@pnpm/core 16.0.0 → 900.0.0

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.
Files changed (40) hide show
  1. package/lib/api.d.ts +1 -0
  2. package/lib/api.js +1 -0
  3. package/lib/api.js.map +1 -1
  4. package/lib/index.d.ts +1 -3
  5. package/lib/index.js +3 -4
  6. package/lib/index.js.map +1 -1
  7. package/lib/install/index.d.ts +9 -2
  8. package/lib/install/index.js +104 -29
  9. package/lib/install/index.js.map +1 -1
  10. package/lib/install/index.test.d.ts +1 -0
  11. package/lib/install/index.test.js +57 -0
  12. package/lib/install/index.test.js.map +1 -0
  13. package/lib/link/index.d.ts +11 -0
  14. package/lib/link/index.js +144 -0
  15. package/lib/link/index.js.map +1 -0
  16. package/lib/link/options.d.ts +32 -0
  17. package/lib/link/options.js +38 -0
  18. package/lib/link/options.js.map +1 -0
  19. package/package.json +67 -67
  20. package/lib/install/checkCompatibility/BreakingChangeError.d.ts +0 -12
  21. package/lib/install/checkCompatibility/BreakingChangeError.js +0 -14
  22. package/lib/install/checkCompatibility/BreakingChangeError.js.map +0 -1
  23. package/lib/install/checkCompatibility/ErrorRelatedSources.d.ts +0 -5
  24. package/lib/install/checkCompatibility/ErrorRelatedSources.js +0 -3
  25. package/lib/install/checkCompatibility/ErrorRelatedSources.js.map +0 -1
  26. package/lib/install/checkCompatibility/ModulesBreakingChangeError.d.ts +0 -9
  27. package/lib/install/checkCompatibility/ModulesBreakingChangeError.js +0 -18
  28. package/lib/install/checkCompatibility/ModulesBreakingChangeError.js.map +0 -1
  29. package/lib/install/checkCompatibility/UnexpectedStoreError.d.ts +0 -11
  30. package/lib/install/checkCompatibility/UnexpectedStoreError.js +0 -14
  31. package/lib/install/checkCompatibility/UnexpectedStoreError.js.map +0 -1
  32. package/lib/install/checkCompatibility/UnexpectedVirtualStoreDirError.d.ts +0 -11
  33. package/lib/install/checkCompatibility/UnexpectedVirtualStoreDirError.js +0 -14
  34. package/lib/install/checkCompatibility/UnexpectedVirtualStoreDirError.js.map +0 -1
  35. package/lib/install/checkCompatibility/index.d.ts +0 -6
  36. package/lib/install/checkCompatibility/index.js +0 -38
  37. package/lib/install/checkCompatibility/index.js.map +0 -1
  38. package/lib/install/validateModules.d.ts +0 -26
  39. package/lib/install/validateModules.js +0 -138
  40. package/lib/install/validateModules.js.map +0 -1
@@ -0,0 +1,144 @@
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.link = link;
7
+ const path_1 = __importDefault(require("path"));
8
+ const core_loggers_1 = require("@pnpm/core-loggers");
9
+ const error_1 = require("@pnpm/error");
10
+ const get_context_1 = require("@pnpm/get-context");
11
+ const link_bins_1 = require("@pnpm/link-bins");
12
+ const lockfile_fs_1 = require("@pnpm/lockfile.fs");
13
+ const logger_1 = require("@pnpm/logger");
14
+ const manifest_utils_1 = require("@pnpm/manifest-utils");
15
+ const lockfile_pruner_1 = require("@pnpm/lockfile.pruner");
16
+ const read_project_manifest_1 = require("@pnpm/read-project-manifest");
17
+ const symlink_dependency_1 = require("@pnpm/symlink-dependency");
18
+ const types_1 = require("@pnpm/types");
19
+ const normalize_path_1 = __importDefault(require("normalize-path"));
20
+ const options_1 = require("./options");
21
+ async function link(linkFromPkgs, destModules, maybeOpts) {
22
+ const reporter = maybeOpts?.reporter;
23
+ if ((reporter != null) && typeof reporter === 'function') {
24
+ logger_1.streamParser.on('data', reporter);
25
+ }
26
+ const opts = await (0, options_1.extendOptions)(maybeOpts);
27
+ const ctx = await (0, get_context_1.getContextForSingleImporter)(opts.manifest, {
28
+ ...opts,
29
+ extraBinPaths: [], // ctx.extraBinPaths is not needed, so this is fine
30
+ }, true);
31
+ const importerId = (0, lockfile_fs_1.getLockfileImporterId)(ctx.lockfileDir, opts.dir);
32
+ const specsToUpsert = [];
33
+ const linkedPkgs = await Promise.all(linkFromPkgs.map(async (linkFrom) => {
34
+ let linkFromPath;
35
+ let linkFromAlias;
36
+ if (typeof linkFrom === 'string') {
37
+ linkFromPath = linkFrom;
38
+ }
39
+ else {
40
+ linkFromPath = linkFrom.path;
41
+ linkFromAlias = linkFrom.alias;
42
+ }
43
+ const { manifest } = await (0, read_project_manifest_1.readProjectManifest)(linkFromPath);
44
+ if (typeof linkFrom === 'string' && manifest.name === undefined) {
45
+ throw new error_1.PnpmError('INVALID_PACKAGE_NAME', `Package in ${linkFromPath} must have a name field to be linked`);
46
+ }
47
+ const targetDependencyType = (0, manifest_utils_1.getDependencyTypeFromManifest)(opts.manifest, manifest.name) ?? opts.targetDependenciesField;
48
+ specsToUpsert.push({
49
+ alias: manifest.name,
50
+ pref: (0, manifest_utils_1.getPref)(manifest.name, manifest.name, manifest.version, {
51
+ pinnedVersion: opts.pinnedVersion,
52
+ }),
53
+ saveType: (targetDependencyType ?? (ctx.manifest && (0, manifest_utils_1.guessDependencyType)(manifest.name, ctx.manifest))),
54
+ });
55
+ const packagePath = (0, normalize_path_1.default)(path_1.default.relative(opts.dir, linkFromPath));
56
+ const addLinkOpts = {
57
+ linkedPkgName: linkFromAlias ?? manifest.name,
58
+ manifest: ctx.manifest,
59
+ packagePath,
60
+ };
61
+ addLinkToLockfile(ctx.currentLockfile.importers[importerId], addLinkOpts);
62
+ addLinkToLockfile(ctx.wantedLockfile.importers[importerId], addLinkOpts);
63
+ return {
64
+ alias: linkFromAlias ?? manifest.name,
65
+ manifest,
66
+ path: linkFromPath,
67
+ };
68
+ }));
69
+ const updatedCurrentLockfile = (0, lockfile_pruner_1.pruneSharedLockfile)(ctx.currentLockfile);
70
+ const warn = (message) => {
71
+ logger_1.logger.warn({ message, prefix: opts.dir });
72
+ };
73
+ const updatedWantedLockfile = (0, lockfile_pruner_1.pruneSharedLockfile)(ctx.wantedLockfile, { warn });
74
+ // Linking should happen after removing orphans
75
+ // Otherwise would've been removed
76
+ await Promise.all(linkedPkgs.map(async ({ alias, manifest, path }) => {
77
+ // TODO: cover with test that linking reports with correct dependency types
78
+ const stu = specsToUpsert.find((s) => s.alias === manifest.name);
79
+ const targetDependencyType = (0, manifest_utils_1.getDependencyTypeFromManifest)(opts.manifest, manifest.name) ?? opts.targetDependenciesField;
80
+ await (0, symlink_dependency_1.symlinkDirectRootDependency)(path, destModules, alias, {
81
+ fromDependenciesField: stu?.saveType ?? targetDependencyType,
82
+ linkedPackage: manifest,
83
+ prefix: opts.dir,
84
+ });
85
+ }));
86
+ const linkToBin = maybeOpts?.linkToBin ?? path_1.default.join(destModules, '.bin');
87
+ await (0, link_bins_1.linkBinsOfPackages)(linkedPkgs.map((p) => ({ manifest: p.manifest, location: p.path })), linkToBin, {
88
+ extraNodePaths: ctx.extraNodePaths,
89
+ preferSymlinkedExecutables: opts.preferSymlinkedExecutables,
90
+ });
91
+ let newPkg;
92
+ if (opts.targetDependenciesField) {
93
+ newPkg = await (0, manifest_utils_1.updateProjectManifestObject)(opts.dir, opts.manifest, specsToUpsert);
94
+ for (const { alias } of specsToUpsert) {
95
+ updatedWantedLockfile.importers[importerId].specifiers[alias] = (0, manifest_utils_1.getSpecFromPackageManifest)(newPkg, alias);
96
+ }
97
+ }
98
+ else {
99
+ newPkg = opts.manifest;
100
+ }
101
+ const lockfileOpts = { useGitBranchLockfile: opts.useGitBranchLockfile, mergeGitBranchLockfiles: opts.mergeGitBranchLockfiles };
102
+ if (opts.useLockfile) {
103
+ await (0, lockfile_fs_1.writeLockfiles)({
104
+ currentLockfile: updatedCurrentLockfile,
105
+ currentLockfileDir: ctx.virtualStoreDir,
106
+ wantedLockfile: updatedWantedLockfile,
107
+ wantedLockfileDir: ctx.lockfileDir,
108
+ ...lockfileOpts,
109
+ });
110
+ }
111
+ else {
112
+ await (0, lockfile_fs_1.writeCurrentLockfile)(ctx.virtualStoreDir, updatedCurrentLockfile);
113
+ }
114
+ core_loggers_1.summaryLogger.debug({ prefix: opts.dir });
115
+ if ((reporter != null) && typeof reporter === 'function') {
116
+ logger_1.streamParser.removeListener('data', reporter);
117
+ }
118
+ return newPkg;
119
+ }
120
+ function addLinkToLockfile(projectSnapshot, opts) {
121
+ const id = `link:${opts.packagePath}`;
122
+ let addedTo;
123
+ for (const depType of types_1.DEPENDENCIES_FIELDS) {
124
+ if (!addedTo && opts.manifest?.[depType]?.[opts.linkedPkgName]) {
125
+ addedTo = depType;
126
+ projectSnapshot[depType] = projectSnapshot[depType] ?? {};
127
+ projectSnapshot[depType][opts.linkedPkgName] = id;
128
+ }
129
+ else if (projectSnapshot[depType] != null) {
130
+ delete projectSnapshot[depType][opts.linkedPkgName];
131
+ }
132
+ }
133
+ // package.json might not be available when linking to global
134
+ if (opts.manifest == null)
135
+ return;
136
+ const availableSpec = (0, manifest_utils_1.getSpecFromPackageManifest)(opts.manifest, opts.linkedPkgName);
137
+ if (availableSpec) {
138
+ projectSnapshot.specifiers[opts.linkedPkgName] = availableSpec;
139
+ }
140
+ else {
141
+ delete projectSnapshot.specifiers[opts.linkedPkgName];
142
+ }
143
+ }
144
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/link/index.ts"],"names":[],"mappings":";;;;;AA4CA,oBAmHC;AA/JD,gDAAuB;AACvB,qDAE2B;AAC3B,uCAAuC;AACvC,mDAA+D;AAC/D,+CAAoD;AACpD,mDAK0B;AAC1B,yCAAmD;AACnD,yDAO6B;AAC7B,2DAA2D;AAC3D,uEAAiE;AACjE,iEAAsE;AACtE,uCAKoB;AACpB,oEAAsC;AACtC,uCAGkB;AASX,KAAK,UAAU,IAAI,CACxB,YAA6D,EAC7D,WAAmB,EACnB,SAA8B;IAE9B,MAAM,QAAQ,GAAG,SAAS,EAAE,QAAQ,CAAA;IACpC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE,CAAC;QACzD,qBAAY,CAAC,EAAE,CAAC,MAA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I,2BAAmB,EAAE,CAAC;QAC1C,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC;YAC/D,OAAO,GAAG,OAAO,CAAA;YACjB,eAAe,CAAC,OAAO,CAAC,GAAG,eAAe,CAAC,OAAO,CAAC,IAAI,EAAE,CAAA;YACzD,eAAe,CAAC,OAAO,CAAE,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,EAAE,CAAA;QACpD,CAAC;aAAM,IAAI,eAAe,CAAC,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC;YAC5C,OAAO,eAAe,CAAC,OAAO,CAAE,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;QACtD,CAAC;IACH,CAAC;IAED,6DAA6D;IAC7D,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI;QAAE,OAAM;IAEjC,MAAM,aAAa,GAAG,IAAA,2CAA0B,EAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,aAAa,CAAC,CAAA;IACnF,IAAI,aAAa,EAAE,CAAC;QAClB,eAAe,CAAC,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,aAAa,CAAA;IAChE,CAAC;SAAM,CAAC;QACN,OAAO,eAAe,CAAC,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;IACvD,CAAC;AACH,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { type StoreController } from '@pnpm/store-controller-types';
2
+ import { type DependenciesField, type ProjectManifest, type Registries } from '@pnpm/types';
3
+ import { type ReporterFunction } from '../types';
4
+ interface StrictLinkOptions {
5
+ autoInstallPeers: boolean;
6
+ binsDir: string;
7
+ excludeLinksFromLockfile: boolean;
8
+ force: boolean;
9
+ useLockfile: boolean;
10
+ lockfileDir: string;
11
+ nodeLinker: 'isolated' | 'hoisted' | 'pnp';
12
+ pinnedVersion: 'major' | 'minor' | 'patch';
13
+ storeController: StoreController;
14
+ manifest: ProjectManifest;
15
+ registries: Registries;
16
+ storeDir: string;
17
+ reporter: ReporterFunction;
18
+ targetDependenciesField?: DependenciesField;
19
+ dir: string;
20
+ preferSymlinkedExecutables: boolean;
21
+ hoistPattern: string[] | undefined;
22
+ forceHoistPattern: boolean;
23
+ publicHoistPattern: string[] | undefined;
24
+ forcePublicHoistPattern: boolean;
25
+ useGitBranchLockfile: boolean;
26
+ mergeGitBranchLockfiles: boolean;
27
+ virtualStoreDirMaxLength: number;
28
+ peersSuffixMaxLength: number;
29
+ }
30
+ export type LinkOptions = Partial<StrictLinkOptions> & Pick<StrictLinkOptions, 'storeController' | 'manifest'>;
31
+ export declare function extendOptions(opts: LinkOptions): Promise<StrictLinkOptions>;
32
+ export {};
@@ -0,0 +1,38 @@
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.extendOptions = extendOptions;
7
+ const path_1 = __importDefault(require("path"));
8
+ const normalize_registries_1 = require("@pnpm/normalize-registries");
9
+ async function extendOptions(opts) {
10
+ if (opts) {
11
+ for (const key in opts) {
12
+ if (opts[key] === undefined) {
13
+ delete opts[key];
14
+ }
15
+ }
16
+ }
17
+ const defaultOpts = await defaults(opts);
18
+ const extendedOpts = { ...defaultOpts, ...opts, storeDir: defaultOpts.storeDir };
19
+ extendedOpts.registries = (0, normalize_registries_1.normalizeRegistries)(extendedOpts.registries);
20
+ return extendedOpts;
21
+ }
22
+ async function defaults(opts) {
23
+ const dir = opts.dir ?? process.cwd();
24
+ return {
25
+ binsDir: path_1.default.join(dir, 'node_modules', '.bin'),
26
+ dir,
27
+ force: false,
28
+ hoistPattern: undefined,
29
+ lockfileDir: opts.lockfileDir ?? dir,
30
+ nodeLinker: 'isolated',
31
+ registries: normalize_registries_1.DEFAULT_REGISTRIES,
32
+ storeController: opts.storeController,
33
+ storeDir: opts.storeDir,
34
+ useLockfile: true,
35
+ virtualStoreDirMaxLength: 120,
36
+ };
37
+ }
38
+ //# sourceMappingURL=options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"options.js","sourceRoot":"","sources":["../../src/link/options.ts"],"names":[],"mappings":";;;;;AA4CA,sCAYC;AAxDD,gDAAuB;AACvB,qEAAoF;AA2C7E,KAAK,UAAU,aAAa,CAAE,IAAiB;IACpD,IAAI,IAAI,EAAE,CAAC;QACT,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;YACvB,IAAI,IAAI,CAAC,GAAwB,CAAC,KAAK,SAAS,EAAE,CAAC;gBACjD,OAAO,IAAI,CAAC,GAAwB,CAAC,CAAA;YACvC,CAAC;QACH,CAAC;IACH,CAAC;IACD,MAAM,WAAW,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,CAAA;IACxC,MAAM,YAAY,GAAG,EAAE,GAAG,WAAW,EAAE,GAAG,IAAI,EAAE,QAAQ,EAAE,WAAW,CAAC,QAAQ,EAAE,CAAA;IAChF,YAAY,CAAC,UAAU,GAAG,IAAA,0CAAmB,EAAC,YAAY,CAAC,UAAU,CAAC,CAAA;IACtE,OAAO,YAAY,CAAA;AACrB,CAAC;AAED,KAAK,UAAU,QAAQ,CAAE,IAAiB;IACxC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,CAAA;IACrC,OAAO;QACL,OAAO,EAAE,cAAI,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,EAAE,MAAM,CAAC;QAC/C,GAAG;QACH,KAAK,EAAE,KAAK;QACZ,YAAY,EAAE,SAAS;QACvB,WAAW,EAAE,IAAI,CAAC,WAAW,IAAI,GAAG;QACpC,UAAU,EAAE,UAAU;QACtB,UAAU,EAAE,yCAAkB;QAC9B,eAAe,EAAE,IAAI,CAAC,eAAe;QACrC,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,WAAW,EAAE,IAAI;QACjB,wBAAwB,EAAE,GAAG;KACT,CAAA;AACxB,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pnpm/core",
3
3
  "description": "Fast, disk space efficient installation engine",
4
- "version": "16.0.0",
4
+ "version": "900.0.0",
5
5
  "bugs": {
6
6
  "url": "https://github.com/pnpm/pnpm/issues"
7
7
  },
@@ -12,15 +12,13 @@
12
12
  "!*.map"
13
13
  ],
14
14
  "peerDependencies": {
15
- "@pnpm/logger": "^5.1.0",
16
- "@pnpm/worker": "^2.0.0"
15
+ "@pnpm/logger": ">=5.1.0 <901.0.0",
16
+ "@pnpm/worker": "^900.0.0"
17
17
  },
18
18
  "dependencies": {
19
19
  "@pnpm/builder.policy": "3.0.0",
20
20
  "@pnpm/npm-package-arg": "^1.0.0",
21
21
  "@zkochan/rimraf": "^3.0.2",
22
- "ci-info": "^3.9.0",
23
- "enquirer": "^2.4.1",
24
22
  "is-inner-link": "^4.0.0",
25
23
  "is-subdir": "^1.2.0",
26
24
  "load-json-file": "^6.2.0",
@@ -31,51 +29,52 @@
31
29
  "ramda": "npm:@pnpm/ramda@0.28.1",
32
30
  "run-groups": "^3.0.1",
33
31
  "semver": "^7.6.2",
34
- "@pnpm/calc-dep-state": "7.0.11",
35
- "@pnpm/catalogs.protocol-parser": "0.1.0",
36
- "@pnpm/catalogs.types": "0.1.0",
37
- "@pnpm/core-loggers": "10.0.7",
38
- "@pnpm/constants": "10.0.0",
39
- "@pnpm/crypto.hash": "1.0.0",
40
- "@pnpm/dependency-path": "6.0.0",
41
- "@pnpm/crypto.object-hasher": "3.0.0",
42
- "@pnpm/deps.graph-sequencer": "2.0.1",
43
- "@pnpm/get-context": "13.0.0",
44
- "@pnpm/error": "6.0.3",
45
- "@pnpm/headless": "24.0.0",
46
- "@pnpm/hoist": "9.1.16",
47
- "@pnpm/build-modules": "14.0.6",
48
- "@pnpm/hooks.read-package-hook": "6.0.0",
49
- "@pnpm/hooks.types": "2.0.9",
50
- "@pnpm/lifecycle": "17.1.6",
51
- "@pnpm/link-bins": "10.0.12",
52
- "@pnpm/lockfile-to-pnp": "4.1.15",
53
- "@pnpm/lockfile.filtering": "1.0.8",
54
- "@pnpm/lockfile.fs": "1.0.6",
55
- "@pnpm/lockfile.preferred-versions": "1.0.15",
56
- "@pnpm/lockfile.utils": "1.0.5",
57
- "@pnpm/lockfile.pruner": "0.0.7",
58
- "@pnpm/lockfile.settings-checker": "1.0.2",
59
- "@pnpm/lockfile.verification": "1.1.0",
60
- "@pnpm/manifest-utils": "6.0.10",
61
- "@pnpm/lockfile.walker": "1.0.5",
62
- "@pnpm/matcher": "6.0.0",
63
- "@pnpm/modules-cleaner": "15.1.17",
64
- "@pnpm/normalize-registries": "6.0.7",
65
- "@pnpm/modules-yaml": "13.1.7",
66
- "@pnpm/package-requester": "26.0.0",
67
- "@pnpm/parse-overrides": "5.1.2",
68
- "@pnpm/parse-wanted-dependency": "6.0.0",
69
- "@pnpm/pkg-manager.direct-dep-linker": "3.0.8",
70
- "@pnpm/read-project-manifest": "6.0.10",
71
- "@pnpm/read-modules-dir": "7.0.0",
72
- "@pnpm/resolve-dependencies": "36.0.7",
73
- "@pnpm/remove-bins": "6.0.10",
74
- "@pnpm/resolver-base": "13.0.4",
75
- "@pnpm/store-controller-types": "18.1.6",
76
- "@pnpm/symlink-dependency": "8.0.8",
77
- "@pnpm/which-version-is-pinned": "6.0.0",
78
- "@pnpm/types": "12.2.0"
32
+ "sort-keys": "^4.2.0",
33
+ "@pnpm/catalogs.types": "900.0.0",
34
+ "@pnpm/build-modules": "900.0.0",
35
+ "@pnpm/calc-dep-state": "900.0.0",
36
+ "@pnpm/catalogs.protocol-parser": "900.0.0",
37
+ "@pnpm/core-loggers": "900.0.0",
38
+ "@pnpm/crypto.base32-hash": "900.0.0",
39
+ "@pnpm/dependency-path": "900.0.0",
40
+ "@pnpm/crypto.polyfill": "900.0.0",
41
+ "@pnpm/deps.graph-sequencer": "900.0.0",
42
+ "@pnpm/constants": "900.0.0",
43
+ "@pnpm/error": "900.0.0",
44
+ "@pnpm/get-context": "900.0.0",
45
+ "@pnpm/headless": "900.0.0",
46
+ "@pnpm/hoist": "900.0.0",
47
+ "@pnpm/hooks.read-package-hook": "900.0.0",
48
+ "@pnpm/hooks.types": "900.0.0",
49
+ "@pnpm/lifecycle": "900.0.0",
50
+ "@pnpm/lockfile-to-pnp": "900.0.0",
51
+ "@pnpm/link-bins": "900.0.0",
52
+ "@pnpm/lockfile.fs": "900.0.0",
53
+ "@pnpm/lockfile.filtering": "900.0.0",
54
+ "@pnpm/lockfile.pruner": "900.0.0",
55
+ "@pnpm/lockfile.preferred-versions": "900.0.0",
56
+ "@pnpm/lockfile.utils": "900.0.0",
57
+ "@pnpm/lockfile.settings-checker": "900.0.0",
58
+ "@pnpm/lockfile.verification": "900.0.0",
59
+ "@pnpm/modules-cleaner": "900.0.0",
60
+ "@pnpm/manifest-utils": "900.0.0",
61
+ "@pnpm/lockfile.walker": "900.0.0",
62
+ "@pnpm/matcher": "900.0.0",
63
+ "@pnpm/normalize-registries": "900.0.0",
64
+ "@pnpm/package-requester": "900.0.0",
65
+ "@pnpm/modules-yaml": "900.0.0",
66
+ "@pnpm/pkg-manager.direct-dep-linker": "900.0.0",
67
+ "@pnpm/parse-overrides": "900.0.0",
68
+ "@pnpm/parse-wanted-dependency": "900.0.0",
69
+ "@pnpm/read-project-manifest": "900.0.0",
70
+ "@pnpm/resolve-dependencies": "900.0.0",
71
+ "@pnpm/read-modules-dir": "900.0.0",
72
+ "@pnpm/resolver-base": "900.0.0",
73
+ "@pnpm/remove-bins": "900.0.0",
74
+ "@pnpm/store-controller-types": "900.0.0",
75
+ "@pnpm/symlink-dependency": "900.0.0",
76
+ "@pnpm/types": "900.0.0",
77
+ "@pnpm/which-version-is-pinned": "900.0.0"
79
78
  },
80
79
  "devDependencies": {
81
80
  "@pnpm/registry-mock": "3.43.0",
@@ -85,7 +84,7 @@
85
84
  "@types/ramda": "0.29.12",
86
85
  "@types/semver": "7.5.3",
87
86
  "@types/sinon": "^10.0.20",
88
- "@yarnpkg/core": "4.0.5",
87
+ "@yarnpkg/core": "4.0.3",
89
88
  "ci-info": "^3.9.0",
90
89
  "deep-require-cwd": "1.0.0",
91
90
  "execa": "npm:safe-execa@0.1.2",
@@ -96,30 +95,31 @@
96
95
  "read-yaml-file": "^2.1.0",
97
96
  "resolve-link-target": "^2.0.0",
98
97
  "sinon": "^16.1.3",
99
- "symlink-dir": "^6.0.3",
98
+ "symlink-dir": "^6.0.2",
100
99
  "write-json-file": "^4.3.0",
101
100
  "write-yaml-file": "^5.0.0",
102
- "@pnpm/assert-project": "3.0.0",
103
- "@pnpm/assert-store": "2.0.0",
104
- "@pnpm/client": "11.1.13",
105
- "@pnpm/core": "16.0.0",
106
- "@pnpm/git-utils": "2.0.0",
107
- "@pnpm/logger": "5.2.0",
108
- "@pnpm/package-store": "21.0.0",
109
- "@pnpm/lockfile.types": "1.0.3",
110
- "@pnpm/prepare": "0.0.106",
111
- "@pnpm/read-package-json": "9.0.10",
112
- "@pnpm/store-path": "9.0.3",
113
- "@pnpm/store.cafs": "5.0.0",
114
- "@pnpm/test-ipc-server": "0.0.0",
115
- "@pnpm/test-fixtures": "0.1.36"
101
+ "@pnpm/assert-project": "2.3.62",
102
+ "@pnpm/assert-store": "1.0.92",
103
+ "@pnpm/crypto.object-hasher": "900.0.0",
104
+ "@pnpm/core": "900.0.0",
105
+ "@pnpm/client": "900.0.0",
106
+ "@pnpm/lockfile.types": "900.0.0",
107
+ "@pnpm/logger": "900.0.0",
108
+ "@pnpm/package-store": "900.0.0",
109
+ "@pnpm/prepare": "0.0.105",
110
+ "@pnpm/store-path": "900.0.0",
111
+ "@pnpm/read-package-json": "900.0.0",
112
+ "@pnpm/git-utils": "900.0.0",
113
+ "@pnpm/store.cafs": "900.0.0",
114
+ "@pnpm/test-fixtures": "0.1.35",
115
+ "@pnpm/test-ipc-server": "0.0.0"
116
116
  },
117
117
  "directories": {
118
118
  "test": "test"
119
119
  },
120
120
  "homepage": "https://github.com/pnpm/pnpm/blob/main/pkg-manager/core#readme",
121
121
  "keywords": [
122
- "pnpm10",
122
+ "pnpm9",
123
123
  "dependency manager",
124
124
  "install",
125
125
  "installer",
@@ -1,12 +0,0 @@
1
- import { PnpmError } from '@pnpm/error';
2
- import { type ErrorRelatedSources } from './ErrorRelatedSources';
3
- export type BreakingChangeErrorOptions = ErrorRelatedSources & {
4
- code: string;
5
- message: string;
6
- };
7
- export declare class BreakingChangeError extends PnpmError {
8
- relatedIssue?: number;
9
- relatedPR?: number;
10
- additionalInformation?: string;
11
- constructor(opts: BreakingChangeErrorOptions);
12
- }
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BreakingChangeError = void 0;
4
- const error_1 = require("@pnpm/error");
5
- class BreakingChangeError extends error_1.PnpmError {
6
- constructor(opts) {
7
- super(opts.code, opts.message);
8
- this.relatedIssue = opts.relatedIssue;
9
- this.relatedPR = opts.relatedPR;
10
- this.additionalInformation = opts.additionalInformation;
11
- }
12
- }
13
- exports.BreakingChangeError = BreakingChangeError;
14
- //# sourceMappingURL=BreakingChangeError.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BreakingChangeError.js","sourceRoot":"","sources":["../../../src/install/checkCompatibility/BreakingChangeError.ts"],"names":[],"mappings":";;;AAAA,uCAAuC;AAQvC,MAAa,mBAAoB,SAAQ,iBAAS;IAIhD,YAAa,IAAgC;QAC3C,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;QAC9B,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAA;QACrC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAA;QAC/B,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC,qBAAqB,CAAA;IACzD,CAAC;CACF;AAVD,kDAUC"}
@@ -1,5 +0,0 @@
1
- export interface ErrorRelatedSources {
2
- additionalInformation?: string;
3
- relatedIssue?: number;
4
- relatedPR?: number;
5
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=ErrorRelatedSources.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ErrorRelatedSources.js","sourceRoot":"","sources":["../../../src/install/checkCompatibility/ErrorRelatedSources.ts"],"names":[],"mappings":""}
@@ -1,9 +0,0 @@
1
- import { BreakingChangeError } from './BreakingChangeError';
2
- import { type ErrorRelatedSources } from './ErrorRelatedSources';
3
- export type ModulesBreakingChangeErrorOptions = ErrorRelatedSources & {
4
- modulesPath: string;
5
- };
6
- export declare class ModulesBreakingChangeError extends BreakingChangeError {
7
- modulesPath: string;
8
- constructor(opts: ModulesBreakingChangeErrorOptions);
9
- }
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ModulesBreakingChangeError = void 0;
4
- const BreakingChangeError_1 = require("./BreakingChangeError");
5
- class ModulesBreakingChangeError extends BreakingChangeError_1.BreakingChangeError {
6
- constructor(opts) {
7
- super({
8
- additionalInformation: opts.additionalInformation,
9
- code: 'MODULES_BREAKING_CHANGE',
10
- message: `The node_modules structure at "${opts.modulesPath}" is not compatible with the current pnpm version. Run "pnpm install --force" to recreate node_modules.`,
11
- relatedIssue: opts.relatedIssue,
12
- relatedPR: opts.relatedPR,
13
- });
14
- this.modulesPath = opts.modulesPath;
15
- }
16
- }
17
- exports.ModulesBreakingChangeError = ModulesBreakingChangeError;
18
- //# sourceMappingURL=ModulesBreakingChangeError.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ModulesBreakingChangeError.js","sourceRoot":"","sources":["../../../src/install/checkCompatibility/ModulesBreakingChangeError.ts"],"names":[],"mappings":";;;AAAA,+DAA2D;AAO3D,MAAa,0BAA2B,SAAQ,yCAAmB;IAEjE,YAAa,IAAuC;QAClD,KAAK,CAAC;YACJ,qBAAqB,EAAE,IAAI,CAAC,qBAAqB;YACjD,IAAI,EAAE,yBAAyB;YAC/B,OAAO,EAAE,kCAAkC,IAAI,CAAC,WAAW,yGAAyG;YACpK,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,SAAS,EAAE,IAAI,CAAC,SAAS;SAC1B,CAAC,CAAA;QACF,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAA;IACrC,CAAC;CACF;AAZD,gEAYC"}
@@ -1,11 +0,0 @@
1
- import { PnpmError } from '@pnpm/error';
2
- export declare class UnexpectedStoreError extends PnpmError {
3
- expectedStorePath: string;
4
- actualStorePath: string;
5
- modulesDir: string;
6
- constructor(opts: {
7
- expectedStorePath: string;
8
- actualStorePath: string;
9
- modulesDir: string;
10
- });
11
- }
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UnexpectedStoreError = void 0;
4
- const error_1 = require("@pnpm/error");
5
- class UnexpectedStoreError extends error_1.PnpmError {
6
- constructor(opts) {
7
- super('UNEXPECTED_STORE', 'Unexpected store location');
8
- this.expectedStorePath = opts.expectedStorePath;
9
- this.actualStorePath = opts.actualStorePath;
10
- this.modulesDir = opts.modulesDir;
11
- }
12
- }
13
- exports.UnexpectedStoreError = UnexpectedStoreError;
14
- //# sourceMappingURL=UnexpectedStoreError.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"UnexpectedStoreError.js","sourceRoot":"","sources":["../../../src/install/checkCompatibility/UnexpectedStoreError.ts"],"names":[],"mappings":";;;AAAA,uCAAuC;AAEvC,MAAa,oBAAqB,SAAQ,iBAAS;IAIjD,YACE,IAIC;QAED,KAAK,CAAC,kBAAkB,EAAE,2BAA2B,CAAC,CAAA;QACtD,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,iBAAiB,CAAA;QAC/C,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,eAAe,CAAA;QAC3C,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAA;IACnC,CAAC;CACF;AAhBD,oDAgBC"}
@@ -1,11 +0,0 @@
1
- import { PnpmError } from '@pnpm/error';
2
- export declare class UnexpectedVirtualStoreDirError extends PnpmError {
3
- expected: string;
4
- actual: string;
5
- modulesDir: string;
6
- constructor(opts: {
7
- expected: string;
8
- actual: string;
9
- modulesDir: string;
10
- });
11
- }
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UnexpectedVirtualStoreDirError = void 0;
4
- const error_1 = require("@pnpm/error");
5
- class UnexpectedVirtualStoreDirError extends error_1.PnpmError {
6
- constructor(opts) {
7
- super('UNEXPECTED_VIRTUAL_STORE', 'Unexpected virtual store location');
8
- this.expected = opts.expected;
9
- this.actual = opts.actual;
10
- this.modulesDir = opts.modulesDir;
11
- }
12
- }
13
- exports.UnexpectedVirtualStoreDirError = UnexpectedVirtualStoreDirError;
14
- //# sourceMappingURL=UnexpectedVirtualStoreDirError.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"UnexpectedVirtualStoreDirError.js","sourceRoot":"","sources":["../../../src/install/checkCompatibility/UnexpectedVirtualStoreDirError.ts"],"names":[],"mappings":";;;AAAA,uCAAuC;AAEvC,MAAa,8BAA+B,SAAQ,iBAAS;IAI3D,YACE,IAIC;QAED,KAAK,CAAC,0BAA0B,EAAE,mCAAmC,CAAC,CAAA;QACtE,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAA;QAC7B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAA;QACzB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAA;IACnC,CAAC;CACF;AAhBD,wEAgBC"}
@@ -1,6 +0,0 @@
1
- import { type Modules } from '@pnpm/modules-yaml';
2
- export declare function checkCompatibility(modules: Modules, opts: {
3
- storeDir: string;
4
- modulesDir: string;
5
- virtualStoreDir: string;
6
- }): void;
@@ -1,38 +0,0 @@
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.checkCompatibility = checkCompatibility;
7
- const path_1 = __importDefault(require("path"));
8
- const constants_1 = require("@pnpm/constants");
9
- const ModulesBreakingChangeError_1 = require("./ModulesBreakingChangeError");
10
- const UnexpectedStoreError_1 = require("./UnexpectedStoreError");
11
- const UnexpectedVirtualStoreDirError_1 = require("./UnexpectedVirtualStoreDirError");
12
- function checkCompatibility(modules, opts) {
13
- if (!modules.layoutVersion || modules.layoutVersion !== constants_1.LAYOUT_VERSION) {
14
- throw new ModulesBreakingChangeError_1.ModulesBreakingChangeError({
15
- modulesPath: opts.modulesDir,
16
- });
17
- }
18
- // Important: comparing paths with path.relative()
19
- // is the only way to compare paths correctly on Windows
20
- // as of Node.js 4-9
21
- // See related issue: https://github.com/pnpm/pnpm/issues/996
22
- if (!modules.storeDir ||
23
- path_1.default.relative(modules.storeDir, opts.storeDir) !== '' && path_1.default.relative(modules.storeDir, path_1.default.join(opts.storeDir, '../v3')) !== '') {
24
- throw new UnexpectedStoreError_1.UnexpectedStoreError({
25
- actualStorePath: opts.storeDir,
26
- expectedStorePath: modules.storeDir,
27
- modulesDir: opts.modulesDir,
28
- });
29
- }
30
- if (modules.virtualStoreDir && path_1.default.relative(modules.virtualStoreDir, opts.virtualStoreDir) !== '') {
31
- throw new UnexpectedVirtualStoreDirError_1.UnexpectedVirtualStoreDirError({
32
- actual: opts.virtualStoreDir,
33
- expected: modules.virtualStoreDir,
34
- modulesDir: opts.modulesDir,
35
- });
36
- }
37
- }
38
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/install/checkCompatibility/index.ts"],"names":[],"mappings":";;;;;AAOA,gDAkCC;AAzCD,gDAAuB;AACvB,+CAAgD;AAEhD,6EAAyE;AACzE,iE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