@pnpm/plugin-commands-installation 14.2.4 → 14.2.6

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,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": "14.2.4",
3
+ "version": "14.2.6",
4
4
  "description": "Commands for installation",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -39,12 +39,12 @@
39
39
  "write-json-file": "^4.3.0",
40
40
  "write-pkg": "4.0.0",
41
41
  "write-yaml-file": "^5.0.0",
42
- "@pnpm/assert-project": "2.3.46",
42
+ "@pnpm/assert-project": "2.3.47",
43
43
  "@pnpm/modules-yaml": "12.1.7",
44
- "@pnpm/plugin-commands-installation": "14.2.4",
45
- "@pnpm/prepare": "0.0.89",
46
- "@pnpm/test-fixtures": "0.1.19",
47
- "@pnpm/test-ipc-server": "0.0.0"
44
+ "@pnpm/plugin-commands-installation": "14.2.6",
45
+ "@pnpm/prepare": "0.0.90",
46
+ "@pnpm/test-ipc-server": "0.0.0",
47
+ "@pnpm/test-fixtures": "0.1.20"
48
48
  },
49
49
  "dependencies": {
50
50
  "@pnpm/colorize-semver-diff": "^1.0.1",
@@ -68,32 +68,32 @@
68
68
  "ramda": "npm:@pnpm/ramda@0.28.1",
69
69
  "render-help": "^1.0.3",
70
70
  "version-selector-type": "^3.0.0",
71
+ "@pnpm/cli-utils": "2.1.11",
71
72
  "@pnpm/command": "4.0.0",
72
- "@pnpm/common-cli-options-help": "1.1.0",
73
+ "@pnpm/config": "20.4.3",
74
+ "@pnpm/core": "13.5.1",
73
75
  "@pnpm/constants": "7.1.1",
74
- "@pnpm/config": "20.4.2",
75
- "@pnpm/dedupe.check": "1.0.7",
76
- "@pnpm/core": "13.5.0",
77
- "@pnpm/error": "5.0.2",
78
- "@pnpm/cli-utils": "2.1.9",
79
- "@pnpm/find-workspace-dir": "6.0.2",
76
+ "@pnpm/dedupe.check": "1.0.8",
77
+ "@pnpm/error": "5.0.3",
78
+ "@pnpm/filter-workspace-packages": "7.2.13",
79
+ "@pnpm/find-workspace-dir": "6.0.3",
80
80
  "@pnpm/graceful-fs": "3.2.0",
81
81
  "@pnpm/lockfile-types": "5.1.5",
82
82
  "@pnpm/matcher": "5.0.0",
83
- "@pnpm/manifest-utils": "5.0.7",
84
- "@pnpm/package-store": "19.0.16",
85
- "@pnpm/outdated": "13.0.43",
83
+ "@pnpm/manifest-utils": "5.0.8",
84
+ "@pnpm/common-cli-options-help": "1.1.0",
85
+ "@pnpm/outdated": "13.0.44",
86
+ "@pnpm/package-store": "19.0.17",
86
87
  "@pnpm/parse-wanted-dependency": "5.0.0",
87
- "@pnpm/plugin-commands-rebuild": "10.0.19",
88
- "@pnpm/pnpmfile": "5.0.20",
88
+ "@pnpm/pnpmfile": "5.0.21",
89
+ "@pnpm/plugin-commands-rebuild": "10.0.21",
90
+ "@pnpm/read-project-manifest": "5.0.11",
89
91
  "@pnpm/resolver-base": "11.1.0",
90
- "@pnpm/read-project-manifest": "5.0.10",
92
+ "@pnpm/store-connection-manager": "7.0.28",
93
+ "@pnpm/workspace.find-packages": "1.1.12",
91
94
  "@pnpm/sort-packages": "5.0.9",
92
- "@pnpm/store-connection-manager": "7.0.27",
93
- "@pnpm/types": "9.4.2",
94
- "@pnpm/workspace.find-packages": "1.1.10",
95
- "@pnpm/workspace.pkgs-graph": "2.0.14",
96
- "@pnpm/filter-workspace-packages": "7.2.11"
95
+ "@pnpm/workspace.pkgs-graph": "2.0.15",
96
+ "@pnpm/types": "9.4.2"
97
97
  },
98
98
  "peerDependencies": {
99
99
  "@pnpm/logger": "^5.0.0"