@pnpm/exec.commands 1100.1.6 → 1100.1.8

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 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 { createPackageVersionPolicy } from '@pnpm/config.version-policy';
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 = opts.minimumReleaseAge ? new Date(Date.now() - opts.minimumReleaseAge * 60 * 1000) : undefined;
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.6",
3
+ "version": "1100.1.8",
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/building.commands": "1100.0.16",
42
41
  "@pnpm/bins.resolver": "1100.0.3",
42
+ "@pnpm/building.commands": "1100.0.18",
43
43
  "@pnpm/catalogs.resolver": "1100.0.0",
44
44
  "@pnpm/cli.command": "1100.0.1",
45
45
  "@pnpm/cli.common-cli-options-help": "1100.0.1",
46
- "@pnpm/config.reader": "1101.3.0",
47
- "@pnpm/cli.utils": "1101.0.3",
48
- "@pnpm/config.version-policy": "1100.0.3",
49
- "@pnpm/core-loggers": "1100.0.2",
46
+ "@pnpm/cli.utils": "1101.0.5",
47
+ "@pnpm/config.reader": "1101.3.2",
48
+ "@pnpm/config.version-policy": "1100.1.0",
49
+ "@pnpm/core-loggers": "1100.1.0",
50
50
  "@pnpm/crypto.hash": "1100.0.1",
51
- "@pnpm/deps.status": "1100.0.14",
51
+ "@pnpm/deps.status": "1100.0.16",
52
+ "@pnpm/engine.runtime.commands": "1100.0.15",
52
53
  "@pnpm/error": "1100.0.0",
53
- "@pnpm/engine.runtime.commands": "1100.0.13",
54
- "@pnpm/installing.commands": "1100.2.1",
55
- "@pnpm/installing.client": "1100.0.14",
56
- "@pnpm/exec.pnpm-cli-runner": "1100.0.0",
57
- "@pnpm/pkg-manifest.reader": "1100.0.3",
54
+ "@pnpm/exec.lifecycle": "1100.0.11",
55
+ "@pnpm/exec.pnpm-cli-runner": "1100.0.1",
56
+ "@pnpm/installing.client": "1100.1.0",
57
+ "@pnpm/installing.commands": "1100.3.0",
58
+ "@pnpm/resolving.parse-wanted-dependency": "1100.0.1",
58
59
  "@pnpm/shell.path": "1100.0.1",
60
+ "@pnpm/pkg-manifest.reader": "1100.0.3",
59
61
  "@pnpm/store.path": "1100.0.1",
60
- "@pnpm/resolving.parse-wanted-dependency": "1100.0.1",
61
- "@pnpm/workspace.projects-sorter": "1100.0.2",
62
62
  "@pnpm/types": "1101.1.0",
63
- "@pnpm/workspace.injected-deps-syncer": "1100.0.10",
64
- "@pnpm/exec.lifecycle": "1100.0.9",
65
- "@pnpm/workspace.project-manifest-reader": "1100.0.4"
63
+ "@pnpm/workspace.injected-deps-syncer": "1100.0.12",
64
+ "@pnpm/workspace.project-manifest-reader": "1100.0.6",
65
+ "@pnpm/workspace.projects-sorter": "1100.0.2"
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.6",
78
+ "@pnpm/exec.commands": "1100.1.8",
79
+ "@pnpm/engine.runtime.system-node-version": "1100.1.0",
79
80
  "@pnpm/logger": "1100.0.0",
80
- "@pnpm/engine.runtime.system-node-version": "1100.0.3",
81
+ "@pnpm/prepare": "1100.0.9",
81
82
  "@pnpm/test-ipc-server": "1100.0.0",
82
- "@pnpm/workspace.projects-filter": "1100.0.10",
83
- "@pnpm/prepare": "1100.0.7",
84
- "@pnpm/testing.command-defaults": "1100.0.1"
83
+ "@pnpm/testing.command-defaults": "1100.0.1",
84
+ "@pnpm/workspace.projects-filter": "1100.0.12"
85
85
  },
86
86
  "engines": {
87
87
  "node": ">=22.13"