@skmtc/core 0.55.1 → 0.56.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/esm/context/CoreContext.d.ts +20 -1
- package/esm/context/CoreContext.js +48 -5
- package/esm/context/GenerateContext.d.ts +12 -3
- package/esm/context/GenerateContext.js +154 -28
- package/esm/context/RenderContext.js +1 -35
- package/esm/context/generateTypes.d.ts +3 -3
- package/esm/context/renderFile.d.ts +52 -0
- package/esm/context/renderFile.js +35 -0
- package/esm/run/toArtifacts.d.ts +20 -1
- package/esm/run/toArtifacts.js +3 -2
- package/package.json +1 -1
- package/script/context/CoreContext.d.ts +20 -1
- package/script/context/CoreContext.js +48 -5
- package/script/context/GenerateContext.d.ts +12 -3
- package/script/context/GenerateContext.js +153 -27
- package/script/context/RenderContext.js +2 -36
- package/script/context/generateTypes.d.ts +3 -3
- package/script/context/renderFile.d.ts +52 -0
- package/script/context/renderFile.js +39 -0
- package/script/run/toArtifacts.d.ts +20 -1
- package/script/run/toArtifacts.js +3 -2
|
@@ -109,6 +109,25 @@ export type ToArtifactsArgs = {
|
|
|
109
109
|
* is otherwise untouched.
|
|
110
110
|
*/
|
|
111
111
|
inspect?: boolean;
|
|
112
|
+
/**
|
|
113
|
+
* Called with each file of the run when the file is complete: its path, as
|
|
114
|
+
* a key of `artifacts`, and its text. The run then keeps no file's text,
|
|
115
|
+
* and `artifacts` of the result is empty; `manifest.files` has every file.
|
|
116
|
+
*
|
|
117
|
+
* For an OpenAPI document the run gives a file as soon as no subject left
|
|
118
|
+
* to run can write to it or read from it, so that a host can write it and
|
|
119
|
+
* the run can let it go. That run goes subject by subject, and writes the
|
|
120
|
+
* same files. A file can have its definitions in another order when more
|
|
121
|
+
* than one generator inserts into it, as when an operation generator that
|
|
122
|
+
* the config lists before a model generator inserts that generator's
|
|
123
|
+
* projection: each subject runs every generator before the next subject
|
|
124
|
+
* runs, and the models run first. A run with `attribution.postPass` or
|
|
125
|
+
* `inspect`, or of a GraphQL document, gives every file at the end.
|
|
126
|
+
*
|
|
127
|
+
* A run that fails has no files. What it gave before it failed, the host
|
|
128
|
+
* must drop. After the first subject that fails it gives no more.
|
|
129
|
+
*/
|
|
130
|
+
onArtifact?: (path: string, content: string) => void;
|
|
112
131
|
};
|
|
113
132
|
/**
|
|
114
133
|
* The main orchestration class for the SKMTC transformation pipeline.
|
|
@@ -291,7 +310,7 @@ export declare class CoreContext {
|
|
|
291
310
|
*
|
|
292
311
|
* @throws Will throw an error if any phase of the pipeline fails
|
|
293
312
|
*/
|
|
294
|
-
toArtifacts({ document, settings, toGeneratorConfigMap, stackTrail, attribution, inspect }: ToArtifactsArgs): ToArtifactsResult;
|
|
313
|
+
toArtifacts({ document, settings, toGeneratorConfigMap, stackTrail, attribution, inspect, onArtifact }: ToArtifactsArgs): ToArtifactsResult;
|
|
295
314
|
/**
|
|
296
315
|
* Capability-only sibling of {@link toArtifacts}: parse the document, then
|
|
297
316
|
* evaluate each generator's `isSupported` over its subjects — no transform,
|
|
@@ -13,6 +13,7 @@ var _CoreContext_instances, _CoreContext_phase, _CoreContext_results, _CoreConte
|
|
|
13
13
|
import { GenerateContext } from './GenerateContext.js';
|
|
14
14
|
import { toInspection } from '../run/toInspection.js';
|
|
15
15
|
import { RenderContext } from './RenderContext.js';
|
|
16
|
+
import { renderFile } from './renderFile.js';
|
|
16
17
|
import { ParseContext } from './ParseContext.js';
|
|
17
18
|
import * as log from '../deps/jsr.io/@std/log/0.224.14/mod.js';
|
|
18
19
|
import { LogLevels } from '../deps/jsr.io/@std/log/0.224.14/levels.js';
|
|
@@ -297,7 +298,7 @@ export class CoreContext {
|
|
|
297
298
|
*
|
|
298
299
|
* @throws Will throw an error if any phase of the pipeline fails
|
|
299
300
|
*/
|
|
300
|
-
toArtifacts({ document, settings, toGeneratorConfigMap, stackTrail, attribution, inspect }) {
|
|
301
|
+
toArtifacts({ document, settings, toGeneratorConfigMap, stackTrail, attribution, inspect, onArtifact }) {
|
|
301
302
|
const runStartedAt = performance.now();
|
|
302
303
|
try {
|
|
303
304
|
// Parse phase: one unified ParseContext handles both protocols
|
|
@@ -321,6 +322,9 @@ export class CoreContext {
|
|
|
321
322
|
const captureChannel = attribution?.postPass
|
|
322
323
|
? { sink: undefined }
|
|
323
324
|
: undefined;
|
|
325
|
+
// The files a run with `onArtifact` gave before the render phase, as `files` of the result has them.
|
|
326
|
+
const givenFiles = {};
|
|
327
|
+
let givenBytes = 0;
|
|
324
328
|
const { files, previews, inspection, enrichmentWarnings } = stackTrail.trace('generate', st => {
|
|
325
329
|
__classPrivateFieldSet(this, _CoreContext_phaseName, 'generate', "f");
|
|
326
330
|
const generatePhase = __classPrivateFieldGet(this, _CoreContext_instances, "m", _CoreContext_setupGeneratePhase).call(this, {
|
|
@@ -330,7 +334,35 @@ export class CoreContext {
|
|
|
330
334
|
captureChannel
|
|
331
335
|
});
|
|
332
336
|
__classPrivateFieldSet(this, _CoreContext_phase, generatePhase, "f");
|
|
333
|
-
|
|
337
|
+
// A capturing render and an inspection read every file at the end
|
|
338
|
+
// of the run, so such a run gives no file before then.
|
|
339
|
+
const givesFilesEarly = onArtifact !== undefined && !attribution?.postPass && !inspect;
|
|
340
|
+
const generated = generatePhase.context.toArtifacts(st, givesFilesEarly
|
|
341
|
+
? {
|
|
342
|
+
reach: phase.context.toReach(),
|
|
343
|
+
onFile: (path, file) => {
|
|
344
|
+
// A file that is complete is rendered now, as the render
|
|
345
|
+
// phase renders the others, with its result at the same place.
|
|
346
|
+
__classPrivateFieldSet(this, _CoreContext_phaseName, 'render', "f");
|
|
347
|
+
const rendered = renderFile({
|
|
348
|
+
content: file.toString(),
|
|
349
|
+
destinationPath: path,
|
|
350
|
+
basePath: settings?.basePath
|
|
351
|
+
});
|
|
352
|
+
onArtifact(rendered.path, rendered.content);
|
|
353
|
+
if (__classPrivateFieldGet(this, _CoreContext_logsPhaseLines, "f")) {
|
|
354
|
+
givenBytes += toByteCount({ [rendered.path]: rendered.content });
|
|
355
|
+
}
|
|
356
|
+
givenFiles[rendered.path] = {
|
|
357
|
+
destinationPath: rendered.destinationPath,
|
|
358
|
+
lines: rendered.lines,
|
|
359
|
+
characters: rendered.characters
|
|
360
|
+
};
|
|
361
|
+
this.captureCurrentResult('success', stackTrail.clone().append(['render', path]));
|
|
362
|
+
__classPrivateFieldSet(this, _CoreContext_phaseName, 'generate', "f");
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
: undefined);
|
|
334
366
|
__classPrivateFieldSet(this, _CoreContext_enrichmentWarnings, generated.enrichmentWarnings, "f");
|
|
335
367
|
// Opt-in snapshot of the live files graph, taken after generate populates
|
|
336
368
|
// it and before render replaces the phase. Off unless `inspect` is set.
|
|
@@ -358,15 +390,26 @@ export class CoreContext {
|
|
|
358
390
|
return __classPrivateFieldGet(this, _CoreContext_phase, "f").context.render(st);
|
|
359
391
|
});
|
|
360
392
|
if (__classPrivateFieldGet(this, _CoreContext_logsPhaseLines, "f")) {
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
393
|
+
// The render line counts what the render phase rendered. The run's
|
|
394
|
+
// line counts every file, also those given before that phase.
|
|
395
|
+
const renderedFiles = Object.keys(renderOutput.artifacts).length;
|
|
396
|
+
const renderedBytes = toByteCount(renderOutput.artifacts);
|
|
397
|
+
const fileCount = toCountPhrase(renderedFiles + Object.keys(givenFiles).length, 'file');
|
|
398
|
+
const byteCount = toCountPhrase(renderedBytes + givenBytes, 'byte');
|
|
399
|
+
this.logger.info(`render: ${toCountPhrase(renderedFiles, 'file')}, ${toCountPhrase(renderedBytes, 'byte')}, ` +
|
|
400
|
+
`${toElapsedMs(renderStartedAt)} ms`);
|
|
364
401
|
this.logger.info(`toArtifacts: ${toCountPhrase(Object.keys(toGeneratorConfigMap()).length, 'generator')}, ` +
|
|
365
402
|
`${fileCount}, ${byteCount}, ${toIssueCounts(phase.context.issues)}, ` +
|
|
366
403
|
`${toElapsedMs(runStartedAt)} ms`);
|
|
367
404
|
}
|
|
405
|
+
if (onArtifact !== undefined) {
|
|
406
|
+
Object.entries(renderOutput.artifacts).forEach(([path, content]) => onArtifact(path, content));
|
|
407
|
+
}
|
|
368
408
|
return {
|
|
369
409
|
...renderOutput,
|
|
410
|
+
...(onArtifact !== undefined
|
|
411
|
+
? { artifacts: {}, files: { ...givenFiles, ...renderOutput.files } }
|
|
412
|
+
: {}),
|
|
370
413
|
results: __classPrivateFieldGet(this, _CoreContext_results, "f").toTree(),
|
|
371
414
|
parseIssues: phase.context.issues,
|
|
372
415
|
enrichmentWarnings,
|
|
@@ -57,6 +57,13 @@ type ConstructorArgs = {
|
|
|
57
57
|
*/
|
|
58
58
|
logsGeneratorLines?: boolean;
|
|
59
59
|
};
|
|
60
|
+
/** What a run needs to give each file to its host when the file is complete. */
|
|
61
|
+
type FileRelease = {
|
|
62
|
+
/** What each subject of the document reaches, from the parse of it. */
|
|
63
|
+
reach: Reach;
|
|
64
|
+
/** Called with a file when no subject left to run holds it. The context then lets the file go. */
|
|
65
|
+
onFile: (path: WorkspacePath, file: FileBase) => void;
|
|
66
|
+
};
|
|
60
67
|
type ToFilePlanArgs = {
|
|
61
68
|
/** The subjects of the run, of each kind. */
|
|
62
69
|
subjects: readonly PlannedSubject[];
|
|
@@ -204,7 +211,7 @@ export declare class GenerateContext implements GenerateContextType {
|
|
|
204
211
|
/**
|
|
205
212
|
* @internal
|
|
206
213
|
*/
|
|
207
|
-
toArtifacts(stackTrail: StackTrail): GenerateResult;
|
|
214
|
+
toArtifacts(stackTrail: StackTrail, release?: FileRelease): GenerateResult;
|
|
208
215
|
/**
|
|
209
216
|
* @internal
|
|
210
217
|
* The file plan of a run of this context: which of `subjects` hold each
|
|
@@ -241,7 +248,8 @@ export declare class GenerateContext implements GenerateContextType {
|
|
|
241
248
|
toEnrichmentDefaults(): EnrichmentDefaults;
|
|
242
249
|
/**
|
|
243
250
|
* Look up an already-registered file by path, or `undefined` if none
|
|
244
|
-
* exists.
|
|
251
|
+
* exists. In a run with `onArtifact`, a lookup of a file that was given
|
|
252
|
+
* to the host throws. Neutral primitive: returns the abstract `FileBase` and never
|
|
245
253
|
* constructs anything, so a (future) language-owned `register` can ask
|
|
246
254
|
* "does this file exist yet?" without the engine knowing the language.
|
|
247
255
|
* To create on a miss, add a file your language constructs with
|
|
@@ -259,7 +267,8 @@ export declare class GenerateContext implements GenerateContextType {
|
|
|
259
267
|
getFileByWorkspacePath(path: WorkspacePath): FileBase | undefined;
|
|
260
268
|
/**
|
|
261
269
|
* Read-only view of every file generated so far, keyed by (normalized)
|
|
262
|
-
* export path.
|
|
270
|
+
* export path. In a run with `onArtifact` it does not have the files that
|
|
271
|
+
* were given to the host. An **inspection / tooling** seam — NOT a coordination
|
|
263
272
|
* surface: generators must still register via `register` / `insert*`, and
|
|
264
273
|
* the storage stays `#`-private so nothing outside can mutate or re-bind it.
|
|
265
274
|
*
|
|
@@ -9,12 +9,12 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
9
9
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
10
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
11
|
};
|
|
12
|
-
var _GenerateContext_instances, _GenerateContext_files, _GenerateContext_failedItems, _GenerateContext_foldedPaths, _GenerateContext_previews, _GenerateContext_captureChannel, _GenerateContext_enrichmentAudit, _GenerateContext_currentSubjectTrail, _GenerateContext_logsGeneratorLines, _GenerateContext_subjectCounts, _GenerateContext_reportSkippedEnrichment, _GenerateContext_logError, _GenerateContext_failItem, _GenerateContext_captureSubjectResult, _GenerateContext_logGeneratorLine, _GenerateContext_runGenerator, _GenerateContext_schemaRefNames, _GenerateContext_subjectDefaults, _GenerateContext_runSubjects, _GenerateContext_addPreview, _GenerateContext_toContentSettingsExportPath, _GenerateContext_ejectedBySuffixedPath_get, _GenerateContext_ejectedBySuffixedPathCache, _GenerateContext_findContainer, _GenerateContext_toContainer;
|
|
12
|
+
var _GenerateContext_instances, _GenerateContext_files, _GenerateContext_failedItems, _GenerateContext_foldedPaths, _GenerateContext_released, _GenerateContext_previews, _GenerateContext_captureChannel, _GenerateContext_enrichmentAudit, _GenerateContext_currentSubjectTrail, _GenerateContext_logsGeneratorLines, _GenerateContext_subjectCounts, _GenerateContext_reportSkippedEnrichment, _GenerateContext_logError, _GenerateContext_failItem, _GenerateContext_captureSubjectResult, _GenerateContext_runByGenerator, _GenerateContext_runBySubject, _GenerateContext_toGeneratorRuns, _GenerateContext_toSteps, _GenerateContext_release, _GenerateContext_affirmNotReleased, _GenerateContext_logGeneratorLine, _GenerateContext_runGenerator, _GenerateContext_schemaRefNames, _GenerateContext_subjectDefaults, _GenerateContext_runSubjects, _GenerateContext_addPreview, _GenerateContext_toContentSettingsExportPath, _GenerateContext_ejectedBySuffixedPath_get, _GenerateContext_ejectedBySuffixedPathCache, _GenerateContext_findContainer, _GenerateContext_toContainer;
|
|
13
13
|
import { applyGeneratedSuffixToWorkspacePath, normalizeWorkspacePath } from '../helpers/normalizeWorkspacePath.js';
|
|
14
14
|
import { getByWorkspacePath } from '../helpers/getByWorkspacePath.js';
|
|
15
15
|
import { DEFAULT_GENERATED_SUFFIX } from '../helpers/applyGeneratedSuffix.js';
|
|
16
16
|
import { DanglingRefError } from '../oas/ref/DanglingRefError.js';
|
|
17
|
-
import { isDefaultRefPath, isRemoteRefPath, toModelKey, toRefPointer, toSchemaComponentRef } from '../helpers/refFns.js';
|
|
17
|
+
import { isDefaultRefPath, fromModelKey, isRemoteRefPath, toModelKey, toRefPointer, toSchemaComponentRef } from '../helpers/refFns.js';
|
|
18
18
|
import { isMethod } from '../types/Method.js';
|
|
19
19
|
import { OasOperationDriver } from '../dsl/operation/oas/OasOperationDriver.js';
|
|
20
20
|
import { WebhookDriver } from '../dsl/webhook/WebhookDriver.js';
|
|
@@ -113,7 +113,11 @@ export class GenerateContext {
|
|
|
113
113
|
/** Each file's path folded (case, Unicode form) → the path: a file system that ignores case sees one file. */
|
|
114
114
|
);
|
|
115
115
|
/** Each file's path folded (case, Unicode form) → the path: a file system that ignores case sees one file. */
|
|
116
|
-
_GenerateContext_foldedPaths.set(this, new Map()
|
|
116
|
+
_GenerateContext_foldedPaths.set(this, new Map()
|
|
117
|
+
/** The paths of the files that were given to the host and let go. */
|
|
118
|
+
);
|
|
119
|
+
/** The paths of the files that were given to the host and let go. */
|
|
120
|
+
_GenerateContext_released.set(this, new Set());
|
|
117
121
|
_GenerateContext_previews.set(this, void 0);
|
|
118
122
|
/**
|
|
119
123
|
* Parsed source document, wrapped in the {@link SkmtcParsedDocument}
|
|
@@ -254,27 +258,18 @@ export class GenerateContext {
|
|
|
254
258
|
/**
|
|
255
259
|
* @internal
|
|
256
260
|
*/
|
|
257
|
-
toArtifacts(stackTrail) {
|
|
261
|
+
toArtifacts(stackTrail, release) {
|
|
258
262
|
const generators = Object.values(this.toGeneratorConfigMap());
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
__classPrivateFieldSet(this, _GenerateContext_subjectCounts, { offered: 0, transformed: 0, failed: 0 }, "f");
|
|
270
|
-
__classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_runGenerator).call(this, generatorConfig, st);
|
|
271
|
-
const { offered, transformed, failed } = __classPrivateFieldGet(this, _GenerateContext_subjectCounts, "f");
|
|
272
|
-
const fileCount = __classPrivateFieldGet(this, _GenerateContext_files, "f").size - fileCountBefore;
|
|
273
|
-
const milliseconds = Math.round(performance.now() - startedAt);
|
|
274
|
-
__classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_logGeneratorLine).call(this, st, `${generatorConfig.id}: ${transformed} of ${toCountPhrase(offered, toSubjectNoun(generatorConfig))}, ` +
|
|
275
|
-
`${failed} failed, ${toCountPhrase(fileCount, 'file')}, ${milliseconds} ms`);
|
|
276
|
-
});
|
|
277
|
-
});
|
|
263
|
+
// A run that gives each file when it is complete goes subject by
|
|
264
|
+
// subject. Any other run goes generator by generator. Both write the
|
|
265
|
+
// same files; a file that more than one generator inserts into can have
|
|
266
|
+
// its definitions in another order.
|
|
267
|
+
if (release !== undefined && this.document.type === 'oas') {
|
|
268
|
+
__classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_runBySubject).call(this, this.document.value, generators, stackTrail, release);
|
|
269
|
+
}
|
|
270
|
+
else {
|
|
271
|
+
__classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_runByGenerator).call(this, generators, stackTrail);
|
|
272
|
+
}
|
|
278
273
|
// Post-walk consumption audit: every enrichment lookup above was
|
|
279
274
|
// recorded; configured paths no lookup touched are dead config —
|
|
280
275
|
// typo'd ids / paths / methods / model names, or entries orphaned by
|
|
@@ -501,7 +496,8 @@ export class GenerateContext {
|
|
|
501
496
|
}
|
|
502
497
|
/**
|
|
503
498
|
* Look up an already-registered file by path, or `undefined` if none
|
|
504
|
-
* exists.
|
|
499
|
+
* exists. In a run with `onArtifact`, a lookup of a file that was given
|
|
500
|
+
* to the host throws. Neutral primitive: returns the abstract `FileBase` and never
|
|
505
501
|
* constructs anything, so a (future) language-owned `register` can ask
|
|
506
502
|
* "does this file exist yet?" without the engine knowing the language.
|
|
507
503
|
* To create on a miss, add a file your language constructs with
|
|
@@ -511,7 +507,11 @@ export class GenerateContext {
|
|
|
511
507
|
* key: a key is a normalized path. The file's own `path` is the key.
|
|
512
508
|
*/
|
|
513
509
|
getFile(filePath) {
|
|
514
|
-
|
|
510
|
+
const file = getByWorkspacePath(__classPrivateFieldGet(this, _GenerateContext_files, "f"), filePath);
|
|
511
|
+
if (file === undefined && __classPrivateFieldGet(this, _GenerateContext_released, "f").size > 0) {
|
|
512
|
+
__classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_affirmNotReleased).call(this, normalizeWorkspacePath(filePath));
|
|
513
|
+
}
|
|
514
|
+
return file;
|
|
515
515
|
}
|
|
516
516
|
/**
|
|
517
517
|
* The file whose normalized path is `path`, or `undefined`. A normalized
|
|
@@ -519,11 +519,16 @@ export class GenerateContext {
|
|
|
519
519
|
* {@link getFile}: there is no file there in any spelling.
|
|
520
520
|
*/
|
|
521
521
|
getFileByWorkspacePath(path) {
|
|
522
|
-
|
|
522
|
+
const file = __classPrivateFieldGet(this, _GenerateContext_files, "f").get(path);
|
|
523
|
+
if (file === undefined && __classPrivateFieldGet(this, _GenerateContext_released, "f").size > 0) {
|
|
524
|
+
__classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_affirmNotReleased).call(this, path);
|
|
525
|
+
}
|
|
526
|
+
return file;
|
|
523
527
|
}
|
|
524
528
|
/**
|
|
525
529
|
* Read-only view of every file generated so far, keyed by (normalized)
|
|
526
|
-
* export path.
|
|
530
|
+
* export path. In a run with `onArtifact` it does not have the files that
|
|
531
|
+
* were given to the host. An **inspection / tooling** seam — NOT a coordination
|
|
527
532
|
* surface: generators must still register via `register` / `insert*`, and
|
|
528
533
|
* the storage stays `#`-private so nothing outside can mutate or re-bind it.
|
|
529
534
|
*
|
|
@@ -548,6 +553,7 @@ export class GenerateContext {
|
|
|
548
553
|
if (__classPrivateFieldGet(this, _GenerateContext_files, "f").has(normalizedPath)) {
|
|
549
554
|
throw new Error(`File already exists: ${normalizedPath}`);
|
|
550
555
|
}
|
|
556
|
+
__classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_affirmNotReleased).call(this, normalizedPath);
|
|
551
557
|
// Two paths that differ only in case are one file on a file system that
|
|
552
558
|
// ignores case, as macOS's and Windows' do by default: writing the
|
|
553
559
|
// second would replace the first without a word.
|
|
@@ -928,7 +934,7 @@ export class GenerateContext {
|
|
|
928
934
|
return place?.findDefinitions({ name })?.[0];
|
|
929
935
|
}
|
|
930
936
|
}
|
|
931
|
-
_GenerateContext_files = new WeakMap(), _GenerateContext_failedItems = new WeakMap(), _GenerateContext_foldedPaths = new WeakMap(), _GenerateContext_previews = new WeakMap(), _GenerateContext_captureChannel = new WeakMap(), _GenerateContext_enrichmentAudit = new WeakMap(), _GenerateContext_currentSubjectTrail = new WeakMap(), _GenerateContext_logsGeneratorLines = new WeakMap(), _GenerateContext_subjectCounts = new WeakMap(), _GenerateContext_ejectedBySuffixedPathCache = new WeakMap(), _GenerateContext_instances = new WeakSet(), _GenerateContext_reportSkippedEnrichment = function _GenerateContext_reportSkippedEnrichment(block, variant, path) {
|
|
937
|
+
_GenerateContext_files = new WeakMap(), _GenerateContext_failedItems = new WeakMap(), _GenerateContext_foldedPaths = new WeakMap(), _GenerateContext_released = new WeakMap(), _GenerateContext_previews = new WeakMap(), _GenerateContext_captureChannel = new WeakMap(), _GenerateContext_enrichmentAudit = new WeakMap(), _GenerateContext_currentSubjectTrail = new WeakMap(), _GenerateContext_logsGeneratorLines = new WeakMap(), _GenerateContext_subjectCounts = new WeakMap(), _GenerateContext_ejectedBySuffixedPathCache = new WeakMap(), _GenerateContext_instances = new WeakSet(), _GenerateContext_reportSkippedEnrichment = function _GenerateContext_reportSkippedEnrichment(block, variant, path) {
|
|
932
938
|
if (!hasVariantEnrichment(block, variant))
|
|
933
939
|
return;
|
|
934
940
|
__classPrivateFieldGet(this, _GenerateContext_enrichmentAudit, "f").report({
|
|
@@ -953,6 +959,126 @@ _GenerateContext_files = new WeakMap(), _GenerateContext_failedItems = new WeakM
|
|
|
953
959
|
if (result === 'error') {
|
|
954
960
|
__classPrivateFieldGet(this, _GenerateContext_subjectCounts, "f").failed += 1;
|
|
955
961
|
}
|
|
962
|
+
}, _GenerateContext_runByGenerator = function _GenerateContext_runByGenerator(generators, stackTrail) {
|
|
963
|
+
generators.forEach(generatorConfig => {
|
|
964
|
+
stackTrail.trace(generatorConfig.id, st => {
|
|
965
|
+
// Whole-generator skip (string entry in `skip`). No per-operation
|
|
966
|
+
// `skipped` results emitted.
|
|
967
|
+
if (this.settings?.skip?.includes(generatorConfig.id)) {
|
|
968
|
+
__classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_logGeneratorLine).call(this, st, `${generatorConfig.id}: skipped by settings.skip`);
|
|
969
|
+
return;
|
|
970
|
+
}
|
|
971
|
+
const startedAt = performance.now();
|
|
972
|
+
const fileCountBefore = __classPrivateFieldGet(this, _GenerateContext_files, "f").size;
|
|
973
|
+
__classPrivateFieldSet(this, _GenerateContext_subjectCounts, { offered: 0, transformed: 0, failed: 0 }, "f");
|
|
974
|
+
__classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_runGenerator).call(this, generatorConfig, st);
|
|
975
|
+
const { offered, transformed, failed } = __classPrivateFieldGet(this, _GenerateContext_subjectCounts, "f");
|
|
976
|
+
const fileCount = __classPrivateFieldGet(this, _GenerateContext_files, "f").size - fileCountBefore;
|
|
977
|
+
const milliseconds = Math.round(performance.now() - startedAt);
|
|
978
|
+
__classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_logGeneratorLine).call(this, st, `${generatorConfig.id}: ${transformed} of ${toCountPhrase(offered, toSubjectNoun(generatorConfig))}, ` +
|
|
979
|
+
`${failed} failed, ${toCountPhrase(fileCount, 'file')}, ${milliseconds} ms`);
|
|
980
|
+
});
|
|
981
|
+
});
|
|
982
|
+
}, _GenerateContext_runBySubject = function _GenerateContext_runBySubject(oasDocument, generators, stackTrail, { reach, onFile }) {
|
|
983
|
+
const runs = __classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_toGeneratorRuns).call(this, generators, stackTrail);
|
|
984
|
+
const models = __classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_schemaRefNames).call(this).map(refName => new ModelSubject(toSchemaComponentRef(refName)));
|
|
985
|
+
const modelSteps = __classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_toSteps).call(this, models, runs.models);
|
|
986
|
+
const laterSteps = [
|
|
987
|
+
...__classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_toSteps).call(this, oasDocument.operations.map(operation => new OasOperationSubject(operation)), runs.operations),
|
|
988
|
+
...__classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_toSteps).call(this, oasDocument.webhooks.map(webhook => new WebhookSubject(webhook)), runs.webhooks)
|
|
989
|
+
];
|
|
990
|
+
const position = new Map(models.map((subject, index) => [toModelKey(subject.ref), index]));
|
|
991
|
+
// How many models a step waits for: each model up to the last one it can get to.
|
|
992
|
+
const toModelCount = ({ subject }) => subject
|
|
993
|
+
.toNamedModels(reach)
|
|
994
|
+
.flatMap(key => reach.ofModel(fromModelKey(key)))
|
|
995
|
+
.reduce((count, key) => Math.max(count, (position.get(key) ?? -1) + 1), 0);
|
|
996
|
+
// The operations stay in document order too, so a step waits for no fewer
|
|
997
|
+
// models than the step before it. A file that every operation adds to
|
|
998
|
+
// then has its entries in the order of the document.
|
|
999
|
+
const waitsFor = [];
|
|
1000
|
+
laterSteps.forEach(step => {
|
|
1001
|
+
waitsFor.push(Math.max(waitsFor.at(-1) ?? 0, toModelCount(step)));
|
|
1002
|
+
});
|
|
1003
|
+
const readyAfter = Map.groupBy(laterSteps, (_step, index) => waitsFor[index]);
|
|
1004
|
+
const steps = [
|
|
1005
|
+
...(readyAfter.get(0) ?? []),
|
|
1006
|
+
...modelSteps.flatMap((step, index) => [step, ...(readyAfter.get(index + 1) ?? [])])
|
|
1007
|
+
];
|
|
1008
|
+
const plan = this.toFilePlan({ subjects: steps.map(({ subject }) => subject), reach });
|
|
1009
|
+
steps.forEach(step => {
|
|
1010
|
+
step.run();
|
|
1011
|
+
// A run that has failed gives no more files: it will write nothing.
|
|
1012
|
+
const complete = plan.finish(step.subject);
|
|
1013
|
+
if (__classPrivateFieldGet(this, _GenerateContext_failedItems, "f").length === 0) {
|
|
1014
|
+
complete.forEach(path => __classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_release).call(this, path, onFile));
|
|
1015
|
+
}
|
|
1016
|
+
});
|
|
1017
|
+
[...runs.models, ...runs.operations, ...runs.webhooks].forEach(run => {
|
|
1018
|
+
__classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_logGeneratorLine).call(this, run.trail, `${run.entry.id}: ${run.counts.transformed} of ${toCountPhrase(run.counts.offered, toSubjectNoun(run.entry))}, ` +
|
|
1019
|
+
`${run.counts.failed} failed, ${toCountPhrase(run.files, 'file')}, ${Math.round(run.milliseconds)} ms`);
|
|
1020
|
+
});
|
|
1021
|
+
}, _GenerateContext_toGeneratorRuns = function _GenerateContext_toGeneratorRuns(generators, stackTrail) {
|
|
1022
|
+
const toRun = (entry, filters) => ({
|
|
1023
|
+
entry,
|
|
1024
|
+
trail: stackTrail.clone().append(entry.id),
|
|
1025
|
+
filters,
|
|
1026
|
+
counts: { offered: 0, transformed: 0, failed: 0 },
|
|
1027
|
+
milliseconds: 0,
|
|
1028
|
+
files: 0
|
|
1029
|
+
});
|
|
1030
|
+
const toFilter = (kind, id) => toGeneratorFilter(this.settings?.[kind], id);
|
|
1031
|
+
const toPathFilters = (id) => ({
|
|
1032
|
+
include: toIncludePaths(toFilter('include', id), id),
|
|
1033
|
+
skip: toSkipPaths(toFilter('skip', id), id)
|
|
1034
|
+
});
|
|
1035
|
+
const active = generators.filter(({ id }) => {
|
|
1036
|
+
const isSkipped = this.settings?.skip?.includes(id) ?? false;
|
|
1037
|
+
if (isSkipped) {
|
|
1038
|
+
__classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_logGeneratorLine).call(this, stackTrail.clone().append(id), `${id}: skipped by settings.skip`);
|
|
1039
|
+
}
|
|
1040
|
+
return !isSkipped;
|
|
1041
|
+
});
|
|
1042
|
+
return {
|
|
1043
|
+
models: active.flatMap(entry => entry.type === 'model'
|
|
1044
|
+
? [
|
|
1045
|
+
toRun(entry, {
|
|
1046
|
+
include: toIncludeModels(toFilter('include', entry.id), entry.id),
|
|
1047
|
+
skip: toSkipModels(toFilter('skip', entry.id), entry.id)
|
|
1048
|
+
})
|
|
1049
|
+
]
|
|
1050
|
+
: []),
|
|
1051
|
+
operations: active.flatMap(entry => entry.type === 'oasOperation' ? [toRun(entry, toPathFilters(entry.id))] : []),
|
|
1052
|
+
webhooks: active.flatMap(entry => (entry.type === 'webhook' ? [toRun(entry, toPathFilters(entry.id))] : []))
|
|
1053
|
+
};
|
|
1054
|
+
}, _GenerateContext_toSteps = function _GenerateContext_toSteps(subjects, runs) {
|
|
1055
|
+
return subjects.map(subject => ({
|
|
1056
|
+
subject,
|
|
1057
|
+
run: () => {
|
|
1058
|
+
runs.forEach(run => {
|
|
1059
|
+
const startedAt = performance.now();
|
|
1060
|
+
const fileCountBefore = __classPrivateFieldGet(this, _GenerateContext_files, "f").size;
|
|
1061
|
+
__classPrivateFieldSet(this, _GenerateContext_subjectCounts, run.counts, "f");
|
|
1062
|
+
__classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_runSubjects).call(this, run.entry, [subject], run.filters, run.trail);
|
|
1063
|
+
run.milliseconds += performance.now() - startedAt;
|
|
1064
|
+
run.files += __classPrivateFieldGet(this, _GenerateContext_files, "f").size - fileCountBefore;
|
|
1065
|
+
});
|
|
1066
|
+
}
|
|
1067
|
+
}));
|
|
1068
|
+
}, _GenerateContext_release = function _GenerateContext_release(path, onFile) {
|
|
1069
|
+
const file = __classPrivateFieldGet(this, _GenerateContext_files, "f").get(path);
|
|
1070
|
+
if (file === undefined) {
|
|
1071
|
+
return;
|
|
1072
|
+
}
|
|
1073
|
+
onFile(path, file);
|
|
1074
|
+
__classPrivateFieldGet(this, _GenerateContext_files, "f").delete(path);
|
|
1075
|
+
__classPrivateFieldGet(this, _GenerateContext_released, "f").add(path);
|
|
1076
|
+
}, _GenerateContext_affirmNotReleased = function _GenerateContext_affirmNotReleased(path) {
|
|
1077
|
+
if (__classPrivateFieldGet(this, _GenerateContext_released, "f").has(path)) {
|
|
1078
|
+
throw new Error(`File '${path}' was complete and given to the host before this subject used it. ` +
|
|
1079
|
+
`A generator inserts a projection that its entry does not list in 'projections', ` +
|
|
1080
|
+
`or inserts a model that this subject does not reach through '$ref's.`);
|
|
1081
|
+
}
|
|
956
1082
|
}, _GenerateContext_logGeneratorLine = function _GenerateContext_logGeneratorLine(generatorTrail, message) {
|
|
957
1083
|
if (!__classPrivateFieldGet(this, _GenerateContext_logsGeneratorLines, "f")) {
|
|
958
1084
|
return;
|
|
@@ -13,7 +13,7 @@ var _RenderContext_captureChannel, _RenderContext_capture;
|
|
|
13
13
|
import invariant from 'tiny-invariant';
|
|
14
14
|
import { getByWorkspacePath } from '../helpers/getByWorkspacePath.js';
|
|
15
15
|
import { normalizeWorkspacePath } from '../helpers/normalizeWorkspacePath.js';
|
|
16
|
-
import {
|
|
16
|
+
import { renderFile } from './renderFile.js';
|
|
17
17
|
import { CodeFileBase } from '../dsl/CodeFileBase.js';
|
|
18
18
|
import { CaptureSink } from '../anchors/CaptureSink.js';
|
|
19
19
|
import { postPass } from '../anchors/postPass.js';
|
|
@@ -321,37 +321,3 @@ const addSidecar = (capture, { artifactPath, filePath, source, spans }) => {
|
|
|
321
321
|
capture.generationMap.push(entry);
|
|
322
322
|
}
|
|
323
323
|
};
|
|
324
|
-
/**
|
|
325
|
-
* Renders a single file with metadata calculation.
|
|
326
|
-
*
|
|
327
|
-
* This function processes a single file through the rendering pipeline,
|
|
328
|
-
* calculating file metadata such as line count and character count. It
|
|
329
|
-
* resolves the final path using the base path configuration.
|
|
330
|
-
*
|
|
331
|
-
* @param args - File rendering arguments
|
|
332
|
-
* @returns A FileObject with content and metadata
|
|
333
|
-
*
|
|
334
|
-
* @example
|
|
335
|
-
* ```typescript
|
|
336
|
-
* const fileObject = renderFile({
|
|
337
|
-
* content: 'const x = 1;',
|
|
338
|
-
* destinationPath: 'utils.ts',
|
|
339
|
-
* basePath: './src'
|
|
340
|
-
* });
|
|
341
|
-
*
|
|
342
|
-
* console.log(fileObject.path); // './src/utils.ts'
|
|
343
|
-
* console.log(fileObject.content); // 'const x = 1;'
|
|
344
|
-
* console.log(fileObject.lines); // 1
|
|
345
|
-
* console.log(fileObject.characters); // 12
|
|
346
|
-
* ```
|
|
347
|
-
*/
|
|
348
|
-
const renderFile = ({ content, destinationPath, basePath }) => {
|
|
349
|
-
const path = toResolvedArtifactPath({ basePath, destinationPath });
|
|
350
|
-
return {
|
|
351
|
-
content: content,
|
|
352
|
-
path,
|
|
353
|
-
destinationPath,
|
|
354
|
-
lines: content.split('\n').length,
|
|
355
|
-
characters: content.length
|
|
356
|
-
};
|
|
357
|
-
};
|
|
@@ -475,11 +475,11 @@ export type GenerateContextType = {
|
|
|
475
475
|
registerJson: ({ destinationPath, json }: RegisterJsonArgs) => void;
|
|
476
476
|
registerMarkdown: ({ destinationPath, markdown }: RegisterMarkdownArgs) => void;
|
|
477
477
|
register: (args: ContextRegisterArgs) => void;
|
|
478
|
-
/** Look up an existing file by path (no creation); the neutral read primitive. */
|
|
478
|
+
/** Look up an existing file by path (no creation); the neutral read primitive. Throws for a file given to the host by `onArtifact`. */
|
|
479
479
|
getFile: (filePath: string) => FileBase | undefined;
|
|
480
|
-
/** Look up an existing file by its normalized path, which is its key: a miss is not normalized again. */
|
|
480
|
+
/** Look up an existing file by its normalized path, which is its key: a miss is not normalized again. Throws for a file given to the host by `onArtifact`. */
|
|
481
481
|
getFileByWorkspacePath: (path: WorkspacePath) => FileBase | undefined;
|
|
482
|
-
/** Read-only view of every file generated so far — an inspection/tooling seam (not coordination). */
|
|
482
|
+
/** Read-only view of every file generated so far, without those given to the host by `onArtifact` — an inspection/tooling seam (not coordination). */
|
|
483
483
|
inspectedFiles: ReadonlyMap<string, FileBase>;
|
|
484
484
|
/** Store a language-constructed file; the neutral write primitive. Returns the stored file. */
|
|
485
485
|
addFile: <File extends FileBase>(file: File) => File;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a rendered file with metadata.
|
|
3
|
+
*/
|
|
4
|
+
export type FileObject = {
|
|
5
|
+
/** The rendered file content */
|
|
6
|
+
content: string;
|
|
7
|
+
/** The original file path */
|
|
8
|
+
path: string;
|
|
9
|
+
/** The resolved destination path */
|
|
10
|
+
destinationPath: string;
|
|
11
|
+
/** Number of lines in the rendered content */
|
|
12
|
+
lines: number;
|
|
13
|
+
/** Number of characters in the rendered content */
|
|
14
|
+
characters: number;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Arguments for rendering a single file.
|
|
18
|
+
*/
|
|
19
|
+
type RenderFileArgs = {
|
|
20
|
+
/** The raw file content to render */
|
|
21
|
+
content: string;
|
|
22
|
+
/** The destination path for the file */
|
|
23
|
+
destinationPath: string;
|
|
24
|
+
/** Optional base path for path resolution */
|
|
25
|
+
basePath?: string;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Renders a single file with metadata calculation.
|
|
29
|
+
*
|
|
30
|
+
* This function processes a single file through the rendering pipeline,
|
|
31
|
+
* calculating file metadata such as line count and character count. It
|
|
32
|
+
* resolves the final path using the base path configuration.
|
|
33
|
+
*
|
|
34
|
+
* @param args - File rendering arguments
|
|
35
|
+
* @returns A FileObject with content and metadata
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```typescript
|
|
39
|
+
* const fileObject = renderFile({
|
|
40
|
+
* content: 'const x = 1;',
|
|
41
|
+
* destinationPath: 'utils.ts',
|
|
42
|
+
* basePath: './src'
|
|
43
|
+
* });
|
|
44
|
+
*
|
|
45
|
+
* console.log(fileObject.path); // './src/utils.ts'
|
|
46
|
+
* console.log(fileObject.content); // 'const x = 1;'
|
|
47
|
+
* console.log(fileObject.lines); // 1
|
|
48
|
+
* console.log(fileObject.characters); // 12
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
export declare const renderFile: ({ content, destinationPath, basePath }: RenderFileArgs) => FileObject;
|
|
52
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { toResolvedArtifactPath } from '../helpers/toResolvedArtifactPath.js';
|
|
2
|
+
/**
|
|
3
|
+
* Renders a single file with metadata calculation.
|
|
4
|
+
*
|
|
5
|
+
* This function processes a single file through the rendering pipeline,
|
|
6
|
+
* calculating file metadata such as line count and character count. It
|
|
7
|
+
* resolves the final path using the base path configuration.
|
|
8
|
+
*
|
|
9
|
+
* @param args - File rendering arguments
|
|
10
|
+
* @returns A FileObject with content and metadata
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* const fileObject = renderFile({
|
|
15
|
+
* content: 'const x = 1;',
|
|
16
|
+
* destinationPath: 'utils.ts',
|
|
17
|
+
* basePath: './src'
|
|
18
|
+
* });
|
|
19
|
+
*
|
|
20
|
+
* console.log(fileObject.path); // './src/utils.ts'
|
|
21
|
+
* console.log(fileObject.content); // 'const x = 1;'
|
|
22
|
+
* console.log(fileObject.lines); // 1
|
|
23
|
+
* console.log(fileObject.characters); // 12
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export const renderFile = ({ content, destinationPath, basePath }) => {
|
|
27
|
+
const path = toResolvedArtifactPath({ basePath, destinationPath });
|
|
28
|
+
return {
|
|
29
|
+
content: content,
|
|
30
|
+
path,
|
|
31
|
+
destinationPath,
|
|
32
|
+
lines: content.split('\n').length,
|
|
33
|
+
characters: content.length
|
|
34
|
+
};
|
|
35
|
+
};
|
package/esm/run/toArtifacts.d.ts
CHANGED
|
@@ -67,6 +67,25 @@ type TransformArgs = {
|
|
|
67
67
|
* the generate/render pipeline is unaffected.
|
|
68
68
|
*/
|
|
69
69
|
inspect?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Called with each file of the run when the file is complete: its path, as
|
|
72
|
+
* a key of `artifacts`, and its text. The run then keeps no file's text,
|
|
73
|
+
* and `artifacts` of the result is empty; `manifest.files` has every file.
|
|
74
|
+
*
|
|
75
|
+
* For an OpenAPI document the run gives a file as soon as no subject left
|
|
76
|
+
* to run can write to it or read from it, so that a host can write it and
|
|
77
|
+
* the run can let it go. That run goes subject by subject, and writes the
|
|
78
|
+
* same files. A file can have its definitions in another order when more
|
|
79
|
+
* than one generator inserts into it, as when an operation generator that
|
|
80
|
+
* the config lists before a model generator inserts that generator's
|
|
81
|
+
* projection: each subject runs every generator before the next subject
|
|
82
|
+
* runs, and the models run first. A run with `attribution.postPass` or
|
|
83
|
+
* `inspect`, or of a GraphQL document, gives every file at the end.
|
|
84
|
+
*
|
|
85
|
+
* A run that fails has no files. What it gave before it failed, the host
|
|
86
|
+
* must drop. After the first subject that fails it gives no more.
|
|
87
|
+
*/
|
|
88
|
+
onArtifact?: (path: string, content: string) => void;
|
|
70
89
|
};
|
|
71
90
|
/**
|
|
72
91
|
* Transforms an OpenAPI v3 document into generated code artifacts and metadata.
|
|
@@ -136,7 +155,7 @@ type TransformArgs = {
|
|
|
136
155
|
* }
|
|
137
156
|
* ```
|
|
138
157
|
*/
|
|
139
|
-
export declare const toArtifacts: ({ traceId, spanId, document, settings, toGeneratorConfigMap, logsPath, startAt, silent, logLevel, stackTrail, attribution, inspect }: TransformArgs) => {
|
|
158
|
+
export declare const toArtifacts: ({ traceId, spanId, document, settings, toGeneratorConfigMap, logsPath, startAt, silent, logLevel, stackTrail, attribution, inspect, onArtifact }: TransformArgs) => {
|
|
140
159
|
artifacts: Record<string, string>;
|
|
141
160
|
manifest: ManifestContent;
|
|
142
161
|
/** The run's log lines (see {@link LogLine}). Not part of the manifest. */
|
package/esm/run/toArtifacts.js
CHANGED
|
@@ -67,7 +67,7 @@ import { CoreContext } from '../context/CoreContext.js';
|
|
|
67
67
|
* }
|
|
68
68
|
* ```
|
|
69
69
|
*/
|
|
70
|
-
export const toArtifacts = ({ traceId, spanId, document, settings, toGeneratorConfigMap, logsPath, startAt, silent, logLevel, stackTrail, attribution, inspect }) => {
|
|
70
|
+
export const toArtifacts = ({ traceId, spanId, document, settings, toGeneratorConfigMap, logsPath, startAt, silent, logLevel, stackTrail, attribution, inspect, onArtifact }) => {
|
|
71
71
|
const context = new CoreContext({ spanId, logsPath, silent, logLevel });
|
|
72
72
|
const { artifacts, files, previews, results, parseIssues, enrichmentWarnings, sidecars, generationMap, inspection, logs } = context.toArtifacts({
|
|
73
73
|
settings,
|
|
@@ -76,7 +76,8 @@ export const toArtifacts = ({ traceId, spanId, document, settings, toGeneratorCo
|
|
|
76
76
|
stackTrail,
|
|
77
77
|
silent,
|
|
78
78
|
attribution,
|
|
79
|
-
inspect
|
|
79
|
+
inspect,
|
|
80
|
+
onArtifact
|
|
80
81
|
});
|
|
81
82
|
const manifest = {
|
|
82
83
|
files,
|