@pnpm/engine.pm.commands 1101.1.11 → 1101.1.13
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.
|
@@ -5,5 +5,5 @@ export declare function cliOptionsTypes(): Record<string, unknown>;
|
|
|
5
5
|
export declare const commandNames: string[];
|
|
6
6
|
export declare const skipPackageManagerCheck = true;
|
|
7
7
|
export declare function help(): string;
|
|
8
|
-
export type SelfUpdateCommandOptions = CreateStoreControllerOptions & Pick<Config, 'globalPkgDir' | 'lockfileDir' | 'modulesDir' | 'pnpmHomeDir'> & Pick<ConfigContext, 'rootProjectManifestDir' | 'wantedPackageManager'>;
|
|
8
|
+
export type SelfUpdateCommandOptions = CreateStoreControllerOptions & Pick<Config, 'globalPkgDir' | 'lockfileDir' | 'minimumReleaseAge' | 'minimumReleaseAgeExclude' | 'minimumReleaseAgeIgnoreMissingTime' | 'minimumReleaseAgeStrict' | 'modulesDir' | 'pnpmHomeDir'> & Pick<ConfigContext, 'rootProjectManifestDir' | 'wantedPackageManager'>;
|
|
9
9
|
export declare function handler(opts: SelfUpdateCommandOptions, params: string[]): Promise<undefined | string>;
|
|
@@ -4,8 +4,9 @@ import { linkBins } from '@pnpm/bins.linker';
|
|
|
4
4
|
import { isExecutedByCorepack, packageManager } from '@pnpm/cli.meta';
|
|
5
5
|
import { docsUrl } from '@pnpm/cli.utils';
|
|
6
6
|
import { parsePackageManager, types as allTypes } from '@pnpm/config.reader';
|
|
7
|
+
import { getPublishedByPolicy } from '@pnpm/config.version-policy';
|
|
7
8
|
import { PnpmError } from '@pnpm/error';
|
|
8
|
-
import { createResolver } from '@pnpm/installing.client';
|
|
9
|
+
import { createResolver, makeResolutionStrict } from '@pnpm/installing.client';
|
|
9
10
|
import { resolvePackageManagerIntegrities } from '@pnpm/installing.env-installer';
|
|
10
11
|
import { readEnvLockfile } from '@pnpm/lockfile.fs';
|
|
11
12
|
import { globalInfo, globalWarn } from '@pnpm/logger';
|
|
@@ -51,8 +52,22 @@ export async function handler(opts, params) {
|
|
|
51
52
|
throw new PnpmError('CANT_SELF_UPDATE_IN_COREPACK', 'You should update pnpm with corepack');
|
|
52
53
|
}
|
|
53
54
|
globalInfo('Checking for updates...');
|
|
54
|
-
const { resolve } = createResolver({
|
|
55
|
+
const { resolve: baseResolve } = createResolver({
|
|
56
|
+
...opts,
|
|
57
|
+
configByUri: opts.configByUri,
|
|
58
|
+
ignoreMissingTimeField: opts.minimumReleaseAgeIgnoreMissingTime,
|
|
59
|
+
});
|
|
60
|
+
// self-update has nowhere to "defer to" either — wrap the resolver
|
|
61
|
+
// under any policy that wants to reject violations up-front. Strict
|
|
62
|
+
// minimumReleaseAge keeps self-update from switching to an immature
|
|
63
|
+
// pnpm; `trustPolicy: 'no-downgrade'` keeps it from switching to a
|
|
64
|
+
// pnpm whose trust evidence weakened relative to the installed
|
|
65
|
+
// version.
|
|
66
|
+
const strictResolution = (Boolean(opts.minimumReleaseAge) && opts.minimumReleaseAgeStrict === true) ||
|
|
67
|
+
opts.trustPolicy === 'no-downgrade';
|
|
68
|
+
const resolve = strictResolution ? makeResolutionStrict(baseResolve) : baseResolve;
|
|
55
69
|
const pkgName = 'pnpm';
|
|
70
|
+
const { publishedBy, publishedByExclude } = getPublishedByPolicy(opts);
|
|
56
71
|
// `pnpm self-update` (no args) defaults to the `latest` dist-tag, but we
|
|
57
72
|
// refuse to downgrade in that case — `latest` on the registry can lag the
|
|
58
73
|
// installed version when a new major has shipped without being tagged.
|
|
@@ -64,6 +79,8 @@ export async function handler(opts, params) {
|
|
|
64
79
|
lockfileDir: opts.lockfileDir ?? opts.dir,
|
|
65
80
|
preferredVersions: {},
|
|
66
81
|
projectDir: opts.dir,
|
|
82
|
+
publishedBy,
|
|
83
|
+
publishedByExclude,
|
|
67
84
|
});
|
|
68
85
|
if (!resolution?.manifest) {
|
|
69
86
|
throw new PnpmError('CANNOT_RESOLVE_PNPM', `Cannot find "${bareSpecifier}" version of pnpm`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnpm/engine.pm.commands",
|
|
3
|
-
"version": "1101.1.
|
|
3
|
+
"version": "1101.1.13",
|
|
4
4
|
"description": "pnpm commands for self-updating and setting up pnpm",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pnpm",
|
|
@@ -32,26 +32,27 @@
|
|
|
32
32
|
"render-help": "^2.0.0",
|
|
33
33
|
"semver": "^7.7.2",
|
|
34
34
|
"symlink-dir": "^10.0.1",
|
|
35
|
-
"@pnpm/building.policy": "1100.0.
|
|
35
|
+
"@pnpm/building.policy": "1100.0.5",
|
|
36
|
+
"@pnpm/bins.linker": "1100.0.7",
|
|
36
37
|
"@pnpm/cli.meta": "1100.0.3",
|
|
37
|
-
"@pnpm/
|
|
38
|
-
"@pnpm/
|
|
39
|
-
"@pnpm/
|
|
38
|
+
"@pnpm/config.reader": "1101.3.2",
|
|
39
|
+
"@pnpm/cli.utils": "1101.0.5",
|
|
40
|
+
"@pnpm/config.version-policy": "1100.1.0",
|
|
41
|
+
"@pnpm/deps.graph-hasher": "1100.2.0",
|
|
42
|
+
"@pnpm/global.commands": "1100.0.18",
|
|
40
43
|
"@pnpm/global.packages": "1100.0.3",
|
|
41
|
-
"@pnpm/installing.client": "1100.0
|
|
42
|
-
"@pnpm/installing.
|
|
43
|
-
"@pnpm/
|
|
44
|
-
"@pnpm/lockfile.
|
|
45
|
-
"@pnpm/
|
|
46
|
-
"@pnpm/
|
|
47
|
-
"@pnpm/store.connection-manager": "1100.1.1",
|
|
44
|
+
"@pnpm/installing.client": "1100.1.0",
|
|
45
|
+
"@pnpm/installing.env-installer": "1101.0.10",
|
|
46
|
+
"@pnpm/installing.deps-restorer": "1101.1.3",
|
|
47
|
+
"@pnpm/lockfile.fs": "1100.1.0",
|
|
48
|
+
"@pnpm/error": "1100.0.0",
|
|
49
|
+
"@pnpm/lockfile.types": "1100.0.6",
|
|
48
50
|
"@pnpm/shell.path": "1100.0.1",
|
|
49
|
-
"@pnpm/store.
|
|
50
|
-
"@pnpm/
|
|
51
|
+
"@pnpm/store.connection-manager": "1100.2.0",
|
|
52
|
+
"@pnpm/resolving.npm-resolver": "1101.2.0",
|
|
53
|
+
"@pnpm/store.controller": "1101.0.7",
|
|
51
54
|
"@pnpm/types": "1101.1.0",
|
|
52
|
-
"@pnpm/
|
|
53
|
-
"@pnpm/global.commands": "1100.0.16",
|
|
54
|
-
"@pnpm/error": "1100.0.0"
|
|
55
|
+
"@pnpm/workspace.project-manifest-reader": "1100.0.6"
|
|
55
56
|
},
|
|
56
57
|
"peerDependencies": {
|
|
57
58
|
"@pnpm/logger": ">=1001.0.0 <1002.0.0"
|
|
@@ -62,11 +63,11 @@
|
|
|
62
63
|
"@types/ramda": "0.31.1",
|
|
63
64
|
"@types/semver": "7.7.1",
|
|
64
65
|
"@pnpm/constants": "1100.0.0",
|
|
65
|
-
"@pnpm/engine.pm.commands": "1101.1.
|
|
66
|
-
"@pnpm/logger": "1100.0.0",
|
|
66
|
+
"@pnpm/engine.pm.commands": "1101.1.13",
|
|
67
67
|
"@pnpm/error": "1100.0.0",
|
|
68
|
-
"@pnpm/
|
|
69
|
-
"@pnpm/
|
|
68
|
+
"@pnpm/logger": "1100.0.0",
|
|
69
|
+
"@pnpm/prepare": "1100.0.9",
|
|
70
|
+
"@pnpm/testing.mock-agent": "1100.0.5"
|
|
70
71
|
},
|
|
71
72
|
"engines": {
|
|
72
73
|
"node": ">=22.13"
|