@smoothbricks/nx-plugin 0.7.16 → 0.7.18
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/README.md +210 -64
- package/dist/.build-inputs.json +28 -23
- package/dist/bun-lock-scope.d.ts +128 -20
- package/dist/bun-lock-scope.d.ts.map +1 -1
- package/dist/bun-lock-scope.js +267 -44
- package/dist/cargo-closure-input.d.ts +8 -6
- package/dist/cargo-closure-input.d.ts.map +1 -1
- package/dist/cargo-closure-input.js +14 -11
- package/dist/cargo-source-hash.d.ts +23 -4
- package/dist/cargo-source-hash.d.ts.map +1 -1
- package/dist/cargo-source-hash.js +80 -14
- package/dist/cargo-workspace.d.ts +20 -2
- package/dist/cargo-workspace.d.ts.map +1 -1
- package/dist/cargo-workspace.js +42 -22
- package/dist/compile-environment.d.ts +8 -0
- package/dist/compile-environment.d.ts.map +1 -0
- package/dist/compile-environment.js +80 -0
- package/dist/dependency-manifests.d.ts +13 -0
- package/dist/dependency-manifests.d.ts.map +1 -0
- package/dist/dependency-manifests.js +20 -0
- package/dist/ensure-built-receipt.d.ts +3 -2
- package/dist/ensure-built-receipt.d.ts.map +1 -1
- package/dist/ensure-built-receipt.js +3 -2
- package/dist/eslint-config-closure.d.ts +8 -3
- package/dist/eslint-config-closure.d.ts.map +1 -1
- package/dist/eslint-config-closure.js +24 -5
- package/dist/executors/bounded-exec/bounds.d.ts +12 -1
- package/dist/executors/bounded-exec/bounds.d.ts.map +1 -1
- package/dist/executors/bounded-exec/bounds.js +8 -4
- package/dist/executors/bounded-exec/cpu-rise.d.ts +73 -0
- package/dist/executors/bounded-exec/cpu-rise.d.ts.map +1 -0
- package/dist/executors/bounded-exec/cpu-rise.js +111 -0
- package/dist/executors/bounded-exec/executor.d.ts +1 -1
- package/dist/executors/bounded-exec/executor.d.ts.map +1 -1
- package/dist/executors/bounded-exec/executor.js +54 -22
- package/dist/executors/bounded-exec/hang-diagnostics.d.ts +8 -0
- package/dist/executors/bounded-exec/hang-diagnostics.d.ts.map +1 -1
- package/dist/executors/bounded-exec/hang-diagnostics.js +66 -6
- package/dist/executors/bounded-exec/mbx-pool.d.ts +16 -2
- package/dist/executors/bounded-exec/mbx-pool.d.ts.map +1 -1
- package/dist/executors/bounded-exec/mbx-pool.js +18 -2
- package/dist/executors/bounded-exec/mbx-reservations.d.ts +5 -2
- package/dist/executors/bounded-exec/mbx-reservations.d.ts.map +1 -1
- package/dist/executors/bounded-exec/mbx-reservations.js +5 -3
- package/dist/executors/bounded-exec/progress-channel.d.ts +38 -0
- package/dist/executors/bounded-exec/progress-channel.d.ts.map +1 -0
- package/dist/executors/bounded-exec/progress-channel.js +113 -0
- package/dist/executors/bounded-exec/progress.d.ts +2 -1
- package/dist/executors/bounded-exec/progress.d.ts.map +1 -1
- package/dist/executors/bounded-exec/ram-temp.d.ts +24 -1
- package/dist/executors/bounded-exec/ram-temp.d.ts.map +1 -1
- package/dist/executors/bounded-exec/ram-temp.js +123 -16
- package/dist/executors/bounded-exec/schema.d.ts +5 -0
- package/dist/executors/bounded-exec/schema.d.ts.map +1 -1
- package/dist/executors/bounded-exec/schema.js +17 -1
- package/dist/executors/bounded-exec/verdict.d.ts +13 -6
- package/dist/executors/bounded-exec/verdict.d.ts.map +1 -1
- package/dist/executors/bounded-exec/verdict.js +34 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +216 -97
- package/dist/managed-files/files.d.ts +3 -3
- package/dist/managed-files/files.js +3 -3
- package/dist/managed-files/generator.d.ts +5 -1
- package/dist/managed-files/generator.d.ts.map +1 -1
- package/dist/managed-files/generator.js +22 -7
- package/dist/managed-files/render-memo.d.ts +13 -0
- package/dist/managed-files/render-memo.d.ts.map +1 -0
- package/dist/managed-files/render-memo.js +94 -0
- package/dist/test-program.d.ts +11 -6
- package/dist/test-program.d.ts.map +1 -1
- package/dist/test-program.js +39 -35
- package/dist/tool-bins.d.ts +12 -0
- package/dist/tool-bins.d.ts.map +1 -1
- package/dist/tool-bins.js +31 -6
- package/dist/typecheck-route.d.ts +3 -4
- package/dist/typecheck-route.d.ts.map +1 -1
- package/dist/typecheck-route.js +4 -15
- package/dist/typecheck-test-policy.d.ts +10 -1
- package/dist/typecheck-test-policy.d.ts.map +1 -1
- package/dist/typecheck-test-policy.js +40 -24
- package/dist/workspace-index.d.ts +14 -1
- package/dist/workspace-index.d.ts.map +1 -1
- package/dist/workspace-index.js +36 -4
- package/managed/raw/patches/nx@24.0.3.patch +703 -119
- package/managed/raw/patches/{ttsc@0.34.1.patch → ttsc@0.36.3.patch} +728 -71
- package/managed/raw/tooling/direnv/developer-links.ts +17 -3
- package/managed/raw/tooling/direnv/devenv.smoo.nix +1 -1
- package/managed/templates/github/actions/save-nix-devenv/action.yml +19 -1
- package/managed/templates/github/actions/setup-devenv/action.yml +2 -0
- package/package.json +5 -4
- package/src/bun-lock-scope.ts +293 -40
- package/src/cargo-closure-input.ts +19 -11
- package/src/cargo-source-hash.ts +103 -13
- package/src/cargo-workspace.ts +59 -20
- package/src/compile-environment.ts +35 -0
- package/src/dependency-manifests.ts +30 -0
- package/src/ensure-built-receipt.ts +3 -2
- package/src/eslint-config-closure.ts +27 -6
- package/src/executors/bounded-exec/bounds.ts +13 -4
- package/src/executors/bounded-exec/cpu-rise.ts +156 -0
- package/src/executors/bounded-exec/executor.ts +65 -21
- package/src/executors/bounded-exec/hang-diagnostics.ts +88 -6
- package/src/executors/bounded-exec/mbx-pool.ts +24 -3
- package/src/executors/bounded-exec/mbx-reservations.ts +7 -5
- package/src/executors/bounded-exec/progress-channel.ts +129 -0
- package/src/executors/bounded-exec/progress.ts +2 -1
- package/src/executors/bounded-exec/ram-temp.ts +137 -17
- package/src/executors/bounded-exec/schema.ts +19 -0
- package/src/executors/bounded-exec/verdict.ts +44 -16
- package/src/index.ts +272 -106
- package/src/managed-files/files.ts +3 -3
- package/src/managed-files/generator.ts +21 -6
- package/src/managed-files/render-memo.ts +135 -0
- package/src/test-program.ts +36 -41
- package/src/tool-bins.ts +35 -6
- package/src/typecheck-route.ts +5 -14
- package/src/typecheck-test-policy.ts +49 -24
- package/src/workspace-index.ts +40 -5
- package/test-timings.json +6 -0
package/dist/bun-lock-scope.d.ts
CHANGED
|
@@ -1,21 +1,29 @@
|
|
|
1
|
-
import { type CreateDependenciesContext, type ProjectGraphExternalNode, type RawProjectGraphDependency } from 'nx/src/devkit-exports.js';
|
|
1
|
+
import { type CreateDependenciesContext, type ProjectGraph, type ProjectGraphExternalNode, type RawProjectGraphDependency } from 'nx/src/devkit-exports.js';
|
|
2
2
|
/**
|
|
3
3
|
* Every bun lock-scope node's name starts with this; the rest is the root of
|
|
4
4
|
* the project whose manifest it stands for, `.` for the workspace root.
|
|
5
5
|
*
|
|
6
6
|
* A lock-scope node is the part of bun.lock one manifest reaches: what the
|
|
7
7
|
* package can load. Its edges go to the npm nodes the manifest's dependencies
|
|
8
|
-
* resolve to
|
|
9
|
-
*
|
|
10
|
-
* the
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* the
|
|
8
|
+
* resolve to and to the node of each workspace member it depends on, the
|
|
9
|
+
* root's manifest included. Nx's lockfile parser links each versioned npm node
|
|
10
|
+
* to the packages it depends on, and the plugin links each unversioned alias
|
|
11
|
+
* to its versioned node ({@link bunVersionAliasDependencies}), so a target naming a node in its
|
|
12
|
+
* `externalDependencies` is keyed on every package of that closure by the hash
|
|
13
|
+
* bun.lock records for it, and on nothing else in the lockfile. That replaces
|
|
14
|
+
* bun.lock as a file input: a lockfile edit re-keys the tasks that can load
|
|
15
|
+
* what changed.
|
|
16
|
+
*
|
|
17
|
+
* A member's node has no edge to the root's. Bun's isolated linker links into
|
|
18
|
+
* a directory's `node_modules` exactly the packages its manifest declares, but
|
|
19
|
+
* Node's lookup from a member continues into the root's `node_modules`, so a
|
|
20
|
+
* member can load any package the root declares. Two rules keep the member's
|
|
21
|
+
* own closure the whole of what it loads: a source import of a package outside
|
|
22
|
+
* that closure refuses the graph ({@link undeclaredImports}), and a tool a
|
|
23
|
+
* target runs names each package it loads by name from a directory by the
|
|
24
|
+
* scope that declares it ({@link bunLoadInput}). The root's own tooling (Nx
|
|
25
|
+
* plugins and generators, release and mutation tooling) then keys only the
|
|
26
|
+
* tasks that load it.
|
|
19
27
|
*
|
|
20
28
|
* The nodes carry no content of their own; Nx hashes a node's version and the
|
|
21
29
|
* nodes it reaches.
|
|
@@ -23,8 +31,15 @@ import { type CreateDependenciesContext, type ProjectGraphExternalNode, type Raw
|
|
|
23
31
|
export declare const BUN_LOCK_NODE_PREFIX = "bun-lock:";
|
|
24
32
|
/** The lock-scope node of the project at `projectRoot`. */
|
|
25
33
|
export declare function bunLockNodeName(projectRoot: string): string;
|
|
26
|
-
/** The node of the workspace root manifest
|
|
34
|
+
/** The node of the workspace root manifest. */
|
|
27
35
|
export declare const BUN_ROOT_LOCK_NODE: string;
|
|
36
|
+
/**
|
|
37
|
+
* The named input every `package.json` project defines as its own lock-scope
|
|
38
|
+
* input. `externalDependencies` takes no `{projectRoot}` token, so a
|
|
39
|
+
* workspace-wide named input or target default names this to key each
|
|
40
|
+
* project's targets on its own manifest's closure.
|
|
41
|
+
*/
|
|
42
|
+
export declare const BUN_LOCK_SCOPE_NAMED_INPUT = "bunLockScope";
|
|
28
43
|
/** The input that keys a target on the bun.lock entries its project's manifest reaches. */
|
|
29
44
|
export declare function bunLockInput(projectRoot: string): {
|
|
30
45
|
externalDependencies: string[];
|
|
@@ -32,13 +47,106 @@ export declare function bunLockInput(projectRoot: string): {
|
|
|
32
47
|
/** The node itself, published by its project; {@link bunLockDependencies} gives it its edges. */
|
|
33
48
|
export declare function bunLockNode(projectRoot: string): ProjectGraphExternalNode;
|
|
34
49
|
/**
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
|
|
50
|
+
* Every bun runtime-scope node's name starts with this; the rest is a project
|
|
51
|
+
* root. It is the part of bun.lock a dependent loads through that package: the
|
|
52
|
+
* closure of its `dependencies`, `optionalDependencies` and
|
|
53
|
+
* `peerDependencies`. A package's devDependencies are installed for its own
|
|
54
|
+
* targets only, so a dependent's lock-scope node reaches the runtime node of
|
|
55
|
+
* each member it declares, never that member's own node.
|
|
56
|
+
*/
|
|
57
|
+
export declare const BUN_LOCK_RUNTIME_NODE_PREFIX = "bun-lock-runtime:";
|
|
58
|
+
/** The runtime-scope node of the project at `projectRoot`. */
|
|
59
|
+
export declare function bunLockRuntimeNodeName(projectRoot: string): string;
|
|
60
|
+
/** The runtime-scope node itself, published by its project beside its lock-scope node. */
|
|
61
|
+
export declare function bunLockRuntimeNode(projectRoot: string): ProjectGraphExternalNode;
|
|
62
|
+
/**
|
|
63
|
+
* The edges of every published bun lock-scope and runtime-scope node. A
|
|
64
|
+
* manifest's dependencies are resolved exactly as Nx resolves a project's own
|
|
65
|
+
* package edges (`buildExplicitPackageJsonDependencies`, one
|
|
66
|
+
* `TargetProjectLocator` over the same projects and lockfile nodes): an
|
|
67
|
+
* installed package becomes an edge to its npm node, a workspace member an
|
|
68
|
+
* edge to that member's runtime node, and a package that resolves to no node
|
|
69
|
+
* is skipped exactly as Nx skips it. The lock-scope node takes every section,
|
|
70
|
+
* the runtime node all but devDependencies.
|
|
42
71
|
*/
|
|
43
72
|
export declare function bunLockDependencies(context: CreateDependenciesContext): RawProjectGraphDependency[];
|
|
73
|
+
/** A package a module loads by name, and the workspace-relative directory of that module. */
|
|
74
|
+
export interface PackageLoad {
|
|
75
|
+
readonly directory: string;
|
|
76
|
+
readonly name: string;
|
|
77
|
+
}
|
|
78
|
+
/** The package a bare specifier names: its scope and name, without the subpath. */
|
|
79
|
+
export declare function specifierPackage(specifier: string): string;
|
|
80
|
+
/** One manifest at or above a directory: its project root and the packages it declares. */
|
|
81
|
+
export interface ManifestDeclarations {
|
|
82
|
+
readonly root: string;
|
|
83
|
+
readonly declared: ReadonlySet<string>;
|
|
84
|
+
}
|
|
85
|
+
/** The manifests at and above the workspace-relative `directory`, nearest first, ending with the root's. */
|
|
86
|
+
export declare function manifestsAbove(workspaceRoot: string, directory: string): ManifestDeclarations[];
|
|
87
|
+
/**
|
|
88
|
+
* The `externalDependencies` entry that keys package `name` as a process loads
|
|
89
|
+
* it by name from a directory, given the manifests at and above it, nearest
|
|
90
|
+
* first; `null` when none declares it, so nothing on that path loads it. Node's
|
|
91
|
+
* lookup walks the directory's ancestors' `node_modules`, and bun's isolated
|
|
92
|
+
* linker links into each exactly what its manifest declares, so the nearest
|
|
93
|
+
* declaring manifest decides what loads. A member's declaration is keyed by its
|
|
94
|
+
* lock-scope node. The root's is named by itself, and Nx keys that package's
|
|
95
|
+
* node and what it reaches: the root's node would key the whole of the root's
|
|
96
|
+
* tooling.
|
|
97
|
+
*/
|
|
98
|
+
export declare function bunLoadScope(manifests: readonly ManifestDeclarations[], name: string): string | null;
|
|
99
|
+
/** The lock scope of each package load, from the manifests above its directory; sorted, each once. */
|
|
100
|
+
export declare function bunLoadScopes(workspaceRoot: string, loads: readonly PackageLoad[]): string[];
|
|
101
|
+
/** A target's one `externalDependencies` input: its project's lock-scope node first, then each other scope once, sorted. */
|
|
102
|
+
export declare function bunScopeInput(projectRoot: string, ...scopes: readonly (readonly string[])[]): {
|
|
103
|
+
externalDependencies: string[];
|
|
104
|
+
};
|
|
105
|
+
/** The input keying every package of `names` a process loads by name from the directory `manifests` stand above. */
|
|
106
|
+
export declare function bunLoadInput(manifests: readonly ManifestDeclarations[], names: Iterable<string>): {
|
|
107
|
+
externalDependencies: string[];
|
|
108
|
+
};
|
|
109
|
+
/**
|
|
110
|
+
* The packages a TypeScript compile in a directory loads by name beyond its
|
|
111
|
+
* sources' imports: every `@types` package a manifest at or above it declares
|
|
112
|
+
* (TypeScript includes each ancestor's `node_modules/@types` unless the config
|
|
113
|
+
* lists `types`, a narrower set), and the `tslib` an `importHelpers` compile
|
|
114
|
+
* resolves.
|
|
115
|
+
*/
|
|
116
|
+
export declare function typescriptLoads(manifests: readonly ManifestDeclarations[]): string[];
|
|
117
|
+
/** A project source import of a package its own lock-scope node does not reach. */
|
|
118
|
+
export interface UndeclaredImport {
|
|
119
|
+
readonly project: string;
|
|
120
|
+
readonly root: string;
|
|
121
|
+
readonly packageName: string;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* The npm packages each workspace member's sources import (Nx's own `static`
|
|
125
|
+
* and `dynamic` edges) that its lock-scope node does not reach. Node loads such
|
|
126
|
+
* a package through an ancestor's `node_modules`, the root's, and the
|
|
127
|
+
* project's targets, keyed on the member's own closure, would miss it. The
|
|
128
|
+
* root's project is exempt: its node reaches everything its manifest declares.
|
|
129
|
+
* So is a `@types` package: TypeScript loads it by ancestry, not Node, and
|
|
130
|
+
* every TypeScript target keys the `@types` the manifests above it declare
|
|
131
|
+
* ({@link typescriptLoads}). A package is compared by name and version, never
|
|
132
|
+
* by node name: Nx publishes a hoisted package as both `npm:<name>` and
|
|
133
|
+
* `npm:<name>@<version>`, and its locator resolves a declaration and an
|
|
134
|
+
* import to either ({@link bunVersionAliasDependencies}).
|
|
135
|
+
*/
|
|
136
|
+
export declare function undeclaredImports(graph: ProjectGraph): UndeclaredImport[];
|
|
137
|
+
/**
|
|
138
|
+
* An edge from each unversioned npm node to the versioned node of the same
|
|
139
|
+
* package and version. Nx's bun lockfile parser publishes a hoisted package as
|
|
140
|
+
* both `npm:<name>` and `npm:<name>@<version>`, with one integrity, and links
|
|
141
|
+
* only the versioned node to the package's dependencies. A key on the
|
|
142
|
+
* unversioned node (an `externalDependencies` entry naming a package, or a
|
|
143
|
+
* lock-scope edge the locator resolved to it) then held the package's own
|
|
144
|
+
* integrity and none of its closure; through this edge it holds both.
|
|
145
|
+
*/
|
|
146
|
+
export declare function bunVersionAliasDependencies(externalNodes: Readonly<Record<string, ProjectGraphExternalNode>>): RawProjectGraphDependency[];
|
|
147
|
+
export declare class UndeclaredImportError extends Error {
|
|
148
|
+
readonly findings: readonly UndeclaredImport[];
|
|
149
|
+
constructor(findings: readonly UndeclaredImport[]);
|
|
150
|
+
}
|
|
151
|
+
export declare function refuseUndeclaredImports(graph: ProjectGraph): void;
|
|
44
152
|
//# sourceMappingURL=bun-lock-scope.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bun-lock-scope.d.ts","sourceRoot":"","sources":["../src/bun-lock-scope.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,yBAAyB,EAE9B,KAAK,wBAAwB,EAE7B,KAAK,yBAAyB,EAE/B,MAAM,0BAA0B,CAAC;AAGlC
|
|
1
|
+
{"version":3,"file":"bun-lock-scope.d.ts","sourceRoot":"","sources":["../src/bun-lock-scope.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,yBAAyB,EAE9B,KAAK,YAAY,EACjB,KAAK,wBAAwB,EAE7B,KAAK,yBAAyB,EAE/B,MAAM,0BAA0B,CAAC;AAGlC;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,oBAAoB,cAAc,CAAC;AAEhD,2DAA2D;AAC3D,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,+CAA+C;AAC/C,eAAO,MAAM,kBAAkB,QAAuB,CAAC;AAEvD;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,iBAAiB,CAAC;AACzD,2FAA2F;AAC3F,wBAAgB,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG;IAAE,oBAAoB,EAAE,MAAM,EAAE,CAAA;CAAE,CAEpF;AAED,iGAAiG;AACjG,wBAAgB,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,wBAAwB,CAGzE;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B,sBAAsB,CAAC;AAEhE,8DAA8D;AAC9D,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,MAAM,G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ACtB;IAAE,oBAAoB,EAAE,MAAM,EAAE,CAAA;CAAE,CAOpC;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,SAAS,oBAAoB,EAAE,GAAG,MAAM,EAAE,CAQpF;AAED,mFAAmF;AACnF,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,YAAY,GAAG,gBAAgB,EAAE,CAsCzE;AAED;;;;;;;;GAQG;AACH,wBAAgB,2BAA2B,CACzC,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAAC,GAChE,yBAAyB,EAAE,CAU7B;AACD,qBAAa,qBAAsB,SAAQ,KAAK;IAClC,QAAQ,CAAC,QAAQ,EAAE,SAAS,gBAAgB,EAAE;IAA1D,YAAqB,QAAQ,EAAE,SAAS,gBAAgB,EAAE,EAOzD;CACF;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAGjE"}
|
package/dist/bun-lock-scope.js
CHANGED
|
@@ -8,17 +8,25 @@ import { TargetProjectLocator } from 'nx/src/plugins/js/project-graph/build-depe
|
|
|
8
8
|
*
|
|
9
9
|
* A lock-scope node is the part of bun.lock one manifest reaches: what the
|
|
10
10
|
* package can load. Its edges go to the npm nodes the manifest's dependencies
|
|
11
|
-
* resolve to
|
|
12
|
-
*
|
|
13
|
-
* the
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* the
|
|
11
|
+
* resolve to and to the node of each workspace member it depends on, the
|
|
12
|
+
* root's manifest included. Nx's lockfile parser links each versioned npm node
|
|
13
|
+
* to the packages it depends on, and the plugin links each unversioned alias
|
|
14
|
+
* to its versioned node ({@link bunVersionAliasDependencies}), so a target naming a node in its
|
|
15
|
+
* `externalDependencies` is keyed on every package of that closure by the hash
|
|
16
|
+
* bun.lock records for it, and on nothing else in the lockfile. That replaces
|
|
17
|
+
* bun.lock as a file input: a lockfile edit re-keys the tasks that can load
|
|
18
|
+
* what changed.
|
|
19
|
+
*
|
|
20
|
+
* A member's node has no edge to the root's. Bun's isolated linker links into
|
|
21
|
+
* a directory's `node_modules` exactly the packages its manifest declares, but
|
|
22
|
+
* Node's lookup from a member continues into the root's `node_modules`, so a
|
|
23
|
+
* member can load any package the root declares. Two rules keep the member's
|
|
24
|
+
* own closure the whole of what it loads: a source import of a package outside
|
|
25
|
+
* that closure refuses the graph ({@link undeclaredImports}), and a tool a
|
|
26
|
+
* target runs names each package it loads by name from a directory by the
|
|
27
|
+
* scope that declares it ({@link bunLoadInput}). The root's own tooling (Nx
|
|
28
|
+
* plugins and generators, release and mutation tooling) then keys only the
|
|
29
|
+
* tasks that load it.
|
|
22
30
|
*
|
|
23
31
|
* The nodes carry no content of their own; Nx hashes a node's version and the
|
|
24
32
|
* nodes it reaches.
|
|
@@ -28,8 +36,15 @@ export const BUN_LOCK_NODE_PREFIX = 'bun-lock:';
|
|
|
28
36
|
export function bunLockNodeName(projectRoot) {
|
|
29
37
|
return `${BUN_LOCK_NODE_PREFIX}${posix.normalize(projectRoot === '' ? '.' : projectRoot)}`;
|
|
30
38
|
}
|
|
31
|
-
/** The node of the workspace root manifest
|
|
39
|
+
/** The node of the workspace root manifest. */
|
|
32
40
|
export const BUN_ROOT_LOCK_NODE = bunLockNodeName('.');
|
|
41
|
+
/**
|
|
42
|
+
* The named input every `package.json` project defines as its own lock-scope
|
|
43
|
+
* input. `externalDependencies` takes no `{projectRoot}` token, so a
|
|
44
|
+
* workspace-wide named input or target default names this to key each
|
|
45
|
+
* project's targets on its own manifest's closure.
|
|
46
|
+
*/
|
|
47
|
+
export const BUN_LOCK_SCOPE_NAMED_INPUT = 'bunLockScope';
|
|
33
48
|
/** The input that keys a target on the bun.lock entries its project's manifest reaches. */
|
|
34
49
|
export function bunLockInput(projectRoot) {
|
|
35
50
|
return { externalDependencies: [bunLockNodeName(projectRoot)] };
|
|
@@ -39,16 +54,51 @@ export function bunLockNode(projectRoot) {
|
|
|
39
54
|
const name = bunLockNodeName(projectRoot);
|
|
40
55
|
return { type: 'bun', name, data: { packageName: name, version: '0.0.0' } };
|
|
41
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* Every bun runtime-scope node's name starts with this; the rest is a project
|
|
59
|
+
* root. It is the part of bun.lock a dependent loads through that package: the
|
|
60
|
+
* closure of its `dependencies`, `optionalDependencies` and
|
|
61
|
+
* `peerDependencies`. A package's devDependencies are installed for its own
|
|
62
|
+
* targets only, so a dependent's lock-scope node reaches the runtime node of
|
|
63
|
+
* each member it declares, never that member's own node.
|
|
64
|
+
*/
|
|
65
|
+
export const BUN_LOCK_RUNTIME_NODE_PREFIX = 'bun-lock-runtime:';
|
|
66
|
+
/** The runtime-scope node of the project at `projectRoot`. */
|
|
67
|
+
export function bunLockRuntimeNodeName(projectRoot) {
|
|
68
|
+
return `${BUN_LOCK_RUNTIME_NODE_PREFIX}${posix.normalize(projectRoot === '' ? '.' : projectRoot)}`;
|
|
69
|
+
}
|
|
70
|
+
/** The runtime-scope node itself, published by its project beside its lock-scope node. */
|
|
71
|
+
export function bunLockRuntimeNode(projectRoot) {
|
|
72
|
+
const name = bunLockRuntimeNodeName(projectRoot);
|
|
73
|
+
return { type: 'bun', name, data: { packageName: name, version: '0.0.0' } };
|
|
74
|
+
}
|
|
42
75
|
/** The manifest sections Nx reads a project's package dependencies from, in the order it lets them override. */
|
|
43
76
|
const DEPENDENCY_SECTIONS = ['optionalDependencies', 'peerDependencies', 'devDependencies', 'dependencies'];
|
|
77
|
+
/** The sections a dependent loads through a package: all but its devDependencies. */
|
|
78
|
+
const RUNTIME_SECTIONS = ['optionalDependencies', 'peerDependencies', 'dependencies'];
|
|
79
|
+
/** Each package a manifest declares in `sections`, with the specifier of the section Nx lets win. */
|
|
80
|
+
function declaredSpecifiers(manifest, sections = DEPENDENCY_SECTIONS) {
|
|
81
|
+
const specifiers = new Map();
|
|
82
|
+
for (const section of sections) {
|
|
83
|
+
const declared = manifest[section];
|
|
84
|
+
if (typeof declared !== 'object' || declared === null)
|
|
85
|
+
continue;
|
|
86
|
+
for (const [name, specifier] of Object.entries(declared)) {
|
|
87
|
+
if (typeof specifier === 'string')
|
|
88
|
+
specifiers.set(name, specifier);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return specifiers;
|
|
92
|
+
}
|
|
44
93
|
/**
|
|
45
|
-
* The edges of every published bun lock-scope node. A
|
|
46
|
-
* are resolved exactly as Nx resolves a project's own
|
|
47
|
-
* (`buildExplicitPackageJsonDependencies`, one
|
|
48
|
-
* the same projects and lockfile nodes): an
|
|
49
|
-
* to its npm node, a workspace member
|
|
50
|
-
* that member's node, and a package that resolves to no node
|
|
51
|
-
* exactly as Nx skips it.
|
|
94
|
+
* The edges of every published bun lock-scope and runtime-scope node. A
|
|
95
|
+
* manifest's dependencies are resolved exactly as Nx resolves a project's own
|
|
96
|
+
* package edges (`buildExplicitPackageJsonDependencies`, one
|
|
97
|
+
* `TargetProjectLocator` over the same projects and lockfile nodes): an
|
|
98
|
+
* installed package becomes an edge to its npm node, a workspace member an
|
|
99
|
+
* edge to that member's runtime node, and a package that resolves to no node
|
|
100
|
+
* is skipped exactly as Nx skips it. The lock-scope node takes every section,
|
|
101
|
+
* the runtime node all but devDependencies.
|
|
52
102
|
*/
|
|
53
103
|
export function bunLockDependencies(context) {
|
|
54
104
|
const externalNodes = context.externalNodes ?? {};
|
|
@@ -57,41 +107,214 @@ export function bunLockDependencies(context) {
|
|
|
57
107
|
nodes[name] = { name, type: data.projectType === 'application' ? 'app' : 'lib', data };
|
|
58
108
|
}
|
|
59
109
|
const locator = new TargetProjectLocator(nodes, externalNodes);
|
|
60
|
-
const nodeOfMember = (member) => {
|
|
61
|
-
const root = context.projects[member]?.root;
|
|
62
|
-
return root === undefined ? null : bunLockNodeName(root);
|
|
63
|
-
};
|
|
64
110
|
const dependencies = [];
|
|
65
111
|
for (const project of Object.values(context.projects).sort((left, right) => left.root < right.root ? -1 : left.root > right.root ? 1 : 0)) {
|
|
66
|
-
const source = bunLockNodeName(project.root);
|
|
67
|
-
if (externalNodes[source] === undefined)
|
|
68
|
-
continue;
|
|
69
112
|
const manifestPath = posix.join(project.root, 'package.json');
|
|
70
113
|
if (!existsSync(join(context.workspaceRoot, manifestPath)))
|
|
71
114
|
continue;
|
|
72
115
|
const manifest = readJsonFile(join(context.workspaceRoot, manifestPath));
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
116
|
+
for (const [source, sections] of [
|
|
117
|
+
[bunLockNodeName(project.root), DEPENDENCY_SECTIONS],
|
|
118
|
+
[bunLockRuntimeNodeName(project.root), RUNTIME_SECTIONS],
|
|
119
|
+
]) {
|
|
120
|
+
if (externalNodes[source] === undefined)
|
|
77
121
|
continue;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
122
|
+
const targets = new Set();
|
|
123
|
+
for (const [name, specifier] of declaredSpecifiers(manifest, sections)) {
|
|
124
|
+
const member = locator.findDependencyInWorkspaceProjects(manifestPath, name, specifier);
|
|
125
|
+
const memberRoot = member === null ? undefined : context.projects[member]?.root;
|
|
126
|
+
const target = member === null
|
|
127
|
+
? locator.findNpmProjectFromImport(name, manifestPath)
|
|
128
|
+
: memberRoot === undefined
|
|
129
|
+
? null
|
|
130
|
+
: bunLockRuntimeNodeName(memberRoot);
|
|
131
|
+
if (target !== null && target !== source && externalNodes[target] !== undefined)
|
|
132
|
+
targets.add(target);
|
|
133
|
+
}
|
|
134
|
+
for (const target of [...targets].sort()) {
|
|
135
|
+
dependencies.push({ source, target, type: DependencyType.static });
|
|
81
136
|
}
|
|
82
137
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
138
|
+
}
|
|
139
|
+
return dependencies;
|
|
140
|
+
}
|
|
141
|
+
/** The package a bare specifier names: its scope and name, without the subpath. */
|
|
142
|
+
export function specifierPackage(specifier) {
|
|
143
|
+
const parts = specifier.split('/');
|
|
144
|
+
return (specifier.startsWith('@') ? parts.slice(0, 2) : parts.slice(0, 1)).join('/');
|
|
145
|
+
}
|
|
146
|
+
/** The manifests at and above the workspace-relative `directory`, nearest first, ending with the root's. */
|
|
147
|
+
export function manifestsAbove(workspaceRoot, directory) {
|
|
148
|
+
const manifests = [];
|
|
149
|
+
for (let current = posix.normalize(directory === '' ? '.' : directory);; current = posix.dirname(current)) {
|
|
150
|
+
const path = join(workspaceRoot, current, 'package.json');
|
|
151
|
+
if (existsSync(path)) {
|
|
152
|
+
manifests.push({ root: current, declared: new Set(declaredSpecifiers(readJsonFile(path)).keys()) });
|
|
91
153
|
}
|
|
92
|
-
|
|
93
|
-
|
|
154
|
+
if (current === '.')
|
|
155
|
+
return manifests;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* The `externalDependencies` entry that keys package `name` as a process loads
|
|
160
|
+
* it by name from a directory, given the manifests at and above it, nearest
|
|
161
|
+
* first; `null` when none declares it, so nothing on that path loads it. Node's
|
|
162
|
+
* lookup walks the directory's ancestors' `node_modules`, and bun's isolated
|
|
163
|
+
* linker links into each exactly what its manifest declares, so the nearest
|
|
164
|
+
* declaring manifest decides what loads. A member's declaration is keyed by its
|
|
165
|
+
* lock-scope node. The root's is named by itself, and Nx keys that package's
|
|
166
|
+
* node and what it reaches: the root's node would key the whole of the root's
|
|
167
|
+
* tooling.
|
|
168
|
+
*/
|
|
169
|
+
export function bunLoadScope(manifests, name) {
|
|
170
|
+
const declaring = manifests.find((manifest) => manifest.declared.has(name));
|
|
171
|
+
if (declaring === undefined)
|
|
172
|
+
return null;
|
|
173
|
+
return declaring.root === '.' ? name : bunLockNodeName(declaring.root);
|
|
174
|
+
}
|
|
175
|
+
/** The lock scope of each package load, from the manifests above its directory; sorted, each once. */
|
|
176
|
+
export function bunLoadScopes(workspaceRoot, loads) {
|
|
177
|
+
const manifests = new Map();
|
|
178
|
+
const scopes = new Set();
|
|
179
|
+
for (const { directory, name } of loads) {
|
|
180
|
+
let above = manifests.get(directory);
|
|
181
|
+
if (above === undefined) {
|
|
182
|
+
above = manifestsAbove(workspaceRoot, directory);
|
|
183
|
+
manifests.set(directory, above);
|
|
94
184
|
}
|
|
185
|
+
const scope = bunLoadScope(above, name);
|
|
186
|
+
if (scope !== null)
|
|
187
|
+
scopes.add(scope);
|
|
95
188
|
}
|
|
96
|
-
return
|
|
189
|
+
return [...scopes].sort();
|
|
190
|
+
}
|
|
191
|
+
/** A target's one `externalDependencies` input: its project's lock-scope node first, then each other scope once, sorted. */
|
|
192
|
+
export function bunScopeInput(projectRoot, ...scopes) {
|
|
193
|
+
const own = bunLockNodeName(projectRoot);
|
|
194
|
+
return { externalDependencies: [own, ...[...new Set(scopes.flat())].filter((scope) => scope !== own).sort()] };
|
|
195
|
+
}
|
|
196
|
+
/** The input keying every package of `names` a process loads by name from the directory `manifests` stand above. */
|
|
197
|
+
export function bunLoadInput(manifests, names) {
|
|
198
|
+
const scopes = new Set();
|
|
199
|
+
for (const name of names) {
|
|
200
|
+
const scope = bunLoadScope(manifests, name);
|
|
201
|
+
if (scope !== null)
|
|
202
|
+
scopes.add(scope);
|
|
203
|
+
}
|
|
204
|
+
return { externalDependencies: [...scopes].sort() };
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* The packages a TypeScript compile in a directory loads by name beyond its
|
|
208
|
+
* sources' imports: every `@types` package a manifest at or above it declares
|
|
209
|
+
* (TypeScript includes each ancestor's `node_modules/@types` unless the config
|
|
210
|
+
* lists `types`, a narrower set), and the `tslib` an `importHelpers` compile
|
|
211
|
+
* resolves.
|
|
212
|
+
*/
|
|
213
|
+
export function typescriptLoads(manifests) {
|
|
214
|
+
const names = new Set(['tslib']);
|
|
215
|
+
for (const manifest of manifests) {
|
|
216
|
+
for (const name of manifest.declared) {
|
|
217
|
+
if (name.startsWith('@types/'))
|
|
218
|
+
names.add(name);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
return [...names].sort();
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* The npm packages each workspace member's sources import (Nx's own `static`
|
|
225
|
+
* and `dynamic` edges) that its lock-scope node does not reach. Node loads such
|
|
226
|
+
* a package through an ancestor's `node_modules`, the root's, and the
|
|
227
|
+
* project's targets, keyed on the member's own closure, would miss it. The
|
|
228
|
+
* root's project is exempt: its node reaches everything its manifest declares.
|
|
229
|
+
* So is a `@types` package: TypeScript loads it by ancestry, not Node, and
|
|
230
|
+
* every TypeScript target keys the `@types` the manifests above it declare
|
|
231
|
+
* ({@link typescriptLoads}). A package is compared by name and version, never
|
|
232
|
+
* by node name: Nx publishes a hoisted package as both `npm:<name>` and
|
|
233
|
+
* `npm:<name>@<version>`, and its locator resolves a declaration and an
|
|
234
|
+
* import to either ({@link bunVersionAliasDependencies}).
|
|
235
|
+
*/
|
|
236
|
+
export function undeclaredImports(graph) {
|
|
237
|
+
const externalNodes = graph.externalNodes ?? {};
|
|
238
|
+
const identity = (name) => {
|
|
239
|
+
const node = externalNodes[name];
|
|
240
|
+
return node?.type === 'npm' ? `${node.data.packageName}@${node.data.version}` : null;
|
|
241
|
+
};
|
|
242
|
+
const namesOf = new Map();
|
|
243
|
+
for (const name of Object.keys(externalNodes)) {
|
|
244
|
+
const key = identity(name);
|
|
245
|
+
if (key !== null)
|
|
246
|
+
namesOf.set(key, [...(namesOf.get(key) ?? []), name]);
|
|
247
|
+
}
|
|
248
|
+
const findings = [];
|
|
249
|
+
for (const [project, node] of Object.entries(graph.nodes).sort(([left], [right]) => (left < right ? -1 : 1))) {
|
|
250
|
+
const scope = bunLockNodeName(node.data.root);
|
|
251
|
+
if (scope === BUN_ROOT_LOCK_NODE || externalNodes[scope] === undefined)
|
|
252
|
+
continue;
|
|
253
|
+
const reached = new Set();
|
|
254
|
+
for (let pending = [scope]; pending.length > 0;) {
|
|
255
|
+
const next = [];
|
|
256
|
+
for (const name of pending) {
|
|
257
|
+
if (reached.has(name))
|
|
258
|
+
continue;
|
|
259
|
+
reached.add(name);
|
|
260
|
+
for (const edge of graph.dependencies[name] ?? [])
|
|
261
|
+
next.push(edge.target);
|
|
262
|
+
const key = identity(name);
|
|
263
|
+
if (key !== null)
|
|
264
|
+
next.push(...(namesOf.get(key) ?? []));
|
|
265
|
+
}
|
|
266
|
+
pending = next;
|
|
267
|
+
}
|
|
268
|
+
const missing = new Set();
|
|
269
|
+
for (const edge of graph.dependencies[project] ?? []) {
|
|
270
|
+
if (edge.type === DependencyType.implicit)
|
|
271
|
+
continue;
|
|
272
|
+
const external = externalNodes[edge.target];
|
|
273
|
+
if (external === undefined || external.type !== 'npm' || reached.has(edge.target))
|
|
274
|
+
continue;
|
|
275
|
+
if (external.data.packageName.startsWith('@types/'))
|
|
276
|
+
continue;
|
|
277
|
+
missing.add(external.data.packageName);
|
|
278
|
+
}
|
|
279
|
+
for (const packageName of [...missing].sort())
|
|
280
|
+
findings.push({ project, root: node.data.root, packageName });
|
|
281
|
+
}
|
|
282
|
+
return findings;
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* An edge from each unversioned npm node to the versioned node of the same
|
|
286
|
+
* package and version. Nx's bun lockfile parser publishes a hoisted package as
|
|
287
|
+
* both `npm:<name>` and `npm:<name>@<version>`, with one integrity, and links
|
|
288
|
+
* only the versioned node to the package's dependencies. A key on the
|
|
289
|
+
* unversioned node (an `externalDependencies` entry naming a package, or a
|
|
290
|
+
* lock-scope edge the locator resolved to it) then held the package's own
|
|
291
|
+
* integrity and none of its closure; through this edge it holds both.
|
|
292
|
+
*/
|
|
293
|
+
export function bunVersionAliasDependencies(externalNodes) {
|
|
294
|
+
const dependencies = [];
|
|
295
|
+
for (const [name, node] of Object.entries(externalNodes)) {
|
|
296
|
+
if (node.type !== 'npm')
|
|
297
|
+
continue;
|
|
298
|
+
const target = `npm:${node.data.packageName}@${node.data.version}`;
|
|
299
|
+
const versioned = externalNodes[target];
|
|
300
|
+
if (target === name || versioned?.type !== 'npm' || versioned.data.version !== node.data.version)
|
|
301
|
+
continue;
|
|
302
|
+
dependencies.push({ source: name, target, type: DependencyType.static });
|
|
303
|
+
}
|
|
304
|
+
return dependencies.sort((left, right) => (left.source < right.source ? -1 : left.source > right.source ? 1 : 0));
|
|
305
|
+
}
|
|
306
|
+
export class UndeclaredImportError extends Error {
|
|
307
|
+
findings;
|
|
308
|
+
constructor(findings) {
|
|
309
|
+
super('Workspace members import packages their package.json does not declare. Node loads each through the root' +
|
|
310
|
+
"'s node_modules, and no lock-scope node of the member keys it; declare each in the member's package.json:\n" +
|
|
311
|
+
findings.map(({ project, root, packageName }) => ` ${project} (${root}): ${packageName}`).join('\n'));
|
|
312
|
+
this.findings = findings;
|
|
313
|
+
this.name = 'UndeclaredImportError';
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
export function refuseUndeclaredImports(graph) {
|
|
317
|
+
const findings = undeclaredImports(graph);
|
|
318
|
+
if (findings.length > 0)
|
|
319
|
+
throw new UndeclaredImportError(findings);
|
|
97
320
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ProjectGraphExternalNode, TargetConfiguration } from 'nx/src/devkit-exports.js';
|
|
2
|
-
import { type CargoResolve, type CompiledCargoInput } from './cargo-source-hash.js';
|
|
2
|
+
import { type CargoResolve, type CargoSourceIndex, type CompiledCargoInput } from './cargo-source-hash.js';
|
|
3
3
|
/**
|
|
4
4
|
* The named input the plugin infers for every project with crates of a Cargo
|
|
5
5
|
* workspace under its root: the mutable sources of the Cargo-resolved
|
|
@@ -32,20 +32,22 @@ export interface CargoClosureSource {
|
|
|
32
32
|
readonly cargo: CargoResolve;
|
|
33
33
|
/** Every `Cargo.toml` in Nx's file index, relative to the workspace root. */
|
|
34
34
|
readonly indexed: ReadonlySet<string>;
|
|
35
|
+
/** The Rust sources and packages of Nx's file index the compiled-in scan reads. */
|
|
36
|
+
readonly sources: CargoSourceIndex;
|
|
35
37
|
readonly compiledFilesCache: Map<string, CompiledCargoInput[]>;
|
|
36
38
|
}
|
|
37
39
|
/**
|
|
38
|
-
*
|
|
39
|
-
* applied, `node_modules` never entered. A package whose manifest is missing
|
|
40
|
-
*
|
|
40
|
+
* The Cargo manifests and Rust sources of Nx's workspace file index, with Nx's content hash of each source:
|
|
41
|
+
* .gitignore and .nxignore applied, `node_modules` never entered. A package whose manifest is missing here has no
|
|
42
|
+
* files a fileset input can hash. Scans of source texts no longer indexed are forgotten here.
|
|
41
43
|
*/
|
|
42
|
-
export declare function
|
|
44
|
+
export declare function indexedCargoSources(workspaceRoot: string): Promise<CargoSourceIndex>;
|
|
43
45
|
/**
|
|
44
46
|
* Content-keyed locked offline metadata. A refusal fails graph inference:
|
|
45
47
|
* a stale closure or runtime whole-workspace fallback cannot establish the
|
|
46
48
|
* precise set of cache inputs.
|
|
47
49
|
*/
|
|
48
|
-
export declare function resolveCargoClosureSource(manifest: string, workspaceRoot: string, indexed: Promise<
|
|
50
|
+
export declare function resolveCargoClosureSource(manifest: string, workspaceRoot: string, indexed: Promise<CargoSourceIndex>, compiledFilesCache: Map<string, CompiledCargoInput[]>): Promise<CargoClosureSource>;
|
|
49
51
|
/**
|
|
50
52
|
* The `cargoClosure` definition for the project at `projectRoot`: for each
|
|
51
53
|
* Cargo workspace with crates under it, the resolve closure of those crates,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cargo-closure-input.d.ts","sourceRoot":"","sources":["../src/cargo-closure-input.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,C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