@substrat-run/model-emit 0.8.24 → 0.9.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/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/plan.d.ts +49 -2
- package/dist/plan.d.ts.map +1 -1
- package/dist/plan.js +86 -7
- package/dist/plan.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { emitTables, columnsOf, primaryKeyConstraint, uniqueConstraints, type EmitSqlOptions, type EmittedColumn, } from './emit-sql.js';
|
|
2
2
|
export { journalColumns, journalUniques, journalPrimaryKeys } from './journal.js';
|
|
3
3
|
export { readSchema, statements, type TableSchema } from './replay.js';
|
|
4
|
-
export { planMigration, parseJournal, type Journal, type JournalEntry, type MigrationPlan, } from './plan.js';
|
|
4
|
+
export { planMigration, parseJournal, type Journal, type JournalEntry, type MigrationPlan, type MigrationPlanOptions, type ParseJournalOptions, } from './plan.js';
|
|
5
5
|
export { renderClient, ClientEmitError, tsTypeOf, methodName, type ClientConfig, } from './emit-client.js';
|
|
6
6
|
export { emitXState, type EmitXStateOptions, type GuardWiring, type XStateMachine, type XStateNode, type XStateTransition, } from './emit-xstate.js';
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,SAAS,EACT,oBAAoB,EACpB,iBAAiB,EACjB,KAAK,cAAc,EACnB,KAAK,aAAa,GACnB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClF,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AACvE,OAAO,EACL,aAAa,EACb,YAAY,EACZ,KAAK,OAAO,EACZ,KAAK,YAAY,EACjB,KAAK,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,SAAS,EACT,oBAAoB,EACpB,iBAAiB,EACjB,KAAK,cAAc,EACnB,KAAK,aAAa,GACnB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClF,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AACvE,OAAO,EACL,aAAa,EACb,YAAY,EACZ,KAAK,OAAO,EACZ,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,GACzB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,YAAY,EACZ,eAAe,EACf,QAAQ,EACR,UAAU,EACV,KAAK,YAAY,GAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,UAAU,EACV,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,gBAAgB,GACtB,MAAM,kBAAkB,CAAC"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,SAAS,EACT,oBAAoB,EACpB,iBAAiB,GAGlB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClF,OAAO,EAAE,UAAU,EAAE,UAAU,EAAoB,MAAM,aAAa,CAAC;AACvE,OAAO,EACL,aAAa,EACb,YAAY,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,SAAS,EACT,oBAAoB,EACpB,iBAAiB,GAGlB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClF,OAAO,EAAE,UAAU,EAAE,UAAU,EAAoB,MAAM,aAAa,CAAC;AACvE,OAAO,EACL,aAAa,EACb,YAAY,GAMb,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,YAAY,EACZ,eAAe,EACf,QAAQ,EACR,UAAU,GAEX,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,UAAU,GAMX,MAAM,kBAAkB,CAAC"}
|
package/dist/plan.d.ts
CHANGED
|
@@ -14,6 +14,38 @@ export interface JournalEntry {
|
|
|
14
14
|
export interface Journal {
|
|
15
15
|
readonly entries: readonly JournalEntry[];
|
|
16
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* A vertical composed of surfaces does not have one journal, and the difference
|
|
19
|
+
* is not cosmetic: the kernel runs `mod.migrations` in the order it is handed
|
|
20
|
+
* them and never sorts by version, so **which journal an entry goes into is the
|
|
21
|
+
* execution order**.
|
|
22
|
+
*
|
|
23
|
+
* Both options are optional, and a vertical with one journal passes neither —
|
|
24
|
+
* that is the same call it makes today, answered the same way.
|
|
25
|
+
*/
|
|
26
|
+
export interface MigrationPlanOptions {
|
|
27
|
+
/**
|
|
28
|
+
* Every journal this vertical runs, by surface name, in the order the kernel
|
|
29
|
+
* runs them. Given this, the planner reads the applied schema across ALL of
|
|
30
|
+
* them (so a table another surface created is not diffed as missing) and
|
|
31
|
+
* derives the next version from the highest prefix it can see anywhere (so a
|
|
32
|
+
* six-journal vertical cannot mint a version one of the other five already
|
|
33
|
+
* holds — a duplicate is a boot failure, not a renumbering).
|
|
34
|
+
*
|
|
35
|
+
* `entities` is then the WHOLE model, not one surface's slice: parent edges
|
|
36
|
+
* resolve against the full registry, and a slice would read every other
|
|
37
|
+
* surface's tables as dropped. The set must be whole too — including the
|
|
38
|
+
* journal being appended to, and including a surface you are only now
|
|
39
|
+
* starting (as an empty journal). A partial set is refused rather than
|
|
40
|
+
* repaired: the order is the caller's, not the planner's.
|
|
41
|
+
*/
|
|
42
|
+
readonly journals?: Readonly<Record<string, Journal>>;
|
|
43
|
+
/**
|
|
44
|
+
* Which journal in that set the new entry lands in. Required once a plan
|
|
45
|
+
* creates a table, and refused rather than guessed — see `journals`.
|
|
46
|
+
*/
|
|
47
|
+
readonly surface?: string;
|
|
48
|
+
}
|
|
17
49
|
export type MigrationPlan = {
|
|
18
50
|
readonly kind: 'up-to-date';
|
|
19
51
|
} | {
|
|
@@ -29,7 +61,22 @@ export type MigrationPlan = {
|
|
|
29
61
|
* Pure: same model + same journal → same plan, every time. It reads no clock and
|
|
30
62
|
* mints no id, which is what lets the result be committed and diffed.
|
|
31
63
|
*/
|
|
32
|
-
export declare function planMigration<T extends Record<string, EntityDef>>(entities: T, journal: Journal): MigrationPlan;
|
|
64
|
+
export declare function planMigration<T extends Record<string, EntityDef>>(entities: T, journal: Journal, opts?: MigrationPlanOptions): MigrationPlan;
|
|
65
|
+
export interface ParseJournalOptions {
|
|
66
|
+
/**
|
|
67
|
+
* The name of the surface this journal belongs to — say it, and the journal is
|
|
68
|
+
* read as ONE of several sharing a counter rather than as the whole vertical's.
|
|
69
|
+
*
|
|
70
|
+
* That is the only thing it relaxes. A shared counter puts gaps in every
|
|
71
|
+
* journal it feeds (`0043` then `0055`, because the numbers between went to
|
|
72
|
+
* other surfaces), so position cannot derive the counter any more. What stays
|
|
73
|
+
* is the detector that matters: **strictly increasing, never repeating**. Two
|
|
74
|
+
* entries numbered `0010` in one surface is still the bad merge it always was;
|
|
75
|
+
* `0010` in two different surfaces is history, from when they numbered
|
|
76
|
+
* independently, and parses.
|
|
77
|
+
*/
|
|
78
|
+
readonly surface?: string;
|
|
79
|
+
}
|
|
33
80
|
/** Parsed hostilely: it is our file, and it is also somebody's merge resolution. */
|
|
34
|
-
export declare function parseJournal(raw: unknown): Journal;
|
|
81
|
+
export declare function parseJournal(raw: unknown, opts?: ParseJournalOptions): Journal;
|
|
35
82
|
//# sourceMappingURL=plan.d.ts.map
|
package/dist/plan.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../src/plan.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../src/plan.ts"],"names":[],"mappings":"AAkCA,OAAO,EAAgB,KAAK,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAGvE,MAAM,WAAW,YAAY;IAC3B,+DAA+D;IAC/D,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,2DAA2D;IAC3D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,OAAO,EAAE,SAAS,YAAY,EAAE,CAAC;CAC3C;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACtD;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,MAAM,aAAa,GACrB;IAAE,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAA;CAAE,GAC/B;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAA;CAAE,GACzD;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAAC;AAUtE;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,EAC/D,QAAQ,EAAE,CAAC,EACX,OAAO,EAAE,OAAO,EAChB,IAAI,CAAC,EAAE,oBAAoB,GAC1B,aAAa,CAuOf;AAED,MAAM,WAAW,mBAAmB;IAClC;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,oFAAoF;AACpF,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAiC9E"}
|
package/dist/plan.js
CHANGED
|
@@ -17,6 +17,13 @@
|
|
|
17
17
|
* right signal on an ordered append-only list. Resolution is mechanical: merge
|
|
18
18
|
* the model, re-run, it renumbers.
|
|
19
19
|
*
|
|
20
|
+
* **One journal, or several.** A vertical composed of surfaces runs one
|
|
21
|
+
* concatenated migration list built from several journals, and the kernel never
|
|
22
|
+
* sorts it — so which journal an entry goes into IS the execution order, and the
|
|
23
|
+
* counter is shared across all of them rather than derived from any one's
|
|
24
|
+
* length. `MigrationPlanOptions.journals` is how that is stated; passing nothing
|
|
25
|
+
* is the single-surface vertical, unchanged.
|
|
26
|
+
*
|
|
20
27
|
* **What this refuses.** Anything that would rewrite history or lose data: a
|
|
21
28
|
* dropped table or column, a retyped column, a moved primary key, or a required
|
|
22
29
|
* column added to a table that may already hold rows. Those are real decisions
|
|
@@ -28,14 +35,40 @@ import { columnsOf, emitTables, primaryKeyConstraint, uniqueConstraints } from '
|
|
|
28
35
|
import { primaryKeyOf } from '@substrat-run/contracts';
|
|
29
36
|
import { journalColumns, journalPrimaryKeys, journalUniques } from './journal.js';
|
|
30
37
|
const pad = (n) => String(n).padStart(4, '0');
|
|
38
|
+
/** The counter a version states, or `undefined` for something that is not one. */
|
|
39
|
+
const counterOf = (version) => {
|
|
40
|
+
if (!/^\d+$/.test(version))
|
|
41
|
+
return undefined;
|
|
42
|
+
return Number.parseInt(version, 10);
|
|
43
|
+
};
|
|
31
44
|
/**
|
|
32
45
|
* What one entry would have to say to bring the journal up to the model.
|
|
33
46
|
*
|
|
34
47
|
* Pure: same model + same journal → same plan, every time. It reads no clock and
|
|
35
48
|
* mints no id, which is what lets the result be committed and diffed.
|
|
36
49
|
*/
|
|
37
|
-
export function planMigration(entities, journal) {
|
|
38
|
-
|
|
50
|
+
export function planMigration(entities, journal, opts) {
|
|
51
|
+
// The set actually read, in the order the kernel runs it. With no `journals`
|
|
52
|
+
// that is the one journal handed in, which is every caller that exists today.
|
|
53
|
+
const named = opts?.journals ? Object.values(opts.journals) : undefined;
|
|
54
|
+
const set = named ?? [journal];
|
|
55
|
+
// `journals` IS the execution order, so the planner will not repair a partial
|
|
56
|
+
// one by putting the stray journal somewhere. Appending it to the end would
|
|
57
|
+
// replay an ALTER from a later surface before the CREATE it depends on, and
|
|
58
|
+
// the reader would report a table it cannot see. Refused before the diff runs,
|
|
59
|
+
// because a diff missing this journal's history proposes creating its tables.
|
|
60
|
+
if (named && !named.includes(journal)) {
|
|
61
|
+
return {
|
|
62
|
+
kind: 'refused',
|
|
63
|
+
reasons: [
|
|
64
|
+
'the journal being appended to is not one of `journals`, and the set is the execution ' +
|
|
65
|
+
'order — a planner that slotted it in somewhere would be picking that order for you. ' +
|
|
66
|
+
'Pass the member itself: `planMigration(entities, journals[surface], { journals, ' +
|
|
67
|
+
'surface })`',
|
|
68
|
+
],
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
const journalSql = set.flatMap((j) => j.entries.map((e) => e.sql)).join('\n');
|
|
39
72
|
const applied = journalColumns(journalSql);
|
|
40
73
|
const desired = journalColumns(emitTables(entities));
|
|
41
74
|
const appliedUniques = journalUniques(journalSql);
|
|
@@ -47,6 +80,7 @@ export function planMigration(entities, journal) {
|
|
|
47
80
|
owner.set(entity.table, { name, entity });
|
|
48
81
|
const statements = [];
|
|
49
82
|
const changes = [];
|
|
83
|
+
const created = [];
|
|
50
84
|
const refusals = [];
|
|
51
85
|
// -- gone from the model, still in the journal ------------------------------
|
|
52
86
|
for (const table of applied.keys()) {
|
|
@@ -72,6 +106,7 @@ export function planMigration(entities, journal) {
|
|
|
72
106
|
];
|
|
73
107
|
statements.push(`CREATE TABLE ${table} (\n${cols.join(',\n')}\n);`);
|
|
74
108
|
changes.push(`add-${table}`);
|
|
109
|
+
created.push(table);
|
|
75
110
|
continue;
|
|
76
111
|
}
|
|
77
112
|
// -- new columns on an existing table -------------------------------------
|
|
@@ -175,17 +210,48 @@ export function planMigration(entities, journal) {
|
|
|
175
210
|
'it in a hand-written entry, or drop the key');
|
|
176
211
|
}
|
|
177
212
|
}
|
|
213
|
+
// -- a new table in a composed vertical, with no surface named ---------------
|
|
214
|
+
// A `parents` edge emits a REFERENCES, and SQLite will happily create a child
|
|
215
|
+
// before its parent: the migration passes and the first insert fails. Which
|
|
216
|
+
// journal the CREATE lands in decides that, and it is not something a diff can
|
|
217
|
+
// read off the model — so it is refused rather than guessed, the same way a
|
|
218
|
+
// dropped column is. An ALTER needs no such choice, which is why only a
|
|
219
|
+
// CREATE asks. Naming the surface is the caller saying they decided; the
|
|
220
|
+
// planner does not check the decision (that would need the concatenation
|
|
221
|
+
// order, which is the vertical's, not the model's).
|
|
222
|
+
if (opts?.journals && created.length > 0 && opts.surface === undefined) {
|
|
223
|
+
const names = Object.keys(opts.journals);
|
|
224
|
+
refusals.push(`${created.map((t) => `'${t}'`).join(', ')} would be created, and this vertical runs ` +
|
|
225
|
+
`${names.length} journals (${names.join(', ')}) — which one an entry goes into IS the ` +
|
|
226
|
+
'execution order, and a generator that guessed could put a table before the parent it ' +
|
|
227
|
+
"REFERENCES. State it: `planMigration(entities, journal, { journals, surface: '…' })`");
|
|
228
|
+
}
|
|
229
|
+
// `hasOwn`, not `in`: `in` accepts every name on Object.prototype, so
|
|
230
|
+
// `surface: 'toString'` would pass a check whose whole job is to make a typo
|
|
231
|
+
// loud — and then name a journal `Object.keys` does not list.
|
|
232
|
+
if (opts?.journals && opts.surface !== undefined && !Object.hasOwn(opts.journals, opts.surface)) {
|
|
233
|
+
refusals.push(`surface '${opts.surface}' is not one of this vertical's journals ` +
|
|
234
|
+
`(${Object.keys(opts.journals).join(', ') || 'none'}) — a surface you are starting is ` +
|
|
235
|
+
'still one of them, so give it an empty journal rather than leaving it out: the set has ' +
|
|
236
|
+
'to name every journal for a typo to be loud');
|
|
237
|
+
}
|
|
178
238
|
if (refusals.length > 0)
|
|
179
239
|
return { kind: 'refused', reasons: refusals };
|
|
180
240
|
if (statements.length === 0)
|
|
181
241
|
return { kind: 'up-to-date' };
|
|
182
|
-
|
|
242
|
+
// The count is not the number. Six surfaces numbering from one shared counter
|
|
243
|
+
// leave gaps in each journal, and a position-derived version would re-mint one
|
|
244
|
+
// another surface already holds — which the adapter rejects at boot. Highest
|
|
245
|
+
// seen anywhere, plus one. For a single contiguous journal that is the count,
|
|
246
|
+
// so nothing about a one-surface vertical changes.
|
|
247
|
+
const highest = set.reduce((max, j) => j.entries.reduce((m, e) => Math.max(m, counterOf(e.version) ?? 0), max), 0);
|
|
248
|
+
const version = pad(highest + 1);
|
|
183
249
|
// One change names itself; several get a count, so the slug stays readable.
|
|
184
250
|
const slug = changes.length === 1 ? changes[0] : `${changes[0]}-and-${changes.length - 1}-more`;
|
|
185
251
|
return { kind: 'append', entry: { version, slug, sql: statements.join('\n\n') } };
|
|
186
252
|
}
|
|
187
253
|
/** Parsed hostilely: it is our file, and it is also somebody's merge resolution. */
|
|
188
|
-
export function parseJournal(raw) {
|
|
254
|
+
export function parseJournal(raw, opts) {
|
|
189
255
|
const entry = z.object({
|
|
190
256
|
version: z.string().regex(/^\d{4}$/, 'version is a derived four-digit counter'),
|
|
191
257
|
slug: z.string().min(1),
|
|
@@ -193,11 +259,24 @@ export function parseJournal(raw) {
|
|
|
193
259
|
released: z.boolean().optional(),
|
|
194
260
|
});
|
|
195
261
|
const parsed = z.object({ entries: z.array(entry) }).parse(raw);
|
|
262
|
+
const where = opts?.surface === undefined ? 'journal' : `journal '${opts.surface}'`;
|
|
263
|
+
let previous = 0;
|
|
196
264
|
parsed.entries.forEach((e, i) => {
|
|
197
|
-
if (
|
|
198
|
-
|
|
199
|
-
|
|
265
|
+
if (opts?.surface === undefined) {
|
|
266
|
+
if (e.version !== pad(i + 1)) {
|
|
267
|
+
throw new Error(`${where}: entry ${i + 1} is numbered '${e.version}' — the counter is derived from ` +
|
|
268
|
+
'position, so a gap or a duplicate means a bad merge, not a renumbering');
|
|
269
|
+
}
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
272
|
+
const counter = counterOf(e.version) ?? 0;
|
|
273
|
+
if (counter <= previous) {
|
|
274
|
+
throw new Error(`${where}: entry ${i + 1} is numbered '${e.version}'` +
|
|
275
|
+
(previous === 0 ? '' : `, after '${pad(previous)}'`) +
|
|
276
|
+
' — a surface shares its counter with the other surfaces, so it may skip, but it ' +
|
|
277
|
+
'must still climb from 0001: a repeat or a step backwards means a bad merge');
|
|
200
278
|
}
|
|
279
|
+
previous = counter;
|
|
201
280
|
});
|
|
202
281
|
return parsed;
|
|
203
282
|
}
|
package/dist/plan.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan.js","sourceRoot":"","sources":["../src/plan.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"plan.js","sourceRoot":"","sources":["../src/plan.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAC/F,OAAO,EAAE,YAAY,EAAkB,MAAM,yBAAyB,CAA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AAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC;gBACpD,kFAAkF;gBAClF,4EAA4E,CAC/E,CAAC;QACJ,CAAC;QACD,QAAQ,GAAG,OAAO,CAAC;IACrB,CAAC,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@substrat-run/model-emit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Build-time tooling over a Substrat model — DDL emitted from the entity registry, and the journal reader that holds it honest",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"dist"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@substrat-run/contracts": "0.
|
|
25
|
+
"@substrat-run/contracts": "0.108.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/node": "^22.0.0",
|