@pnpm/plugin-commands-installation 17.2.7 → 17.2.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.
@@ -0,0 +1,11 @@
1
+ import { type AllowedDeprecatedVersions, type PackageExtension, type PeerDependencyRules, type ProjectManifest } from '@pnpm/types';
2
+ export declare function getOptionsFromRootManifest(manifest: ProjectManifest): {
3
+ allowedDeprecatedVersions?: AllowedDeprecatedVersions;
4
+ allowNonAppliedPatches?: boolean;
5
+ overrides?: Record<string, string>;
6
+ neverBuiltDependencies?: string[];
7
+ onlyBuiltDependencies?: string[];
8
+ packageExtensions?: Record<string, PackageExtension>;
9
+ patchedDependencies?: Record<string, string>;
10
+ peerDependencyRules?: PeerDependencyRules;
11
+ };
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getOptionsFromRootManifest = void 0;
7
+ const error_1 = require("@pnpm/error");
8
+ const map_1 = __importDefault(require("ramda/src/map"));
9
+ function getOptionsFromRootManifest(manifest) {
10
+ // We read Yarn's resolutions field for compatibility
11
+ // but we really replace the version specs to any other version spec, not only to exact versions,
12
+ // so we cannot call it resolutions
13
+ const overrides = (0, map_1.default)(createVersionReferencesReplacer(manifest), manifest.pnpm?.overrides ?? manifest.resolutions ?? {});
14
+ const neverBuiltDependencies = manifest.pnpm?.neverBuiltDependencies;
15
+ const onlyBuiltDependencies = manifest.pnpm?.onlyBuiltDependencies;
16
+ const packageExtensions = manifest.pnpm?.packageExtensions;
17
+ const peerDependencyRules = manifest.pnpm?.peerDependencyRules;
18
+ const allowedDeprecatedVersions = manifest.pnpm?.allowedDeprecatedVersions;
19
+ const allowNonAppliedPatches = manifest.pnpm?.allowNonAppliedPatches;
20
+ const patchedDependencies = manifest.pnpm?.patchedDependencies;
21
+ const settings = {
22
+ allowedDeprecatedVersions,
23
+ allowNonAppliedPatches,
24
+ overrides,
25
+ neverBuiltDependencies,
26
+ packageExtensions,
27
+ peerDependencyRules,
28
+ patchedDependencies,
29
+ };
30
+ if (onlyBuiltDependencies) {
31
+ // @ts-expect-error
32
+ settings['onlyBuiltDependencies'] = onlyBuiltDependencies;
33
+ }
34
+ return settings;
35
+ }
36
+ exports.getOptionsFromRootManifest = getOptionsFromRootManifest;
37
+ function createVersionReferencesReplacer(manifest) {
38
+ const allDeps = {
39
+ ...manifest.devDependencies,
40
+ ...manifest.dependencies,
41
+ ...manifest.optionalDependencies,
42
+ };
43
+ return replaceVersionReferences.bind(null, allDeps);
44
+ }
45
+ function replaceVersionReferences(dep, spec) {
46
+ if (!spec.startsWith('$'))
47
+ return spec;
48
+ const dependencyName = spec.slice(1);
49
+ const newSpec = dep[dependencyName];
50
+ if (newSpec)
51
+ return newSpec;
52
+ throw new error_1.PnpmError('CANNOT_RESOLVE_OVERRIDE_VERSION', `Cannot resolve version ${spec} in overrides. The direct dependencies don't have dependency "${dependencyName}".`);
53
+ }
54
+ //# sourceMappingURL=getOptionsFromRootManifest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getOptionsFromRootManifest.js","sourceRoot":"","sources":["../src/getOptionsFromRootManifest.ts"],"names":[],"mappings":";;;;;;AAAA,uCAAuC;AAOvC,wDAAqC;AAErC,SAAgB,0BAA0B,CAAE,QAAyB;IAUnE,qDAAqD;IACrD,iGAAiG;IACjG,mCAAmC;IACnC,MAAM,SAAS,GAAG,IAAA,aAAS,EACzB,+BAA+B,CAAC,QAAQ,CAAC,EACzC,QAAQ,CAAC,IAAI,EAAE,SAAS,IAAI,QAAQ,CAAC,WAAW,IAAI,EAAE,CACvD,CAAA;IACD,MAAM,sBAAsB,GAAG,QAAQ,CAAC,IAAI,EAAE,sBAAsB,CAAA;IACpE,MAAM,qBAAqB,GAAG,QAAQ,CAAC,IAAI,EAAE,qBAAqB,CAAA;IAClE,MAAM,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A;AACH,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { type IncludedDependencies, type ProjectManifest } from '@pnpm/types';
2
+ export declare function updateToLatestSpecsFromManifest(manifest: ProjectManifest, include: IncludedDependencies): string[];
3
+ export declare function createLatestSpecs(specs: string[], manifest: ProjectManifest): string[];
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.createLatestSpecs = exports.updateToLatestSpecsFromManifest = void 0;
7
+ const manifest_utils_1 = require("@pnpm/manifest-utils");
8
+ const version_selector_type_1 = __importDefault(require("version-selector-type"));
9
+ function updateToLatestSpecsFromManifest(manifest, include) {
10
+ const allDeps = (0, manifest_utils_1.filterDependenciesByType)(manifest, include);
11
+ const updateSpecs = [];
12
+ for (const [depName, depVersion] of Object.entries(allDeps)) {
13
+ if (depVersion.startsWith('npm:')) {
14
+ updateSpecs.push(`${depName}@${removeVersionFromSpec(depVersion)}@latest`);
15
+ }
16
+ else {
17
+ const selector = (0, version_selector_type_1.default)(depVersion);
18
+ if (selector == null)
19
+ continue;
20
+ updateSpecs.push(`${depName}@latest`);
21
+ }
22
+ }
23
+ return updateSpecs;
24
+ }
25
+ exports.updateToLatestSpecsFromManifest = updateToLatestSpecsFromManifest;
26
+ function createLatestSpecs(specs, manifest) {
27
+ const allDeps = (0, manifest_utils_1.getAllDependenciesFromManifest)(manifest);
28
+ return specs
29
+ .filter((selector) => selector.includes('@', 1)
30
+ ? allDeps[selector.slice(0, selector.indexOf('@', 1))]
31
+ : allDeps[selector])
32
+ .map((selector) => {
33
+ if (selector.includes('@', 1)) {
34
+ return selector;
35
+ }
36
+ if (allDeps[selector].startsWith('npm:')) {
37
+ return `${selector}@${removeVersionFromSpec(allDeps[selector])}@latest`;
38
+ }
39
+ if ((0, version_selector_type_1.default)(allDeps[selector]) == null) {
40
+ return selector;
41
+ }
42
+ return `${selector}@latest`;
43
+ });
44
+ }
45
+ exports.createLatestSpecs = createLatestSpecs;
46
+ function removeVersionFromSpec(spec) {
47
+ return spec.substring(0, spec.lastIndexOf('@'));
48
+ }
49
+ //# sourceMappingURL=updateToLatestSpecsFromManifest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"updateToLatestSpecsFromManifest.js","sourceRoot":"","sources":["../src/updateToLatestSpecsFromManifest.ts"],"names":[],"mappings":";;;;;;AAAA,yDAA+F;AAE/F,kFAAiD;AAEjD,SAAgB,+BAA+B,CAAE,QAAyB,EAAE,OAA6B;IACvG,MAAM,OAAO,GAAG,IAAA,yCAAwB,EAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;IAC3D,MAAM,WAAW,GAAG,EAAE,CAAA;IACtB,KAAK,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QAC3D,IAAI,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE;YACjC,WAAW,CAAC,IAAI,CAAC,GAAG,OAAO,IAAI,qBAAqB,CAAC,UAAU,CAAC,SAAS,CAAC,CAAA;SAC3E;aAAM;YACL,MAAM,QAAQ,GAAG,IAAA,+BAAa,EAAC,UAAU,CAAC,CAAA;YAC1C,IAAI,QAAQ,IAAI,IAAI;gBAAE,SAAQ;YAC9B,WAAW,CAAC,IAAI,CAAC,GAAG,OAAO,SAAS,CAAC,CAAA;SACtC;KACF;IACD,OAAO,WAAW,CAAA;AACpB,CAAC;AAbD,0EAaC;AAED,SAAgB,iBAAiB,CAAE,KAAe,EAAE,QAAyB;IAC3E,MAAM,OAAO,GAAG,IAAA,+CAA8B,EAAC,QAAQ,CAAC,CAAA;IACxD,OAAO,KAAK;SACT,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,CAAC;QAC7C,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;QACtD,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CACpB;SACA,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE;QAChB,IAAI,QAAQ,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE;YAC7B,OAAO,QAAQ,CAAA;SAChB;QACD,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE;YACxC,OAAO,GAAG,QAAQ,IAAI,qBAAqB,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAA;SACxE;QACD,IAAI,IAAA,+BAAa,EAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,IAAI,IAAI,EAAE;YAC5C,OAAO,QAAQ,CAAA;SAChB;QACD,OAAO,GAAG,QAAQ,SAAS,CAAA;IAC7B,CAAC,CAAC,CAAA;AACN,CAAC;AAnBD,8CAmBC;AAED,SAAS,qBAAqB,CAAE,IAAY;IAC1C,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAA;AACjD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnpm/plugin-commands-installation",
3
- "version": "17.2.7",
3
+ "version": "17.2.8",
4
4
  "description": "Commands for installation",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -40,13 +40,13 @@
40
40
  "write-json-file": "^4.3.0",
41
41
  "write-pkg": "4.0.0",
42
42
  "write-yaml-file": "^5.0.0",
43
- "@pnpm/assert-project": "2.3.62",
44
43
  "@pnpm/logger": "5.2.0",
44
+ "@pnpm/assert-project": "2.3.62",
45
45
  "@pnpm/modules-yaml": "13.1.7",
46
- "@pnpm/plugin-commands-installation": "17.2.7",
47
- "@pnpm/test-fixtures": "0.1.35",
46
+ "@pnpm/plugin-commands-installation": "17.2.8",
48
47
  "@pnpm/prepare": "0.0.105",
49
48
  "@pnpm/test-ipc-server": "0.0.0",
49
+ "@pnpm/test-fixtures": "0.1.35",
50
50
  "@pnpm/workspace.filter-packages-from-dir": "1.0.13"
51
51
  },
52
52
  "dependencies": {
@@ -72,32 +72,32 @@
72
72
  "which": "npm:@pnpm/which@^3.0.1",
73
73
  "@pnpm/cli-utils": "4.0.7",
74
74
  "@pnpm/command": "5.0.2",
75
- "@pnpm/config": "21.8.5",
76
- "@pnpm/constants": "9.0.0",
77
75
  "@pnpm/common-cli-options-help": "2.0.0",
76
+ "@pnpm/config": "21.8.5",
78
77
  "@pnpm/dedupe.check": "2.0.11",
79
- "@pnpm/core": "15.3.8",
78
+ "@pnpm/core": "15.3.9",
80
79
  "@pnpm/filter-workspace-packages": "10.0.12",
80
+ "@pnpm/constants": "9.0.0",
81
+ "@pnpm/get-context": "12.0.8",
81
82
  "@pnpm/error": "6.0.2",
82
- "@pnpm/get-context": "12.0.7",
83
83
  "@pnpm/find-workspace-dir": "7.0.2",
84
84
  "@pnpm/lockfile.types": "1.0.3",
85
85
  "@pnpm/graceful-fs": "4.0.0",
86
86
  "@pnpm/manifest-utils": "6.0.9",
87
87
  "@pnpm/matcher": "6.0.0",
88
- "@pnpm/outdated": "15.1.7",
89
88
  "@pnpm/package-store": "20.4.2",
89
+ "@pnpm/outdated": "15.1.8",
90
90
  "@pnpm/parse-wanted-dependency": "6.0.0",
91
- "@pnpm/plugin-commands-env": "5.1.11",
92
- "@pnpm/plugin-commands-rebuild": "12.1.2",
91
+ "@pnpm/plugin-commands-rebuild": "12.1.3",
93
92
  "@pnpm/read-project-manifest": "6.0.9",
94
- "@pnpm/pnpmfile": "6.0.13",
93
+ "@pnpm/plugin-commands-env": "5.1.11",
95
94
  "@pnpm/resolver-base": "13.0.4",
96
- "@pnpm/sort-packages": "6.0.8",
97
- "@pnpm/store-connection-manager": "8.4.2",
98
95
  "@pnpm/types": "12.2.0",
96
+ "@pnpm/store-connection-manager": "8.4.2",
99
97
  "@pnpm/workspace.find-packages": "4.0.12",
100
- "@pnpm/workspace.pkgs-graph": "4.0.7"
98
+ "@pnpm/sort-packages": "6.0.8",
99
+ "@pnpm/workspace.pkgs-graph": "4.0.7",
100
+ "@pnpm/pnpmfile": "6.0.13"
101
101
  },
102
102
  "peerDependencies": {
103
103
  "@pnpm/logger": "^5.1.0"