diff --git a/.changeset/yarn-like-run-output.md b/.changeset/yarn-like-run-output.md new file mode 100644 index 0000000000..1af5162f2a --- /dev/null +++ b/.changeset/yarn-like-run-output.md @@ -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). diff --git a/exec/lifecycle/package.json b/exec/lifecycle/package.json index e61c4e25b0..27aa92c057 100644 --- a/exec/lifecycle/package.json +++ b/exec/lifecycle/package.json @@ -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:", diff --git a/exec/lifecycle/src/runLifecycleHook.ts b/exec/lifecycle/src/runLifecycleHook.ts index 09e46475e6..e73f8f096a 100644 --- a/exec/lifecycle/src/runLifecycleHook.ts +++ b/exec/lifecycle/src/runLifecycleHook.ts @@ -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' diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 631aebf4ab..cf499e261e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -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 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 0acc9aeaab..cab38c1efb 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -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