@pnpm/installing.commands 1100.7.3 → 1100.8.0
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/install.d.ts +1 -1
- package/lib/installDeps.d.ts +1 -1
- package/lib/installDeps.js +25 -2
- package/package.json +37 -37
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' | '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' | 'pnprServer' | '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' | 'optimisticRepeatInstall' | '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' | 'pnprServer' | '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/installDeps.d.ts
CHANGED
|
@@ -48,5 +48,5 @@ export type InstallDepsOptions = Pick<Config, 'autoInstallPeers' | 'bail' | 'bin
|
|
|
48
48
|
* subcommand — see `runPacquet.ts`'s `noRuntime` opt.
|
|
49
49
|
*/
|
|
50
50
|
isInstallCommand?: boolean;
|
|
51
|
-
} & Partial<Pick<Config, 'pnpmHomeDir' | 'strictDepBuilds'>>;
|
|
51
|
+
} & Partial<Pick<Config, 'pnpmHomeDir' | 'strictDepBuilds' | 'useLockfile' | 'useGitBranchLockfile'>>;
|
|
52
52
|
export declare function installDeps(opts: InstallDepsOptions, params: string[]): Promise<void>;
|
package/lib/installDeps.js
CHANGED
|
@@ -5,6 +5,7 @@ import { checkDepsStatus } from '@pnpm/deps.status';
|
|
|
5
5
|
import { PnpmError } from '@pnpm/error';
|
|
6
6
|
import { arrayOfWorkspacePackagesToMap } from '@pnpm/installing.context';
|
|
7
7
|
import { install, mutateModulesInSingleProject, } from '@pnpm/installing.deps-installer';
|
|
8
|
+
import { writeWantedLockfile } from '@pnpm/lockfile.fs';
|
|
8
9
|
import { globalInfo, logger } from '@pnpm/logger';
|
|
9
10
|
import { applyRuntimeOnFailOverride, filterDependenciesByType } from '@pnpm/pkg-manifest.utils';
|
|
10
11
|
import { createStoreController } from '@pnpm/store.connection-manager';
|
|
@@ -28,11 +29,11 @@ const OVERWRITE_UPDATE_OPTIONS = {
|
|
|
28
29
|
};
|
|
29
30
|
export async function installDeps(opts, params) {
|
|
30
31
|
if (!opts.update && !opts.dedupe && params.length === 0 && opts.optimisticRepeatInstall) {
|
|
31
|
-
const { upToDate } = await checkDepsStatus({
|
|
32
|
+
const { upToDate, wantedLockfileToRestore } = await checkDepsStatus({
|
|
32
33
|
...opts,
|
|
33
34
|
ignoreFilteredInstallCache: true,
|
|
34
35
|
});
|
|
35
|
-
if (upToDate) {
|
|
36
|
+
if (upToDate && await restoreWantedLockfileIfMissing(wantedLockfileToRestore, opts)) {
|
|
36
37
|
if (opts.hooks?.customResolvers?.some(r => r.shouldRefreshResolution)) {
|
|
37
38
|
logger.warn({
|
|
38
39
|
message: 'shouldRefreshResolution hooks were skipped because optimisticRepeatInstall is enabled.',
|
|
@@ -416,4 +417,26 @@ function preferNonvulnerablePackageVersions(packageVulnerabilityAudit) {
|
|
|
416
417
|
}
|
|
417
418
|
return preferredVersions;
|
|
418
419
|
}
|
|
420
|
+
/**
|
|
421
|
+
* Restore a missing `pnpm-lock.yaml` from the current lockfile before the
|
|
422
|
+
* optimistic repeat-install short-circuit reports "Already up to date", so
|
|
423
|
+
* the fast path leaves the same on-disk contract a full install would.
|
|
424
|
+
* Returns `true` when the short-circuit may proceed: nothing to restore,
|
|
425
|
+
* lockfile writing is disabled (`useLockfile: false`), or the restore
|
|
426
|
+
* succeeded. A failed write returns `false` so the caller falls through to
|
|
427
|
+
* the full install instead of reporting up to date while `pnpm-lock.yaml`
|
|
428
|
+
* stays missing.
|
|
429
|
+
*/
|
|
430
|
+
async function restoreWantedLockfileIfMissing(wantedLockfileToRestore, opts) {
|
|
431
|
+
if (wantedLockfileToRestore == null || opts.useLockfile === false)
|
|
432
|
+
return true;
|
|
433
|
+
try {
|
|
434
|
+
await writeWantedLockfile(wantedLockfileToRestore.lockfileDir, wantedLockfileToRestore.lockfile);
|
|
435
|
+
return true;
|
|
436
|
+
}
|
|
437
|
+
catch (error) {
|
|
438
|
+
logger.debug({ msg: 'Failed to restore pnpm-lock.yaml from the current lockfile', error });
|
|
439
|
+
return false;
|
|
440
|
+
}
|
|
441
|
+
}
|
|
419
442
|
//# sourceMappingURL=installDeps.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnpm/installing.commands",
|
|
3
|
-
"version": "1100.
|
|
3
|
+
"version": "1100.8.0",
|
|
4
4
|
"description": "Commands for installation",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pnpm",
|
|
@@ -47,51 +47,51 @@
|
|
|
47
47
|
"ramda": "npm:@pnpm/ramda@0.28.1",
|
|
48
48
|
"render-help": "^2.0.0",
|
|
49
49
|
"version-selector-type": "^3.0.0",
|
|
50
|
-
"@pnpm/building.
|
|
50
|
+
"@pnpm/building.after-install": "1101.0.21",
|
|
51
51
|
"@pnpm/cli.command": "1100.0.1",
|
|
52
52
|
"@pnpm/catalogs.types": "1100.0.0",
|
|
53
53
|
"@pnpm/cli.common-cli-options-help": "1100.0.2",
|
|
54
|
-
"@pnpm/cli.utils": "1101.0.10",
|
|
55
54
|
"@pnpm/config.matcher": "1100.0.1",
|
|
55
|
+
"@pnpm/cli.utils": "1101.0.11",
|
|
56
56
|
"@pnpm/config.pick-registry-for-package": "1100.0.8",
|
|
57
|
-
"@pnpm/config.writer": "1100.0.12",
|
|
58
57
|
"@pnpm/constants": "1100.0.0",
|
|
59
|
-
"@pnpm/config.reader": "1101.
|
|
60
|
-
"@pnpm/deps.inspection.outdated": "1100.1.
|
|
61
|
-
"@pnpm/
|
|
58
|
+
"@pnpm/config.reader": "1101.8.0",
|
|
59
|
+
"@pnpm/deps.inspection.outdated": "1100.1.7",
|
|
60
|
+
"@pnpm/config.writer": "1100.0.12",
|
|
62
61
|
"@pnpm/deps.path": "1100.0.7",
|
|
63
|
-
"@pnpm/deps.
|
|
62
|
+
"@pnpm/deps.status": "1100.1.0",
|
|
64
63
|
"@pnpm/error": "1100.0.0",
|
|
64
|
+
"@pnpm/deps.security.signatures": "1101.2.1",
|
|
65
65
|
"@pnpm/fs.graceful-fs": "1100.1.0",
|
|
66
66
|
"@pnpm/fs.read-modules-dir": "1100.0.1",
|
|
67
|
-
"@pnpm/
|
|
68
|
-
"@pnpm/
|
|
69
|
-
"@pnpm/installing.context": "1100.0.16",
|
|
67
|
+
"@pnpm/hooks.pnpmfile": "1100.0.14",
|
|
68
|
+
"@pnpm/installing.context": "1100.0.17",
|
|
70
69
|
"@pnpm/installing.dedupe.check": "1100.0.10",
|
|
71
|
-
"@pnpm/
|
|
72
|
-
"@pnpm/installing.
|
|
70
|
+
"@pnpm/global.commands": "1100.0.27",
|
|
71
|
+
"@pnpm/installing.env-installer": "1101.1.8",
|
|
73
72
|
"@pnpm/lockfile.fs": "1100.1.4",
|
|
74
|
-
"@pnpm/
|
|
75
|
-
"@pnpm/
|
|
76
|
-
"@pnpm/
|
|
77
|
-
"@pnpm/
|
|
78
|
-
"@pnpm/
|
|
73
|
+
"@pnpm/network.fetch": "1100.1.2",
|
|
74
|
+
"@pnpm/pkg-manifest.reader": "1100.0.7",
|
|
75
|
+
"@pnpm/pkg-manifest.utils": "1100.2.4",
|
|
76
|
+
"@pnpm/resolving.npm-resolver": "1101.5.2",
|
|
77
|
+
"@pnpm/installing.deps-installer": "1101.9.0",
|
|
79
78
|
"@pnpm/resolving.parse-wanted-dependency": "1100.0.1",
|
|
80
|
-
"@pnpm/pkg-manifest.utils": "1100.2.3",
|
|
81
79
|
"@pnpm/resolving.resolver-base": "1100.4.1",
|
|
82
|
-
"@pnpm/store.
|
|
80
|
+
"@pnpm/store.connection-manager": "1100.2.8",
|
|
81
|
+
"@pnpm/network.auth-header": "1101.1.1",
|
|
82
|
+
"@pnpm/store.controller": "1101.0.13",
|
|
83
83
|
"@pnpm/types": "1101.3.1",
|
|
84
|
-
"@pnpm/
|
|
85
|
-
"@pnpm/workspace.project-manifest-reader": "1100.0.11",
|
|
86
|
-
"@pnpm/workspace.projects-filter": "1100.0.19",
|
|
84
|
+
"@pnpm/workspace.project-manifest-reader": "1100.0.12",
|
|
87
85
|
"@pnpm/workspace.project-manifest-writer": "1100.0.7",
|
|
88
|
-
"@pnpm/workspace.projects-
|
|
86
|
+
"@pnpm/workspace.projects-graph": "1100.0.17",
|
|
87
|
+
"@pnpm/workspace.projects-reader": "1101.0.11",
|
|
89
88
|
"@pnpm/workspace.projects-sorter": "1100.0.6",
|
|
90
|
-
"@pnpm/workspace.projects-graph": "1100.0.16",
|
|
91
|
-
"@pnpm/workspace.state": "1100.0.20",
|
|
92
|
-
"@pnpm/workspace.workspace-manifest-writer": "1100.0.12",
|
|
93
89
|
"@pnpm/workspace.root-finder": "1100.0.1",
|
|
94
|
-
"@pnpm/
|
|
90
|
+
"@pnpm/workspace.state": "1100.0.21",
|
|
91
|
+
"@pnpm/workspace.workspace-manifest-writer": "1100.0.12",
|
|
92
|
+
"@pnpm/workspace.projects-filter": "1100.0.20",
|
|
93
|
+
"@pnpm/building.policy": "1100.0.9",
|
|
94
|
+
"@pnpm/lockfile.types": "1100.0.10"
|
|
95
95
|
},
|
|
96
96
|
"peerDependencies": {
|
|
97
97
|
"@pnpm/logger": "^1001.0.1"
|
|
@@ -113,19 +113,19 @@
|
|
|
113
113
|
"write-json-file": "^7.0.0",
|
|
114
114
|
"write-package": "7.2.0",
|
|
115
115
|
"write-yaml-file": "^6.0.0",
|
|
116
|
-
"@pnpm/
|
|
117
|
-
"@pnpm/installing.
|
|
116
|
+
"@pnpm/assert-project": "1100.0.15",
|
|
117
|
+
"@pnpm/installing.commands": "1100.8.0",
|
|
118
118
|
"@pnpm/logger": "1100.0.0",
|
|
119
|
-
"@pnpm/
|
|
120
|
-
"@pnpm/assert-project": "1100.0.14",
|
|
119
|
+
"@pnpm/installing.modules-yaml": "1100.0.8",
|
|
121
120
|
"@pnpm/store.index": "1100.1.0",
|
|
121
|
+
"@pnpm/prepare": "1100.0.15",
|
|
122
122
|
"@pnpm/test-fixtures": "1100.0.0",
|
|
123
|
-
"@pnpm/testing.command-defaults": "1100.0.4",
|
|
124
|
-
"@pnpm/testing.registry-mock": "1100.0.4",
|
|
125
|
-
"@pnpm/testing.mock-agent": "1101.0.1",
|
|
126
123
|
"@pnpm/test-ipc-server": "1100.0.0",
|
|
127
|
-
"@pnpm/
|
|
128
|
-
"@pnpm/
|
|
124
|
+
"@pnpm/testing.mock-agent": "1101.0.2",
|
|
125
|
+
"@pnpm/testing.command-defaults": "1100.0.5",
|
|
126
|
+
"@pnpm/worker": "1100.1.11",
|
|
127
|
+
"@pnpm/workspace.projects-filter": "1100.0.20",
|
|
128
|
+
"@pnpm/testing.registry-mock": "1100.0.5"
|
|
129
129
|
},
|
|
130
130
|
"engines": {
|
|
131
131
|
"node": ">=22.13"
|