@spine-event-engine/proto-tools 2.0.0-snapshot.25 → 2.0.0-snapshot.28
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 +10 -3
- package/REFERENCE.md +58 -3
- package/dist/src/generation/app-query-generator.d.ts +33 -0
- package/dist/src/generation/app-query-generator.d.ts.map +1 -0
- package/dist/src/generation/app-query-generator.js +73 -0
- package/dist/src/generation/app-query-generator.js.map +1 -0
- package/dist/src/generation/build-time-handler-analyzer.d.ts +53 -1
- package/dist/src/generation/build-time-handler-analyzer.d.ts.map +1 -1
- package/dist/src/generation/build-time-handler-analyzer.js +414 -9
- package/dist/src/generation/build-time-handler-analyzer.js.map +1 -1
- package/dist/src/generation/entity-query-generator.d.ts.map +1 -1
- package/dist/src/generation/entity-query-generator.js +4 -3
- package/dist/src/generation/entity-query-generator.js.map +1 -1
- package/dist/src/generation/generated-registry-writer.d.ts +61 -0
- package/dist/src/generation/generated-registry-writer.d.ts.map +1 -1
- package/dist/src/generation/generated-registry-writer.js +470 -13
- package/dist/src/generation/generated-registry-writer.js.map +1 -1
- package/dist/src/generation/generated-source-policy.d.ts.map +1 -1
- package/dist/src/generation/generated-source-policy.js +50 -13
- package/dist/src/generation/generated-source-policy.js.map +1 -1
- package/dist/src/generation/generator.d.ts +4 -0
- package/dist/src/generation/generator.d.ts.map +1 -1
- package/dist/src/generation/generator.js +193 -45
- package/dist/src/generation/generator.js.map +1 -1
- package/dist/src/generation/handler-codegen.d.ts +8 -0
- package/dist/src/generation/handler-codegen.d.ts.map +1 -1
- package/dist/src/generation/handler-codegen.js +202 -13
- package/dist/src/generation/handler-codegen.js.map +1 -1
- package/dist/src/generation/handler-generator.d.ts +3 -0
- package/dist/src/generation/handler-generator.d.ts.map +1 -1
- package/dist/src/generation/handler-generator.js +5 -1
- package/dist/src/generation/handler-generator.js.map +1 -1
- package/dist/src/generation/runtime-metadata-assets.d.ts +48 -0
- package/dist/src/generation/runtime-metadata-assets.d.ts.map +1 -0
- package/dist/src/generation/runtime-metadata-assets.js +263 -0
- package/dist/src/generation/runtime-metadata-assets.js.map +1 -0
- package/dist/src/generation/runtime-metadata-graph.d.ts +82 -0
- package/dist/src/generation/runtime-metadata-graph.d.ts.map +1 -0
- package/dist/src/generation/runtime-metadata-graph.js +390 -0
- package/dist/src/generation/runtime-metadata-graph.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026, CodeMatters. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
|
|
5
|
+
* in compliance with the License. You may obtain a copy of the License at
|
|
6
|
+
*
|
|
7
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
*
|
|
9
|
+
* Unless required by applicable law or agreed to in writing, software distributed under the License
|
|
10
|
+
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
|
11
|
+
* or implied. See the License for the specific language governing permissions and limitations under
|
|
12
|
+
* the License.
|
|
13
|
+
*/
|
|
14
|
+
import { createHash } from "node:crypto";
|
|
15
|
+
import { existsSync, readFileSync, realpathSync } from "node:fs";
|
|
16
|
+
import { createRequire } from "node:module";
|
|
17
|
+
import { dirname, isAbsolute, join, relative, resolve } from "node:path";
|
|
18
|
+
import ts from "typescript";
|
|
19
|
+
/**
|
|
20
|
+
* Builds static adapters from resolved public package exports.
|
|
21
|
+
*/
|
|
22
|
+
export const RuntimeMetadataAssets = Object.freeze({
|
|
23
|
+
/**
|
|
24
|
+
* Renders source and emitted adapters with public direct imports and resolved nested paths.
|
|
25
|
+
*
|
|
26
|
+
* @param project Application TypeScript project path.
|
|
27
|
+
* @param publishedBootstrap Final bootstrap source path.
|
|
28
|
+
* @param sourceBootstrap Staged or final bootstrap source path.
|
|
29
|
+
* @param dependencies Resolved public package metadata exports.
|
|
30
|
+
* @param writer Existing generated metadata writer.
|
|
31
|
+
* @param format Runtime module condition of the consuming application.
|
|
32
|
+
* @returns Generated adapter files and restoration record.
|
|
33
|
+
*/
|
|
34
|
+
render(project, publishedBootstrap, sourceBootstrap, dependencies, writer, format = "import") {
|
|
35
|
+
const appRoot = dirname(project);
|
|
36
|
+
const outputs = MetadataOutput.paths(project, publishedBootstrap);
|
|
37
|
+
const imports = MetadataOutput.imports(appRoot, dependencies);
|
|
38
|
+
const source = writer.renderDependencies(imports, dirname(publishedBootstrap), format);
|
|
39
|
+
const runtime = writer.renderDependencies(imports, dirname(outputs.runtime), format);
|
|
40
|
+
const declarations = writer.renderDependencies(imports, dirname(outputs.declarations));
|
|
41
|
+
const sourceFiles = MetadataOutput.pair(dirname(sourceBootstrap), source);
|
|
42
|
+
const runtimeFiles = [
|
|
43
|
+
{ file: outputs.runtime, source: runtime.runtime },
|
|
44
|
+
{ file: outputs.declarations, source: declarations.declarations },
|
|
45
|
+
];
|
|
46
|
+
const record = MetadataOutput.record(appRoot, project, dirname(sourceBootstrap), runtimeFiles, dependencies);
|
|
47
|
+
return { source: sourceFiles, runtime: runtimeFiles, record, directDependencies: imports };
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
/**
|
|
51
|
+
* Calculates compiler output and confines restoration payloads.
|
|
52
|
+
*/
|
|
53
|
+
const MetadataOutput = {
|
|
54
|
+
/**
|
|
55
|
+
* Maps reachable direct edges to declared package aliases.
|
|
56
|
+
*
|
|
57
|
+
* @param appRoot Application package directory.
|
|
58
|
+
* @param dependencies Resolved metadata participants and runtime edges.
|
|
59
|
+
* @returns Metadata imports for the current installation.
|
|
60
|
+
*/
|
|
61
|
+
imports(appRoot, dependencies) {
|
|
62
|
+
const canonicalRoot = realpathSync(appRoot);
|
|
63
|
+
const participants = new Map(dependencies.map((item) => [item.root, item]));
|
|
64
|
+
const reachable = MetadataOutput.reachable(canonicalRoot, dependencies, participants);
|
|
65
|
+
for (const dependency of dependencies) {
|
|
66
|
+
if (!reachable.has(dependency.root))
|
|
67
|
+
throw new Error(`spine-proto: ${dependency.name}/spine is inaccessible through public package-edge metadata; ` +
|
|
68
|
+
"a nonparticipating bridge must expose its own /spine entry");
|
|
69
|
+
}
|
|
70
|
+
return dependencies.edges.flatMap((edge) => {
|
|
71
|
+
const participant = edge.requester === canonicalRoot && edge.resolved !== null
|
|
72
|
+
? participants.get(edge.resolved)
|
|
73
|
+
: undefined;
|
|
74
|
+
return participant === undefined
|
|
75
|
+
? []
|
|
76
|
+
: [{ ...participant, moduleSpecifier: `${edge.name}/spine` }];
|
|
77
|
+
});
|
|
78
|
+
},
|
|
79
|
+
/**
|
|
80
|
+
* Lists participants reachable solely through public passive metadata edges.
|
|
81
|
+
*
|
|
82
|
+
* @param canonicalRoot Canonical root package directory.
|
|
83
|
+
* @param dependencies Discovered dependency graph.
|
|
84
|
+
* @param participants Packages exposing passive metadata.
|
|
85
|
+
* @returns Reachable participant directories.
|
|
86
|
+
*/
|
|
87
|
+
reachable(canonicalRoot, dependencies, participants) {
|
|
88
|
+
const reachable = new Set([canonicalRoot]);
|
|
89
|
+
const pending = [canonicalRoot];
|
|
90
|
+
while (pending.length > 0) {
|
|
91
|
+
const requester = pending.shift();
|
|
92
|
+
for (const edge of dependencies.edges) {
|
|
93
|
+
if (edge.requester !== requester ||
|
|
94
|
+
edge.resolved === null ||
|
|
95
|
+
!participants.has(edge.resolved))
|
|
96
|
+
continue;
|
|
97
|
+
if (reachable.has(edge.resolved))
|
|
98
|
+
continue;
|
|
99
|
+
reachable.add(edge.resolved);
|
|
100
|
+
pending.push(edge.resolved);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return reachable;
|
|
104
|
+
},
|
|
105
|
+
/**
|
|
106
|
+
* Lists the effective project and inherited configs that control emitted paths.
|
|
107
|
+
*
|
|
108
|
+
* @param project Root TypeScript project configuration.
|
|
109
|
+
* @returns Configuration files in dependency order without duplicates.
|
|
110
|
+
*/
|
|
111
|
+
configurationFiles(project) {
|
|
112
|
+
const visited = new Set();
|
|
113
|
+
const pending = [project];
|
|
114
|
+
while (pending.length > 0) {
|
|
115
|
+
const file = pending.pop();
|
|
116
|
+
if (file === undefined || visited.has(file))
|
|
117
|
+
continue;
|
|
118
|
+
visited.add(file);
|
|
119
|
+
const config = ts.readConfigFile(file, (path) => ts.sys.readFile(path));
|
|
120
|
+
if (config.error !== undefined)
|
|
121
|
+
throw new Error(`Cannot read adapter project: ${file}`);
|
|
122
|
+
const inherited = config.config.extends;
|
|
123
|
+
const names = Array.isArray(inherited)
|
|
124
|
+
? inherited
|
|
125
|
+
: inherited === undefined
|
|
126
|
+
? []
|
|
127
|
+
: [inherited];
|
|
128
|
+
for (const name of names) {
|
|
129
|
+
if (typeof name !== "string")
|
|
130
|
+
throw new Error(`Invalid adapter project extends: ${file}`);
|
|
131
|
+
pending.push(createRequire(file).resolve(name));
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
return [...visited];
|
|
135
|
+
},
|
|
136
|
+
/**
|
|
137
|
+
* Calculates actual emitted paths, including a separate declaration directory.
|
|
138
|
+
*
|
|
139
|
+
* @param project Effective application project configuration.
|
|
140
|
+
* @param bootstrap Generated TypeScript bootstrap source.
|
|
141
|
+
* @returns Emitted JavaScript and declaration adapter paths.
|
|
142
|
+
*/
|
|
143
|
+
paths(project, bootstrap) {
|
|
144
|
+
const config = ts.readConfigFile(project, (path) => ts.sys.readFile(path));
|
|
145
|
+
if (config.error !== undefined)
|
|
146
|
+
throw new Error(`Cannot read adapter project: ${project}`);
|
|
147
|
+
const parsed = ts.parseJsonConfigFileContent(config.config, ts.sys, dirname(project), undefined, project);
|
|
148
|
+
if (parsed.errors.some((error) => error.code !== 18003))
|
|
149
|
+
throw new Error(`Invalid adapter project: ${project}`);
|
|
150
|
+
const command = { ...parsed, fileNames: [...parsed.fileNames, bootstrap] };
|
|
151
|
+
const emitted = ts.getOutputFileNames(command, bootstrap, !ts.sys.useCaseSensitiveFileNames);
|
|
152
|
+
const js = emitted.find((path) => path.endsWith(".js"));
|
|
153
|
+
if (js === undefined)
|
|
154
|
+
throw new Error(`No JavaScript bootstrap output: ${project}`);
|
|
155
|
+
const dts = emitted.find((path) => path.endsWith(".d.ts")) ?? js.replace(/\.js$/u, ".d.ts");
|
|
156
|
+
return {
|
|
157
|
+
runtime: MetadataOutput.confine(dirname(project), join(dirname(js), "spine-dependencies.js")),
|
|
158
|
+
declarations: MetadataOutput.confine(dirname(project), join(dirname(dts), "spine-dependencies.d.ts")),
|
|
159
|
+
};
|
|
160
|
+
},
|
|
161
|
+
/**
|
|
162
|
+
* Adds sibling JavaScript and declaration adapters to the source output.
|
|
163
|
+
*
|
|
164
|
+
* @param directory Generated source directory.
|
|
165
|
+
* @param source Rendered JavaScript and declarations.
|
|
166
|
+
* @returns Two source adapter files.
|
|
167
|
+
*/
|
|
168
|
+
pair(directory, source) {
|
|
169
|
+
return [
|
|
170
|
+
{ file: join(directory, "spine-dependencies.js"), source: source.runtime },
|
|
171
|
+
{ file: join(directory, "spine-dependencies.d.ts"), source: source.declarations },
|
|
172
|
+
];
|
|
173
|
+
},
|
|
174
|
+
/**
|
|
175
|
+
* Records confined emitted payloads and dependency fingerprints for clean restoration.
|
|
176
|
+
*
|
|
177
|
+
* @param appRoot Application package root.
|
|
178
|
+
* @param project Effective TypeScript project configuration.
|
|
179
|
+
* @param sourceDirectory Generated source directory.
|
|
180
|
+
* @param runtime Emitted adapter payloads.
|
|
181
|
+
* @param dependencies Selected public package exports.
|
|
182
|
+
* @returns Generated restoration record.
|
|
183
|
+
*/
|
|
184
|
+
record(appRoot, project, sourceDirectory, runtime, dependencies) {
|
|
185
|
+
const canonicalRoot = realpathSync(appRoot);
|
|
186
|
+
const payload = {
|
|
187
|
+
formatVersion: 2,
|
|
188
|
+
inputs: MetadataOutput.fingerprintInputs(appRoot, project, dependencies),
|
|
189
|
+
edges: dependencies.edges.map(({ requester, name, resolved }) => ({
|
|
190
|
+
requester: relative(canonicalRoot, requester) || ".",
|
|
191
|
+
name,
|
|
192
|
+
resolved: resolved === null ? null : relative(canonicalRoot, resolved),
|
|
193
|
+
})),
|
|
194
|
+
runtime: runtime.map(({ file, source }) => ({ path: relative(appRoot, file), source })),
|
|
195
|
+
};
|
|
196
|
+
return {
|
|
197
|
+
file: join(sourceDirectory, "spine-dependencies.json"),
|
|
198
|
+
source: `${JSON.stringify(payload, null, 2)}\n`,
|
|
199
|
+
};
|
|
200
|
+
},
|
|
201
|
+
/**
|
|
202
|
+
* Records staged-source fingerprints at published paths and installed-export fingerprints at emitted paths.
|
|
203
|
+
*
|
|
204
|
+
* @param appRoot Application package root used for stable relative paths.
|
|
205
|
+
* @param project Effective TypeScript project configuration.
|
|
206
|
+
* @param dependencies Selected metadata packages and their staged sources.
|
|
207
|
+
* @returns Paths and hashes that invalidate the restoration record when inputs change.
|
|
208
|
+
*/
|
|
209
|
+
fingerprintInputs(appRoot, project, dependencies) {
|
|
210
|
+
const staged = new Map(dependencies.flatMap(({ publishedSourceFile, stagedSourceFile }) => publishedSourceFile !== undefined && stagedSourceFile !== undefined
|
|
211
|
+
? [[publishedSourceFile, stagedSourceFile]]
|
|
212
|
+
: []));
|
|
213
|
+
return MetadataOutput.inputFiles(appRoot, project, dependencies)
|
|
214
|
+
.map((file) => ({ file, source: staged.get(file) ?? file }))
|
|
215
|
+
.filter(({ source }) => existsSync(source))
|
|
216
|
+
.map(({ file, source }) => ({
|
|
217
|
+
path: relative(appRoot, file),
|
|
218
|
+
hash: MetadataOutput.hash(readFileSync(source)),
|
|
219
|
+
}));
|
|
220
|
+
},
|
|
221
|
+
/**
|
|
222
|
+
* Collects all manifests, compiler configs, and selected published exports.
|
|
223
|
+
*
|
|
224
|
+
* @param appRoot Application package root.
|
|
225
|
+
* @param project Effective TypeScript project configuration.
|
|
226
|
+
* @param dependencies Resolved runtime graph and participating packages.
|
|
227
|
+
* @returns Files whose bytes determine the adapter output.
|
|
228
|
+
*/
|
|
229
|
+
inputFiles(appRoot, project, dependencies) {
|
|
230
|
+
return [
|
|
231
|
+
join(appRoot, "package.json"),
|
|
232
|
+
...MetadataOutput.configurationFiles(project),
|
|
233
|
+
...dependencies.edges.flatMap((edge) => edge.resolved === null ? [] : [join(edge.resolved, "package.json")]),
|
|
234
|
+
...dependencies.flatMap(({ root, runtimeFile, typesFile, publishedSourceFile }) => publishedSourceFile === undefined
|
|
235
|
+
? [join(root, "package.json"), runtimeFile, typesFile]
|
|
236
|
+
: [join(root, "package.json"), publishedSourceFile]),
|
|
237
|
+
];
|
|
238
|
+
},
|
|
239
|
+
/**
|
|
240
|
+
* Validates that generated adapter destinations remain in the application package.
|
|
241
|
+
*
|
|
242
|
+
* @param root Application package root.
|
|
243
|
+
* @param file Proposed emitted adapter path.
|
|
244
|
+
* @returns Validated absolute path.
|
|
245
|
+
*/
|
|
246
|
+
confine(root, file) {
|
|
247
|
+
const path = resolve(file);
|
|
248
|
+
const within = relative(root, path);
|
|
249
|
+
if (within.startsWith("..") || isAbsolute(within))
|
|
250
|
+
throw new Error(`Generated adapter output escapes application: ${path}`);
|
|
251
|
+
return path;
|
|
252
|
+
},
|
|
253
|
+
/**
|
|
254
|
+
* Returns a stable fingerprint for a dependency manifest or selected export.
|
|
255
|
+
*
|
|
256
|
+
* @param bytes Exact published input bytes.
|
|
257
|
+
* @returns Stable SHA-256 digest.
|
|
258
|
+
*/
|
|
259
|
+
hash(bytes) {
|
|
260
|
+
return createHash("sha256").update(bytes).digest("hex");
|
|
261
|
+
},
|
|
262
|
+
};
|
|
263
|
+
//# sourceMappingURL=runtime-metadata-assets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-metadata-assets.js","sourceRoot":"","sources":["../../../src/generation/runtime-metadata-assets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,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AC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CACrC,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC,CACpE;YACD,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,mBAAmB,EAAE,EAAE,EAAE,CAChF,mBAAmB,KAAK,SAAS;gBAC/B,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,cAAc,CAAC,EAAE,WAAW,EAAE,SAAS,CAAC;gBACtD,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,cAAc,CAAC,EAAE,mBAAmB,CAAC,CACtD;SACF,CAAC;IACJ,CAAC;IAED;;;;;;OAMG;IACH,OAAO,CAAC,IAAY,EAAE,IAAY;QAChC,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;QAC3B,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACpC,IAAI,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,MAAM,CAAC;YAC/C,MAAM,IAAI,KAAK,CAAC,iDAAiD,IAAI,EAAE,CAAC,CAAC;QAC3E,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;OAKG;IACH,IAAI,CAAC,KAAiB;QACpB,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC1D,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An installed package that publishes passive Spine metadata.
|
|
3
|
+
*/
|
|
4
|
+
export interface RuntimeMetadataPackage {
|
|
5
|
+
/**
|
|
6
|
+
* Published package label used for registration and diagnostics.
|
|
7
|
+
*/
|
|
8
|
+
readonly name: string;
|
|
9
|
+
/**
|
|
10
|
+
* Resolved package version.
|
|
11
|
+
*/
|
|
12
|
+
readonly version: string;
|
|
13
|
+
/**
|
|
14
|
+
* Canonical installed package location used for diamond deduplication.
|
|
15
|
+
*/
|
|
16
|
+
readonly root: string;
|
|
17
|
+
/**
|
|
18
|
+
* JavaScript target imported by the generated dependency adapter.
|
|
19
|
+
*/
|
|
20
|
+
readonly runtimeFile: string;
|
|
21
|
+
/**
|
|
22
|
+
* Declaration target imported by the generated dependency adapter.
|
|
23
|
+
*/
|
|
24
|
+
readonly typesFile: string;
|
|
25
|
+
/**
|
|
26
|
+
* Metadata source generated in the current transaction, when present.
|
|
27
|
+
*/
|
|
28
|
+
readonly stagedSourceFile?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Stable path published for the staged metadata source.
|
|
31
|
+
*/
|
|
32
|
+
readonly publishedSourceFile?: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* A declared runtime dependency and its resolved installation, if present.
|
|
36
|
+
*/
|
|
37
|
+
export interface RuntimeMetadataEdge {
|
|
38
|
+
/**
|
|
39
|
+
* Declared package name.
|
|
40
|
+
*/
|
|
41
|
+
readonly name: string;
|
|
42
|
+
/**
|
|
43
|
+
* Package root from which Node resolves this dependency.
|
|
44
|
+
*/
|
|
45
|
+
readonly requester: string;
|
|
46
|
+
/**
|
|
47
|
+
* Canonical installed root or null for an absent optional dependency.
|
|
48
|
+
*/
|
|
49
|
+
readonly resolved: string | null;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Participating metadata plus every traversed runtime dependency edge.
|
|
53
|
+
*/
|
|
54
|
+
export interface RuntimeMetadataDiscovery extends ReadonlyArray<RuntimeMetadataPackage> {
|
|
55
|
+
/**
|
|
56
|
+
* Edges used to detect stale generated adapters after installation changes.
|
|
57
|
+
*/
|
|
58
|
+
readonly edges: readonly RuntimeMetadataEdge[];
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Metadata adapter emitted earlier in the current generation transaction.
|
|
62
|
+
*/
|
|
63
|
+
interface StagedMetadata {
|
|
64
|
+
readonly packageName: string;
|
|
65
|
+
readonly staged: string;
|
|
66
|
+
readonly moduleRoot?: string;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Resolves passive metadata participants from declared runtime dependencies.
|
|
70
|
+
*/
|
|
71
|
+
export declare const RuntimeMetadataGraph: Readonly<{
|
|
72
|
+
/**
|
|
73
|
+
* Discovers metadata participants and dependency edges from a package root.
|
|
74
|
+
*/
|
|
75
|
+
resolve(applicationRoot: string, staged?: readonly StagedMetadata[], format?: "import" | "require"): RuntimeMetadataDiscovery;
|
|
76
|
+
/**
|
|
77
|
+
* Selects the Node module condition used by this application package.
|
|
78
|
+
*/
|
|
79
|
+
format(applicationRoot: string): "import" | "require";
|
|
80
|
+
}>;
|
|
81
|
+
export {};
|
|
82
|
+
//# sourceMappingURL=runtime-metadata-graph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-metadata-graph.d.ts","sourceRoot":"","sources":["../../../src/generation/runtime-metadata-graph.ts"],"names":[],"mappings":"AAmBA;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAE7B;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAEnC;;OAEG;IACH,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC;CACvC;AAED;;GAEG;AACH,MAAM,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