mirror of
https://github.com/pnpm/pnpm.git
synced 2026-01-12 00:48:21 -05:00
6
.changeset/nice-apes-protect.md
Normal file
6
.changeset/nice-apes-protect.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@pnpm/plugin-commands-script-runners": patch
|
||||
"pnpm": patch
|
||||
---
|
||||
|
||||
Set `reporter-hide-prefix` to `true` by default for `pnpm exec`. In order to show prefix, the user now has to explicitly set `reporter-hide-prefix=false` [#8174](https://github.com/pnpm/pnpm/issues/8174).
|
||||
@@ -186,7 +186,7 @@ export async function handler (
|
||||
'./node_modules/.bin',
|
||||
...opts.extraBinPaths,
|
||||
]
|
||||
const reporterShowPrefix = opts.recursive && !opts.reporterHidePrefix
|
||||
const reporterShowPrefix = opts.recursive && opts.reporterHidePrefix === false
|
||||
for (const chunk of chunks) {
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
await Promise.all(chunk.map(async (prefix: string) =>
|
||||
|
||||
@@ -21,7 +21,7 @@ afterEach(() => {
|
||||
(lifecycleLogger.debug as jest.Mock).mockClear()
|
||||
})
|
||||
|
||||
test('pnpm exec --recursive prints prefixes', async () => {
|
||||
test('pnpm exec --recursive --no-reporter-hide-prefix prints prefixes', async () => {
|
||||
preparePackages([
|
||||
{
|
||||
location: 'packages/foo',
|
||||
@@ -51,6 +51,7 @@ test('pnpm exec --recursive prints prefixes', async () => {
|
||||
dir: process.cwd(),
|
||||
recursive: true,
|
||||
bail: true,
|
||||
reporterHidePrefix: false,
|
||||
selectedProjectsGraph,
|
||||
}, [process.execPath, scriptFile])
|
||||
|
||||
@@ -119,3 +120,39 @@ test('pnpm exec --recursive --reporter-hide-prefix does not print prefixes', asy
|
||||
|
||||
expect(lifecycleLogger.debug).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
test('pnpm exec --recursive does not print prefixes by default', async () => {
|
||||
preparePackages([
|
||||
{
|
||||
location: 'packages/foo',
|
||||
package: { name: 'foo' },
|
||||
},
|
||||
{
|
||||
location: 'packages/bar',
|
||||
package: { name: 'bar' },
|
||||
},
|
||||
])
|
||||
|
||||
await writeYamlFile('pnpm-workspace.yaml', {
|
||||
packages: ['packages/*'],
|
||||
})
|
||||
|
||||
const { selectedProjectsGraph } = await readProjects(process.cwd(), [])
|
||||
|
||||
const scriptFile = path.resolve('script.js')
|
||||
fs.writeFileSync(scriptFile, `
|
||||
console.log('hello from stdout')
|
||||
console.error('hello from stderr')
|
||||
console.log('name is ' + require(require('path').resolve('package.json')).name)
|
||||
`)
|
||||
|
||||
await exec.handler({
|
||||
...DEFAULT_OPTS,
|
||||
dir: process.cwd(),
|
||||
recursive: true,
|
||||
bail: true,
|
||||
selectedProjectsGraph,
|
||||
}, [process.execPath, scriptFile])
|
||||
|
||||
expect(lifecycleLogger.debug).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user