@pnpm/exec.commands 1100.1.7 → 1100.1.9
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/dlx.js +14 -8
- package/lib/exec.d.ts +1 -1
- package/lib/runDepsStatusCheck.d.ts +2 -1
- package/lib/runDepsStatusCheck.js +1 -1
- package/package.json +24 -24
package/lib/dlx.js
CHANGED
|
@@ -7,10 +7,10 @@ import { resolveFromCatalog, } from '@pnpm/catalogs.resolver';
|
|
|
7
7
|
import { OUTPUT_OPTIONS } from '@pnpm/cli.common-cli-options-help';
|
|
8
8
|
import { docsUrl, readProjectManifestOnly } from '@pnpm/cli.utils';
|
|
9
9
|
import { types } from '@pnpm/config.reader';
|
|
10
|
-
import {
|
|
10
|
+
import { getPublishedByPolicy } from '@pnpm/config.version-policy';
|
|
11
11
|
import { createHexHash } from '@pnpm/crypto.hash';
|
|
12
12
|
import { PnpmError } from '@pnpm/error';
|
|
13
|
-
import { createResolver } from '@pnpm/installing.client';
|
|
13
|
+
import { createResolver, makeResolutionStrict } from '@pnpm/installing.client';
|
|
14
14
|
import { add } from '@pnpm/installing.commands';
|
|
15
15
|
import { readPackageJsonFromDir } from '@pnpm/pkg-manifest.reader';
|
|
16
16
|
import { parseWantedDependency } from '@pnpm/resolving.parse-wanted-dependency';
|
|
@@ -84,12 +84,11 @@ export async function handler(opts, [command, ...args], commands) {
|
|
|
84
84
|
opts.trustPolicy === 'no-downgrade' ||
|
|
85
85
|
Boolean(opts.minimumReleaseAge)) && !opts.registrySupportsTimeField);
|
|
86
86
|
const catalogResolver = resolveFromCatalog.bind(null, opts.catalogs ?? {});
|
|
87
|
-
const { resolve } = createResolver({
|
|
87
|
+
const { resolve: baseResolve } = createResolver({
|
|
88
88
|
...opts,
|
|
89
89
|
configByUri: opts.configByUri,
|
|
90
90
|
fullMetadata,
|
|
91
91
|
filterMetadata: fullMetadata,
|
|
92
|
-
strictPublishedByCheck: Boolean(opts.minimumReleaseAge) && opts.minimumReleaseAgeStrict === true,
|
|
93
92
|
ignoreMissingTimeField: opts.minimumReleaseAgeIgnoreMissingTime,
|
|
94
93
|
retry: {
|
|
95
94
|
factor: opts.fetchRetryFactor,
|
|
@@ -99,11 +98,18 @@ export async function handler(opts, [command, ...args], commands) {
|
|
|
99
98
|
},
|
|
100
99
|
timeout: opts.fetchTimeout,
|
|
101
100
|
});
|
|
101
|
+
// dlx has nowhere to "defer to" — it runs the resolved package directly.
|
|
102
|
+
// Wrap the resolver under any policy that wants to reject violations
|
|
103
|
+
// up-front: strict minimumReleaseAge (refuse immature picks) and
|
|
104
|
+
// `trustPolicy: 'no-downgrade'` (refuse versions whose trust evidence
|
|
105
|
+
// weakened). Without the trust-policy arm, a downgraded version would
|
|
106
|
+
// resolve to a `policyViolation` that dlx silently ignored and then
|
|
107
|
+
// executed.
|
|
108
|
+
const strictResolution = (Boolean(opts.minimumReleaseAge) && opts.minimumReleaseAgeStrict === true) ||
|
|
109
|
+
opts.trustPolicy === 'no-downgrade';
|
|
110
|
+
const resolve = strictResolution ? makeResolutionStrict(baseResolve) : baseResolve;
|
|
102
111
|
const resolvedPkgAliases = [];
|
|
103
|
-
const publishedBy
|
|
104
|
-
const publishedByExclude = opts.minimumReleaseAgeExclude
|
|
105
|
-
? createPackageVersionPolicy(opts.minimumReleaseAgeExclude)
|
|
106
|
-
: undefined;
|
|
112
|
+
const { publishedBy, publishedByExclude } = getPublishedByPolicy(opts);
|
|
107
113
|
const resolvedPkgs = await Promise.all(pkgs.map(async (pkg) => {
|
|
108
114
|
const { alias, bareSpecifier } = parseWantedDependency(pkg) || {};
|
|
109
115
|
if (alias == null)
|
package/lib/exec.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ export type ExecOpts = Required<Pick<ConfigContext, 'selectedProjectsGraph'>> &
|
|
|
28
28
|
resumeFrom?: string;
|
|
29
29
|
reportSummary?: boolean;
|
|
30
30
|
implicitlyFellbackFromRun?: boolean;
|
|
31
|
-
} & Pick<Config, 'bin' | 'dir' | 'extraBinPaths' | 'extraEnv' | 'lockfileDir' | 'modulesDir' | 'nodeOptions' | 'pnpmHomeDir' | 'recursive' | 'reporterHidePrefix' | 'userAgent' | 'verifyDepsBeforeRun' | 'workspaceDir'> & Pick<ConfigContext, 'cliOptions'> & CheckDepsStatusOptions;
|
|
31
|
+
} & Pick<Config, 'bin' | 'dir' | 'extraBinPaths' | 'extraEnv' | 'lockfileDir' | 'modulesDir' | 'nodeOptions' | 'pnpmHomeDir' | 'recursive' | 'reporter' | 'reporterHidePrefix' | 'userAgent' | 'verifyDepsBeforeRun' | 'workspaceDir'> & Pick<ConfigContext, 'cliOptions'> & CheckDepsStatusOptions;
|
|
32
32
|
export declare function handler(opts: ExecOpts, params: string[]): Promise<{
|
|
33
33
|
exitCode: number;
|
|
34
34
|
}>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { VerifyDepsBeforeRun } from '@pnpm/config.reader';
|
|
1
|
+
import type { Config, VerifyDepsBeforeRun } from '@pnpm/config.reader';
|
|
2
2
|
import { type CheckDepsStatusOptions, type WorkspaceStateSettings } from '@pnpm/deps.status';
|
|
3
3
|
export interface RunDepsStatusCheckOptions extends CheckDepsStatusOptions {
|
|
4
4
|
dir: string;
|
|
5
|
+
reporter?: Config['reporter'];
|
|
5
6
|
verifyDepsBeforeRun?: VerifyDepsBeforeRun;
|
|
6
7
|
}
|
|
7
8
|
export declare function runDepsStatusCheck(opts: RunDepsStatusCheckOptions): Promise<void>;
|
|
@@ -12,7 +12,7 @@ export async function runDepsStatusCheck(opts) {
|
|
|
12
12
|
if (upToDate)
|
|
13
13
|
return;
|
|
14
14
|
const command = ['install', ...createInstallArgs(workspaceState?.settings)];
|
|
15
|
-
const install = runPnpmCli.bind(null, command, { cwd: opts.dir });
|
|
15
|
+
const install = runPnpmCli.bind(null, command, { cwd: opts.dir, reporter: opts.reporter });
|
|
16
16
|
switch (opts.verifyDepsBeforeRun) {
|
|
17
17
|
case 'install':
|
|
18
18
|
install();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnpm/exec.commands",
|
|
3
|
-
"version": "1100.1.
|
|
3
|
+
"version": "1100.1.9",
|
|
4
4
|
"description": "Commands for running scripts",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pnpm",
|
|
@@ -38,31 +38,31 @@
|
|
|
38
38
|
"symlink-dir": "^10.0.1",
|
|
39
39
|
"which": "npm:@pnpm/which@^3.0.1",
|
|
40
40
|
"write-json-file": "^7.0.0",
|
|
41
|
-
"@pnpm/
|
|
41
|
+
"@pnpm/building.commands": "1100.0.19",
|
|
42
42
|
"@pnpm/catalogs.resolver": "1100.0.0",
|
|
43
|
-
"@pnpm/
|
|
44
|
-
"@pnpm/building.commands": "1100.0.17",
|
|
43
|
+
"@pnpm/bins.resolver": "1100.0.4",
|
|
45
44
|
"@pnpm/cli.command": "1100.0.1",
|
|
46
|
-
"@pnpm/cli.
|
|
47
|
-
"@pnpm/
|
|
48
|
-
"@pnpm/config.reader": "1101.3.
|
|
45
|
+
"@pnpm/cli.common-cli-options-help": "1100.0.1",
|
|
46
|
+
"@pnpm/cli.utils": "1101.0.6",
|
|
47
|
+
"@pnpm/config.reader": "1101.3.3",
|
|
48
|
+
"@pnpm/core-loggers": "1100.1.1",
|
|
49
|
+
"@pnpm/config.version-policy": "1100.1.1",
|
|
49
50
|
"@pnpm/crypto.hash": "1100.0.1",
|
|
51
|
+
"@pnpm/deps.status": "1100.0.17",
|
|
50
52
|
"@pnpm/error": "1100.0.0",
|
|
51
|
-
"@pnpm/
|
|
52
|
-
"@pnpm/
|
|
53
|
-
"@pnpm/
|
|
54
|
-
"@pnpm/
|
|
55
|
-
"@pnpm/
|
|
56
|
-
"@pnpm/
|
|
57
|
-
"@pnpm/installing.commands": "1100.2.2",
|
|
53
|
+
"@pnpm/exec.pnpm-cli-runner": "1100.0.1",
|
|
54
|
+
"@pnpm/installing.client": "1100.2.0",
|
|
55
|
+
"@pnpm/exec.lifecycle": "1100.0.12",
|
|
56
|
+
"@pnpm/installing.commands": "1100.4.0",
|
|
57
|
+
"@pnpm/engine.runtime.commands": "1100.0.16",
|
|
58
|
+
"@pnpm/pkg-manifest.reader": "1100.0.4",
|
|
58
59
|
"@pnpm/resolving.parse-wanted-dependency": "1100.0.1",
|
|
59
|
-
"@pnpm/pkg-manifest.reader": "1100.0.3",
|
|
60
60
|
"@pnpm/store.path": "1100.0.1",
|
|
61
|
+
"@pnpm/types": "1101.1.1",
|
|
61
62
|
"@pnpm/shell.path": "1100.0.1",
|
|
62
|
-
"@pnpm/
|
|
63
|
-
"@pnpm/workspace.
|
|
64
|
-
"@pnpm/workspace.
|
|
65
|
-
"@pnpm/workspace.projects-sorter": "1100.0.2"
|
|
63
|
+
"@pnpm/workspace.injected-deps-syncer": "1100.0.13",
|
|
64
|
+
"@pnpm/workspace.project-manifest-reader": "1100.0.7",
|
|
65
|
+
"@pnpm/workspace.projects-sorter": "1100.0.3"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
68
|
"@pnpm/logger": ">=1001.0.0 <1002.0.0"
|
|
@@ -75,13 +75,13 @@
|
|
|
75
75
|
"@types/which": "^3.0.4",
|
|
76
76
|
"is-windows": "^1.0.2",
|
|
77
77
|
"write-yaml-file": "^6.0.0",
|
|
78
|
+
"@pnpm/exec.commands": "1100.1.9",
|
|
78
79
|
"@pnpm/logger": "1100.0.0",
|
|
79
|
-
"@pnpm/
|
|
80
|
-
"@pnpm/engine.runtime.system-node-version": "1100.0.3",
|
|
80
|
+
"@pnpm/testing.command-defaults": "1100.0.1",
|
|
81
81
|
"@pnpm/test-ipc-server": "1100.0.0",
|
|
82
|
-
"@pnpm/prepare": "1100.0.
|
|
83
|
-
"@pnpm/workspace.projects-filter": "1100.0.
|
|
84
|
-
"@pnpm/
|
|
82
|
+
"@pnpm/prepare": "1100.0.10",
|
|
83
|
+
"@pnpm/workspace.projects-filter": "1100.0.13",
|
|
84
|
+
"@pnpm/engine.runtime.system-node-version": "1100.1.1"
|
|
85
85
|
},
|
|
86
86
|
"engines": {
|
|
87
87
|
"node": ">=22.13"
|