@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
|
@@ -15,7 +15,7 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
15
15
|
};
|
|
16
16
|
})();
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.ImplementsExtendsNotLoadableForeignAbstractClass = exports.ExtendsNotLoadableForeignAbstractClass = exports.ImplementsExtendsLoadableForeignAbstractClass = exports.ExtendsLoadableForeignAbstractClass = exports.
|
|
18
|
+
exports.ImplementsExtendsNotLoadableForeignAbstractClass = exports.ExtendsNotLoadableForeignAbstractClass = exports.ImplementsExtendsLoadableForeignAbstractClass = exports.ExtendsLoadableForeignAbstractClass = exports.ImplementsExtendsNotLoadableForeignInterface = exports.ImplementsExtendsLoadableForeignInterface = exports.ImplementsNotLoadableForeignAbstractClass = exports.ImplementsLoadableForeignAbstractClass = exports.ImplementsNotLoadableForeignInterface = exports.ImplementsLoadableForeignInterface = exports.implementsExtendsNotLoadableForeignType = exports.implementsExtendsLoadableForeignType = exports.implementsNotLoadableForeignType = exports.implementsLoadableForeignType = void 0;
|
|
19
19
|
var reflection_build_test_b_1 = require("@proteinjs/reflection-build-test-b");
|
|
20
20
|
// variable <- type alias
|
|
21
21
|
exports.implementsLoadableForeignType = { z: 1 };
|
|
@@ -66,14 +66,14 @@ var ImplementsExtendsLoadableForeignInterface = /** @class */ (function () {
|
|
|
66
66
|
return ImplementsExtendsLoadableForeignInterface;
|
|
67
67
|
}());
|
|
68
68
|
exports.ImplementsExtendsLoadableForeignInterface = ImplementsExtendsLoadableForeignInterface;
|
|
69
|
-
var
|
|
70
|
-
function
|
|
69
|
+
var ImplementsExtendsNotLoadableForeignInterface = /** @class */ (function () {
|
|
70
|
+
function ImplementsExtendsNotLoadableForeignInterface() {
|
|
71
71
|
this.z = 1;
|
|
72
72
|
this.b = 2;
|
|
73
73
|
}
|
|
74
|
-
return
|
|
74
|
+
return ImplementsExtendsNotLoadableForeignInterface;
|
|
75
75
|
}());
|
|
76
|
-
exports.
|
|
76
|
+
exports.ImplementsExtendsNotLoadableForeignInterface = ImplementsExtendsNotLoadableForeignInterface;
|
|
77
77
|
// class <- abstract class <- abstract class
|
|
78
78
|
var ExtendsLoadableForeignAbstractClass = /** @class */ (function (_super) {
|
|
79
79
|
__extends(ExtendsLoadableForeignAbstractClass, _super);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExtendsForeignType.js","sourceRoot":"","sources":["../../../../../../test/examples/source-repository/a/src/ExtendsForeignType.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,8EAO4C;AAE5C,yBAAyB;AAEZ,QAAA,6BAA6B,GAAwB,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AAE9D,QAAA,gCAAgC,GAA2B,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AAMpE,QAAA,oCAAoC,GAA+B,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC;AAIrF,QAAA,uCAAuC,GAAkC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC;AAExG,qBAAqB;AAErB;IAAA;QACE,MAAC,GAAG,CAAC,CAAC;IACR,CAAC;IAAD,yCAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gFAAkC;AAI/C;IAAA;QACE,MAAC,GAAG,CAAC,CAAC;IACR,CAAC;IAAD,4CAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sFAAqC;AAIlD,0BAA0B;AAE1B;IAA4D,0DAA4B;IAAxF;QAAA,qEAEC;QADC,OAAC,GAAG,CAAC,CAAC;;IACR,CAAC;IAAD,6CAAC;AAAD,CAAC,AAFD,CAA4D,sDAA4B,GAEvF;AAFY,wFAAsC;AAInD;IAA+D,6DAA+B;IAA9F;QAAA,qEAEC;QADC,OAAC,GAAG,CAAC,CAAC;;IACR,CAAC;IAAD,gDAAC;AAAD,CAAC,AAFD,CAA+D,yDAA+B,GAE7F;AAFY,8FAAyC;AAStD;IAAA;QACE,MAAC,GAAG,CAAC,CAAC;QACN,MAAC,GAAG,CAAC,CAAC;IACR,CAAC;IAAD,gDAAC;AAAD,CAAC,AAHD,IAGC;AAHY,8FAAyC;AAStD;IAAA;QACE,MAAC,GAAG,CAAC,CAAC;QACN,MAAC,GAAG,CAAC,CAAC;IACR,CAAC;IAAD,
|
|
1
|
+
{"version":3,"file":"ExtendsForeignType.js","sourceRoot":"","sources":["../../../../../../test/examples/source-repository/a/src/ExtendsForeignType.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,8EAO4C;AAE5C,yBAAyB;AAEZ,QAAA,6BAA6B,GAAwB,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AAE9D,QAAA,gCAAgC,GAA2B,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AAMpE,QAAA,oCAAoC,GAA+B,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC;AAIrF,QAAA,uCAAuC,GAAkC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC;AAExG,qBAAqB;AAErB;IAAA;QACE,MAAC,GAAG,CAAC,CAAC;IACR,CAAC;IAAD,yCAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gFAAkC;AAI/C;IAAA;QACE,MAAC,GAAG,CAAC,CAAC;IACR,CAAC;IAAD,4CAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sFAAqC;AAIlD,0BAA0B;AAE1B;IAA4D,0DAA4B;IAAxF;QAAA,qEAEC;QADC,OAAC,GAAG,CAAC,CAAC;;IACR,CAAC;IAAD,6CAAC;AAAD,CAAC,AAFD,CAA4D,sDAA4B,GAEvF;AAFY,wFAAsC;AAInD;IAA+D,6DAA+B;IAA9F;QAAA,qEAEC;QADC,OAAC,GAAG,CAAC,CAAC;;IACR,CAAC;IAAD,gDAAC;AAAD,CAAC,AAFD,CAA+D,yDAA+B,GAE7F;AAFY,8FAAyC;AAStD;IAAA;QACE,MAAC,GAAG,CAAC,CAAC;QACN,MAAC,GAAG,CAAC,CAAC;IACR,CAAC;IAAD,gDAAC;AAAD,CAAC,AAHD,IAGC;AAHY,8FAAyC;AAStD;IAAA;QACE,MAAC,GAAG,CAAC,CAAC;QACN,MAAC,GAAG,CAAC,CAAC;IACR,CAAC;IAAD,mDAAC;AAAD,CAAC,AAHD,IAGC;AAHY,oGAA4C;AAKzD,4CAA4C;AAC5C;IAAkE,uDAA4B;IAA9F;;IAEA,CAAC;IAAD,0CAAC;AAAD,CAAC,AAFD,CAAkE,sDAA4B,GAE7F;AAFqB,kFAAmC;AAIzD;IAAmE,iEAAmC;IAAtG;QAAA,qEAGC;QAFC,OAAC,GAAG,CAAC,CAAC;QACN,OAAC,GAAG,CAAC,CAAC;;IACR,CAAC;IAAD,oDAAC;AAAD,CAAC,AAHD,CAAmE,mCAAmC,GAGrG;AAHY,sGAA6C;AAK1D;IAAqE,0DAA+B;IAApG;;IAEA,CAAC;IAAD,6CAAC;AAAD,CAAC,AAFD,CAAqE,yDAA+B,GAEnG;AAFqB,wFAAsC;AAI5D;IAAsE,oEAAsC;IAA5G;QAAA,qEAGC;QAFC,OAAC,GAAG,CAAC,CAAC;QACN,OAAC,GAAG,CAAC,CAAC;;IACR,CAAC;IAAD,uDAAC;AAAD,CAAC,AAHD,CAAsE,sCAAsC,GAG3G;AAHY,4GAAgD"}
|
|
@@ -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":["../../../../../../test/examples/source-repository/b/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":["../../../../../../test/examples/source-repository/b/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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@proteinjs/reflection-build",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Build system for reflection",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@dagrejs/graphlib": "2.1.4",
|
|
33
|
-
"@proteinjs/reflection": "^1.2.
|
|
34
|
-
"@proteinjs/util": "^1.6.
|
|
35
|
-
"@proteinjs/util-node": "^1.
|
|
33
|
+
"@proteinjs/reflection": "^1.2.1",
|
|
34
|
+
"@proteinjs/util": "^1.6.2",
|
|
35
|
+
"@proteinjs/util-node": "^1.11.0",
|
|
36
36
|
"globby": "11.0.1",
|
|
37
37
|
"gulp": "4.0.2",
|
|
38
38
|
"gulp-shell": "0.8.0",
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"ts-jest": "29.1.1",
|
|
57
57
|
"typescript": "5.2.2"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "dba60a9a16985d76264f9f9e29ccdbcc669543f3"
|
|
60
60
|
}
|
package/src/ReflectionDoctor.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import * as fs from 'fs';
|
|
2
2
|
import * as path from 'path';
|
|
3
|
-
import globby from 'globby';
|
|
4
3
|
import { TypescriptParser } from '../modules/typescript-parser';
|
|
4
|
+
import { Graph } from '@dagrejs/graphlib';
|
|
5
5
|
import { createEmittedSourceGraph, findDependencyDir, findDependencySourceGraph } from './codegen/writeGeneratedIndex';
|
|
6
|
+
import { PackageSourceFiles } from './parser/PackageSourceFiles';
|
|
7
|
+
import { SharedQualifiedName } from './parser/SharedQualifiedNames';
|
|
6
8
|
|
|
7
9
|
const LOADABLE_QUALIFIED_NAME = '@proteinjs/reflection/Loadable';
|
|
8
10
|
const SOURCE_REPOSITORY_FILTER_QUALIFIED_NAME = '@proteinjs/reflection/SourceRepositoryFilter';
|
|
@@ -27,6 +29,8 @@ export interface DoctorReport {
|
|
|
27
29
|
/** declarations in the built artifact no longer in sources (stale dist) */
|
|
28
30
|
onlyInDist: string[];
|
|
29
31
|
};
|
|
32
|
+
/** names in current sources that two or more files declare and that reach the graph (reflection-build refuses these sources) */
|
|
33
|
+
sharedNames: SharedQualifiedName[];
|
|
30
34
|
orphans: Orphan[];
|
|
31
35
|
}
|
|
32
36
|
|
|
@@ -61,7 +65,9 @@ interface Universe {
|
|
|
61
65
|
* the runtime would merge).
|
|
62
66
|
*
|
|
63
67
|
* - `diagnose()` prints the registered inventory (deps with graphs / without / skip-listed),
|
|
64
|
-
* this package's node+edge+sourceLink counts, emitted-vs-source drift (stale dist),
|
|
68
|
+
* this package's node+edge+sourceLink counts, emitted-vs-source drift (stale dist), SHARED
|
|
69
|
+
* NAMES: names in current sources that two files declare and that reach the graph (the build
|
|
70
|
+
* refuses these sources; an artifact built before the refusal kept one file's declaration), and
|
|
65
71
|
* ORPHANS: nodes the build kept because a parent is foreign, whose parent's package
|
|
66
72
|
* resolves to no loadable graph — the undeclared-dep / typo footgun that the runtime
|
|
67
73
|
* silently prunes today.
|
|
@@ -83,11 +89,16 @@ export class ReflectionDoctor {
|
|
|
83
89
|
const universe = this.harvestUniverse(packageJson);
|
|
84
90
|
const own = universe.graphs[packageJson.name];
|
|
85
91
|
const dependencies = this.dependencyInventory(packageJson);
|
|
86
|
-
const
|
|
92
|
+
const fresh = await createEmittedSourceGraph(this.packageDir, ['src']);
|
|
93
|
+
const drift = this.computeDrift(fresh.graph, own.graph);
|
|
87
94
|
const orphans = this.findOrphans(packageJson, universe);
|
|
88
95
|
const sourceLinkCount = this.parseSourceLinkKeys(fs.readFileSync(own.artifactPath, 'utf-8')).length;
|
|
89
96
|
|
|
90
|
-
const healthy =
|
|
97
|
+
const healthy =
|
|
98
|
+
orphans.length === 0 &&
|
|
99
|
+
drift.missingFromDist.length === 0 &&
|
|
100
|
+
drift.onlyInDist.length === 0 &&
|
|
101
|
+
fresh.sharedNames.length === 0;
|
|
91
102
|
const report: DoctorReport = {
|
|
92
103
|
text: '',
|
|
93
104
|
healthy,
|
|
@@ -96,6 +107,7 @@ export class ReflectionDoctor {
|
|
|
96
107
|
edgeCount: own.graph.edges.length,
|
|
97
108
|
sourceLinkCount,
|
|
98
109
|
drift,
|
|
110
|
+
sharedNames: fresh.sharedNames,
|
|
99
111
|
orphans,
|
|
100
112
|
};
|
|
101
113
|
report.text = this.formatReport(packageJson.name, own.artifactPath, report);
|
|
@@ -288,11 +300,10 @@ export class ReflectionDoctor {
|
|
|
288
300
|
}
|
|
289
301
|
|
|
290
302
|
/** Emitted-vs-source drift: rebuild-needed detection for the prod graph. */
|
|
291
|
-
private
|
|
292
|
-
|
|
303
|
+
private computeDrift(
|
|
304
|
+
freshGraph: Graph,
|
|
293
305
|
emittedGraph: GraphJson
|
|
294
|
-
):
|
|
295
|
-
const freshGraph = await createEmittedSourceGraph(this.packageDir, ['src']);
|
|
306
|
+
): { missingFromDist: string[]; onlyInDist: string[] } {
|
|
296
307
|
const freshValued: { [qualifiedName: string]: boolean } = {};
|
|
297
308
|
for (const nodeName of freshGraph.nodes()) {
|
|
298
309
|
if (freshGraph.node(nodeName)) {
|
|
@@ -430,7 +441,7 @@ export class ReflectionDoctor {
|
|
|
430
441
|
? nameOrQualifiedName.substring(nameOrQualifiedName.lastIndexOf('/') + 1)
|
|
431
442
|
: nameOrQualifiedName;
|
|
432
443
|
|
|
433
|
-
const freshGraph = await createEmittedSourceGraph(this.packageDir, ['src']);
|
|
444
|
+
const { graph: freshGraph } = await createEmittedSourceGraph(this.packageDir, ['src']);
|
|
434
445
|
const freshMatch = freshGraph
|
|
435
446
|
.nodes()
|
|
436
447
|
.find((qualifiedName: string) => freshGraph.node(qualifiedName) && qualifiedName.endsWith(`/${name}`));
|
|
@@ -457,20 +468,14 @@ export class ReflectionDoctor {
|
|
|
457
468
|
|
|
458
469
|
/** Raw parser pass over src — sees non-exported declarations the graph never contains. */
|
|
459
470
|
private async findDeclarationInSources(name: string): Promise<{ filePath: string; isExported: boolean } | undefined> {
|
|
460
|
-
const
|
|
461
|
-
path.join(this.packageDir, 'src', '**/*.ts'),
|
|
462
|
-
path.join(this.packageDir, 'src', '**/*.tsx'),
|
|
463
|
-
'!**/node_modules/**',
|
|
464
|
-
'!**/generated/**',
|
|
465
|
-
];
|
|
466
|
-
const sourceFilePaths: string[] = await globby(patterns);
|
|
471
|
+
const sourceFilePaths = await new PackageSourceFiles(this.packageDir, ['src']).list();
|
|
467
472
|
const parser = new TypescriptParser();
|
|
468
473
|
for (const sourceFilePath of sourceFilePaths) {
|
|
469
474
|
const parsedFile = await parser.parseFile(sourceFilePath, path.dirname(sourceFilePath));
|
|
470
475
|
for (const declaration of parsedFile.declarations) {
|
|
471
476
|
if (declaration.name === name) {
|
|
472
477
|
return {
|
|
473
|
-
filePath:
|
|
478
|
+
filePath: PackageSourceFiles.relativePath(this.packageDir, sourceFilePath),
|
|
474
479
|
isExported: !!(declaration as any).isExported,
|
|
475
480
|
};
|
|
476
481
|
}
|
|
@@ -556,6 +561,21 @@ export class ReflectionDoctor {
|
|
|
556
561
|
}
|
|
557
562
|
}
|
|
558
563
|
|
|
564
|
+
if (report.sharedNames.length === 0) {
|
|
565
|
+
lines.push(`Shared names: none — each name in the graph has one declaring file`);
|
|
566
|
+
} else {
|
|
567
|
+
lines.push(
|
|
568
|
+
`Shared names: reflection-build refuses these sources — each name below reaches the graph from more than ` +
|
|
569
|
+
`one file, and the graph keeps one declaration per name; give each declaration its own name`
|
|
570
|
+
);
|
|
571
|
+
for (const { qualifiedName, filePaths } of report.sharedNames) {
|
|
572
|
+
lines.push(` ${qualifiedName}`);
|
|
573
|
+
for (const filePath of filePaths) {
|
|
574
|
+
lines.push(` declared in ${filePath}`);
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
|
|
559
579
|
lines.push('');
|
|
560
580
|
if (report.orphans.length === 0) {
|
|
561
581
|
lines.push(`Orphans: none — every foreign parent resolves in a loaded graph`);
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Edge, Graph } from '@dagrejs/graphlib';
|
|
2
|
+
import { PackageSourceFiles } from '../parser/PackageSourceFiles';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The emitted form of a source graph: the same nodes, values and edges, in an order that is a
|
|
6
|
+
* function of the graph's content alone — never of the order the builder happened to visit the
|
|
7
|
+
* sources or insert placeholder parents. The generated index serializes nodes and edges in
|
|
8
|
+
* insertion order, so this order is the artifact's byte order (and the runtime's `objects()`
|
|
9
|
+
* order within one package).
|
|
10
|
+
*
|
|
11
|
+
* - Nodes by the declaring file's package-relative path, then by qualified name. A placeholder
|
|
12
|
+
* (a parent referenced here but declared elsewhere) has no file and sorts by name ahead of
|
|
13
|
+
* the declared nodes.
|
|
14
|
+
* - Edges by child, then parent (a source graph is never a multigraph: one edge per pair).
|
|
15
|
+
*
|
|
16
|
+
* Both keys are package-relative strings compared by code unit, so they are the same on every
|
|
17
|
+
* machine and in every checkout location.
|
|
18
|
+
*/
|
|
19
|
+
export class CanonicalSourceGraph {
|
|
20
|
+
/** A copy of `graph` whose node and edge order is canonical. */
|
|
21
|
+
static of(graph: Graph): Graph {
|
|
22
|
+
const canonical = new Graph({
|
|
23
|
+
directed: graph.isDirected(),
|
|
24
|
+
multigraph: graph.isMultigraph(),
|
|
25
|
+
compound: graph.isCompound(),
|
|
26
|
+
});
|
|
27
|
+
for (const nodeName of CanonicalSourceGraph.nodeOrder(graph)) {
|
|
28
|
+
canonical.setNode(nodeName, graph.node(nodeName));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
for (const edge of CanonicalSourceGraph.edgeOrder(graph)) {
|
|
32
|
+
canonical.setEdge(edge, graph.edge(edge));
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return canonical;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
private static nodeOrder(graph: Graph): string[] {
|
|
39
|
+
const fileOf = (nodeName: string): string => graph.node(nodeName)?.filePath || '';
|
|
40
|
+
return [...graph.nodes()].sort(
|
|
41
|
+
(a, b) => PackageSourceFiles.compare(fileOf(a), fileOf(b)) || PackageSourceFiles.compare(a, b)
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
private static edgeOrder(graph: Graph): Edge[] {
|
|
46
|
+
return [...graph.edges()].sort(
|
|
47
|
+
(a, b) => PackageSourceFiles.compare(a.v, b.v) || PackageSourceFiles.compare(a.w, b.w)
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -5,6 +5,9 @@ import { graphSerializer, isInstanceOf } from '@proteinjs/util';
|
|
|
5
5
|
import { Graph } from '@dagrejs/graphlib';
|
|
6
6
|
import jsesc from 'jsesc';
|
|
7
7
|
import { createSourceGraph } from '../parser/createSourceGraph';
|
|
8
|
+
import { PackageSourceFiles } from '../parser/PackageSourceFiles';
|
|
9
|
+
import { SharedQualifiedName, SharedQualifiedNames } from '../parser/SharedQualifiedNames';
|
|
10
|
+
import { CanonicalSourceGraph } from './CanonicalSourceGraph';
|
|
8
11
|
import { VariableDeclaration, PackageScope, ClassDeclaration, LOADABLE_QUALIFIED_NAME } from '@proteinjs/reflection';
|
|
9
12
|
|
|
10
13
|
/**
|
|
@@ -59,8 +62,11 @@ export async function writeGeneratedIndex(
|
|
|
59
62
|
// - If override provided, re-export from that (path relative to generated dir, without extension)
|
|
60
63
|
// - Else fallback to the current default: '<packageRoot>/index'
|
|
61
64
|
const exportTargetNoExt = publicEntryRelOverride
|
|
62
|
-
?
|
|
63
|
-
|
|
65
|
+
? PackageSourceFiles.relativePath(packageGeneratedDir, path.join(packageDir, publicEntryRelOverride)).replace(
|
|
66
|
+
/\.[^/.]+$/,
|
|
67
|
+
''
|
|
68
|
+
)
|
|
69
|
+
: `${PackageSourceFiles.relativePath(packageGeneratedDir, packageDir)}/index`;
|
|
64
70
|
|
|
65
71
|
generatedIndex += `\n\n\nexport * from '${exportTargetNoExt}';`;
|
|
66
72
|
|
|
@@ -77,7 +83,8 @@ async function sourceRepositoryLoader(
|
|
|
77
83
|
|
|
78
84
|
// Allow multiple roots (e.g., ['test','src']) to keep ancestry intact.
|
|
79
85
|
const roots = Array.isArray(sourceRootsRel) ? sourceRootsRel : [sourceRootsRel];
|
|
80
|
-
const
|
|
86
|
+
const { graph: sourceGraph, sharedNames } = await createEmittedSourceGraph(packageDir, roots);
|
|
87
|
+
SharedQualifiedNames.refuse(packageJson.name, sharedNames);
|
|
81
88
|
|
|
82
89
|
code += generateSourceGraph(sourceGraph);
|
|
83
90
|
code += generateSourceLinks(sourceGraph, packageJson, packageDir, generatedIndexPath);
|
|
@@ -230,16 +237,32 @@ function getDependencyImportSpecifier(packageDir: string, packageName: string):
|
|
|
230
237
|
}
|
|
231
238
|
}
|
|
232
239
|
|
|
240
|
+
export interface EmittedSourceGraph {
|
|
241
|
+
/** The pruned graph in canonical order: what the generated index serializes. */
|
|
242
|
+
graph: Graph;
|
|
243
|
+
/** The names in `graph` that two or more source files declare; the build refuses to emit while there is one. */
|
|
244
|
+
sharedNames: SharedQualifiedName[];
|
|
245
|
+
}
|
|
246
|
+
|
|
233
247
|
/**
|
|
234
248
|
* The graph exactly as a build emits it: parsed from the package's source roots, with
|
|
235
|
-
* build-time-non-loadable declarations pruned
|
|
236
|
-
*
|
|
249
|
+
* build-time-non-loadable declarations pruned, in canonical order (the serialized graph and
|
|
250
|
+
* the source links follow it, so the same sources emit the same bytes on every machine), and
|
|
251
|
+
* the names in it that more than one file declares. Owned here so build emit and diagnostic
|
|
252
|
+
* tooling (reflection-doctor drift and shared-name checks) share one pipeline.
|
|
237
253
|
*/
|
|
238
|
-
export async function createEmittedSourceGraph(
|
|
254
|
+
export async function createEmittedSourceGraph(
|
|
255
|
+
packageDir: string,
|
|
256
|
+
sourceRootsRel: string[]
|
|
257
|
+
): Promise<EmittedSourceGraph> {
|
|
239
258
|
const packageJson = await getPackageJson(packageDir);
|
|
240
|
-
const
|
|
259
|
+
const declarations = new SharedQualifiedNames();
|
|
260
|
+
const sourceGraph = await createSourceGraph(packageDir, [], sourceRootsRel, declarations);
|
|
241
261
|
removeNonLoadables(sourceGraph, packageJson.name);
|
|
242
|
-
|
|
262
|
+
// Shared names are read AFTER the prune, never before: a name whose declarations the prune
|
|
263
|
+
// drops never reaches the index, and two files exporting it is ordinary TypeScript.
|
|
264
|
+
const sharedNames = declarations.in(sourceGraph);
|
|
265
|
+
return { graph: CanonicalSourceGraph.of(sourceGraph), sharedNames };
|
|
243
266
|
}
|
|
244
267
|
|
|
245
268
|
function generateSourceGraph(sourceGraph: Graph): string {
|
|
@@ -347,7 +370,10 @@ function generateSourceLinks(
|
|
|
347
370
|
|
|
348
371
|
// node.filePath is package-relative (never serialized absolute); resolve against the
|
|
349
372
|
// package dir to compute the real import location for the generated index.
|
|
350
|
-
const relativeImportPath =
|
|
373
|
+
const relativeImportPath = PackageSourceFiles.relativePath(
|
|
374
|
+
path.dirname(generatedIndexPath),
|
|
375
|
+
path.join(packageDir, node.filePath)
|
|
376
|
+
);
|
|
351
377
|
code += `import { ${node.name} } from '${relativeImportPath.replace(/\.[^/.]+$/, '')}';\n`;
|
|
352
378
|
linkableNodes.push(node);
|
|
353
379
|
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import * as path from 'path';
|
|
2
|
+
import globby from 'globby';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The TypeScript sources of a package, in one reproducible order.
|
|
6
|
+
*
|
|
7
|
+
* Every build of the same sources must write the same bytes, whatever machine or directory it
|
|
8
|
+
* runs in. Two machine-specific inputs are closed here, where they enter:
|
|
9
|
+
*
|
|
10
|
+
* - ORDER. The glob returns files in the order its concurrent directory reads complete, which
|
|
11
|
+
* varies with the filesystem and from run to run. The parse order decides the graph's
|
|
12
|
+
* insertion order, which declaration a name exported by two files holds (the last one parsed;
|
|
13
|
+
* the build refuses such a name when it survives the prune — `SharedQualifiedNames`), and the
|
|
14
|
+
* order that refusal lists the files in. `list()` therefore orders the files by their
|
|
15
|
+
* package-relative path, compared by code unit — never by `localeCompare`, whose collation
|
|
16
|
+
* depends on the machine's locale data.
|
|
17
|
+
* - LOCATION. `relativePath()` is the only form a source path takes in a generated artifact:
|
|
18
|
+
* relative, with `/` separators on every platform, no leading `./`.
|
|
19
|
+
*/
|
|
20
|
+
export class PackageSourceFiles {
|
|
21
|
+
constructor(
|
|
22
|
+
private readonly packageDir: string,
|
|
23
|
+
private readonly sourceRootsRel: string[],
|
|
24
|
+
private readonly excludedDirs: string[] = []
|
|
25
|
+
) {}
|
|
26
|
+
|
|
27
|
+
/** Absolute paths of the package's `.ts`/`.tsx` sources under the source roots, in package-relative path order. */
|
|
28
|
+
async list(): Promise<string[]> {
|
|
29
|
+
const sourceFilePaths: string[] = await globby([...this.includePatterns(), ...this.excludePatterns()]);
|
|
30
|
+
return Array.from(new Set(sourceFilePaths))
|
|
31
|
+
.map((absolutePath) => ({
|
|
32
|
+
absolutePath,
|
|
33
|
+
relativePath: PackageSourceFiles.relativePath(this.packageDir, absolutePath),
|
|
34
|
+
}))
|
|
35
|
+
.sort((a, b) => PackageSourceFiles.compare(a.relativePath, b.relativePath))
|
|
36
|
+
.map(({ absolutePath }) => absolutePath);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** `filePath` relative to `fromDir`, with `/` separators on every platform and no leading `./`. */
|
|
40
|
+
static relativePath(fromDir: string, filePath: string): string {
|
|
41
|
+
return path.relative(fromDir, filePath).split(path.sep).join('/');
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** Code-unit order: the same on every machine, unlike `localeCompare`. */
|
|
45
|
+
static compare(a: string, b: string): number {
|
|
46
|
+
if (a < b) {
|
|
47
|
+
return -1;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return a > b ? 1 : 0;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
private includePatterns(): string[] {
|
|
54
|
+
const patterns: string[] = [];
|
|
55
|
+
for (const rel of this.sourceRootsRel) {
|
|
56
|
+
const root = path.join(this.packageDir, rel);
|
|
57
|
+
patterns.push(path.join(root, '**/*.ts'));
|
|
58
|
+
patterns.push(path.join(root, '**/*.tsx'));
|
|
59
|
+
}
|
|
60
|
+
return patterns;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
private excludePatterns(): string[] {
|
|
64
|
+
return ['!**/node_modules/**', '!**/generated/**', ...this.excludedDirs.map((dir) => `!${dir}`)];
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { Graph } from '@dagrejs/graphlib';
|
|
2
|
+
|
|
3
|
+
/** A qualified name that two or more source files declare. */
|
|
4
|
+
export interface SharedQualifiedName {
|
|
5
|
+
qualifiedName: string;
|
|
6
|
+
/** Every file that declares it: package-relative, `/`-separated, in the order the sources parse. */
|
|
7
|
+
filePaths: string[];
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* One qualified name, one declaring file, for every name that reaches the generated index.
|
|
12
|
+
*
|
|
13
|
+
* The source graph holds ONE node per qualified name. When two files export the same name, the
|
|
14
|
+
* declaration parsed last takes the node (its value, its `filePath`, and so the class or value
|
|
15
|
+
* the source link hands `objects()`), while the parent edges of both stay on it. The other
|
|
16
|
+
* declaration leaves no trace, so the emitted graph cannot show the collision. This class records
|
|
17
|
+
* every file that declares each name while the graph is built, and names the collisions that are
|
|
18
|
+
* left in a graph.
|
|
19
|
+
*
|
|
20
|
+
* The rule applies to the graph AFTER `removeNonLoadables`, never before. Types, consts and
|
|
21
|
+
* functions exported under one name by two files are ordinary TypeScript: while none of them is
|
|
22
|
+
* Loadable, the prune drops the name and it never reaches the index. A name that survives the
|
|
23
|
+
* prune is an authoring error the graph cannot represent, and the build refuses it rather than
|
|
24
|
+
* ship the last file's declaration.
|
|
25
|
+
*
|
|
26
|
+
* Order: files are kept in the order they are recorded, which is the parse order —
|
|
27
|
+
* `PackageSourceFiles.list()` order, package-relative path by code unit — and names in the order
|
|
28
|
+
* their first declaration was recorded. Both are the same on every machine.
|
|
29
|
+
*/
|
|
30
|
+
export class SharedQualifiedNames {
|
|
31
|
+
private readonly filePathsByName = new Map<string, string[]>();
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The build's refusal: one error naming the package and, for each shared name, every file that
|
|
35
|
+
* declares it. Returns without effect when `sharedNames` is empty.
|
|
36
|
+
*/
|
|
37
|
+
static refuse(packageName: string, sharedNames: SharedQualifiedName[]): void {
|
|
38
|
+
if (sharedNames.length === 0) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
throw new Error(
|
|
43
|
+
[
|
|
44
|
+
`reflection-build refused ${packageName}: a name that reaches the generated index is declared in more than one file.`,
|
|
45
|
+
'The index holds one declaration per qualified name, so the file parsed last would replace the others without a trace.',
|
|
46
|
+
'Give each declaration its own name (no index was written):',
|
|
47
|
+
...sharedNames.map(({ qualifiedName, filePaths }) => ` ${qualifiedName}: ${filePaths.join(', ')}`),
|
|
48
|
+
].join('\n')
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** The names left in `prunedGraph` that two or more files declare. */
|
|
53
|
+
in(prunedGraph: Graph): SharedQualifiedName[] {
|
|
54
|
+
const shared: SharedQualifiedName[] = [];
|
|
55
|
+
this.filePathsByName.forEach((filePaths, qualifiedName) => {
|
|
56
|
+
if (filePaths.length > 1 && prunedGraph.hasNode(qualifiedName)) {
|
|
57
|
+
shared.push({ qualifiedName, filePaths: [...filePaths] });
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
return shared;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Records that the package-relative `filePath` declares `qualifiedName`. The graph builder calls
|
|
65
|
+
* this for every declaration it sets on the graph; a file that declares a name twice (a const
|
|
66
|
+
* and a type of one name, say) counts once.
|
|
67
|
+
*/
|
|
68
|
+
record(qualifiedName: string, filePath: string): void {
|
|
69
|
+
const filePaths = this.filePathsByName.get(qualifiedName);
|
|
70
|
+
if (!filePaths) {
|
|
71
|
+
this.filePathsByName.set(qualifiedName, [filePath]);
|
|
72
|
+
} else if (!filePaths.includes(filePath)) {
|
|
73
|
+
filePaths.push(filePath);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|