@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,60 @@
|
|
|
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.CanonicalSourceGraph = void 0;
|
|
13
|
+
var graphlib_1 = require("@dagrejs/graphlib");
|
|
14
|
+
var PackageSourceFiles_1 = require("../parser/PackageSourceFiles");
|
|
15
|
+
/**
|
|
16
|
+
* The emitted form of a source graph: the same nodes, values and edges, in an order that is a
|
|
17
|
+
* function of the graph's content alone — never of the order the builder happened to visit the
|
|
18
|
+
* sources or insert placeholder parents. The generated index serializes nodes and edges in
|
|
19
|
+
* insertion order, so this order is the artifact's byte order (and the runtime's `objects()`
|
|
20
|
+
* order within one package).
|
|
21
|
+
*
|
|
22
|
+
* - Nodes by the declaring file's package-relative path, then by qualified name. A placeholder
|
|
23
|
+
* (a parent referenced here but declared elsewhere) has no file and sorts by name ahead of
|
|
24
|
+
* the declared nodes.
|
|
25
|
+
* - Edges by child, then parent (a source graph is never a multigraph: one edge per pair).
|
|
26
|
+
*
|
|
27
|
+
* Both keys are package-relative strings compared by code unit, so they are the same on every
|
|
28
|
+
* machine and in every checkout location.
|
|
29
|
+
*/
|
|
30
|
+
var CanonicalSourceGraph = /** @class */ (function () {
|
|
31
|
+
function CanonicalSourceGraph() {
|
|
32
|
+
}
|
|
33
|
+
/** A copy of `graph` whose node and edge order is canonical. */
|
|
34
|
+
CanonicalSourceGraph.of = function (graph) {
|
|
35
|
+
var canonical = new graphlib_1.Graph({
|
|
36
|
+
directed: graph.isDirected(),
|
|
37
|
+
multigraph: graph.isMultigraph(),
|
|
38
|
+
compound: graph.isCompound(),
|
|
39
|
+
});
|
|
40
|
+
for (var _i = 0, _a = CanonicalSourceGraph.nodeOrder(graph); _i < _a.length; _i++) {
|
|
41
|
+
var nodeName = _a[_i];
|
|
42
|
+
canonical.setNode(nodeName, graph.node(nodeName));
|
|
43
|
+
}
|
|
44
|
+
for (var _b = 0, _c = CanonicalSourceGraph.edgeOrder(graph); _b < _c.length; _b++) {
|
|
45
|
+
var edge = _c[_b];
|
|
46
|
+
canonical.setEdge(edge, graph.edge(edge));
|
|
47
|
+
}
|
|
48
|
+
return canonical;
|
|
49
|
+
};
|
|
50
|
+
CanonicalSourceGraph.nodeOrder = function (graph) {
|
|
51
|
+
var fileOf = function (nodeName) { var _a; return ((_a = graph.node(nodeName)) === null || _a === void 0 ? void 0 : _a.filePath) || ''; };
|
|
52
|
+
return __spreadArray([], graph.nodes(), true).sort(function (a, b) { return PackageSourceFiles_1.PackageSourceFiles.compare(fileOf(a), fileOf(b)) || PackageSourceFiles_1.PackageSourceFiles.compare(a, b); });
|
|
53
|
+
};
|
|
54
|
+
CanonicalSourceGraph.edgeOrder = function (graph) {
|
|
55
|
+
return __spreadArray([], graph.edges(), true).sort(function (a, b) { return PackageSourceFiles_1.PackageSourceFiles.compare(a.v, b.v) || PackageSourceFiles_1.PackageSourceFiles.compare(a.w, b.w); });
|
|
56
|
+
};
|
|
57
|
+
return CanonicalSourceGraph;
|
|
58
|
+
}());
|
|
59
|
+
exports.CanonicalSourceGraph = CanonicalSourceGraph;
|
|
60
|
+
//# sourceMappingURL=CanonicalSourceGraph.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CanonicalSourceGraph.js","sourceRoot":"","sources":["../../../../../../src/codegen/CanonicalSourceGraph.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8CAAgD;AACh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;IACJ,CAAC;IAEc,8BAAS,GAAxB,UAAyB,KAAY;QACnC,OAAO,kBAAI,KAAK,CAAC,KAAK,EAAE,QAAE,IAAI,CAC5B,UAAC,CAAC,EAAE,CAAC,IAAK,OAAA,uCAAkB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,uCAAkB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAA5E,CAA4E,CACvF,CAAC;IACJ,CAAC;IACH,2BAAC;AAAD,CAAC,AA/BD,IA+BC;AA/BY,oDAAoB"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Graph } from '@dagrejs/graphlib';
|
|
2
|
+
import { SharedQualifiedName } from '../parser/SharedQualifiedNames';
|
|
2
3
|
/**
|
|
3
4
|
* @param packageDir Root of the package (contains package.json)
|
|
4
5
|
* @param packageGeneratedDir Directory where generated/index.ts will be written
|
|
@@ -27,9 +28,17 @@ export declare function findDependencySourceGraph(packageDir: string, packageNam
|
|
|
27
28
|
* consuming package — npm-layout resolution: the nearest installed copy shadows hoisted ones.
|
|
28
29
|
*/
|
|
29
30
|
export declare function findDependencyDir(packageDir: string, packageName: string): string | undefined;
|
|
31
|
+
export interface EmittedSourceGraph {
|
|
32
|
+
/** The pruned graph in canonical order: what the generated index serializes. */
|
|
33
|
+
graph: Graph;
|
|
34
|
+
/** The names in `graph` that two or more source files declare; the build refuses to emit while there is one. */
|
|
35
|
+
sharedNames: SharedQualifiedName[];
|
|
36
|
+
}
|
|
30
37
|
/**
|
|
31
38
|
* The graph exactly as a build emits it: parsed from the package's source roots, with
|
|
32
|
-
* build-time-non-loadable declarations pruned
|
|
33
|
-
*
|
|
39
|
+
* build-time-non-loadable declarations pruned, in canonical order (the serialized graph and
|
|
40
|
+
* the source links follow it, so the same sources emit the same bytes on every machine), and
|
|
41
|
+
* the names in it that more than one file declares. Owned here so build emit and diagnostic
|
|
42
|
+
* tooling (reflection-doctor drift and shared-name checks) share one pipeline.
|
|
34
43
|
*/
|
|
35
|
-
export declare function createEmittedSourceGraph(packageDir: string, sourceRootsRel: string[]): Promise<
|
|
44
|
+
export declare function createEmittedSourceGraph(packageDir: string, sourceRootsRel: string[]): Promise<EmittedSourceGraph>;
|
|
@@ -69,6 +69,9 @@ var util_node_1 = require("@proteinjs/util-node");
|
|
|
69
69
|
var util_1 = require("@proteinjs/util");
|
|
70
70
|
var jsesc_1 = __importDefault(require("jsesc"));
|
|
71
71
|
var createSourceGraph_1 = require("../parser/createSourceGraph");
|
|
72
|
+
var PackageSourceFiles_1 = require("../parser/PackageSourceFiles");
|
|
73
|
+
var SharedQualifiedNames_1 = require("../parser/SharedQualifiedNames");
|
|
74
|
+
var CanonicalSourceGraph_1 = require("./CanonicalSourceGraph");
|
|
72
75
|
var reflection_1 = require("@proteinjs/reflection");
|
|
73
76
|
/**
|
|
74
77
|
* @param packageDir Root of the package (contains package.json)
|
|
@@ -121,8 +124,8 @@ function writeGeneratedIndex(packageDir, packageGeneratedDir, generatedIndexPath
|
|
|
121
124
|
case 7:
|
|
122
125
|
generatedIndex = _a.sent();
|
|
123
126
|
exportTargetNoExt = publicEntryRelOverride
|
|
124
|
-
?
|
|
125
|
-
: "".concat(
|
|
127
|
+
? PackageSourceFiles_1.PackageSourceFiles.relativePath(packageGeneratedDir, path.join(packageDir, publicEntryRelOverride)).replace(/\.[^/.]+$/, '')
|
|
128
|
+
: "".concat(PackageSourceFiles_1.PackageSourceFiles.relativePath(packageGeneratedDir, packageDir), "/index");
|
|
126
129
|
generatedIndex += "\n\n\nexport * from '".concat(exportTargetNoExt, "';");
|
|
127
130
|
return [4 /*yield*/, util_node_1.promisifiedFs.writeFile(generatedIndexPath, generatedIndex)];
|
|
128
131
|
case 8:
|
|
@@ -135,17 +138,18 @@ function writeGeneratedIndex(packageDir, packageGeneratedDir, generatedIndexPath
|
|
|
135
138
|
exports.writeGeneratedIndex = writeGeneratedIndex;
|
|
136
139
|
function sourceRepositoryLoader(packageDir, generatedIndexPath, sourceRootsRel) {
|
|
137
140
|
return __awaiter(this, void 0, void 0, function () {
|
|
138
|
-
var packageJson, code, roots, sourceGraph;
|
|
139
|
-
return __generator(this, function (
|
|
140
|
-
switch (
|
|
141
|
+
var packageJson, code, roots, _a, sourceGraph, sharedNames;
|
|
142
|
+
return __generator(this, function (_b) {
|
|
143
|
+
switch (_b.label) {
|
|
141
144
|
case 0: return [4 /*yield*/, getPackageJson(packageDir)];
|
|
142
145
|
case 1:
|
|
143
|
-
packageJson =
|
|
146
|
+
packageJson = _b.sent();
|
|
144
147
|
code = loadDependencySourceGraphs(packageDir, packageJson);
|
|
145
148
|
roots = Array.isArray(sourceRootsRel) ? sourceRootsRel : [sourceRootsRel];
|
|
146
149
|
return [4 /*yield*/, createEmittedSourceGraph(packageDir, roots)];
|
|
147
150
|
case 2:
|
|
148
|
-
|
|
151
|
+
_a = _b.sent(), sourceGraph = _a.graph, sharedNames = _a.sharedNames;
|
|
152
|
+
SharedQualifiedNames_1.SharedQualifiedNames.refuse(packageJson.name, sharedNames);
|
|
149
153
|
code += generateSourceGraph(sourceGraph);
|
|
150
154
|
code += generateSourceLinks(sourceGraph, packageJson, packageDir, generatedIndexPath);
|
|
151
155
|
code += mergeSourceGraph();
|
|
@@ -304,22 +308,26 @@ function getDependencyImportSpecifier(packageDir, packageName) {
|
|
|
304
308
|
}
|
|
305
309
|
/**
|
|
306
310
|
* The graph exactly as a build emits it: parsed from the package's source roots, with
|
|
307
|
-
* build-time-non-loadable declarations pruned
|
|
308
|
-
*
|
|
311
|
+
* build-time-non-loadable declarations pruned, in canonical order (the serialized graph and
|
|
312
|
+
* the source links follow it, so the same sources emit the same bytes on every machine), and
|
|
313
|
+
* the names in it that more than one file declares. Owned here so build emit and diagnostic
|
|
314
|
+
* tooling (reflection-doctor drift and shared-name checks) share one pipeline.
|
|
309
315
|
*/
|
|
310
316
|
function createEmittedSourceGraph(packageDir, sourceRootsRel) {
|
|
311
317
|
return __awaiter(this, void 0, void 0, function () {
|
|
312
|
-
var packageJson, sourceGraph;
|
|
318
|
+
var packageJson, declarations, sourceGraph, sharedNames;
|
|
313
319
|
return __generator(this, function (_a) {
|
|
314
320
|
switch (_a.label) {
|
|
315
321
|
case 0: return [4 /*yield*/, getPackageJson(packageDir)];
|
|
316
322
|
case 1:
|
|
317
323
|
packageJson = _a.sent();
|
|
318
|
-
|
|
324
|
+
declarations = new SharedQualifiedNames_1.SharedQualifiedNames();
|
|
325
|
+
return [4 /*yield*/, (0, createSourceGraph_1.createSourceGraph)(packageDir, [], sourceRootsRel, declarations)];
|
|
319
326
|
case 2:
|
|
320
327
|
sourceGraph = _a.sent();
|
|
321
328
|
removeNonLoadables(sourceGraph, packageJson.name);
|
|
322
|
-
|
|
329
|
+
sharedNames = declarations.in(sourceGraph);
|
|
330
|
+
return [2 /*return*/, { graph: CanonicalSourceGraph_1.CanonicalSourceGraph.of(sourceGraph), sharedNames: sharedNames }];
|
|
323
331
|
}
|
|
324
332
|
});
|
|
325
333
|
});
|
|
@@ -410,7 +418,7 @@ function generateSourceLinks(sourceGraph, packageJson, packageDir, generatedInde
|
|
|
410
418
|
}
|
|
411
419
|
// node.filePath is package-relative (never serialized absolute); resolve against the
|
|
412
420
|
// package dir to compute the real import location for the generated index.
|
|
413
|
-
var relativeImportPath =
|
|
421
|
+
var relativeImportPath = PackageSourceFiles_1.PackageSourceFiles.relativePath(path.dirname(generatedIndexPath), path.join(packageDir, node.filePath));
|
|
414
422
|
code += "import { ".concat(node.name, " } from '").concat(relativeImportPath.replace(/\.[^/.]+$/, ''), "';\n");
|
|
415
423
|
linkableNodes.push(node);
|
|
416
424
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writeGeneratedIndex.js","sourceRoot":"","sources":["../../../../../../src/codegen/writeGeneratedIndex.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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C;KAC1B;IAED,IAAI,IAAI,2BAA2B,CAAC;IACpC,KAAmB,UAAa,EAAb,+BAAa,EAAb,2BAAa,EAAb,IAAa,EAAE;QAA7B,IAAM,IAAI,sBAAA;QACb,IAAI,IAAI,aAAM,IAAI,CAAC,aAAa,gBAAM,IAAI,CAAC,IAAI,QAAK,CAAC;KACtD;IACD,IAAI,IAAI,MAAM,CAAC;IAEf,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,gBAAgB;IACvB,IAAI,IAAI,GAAG,4CAA4C,CAAC;IACxD,IAAI,IAAI,6DAA6D,CAAC;IACtE,IAAI,IAAI,mDAAmD,CAAC;IAC5D,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -16,7 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
};
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
/** Generate Source Graph */
|
|
19
|
-
var sourceGraph = "{\"options\":{\"directed\":true,\"multigraph\":false,\"compound\":false},\"nodes\":[{\"v\":\"@proteinjs/reflection-build-test-b/
|
|
19
|
+
var sourceGraph = "{\"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\"}]}";
|
|
20
20
|
/** Generate Source Links */
|
|
21
21
|
var LoadableForeignType_1 = require("../src/LoadableForeignType");
|
|
22
22
|
var LoadableForeignType_2 = require("../src/LoadableForeignType");
|
|
@@ -24,11 +24,11 @@ var LoadableForeignType_3 = require("../src/LoadableForeignType");
|
|
|
24
24
|
var LoadableForeignType_4 = require("../src/LoadableForeignType");
|
|
25
25
|
var LoadableForeignType_5 = require("../src/LoadableForeignType");
|
|
26
26
|
var sourceLinks = {
|
|
27
|
-
'@proteinjs/reflection-build-test-b/
|
|
27
|
+
'@proteinjs/reflection-build-test-b/ImplementsOptionalLoadableForeignAbstractClass': LoadableForeignType_1.ImplementsOptionalLoadableForeignAbstractClass,
|
|
28
28
|
'@proteinjs/reflection-build-test-b/ImplementsOptionalLoadableForeignInterface': LoadableForeignType_2.ImplementsOptionalLoadableForeignInterface,
|
|
29
29
|
'@proteinjs/reflection-build-test-b/LoadableForeignAbstractClass': LoadableForeignType_3.LoadableForeignAbstractClass,
|
|
30
30
|
'@proteinjs/reflection-build-test-b/OptionalLoadableForeignAbstractClass': LoadableForeignType_4.OptionalLoadableForeignAbstractClass,
|
|
31
|
-
'@proteinjs/reflection-build-test-b/
|
|
31
|
+
'@proteinjs/reflection-build-test-b/implementsOptionalLoadableForeignType': LoadableForeignType_5.implementsOptionalLoadableForeignType,
|
|
32
32
|
};
|
|
33
33
|
/** Load Source Graph and Links */
|
|
34
34
|
var reflection_1 = require("@proteinjs/reflection");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../generated/index.ts"],"names":[],"mappings":";AAAA,oCAAoC;;;;;;;;;;;;;;;;AAIpC,4BAA4B;AAE5B,IAAM,WAAW,GAAG,wiTAAwiT,CAAC;AAG7jT,4BAA4B;AAE5B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../generated/index.ts"],"names":[],"mappings":";AAAA,oCAAoC;;;;;;;;;;;;;;;;AAIpC,4BAA4B;AAE5B,IAAM,WAAW,GAAG,wiTAAwiT,CAAC;AAG7jT,4BAA4B;AAE5B,kEAA4F;AAC5F,kEAAwF;AACxF,kEAA0E;AAC1E,kEAAkF;AAClF,kEAAmF;AAEnF,IAAM,WAAW,GAAG;IACnB,mFAAmF,EAAE,oEAA8C;IACnI,+EAA+E,EAAE,gEAA0C;IAC3H,iEAAiE,EAAE,kDAA4B;IAC/F,yEAAyE,EAAE,0DAAoC;IAC/G,0EAA0E,EAAE,2DAAqC;CACjH,CAAC;AAGF,kCAAkC;AAElC,oDAAyD;AACzD,6BAAgB,CAAC,KAAK,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AAGjD,2CAAyB"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The TypeScript sources of a package, in one reproducible order.
|
|
3
|
+
*
|
|
4
|
+
* Every build of the same sources must write the same bytes, whatever machine or directory it
|
|
5
|
+
* runs in. Two machine-specific inputs are closed here, where they enter:
|
|
6
|
+
*
|
|
7
|
+
* - ORDER. The glob returns files in the order its concurrent directory reads complete, which
|
|
8
|
+
* varies with the filesystem and from run to run. The parse order decides the graph's
|
|
9
|
+
* insertion order, which declaration a name exported by two files holds (the last one parsed;
|
|
10
|
+
* the build refuses such a name when it survives the prune — `SharedQualifiedNames`), and the
|
|
11
|
+
* order that refusal lists the files in. `list()` therefore orders the files by their
|
|
12
|
+
* package-relative path, compared by code unit — never by `localeCompare`, whose collation
|
|
13
|
+
* depends on the machine's locale data.
|
|
14
|
+
* - LOCATION. `relativePath()` is the only form a source path takes in a generated artifact:
|
|
15
|
+
* relative, with `/` separators on every platform, no leading `./`.
|
|
16
|
+
*/
|
|
17
|
+
export declare class PackageSourceFiles {
|
|
18
|
+
private readonly packageDir;
|
|
19
|
+
private readonly sourceRootsRel;
|
|
20
|
+
private readonly excludedDirs;
|
|
21
|
+
constructor(packageDir: string, sourceRootsRel: string[], excludedDirs?: string[]);
|
|
22
|
+
/** Absolute paths of the package's `.ts`/`.tsx` sources under the source roots, in package-relative path order. */
|
|
23
|
+
list(): Promise<string[]>;
|
|
24
|
+
/** `filePath` relative to `fromDir`, with `/` separators on every platform and no leading `./`. */
|
|
25
|
+
static relativePath(fromDir: string, filePath: string): string;
|
|
26
|
+
/** Code-unit order: the same on every machine, unlike `localeCompare`. */
|
|
27
|
+
static compare(a: string, b: string): number;
|
|
28
|
+
private includePatterns;
|
|
29
|
+
private excludePatterns;
|
|
30
|
+
}
|
|
@@ -0,0 +1,151 @@
|
|
|
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
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
35
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
36
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
37
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
38
|
+
function step(op) {
|
|
39
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
40
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
41
|
+
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;
|
|
42
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
43
|
+
switch (op[0]) {
|
|
44
|
+
case 0: case 1: t = op; break;
|
|
45
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
46
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
47
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
48
|
+
default:
|
|
49
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
50
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
51
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
52
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
53
|
+
if (t[2]) _.ops.pop();
|
|
54
|
+
_.trys.pop(); continue;
|
|
55
|
+
}
|
|
56
|
+
op = body.call(thisArg, _);
|
|
57
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
58
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
59
|
+
}
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
74
|
+
exports.PackageSourceFiles = void 0;
|
|
75
|
+
var path = __importStar(require("path"));
|
|
76
|
+
var globby_1 = __importDefault(require("globby"));
|
|
77
|
+
/**
|
|
78
|
+
* The TypeScript sources of a package, in one reproducible order.
|
|
79
|
+
*
|
|
80
|
+
* Every build of the same sources must write the same bytes, whatever machine or directory it
|
|
81
|
+
* runs in. Two machine-specific inputs are closed here, where they enter:
|
|
82
|
+
*
|
|
83
|
+
* - ORDER. The glob returns files in the order its concurrent directory reads complete, which
|
|
84
|
+
* varies with the filesystem and from run to run. The parse order decides the graph's
|
|
85
|
+
* insertion order, which declaration a name exported by two files holds (the last one parsed;
|
|
86
|
+
* the build refuses such a name when it survives the prune — `SharedQualifiedNames`), and the
|
|
87
|
+
* order that refusal lists the files in. `list()` therefore orders the files by their
|
|
88
|
+
* package-relative path, compared by code unit — never by `localeCompare`, whose collation
|
|
89
|
+
* depends on the machine's locale data.
|
|
90
|
+
* - LOCATION. `relativePath()` is the only form a source path takes in a generated artifact:
|
|
91
|
+
* relative, with `/` separators on every platform, no leading `./`.
|
|
92
|
+
*/
|
|
93
|
+
var PackageSourceFiles = /** @class */ (function () {
|
|
94
|
+
function PackageSourceFiles(packageDir, sourceRootsRel, excludedDirs) {
|
|
95
|
+
if (excludedDirs === void 0) { excludedDirs = []; }
|
|
96
|
+
this.packageDir = packageDir;
|
|
97
|
+
this.sourceRootsRel = sourceRootsRel;
|
|
98
|
+
this.excludedDirs = excludedDirs;
|
|
99
|
+
}
|
|
100
|
+
/** Absolute paths of the package's `.ts`/`.tsx` sources under the source roots, in package-relative path order. */
|
|
101
|
+
PackageSourceFiles.prototype.list = function () {
|
|
102
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
103
|
+
var sourceFilePaths;
|
|
104
|
+
var _this = this;
|
|
105
|
+
return __generator(this, function (_a) {
|
|
106
|
+
switch (_a.label) {
|
|
107
|
+
case 0: return [4 /*yield*/, (0, globby_1.default)(__spreadArray(__spreadArray([], this.includePatterns(), true), this.excludePatterns(), true))];
|
|
108
|
+
case 1:
|
|
109
|
+
sourceFilePaths = _a.sent();
|
|
110
|
+
return [2 /*return*/, Array.from(new Set(sourceFilePaths))
|
|
111
|
+
.map(function (absolutePath) { return ({
|
|
112
|
+
absolutePath: absolutePath,
|
|
113
|
+
relativePath: PackageSourceFiles.relativePath(_this.packageDir, absolutePath),
|
|
114
|
+
}); })
|
|
115
|
+
.sort(function (a, b) { return PackageSourceFiles.compare(a.relativePath, b.relativePath); })
|
|
116
|
+
.map(function (_a) {
|
|
117
|
+
var absolutePath = _a.absolutePath;
|
|
118
|
+
return absolutePath;
|
|
119
|
+
})];
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
};
|
|
124
|
+
/** `filePath` relative to `fromDir`, with `/` separators on every platform and no leading `./`. */
|
|
125
|
+
PackageSourceFiles.relativePath = function (fromDir, filePath) {
|
|
126
|
+
return path.relative(fromDir, filePath).split(path.sep).join('/');
|
|
127
|
+
};
|
|
128
|
+
/** Code-unit order: the same on every machine, unlike `localeCompare`. */
|
|
129
|
+
PackageSourceFiles.compare = function (a, b) {
|
|
130
|
+
if (a < b) {
|
|
131
|
+
return -1;
|
|
132
|
+
}
|
|
133
|
+
return a > b ? 1 : 0;
|
|
134
|
+
};
|
|
135
|
+
PackageSourceFiles.prototype.includePatterns = function () {
|
|
136
|
+
var patterns = [];
|
|
137
|
+
for (var _i = 0, _a = this.sourceRootsRel; _i < _a.length; _i++) {
|
|
138
|
+
var rel = _a[_i];
|
|
139
|
+
var root = path.join(this.packageDir, rel);
|
|
140
|
+
patterns.push(path.join(root, '**/*.ts'));
|
|
141
|
+
patterns.push(path.join(root, '**/*.tsx'));
|
|
142
|
+
}
|
|
143
|
+
return patterns;
|
|
144
|
+
};
|
|
145
|
+
PackageSourceFiles.prototype.excludePatterns = function () {
|
|
146
|
+
return __spreadArray(['!**/node_modules/**', '!**/generated/**'], this.excludedDirs.map(function (dir) { return "!".concat(dir); }), true);
|
|
147
|
+
};
|
|
148
|
+
return PackageSourceFiles;
|
|
149
|
+
}());
|
|
150
|
+
exports.PackageSourceFiles = PackageSourceFiles;
|
|
151
|
+
//# sourceMappingURL=PackageSourceFiles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PackageSourceFiles.js","sourceRoot":"","sources":["../../../../../../src/parser/PackageSourceFiles.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA6B;AAC7B,kDAA4B;AAE5B;;;;;;;;;;;;;;;GAeG;AACH;IACE,4BACmB,UAAkB,EAClB,cAAwB,EACxB,YAA2B;QAA3B,6BAAA,EAAA,iBAA2B;QAF3B,eAAU,GAAV,UAAU,CAAQ;QAClB,mBAAc,GAAd,cAAc,CAAU;QACxB,iBAAY,GAAZ,YAAY,CAAe;IAC3C,CAAC;IAEJ,mHAAmH;IAC7G,iCAAI,GAAV;;;;;;4BACoC,qBAAM,IAAA,gBAAM,kCAAK,IAAI,CAAC,eAAe,EAAE,SAAK,IAAI,CAAC,eAAe,EAAE,QAAE,EAAA;;wBAAhG,eAAe,GAAa,SAAoE;wBACtG,sBAAO,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,eAAe,CAAC,CAAC;iCACxC,GAAG,CAAC,UAAC,YAAY,IAAK,OAAA,CAAC;gCACtB,YAAY,cAAA;gCACZ,YAAY,EAAE,kBAAkB,CAAC,YAAY,CAAC,KAAI,CAAC,UAAU,EAAE,YAAY,CAAC;6BAC7E,CAAC,EAHqB,CAGrB,CAAC;iCACF,IAAI,CAAC,UAAC,CAAC,EAAE,CAAC,IAAK,OAAA,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC,CAAC,YAAY,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CAAC;IACH,yBAAC;AAAD,CAAC,AA9CD,IA8CC;AA9CY,gDAAkB"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Graph } from '@dagrejs/graphlib';
|
|
2
|
+
/** A qualified name that two or more source files declare. */
|
|
3
|
+
export interface SharedQualifiedName {
|
|
4
|
+
qualifiedName: string;
|
|
5
|
+
/** Every file that declares it: package-relative, `/`-separated, in the order the sources parse. */
|
|
6
|
+
filePaths: string[];
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* One qualified name, one declaring file, for every name that reaches the generated index.
|
|
10
|
+
*
|
|
11
|
+
* The source graph holds ONE node per qualified name. When two files export the same name, the
|
|
12
|
+
* declaration parsed last takes the node (its value, its `filePath`, and so the class or value
|
|
13
|
+
* the source link hands `objects()`), while the parent edges of both stay on it. The other
|
|
14
|
+
* declaration leaves no trace, so the emitted graph cannot show the collision. This class records
|
|
15
|
+
* every file that declares each name while the graph is built, and names the collisions that are
|
|
16
|
+
* left in a graph.
|
|
17
|
+
*
|
|
18
|
+
* The rule applies to the graph AFTER `removeNonLoadables`, never before. Types, consts and
|
|
19
|
+
* functions exported under one name by two files are ordinary TypeScript: while none of them is
|
|
20
|
+
* Loadable, the prune drops the name and it never reaches the index. A name that survives the
|
|
21
|
+
* prune is an authoring error the graph cannot represent, and the build refuses it rather than
|
|
22
|
+
* ship the last file's declaration.
|
|
23
|
+
*
|
|
24
|
+
* Order: files are kept in the order they are recorded, which is the parse order —
|
|
25
|
+
* `PackageSourceFiles.list()` order, package-relative path by code unit — and names in the order
|
|
26
|
+
* their first declaration was recorded. Both are the same on every machine.
|
|
27
|
+
*/
|
|
28
|
+
export declare class SharedQualifiedNames {
|
|
29
|
+
private readonly filePathsByName;
|
|
30
|
+
/**
|
|
31
|
+
* The build's refusal: one error naming the package and, for each shared name, every file that
|
|
32
|
+
* declares it. Returns without effect when `sharedNames` is empty.
|
|
33
|
+
*/
|
|
34
|
+
static refuse(packageName: string, sharedNames: SharedQualifiedName[]): void;
|
|
35
|
+
/** The names left in `prunedGraph` that two or more files declare. */
|
|
36
|
+
in(prunedGraph: Graph): SharedQualifiedName[];
|
|
37
|
+
/**
|
|
38
|
+
* Records that the package-relative `filePath` declares `qualifiedName`. The graph builder calls
|
|
39
|
+
* this for every declaration it sets on the graph; a file that declares a name twice (a const
|
|
40
|
+
* and a type of one name, say) counts once.
|
|
41
|
+
*/
|
|
42
|
+
record(qualifiedName: string, filePath: string): void;
|
|
43
|
+
}
|