@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,91 @@
|
|
|
1
|
+
/** A declared-workspace rule was broken. The message names every path involved. */
|
|
2
|
+
export declare class WorkspaceDeclarationError extends Error {
|
|
3
|
+
constructor(message: string);
|
|
4
|
+
}
|
|
5
|
+
export type DiscoveredPackage = {
|
|
6
|
+
/** Absolute package.json path — the package's identity. */
|
|
7
|
+
filePath: string;
|
|
8
|
+
packageJson: any;
|
|
9
|
+
/** `declared`: named by a workspace declaration; `crawled`: found by the bounded walk of an undeclared tree. */
|
|
10
|
+
origin: 'declared' | 'crawled';
|
|
11
|
+
/** The declaration file (lerna.json or the root package.json) that named a `declared` package. */
|
|
12
|
+
declaredBy?: string;
|
|
13
|
+
};
|
|
14
|
+
type Declaration = {
|
|
15
|
+
rootDir: string;
|
|
16
|
+
/** Each pattern with the file that declared it, in declaration order. */
|
|
17
|
+
patterns: Array<{
|
|
18
|
+
pattern: string;
|
|
19
|
+
source: string;
|
|
20
|
+
}>;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* The ONE owner of workspace membership: which package.json files belong to the workspace rooted
|
|
24
|
+
* at a directory.
|
|
25
|
+
*
|
|
26
|
+
* Membership is DECLARED, never crawled. A directory holding a `lerna.json` (its `packages`
|
|
27
|
+
* globs; lerna's own default `packages/*` when the field is absent) or a root `package.json`
|
|
28
|
+
* carrying `workspacePackages` (extra roots the workspace tooling builds alongside lerna's
|
|
29
|
+
* members — e.g. an app's `ops/*` tools that lerna must not version) is a workspace ROOT. Its
|
|
30
|
+
* members are exactly what it declares, and it OWNS its subtree: nothing undeclared beneath it is
|
|
31
|
+
* a member, however the tree is walked from above. A member that is itself a root expands through
|
|
32
|
+
* its own declaration (the metarepo's nested lerna roots).
|
|
33
|
+
*
|
|
34
|
+
* Why: the previous crawl (every package.json under the root, keyed by name, last path wins)
|
|
35
|
+
* let a CI fixture tree whose package.json files reused the app's own package names shadow the
|
|
36
|
+
* real packages — build-workspace built "1 package in workspace" and the release image shipped
|
|
37
|
+
* with no server dist (n3xah/app Deploy to Test run 33747781291, 2026-09-03). A declaration
|
|
38
|
+
* cannot be shadowed by a file nobody declared.
|
|
39
|
+
*
|
|
40
|
+
* A tree with no declaration at its root (the n3xa metarepo root) still crawls — bounded exactly
|
|
41
|
+
* as before: never into hidden directories, `node_modules`, `dist`, or through symlinks — and
|
|
42
|
+
* hands every declared root it meets to that root's declaration.
|
|
43
|
+
*
|
|
44
|
+
* Hard errors, each naming its paths: a declared literal path with no package.json; two leaf
|
|
45
|
+
* packages sharing a name (dependencies resolve to members BY NAME). Containers — a package.json
|
|
46
|
+
* with members beneath it; every root in the metarepo is named `root` — are identified by path
|
|
47
|
+
* and exempt from the name rule.
|
|
48
|
+
*
|
|
49
|
+
* npm's own `workspaces` field is deliberately NOT read: it changes how `npm i` installs at the
|
|
50
|
+
* root, which is a different install model from the per-package installs this tooling performs.
|
|
51
|
+
*/
|
|
52
|
+
export declare class WorkspaceDeclaration {
|
|
53
|
+
/** Root package.json field naming extra member globs beside lerna's `packages`. */
|
|
54
|
+
static readonly EXTRA_PACKAGES_FIELD = "workspacePackages";
|
|
55
|
+
private static readonly lernaDefaultPackages;
|
|
56
|
+
private static readonly prunedDirNames;
|
|
57
|
+
/** Every member package.json of the workspace rooted at `rootDir`, sorted by path. */
|
|
58
|
+
static discover(rootDir: string): Promise<DiscoveredPackage[]>;
|
|
59
|
+
/** The declaration at `dir` when `dir` is a workspace root; undefined otherwise. */
|
|
60
|
+
static read(dir: string): Promise<Declaration | undefined>;
|
|
61
|
+
/** A declared root: its own package.json (the container), then exactly its declared members. */
|
|
62
|
+
private static discoverDeclared;
|
|
63
|
+
/**
|
|
64
|
+
* The bounded walk of an UNDECLARED tree (the metarepo root): every package.json it meets is a
|
|
65
|
+
* member, and every declared root it meets is handed to that root's declaration instead of
|
|
66
|
+
* being walked. Never enters hidden directories, node_modules, or dist; never follows symlinks
|
|
67
|
+
* (`withFileTypes` reports a symlink as neither directory nor file).
|
|
68
|
+
*/
|
|
69
|
+
private static crawl;
|
|
70
|
+
/**
|
|
71
|
+
* The directories a declared pattern names under `rootDir`, lerna's semantics: a literal path
|
|
72
|
+
* MUST hold a package.json (hard error otherwise — a declared package that does not exist is
|
|
73
|
+
* a broken declaration, never a silent skip); a glob (`*` within a segment, `**` for any depth)
|
|
74
|
+
* matches directories that hold one, walking with the same prune rules as the crawl. A declared
|
|
75
|
+
* root met inside a glob's walk is matched as a whole and not walked past — it owns its subtree.
|
|
76
|
+
*/
|
|
77
|
+
private static expand;
|
|
78
|
+
private static matchSegments;
|
|
79
|
+
/** Leaf packages resolve by name; two leaves with one name is a broken workspace, not a tie to break. */
|
|
80
|
+
private static assertNoLeafNameCollisions;
|
|
81
|
+
private static add;
|
|
82
|
+
private static assertPattern;
|
|
83
|
+
private static segmentMatcher;
|
|
84
|
+
private static isPrunedDirName;
|
|
85
|
+
/** Real (non-symlink, non-pruned) child directories of `dir`. */
|
|
86
|
+
private static childDirs;
|
|
87
|
+
private static isRealDir;
|
|
88
|
+
private static exists;
|
|
89
|
+
private static readJsonIfExists;
|
|
90
|
+
}
|
|
91
|
+
export {};
|