diff --git a/.changeset/update-default-settings.md b/.changeset/update-default-settings.md new file mode 100644 index 0000000000..9b45bd90cc --- /dev/null +++ b/.changeset/update-default-settings.md @@ -0,0 +1,6 @@ +--- +"@pnpm/config": minor +"pnpm": minor +--- + +Changed default values: `optimisticRepeatInstall` is now `true` and `verifyDepsBeforeRun` is now `install`. diff --git a/config/config/src/index.ts b/config/config/src/index.ts index 147267f208..ab16544828 100644 --- a/config/config/src/index.ts +++ b/config/config/src/index.ts @@ -184,7 +184,7 @@ export async function getConfig (opts: { 'hoist-workspace-packages': true, 'ignore-workspace-cycles': false, 'ignore-workspace-root-check': false, - 'optimistic-repeat-install': false, + 'optimistic-repeat-install': true, optional: true, 'init-package-manager': true, 'init-type': 'module', @@ -222,7 +222,7 @@ export async function getConfig (opts: { 'unsafe-perm': npmDefaults['unsafe-perm'], 'use-beta-cli': false, userconfig: npmDefaults.userconfig, - 'verify-deps-before-run': false, + 'verify-deps-before-run': 'install', 'verify-store-integrity': true, 'workspace-concurrency': getDefaultWorkspaceConcurrency(), 'workspace-prefix': opts.workspaceDir, diff --git a/pnpm/test/install/lifecycleScripts.ts b/pnpm/test/install/lifecycleScripts.ts index 9ed45b9194..96a9c9050a 100644 --- a/pnpm/test/install/lifecycleScripts.ts +++ b/pnpm/test/install/lifecycleScripts.ts @@ -240,7 +240,7 @@ test('the list of ignored builds is preserved after a repeat install', async () const project = prepare({}) execPnpmSync(['add', '@pnpm.e2e/pre-and-postinstall-scripts-example@1.0.0', 'esbuild@0.25.0', '--config.optimistic-repeat-install=false']) - const result = execPnpmSync(['install']) + const result = execPnpmSync(['install', '--config.optimistic-repeat-install=false']) // The warning is printed on repeat install too expect(result.stdout.toString()).toContain('Ignored build scripts:') diff --git a/pnpm/test/install/yesFlag.ts b/pnpm/test/install/yesFlag.ts index 3df45618e3..7538659fd5 100644 --- a/pnpm/test/install/yesFlag.ts +++ b/pnpm/test/install/yesFlag.ts @@ -23,10 +23,10 @@ describe('pnpm install --yes', () => { } test('prompts without --yes flag', () => { - expect(() => execPnpmSync(['install'], execPnpmOpts)).toThrow('Aborted removal of modules directory due to no TTY') + expect(() => execPnpmSync(['install', '--config.optimistic-repeat-install=false'], execPnpmOpts)).toThrow('Aborted removal of modules directory due to no TTY') }) test('skips prompt when --yes is passed', () => { - expect(() => execPnpmSync(['install', '--yes'], execPnpmOpts)).not.toThrow() + expect(() => execPnpmSync(['install', '--yes', '--config.optimistic-repeat-install=false'], execPnpmOpts)).not.toThrow() }) }) diff --git a/pnpm/test/monorepo/index.ts b/pnpm/test/monorepo/index.ts index 53b43c2ffd..442cc046ce 100644 --- a/pnpm/test/monorepo/index.ts +++ b/pnpm/test/monorepo/index.ts @@ -1724,6 +1724,7 @@ test('run --stream should prefix with dir name', async () => { const result = execPnpmSync([ '--stream', + '--config.verify-deps-before-run=false', '--filter', 'alfa', '--filter', @@ -1749,6 +1750,7 @@ packages/beta test: OK` ) const singleResult = execPnpmSync([ '--stream', + '--config.verify-deps-before-run=false', '--filter', 'alfa', 'run', @@ -1805,6 +1807,7 @@ test('run --reporter-hide-prefix should hide prefix', async () => { const result = execPnpmSync([ '--stream', '--reporter-hide-prefix', + '--config.verify-deps-before-run=false', '--filter', 'alfa', '--filter', @@ -1831,6 +1834,7 @@ packages/beta test: Done` const singleResult = execPnpmSync([ '--stream', '--reporter-hide-prefix', + '--config.verify-deps-before-run=false', '--filter', 'alfa', 'run', diff --git a/pnpm/test/run.ts b/pnpm/test/run.ts index 2c6be9ff34..f6e10a87c1 100644 --- a/pnpm/test/run.ts +++ b/pnpm/test/run.ts @@ -20,7 +20,7 @@ test('run -r: pass the args to the command that is specified in the build script fs.writeFileSync('project/args.json', '[]', 'utf8') fs.writeFileSync('project/recordArgs.js', RECORD_ARGS_FILE, 'utf8') - await execPnpm(['run', '-r', '--config.enable-pre-post-scripts', 'foo', 'arg', '--flag=true']) + await execPnpm(['run', '-r', '--config.enable-pre-post-scripts', '--config.verify-deps-before-run=false', 'foo', 'arg', '--flag=true']) const { default: args } = await import(path.resolve('project/args.json')) expect(args).toStrictEqual([ @@ -95,7 +95,7 @@ test('recursive test: pass the args to the command that is specified in the buil }, }]) - const result = execPnpmSync(['-r', 'test', 'arg', '--flag=true']) + const result = execPnpmSync(['--config.verify-deps-before-run=false', '-r', 'test', 'arg', '--flag=true']) expect((result.stdout as Buffer).toString('utf8')).toMatch( process.platform === 'win32' ? /ts-node test "arg" "--flag=true"/ : /ts-node test arg --flag=true/ @@ -132,7 +132,7 @@ test('silent run only prints the output of the child process', async () => { }, }) - const result = execPnpmSync(['run', '--silent', 'hi']) + const result = execPnpmSync(['run', '--silent', '--config.verify-deps-before-run=false', 'hi']) expect(result.stdout.toString().trim()).toBe('hi') })