document-model 6.2.3-dev.90 → 6.2.3-dev.91
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/dist/catalog-6zzASEUv.js +358 -0
- package/dist/catalog-6zzASEUv.js.map +1 -0
- package/dist/catalog-B3nJD57s.d.ts +85 -0
- package/dist/catalog-B3nJD57s.d.ts.map +1 -0
- package/dist/index.d.ts +565 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4429 -2
- package/dist/index.js.map +1 -1
- package/dist/scalars.d.ts +2 -82
- package/dist/scalars.d.ts.map +1 -1
- package/dist/scalars.js +1 -354
- package/dist/scalars.js.map +1 -1
- package/dist/tooling.d.mts +121 -0
- package/dist/tooling.d.mts.map +1 -0
- package/dist/tooling.mjs +2655 -0
- package/dist/tooling.mjs.map +1 -0
- package/package.json +8 -3
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { DefinitionCheckReport, DefinitionCheckSkipReason, DefinitionDiagnostic, DefinitionPath, DefinitionSource, DocumentModelDefinition, DocumentModelModule, DocumentModelPHState, Sha256Digest, UpgradeManifest } from "@powerhousedao/shared/document-model";
|
|
2
|
+
//#region src/definition/kernel/diagnostics.d.ts
|
|
3
|
+
/** @experimental One line: code, severity and phase, location, message, expected, received, related and repair. */
|
|
4
|
+
export declare function formatDefinitionDiagnostic(diagnostic: DefinitionDiagnostic): string;
|
|
5
|
+
//#endregion
|
|
6
|
+
//#region src/definition/tooling/adapters/types.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* @experimental The shape both authoring paths normalize into. A consumer
|
|
9
|
+
* reads it without learning which adapter produced it.
|
|
10
|
+
*/
|
|
11
|
+
type NormalizedDocumentModelArtifact = {
|
|
12
|
+
readonly kind: "powerhouse.document-model-artifact";
|
|
13
|
+
readonly source: DefinitionSource;
|
|
14
|
+
readonly documentType: string;
|
|
15
|
+
readonly version: number;
|
|
16
|
+
readonly definition: DocumentModelDefinition;
|
|
17
|
+
readonly digest: Sha256Digest;
|
|
18
|
+
readonly documentModel: DocumentModelPHState;
|
|
19
|
+
};
|
|
20
|
+
/** @experimental */
|
|
21
|
+
type NormalizedDocumentModelResult = {
|
|
22
|
+
readonly artifacts: readonly NormalizedDocumentModelArtifact[];
|
|
23
|
+
readonly upgradeManifest: UpgradeManifest<readonly number[]> | null;
|
|
24
|
+
readonly diagnostics: readonly DefinitionDiagnostic[];
|
|
25
|
+
};
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region src/definition/tooling/adapters/code-first-document-model-source-adapter.d.ts
|
|
28
|
+
/**
|
|
29
|
+
* @experimental Normalizes one materialized code-first module, or a family
|
|
30
|
+
* and its versions in order. A family reports every malformed member: a
|
|
31
|
+
* valid sibling never makes a broken one pass.
|
|
32
|
+
*/
|
|
33
|
+
export declare function adaptCodeFirstDocumentModelSource(value: unknown, source: DefinitionSource): NormalizedDocumentModelResult;
|
|
34
|
+
//#endregion
|
|
35
|
+
//#region src/definition/tooling/definition-source-types.d.ts
|
|
36
|
+
/**
|
|
37
|
+
* @experimental The selected sources, exactly as a definition report carries
|
|
38
|
+
* them. Defined from the stored report type so the two cannot disagree.
|
|
39
|
+
*/
|
|
40
|
+
type DefinitionSourceSet = DefinitionCheckReport["sourceSet"];
|
|
41
|
+
/** @experimental Where the selected source list came from. */
|
|
42
|
+
type DefinitionSourceOrigin = DefinitionSourceSet["origin"];
|
|
43
|
+
/**
|
|
44
|
+
* @experimental The loader's one substitutable dependency: something that
|
|
45
|
+
* turns a package-relative TypeScript path into a module namespace. Codegen
|
|
46
|
+
* supplies a Vite environment; a build can supply its own module graph.
|
|
47
|
+
*/
|
|
48
|
+
interface TypeScriptSourceImportInterface {
|
|
49
|
+
importModule(request: {
|
|
50
|
+
readonly packageRoot: string;
|
|
51
|
+
readonly specifier: `./${string}`;
|
|
52
|
+
readonly packageRevision: Sha256Digest;
|
|
53
|
+
readonly signal?: AbortSignal;
|
|
54
|
+
}): Promise<Readonly<Record<string, unknown>>>;
|
|
55
|
+
disposeRevision?(packageRevision?: Sha256Digest): Promise<void> | void;
|
|
56
|
+
}
|
|
57
|
+
/** @experimental */
|
|
58
|
+
type DefinitionSourceSelectionRequest = {
|
|
59
|
+
readonly configFile?: string;
|
|
60
|
+
readonly allowMissingConfig?: boolean;
|
|
61
|
+
};
|
|
62
|
+
/** @experimental */
|
|
63
|
+
type DefinitionSourceLoadRequest = DefinitionSourceSelectionRequest & {
|
|
64
|
+
/**
|
|
65
|
+
* Binds the imported bytes this load may reuse. A definition digest is not
|
|
66
|
+
* enough: editing a reducer helper leaves every definition digest unchanged.
|
|
67
|
+
*/
|
|
68
|
+
readonly packageRevision: Sha256Digest;
|
|
69
|
+
readonly signal?: AbortSignal;
|
|
70
|
+
};
|
|
71
|
+
/** @experimental A selection, resolved without importing anything. */
|
|
72
|
+
type DefinitionSourceResolution = {
|
|
73
|
+
readonly packageRoot: string;
|
|
74
|
+
readonly sourceSet: DefinitionSourceSet;
|
|
75
|
+
readonly diagnostics: readonly DefinitionDiagnostic[];
|
|
76
|
+
} & ({
|
|
77
|
+
readonly status: "ready" | "failed";
|
|
78
|
+
readonly skipReason?: never;
|
|
79
|
+
} | {
|
|
80
|
+
readonly status: "skipped";
|
|
81
|
+
readonly skipReason: DefinitionCheckSkipReason;
|
|
82
|
+
});
|
|
83
|
+
/** @experimental One value the traversal recognized, and where it was found. */
|
|
84
|
+
type LoadedDefinition<TValue> = {
|
|
85
|
+
readonly source: DefinitionSource;
|
|
86
|
+
readonly path: DefinitionPath;
|
|
87
|
+
readonly value: TValue;
|
|
88
|
+
};
|
|
89
|
+
/** @experimental */
|
|
90
|
+
type LoadedDefinitionSet = DefinitionSourceResolution & {
|
|
91
|
+
readonly documentModels: readonly LoadedDefinition<DocumentModelModule>[];
|
|
92
|
+
readonly upgradeManifests: readonly LoadedDefinition<UpgradeManifest<readonly number[]>>[];
|
|
93
|
+
};
|
|
94
|
+
//#endregion
|
|
95
|
+
//#region src/definition/tooling/definition-source-loader.d.ts
|
|
96
|
+
/**
|
|
97
|
+
* @experimental Imports the selected definition sources and finds the
|
|
98
|
+
* materialized document models, families and upgrade manifests they export.
|
|
99
|
+
* It folds aliases, reports two values that claim one `documentType@version`,
|
|
100
|
+
* and returns everything sorted by source, so neither config order nor
|
|
101
|
+
* import completion order changes a result. Validity belongs to the
|
|
102
|
+
* adapters; registration belongs to the host.
|
|
103
|
+
*/
|
|
104
|
+
export declare class DefinitionSourceLoader {
|
|
105
|
+
#private;
|
|
106
|
+
constructor(importer: TypeScriptSourceImportInterface);
|
|
107
|
+
resolve(request: DefinitionSourceSelectionRequest): DefinitionSourceResolution;
|
|
108
|
+
normalizeDefinitionSources(request: DefinitionSourceLoadRequest): Promise<LoadedDefinitionSet>;
|
|
109
|
+
dispose(): Promise<void>;
|
|
110
|
+
}
|
|
111
|
+
//#endregion
|
|
112
|
+
//#region src/definition/tooling/definition-source-resolution.d.ts
|
|
113
|
+
/**
|
|
114
|
+
* @experimental The selection a command would load, resolved without
|
|
115
|
+
* importing anything and without any machine-specific path but the root.
|
|
116
|
+
*/
|
|
117
|
+
export declare function resolveDefinitionSelection(request: DefinitionSourceSelectionRequest): DefinitionSourceResolution;
|
|
118
|
+
//#endregion
|
|
119
|
+
export type { DefinitionSourceLoadRequest, DefinitionSourceOrigin, DefinitionSourceResolution, DefinitionSourceSelectionRequest, DefinitionSourceSet, LoadedDefinition, LoadedDefinitionSet, NormalizedDocumentModelArtifact, NormalizedDocumentModelResult, TypeScriptSourceImportInterface };
|
|
120
|
+
export {};
|
|
121
|
+
//# sourceMappingURL=tooling.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tooling.d.mts","names":[],"sources":["../src/definition/kernel/diagnostics.ts","../src/definition/tooling/adapters/types.ts","../src/definition/tooling/adapters/code-first-document-model-source-adapter.ts","../src/definition/tooling/definition-source-types.ts","../src/definition/tooling/definition-source-loader.ts","../src/definition/tooling/definition-source-resolution.ts"],"mappings":";;;wBAuQgB,2BACd,YAAY;;;;;;;KC3PF;WACD;WACA,QAAQ;WACR;WAEA;WAEA,YAAY;WAEZ,QAAQ;WAER,eAAe;;;KAId;WACD,oBAAoB;WAEpB,iBAAiB;WACjB,sBAAsB;;;;;;;;;wBC2NjB,kCACd,gBACA,QAAQ,mBACP;;;;;;;KC/OS,sBAAsB;;KAGtB,yBAAyB;;;;;;UAOpB;EACf,aAAa;aACF;aACA;aACA,iBAAiB;aACjB,SAAS;MAChB,QAAQ,SAAS;EAErB,iBAAiB,kBAAkB,eAAe;;;KAIxC;WACD;WAEA;;;KAIC,8BAA8B;;;;;WAK/B,iBAAiB;WACjB,SAAS;;;KAIR;WACD;WACA,WAAW;WACX,sBAAsB;;WAElB;WAAqC;;WAErC;WACA,YAAY;;;KAKf,iBAAiB;WAClB,QAAQ;WAER,MAAM;WACN,OAAO;;;KAIN,sBAAsB;WACvB,yBAAyB,iBAAiB;WAC1C,2BAA2B,iBAClC;;;;;;;;;;;;qBC+ZS;;EAQX,YAAY,UAAU;EAItB,QACE,SAAS,mCACR;EAIG,2BACJ,SAAS,8BACR,QAAQ;EAmFL,WAAW;;;;;;;;wBCvDH,2BACd,SAAS,mCACR"}
|