@pnpm/global.commands 1100.0.18 → 1100.0.19

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.
@@ -1,5 +1,6 @@
1
1
  import type { CommandHandlerMap } from '@pnpm/cli.command';
2
2
  import type { CreateStoreControllerOptions } from '@pnpm/store.connection-manager';
3
+ import { type ResolutionPolicyViolation } from './installGlobalPackages.js';
3
4
  export type GlobalAddOptions = CreateStoreControllerOptions & {
4
5
  bin?: string;
5
6
  globalPkgDir?: string;
@@ -12,5 +13,7 @@ export type GlobalAddOptions = CreateStoreControllerOptions & {
12
13
  libc?: string[];
13
14
  };
14
15
  rootProjectManifest?: unknown;
16
+ handleResolutionPolicyViolations?: (violations: readonly ResolutionPolicyViolation[]) => Promise<void>;
17
+ updateResolutionPolicyManifest?: (violations: readonly ResolutionPolicyViolation[], dir: string) => Promise<void>;
15
18
  };
16
19
  export declare function handleGlobalAdd(opts: GlobalAddOptions, params: string[], commands: CommandHandlerMap): Promise<void>;
package/lib/globalAdd.js CHANGED
@@ -76,7 +76,7 @@ async function installGroup(ctx, commands) {
76
76
  allowBuilds,
77
77
  omitSummaryLog: true,
78
78
  };
79
- const ignoredBuilds = await installGlobalPackages(installOpts, params);
79
+ const { ignoredBuilds, resolutionPolicyViolations } = await installGlobalPackages(installOpts, params);
80
80
  await promptApproveGlobalBuilds({
81
81
  globalPkgDir: globalDir,
82
82
  installDir,
@@ -114,6 +114,7 @@ async function installGroup(ctx, commands) {
114
114
  await symlinkDir(installDir, hashLink, { overwrite: true });
115
115
  // Link bins from installed packages into global bin dir
116
116
  await linkBinsOfPackages(pkgs, globalBinDir, { excludeBins: binsToSkip });
117
+ await opts.updateResolutionPolicyManifest?.(resolutionPolicyViolations, globalDir);
117
118
  }
118
119
  function splitCommaSeparated(param, baseDir) {
119
120
  if (!param.includes(','))
@@ -1,5 +1,6 @@
1
1
  import type { CommandHandlerMap } from '@pnpm/cli.command';
2
2
  import type { CreateStoreControllerOptions } from '@pnpm/store.connection-manager';
3
+ import { type ResolutionPolicyViolation } from './installGlobalPackages.js';
3
4
  export type GlobalUpdateOptions = CreateStoreControllerOptions & {
4
5
  bin?: string;
5
6
  globalPkgDir?: string;
@@ -11,5 +12,7 @@ export type GlobalUpdateOptions = CreateStoreControllerOptions & {
11
12
  libc?: string[];
12
13
  };
13
14
  rootProjectManifest?: unknown;
15
+ handleResolutionPolicyViolations?: (violations: readonly ResolutionPolicyViolation[]) => Promise<void>;
16
+ updateResolutionPolicyManifest?: (violations: readonly ResolutionPolicyViolation[], dir: string) => Promise<void>;
14
17
  };
15
18
  export declare function handleGlobalUpdate(opts: GlobalUpdateOptions, params: string[], commands: CommandHandlerMap): Promise<string | undefined>;
@@ -46,7 +46,7 @@ async function updateGlobalPackageGroup(opts, globalDir, globalBinDir, pkg, comm
46
46
  };
47
47
  const fetchFullMetadata = opts.supportedArchitectures?.libc != null && true;
48
48
  const allowBuilds = opts.allowBuilds ?? {};
49
- const ignoredBuilds = await installGlobalPackages({
49
+ const { ignoredBuilds, resolutionPolicyViolations } = await installGlobalPackages({
50
50
  ...opts,
51
51
  global: false,
52
52
  bin: path.join(installDir, 'node_modules/.bin'),
@@ -100,5 +100,6 @@ async function updateGlobalPackageGroup(opts, globalDir, globalBinDir, pkg, comm
100
100
  }
101
101
  // Link bins from new installation
102
102
  await linkBinsOfPackages(pkgs, globalBinDir, { excludeBins: binsToSkip });
103
+ await opts.updateResolutionPolicyManifest?.(resolutionPolicyViolations, globalDir);
103
104
  }
104
105
  //# sourceMappingURL=globalUpdate.js.map
@@ -1,5 +1,15 @@
1
1
  import { type CreateStoreControllerOptions } from '@pnpm/store.connection-manager';
2
2
  import type { IgnoredBuilds, IncludedDependencies } from '@pnpm/types';
3
+ export interface ResolutionPolicyViolation {
4
+ name: string;
5
+ version: string;
6
+ code: string;
7
+ reason: string;
8
+ }
9
+ export interface InstallGlobalPackagesResult {
10
+ ignoredBuilds: IgnoredBuilds | undefined;
11
+ resolutionPolicyViolations: ResolutionPolicyViolation[];
12
+ }
3
13
  export interface InstallGlobalPackagesOptions extends CreateStoreControllerOptions {
4
14
  bin: string;
5
15
  dir: string;
@@ -21,5 +31,6 @@ export interface InstallGlobalPackagesOptions extends CreateStoreControllerOptio
21
31
  saveProd?: boolean;
22
32
  sharedWorkspaceLockfile?: boolean;
23
33
  workspaceDir?: string;
34
+ handleResolutionPolicyViolations?: (violations: readonly ResolutionPolicyViolation[]) => Promise<void>;
24
35
  }
25
- export declare function installGlobalPackages(opts: InstallGlobalPackagesOptions, params: string[]): Promise<IgnoredBuilds | undefined>;
36
+ export declare function installGlobalPackages(opts: InstallGlobalPackagesOptions, params: string[]): Promise<InstallGlobalPackagesResult>;
@@ -14,7 +14,7 @@ export async function installGlobalPackages(opts, params) {
14
14
  storeDir: store.dir,
15
15
  };
16
16
  const pinnedVersion = opts.saveExact ? 'patch' : (opts.savePrefix === '~' ? 'minor' : 'major');
17
- const { updatedProject, ignoredBuilds } = await mutateModulesInSingleProject({
17
+ const { updatedProject, ignoredBuilds, resolutionPolicyViolations } = await mutateModulesInSingleProject({
18
18
  allowNew: true,
19
19
  binsDir: opts.bin,
20
20
  dependencySelectors: params,
@@ -26,6 +26,6 @@ export async function installGlobalPackages(opts, params) {
26
26
  targetDependenciesField: 'dependencies',
27
27
  }, installOpts);
28
28
  await writeProjectManifest(updatedProject.manifest);
29
- return ignoredBuilds;
29
+ return { ignoredBuilds, resolutionPolicyViolations };
30
30
  }
31
31
  //# sourceMappingURL=installGlobalPackages.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnpm/global.commands",
3
- "version": "1100.0.18",
3
+ "version": "1100.0.19",
4
4
  "description": "Global package command handlers for pnpm",
5
5
  "keywords": [
6
6
  "pnpm",
@@ -28,25 +28,25 @@
28
28
  "@pnpm/util.lex-comparator": "^3.0.2",
29
29
  "is-subdir": "^2.0.0",
30
30
  "symlink-dir": "^10.0.1",
31
- "@pnpm/bins.linker": "1100.0.7",
32
- "@pnpm/bins.resolver": "1100.0.3",
33
- "@pnpm/bins.remover": "1100.0.4",
31
+ "@pnpm/bins.linker": "1100.0.8",
32
+ "@pnpm/bins.remover": "1100.0.5",
34
33
  "@pnpm/cli.command": "1100.0.1",
35
- "@pnpm/cli.utils": "1101.0.5",
34
+ "@pnpm/cli.utils": "1101.0.6",
36
35
  "@pnpm/config.matcher": "1100.0.1",
37
- "@pnpm/config.reader": "1101.3.2",
38
- "@pnpm/core-loggers": "1100.1.0",
39
- "@pnpm/deps.inspection.list": "1100.0.11",
36
+ "@pnpm/bins.resolver": "1100.0.4",
37
+ "@pnpm/core-loggers": "1100.1.1",
38
+ "@pnpm/deps.inspection.list": "1100.0.12",
39
+ "@pnpm/global.packages": "1100.0.4",
40
+ "@pnpm/installing.deps-installer": "1101.3.0",
41
+ "@pnpm/store.connection-manager": "1100.2.1",
40
42
  "@pnpm/error": "1100.0.0",
41
- "@pnpm/global.packages": "1100.0.3",
42
- "@pnpm/installing.deps-installer": "1101.2.0",
43
- "@pnpm/pkg-manifest.reader": "1100.0.3",
44
- "@pnpm/store.connection-manager": "1100.2.0",
45
- "@pnpm/types": "1101.1.0"
43
+ "@pnpm/pkg-manifest.reader": "1100.0.4",
44
+ "@pnpm/types": "1101.1.1",
45
+ "@pnpm/config.reader": "1101.3.3"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@jest/globals": "30.3.0",
49
- "@pnpm/global.commands": "1100.0.18"
49
+ "@pnpm/global.commands": "1100.0.19"
50
50
  },
51
51
  "engines": {
52
52
  "node": ">=22.13"