@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,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
|
+
if (ar || !(i in from)) {
|
|
5
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6
|
+
ar[i] = from[i];
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.SharedQualifiedNames = void 0;
|
|
13
|
+
/**
|
|
14
|
+
* One qualified name, one declaring file, for every name that reaches the generated index.
|
|
15
|
+
*
|
|
16
|
+
* The source graph holds ONE node per qualified name. When two files export the same name, the
|
|
17
|
+
* declaration parsed last takes the node (its value, its `filePath`, and so the class or value
|
|
18
|
+
* the source link hands `objects()`), while the parent edges of both stay on it. The other
|
|
19
|
+
* declaration leaves no trace, so the emitted graph cannot show the collision. This class records
|
|
20
|
+
* every file that declares each name while the graph is built, and names the collisions that are
|
|
21
|
+
* left in a graph.
|
|
22
|
+
*
|
|
23
|
+
* The rule applies to the graph AFTER `removeNonLoadables`, never before. Types, consts and
|
|
24
|
+
* functions exported under one name by two files are ordinary TypeScript: while none of them is
|
|
25
|
+
* Loadable, the prune drops the name and it never reaches the index. A name that survives the
|
|
26
|
+
* prune is an authoring error the graph cannot represent, and the build refuses it rather than
|
|
27
|
+
* ship the last file's declaration.
|
|
28
|
+
*
|
|
29
|
+
* Order: files are kept in the order they are recorded, which is the parse order —
|
|
30
|
+
* `PackageSourceFiles.list()` order, package-relative path by code unit — and names in the order
|
|
31
|
+
* their first declaration was recorded. Both are the same on every machine.
|
|
32
|
+
*/
|
|
33
|
+
var SharedQualifiedNames = /** @class */ (function () {
|
|
34
|
+
function SharedQualifiedNames() {
|
|
35
|
+
this.filePathsByName = new Map();
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* The build's refusal: one error naming the package and, for each shared name, every file that
|
|
39
|
+
* declares it. Returns without effect when `sharedNames` is empty.
|
|
40
|
+
*/
|
|
41
|
+
SharedQualifiedNames.refuse = function (packageName, sharedNames) {
|
|
42
|
+
if (sharedNames.length === 0) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
throw new Error(__spreadArray([
|
|
46
|
+
"reflection-build refused ".concat(packageName, ": a name that reaches the generated index is declared in more than one file."),
|
|
47
|
+
'The index holds one declaration per qualified name, so the file parsed last would replace the others without a trace.',
|
|
48
|
+
'Give each declaration its own name (no index was written):'
|
|
49
|
+
], sharedNames.map(function (_a) {
|
|
50
|
+
var qualifiedName = _a.qualifiedName, filePaths = _a.filePaths;
|
|
51
|
+
return " ".concat(qualifiedName, ": ").concat(filePaths.join(', '));
|
|
52
|
+
}), true).join('\n'));
|
|
53
|
+
};
|
|
54
|
+
/** The names left in `prunedGraph` that two or more files declare. */
|
|
55
|
+
SharedQualifiedNames.prototype.in = function (prunedGraph) {
|
|
56
|
+
var shared = [];
|
|
57
|
+
this.filePathsByName.forEach(function (filePaths, qualifiedName) {
|
|
58
|
+
if (filePaths.length > 1 && prunedGraph.hasNode(qualifiedName)) {
|
|
59
|
+
shared.push({ qualifiedName: qualifiedName, filePaths: __spreadArray([], filePaths, true) });
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
return shared;
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Records that the package-relative `filePath` declares `qualifiedName`. The graph builder calls
|
|
66
|
+
* this for every declaration it sets on the graph; a file that declares a name twice (a const
|
|
67
|
+
* and a type of one name, say) counts once.
|
|
68
|
+
*/
|
|
69
|
+
SharedQualifiedNames.prototype.record = function (qualifiedName, filePath) {
|
|
70
|
+
var filePaths = this.filePathsByName.get(qualifiedName);
|
|
71
|
+
if (!filePaths) {
|
|
72
|
+
this.filePathsByName.set(qualifiedName, [filePath]);
|
|
73
|
+
}
|
|
74
|
+
else if (!filePaths.includes(filePath)) {
|
|
75
|
+
filePaths.push(filePath);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
return SharedQualifiedNames;
|
|
79
|
+
}());
|
|
80
|
+
exports.SharedQualifiedNames = SharedQualifiedNames;
|
|
81
|
+
//# sourceMappingURL=SharedQualifiedNames.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SharedQualifiedNames.js","sourceRoot":"","sources":["../../../../../../src/parser/SharedQualifiedNames.ts"],"names":[],"mappings":";;;;;;;;;;;;AASA;;;;;;;;;;;;;;;;;;;GAmBG;AACH;IAAA;QACmB,oBAAe,GAAG,IAAI,GAAG,EAAoB,CAAC;IA6CjE,CAAC;IA3CC;;;OAGG;IACI,2BAAM,GAAb,UAAc,WAAmB,EAAE,WAAkC;QACnE,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE;YAC5B,OAAO;SACR;QAED,MAAM,IAAI,KAAK,CACb;YACE,mCAA4B,WAAW,iFAA8E;YACrH,uHAAuH;YACvH,4DAA4D;WACzD,WAAW,CAAC,GAAG,CAAC,UAAC,EAA4B;gBAA1B,aAAa,mBAAA,EAAE,SAAS,eAAA;YAAO,OAAA,YAAK,aAAa,eAAK,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAE;QAA7C,CAA6C,CAAC,QACnG,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;IACJ,CAAC;IAED,sEAAsE;IACtE,iCAAE,GAAF,UAAG,WAAkB;QACnB,IAAM,MAAM,GAA0B,EAAE,CAAC;QACzC,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,UAAC,SAAS,EAAE,aAAa;YACpD,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,IAAI,WAAW,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE;gBAC9D,MAAM,CAAC,IAAI,CAAC,EAAE,aAAa,eAAA,EAAE,SAAS,oBAAM,SAAS,OAAC,EAAE,CAAC,CAAC;aAC3D;QACH,CAAC,CAAC,CAAC;QACH,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;;;OAIG;IACH,qCAAM,GAAN,UAAO,aAAqB,EAAE,QAAgB;QAC5C,IAAM,SAAS,GAAG,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QAC1D,IAAI,CAAC,SAAS,EAAE;YACd,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;SACrD;aAAM,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;YACxC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;SAC1B;IACH,CAAC;IACH,2BAAC;AAAD,CAAC,AA9CD,IA8CC;AA9CY,oDAAoB"}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
import * as graphlib from '@dagrejs/graphlib';
|
|
2
2
|
import { File } from '../../modules/typescript-parser';
|
|
3
|
-
|
|
3
|
+
import { SharedQualifiedNames } from './SharedQualifiedNames';
|
|
4
|
+
/**
|
|
5
|
+
* @param sharedNames records the file of every declaration set on the graph: the graph keeps one
|
|
6
|
+
* node per qualified name, so it cannot show a name two files declare
|
|
7
|
+
*/
|
|
8
|
+
export declare function createGraphBuilder(graph: graphlib.Graph, packageJson: any, packageJsonDir: string, sharedNames: SharedQualifiedNames): (parsedFile: File) => Promise<void>;
|
|
@@ -1,27 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -60,7 +37,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
60
37
|
};
|
|
61
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
62
39
|
exports.createGraphBuilder = void 0;
|
|
63
|
-
var path = __importStar(require("path"));
|
|
64
40
|
var typescript_parser_1 = require("../../modules/typescript-parser");
|
|
65
41
|
var reflection_1 = require("@proteinjs/reflection");
|
|
66
42
|
var util_1 = require("@proteinjs/util");
|
|
@@ -69,15 +45,24 @@ var PackageNameFinder_1 = require("./types/PackageNameFinder");
|
|
|
69
45
|
var createTypeAliasDeclaration_1 = require("./types/createTypeAliasDeclaration");
|
|
70
46
|
var createClassDeclaration_1 = require("./types/createClassDeclaration");
|
|
71
47
|
var createInterfaceDeclaration_1 = require("./types/createInterfaceDeclaration");
|
|
72
|
-
|
|
48
|
+
var PackageSourceFiles_1 = require("./PackageSourceFiles");
|
|
49
|
+
/**
|
|
50
|
+
* @param sharedNames records the file of every declaration set on the graph: the graph keeps one
|
|
51
|
+
* node per qualified name, so it cannot show a name two files declare
|
|
52
|
+
*/
|
|
53
|
+
function createGraphBuilder(graph, packageJson, packageJsonDir, sharedNames) {
|
|
73
54
|
var _this = this;
|
|
74
55
|
var packageName = packageJson.name;
|
|
75
56
|
return function (parsedFile) { return __awaiter(_this, void 0, void 0, function () {
|
|
76
|
-
var filePath, _i, _a, declaration, packageNameFinder, variableDeclaration, typeAliasDeclaration, classDeclaration, _b, _c, parentInterface, _d, _e, parentClass, interfaceDeclaration, _f, _g, parentInterface;
|
|
57
|
+
var filePath, setDeclaration, _i, _a, declaration, packageNameFinder, variableDeclaration, typeAliasDeclaration, classDeclaration, _b, _c, parentInterface, _d, _e, parentClass, interfaceDeclaration, _f, _g, parentInterface;
|
|
77
58
|
return __generator(this, function (_h) {
|
|
78
59
|
switch (_h.label) {
|
|
79
60
|
case 0:
|
|
80
|
-
filePath =
|
|
61
|
+
filePath = PackageSourceFiles_1.PackageSourceFiles.relativePath(packageJsonDir, parsedFile.filePath);
|
|
62
|
+
setDeclaration = function (qualifiedName, value) {
|
|
63
|
+
graph.setNode(qualifiedName, value);
|
|
64
|
+
sharedNames.record(qualifiedName, filePath);
|
|
65
|
+
};
|
|
81
66
|
_i = 0, _a = parsedFile.declarations;
|
|
82
67
|
_h.label = 1;
|
|
83
68
|
case 1:
|
|
@@ -94,7 +79,7 @@ function createGraphBuilder(graph, packageJson, packageJsonDir) {
|
|
|
94
79
|
return [4 /*yield*/, (0, createVariableDeclaration_1.createVariableDeclaration)(declaration, packageNameFinder, filePath)];
|
|
95
80
|
case 2:
|
|
96
81
|
variableDeclaration = _h.sent();
|
|
97
|
-
|
|
82
|
+
setDeclaration(variableDeclaration.qualifiedName, Object.assign(variableDeclaration, { sourceType: reflection_1.SourceType.variable }));
|
|
98
83
|
addTypeAliasDeclaration(variableDeclaration.type, variableDeclaration.qualifiedName, reflection_1.SourceRelationship.hasType, graph);
|
|
99
84
|
return [3 /*break*/, 9];
|
|
100
85
|
case 3:
|
|
@@ -102,7 +87,7 @@ function createGraphBuilder(graph, packageJson, packageJsonDir) {
|
|
|
102
87
|
return [4 /*yield*/, (0, createTypeAliasDeclaration_1.createTypeAliasDeclaration)(declaration, packageNameFinder, filePath)];
|
|
103
88
|
case 4:
|
|
104
89
|
typeAliasDeclaration = _h.sent();
|
|
105
|
-
|
|
90
|
+
setDeclaration(typeAliasDeclaration.qualifiedName, Object.assign(typeAliasDeclaration, { sourceType: reflection_1.SourceType.typeAlias }));
|
|
106
91
|
addTypeAliasDeclaration(typeAliasDeclaration, typeAliasDeclaration.qualifiedName, reflection_1.SourceRelationship.extendsType, graph);
|
|
107
92
|
return [3 /*break*/, 9];
|
|
108
93
|
case 5:
|
|
@@ -110,7 +95,7 @@ function createGraphBuilder(graph, packageJson, packageJsonDir) {
|
|
|
110
95
|
return [4 /*yield*/, (0, createClassDeclaration_1.createClassDeclaration)(declaration, packageNameFinder, filePath)];
|
|
111
96
|
case 6:
|
|
112
97
|
classDeclaration = _h.sent();
|
|
113
|
-
|
|
98
|
+
setDeclaration(classDeclaration.qualifiedName, Object.assign(classDeclaration, { sourceType: reflection_1.SourceType.class }));
|
|
114
99
|
for (_b = 0, _c = classDeclaration.directParentInterfaces; _b < _c.length; _b++) {
|
|
115
100
|
parentInterface = _c[_b];
|
|
116
101
|
if (parentInterface.packageName.startsWith('/')) {
|
|
@@ -137,7 +122,7 @@ function createGraphBuilder(graph, packageJson, packageJsonDir) {
|
|
|
137
122
|
return [4 /*yield*/, (0, createInterfaceDeclaration_1.createInterfaceDeclaration)(declaration, packageNameFinder, filePath)];
|
|
138
123
|
case 8:
|
|
139
124
|
interfaceDeclaration = _h.sent();
|
|
140
|
-
|
|
125
|
+
setDeclaration(interfaceDeclaration.qualifiedName, Object.assign(interfaceDeclaration, { sourceType: reflection_1.SourceType.interface }));
|
|
141
126
|
for (_f = 0, _g = interfaceDeclaration.directParents; _f < _g.length; _f++) {
|
|
142
127
|
parentInterface = _g[_f];
|
|
143
128
|
if (parentInterface.packageName.startsWith('/')) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createGraphBuilder.js","sourceRoot":"","sources":["../../../../../../src/parser/createGraphBuilder.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createGraphBuilder.js","sourceRoot":"","sources":["../../../../../../src/parser/createGraphBuilder.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
import * as graphlib from '@dagrejs/graphlib';
|
|
2
|
-
|
|
2
|
+
import { SharedQualifiedNames } from './SharedQualifiedNames';
|
|
3
|
+
/**
|
|
4
|
+
* @param sharedNames receives the file of every declaration the graph holds a node for; the
|
|
5
|
+
* build reads the names two files declare from it after the prune
|
|
6
|
+
*/
|
|
7
|
+
export declare function createSourceGraph(dir: string, excludedDirs?: string[], sourceRootsRel?: string | string[], sharedNames?: SharedQualifiedNames): Promise<graphlib.Graph>;
|
|
@@ -58,71 +58,56 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
58
58
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
59
59
|
}
|
|
60
60
|
};
|
|
61
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
62
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
63
|
-
if (ar || !(i in from)) {
|
|
64
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
65
|
-
ar[i] = from[i];
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
69
|
-
};
|
|
70
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
71
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
72
|
-
};
|
|
73
61
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
74
62
|
exports.createSourceGraph = void 0;
|
|
75
63
|
var graphlib = __importStar(require("@dagrejs/graphlib"));
|
|
76
|
-
var globby_1 = __importDefault(require("globby"));
|
|
77
64
|
var path = __importStar(require("path"));
|
|
78
65
|
var typescript_parser_1 = require("../../modules/typescript-parser");
|
|
79
66
|
var util_node_1 = require("@proteinjs/util-node");
|
|
80
67
|
var createGraphBuilder_1 = require("./createGraphBuilder");
|
|
81
|
-
|
|
68
|
+
var PackageSourceFiles_1 = require("./PackageSourceFiles");
|
|
69
|
+
var SharedQualifiedNames_1 = require("./SharedQualifiedNames");
|
|
70
|
+
/**
|
|
71
|
+
* @param sharedNames receives the file of every declaration the graph holds a node for; the
|
|
72
|
+
* build reads the names two files declare from it after the prune
|
|
73
|
+
*/
|
|
74
|
+
function createSourceGraph(dir, excludedDirs, sourceRootsRel, sharedNames) {
|
|
82
75
|
if (excludedDirs === void 0) { excludedDirs = []; }
|
|
83
76
|
if (sourceRootsRel === void 0) { sourceRootsRel = 'src'; }
|
|
77
|
+
if (sharedNames === void 0) { sharedNames = new SharedQualifiedNames_1.SharedQualifiedNames(); }
|
|
84
78
|
return __awaiter(this, void 0, void 0, function () {
|
|
85
|
-
var packageJsonPath, packageJson, roots,
|
|
86
|
-
return __generator(this, function (
|
|
87
|
-
switch (
|
|
79
|
+
var packageJsonPath, packageJson, roots, sourceFilePaths, graph, addSourceFile, parser, _i, sourceFilePaths_1, sourceFilePath, sourceFile;
|
|
80
|
+
return __generator(this, function (_a) {
|
|
81
|
+
switch (_a.label) {
|
|
88
82
|
case 0:
|
|
89
83
|
packageJsonPath = path.join(dir, 'package.json');
|
|
90
84
|
return [4 /*yield*/, util_node_1.promisifiedFs.exists(packageJsonPath)];
|
|
91
85
|
case 1:
|
|
92
|
-
if (!(
|
|
86
|
+
if (!(_a.sent())) {
|
|
93
87
|
throw new Error("Unable to find package.json in dir: ".concat(dir));
|
|
94
88
|
}
|
|
95
89
|
packageJson = require(packageJsonPath);
|
|
96
90
|
roots = Array.isArray(sourceRootsRel) ? sourceRootsRel : [sourceRootsRel];
|
|
97
|
-
|
|
98
|
-
for (_i = 0, roots_1 = roots; _i < roots_1.length; _i++) {
|
|
99
|
-
rel = roots_1[_i];
|
|
100
|
-
root = path.join(dir, rel);
|
|
101
|
-
patterns.push(path.join(root, '**/*.ts'));
|
|
102
|
-
patterns.push(path.join(root, '**/*.tsx'));
|
|
103
|
-
}
|
|
104
|
-
excludePatterns = __spreadArray(['!**/node_modules/**', '!**/generated/**'], excludedDirs.map(function (d) { return "!".concat(d); }), true);
|
|
105
|
-
return [4 /*yield*/, (0, globby_1.default)(__spreadArray(__spreadArray([], patterns, true), excludePatterns, true))];
|
|
91
|
+
return [4 /*yield*/, new PackageSourceFiles_1.PackageSourceFiles(dir, roots, excludedDirs).list()];
|
|
106
92
|
case 2:
|
|
107
|
-
sourceFilePaths =
|
|
108
|
-
uniqueFilePaths = Array.from(new Set(sourceFilePaths));
|
|
93
|
+
sourceFilePaths = _a.sent();
|
|
109
94
|
graph = new graphlib.Graph();
|
|
110
|
-
addSourceFile = (0, createGraphBuilder_1.createGraphBuilder)(graph, packageJson, dir);
|
|
95
|
+
addSourceFile = (0, createGraphBuilder_1.createGraphBuilder)(graph, packageJson, dir, sharedNames);
|
|
111
96
|
parser = new typescript_parser_1.TypescriptParser();
|
|
112
|
-
|
|
113
|
-
|
|
97
|
+
_i = 0, sourceFilePaths_1 = sourceFilePaths;
|
|
98
|
+
_a.label = 3;
|
|
114
99
|
case 3:
|
|
115
|
-
if (!(
|
|
116
|
-
sourceFilePath =
|
|
100
|
+
if (!(_i < sourceFilePaths_1.length)) return [3 /*break*/, 7];
|
|
101
|
+
sourceFilePath = sourceFilePaths_1[_i];
|
|
117
102
|
return [4 /*yield*/, parser.parseFile(sourceFilePath, path.dirname(sourceFilePath))];
|
|
118
103
|
case 4:
|
|
119
|
-
sourceFile =
|
|
104
|
+
sourceFile = _a.sent();
|
|
120
105
|
return [4 /*yield*/, addSourceFile(sourceFile)];
|
|
121
106
|
case 5:
|
|
122
|
-
|
|
123
|
-
|
|
107
|
+
_a.sent();
|
|
108
|
+
_a.label = 6;
|
|
124
109
|
case 6:
|
|
125
|
-
|
|
110
|
+
_i++;
|
|
126
111
|
return [3 /*break*/, 3];
|
|
127
112
|
case 7: return [2 /*return*/, graph];
|
|
128
113
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createSourceGraph.js","sourceRoot":"","sources":["../../../../../../src/parser/createSourceGraph.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createSourceGraph.js","sourceRoot":"","sources":["../../../../../../src/parser/createSourceGraph.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0DAA8C;AAC9C,yCAA6B;AAC7B,qEAAmE;AACnE,kDAAqD;AACrD,2DAA0D;AAC1D,2DAA0D;AAC1D,+DAA8D;AAE9D;;;GAGG;AACH,SAAsB,iBAAiB,CACrC,GAAW,EACX,YAA2B,EAC3B,cAAyC,EACzC,WAA8D;IAF9D,6BAAA,EAAA,iBAA2B;IAC3B,+BAAA,EAAA,sBAAyC;IACzC,4BAAA,EAAA,kBAAwC,2CAAoB,EAAE;;;;;;oBAExD,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;oBACjD,qBAAM,yBAAa,CAAC,MAAM,CAAC,eAAe,CAAC,EAAA;;oBAAjD,IAAI,CAAC,CAAC,SAA2C,CAAC,EAAE;wBAClD,MAAM,IAAI,KAAK,CAAC,8CAAuC,GAAG,CAAE,CAAC,CAAC;qBAC/D;oBAEK,WAAW,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;oBACvC,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC;oBACxD,qBAAM,IAAI,uCAAkB,CAAC,GAAG,EAAE,KAAK,EAAE,YAAY,CAAC,CAAC,IAAI,EAAE,EAAA;;oBAA/E,eAAe,GAAG,SAA6D;oBAE/E,KAAK,GAAG,IAAI,QAAQ,CAAC,KAAK,EAAE,CAAC;oBAC7B,aAAa,GAAG,IAAA,uCAAkB,EAAC,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,WAAW,CAAC,CAAC;oBACzE,MAAM,GAAG,IAAI,oCAAgB,EAAE,CAAC;0BAKM,EAAf,mCAAe;;;yBAAf,CAAA,6BAAe,CAAA;oBAAjC,cAAc;oBACJ,qBAAM,MAAM,CAAC,SAAS,CAAC,cAAc,EAAE,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,EAAA;;oBAAjF,UAAU,GAAG,SAAoE;oBACvF,qBAAM,aAAa,CAAC,UAAU,CAAC,EAAA;;oBAA/B,SAA+B,CAAC;;;oBAFL,IAAe,CAAA;;wBAK5C,sBAAO,KAAK,EAAC;;;;CACd;AA5BD,8CA4BC"}
|
|
@@ -3,24 +3,24 @@
|
|
|
3
3
|
/** Generate Source Graph */
|
|
4
4
|
|
|
5
5
|
const sourceGraph =
|
|
6
|
-
'{"options":{"directed":true,"multigraph":false,"compound":false},"nodes":[{"v":"@proteinjs/reflection-build-test-b/
|
|
6
|
+
'{"options":{"directed":true,"multigraph":false,"compound":false},"nodes":[{"v":"@proteinjs/reflection/Loadable"},{"v":"@proteinjs/reflection-build-test-b/ImplementsOptionalLoadableForeignAbstractClass","value":{"packageName":"@proteinjs/reflection-build-test-b","name":"ImplementsOptionalLoadableForeignAbstractClass","filePath":"src/LoadableForeignType.ts","qualifiedName":"@proteinjs/reflection-build-test-b/ImplementsOptionalLoadableForeignAbstractClass","isAbstract":false,"isStatic":false,"visibility":"public","properties":[{"name":"z","type":null,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public"}],"methods":[],"typeParameters":[],"directParentInterfaces":[],"directParentClasses":[{"packageName":"@proteinjs/reflection-build-test-b","name":"OptionalLoadableForeignAbstractClass","filePath":null,"qualifiedName":"@proteinjs/reflection-build-test-b/OptionalLoadableForeignAbstractClass","isAbstract":false,"isStatic":false,"visibility":"public","properties":[],"methods":[],"typeParameters":[],"directParentInterfaces":[],"directParentClasses":[]}],"sourceType":2}},{"v":"@proteinjs/reflection-build-test-b/ImplementsOptionalLoadableForeignInterface","value":{"packageName":"@proteinjs/reflection-build-test-b","name":"ImplementsOptionalLoadableForeignInterface","filePath":"src/LoadableForeignType.ts","qualifiedName":"@proteinjs/reflection-build-test-b/ImplementsOptionalLoadableForeignInterface","isAbstract":false,"isStatic":false,"visibility":"public","properties":[{"name":"z","type":null,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public"}],"methods":[],"typeParameters":[],"directParentInterfaces":[{"packageName":"@proteinjs/reflection-build-test-b","name":"OptionalLoadableForeignInterface","filePath":null,"qualifiedName":"@proteinjs/reflection-build-test-b/OptionalLoadableForeignInterface","properties":[],"methods":[],"typeParameters":[],"directParents":[]}],"directParentClasses":[],"sourceType":2}},{"v":"@proteinjs/reflection-build-test-b/LoadableForeignAbstractClass","value":{"packageName":"@proteinjs/reflection-build-test-b","name":"LoadableForeignAbstractClass","filePath":"src/LoadableForeignType.ts","qualifiedName":"@proteinjs/reflection-build-test-b/LoadableForeignAbstractClass","isAbstract":true,"isStatic":false,"visibility":"public","properties":[{"name":"z","type":{"packageName":"","name":"number","filePath":null,"qualifiedName":"/number","typeParameters":null,"directParents":null},"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public"}],"methods":[],"typeParameters":[],"directParentInterfaces":[{"packageName":"@proteinjs/reflection","name":"Loadable","filePath":null,"qualifiedName":"@proteinjs/reflection/Loadable","properties":[],"methods":[],"typeParameters":[],"directParents":[]}],"directParentClasses":[],"sourceType":2}},{"v":"@proteinjs/reflection-build-test-b/LoadableForeignInterface","value":{"packageName":"@proteinjs/reflection-build-test-b","name":"LoadableForeignInterface","filePath":"src/LoadableForeignType.ts","qualifiedName":"@proteinjs/reflection-build-test-b/LoadableForeignInterface","properties":[{"name":"z","type":{"packageName":"","name":"number","filePath":null,"qualifiedName":"/number","typeParameters":null,"directParents":null},"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public"}],"methods":[],"typeParameters":[],"directParents":[{"packageName":"@proteinjs/reflection","name":"Loadable","filePath":null,"qualifiedName":"@proteinjs/reflection/Loadable","properties":[],"methods":[],"typeParameters":[],"directParents":[]}],"sourceType":3}},{"v":"@proteinjs/reflection-build-test-b/LoadableForeignType","value":{"packageName":"@proteinjs/reflection-build-test-b","name":"LoadableForeignType","filePath":"src/LoadableForeignType.ts","qualifiedName":"@proteinjs/reflection-build-test-b/LoadableForeignType","typeParameters":[],"directParents":[{"packageName":"@proteinjs/reflection","name":"Loadable","filePath":null,"qualifiedName":"@proteinjs/reflection/Loadable","typeParameters":[],"directParents":null},{"packageName":"@proteinjs/reflection-build-test-b","name":"{ z: number }","filePath":null,"qualifiedName":"@proteinjs/reflection-build-test-b/{ z: number }","typeParameters":[],"directParents":null}],"sourceType":1}},{"v":"@proteinjs/reflection-build-test-b/OptionalLoadableForeignAbstractClass","value":{"packageName":"@proteinjs/reflection-build-test-b","name":"OptionalLoadableForeignAbstractClass","filePath":"src/LoadableForeignType.ts","qualifiedName":"@proteinjs/reflection-build-test-b/OptionalLoadableForeignAbstractClass","isAbstract":true,"isStatic":false,"visibility":"public","properties":[{"name":"z","type":{"packageName":"","name":"number","filePath":null,"qualifiedName":"/number","typeParameters":null,"directParents":null},"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public"}],"methods":[],"typeParameters":[],"directParentInterfaces":[{"packageName":"@proteinjs/reflection","name":"Loadable","filePath":null,"qualifiedName":"@proteinjs/reflection/Loadable","properties":[],"methods":[],"typeParameters":[],"directParents":[]}],"directParentClasses":[],"sourceType":2}},{"v":"@proteinjs/reflection-build-test-b/OptionalLoadableForeignInterface","value":{"packageName":"@proteinjs/reflection-build-test-b","name":"OptionalLoadableForeignInterface","filePath":"src/LoadableForeignType.ts","qualifiedName":"@proteinjs/reflection-build-test-b/OptionalLoadableForeignInterface","properties":[{"name":"z","type":{"packageName":"","name":"number","filePath":null,"qualifiedName":"/number","typeParameters":null,"directParents":null},"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public"}],"methods":[],"typeParameters":[],"directParents":[{"packageName":"@proteinjs/reflection","name":"Loadable","filePath":null,"qualifiedName":"@proteinjs/reflection/Loadable","properties":[],"methods":[],"typeParameters":[],"directParents":[]}],"sourceType":3}},{"v":"@proteinjs/reflection-build-test-b/OptionalLoadableForeignType","value":{"packageName":"@proteinjs/reflection-build-test-b","name":"OptionalLoadableForeignType","filePath":"src/LoadableForeignType.ts","qualifiedName":"@proteinjs/reflection-build-test-b/OptionalLoadableForeignType","typeParameters":[],"directParents":[{"packageName":"@proteinjs/reflection","name":"Loadable","filePath":null,"qualifiedName":"@proteinjs/reflection/Loadable","typeParameters":[],"directParents":null},{"packageName":"@proteinjs/reflection-build-test-b","name":"{ z: number }","filePath":null,"qualifiedName":"@proteinjs/reflection-build-test-b/{ z: number }","typeParameters":[],"directParents":null}],"sourceType":1}},{"v":"@proteinjs/reflection-build-test-b/implementsOptionalLoadableForeignType","value":{"packageName":"@proteinjs/reflection-build-test-b","name":"implementsOptionalLoadableForeignType","filePath":"src/LoadableForeignType.ts","qualifiedName":"@proteinjs/reflection-build-test-b/implementsOptionalLoadableForeignType","type":{"packageName":"@proteinjs/reflection-build-test-b","name":"OptionalLoadableForeignType","filePath":null,"qualifiedName":"@proteinjs/reflection-build-test-b/OptionalLoadableForeignType","typeParameters":[],"directParents":[{"packageName":"@proteinjs/reflection-build-test-b","name":"OptionalLoadableForeignType","filePath":null,"qualifiedName":"@proteinjs/reflection-build-test-b/OptionalLoadableForeignType","typeParameters":[],"directParents":null}]},"isExported":true,"isConst":true,"sourceType":0}}],"edges":[{"v":"@proteinjs/reflection-build-test-b/ImplementsOptionalLoadableForeignAbstractClass","w":"@proteinjs/reflection-build-test-b/OptionalLoadableForeignAbstractClass","value":"extends class"},{"v":"@proteinjs/reflection-build-test-b/ImplementsOptionalLoadableForeignInterface","w":"@proteinjs/reflection-build-test-b/OptionalLoadableForeignInterface","value":"implements interface"},{"v":"@proteinjs/reflection-build-test-b/LoadableForeignAbstractClass","w":"@proteinjs/reflection/Loadable","value":"implements interface"},{"v":"@proteinjs/reflection-build-test-b/LoadableForeignInterface","w":"@proteinjs/reflection/Loadable","value":"extends interface"},{"v":"@proteinjs/reflection-build-test-b/LoadableForeignType","w":"@proteinjs/reflection/Loadable","value":"extends type"},{"v":"@proteinjs/reflection-build-test-b/OptionalLoadableForeignAbstractClass","w":"@proteinjs/reflection/Loadable","value":"implements interface"},{"v":"@proteinjs/reflection-build-test-b/OptionalLoadableForeignInterface","w":"@proteinjs/reflection/Loadable","value":"extends interface"},{"v":"@proteinjs/reflection-build-test-b/OptionalLoadableForeignType","w":"@proteinjs/reflection/Loadable","value":"extends type"},{"v":"@proteinjs/reflection-build-test-b/implementsOptionalLoadableForeignType","w":"@proteinjs/reflection-build-test-b/OptionalLoadableForeignType","value":"has type"}]}';
|
|
7
7
|
|
|
8
8
|
/** Generate Source Links */
|
|
9
9
|
|
|
10
|
-
import {
|
|
10
|
+
import { ImplementsOptionalLoadableForeignAbstractClass } from '../src/LoadableForeignType';
|
|
11
11
|
import { ImplementsOptionalLoadableForeignInterface } from '../src/LoadableForeignType';
|
|
12
12
|
import { LoadableForeignAbstractClass } from '../src/LoadableForeignType';
|
|
13
13
|
import { OptionalLoadableForeignAbstractClass } from '../src/LoadableForeignType';
|
|
14
|
-
import {
|
|
14
|
+
import { implementsOptionalLoadableForeignType } from '../src/LoadableForeignType';
|
|
15
15
|
|
|
16
16
|
const sourceLinks = {
|
|
17
|
-
'@proteinjs/reflection-build-test-b/
|
|
17
|
+
'@proteinjs/reflection-build-test-b/ImplementsOptionalLoadableForeignAbstractClass':
|
|
18
|
+
ImplementsOptionalLoadableForeignAbstractClass,
|
|
18
19
|
'@proteinjs/reflection-build-test-b/ImplementsOptionalLoadableForeignInterface':
|
|
19
20
|
ImplementsOptionalLoadableForeignInterface,
|
|
20
21
|
'@proteinjs/reflection-build-test-b/LoadableForeignAbstractClass': LoadableForeignAbstractClass,
|
|
21
22
|
'@proteinjs/reflection-build-test-b/OptionalLoadableForeignAbstractClass': OptionalLoadableForeignAbstractClass,
|
|
22
|
-
'@proteinjs/reflection-build-test-b/
|
|
23
|
-
ImplementsOptionalLoadableForeignAbstractClass,
|
|
23
|
+
'@proteinjs/reflection-build-test-b/implementsOptionalLoadableForeignType': implementsOptionalLoadableForeignType,
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
/** Load Source Graph and Links */
|
|
@@ -1053,9 +1053,9 @@
|
|
|
1053
1053
|
}
|
|
1054
1054
|
},
|
|
1055
1055
|
"node_modules/@proteinjs/reflection": {
|
|
1056
|
-
"version": "1.
|
|
1057
|
-
"resolved": "https://registry.npmjs.org/@proteinjs/reflection/-/reflection-1.
|
|
1058
|
-
"integrity": "sha512-
|
|
1056
|
+
"version": "1.2.0",
|
|
1057
|
+
"resolved": "https://registry.npmjs.org/@proteinjs/reflection/-/reflection-1.2.0.tgz",
|
|
1058
|
+
"integrity": "sha512-AsoipvjpRD0WA1VC4770D5NsN0BDdli9UipdzHHPxcA+BJYcxwPLPLA7h+AAXTNMNfpr/BbEFkxHC0oSCiTkNg==",
|
|
1059
1059
|
"license": "ISC",
|
|
1060
1060
|
"dependencies": {
|
|
1061
1061
|
"@dagrejs/graphlib": "2.1.4",
|
|
@@ -1063,9 +1063,9 @@
|
|
|
1063
1063
|
}
|
|
1064
1064
|
},
|
|
1065
1065
|
"node_modules/@proteinjs/util": {
|
|
1066
|
-
"version": "1.6.
|
|
1067
|
-
"resolved": "https://registry.npmjs.org/@proteinjs/util/-/util-1.6.
|
|
1068
|
-
"integrity": "sha512-
|
|
1066
|
+
"version": "1.6.2",
|
|
1067
|
+
"resolved": "https://registry.npmjs.org/@proteinjs/util/-/util-1.6.2.tgz",
|
|
1068
|
+
"integrity": "sha512-ZY7rMImFNnGV7x/Bqkkav1/gy9IvRR823JcnRJ4SoWXSlA29kuPdaHfnBay6eTQ7+kjiGGtJ+tMWM6NvZW9rUw==",
|
|
1069
1069
|
"license": "ISC",
|
|
1070
1070
|
"dependencies": {
|
|
1071
1071
|
"@dagrejs/graphlib": "2.1.4",
|
|
@@ -1073,13 +1073,13 @@
|
|
|
1073
1073
|
}
|
|
1074
1074
|
},
|
|
1075
1075
|
"node_modules/@proteinjs/util-node": {
|
|
1076
|
-
"version": "1.
|
|
1077
|
-
"resolved": "https://registry.npmjs.org/@proteinjs/util-node/-/util-node-1.
|
|
1078
|
-
"integrity": "sha512
|
|
1076
|
+
"version": "1.11.0",
|
|
1077
|
+
"resolved": "https://registry.npmjs.org/@proteinjs/util-node/-/util-node-1.11.0.tgz",
|
|
1078
|
+
"integrity": "sha512-+G6Q2w/F5NqmB/3wpNlhj6anpFs503xeKGiec4Hh0+WAsN1JkZCMmEQsHrrzaLGide0b6LyY3Kdo1eycFWRwGw==",
|
|
1079
1079
|
"license": "ISC",
|
|
1080
1080
|
"dependencies": {
|
|
1081
1081
|
"@dagrejs/graphlib": "2.1.4",
|
|
1082
|
-
"@proteinjs/util": "^1.6.
|
|
1082
|
+
"@proteinjs/util": "^1.6.2",
|
|
1083
1083
|
"fs-extra": "11.1.1",
|
|
1084
1084
|
"globby": "11.0.1",
|
|
1085
1085
|
"typescript": "5.2.2"
|
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.6.2](https://github.com/proteinjs/util/compare/@proteinjs/util@1.6.1...@proteinjs/util@1.6.2) (2026-08-13)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @proteinjs/util
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
# [1.6.0](https://github.com/proteinjs/util/compare/@proteinjs/util@1.5.0...@proteinjs/util@1.6.0) (2026-03-06)
|
|
7
15
|
|
|
8
16
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Brent Bahry
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@proteinjs/util",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.2",
|
|
4
4
|
"description": "Runtime-agnostic util libs",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -36,5 +36,6 @@
|
|
|
36
36
|
"eslint-config-prettier": "9.1.0",
|
|
37
37
|
"eslint-plugin-prettier": "5.1.3",
|
|
38
38
|
"typescript": "5.2.2"
|
|
39
|
-
}
|
|
39
|
+
},
|
|
40
|
+
"gitHead": "6b3396594c660b51fb8312414afba5af74287159"
|
|
40
41
|
}
|
|
@@ -3,6 +3,69 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [1.11.0](https://github.com/proteinjs/util/compare/@proteinjs/util-node@1.10.6...@proteinjs/util-node@1.11.0) (2026-09-03)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **util-node:** workspace membership is declared, never crawled — WorkspaceDeclaration is the one owner of which package.json files are members: a root's lerna.json `packages` (lerna's default packages/* when the field is absent) plus the root package.json `workspacePackages` extra roots name exactly its members; a declared root OWNS its subtree (nothing undeclared beneath it is a member, however the tree is walked from above); only a tree with no declaration at its root is crawled — bounded exactly as before (no hidden dirs, node_modules, dist, symlinks) — and it hands every declared root it meets to that root's declaration. Hard errors naming their paths: a declared literal with no package.json; two leaf packages sharing a name (containers — every root in the metarepo is named `root` — are path-identified and exempt). npm's own `workspaces` field is deliberately not read (a different install model). Why: n3xah/app Deploy to Test run 33747781291 (2026-09-03) — CI fixture trees carrying the app's own package names shadowed packages/common, server and ui in the crawl (last path wins), build-workspace built "1 package in workspace", the image shipped with no packages/server/dist, and the migration gate failed on `Cannot find module dist/generated/index.js`. RED RUN stated: the shadowing repro through PackageUtil.getWorkspaceMetadata resolved @t/server to the fixture path at the pre-fix scanner; green with the declaration wired in. Bites verified: collision check disarmed -> the collision pin red alone; declaration ignored at the root -> repro + globs + literal-missing red; restored green. Suite: packages/node 6 suites / 30 tests green (24 pre-existing + 6 new). ([a8f3684](https://github.com/proteinjs/util/commit/a8f368494a07146d850c33584428945601d223e3))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [1.10.6](https://github.com/proteinjs/util/compare/@proteinjs/util-node@1.10.5...@proteinjs/util-node@1.10.6) (2026-09-02)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* **util-node:** Fs glob helpers prune ignored directories under a dot-directory base path — match relative to cwd (absolute:true) instead of folding the directory into an absolute pattern. In the absolute form fast-glob matched the ignore list against the absolute entry path and a globstar does not cross a dot-segment, so under ~/.n3xa/workspaces/<name> (the default local workspaces root) or a .scratch estate the ignore list matched nothing: every node_modules/dist was walked in full, workspace symlinks followed into cycles, and the dev-skill Glob of every package.json over a materialized metarepo exhausted a 12G heap three times running (2026-09-02). getFilePaths now rides the same path (its dir + '**/*' form walked one level only without a trailing separator). RED RUN stated: Fs.getFilePathsMatchingGlob.test 3/3 red at the pre-fix code (EACCES from inside node_modules/dep/locked under a dot-directory tmp root — the walk provably entering node_modules); green with the cwd form. Bite verified: absolute form re-introduced -> 3/3 red; restored green. Suite: packages/node 5 suites / 24 tests green (21 pre-existing + 3 new). ([2aace27](https://github.com/proteinjs/util/commit/2aace277e5e5727dc2666ee0a3cd3d49a3c69932))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
## [1.10.5](https://github.com/proteinjs/util/compare/@proteinjs/util-node@1.10.4...@proteinjs/util-node@1.10.5) (2026-09-02)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### Bug Fixes
|
|
32
|
+
|
|
33
|
+
* **util-node:** parseArgsMap splits on the FIRST '=' only — values with embedded '=' (the estate CLI's --note among them) previously truncated at the second '=' (split('=')[1] kept one segment). The parser now preserves the full value after the first separator; bare flags and empty values unchanged. RED RUN stated: ArgsMap.test 2/6 red at the pre-fix code (--note=a=b=c parsed as 'a'); green with the indexOf split. Bite verified: truncation re-introduced -> the 2 embedded-'=' pins red alone; restored green. Suite: packages/node 4 suites / 21 tests green (15 pre-existing + 6 new). ([277c1d6](https://github.com/proteinjs/util/commit/277c1d65e15d874f7c1750b3edf63bf905120780))
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
## [1.10.4](https://github.com/proteinjs/util/compare/@proteinjs/util-node@1.10.3...@proteinjs/util-node@1.10.4) (2026-08-17)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
### Bug Fixes
|
|
43
|
+
|
|
44
|
+
* package identity is the package.json path — name-keyed discovery dropped same-named packages ([9cd9721](https://github.com/proteinjs/util/commit/9cd9721dec7052f65b1021a4c004900ff19802a8)), closes [#75](https://github.com/proteinjs/util/issues/75)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
## [1.10.3](https://github.com/proteinjs/util/compare/@proteinjs/util-node@1.10.2...@proteinjs/util-node@1.10.3) (2026-08-15)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
### Bug Fixes
|
|
54
|
+
|
|
55
|
+
* bounded workspace package discovery — replace glob walk that descended unpruned into hidden directories ([04a56bb](https://github.com/proteinjs/util/commit/04a56bb228536ffa2fb63e888524c672f4cca186))
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
## [1.10.2](https://github.com/proteinjs/util/compare/@proteinjs/util-node@1.10.1...@proteinjs/util-node@1.10.2) (2026-08-13)
|
|
62
|
+
|
|
63
|
+
**Note:** Version bump only for package @proteinjs/util-node
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
6
69
|
# [1.10.0](https://github.com/proteinjs/util/compare/@proteinjs/util-node@1.9.0...@proteinjs/util-node@1.10.0) (2026-07-28)
|
|
7
70
|
|
|
8
71
|
|