@pnpm/installing.commands 1100.6.0 → 1100.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/add.js CHANGED
@@ -37,6 +37,7 @@ export function rcOptionsTypes() {
37
37
  'global',
38
38
  'hoist',
39
39
  'hoist-pattern',
40
+ 'hoisting-limits',
40
41
  'https-proxy',
41
42
  'ignore-pnpmfile',
42
43
  'ignore-scripts',
package/lib/install.d.ts CHANGED
@@ -7,7 +7,7 @@ export declare const shorthands: Record<string, string>;
7
7
  export declare const commandNames: string[];
8
8
  export declare const recursiveByDefault = true;
9
9
  export declare function help(): string;
10
- export type InstallCommandOptions = Pick<Config, 'autoInstallPeers' | 'bail' | 'bin' | 'catalogs' | 'configDependencies' | 'dedupeInjectedDeps' | 'dedupeDirectDeps' | 'dedupePeerDependents' | 'dedupePeers' | 'deployAllFiles' | 'depth' | 'dev' | 'enableGlobalVirtualStore' | 'engineStrict' | 'excludeLinksFromLockfile' | 'frozenLockfile' | 'global' | 'globalPnpmfile' | 'hoistPattern' | 'publicHoistPattern' | 'ignorePnpmfile' | 'ignoreScripts' | 'injectWorkspacePackages' | 'linkWorkspacePackages' | 'lockfileDir' | 'lockfileOnly' | 'modulesDir' | 'nodeLinker' | 'patchedDependencies' | 'preferFrozenLockfile' | 'preferWorkspacePackages' | 'production' | 'registries' | 'save' | 'saveDev' | 'saveExact' | 'saveOptional' | 'savePeer' | 'savePrefix' | 'saveProd' | 'saveCatalogName' | 'saveWorkspaceProtocol' | 'lockfileIncludeTarballUrl' | 'sideEffectsCache' | 'sideEffectsCacheReadonly' | 'sort' | 'sharedWorkspaceLockfile' | 'tag' | 'trustLockfile' | 'allowBuilds' | 'optional' | 'virtualStoreDir' | 'workspaceConcurrency' | 'workspaceDir' | 'workspacePackagePatterns' | 'extraEnv' | 'resolutionMode' | 'ignoreWorkspaceCycles' | 'disallowWorkspaceCycles' | 'updateConfig' | 'overrides' | 'packageExtensions' | 'agent' | 'supportedArchitectures' | 'packageConfigs'> & Pick<ConfigContext, 'allProjects' | 'cliOptions' | 'hooks' | 'rootProjectManifest' | 'rootProjectManifestDir' | 'allProjectsGraph' | 'selectedProjectsGraph'> & CreateStoreControllerOptions & Partial<Pick<Config, 'globalPkgDir'>> & {
10
+ export type InstallCommandOptions = Pick<Config, 'autoInstallPeers' | 'bail' | 'bin' | 'catalogs' | 'configDependencies' | 'dedupeInjectedDeps' | 'dedupeDirectDeps' | 'dedupePeerDependents' | 'dedupePeers' | 'deployAllFiles' | 'depth' | 'dev' | 'enableGlobalVirtualStore' | 'engineStrict' | 'excludeLinksFromLockfile' | 'frozenLockfile' | 'global' | 'globalPnpmfile' | 'hoistPattern' | 'hoistingLimits' | 'publicHoistPattern' | 'ignorePnpmfile' | 'ignoreScripts' | 'injectWorkspacePackages' | 'linkWorkspacePackages' | 'lockfileDir' | 'lockfileOnly' | 'modulesDir' | 'nodeLinker' | 'patchedDependencies' | 'preferFrozenLockfile' | 'preferWorkspacePackages' | 'production' | 'registries' | 'save' | 'saveDev' | 'saveExact' | 'saveOptional' | 'savePeer' | 'savePrefix' | 'saveProd' | 'saveCatalogName' | 'saveWorkspaceProtocol' | 'lockfileIncludeTarballUrl' | 'sideEffectsCache' | 'sideEffectsCacheReadonly' | 'sort' | 'sharedWorkspaceLockfile' | 'tag' | 'trustLockfile' | 'allowBuilds' | 'optional' | 'virtualStoreDir' | 'workspaceConcurrency' | 'workspaceDir' | 'workspacePackagePatterns' | 'extraEnv' | 'resolutionMode' | 'ignoreWorkspaceCycles' | 'disallowWorkspaceCycles' | 'updateConfig' | 'overrides' | 'packageExtensions' | 'agent' | 'supportedArchitectures' | 'packageConfigs'> & Pick<ConfigContext, 'allProjects' | 'cliOptions' | 'hooks' | 'rootProjectManifest' | 'rootProjectManifestDir' | 'allProjectsGraph' | 'selectedProjectsGraph'> & CreateStoreControllerOptions & Partial<Pick<Config, 'globalPkgDir'>> & {
11
11
  argv: {
12
12
  cooked?: string[];
13
13
  original: string[];
package/lib/install.js CHANGED
@@ -26,6 +26,7 @@ export function rcOptionsTypes() {
26
26
  'global',
27
27
  'hoist',
28
28
  'hoist-pattern',
29
+ 'hoisting-limits',
29
30
  'https-proxy',
30
31
  'ignore-pnpmfile',
31
32
  'ignore-scripts',
@@ -1,8 +1,8 @@
1
+ import { confirm } from '@inquirer/prompts';
1
2
  import { PnpmError } from '@pnpm/error';
2
3
  import { globalInfo } from '@pnpm/logger';
3
4
  import { MINIMUM_RELEASE_AGE_VIOLATION_CODE } from '@pnpm/resolving.npm-resolver';
4
5
  import { isCI } from 'ci-info';
5
- import enquirer from 'enquirer';
6
6
  /**
7
7
  * Composes the per-policy handlers the install command needs for the
8
8
  * current opts. Returns `undefined` only when no handler reports
@@ -146,13 +146,19 @@ async function promptForApproval(immature) {
146
146
  const message = `${sorted.length} ${sorted.length === 1 ? 'version does' : 'versions do'} not meet the minimumReleaseAge constraint:\n` +
147
147
  sorted.map((v) => ` ${v.name}@${v.version}`).join('\n') + '\n' +
148
148
  'Add to minimumReleaseAgeExclude in pnpm-workspace.yaml and proceed with the install?';
149
- const answer = await enquirer.prompt({
150
- type: 'confirm',
151
- name: 'confirmed',
152
- message,
153
- initial: false,
154
- });
155
- if (!answer.confirmed) {
149
+ let confirmed;
150
+ try {
151
+ confirmed = await confirm({ message, default: false });
152
+ }
153
+ catch (err) {
154
+ if (err instanceof Error && err.name === 'ExitPromptError') {
155
+ confirmed = false;
156
+ }
157
+ else {
158
+ throw err;
159
+ }
160
+ }
161
+ if (!confirmed) {
156
162
  throw new PnpmError('MINIMUM_RELEASE_AGE_DENIED', 'Aborted: the immature versions were not approved.', {
157
163
  hint: 'Re-run the install without `minimumReleaseAgeStrict: true` to allow these versions, ' +
158
164
  'or wait for the packages to mature past the configured cutoff.',
@@ -6,7 +6,7 @@ import type { ResolutionVerifier } from '@pnpm/resolving.resolver-base';
6
6
  import { type CreateStoreControllerOptions } from '@pnpm/store.connection-manager';
7
7
  import type { StoreController } from '@pnpm/store.controller';
8
8
  import type { IncludedDependencies, Project, ProjectManifest, ProjectsGraph } from '@pnpm/types';
9
- export type RecursiveOptions = CreateStoreControllerOptions & Pick<Config, 'bail' | 'configDependencies' | 'dedupePeerDependents' | 'dedupePeers' | 'depth' | 'globalPnpmfile' | 'hoistPattern' | 'ignorePnpmfile' | 'ignoreScripts' | 'linkWorkspacePackages' | 'lockfileDir' | 'lockfileOnly' | 'modulesDir' | 'agent' | 'allowBuilds' | 'registries' | 'runtime' | 'save' | 'saveCatalogName' | 'saveDev' | 'saveExact' | 'saveOptional' | 'savePeer' | 'savePrefix' | 'saveProd' | 'saveWorkspaceProtocol' | 'lockfileIncludeTarballUrl' | 'sharedWorkspaceLockfile' | 'tag' | 'trustLockfile' | 'cleanupUnusedCatalogs' | 'packageConfigs' | 'updateConfig'> & Pick<ConfigContext, 'hooks' | 'rootProjectManifest' | 'rootProjectManifestDir'> & {
9
+ export type RecursiveOptions = CreateStoreControllerOptions & Pick<Config, 'bail' | 'configDependencies' | 'dedupePeerDependents' | 'dedupePeers' | 'depth' | 'globalPnpmfile' | 'hoistPattern' | 'hoistingLimits' | 'ignorePnpmfile' | 'ignoreScripts' | 'linkWorkspacePackages' | 'lockfileDir' | 'lockfileOnly' | 'modulesDir' | 'agent' | 'allowBuilds' | 'registries' | 'runtime' | 'save' | 'saveCatalogName' | 'saveDev' | 'saveExact' | 'saveOptional' | 'savePeer' | 'savePrefix' | 'saveProd' | 'saveWorkspaceProtocol' | 'lockfileIncludeTarballUrl' | 'sharedWorkspaceLockfile' | 'tag' | 'trustLockfile' | 'cleanupUnusedCatalogs' | 'packageConfigs' | 'updateConfig'> & Pick<ConfigContext, 'hooks' | 'rootProjectManifest' | 'rootProjectManifestDir'> & {
10
10
  rebuildHandler?: CommandHandler;
11
11
  include?: IncludedDependencies;
12
12
  includeDirect?: IncludedDependencies;
@@ -2,6 +2,7 @@ import type { OutdatedPackage } from '@pnpm/deps.inspection.outdated';
2
2
  export interface ChoiceRow {
3
3
  name: string;
4
4
  value: string;
5
+ message: string;
5
6
  disabled?: boolean;
6
7
  }
7
8
  type ChoiceGroup = Array<{
@@ -48,6 +48,7 @@ export function getUpdateChoices(outdatedPkgsOfProjects, workspacesEnabled) {
48
48
  if (i === 0) {
49
49
  return {
50
50
  name: renderedTable[i],
51
+ message: renderedTable[i],
51
52
  value: '',
52
53
  disabled: true,
53
54
  hint: '',
@@ -1,5 +1,6 @@
1
+ import { checkbox, Separator } from '@inquirer/prompts';
1
2
  import { FILTERING, OPTIONS, UNIVERSAL_OPTIONS } from '@pnpm/cli.common-cli-options-help';
2
- import { docsUrl, readDepNameCompletions, readProjectManifestOnly, } from '@pnpm/cli.utils';
3
+ import { docsUrl, interactivePromptPageSize, readDepNameCompletions, readProjectManifestOnly, } from '@pnpm/cli.utils';
3
4
  import { createMatcher } from '@pnpm/config.matcher';
4
5
  import { types as allTypes } from '@pnpm/config.reader';
5
6
  import { outdatedDepsOfProjects } from '@pnpm/deps.inspection.outdated';
@@ -7,8 +8,7 @@ import { PnpmError } from '@pnpm/error';
7
8
  import { handleGlobalUpdate } from '@pnpm/global.commands';
8
9
  import { globalInfo } from '@pnpm/logger';
9
10
  import chalk from 'chalk';
10
- import enquirer from 'enquirer';
11
- import { pick, pluck, unnest } from 'ramda';
11
+ import { pick, unnest } from 'ramda';
12
12
  import { renderHelp } from 'render-help';
13
13
  import { installDeps } from '../installDeps.js';
14
14
  import { parseUpdateParam } from '../recursive.js';
@@ -187,69 +187,61 @@ async function interactiveUpdate(input, opts, rebuildHandler) {
187
187
  timeout: opts.fetchTimeout,
188
188
  });
189
189
  const workspacesEnabled = !!opts.workspaceDir;
190
- const choices = getUpdateChoices(unnest(outdatedPkgsOfProjects), workspacesEnabled);
191
- if (choices.length === 0) {
190
+ const choiceGroups = getUpdateChoices(unnest(outdatedPkgsOfProjects), workspacesEnabled);
191
+ if (choiceGroups.length === 0) {
192
192
  if (opts.latest) {
193
193
  return 'All of your dependencies are already up to date';
194
194
  }
195
195
  return 'All of your dependencies are already up to date inside the specified ranges. Use the --latest option to update the ranges in package.json';
196
196
  }
197
- const { updateDependencies } = await enquirer.prompt({
198
- choices,
199
- footer: '\nEnter to start updating. Ctrl-c to cancel.',
200
- indicator(state, choice) {
201
- return ` ${choice.enabled ? '●' : '○'}`;
202
- },
203
- message: 'Choose which packages to update ' +
204
- `(Press ${chalk.cyan('<space>')} to select, ` +
205
- `${chalk.cyan('<a>')} to toggle all, ` +
206
- `${chalk.cyan('<i>')} to invert selection)`,
207
- name: 'updateDependencies',
208
- pointer: '❯',
209
- result() {
210
- return this.selected;
211
- },
212
- format() {
213
- if (!this.state.submitted || this.state.cancelled)
214
- return '';
215
- if (Array.isArray(this.selected)) {
216
- return this.selected
217
- // The custom format function is used to filter out "[dependencies]" or "[devDependencies]" from the output.
218
- // https://github.com/enquirer/enquirer/blob/master/lib/prompts/select.js#L98
219
- .filter((choice) => !/^\[.+\]$/.test(choice.name))
220
- .map((choice) => this.styles.primary(choice.name)).join(', ');
197
+ const flatChoices = [];
198
+ for (const group of choiceGroups) {
199
+ flatChoices.push(new Separator(chalk.bold(`── ${group.message} ──`)));
200
+ for (const choice of group.choices) {
201
+ if (choice.disabled) {
202
+ flatChoices.push(new Separator(` ${choice.message ?? choice.name}`));
221
203
  }
222
- return this.styles.primary(this.selected.name);
223
- },
224
- styles: {
225
- dark: chalk.reset,
226
- em: chalk.bgBlack.whiteBright,
227
- success: chalk.reset,
228
- },
229
- type: 'multiselect',
230
- validate(value) {
231
- if (value.length === 0) {
232
- return 'You must choose at least one package.';
204
+ else {
205
+ flatChoices.push({
206
+ name: choice.message,
207
+ value: choice.value,
208
+ });
233
209
  }
234
- return true;
235
- },
236
- // For Vim users (related: https://github.com/enquirer/enquirer/pull/163)
237
- j() {
238
- return this.down();
239
- },
240
- k() {
241
- return this.up();
242
- },
243
- cancel() {
244
- // By default, canceling the prompt via Ctrl+c throws an empty string.
245
- // The custom cancel function prevents that behavior.
246
- // Otherwise, pnpm CLI would print an error and confuse users.
247
- // See related issue: https://github.com/enquirer/enquirer/issues/225
210
+ }
211
+ }
212
+ const message = 'Choose which packages to update ' +
213
+ `(Press ${chalk.cyan('<space>')} to select, ` +
214
+ `${chalk.cyan('<a>')} to toggle all, ` +
215
+ `${chalk.cyan('<i>')} to invert selection)\n\nEnter to start updating. Ctrl-c to cancel.`;
216
+ let updatePkgNames;
217
+ try {
218
+ updatePkgNames = await checkbox({
219
+ choices: flatChoices,
220
+ pageSize: interactivePromptPageSize(),
221
+ message,
222
+ required: true,
223
+ validate: (values) => {
224
+ if (values.length === 0) {
225
+ return 'You must choose at least one package.';
226
+ }
227
+ return true;
228
+ },
229
+ theme: {
230
+ icon: { checked: '●', unchecked: '○', cursor: '❯' },
231
+ style: {
232
+ highlight: (text) => text,
233
+ },
234
+ keybindings: ['vim'],
235
+ },
236
+ });
237
+ }
238
+ catch (err) {
239
+ if (err instanceof Error && err.name === 'ExitPromptError') {
248
240
  globalInfo('Update canceled');
249
241
  process.exit(0);
250
- },
251
- }); // eslint-disable-line @typescript-eslint/no-explicit-any
252
- const updatePkgNames = pluck('value', updateDependencies);
242
+ }
243
+ throw err;
244
+ }
253
245
  return update(updatePkgNames, opts, rebuildHandler);
254
246
  }
255
247
  async function update(dependencies, opts, rebuildHandler) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnpm/installing.commands",
3
- "version": "1100.6.0",
3
+ "version": "1100.7.1",
4
4
  "description": "Commands for installation",
5
5
  "keywords": [
6
6
  "pnpm",
@@ -24,6 +24,7 @@
24
24
  "!*.map"
25
25
  ],
26
26
  "dependencies": {
27
+ "@inquirer/prompts": "^8.4.3",
27
28
  "@pnpm/colorize-semver-diff": "^2.0.0",
28
29
  "@pnpm/semver-diff": "^2.0.0",
29
30
  "@pnpm/util.lex-comparator": "^3.0.2",
@@ -34,7 +35,6 @@
34
35
  "@zkochan/table": "^2.0.1",
35
36
  "chalk": "^5.6.2",
36
37
  "ci-info": "^4.4.0",
37
- "enquirer": "^2.4.1",
38
38
  "get-npm-tarball-url": "^2.1.0",
39
39
  "is-subdir": "^2.0.0",
40
40
  "load-json-file": "^7.0.1",
@@ -44,53 +44,52 @@
44
44
  "ramda": "npm:@pnpm/ramda@0.28.1",
45
45
  "render-help": "^2.0.0",
46
46
  "version-selector-type": "^3.0.0",
47
- "@pnpm/building.after-install": "1101.0.17",
48
- "@pnpm/catalogs.types": "1100.0.0",
47
+ "@pnpm/building.after-install": "1101.0.18",
49
48
  "@pnpm/cli.command": "1100.0.1",
50
- "@pnpm/cli.utils": "1101.0.8",
51
49
  "@pnpm/cli.common-cli-options-help": "1100.0.1",
52
- "@pnpm/config.reader": "1101.4.1",
50
+ "@pnpm/cli.utils": "1101.0.8",
53
51
  "@pnpm/config.matcher": "1100.0.1",
54
52
  "@pnpm/config.pick-registry-for-package": "1100.0.6",
53
+ "@pnpm/config.reader": "1101.5.0",
55
54
  "@pnpm/config.writer": "1100.0.10",
56
55
  "@pnpm/constants": "1100.0.0",
56
+ "@pnpm/deps.inspection.outdated": "1100.1.4",
57
57
  "@pnpm/deps.path": "1100.0.5",
58
- "@pnpm/deps.inspection.outdated": "1100.1.3",
59
- "@pnpm/deps.status": "1100.0.19",
58
+ "@pnpm/deps.status": "1100.0.21",
60
59
  "@pnpm/error": "1100.0.0",
61
60
  "@pnpm/fs.graceful-fs": "1100.1.0",
62
61
  "@pnpm/fs.read-modules-dir": "1100.0.1",
63
- "@pnpm/global.commands": "1100.0.22",
62
+ "@pnpm/global.commands": "1100.0.24",
64
63
  "@pnpm/hooks.pnpmfile": "1100.0.11",
65
- "@pnpm/installing.context": "1100.0.13",
66
- "@pnpm/installing.deps-installer": "1101.5.0",
64
+ "@pnpm/installing.context": "1100.0.14",
67
65
  "@pnpm/installing.dedupe.check": "1100.0.8",
66
+ "@pnpm/installing.deps-installer": "1101.6.1",
67
+ "@pnpm/installing.env-installer": "1101.1.5",
68
68
  "@pnpm/lockfile.types": "1100.0.8",
69
- "@pnpm/pkg-manifest.utils": "1100.2.1",
70
69
  "@pnpm/pkg-manifest.reader": "1100.0.5",
71
- "@pnpm/resolving.npm-resolver": "1101.3.3",
70
+ "@pnpm/pkg-manifest.utils": "1100.2.1",
71
+ "@pnpm/resolving.npm-resolver": "1101.4.0",
72
72
  "@pnpm/resolving.parse-wanted-dependency": "1100.0.1",
73
73
  "@pnpm/resolving.resolver-base": "1100.3.1",
74
- "@pnpm/store.controller": "1101.0.9",
75
- "@pnpm/installing.env-installer": "1101.1.3",
76
- "@pnpm/store.connection-manager": "1100.2.4",
74
+ "@pnpm/store.connection-manager": "1100.2.5",
75
+ "@pnpm/store.controller": "1101.0.10",
77
76
  "@pnpm/types": "1101.2.0",
78
- "@pnpm/workspace.projects-filter": "1100.0.16",
77
+ "@pnpm/workspace.project-manifest-reader": "1100.0.9",
79
78
  "@pnpm/workspace.project-manifest-writer": "1100.0.5",
80
- "@pnpm/workspace.projects-graph": "1100.0.13",
79
+ "@pnpm/workspace.projects-filter": "1100.0.17",
80
+ "@pnpm/workspace.projects-graph": "1100.0.14",
81
81
  "@pnpm/workspace.projects-reader": "1101.0.8",
82
- "@pnpm/workspace.state": "1100.0.16",
83
- "@pnpm/workspace.project-manifest-reader": "1100.0.9",
84
82
  "@pnpm/workspace.projects-sorter": "1100.0.4",
83
+ "@pnpm/workspace.root-finder": "1100.0.1",
84
+ "@pnpm/workspace.state": "1100.0.18",
85
85
  "@pnpm/workspace.workspace-manifest-writer": "1100.0.10",
86
- "@pnpm/workspace.root-finder": "1100.0.1"
86
+ "@pnpm/catalogs.types": "1100.0.0"
87
87
  },
88
88
  "peerDependencies": {
89
89
  "@pnpm/logger": "^1001.0.1"
90
90
  },
91
91
  "devDependencies": {
92
92
  "@jest/globals": "30.3.0",
93
- "@pnpm/registry-mock": "6.0.0",
94
93
  "@types/normalize-path": "^3.0.2",
95
94
  "@types/proxyquire": "^1.3.31",
96
95
  "@types/ramda": "0.31.1",
@@ -106,19 +105,19 @@
106
105
  "write-json-file": "^7.0.0",
107
106
  "write-package": "7.2.0",
108
107
  "write-yaml-file": "^6.0.0",
109
- "@pnpm/assert-project": "1100.0.11",
110
- "@pnpm/installing.commands": "1100.6.0",
108
+ "@pnpm/assert-project": "1100.0.12",
109
+ "@pnpm/installing.commands": "1100.7.1",
111
110
  "@pnpm/installing.modules-yaml": "1100.0.6",
112
111
  "@pnpm/logger": "1100.0.0",
113
- "@pnpm/prepare": "1100.0.11",
112
+ "@pnpm/prepare": "1100.0.12",
114
113
  "@pnpm/store.index": "1100.1.0",
115
114
  "@pnpm/test-fixtures": "1100.0.0",
116
115
  "@pnpm/test-ipc-server": "1100.0.0",
117
- "@pnpm/testing.mock-agent": "1100.0.7",
118
- "@pnpm/testing.registry-mock": "1100.0.1",
119
- "@pnpm/testing.command-defaults": "1100.0.1",
116
+ "@pnpm/testing.command-defaults": "1100.0.2",
117
+ "@pnpm/testing.mock-agent": "1100.0.8",
118
+ "@pnpm/testing.registry-mock": "1100.0.2",
120
119
  "@pnpm/worker": "1100.1.8",
121
- "@pnpm/workspace.projects-filter": "1100.0.16"
120
+ "@pnpm/workspace.projects-filter": "1100.0.17"
122
121
  },
123
122
  "engines": {
124
123
  "node": ">=22.13"