@proteinjs/reflection-build 2.0.2 → 2.1.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.
- package/CHANGELOG.md +24 -0
- package/dist/src/ReflectionDoctor.d.ts +6 -1
- package/dist/src/ReflectionDoctor.js +53 -51
- package/dist/src/ReflectionDoctor.js.map +1 -1
- package/dist/src/codegen/CanonicalSourceGraph.d.ts +22 -0
- package/dist/src/codegen/CanonicalSourceGraph.js +60 -0
- package/dist/src/codegen/CanonicalSourceGraph.js.map +1 -0
- package/dist/src/codegen/writeGeneratedIndex.d.ts +12 -3
- package/dist/src/codegen/writeGeneratedIndex.js +21 -13
- package/dist/src/codegen/writeGeneratedIndex.js.map +1 -1
- package/dist/src/parser/PackageSourceFiles.d.ts +30 -0
- package/dist/src/parser/PackageSourceFiles.js +151 -0
- package/dist/src/parser/PackageSourceFiles.js.map +1 -0
- package/dist/src/parser/SharedQualifiedNames.d.ts +43 -0
- package/dist/src/parser/SharedQualifiedNames.js +81 -0
- package/dist/src/parser/SharedQualifiedNames.js.map +1 -0
- package/dist/src/parser/createGraphBuilder.d.ts +6 -1
- package/dist/src/parser/createGraphBuilder.js +16 -31
- package/dist/src/parser/createGraphBuilder.js.map +1 -1
- package/dist/src/parser/createSourceGraph.d.ts +6 -1
- package/dist/src/parser/createSourceGraph.js +23 -38
- package/dist/src/parser/createSourceGraph.js.map +1 -1
- package/dist/test/Class.test.js +1 -1
- package/dist/test/Class.test.js.map +1 -1
- package/dist/test/ExamplePackageFixture.d.ts +47 -0
- package/dist/test/ExamplePackageFixture.js +207 -0
- package/dist/test/ExamplePackageFixture.js.map +1 -0
- package/dist/test/GraphEmitRelativePaths.test.js +1 -1
- package/dist/test/GraphEmitRelativePaths.test.js.map +1 -1
- package/dist/test/PackageSourceFiles.test.d.ts +1 -0
- package/dist/test/PackageSourceFiles.test.js +57 -0
- package/dist/test/PackageSourceFiles.test.js.map +1 -0
- package/dist/test/ReflectionDoctor.test.js +55 -18
- package/dist/test/ReflectionDoctor.test.js.map +1 -1
- package/dist/test/ReproducibleGeneratedIndex.test.d.ts +1 -0
- package/dist/test/ReproducibleGeneratedIndex.test.js +224 -0
- package/dist/test/ReproducibleGeneratedIndex.test.js.map +1 -0
- package/dist/test/SharedQualifiedNames.test.d.ts +1 -0
- package/dist/test/SharedQualifiedNames.test.js +186 -0
- package/dist/test/SharedQualifiedNames.test.js.map +1 -0
- package/dist/test/examples/reproducible/index.d.ts +4 -0
- package/dist/test/examples/reproducible/index.js +21 -0
- package/dist/test/examples/reproducible/index.js.map +1 -0
- package/dist/test/examples/reproducible/src/alpha/Alpha.d.ts +10 -0
- package/dist/test/examples/reproducible/src/alpha/Alpha.js +18 -0
- package/dist/test/examples/reproducible/src/alpha/Alpha.js.map +1 -0
- package/dist/test/examples/reproducible/src/alpha/Defaults.d.ts +2 -0
- package/dist/test/examples/reproducible/src/alpha/Defaults.js +6 -0
- package/dist/test/examples/reproducible/src/alpha/Defaults.js.map +1 -0
- package/dist/test/examples/reproducible/src/beta/Beta.d.ts +5 -0
- package/dist/test/examples/reproducible/src/beta/Beta.js +12 -0
- package/dist/test/examples/reproducible/src/beta/Beta.js.map +1 -0
- package/dist/test/examples/reproducible/src/beta/deep/Gamma.d.ts +4 -0
- package/dist/test/examples/reproducible/src/beta/deep/Gamma.js +11 -0
- package/dist/test/examples/reproducible/src/beta/deep/Gamma.js.map +1 -0
- package/dist/test/examples/reproducible/src/zeta/Defaults.d.ts +2 -0
- package/dist/test/examples/reproducible/src/zeta/Defaults.js +6 -0
- package/dist/test/examples/reproducible/src/zeta/Defaults.js.map +1 -0
- package/dist/test/examples/reproducible/src/zeta/Zeta.d.ts +7 -0
- package/dist/test/examples/reproducible/src/zeta/Zeta.js +18 -0
- package/dist/test/examples/reproducible/src/zeta/Zeta.js.map +1 -0
- package/dist/test/examples/shared-name/index.d.ts +1 -0
- package/dist/test/examples/shared-name/index.js +18 -0
- package/dist/test/examples/shared-name/index.js.map +1 -0
- package/dist/test/examples/shared-name/src/alpha/Widget.d.ts +4 -0
- package/dist/test/examples/shared-name/src/alpha/Widget.js +3 -0
- package/dist/test/examples/shared-name/src/alpha/Widget.js.map +1 -0
- package/dist/test/examples/shared-name/src/beta/Widget.d.ts +3 -0
- package/dist/test/examples/shared-name/src/beta/Widget.js +13 -0
- package/dist/test/examples/shared-name/src/beta/Widget.js.map +1 -0
- package/dist/test/examples/shared-name/src/gamma/Gear.d.ts +7 -0
- package/dist/test/examples/shared-name/src/gamma/Gear.js +5 -0
- package/dist/test/examples/shared-name/src/gamma/Gear.js.map +1 -0
- package/dist/test/examples/shared-name-pruned/index.d.ts +1 -0
- package/dist/test/examples/shared-name-pruned/index.js +18 -0
- package/dist/test/examples/shared-name-pruned/index.js.map +1 -0
- package/dist/test/examples/shared-name-pruned/src/alpha/Limits.d.ts +3 -0
- package/dist/test/examples/shared-name-pruned/src/alpha/Limits.js +6 -0
- package/dist/test/examples/shared-name-pruned/src/alpha/Limits.js.map +1 -0
- package/dist/test/examples/shared-name-pruned/src/alpha/Shape.d.ts +3 -0
- package/dist/test/examples/shared-name-pruned/src/alpha/Shape.js +3 -0
- package/dist/test/examples/shared-name-pruned/src/alpha/Shape.js.map +1 -0
- package/dist/test/examples/shared-name-pruned/src/alpha/Tile.d.ts +7 -0
- package/dist/test/examples/shared-name-pruned/src/alpha/Tile.js +11 -0
- package/dist/test/examples/shared-name-pruned/src/alpha/Tile.js.map +1 -0
- package/dist/test/examples/shared-name-pruned/src/beta/Limits.d.ts +3 -0
- package/dist/test/examples/shared-name-pruned/src/beta/Limits.js +6 -0
- package/dist/test/examples/shared-name-pruned/src/beta/Limits.js.map +1 -0
- package/dist/test/examples/shared-name-pruned/src/beta/Shape.d.ts +3 -0
- package/dist/test/examples/shared-name-pruned/src/beta/Shape.js +3 -0
- package/dist/test/examples/shared-name-pruned/src/beta/Shape.js.map +1 -0
- package/dist/test/examples/source-repository/a/generated/index.js +28 -28
- package/dist/test/examples/source-repository/a/generated/index.js.map +1 -1
- package/dist/test/examples/source-repository/a/src/ExtendsForeignType.d.ts +1 -1
- package/dist/test/examples/source-repository/a/src/ExtendsForeignType.js +5 -5
- package/dist/test/examples/source-repository/a/src/ExtendsForeignType.js.map +1 -1
- package/dist/test/examples/source-repository/b/generated/index.js +3 -3
- package/dist/test/examples/source-repository/b/generated/index.js.map +1 -1
- package/package.json +5 -5
- package/src/ReflectionDoctor.ts +37 -17
- package/src/codegen/CanonicalSourceGraph.ts +50 -0
- package/src/codegen/writeGeneratedIndex.ts +35 -9
- package/src/parser/PackageSourceFiles.ts +66 -0
- package/src/parser/SharedQualifiedNames.ts +76 -0
- package/src/parser/createGraphBuilder.ts +25 -10
- package/src/parser/createSourceGraph.ts +14 -16
- package/test/Class.test.ts +1 -1
- package/test/ExamplePackageFixture.ts +142 -0
- package/test/GraphEmitRelativePaths.test.ts +1 -1
- package/test/PackageSourceFiles.test.ts +42 -0
- package/test/ReflectionDoctor.test.ts +50 -12
- package/test/ReproducibleGeneratedIndex.test.ts +114 -0
- package/test/SharedQualifiedNames.test.ts +89 -0
- package/test/examples/reproducible/index.ts +4 -0
- package/test/examples/reproducible/src/alpha/Alpha.ts +13 -0
- package/test/examples/reproducible/src/alpha/Defaults.ts +4 -0
- package/test/examples/reproducible/src/beta/Beta.ts +7 -0
- package/test/examples/reproducible/src/beta/deep/Gamma.ts +5 -0
- package/test/examples/reproducible/src/zeta/Defaults.ts +4 -0
- package/test/examples/reproducible/src/zeta/Zeta.ts +9 -0
- package/test/examples/shared-name/index.ts +1 -0
- package/test/examples/shared-name/src/alpha/Widget.ts +6 -0
- package/test/examples/shared-name/src/beta/Widget.ts +5 -0
- package/test/examples/shared-name/src/gamma/Gear.ts +9 -0
- package/test/examples/shared-name-pruned/index.ts +1 -0
- package/test/examples/shared-name-pruned/src/alpha/Limits.ts +2 -0
- package/test/examples/shared-name-pruned/src/alpha/Shape.ts +3 -0
- package/test/examples/shared-name-pruned/src/alpha/Tile.ts +9 -0
- package/test/examples/shared-name-pruned/src/beta/Limits.ts +2 -0
- package/test/examples/shared-name-pruned/src/beta/Shape.ts +4 -0
- package/test/examples/source-repository/a/dist/codegen/CanonicalSourceGraph.d.ts +22 -0
- package/test/examples/source-repository/a/dist/codegen/CanonicalSourceGraph.js +60 -0
- package/test/examples/source-repository/a/dist/codegen/CanonicalSourceGraph.js.map +1 -0
- package/test/examples/source-repository/a/dist/codegen/writeGeneratedIndex.d.ts +12 -3
- package/test/examples/source-repository/a/dist/codegen/writeGeneratedIndex.js +21 -13
- package/test/examples/source-repository/a/dist/codegen/writeGeneratedIndex.js.map +1 -1
- package/test/examples/source-repository/a/dist/generated/index.js +28 -28
- package/test/examples/source-repository/a/dist/generated/index.js.map +1 -1
- package/test/examples/source-repository/a/dist/parser/PackageSourceFiles.d.ts +30 -0
- package/test/examples/source-repository/a/dist/parser/PackageSourceFiles.js +151 -0
- package/test/examples/source-repository/a/dist/parser/PackageSourceFiles.js.map +1 -0
- package/test/examples/source-repository/a/dist/parser/SharedQualifiedNames.d.ts +43 -0
- package/test/examples/source-repository/a/dist/parser/SharedQualifiedNames.js +81 -0
- package/test/examples/source-repository/a/dist/parser/SharedQualifiedNames.js.map +1 -0
- package/test/examples/source-repository/a/dist/parser/createGraphBuilder.d.ts +6 -1
- package/test/examples/source-repository/a/dist/parser/createGraphBuilder.js +16 -31
- package/test/examples/source-repository/a/dist/parser/createGraphBuilder.js.map +1 -1
- package/test/examples/source-repository/a/dist/parser/createSourceGraph.d.ts +6 -1
- package/test/examples/source-repository/a/dist/parser/createSourceGraph.js +23 -38
- package/test/examples/source-repository/a/dist/parser/createSourceGraph.js.map +1 -1
- package/test/examples/source-repository/a/dist/src/ExtendsForeignType.d.ts +1 -1
- package/test/examples/source-repository/a/dist/src/ExtendsForeignType.js +5 -5
- package/test/examples/source-repository/a/dist/src/ExtendsForeignType.js.map +1 -1
- package/test/examples/source-repository/a/generated/index.ts +44 -44
- package/test/examples/source-repository/a/node_modules/.package-lock.json +13 -13
- package/test/examples/source-repository/a/node_modules/@proteinjs/util/CHANGELOG.md +8 -0
- package/test/examples/source-repository/a/node_modules/@proteinjs/util/LICENSE +21 -0
- package/test/examples/source-repository/a/node_modules/@proteinjs/util/package.json +3 -2
- package/test/examples/source-repository/a/node_modules/@proteinjs/util/tsconfig.json +1 -0
- package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/CHANGELOG.md +63 -0
- package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/LICENSE +21 -0
- package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/dist/index.d.ts +1 -0
- package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/dist/index.js +1 -0
- package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/dist/index.js.map +1 -1
- package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/dist/src/ArgsMap.js +7 -4
- package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/dist/src/ArgsMap.js.map +1 -1
- package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/dist/src/Fs.js +16 -12
- package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/dist/src/Fs.js.map +1 -1
- package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/dist/src/PackageUtil.d.ts +59 -13
- package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/dist/src/PackageUtil.js +119 -80
- package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/dist/src/PackageUtil.js.map +1 -1
- package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/dist/src/WorkspaceDeclaration.d.ts +91 -0
- package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/dist/src/WorkspaceDeclaration.js +608 -0
- package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/dist/src/WorkspaceDeclaration.js.map +1 -0
- package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/dist/src/promisifiedFs.d.ts +0 -1
- package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/index.ts +1 -0
- package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/package.json +4 -3
- package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/src/ArgsMap.ts +7 -4
- package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/src/Fs.ts +12 -9
- package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/src/PackageUtil.ts +92 -38
- package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/src/WorkspaceDeclaration.ts +340 -0
- package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/test/ArgsMap.test.ts +35 -0
- package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/test/Fs.getFilePathsMatchingGlob.test.ts +70 -0
- package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/test/PackageUtil.getLocalPackageMap.test.ts +107 -0
- package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/test/PackageUtil.pathKeyedIdentity.test.ts +169 -0
- package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/test/WorkspaceDeclaration.test.ts +174 -0
- package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/tsconfig.json +1 -0
- package/test/examples/source-repository/a/package-lock.json +16 -16
- package/test/examples/source-repository/a/package.json +3 -3
- package/test/examples/source-repository/a/src/ExtendsForeignType.ts +1 -1
- package/test/examples/source-repository/b/dist/codegen/CanonicalSourceGraph.d.ts +22 -0
- package/test/examples/source-repository/b/dist/codegen/CanonicalSourceGraph.js +60 -0
- package/test/examples/source-repository/b/dist/codegen/CanonicalSourceGraph.js.map +1 -0
- package/test/examples/source-repository/b/dist/codegen/writeGeneratedIndex.d.ts +12 -3
- package/test/examples/source-repository/b/dist/codegen/writeGeneratedIndex.js +21 -13
- package/test/examples/source-repository/b/dist/codegen/writeGeneratedIndex.js.map +1 -1
- package/test/examples/source-repository/b/dist/generated/index.js +3 -3
- package/test/examples/source-repository/b/dist/generated/index.js.map +1 -1
- package/test/examples/source-repository/b/dist/parser/PackageSourceFiles.d.ts +30 -0
- package/test/examples/source-repository/b/dist/parser/PackageSourceFiles.js +151 -0
- package/test/examples/source-repository/b/dist/parser/PackageSourceFiles.js.map +1 -0
- package/test/examples/source-repository/b/dist/parser/SharedQualifiedNames.d.ts +43 -0
- package/test/examples/source-repository/b/dist/parser/SharedQualifiedNames.js +81 -0
- package/test/examples/source-repository/b/dist/parser/SharedQualifiedNames.js.map +1 -0
- package/test/examples/source-repository/b/dist/parser/createGraphBuilder.d.ts +6 -1
- package/test/examples/source-repository/b/dist/parser/createGraphBuilder.js +16 -31
- package/test/examples/source-repository/b/dist/parser/createGraphBuilder.js.map +1 -1
- package/test/examples/source-repository/b/dist/parser/createSourceGraph.d.ts +6 -1
- package/test/examples/source-repository/b/dist/parser/createSourceGraph.js +23 -38
- package/test/examples/source-repository/b/dist/parser/createSourceGraph.js.map +1 -1
- package/test/examples/source-repository/b/generated/index.ts +6 -6
- package/test/examples/source-repository/b/node_modules/.package-lock.json +10 -10
- package/test/examples/source-repository/b/node_modules/@proteinjs/util/CHANGELOG.md +8 -0
- package/test/examples/source-repository/b/node_modules/@proteinjs/util/LICENSE +21 -0
- package/test/examples/source-repository/b/node_modules/@proteinjs/util/package.json +3 -2
- package/test/examples/source-repository/b/node_modules/@proteinjs/util/tsconfig.json +1 -0
- package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/CHANGELOG.md +63 -0
- package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/LICENSE +21 -0
- package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/dist/index.d.ts +1 -0
- package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/dist/index.js +1 -0
- package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/dist/index.js.map +1 -1
- package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/dist/src/ArgsMap.js +7 -4
- package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/dist/src/ArgsMap.js.map +1 -1
- package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/dist/src/Fs.js +16 -12
- package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/dist/src/Fs.js.map +1 -1
- package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/dist/src/PackageUtil.d.ts +59 -13
- package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/dist/src/PackageUtil.js +119 -80
- package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/dist/src/PackageUtil.js.map +1 -1
- package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/dist/src/WorkspaceDeclaration.d.ts +91 -0
- package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/dist/src/WorkspaceDeclaration.js +608 -0
- package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/dist/src/WorkspaceDeclaration.js.map +1 -0
- package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/dist/src/promisifiedFs.d.ts +0 -1
- package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/index.ts +1 -0
- package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/package.json +4 -3
- package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/src/ArgsMap.ts +7 -4
- package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/src/Fs.ts +12 -9
- package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/src/PackageUtil.ts +92 -38
- package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/src/WorkspaceDeclaration.ts +340 -0
- package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/test/ArgsMap.test.ts +35 -0
- package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/test/Fs.getFilePathsMatchingGlob.test.ts +70 -0
- package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/test/PackageUtil.getLocalPackageMap.test.ts +107 -0
- package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/test/PackageUtil.pathKeyedIdentity.test.ts +169 -0
- package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/test/WorkspaceDeclaration.test.ts +174 -0
- package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/tsconfig.json +1 -0
- package/test/examples/source-repository/b/package-lock.json +13 -13
- package/test/examples/source-repository/b/package.json +3 -3
|
@@ -0,0 +1,608 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __assign = (this && this.__assign) || function () {
|
|
18
|
+
__assign = Object.assign || function(t) {
|
|
19
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
20
|
+
s = arguments[i];
|
|
21
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
22
|
+
t[p] = s[p];
|
|
23
|
+
}
|
|
24
|
+
return t;
|
|
25
|
+
};
|
|
26
|
+
return __assign.apply(this, arguments);
|
|
27
|
+
};
|
|
28
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
29
|
+
if (k2 === undefined) k2 = k;
|
|
30
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
31
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
32
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
33
|
+
}
|
|
34
|
+
Object.defineProperty(o, k2, desc);
|
|
35
|
+
}) : (function(o, m, k, k2) {
|
|
36
|
+
if (k2 === undefined) k2 = k;
|
|
37
|
+
o[k2] = m[k];
|
|
38
|
+
}));
|
|
39
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
40
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
41
|
+
}) : function(o, v) {
|
|
42
|
+
o["default"] = v;
|
|
43
|
+
});
|
|
44
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
45
|
+
if (mod && mod.__esModule) return mod;
|
|
46
|
+
var result = {};
|
|
47
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
48
|
+
__setModuleDefault(result, mod);
|
|
49
|
+
return result;
|
|
50
|
+
};
|
|
51
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
52
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
53
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
54
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
55
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
56
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
57
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
61
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
62
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
63
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
64
|
+
function step(op) {
|
|
65
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
66
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
67
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
68
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
69
|
+
switch (op[0]) {
|
|
70
|
+
case 0: case 1: t = op; break;
|
|
71
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
72
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
73
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
74
|
+
default:
|
|
75
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
76
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
77
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
78
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
79
|
+
if (t[2]) _.ops.pop();
|
|
80
|
+
_.trys.pop(); continue;
|
|
81
|
+
}
|
|
82
|
+
op = body.call(thisArg, _);
|
|
83
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
84
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
88
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
89
|
+
if (ar || !(i in from)) {
|
|
90
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
91
|
+
ar[i] = from[i];
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
95
|
+
};
|
|
96
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
97
|
+
exports.WorkspaceDeclaration = exports.WorkspaceDeclarationError = void 0;
|
|
98
|
+
var path = __importStar(require("path"));
|
|
99
|
+
var fs = __importStar(require("fs/promises"));
|
|
100
|
+
/** A declared-workspace rule was broken. The message names every path involved. */
|
|
101
|
+
var WorkspaceDeclarationError = /** @class */ (function (_super) {
|
|
102
|
+
__extends(WorkspaceDeclarationError, _super);
|
|
103
|
+
function WorkspaceDeclarationError(message) {
|
|
104
|
+
var _this = _super.call(this, message) || this;
|
|
105
|
+
_this.name = 'WorkspaceDeclarationError';
|
|
106
|
+
Object.setPrototypeOf(_this, WorkspaceDeclarationError.prototype); // ES5 target: keep instanceof true across the Error subclass
|
|
107
|
+
return _this;
|
|
108
|
+
}
|
|
109
|
+
return WorkspaceDeclarationError;
|
|
110
|
+
}(Error));
|
|
111
|
+
exports.WorkspaceDeclarationError = WorkspaceDeclarationError;
|
|
112
|
+
/**
|
|
113
|
+
* The ONE owner of workspace membership: which package.json files belong to the workspace rooted
|
|
114
|
+
* at a directory.
|
|
115
|
+
*
|
|
116
|
+
* Membership is DECLARED, never crawled. A directory holding a `lerna.json` (its `packages`
|
|
117
|
+
* globs; lerna's own default `packages/*` when the field is absent) or a root `package.json`
|
|
118
|
+
* carrying `workspacePackages` (extra roots the workspace tooling builds alongside lerna's
|
|
119
|
+
* members — e.g. an app's `ops/*` tools that lerna must not version) is a workspace ROOT. Its
|
|
120
|
+
* members are exactly what it declares, and it OWNS its subtree: nothing undeclared beneath it is
|
|
121
|
+
* a member, however the tree is walked from above. A member that is itself a root expands through
|
|
122
|
+
* its own declaration (the metarepo's nested lerna roots).
|
|
123
|
+
*
|
|
124
|
+
* Why: the previous crawl (every package.json under the root, keyed by name, last path wins)
|
|
125
|
+
* let a CI fixture tree whose package.json files reused the app's own package names shadow the
|
|
126
|
+
* real packages — build-workspace built "1 package in workspace" and the release image shipped
|
|
127
|
+
* with no server dist (n3xah/app Deploy to Test run 33747781291, 2026-09-03). A declaration
|
|
128
|
+
* cannot be shadowed by a file nobody declared.
|
|
129
|
+
*
|
|
130
|
+
* A tree with no declaration at its root (the n3xa metarepo root) still crawls — bounded exactly
|
|
131
|
+
* as before: never into hidden directories, `node_modules`, `dist`, or through symlinks — and
|
|
132
|
+
* hands every declared root it meets to that root's declaration.
|
|
133
|
+
*
|
|
134
|
+
* Hard errors, each naming its paths: a declared literal path with no package.json; two leaf
|
|
135
|
+
* packages sharing a name (dependencies resolve to members BY NAME). Containers — a package.json
|
|
136
|
+
* with members beneath it; every root in the metarepo is named `root` — are identified by path
|
|
137
|
+
* and exempt from the name rule.
|
|
138
|
+
*
|
|
139
|
+
* npm's own `workspaces` field is deliberately NOT read: it changes how `npm i` installs at the
|
|
140
|
+
* root, which is a different install model from the per-package installs this tooling performs.
|
|
141
|
+
*/
|
|
142
|
+
var WorkspaceDeclaration = /** @class */ (function () {
|
|
143
|
+
function WorkspaceDeclaration() {
|
|
144
|
+
}
|
|
145
|
+
/** Every member package.json of the workspace rooted at `rootDir`, sorted by path. */
|
|
146
|
+
WorkspaceDeclaration.discover = function (rootDir) {
|
|
147
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
148
|
+
var found, root, declaration, discovered;
|
|
149
|
+
return __generator(this, function (_a) {
|
|
150
|
+
switch (_a.label) {
|
|
151
|
+
case 0:
|
|
152
|
+
found = new Map();
|
|
153
|
+
root = path.resolve(rootDir);
|
|
154
|
+
return [4 /*yield*/, WorkspaceDeclaration.read(root)];
|
|
155
|
+
case 1:
|
|
156
|
+
declaration = _a.sent();
|
|
157
|
+
if (!declaration) return [3 /*break*/, 3];
|
|
158
|
+
return [4 /*yield*/, WorkspaceDeclaration.discoverDeclared(declaration, found)];
|
|
159
|
+
case 2:
|
|
160
|
+
_a.sent();
|
|
161
|
+
return [3 /*break*/, 5];
|
|
162
|
+
case 3: return [4 /*yield*/, WorkspaceDeclaration.crawl(root, found)];
|
|
163
|
+
case 4:
|
|
164
|
+
_a.sent();
|
|
165
|
+
_a.label = 5;
|
|
166
|
+
case 5:
|
|
167
|
+
discovered = Array.from(found.values()).sort(function (a, b) {
|
|
168
|
+
return a.filePath < b.filePath ? -1 : a.filePath > b.filePath ? 1 : 0;
|
|
169
|
+
});
|
|
170
|
+
WorkspaceDeclaration.assertNoLeafNameCollisions(discovered);
|
|
171
|
+
return [2 /*return*/, discovered];
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
};
|
|
176
|
+
/** The declaration at `dir` when `dir` is a workspace root; undefined otherwise. */
|
|
177
|
+
WorkspaceDeclaration.read = function (dir) {
|
|
178
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
179
|
+
var patterns, lernaPath, lernaJson, declared, _i, declared_1, pattern, packageJsonPath, packageJson, extra, _a, extra_1, pattern;
|
|
180
|
+
return __generator(this, function (_b) {
|
|
181
|
+
switch (_b.label) {
|
|
182
|
+
case 0:
|
|
183
|
+
patterns = [];
|
|
184
|
+
lernaPath = path.join(dir, 'lerna.json');
|
|
185
|
+
return [4 /*yield*/, WorkspaceDeclaration.readJsonIfExists(lernaPath)];
|
|
186
|
+
case 1:
|
|
187
|
+
lernaJson = _b.sent();
|
|
188
|
+
if (lernaJson) {
|
|
189
|
+
declared = Array.isArray(lernaJson.packages)
|
|
190
|
+
? lernaJson.packages
|
|
191
|
+
: WorkspaceDeclaration.lernaDefaultPackages;
|
|
192
|
+
for (_i = 0, declared_1 = declared; _i < declared_1.length; _i++) {
|
|
193
|
+
pattern = declared_1[_i];
|
|
194
|
+
patterns.push({ pattern: WorkspaceDeclaration.assertPattern(pattern, lernaPath), source: lernaPath });
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
packageJsonPath = path.join(dir, 'package.json');
|
|
198
|
+
return [4 /*yield*/, WorkspaceDeclaration.readJsonIfExists(packageJsonPath)];
|
|
199
|
+
case 2:
|
|
200
|
+
packageJson = _b.sent();
|
|
201
|
+
extra = packageJson === null || packageJson === void 0 ? void 0 : packageJson[WorkspaceDeclaration.EXTRA_PACKAGES_FIELD];
|
|
202
|
+
if (extra !== undefined) {
|
|
203
|
+
if (!Array.isArray(extra)) {
|
|
204
|
+
throw new WorkspaceDeclarationError("".concat(packageJsonPath, ": \"").concat(WorkspaceDeclaration.EXTRA_PACKAGES_FIELD, "\" must be an array of package globs"));
|
|
205
|
+
}
|
|
206
|
+
for (_a = 0, extra_1 = extra; _a < extra_1.length; _a++) {
|
|
207
|
+
pattern = extra_1[_a];
|
|
208
|
+
patterns.push({
|
|
209
|
+
pattern: WorkspaceDeclaration.assertPattern(pattern, packageJsonPath),
|
|
210
|
+
source: packageJsonPath,
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
return [2 /*return*/, patterns.length > 0 ? { rootDir: dir, patterns: patterns } : undefined];
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
});
|
|
218
|
+
};
|
|
219
|
+
/** A declared root: its own package.json (the container), then exactly its declared members. */
|
|
220
|
+
WorkspaceDeclaration.discoverDeclared = function (declaration, found) {
|
|
221
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
222
|
+
var own, _i, _a, _b, pattern, source, _c, _d, memberDir, nested;
|
|
223
|
+
return __generator(this, function (_e) {
|
|
224
|
+
switch (_e.label) {
|
|
225
|
+
case 0:
|
|
226
|
+
own = path.join(declaration.rootDir, 'package.json');
|
|
227
|
+
return [4 /*yield*/, WorkspaceDeclaration.exists(own)];
|
|
228
|
+
case 1:
|
|
229
|
+
if (!_e.sent()) return [3 /*break*/, 3];
|
|
230
|
+
return [4 /*yield*/, WorkspaceDeclaration.add(found, own, 'declared', declaration.patterns[0].source)];
|
|
231
|
+
case 2:
|
|
232
|
+
_e.sent();
|
|
233
|
+
_e.label = 3;
|
|
234
|
+
case 3:
|
|
235
|
+
_i = 0, _a = declaration.patterns;
|
|
236
|
+
_e.label = 4;
|
|
237
|
+
case 4:
|
|
238
|
+
if (!(_i < _a.length)) return [3 /*break*/, 13];
|
|
239
|
+
_b = _a[_i], pattern = _b.pattern, source = _b.source;
|
|
240
|
+
_c = 0;
|
|
241
|
+
return [4 /*yield*/, WorkspaceDeclaration.expand(declaration.rootDir, pattern, source)];
|
|
242
|
+
case 5:
|
|
243
|
+
_d = _e.sent();
|
|
244
|
+
_e.label = 6;
|
|
245
|
+
case 6:
|
|
246
|
+
if (!(_c < _d.length)) return [3 /*break*/, 12];
|
|
247
|
+
memberDir = _d[_c];
|
|
248
|
+
return [4 /*yield*/, WorkspaceDeclaration.read(memberDir)];
|
|
249
|
+
case 7:
|
|
250
|
+
nested = _e.sent();
|
|
251
|
+
if (!nested) return [3 /*break*/, 9];
|
|
252
|
+
return [4 /*yield*/, WorkspaceDeclaration.discoverDeclared(nested, found)];
|
|
253
|
+
case 8:
|
|
254
|
+
_e.sent(); // a nested root owns its subtree
|
|
255
|
+
return [3 /*break*/, 11];
|
|
256
|
+
case 9: return [4 /*yield*/, WorkspaceDeclaration.add(found, path.join(memberDir, 'package.json'), 'declared', source)];
|
|
257
|
+
case 10:
|
|
258
|
+
_e.sent();
|
|
259
|
+
_e.label = 11;
|
|
260
|
+
case 11:
|
|
261
|
+
_c++;
|
|
262
|
+
return [3 /*break*/, 6];
|
|
263
|
+
case 12:
|
|
264
|
+
_i++;
|
|
265
|
+
return [3 /*break*/, 4];
|
|
266
|
+
case 13: return [2 /*return*/];
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
});
|
|
270
|
+
};
|
|
271
|
+
/**
|
|
272
|
+
* The bounded walk of an UNDECLARED tree (the metarepo root): every package.json it meets is a
|
|
273
|
+
* member, and every declared root it meets is handed to that root's declaration instead of
|
|
274
|
+
* being walked. Never enters hidden directories, node_modules, or dist; never follows symlinks
|
|
275
|
+
* (`withFileTypes` reports a symlink as neither directory nor file).
|
|
276
|
+
*/
|
|
277
|
+
WorkspaceDeclaration.crawl = function (rootDir, found) {
|
|
278
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
279
|
+
var pending, currentDir, _i, _a, dirent, entryPath, declaration;
|
|
280
|
+
return __generator(this, function (_b) {
|
|
281
|
+
switch (_b.label) {
|
|
282
|
+
case 0:
|
|
283
|
+
pending = [rootDir];
|
|
284
|
+
_b.label = 1;
|
|
285
|
+
case 1:
|
|
286
|
+
if (!(pending.length > 0)) return [3 /*break*/, 12];
|
|
287
|
+
currentDir = pending.pop();
|
|
288
|
+
_i = 0;
|
|
289
|
+
return [4 /*yield*/, fs.readdir(currentDir, { withFileTypes: true })];
|
|
290
|
+
case 2:
|
|
291
|
+
_a = _b.sent();
|
|
292
|
+
_b.label = 3;
|
|
293
|
+
case 3:
|
|
294
|
+
if (!(_i < _a.length)) return [3 /*break*/, 11];
|
|
295
|
+
dirent = _a[_i];
|
|
296
|
+
entryPath = path.join(currentDir, dirent.name);
|
|
297
|
+
if (!dirent.isDirectory()) return [3 /*break*/, 8];
|
|
298
|
+
if (WorkspaceDeclaration.isPrunedDirName(dirent.name)) {
|
|
299
|
+
return [3 /*break*/, 10];
|
|
300
|
+
}
|
|
301
|
+
return [4 /*yield*/, WorkspaceDeclaration.read(entryPath)];
|
|
302
|
+
case 4:
|
|
303
|
+
declaration = _b.sent();
|
|
304
|
+
if (!declaration) return [3 /*break*/, 6];
|
|
305
|
+
return [4 /*yield*/, WorkspaceDeclaration.discoverDeclared(declaration, found)];
|
|
306
|
+
case 5:
|
|
307
|
+
_b.sent();
|
|
308
|
+
return [3 /*break*/, 7];
|
|
309
|
+
case 6:
|
|
310
|
+
pending.push(entryPath);
|
|
311
|
+
_b.label = 7;
|
|
312
|
+
case 7: return [3 /*break*/, 10];
|
|
313
|
+
case 8:
|
|
314
|
+
if (!(dirent.isFile() && dirent.name === 'package.json')) return [3 /*break*/, 10];
|
|
315
|
+
return [4 /*yield*/, WorkspaceDeclaration.add(found, entryPath, 'crawled')];
|
|
316
|
+
case 9:
|
|
317
|
+
_b.sent();
|
|
318
|
+
_b.label = 10;
|
|
319
|
+
case 10:
|
|
320
|
+
_i++;
|
|
321
|
+
return [3 /*break*/, 3];
|
|
322
|
+
case 11: return [3 /*break*/, 1];
|
|
323
|
+
case 12: return [2 /*return*/];
|
|
324
|
+
}
|
|
325
|
+
});
|
|
326
|
+
});
|
|
327
|
+
};
|
|
328
|
+
/**
|
|
329
|
+
* The directories a declared pattern names under `rootDir`, lerna's semantics: a literal path
|
|
330
|
+
* MUST hold a package.json (hard error otherwise — a declared package that does not exist is
|
|
331
|
+
* a broken declaration, never a silent skip); a glob (`*` within a segment, `**` for any depth)
|
|
332
|
+
* matches directories that hold one, walking with the same prune rules as the crawl. A declared
|
|
333
|
+
* root met inside a glob's walk is matched as a whole and not walked past — it owns its subtree.
|
|
334
|
+
*/
|
|
335
|
+
WorkspaceDeclaration.expand = function (rootDir, pattern, source) {
|
|
336
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
337
|
+
var segments, dir, matches;
|
|
338
|
+
return __generator(this, function (_a) {
|
|
339
|
+
switch (_a.label) {
|
|
340
|
+
case 0:
|
|
341
|
+
segments = pattern.split('/').filter(function (segment) { return segment.length > 0 && segment !== '.'; });
|
|
342
|
+
if (!!segments.some(function (segment) { return segment.includes('*'); })) return [3 /*break*/, 2];
|
|
343
|
+
dir = path.join.apply(path, __spreadArray([rootDir], segments, false));
|
|
344
|
+
return [4 /*yield*/, WorkspaceDeclaration.exists(path.join(dir, 'package.json'))];
|
|
345
|
+
case 1:
|
|
346
|
+
if (!(_a.sent())) {
|
|
347
|
+
throw new WorkspaceDeclarationError("".concat(source, " declares \"").concat(pattern, "\" but ").concat(path.join(dir, 'package.json'), " does not exist \u2014 a declared package must exist (fix the declaration or restore the package)"));
|
|
348
|
+
}
|
|
349
|
+
return [2 /*return*/, [dir]];
|
|
350
|
+
case 2:
|
|
351
|
+
matches = new Set();
|
|
352
|
+
return [4 /*yield*/, WorkspaceDeclaration.matchSegments(rootDir, segments, 0, matches)];
|
|
353
|
+
case 3:
|
|
354
|
+
_a.sent();
|
|
355
|
+
return [2 /*return*/, Array.from(matches).sort()];
|
|
356
|
+
}
|
|
357
|
+
});
|
|
358
|
+
});
|
|
359
|
+
};
|
|
360
|
+
WorkspaceDeclaration.matchSegments = function (dir, segments, index, matches) {
|
|
361
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
362
|
+
var segment, remaining, _i, _a, child, children, _b, _c, children_1, child, _d;
|
|
363
|
+
return __generator(this, function (_e) {
|
|
364
|
+
switch (_e.label) {
|
|
365
|
+
case 0:
|
|
366
|
+
if (!(index === segments.length)) return [3 /*break*/, 2];
|
|
367
|
+
return [4 /*yield*/, WorkspaceDeclaration.exists(path.join(dir, 'package.json'))];
|
|
368
|
+
case 1:
|
|
369
|
+
if (_e.sent()) {
|
|
370
|
+
matches.add(dir);
|
|
371
|
+
}
|
|
372
|
+
return [2 /*return*/];
|
|
373
|
+
case 2:
|
|
374
|
+
segment = segments[index];
|
|
375
|
+
remaining = segments.length - index - 1;
|
|
376
|
+
if (!(segment === '**')) return [3 /*break*/, 10];
|
|
377
|
+
return [4 /*yield*/, WorkspaceDeclaration.matchSegments(dir, segments, index + 1, matches)];
|
|
378
|
+
case 3:
|
|
379
|
+
_e.sent(); // zero directories
|
|
380
|
+
_i = 0;
|
|
381
|
+
return [4 /*yield*/, WorkspaceDeclaration.childDirs(dir)];
|
|
382
|
+
case 4:
|
|
383
|
+
_a = _e.sent();
|
|
384
|
+
_e.label = 5;
|
|
385
|
+
case 5:
|
|
386
|
+
if (!(_i < _a.length)) return [3 /*break*/, 9];
|
|
387
|
+
child = _a[_i];
|
|
388
|
+
return [4 /*yield*/, WorkspaceDeclaration.read(child)];
|
|
389
|
+
case 6:
|
|
390
|
+
if (_e.sent()) {
|
|
391
|
+
matches.add(child); // a nested root owns its subtree — matched whole, never walked past
|
|
392
|
+
return [3 /*break*/, 8];
|
|
393
|
+
}
|
|
394
|
+
return [4 /*yield*/, WorkspaceDeclaration.matchSegments(child, segments, index, matches)];
|
|
395
|
+
case 7:
|
|
396
|
+
_e.sent(); // one more directory under **
|
|
397
|
+
_e.label = 8;
|
|
398
|
+
case 8:
|
|
399
|
+
_i++;
|
|
400
|
+
return [3 /*break*/, 5];
|
|
401
|
+
case 9: return [2 /*return*/];
|
|
402
|
+
case 10:
|
|
403
|
+
if (!segment.includes('*')) return [3 /*break*/, 12];
|
|
404
|
+
return [4 /*yield*/, WorkspaceDeclaration.childDirs(dir)];
|
|
405
|
+
case 11:
|
|
406
|
+
_b = (_e.sent()).filter(function (child) {
|
|
407
|
+
return WorkspaceDeclaration.segmentMatcher(segment).test(path.basename(child));
|
|
408
|
+
});
|
|
409
|
+
return [3 /*break*/, 14];
|
|
410
|
+
case 12: return [4 /*yield*/, WorkspaceDeclaration.isRealDir(path.join(dir, segment))];
|
|
411
|
+
case 13:
|
|
412
|
+
_b = (_e.sent())
|
|
413
|
+
? [path.join(dir, segment)]
|
|
414
|
+
: [];
|
|
415
|
+
_e.label = 14;
|
|
416
|
+
case 14:
|
|
417
|
+
children = _b;
|
|
418
|
+
_c = 0, children_1 = children;
|
|
419
|
+
_e.label = 15;
|
|
420
|
+
case 15:
|
|
421
|
+
if (!(_c < children_1.length)) return [3 /*break*/, 20];
|
|
422
|
+
child = children_1[_c];
|
|
423
|
+
_d = remaining > 0;
|
|
424
|
+
if (!_d) return [3 /*break*/, 17];
|
|
425
|
+
return [4 /*yield*/, WorkspaceDeclaration.read(child)];
|
|
426
|
+
case 16:
|
|
427
|
+
_d = (_e.sent());
|
|
428
|
+
_e.label = 17;
|
|
429
|
+
case 17:
|
|
430
|
+
if (_d) {
|
|
431
|
+
matches.add(child);
|
|
432
|
+
return [3 /*break*/, 19];
|
|
433
|
+
}
|
|
434
|
+
return [4 /*yield*/, WorkspaceDeclaration.matchSegments(child, segments, index + 1, matches)];
|
|
435
|
+
case 18:
|
|
436
|
+
_e.sent();
|
|
437
|
+
_e.label = 19;
|
|
438
|
+
case 19:
|
|
439
|
+
_c++;
|
|
440
|
+
return [3 /*break*/, 15];
|
|
441
|
+
case 20: return [2 /*return*/];
|
|
442
|
+
}
|
|
443
|
+
});
|
|
444
|
+
});
|
|
445
|
+
};
|
|
446
|
+
/** Leaf packages resolve by name; two leaves with one name is a broken workspace, not a tie to break. */
|
|
447
|
+
WorkspaceDeclaration.assertNoLeafNameCollisions = function (discovered) {
|
|
448
|
+
var _a, _b;
|
|
449
|
+
var dirs = discovered.map(function (entry) { return path.dirname(entry.filePath); });
|
|
450
|
+
var isContainer = function (entry) {
|
|
451
|
+
var prefix = path.dirname(entry.filePath) + path.sep;
|
|
452
|
+
return dirs.some(function (dir) { return dir.startsWith(prefix); });
|
|
453
|
+
};
|
|
454
|
+
var byName = new Map();
|
|
455
|
+
for (var _i = 0, discovered_1 = discovered; _i < discovered_1.length; _i++) {
|
|
456
|
+
var entry = discovered_1[_i];
|
|
457
|
+
var name_1 = (_a = entry.packageJson) === null || _a === void 0 ? void 0 : _a.name;
|
|
458
|
+
if (typeof name_1 !== 'string' || name_1.length === 0) {
|
|
459
|
+
continue;
|
|
460
|
+
}
|
|
461
|
+
byName.set(name_1, ((_b = byName.get(name_1)) !== null && _b !== void 0 ? _b : []).concat(entry));
|
|
462
|
+
}
|
|
463
|
+
var collisions = [];
|
|
464
|
+
for (var _c = 0, _d = Array.from(byName.entries()); _c < _d.length; _c++) {
|
|
465
|
+
var _e = _d[_c], name_2 = _e[0], entries = _e[1];
|
|
466
|
+
var leaves = entries.filter(function (entry) { return !isContainer(entry); });
|
|
467
|
+
if (leaves.length < 2) {
|
|
468
|
+
continue;
|
|
469
|
+
}
|
|
470
|
+
collisions.push("\"".concat(name_2, "\" is claimed by\n") +
|
|
471
|
+
leaves
|
|
472
|
+
.map(function (entry) {
|
|
473
|
+
return " - ".concat(entry.filePath, " (").concat(entry.origin === 'declared' ? "declared by ".concat(entry.declaredBy) : 'crawled — no declaration names it', ")");
|
|
474
|
+
})
|
|
475
|
+
.join('\n'));
|
|
476
|
+
}
|
|
477
|
+
if (collisions.length > 0) {
|
|
478
|
+
throw new WorkspaceDeclarationError("Workspace package name collision \u2014 dependencies resolve to workspace members BY NAME, so two packages cannot share one:\n".concat(collisions.join('\n'), "\nRename the impostor (fixtures carry fixture names) or move it outside the workspace."));
|
|
479
|
+
}
|
|
480
|
+
};
|
|
481
|
+
WorkspaceDeclaration.add = function (found, filePath, origin, declaredBy) {
|
|
482
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
483
|
+
var packageJson, _a, _b;
|
|
484
|
+
return __generator(this, function (_c) {
|
|
485
|
+
switch (_c.label) {
|
|
486
|
+
case 0:
|
|
487
|
+
if (found.has(filePath)) {
|
|
488
|
+
return [2 /*return*/];
|
|
489
|
+
}
|
|
490
|
+
_b = (_a = JSON).parse;
|
|
491
|
+
return [4 /*yield*/, fs.readFile(filePath, 'utf8')];
|
|
492
|
+
case 1:
|
|
493
|
+
packageJson = _b.apply(_a, [_c.sent()]);
|
|
494
|
+
found.set(filePath, __assign({ filePath: filePath, packageJson: packageJson, origin: origin }, (declaredBy ? { declaredBy: declaredBy } : {})));
|
|
495
|
+
return [2 /*return*/];
|
|
496
|
+
}
|
|
497
|
+
});
|
|
498
|
+
});
|
|
499
|
+
};
|
|
500
|
+
WorkspaceDeclaration.assertPattern = function (pattern, source) {
|
|
501
|
+
if (typeof pattern !== 'string' || pattern.trim().length === 0) {
|
|
502
|
+
throw new WorkspaceDeclarationError("".concat(source, ": package patterns must be non-empty strings, got ").concat(JSON.stringify(pattern)));
|
|
503
|
+
}
|
|
504
|
+
if (path.isAbsolute(pattern) || pattern.split('/').includes('..')) {
|
|
505
|
+
throw new WorkspaceDeclarationError("".concat(source, ": package pattern \"").concat(pattern, "\" must be relative to the root and stay inside it"));
|
|
506
|
+
}
|
|
507
|
+
return pattern;
|
|
508
|
+
};
|
|
509
|
+
WorkspaceDeclaration.segmentMatcher = function (segment) {
|
|
510
|
+
var escaped = segment.replace(/[.+?^${}()|[\]\\]/g, '\\$&').replace(/\*/g, '[^/]*');
|
|
511
|
+
return new RegExp("^".concat(escaped, "$"));
|
|
512
|
+
};
|
|
513
|
+
WorkspaceDeclaration.isPrunedDirName = function (name) {
|
|
514
|
+
return name.startsWith('.') || WorkspaceDeclaration.prunedDirNames.has(name);
|
|
515
|
+
};
|
|
516
|
+
/** Real (non-symlink, non-pruned) child directories of `dir`. */
|
|
517
|
+
WorkspaceDeclaration.childDirs = function (dir) {
|
|
518
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
519
|
+
var dirents, _a;
|
|
520
|
+
return __generator(this, function (_b) {
|
|
521
|
+
switch (_b.label) {
|
|
522
|
+
case 0:
|
|
523
|
+
_b.trys.push([0, 2, , 3]);
|
|
524
|
+
return [4 /*yield*/, fs.readdir(dir, { withFileTypes: true })];
|
|
525
|
+
case 1:
|
|
526
|
+
dirents = _b.sent();
|
|
527
|
+
return [3 /*break*/, 3];
|
|
528
|
+
case 2:
|
|
529
|
+
_a = _b.sent();
|
|
530
|
+
return [2 /*return*/, []];
|
|
531
|
+
case 3: return [2 /*return*/, dirents
|
|
532
|
+
.filter(function (dirent) { return dirent.isDirectory() && !WorkspaceDeclaration.isPrunedDirName(dirent.name); })
|
|
533
|
+
.map(function (dirent) { return path.join(dir, dirent.name); })
|
|
534
|
+
.sort()];
|
|
535
|
+
}
|
|
536
|
+
});
|
|
537
|
+
});
|
|
538
|
+
};
|
|
539
|
+
WorkspaceDeclaration.isRealDir = function (p) {
|
|
540
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
541
|
+
var _a;
|
|
542
|
+
return __generator(this, function (_b) {
|
|
543
|
+
switch (_b.label) {
|
|
544
|
+
case 0:
|
|
545
|
+
_b.trys.push([0, 2, , 3]);
|
|
546
|
+
return [4 /*yield*/, fs.lstat(p)];
|
|
547
|
+
case 1: return [2 /*return*/, (_b.sent()).isDirectory()];
|
|
548
|
+
case 2:
|
|
549
|
+
_a = _b.sent();
|
|
550
|
+
return [2 /*return*/, false];
|
|
551
|
+
case 3: return [2 /*return*/];
|
|
552
|
+
}
|
|
553
|
+
});
|
|
554
|
+
});
|
|
555
|
+
};
|
|
556
|
+
WorkspaceDeclaration.exists = function (p) {
|
|
557
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
558
|
+
var _a;
|
|
559
|
+
return __generator(this, function (_b) {
|
|
560
|
+
switch (_b.label) {
|
|
561
|
+
case 0:
|
|
562
|
+
_b.trys.push([0, 2, , 3]);
|
|
563
|
+
return [4 /*yield*/, fs.access(p)];
|
|
564
|
+
case 1:
|
|
565
|
+
_b.sent();
|
|
566
|
+
return [2 /*return*/, true];
|
|
567
|
+
case 2:
|
|
568
|
+
_a = _b.sent();
|
|
569
|
+
return [2 /*return*/, false];
|
|
570
|
+
case 3: return [2 /*return*/];
|
|
571
|
+
}
|
|
572
|
+
});
|
|
573
|
+
});
|
|
574
|
+
};
|
|
575
|
+
WorkspaceDeclaration.readJsonIfExists = function (p) {
|
|
576
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
577
|
+
var text, _a;
|
|
578
|
+
return __generator(this, function (_b) {
|
|
579
|
+
switch (_b.label) {
|
|
580
|
+
case 0:
|
|
581
|
+
_b.trys.push([0, 2, , 3]);
|
|
582
|
+
return [4 /*yield*/, fs.readFile(p, 'utf8')];
|
|
583
|
+
case 1:
|
|
584
|
+
text = _b.sent();
|
|
585
|
+
return [3 /*break*/, 3];
|
|
586
|
+
case 2:
|
|
587
|
+
_a = _b.sent();
|
|
588
|
+
return [2 /*return*/, undefined];
|
|
589
|
+
case 3:
|
|
590
|
+
try {
|
|
591
|
+
return [2 /*return*/, JSON.parse(text)];
|
|
592
|
+
}
|
|
593
|
+
catch (error) {
|
|
594
|
+
throw new WorkspaceDeclarationError("".concat(p, " is not valid JSON: ").concat(error instanceof Error ? error.message : String(error)));
|
|
595
|
+
}
|
|
596
|
+
return [2 /*return*/];
|
|
597
|
+
}
|
|
598
|
+
});
|
|
599
|
+
});
|
|
600
|
+
};
|
|
601
|
+
/** Root package.json field naming extra member globs beside lerna's `packages`. */
|
|
602
|
+
WorkspaceDeclaration.EXTRA_PACKAGES_FIELD = 'workspacePackages';
|
|
603
|
+
WorkspaceDeclaration.lernaDefaultPackages = ['packages/*'];
|
|
604
|
+
WorkspaceDeclaration.prunedDirNames = new Set(['node_modules', 'dist']);
|
|
605
|
+
return WorkspaceDeclaration;
|
|
606
|
+
}());
|
|
607
|
+
exports.WorkspaceDeclaration = WorkspaceDeclaration;
|
|
608
|
+
//# sourceMappingURL=WorkspaceDeclaration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkspaceDeclaration.js","sourceRoot":"","sources":["../../src/WorkspaceDeclaration.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA6B;AAC7B,8CAAkC;AAElC,mFAAmF;AACnF;IAA+C,6CAAK;IAClD,mCAAY,OAAe;QAA3B,YACE,kBAAM,OAAO,CAAC,SAGf;QAFC,KAAI,CAAC,IAAI,GAAG,2BAA2B,CAAC;QACxC,MAAM,CAAC,cAAc,CAAC,KAAI,EAAE,yBAAyB,CAAC,SAAS,CAAC,CAAC,CAAC,6DAA6D;;IACjI,CAAC;IACH,gCAAC;AAAD,CAAC,AAND,CAA+C,KAAK,GAMnD;AANY,8DAAyB;AAwBtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH;IAAA;IAyRA,CAAC;IAnRC,sFAAsF;IACzE,6BAAQ,GAArB,UAAsB,OAAe;;;;;;wBAC7B,KAAK,GAAG,IAAI,GAAG,EAA6B,CAAC;wBAC7C,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;wBACf,qBAAM,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAA;;wBAAnD,WAAW,GAAG,SAAqC;6BACrD,WAAW,EAAX,wBAAW;wBACb,qBAAM,oBAAoB,CAAC,gBAAgB,CAAC,WAAW,EAAE,KAAK,C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