mirror of
https://github.com/pnpm/pnpm.git
synced 2026-04-27 18:46:18 -04:00
feat!: use cleaner output for script execution (#11132)
* feat: use yarn-like output for script execution Print `$ command` instead of `> pkg@version stage path\n> command`. Show project name and path only when running in a different directory. * fix: sort chalk dependency after @pnpm packages * refactor: remove project info line from run output * chore: add changeset * refactor: print script command line to stderr The `$ command` line is metadata, not program output. Printing it to stderr keeps stdout clean for piping, matching bun's behavior. * chore: update changeset to major
This commit is contained in:
6
.changeset/yarn-like-run-output.md
Normal file
6
.changeset/yarn-like-run-output.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@pnpm/exec.lifecycle": major
|
||||
"pnpm": major
|
||||
---
|
||||
|
||||
Changed the output of script execution. Print `$ command` (dimmed, to stderr) instead of `> pkg@version stage path` and `> command` (to stdout).
|
||||
@@ -43,6 +43,7 @@
|
||||
"@pnpm/store.cafs-types": "workspace:*",
|
||||
"@pnpm/store.controller-types": "workspace:*",
|
||||
"@pnpm/types": "workspace:*",
|
||||
"chalk": "catalog:",
|
||||
"is-windows": "catalog:",
|
||||
"path-exists": "catalog:",
|
||||
"run-groups": "catalog:",
|
||||
|
||||
@@ -6,6 +6,7 @@ import { PnpmError } from '@pnpm/error'
|
||||
import { globalWarn } from '@pnpm/logger'
|
||||
import { lifecycle } from '@pnpm/npm-lifecycle'
|
||||
import type { DependencyManifest, PackageScripts, ProjectManifest } from '@pnpm/types'
|
||||
import chalk from 'chalk'
|
||||
import isWindows from 'is-windows'
|
||||
import { join as shellQuote } from 'shlex'
|
||||
|
||||
@@ -105,6 +106,8 @@ Please unset the scriptShell option, or configure it to a .exe instead.
|
||||
stage,
|
||||
wd: opts.pkgRoot,
|
||||
})
|
||||
} else if (!opts.silent) {
|
||||
console.error(chalk.dim(`$ ${m.scripts[stage]}`))
|
||||
}
|
||||
const logLevel = (opts.stdio !== 'inherit' || opts.silent)
|
||||
? 'silent'
|
||||
|
||||
15
pnpm-lock.yaml
generated
15
pnpm-lock.yaml
generated
@@ -251,8 +251,8 @@ catalogs:
|
||||
specifier: 3.0.2
|
||||
version: 3.0.2
|
||||
'@pnpm/npm-lifecycle':
|
||||
specifier: 1100.0.0-0
|
||||
version: 1100.0.0-0
|
||||
specifier: 1100.0.0-1
|
||||
version: 1100.0.0-1
|
||||
'@pnpm/npm-package-arg':
|
||||
specifier: ^2.0.0
|
||||
version: 2.0.0
|
||||
@@ -4020,7 +4020,7 @@ importers:
|
||||
version: link:../../fetching/directory-fetcher
|
||||
'@pnpm/npm-lifecycle':
|
||||
specifier: 'catalog:'
|
||||
version: 1100.0.0-0(typanion@3.14.0)
|
||||
version: 1100.0.0-1(typanion@3.14.0)
|
||||
'@pnpm/pkg-manifest.reader':
|
||||
specifier: workspace:*
|
||||
version: link:../../pkg-manifest/reader
|
||||
@@ -4033,6 +4033,9 @@ importers:
|
||||
'@pnpm/types':
|
||||
specifier: workspace:*
|
||||
version: link:../../core/types
|
||||
chalk:
|
||||
specifier: 'catalog:'
|
||||
version: 5.6.2
|
||||
is-windows:
|
||||
specifier: 'catalog:'
|
||||
version: 1.0.2
|
||||
@@ -10626,8 +10629,8 @@ packages:
|
||||
resolution: {integrity: sha512-5jW/GNLdZMiw+PJ8FYSvOghoApSjsORNIro2fj8j6NHAqJxJjcHekC5/NsKaawoI5LAkU/XDDVjNC71Yz+uS1w==}
|
||||
engines: {node: '>=18.12'}
|
||||
|
||||
'@pnpm/npm-lifecycle@1100.0.0-0':
|
||||
resolution: {integrity: sha512-FymJ23SU6f3AlgUsK0Bt+0ztIWe3MFkqGbPL86couBb37fH+UNyG6P6IUmOv/lXA4Y2mhqGDTSV0/8mYI08xng==}
|
||||
'@pnpm/npm-lifecycle@1100.0.0-1':
|
||||
resolution: {integrity: sha512-sqXZFikFaJfwY8K+Gg9oPMxxYnJ9O7OkMxXAWNPBUEiZh8XK/DaNFlbNOJ3X8P0WKS5nDE9A6TiOBWrhTrpS+A==}
|
||||
engines: {node: '>=22.13'}
|
||||
|
||||
'@pnpm/npm-package-arg@2.0.0':
|
||||
@@ -18534,7 +18537,7 @@ snapshots:
|
||||
- supports-color
|
||||
- typanion
|
||||
|
||||
'@pnpm/npm-lifecycle@1100.0.0-0(typanion@3.14.0)':
|
||||
'@pnpm/npm-lifecycle@1100.0.0-1(typanion@3.14.0)':
|
||||
dependencies:
|
||||
'@pnpm/byline': 1.0.0
|
||||
'@pnpm/error': 1000.1.0
|
||||
|
||||
@@ -89,7 +89,7 @@ catalog:
|
||||
'@pnpm/network.agent': ^2.0.3
|
||||
'@pnpm/nopt': ^0.3.1
|
||||
'@pnpm/npm-conf': 3.0.2
|
||||
'@pnpm/npm-lifecycle': 1100.0.0-0
|
||||
'@pnpm/npm-lifecycle': 1100.0.0-1
|
||||
'@pnpm/npm-package-arg': ^2.0.0
|
||||
'@pnpm/os.env.path-extender': ^3.0.0
|
||||
'@pnpm/patch-package': 0.0.1
|
||||
|
||||
Reference in New Issue
Block a user