@forge-cms/runtime 0.7.0 → 0.8.1
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/runtime.d.ts +60 -3
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +206 -29
- package/dist/runtime.js.map +1 -1
- package/package.json +7 -7
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type { AdapterSet, ForgeCmsConfig } from './config.js';
|
|
2
2
|
export type { OperationContext } from './context.js';
|
|
3
|
-
export { ForgeCmsRuntime } from './runtime.js';
|
|
3
|
+
export { ForgeCmsRuntime, type MigrationReport } from './runtime.js';
|
|
4
4
|
export { handleList, handleRead, handleCreate, handleUpdate, handleDelete, handleGlobalRead, handleGlobalUpdate, handleListVersions, handleGetVersion, handleRestoreVersion, handlePreview, type HandlerOptions, DEFAULT_LIMIT, MAX_LIMIT } from './handlers.js';
|
|
5
5
|
export { handleFile, type FileHandlerOptions } from './files.js';
|
|
6
6
|
export { reconcileStorage, DEFAULT_UPLOAD_GRACE_MS, type ReconcileStorageOptions, type ReconcileStorageReport } from './storage-intents.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC9D,YAAY,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC9D,YAAY,EAAE,gBAAgB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EACL,uBAAuB,EACvB,sBAAsB,EACtB,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,mBAAmB,EACnB,aAAa,EACd,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAwB,MAAM,cAAc,CAAC;AACrE,OAAO,EACL,UAAU,EACV,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,EAEb,aAAa,EACb,SAAS,EACV,MAAM,eAAe,CAAC;AAEvB,kCAAkC;AAClC,OAAO,EAAE,UAAU,EAA2B,MAAM,YAAY,CAAC;AACjE,sEAAsE;AACtE,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EAGxB,MAAM,sBAAsB,CAAC;AAE9B,6EAA6E;AAC7E,OAAO,EACL,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,mBAAmB,EAMpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,iDAAiD;AACjD,OAAO,EACL,qBAAqB,EACrB,2BAA2B,EAE5B,MAAM,WAAW,CAAC;AAEnB,2CAA2C;AAC3C,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEnE,wFAAwF;AACxF,OAAO,EACL,IAAI,EACJ,QAAQ,EACR,O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AsB,EACtB,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,mBAAmB,EACnB,aAAa,EACd,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/runtime.d.ts
CHANGED
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
import type { ForgeCmsConfig, AdapterSet } from './config.js';
|
|
2
2
|
import type { CollectionBySlug, CollectionDefinition, CollectionDocument, CollectionRegistry, CollectionSlug, GlobalDefinition } from '@forge-cms/core';
|
|
3
|
-
import type { DatabaseRecord } from '@forge-cms/db';
|
|
3
|
+
import type { DatabaseRecord, MigrationDefinition, MigrationRecord, MigrationRunResult, MigrationState, RunMigrationsOptions, SchemaPlan } from '@forge-cms/db';
|
|
4
4
|
import type { OperationContext } from './context.js';
|
|
5
5
|
import type { ReconcileStorageOptions, ReconcileStorageReport } from './storage-intents.js';
|
|
6
6
|
import type { TypedCountArgs, TypedCreateArgs, TypedDeleteArgs, TypedFindArgs, TypedFindByIDArgs, TypedFindOneArgs, TypedPaginatedDocs, TypedPreviewArgs, TypedUpdateArgs } from './typed-api.js';
|
|
7
7
|
import type { GetGlobalArgs, UpdateGlobalArgs } from './globals.js';
|
|
8
8
|
import type { ListVersionsArgs, GetVersionArgs, RestoreVersionArgs, CreateVersionArgs } from './versions.js';
|
|
9
9
|
import type { Version } from '@forge-cms/core';
|
|
10
|
+
/** What {@link ForgeCmsRuntime.runMigrations} did (spec 072). */
|
|
11
|
+
export interface MigrationReport {
|
|
12
|
+
/** The drift plan before any migration ran: what the migrations were meant to resolve. */
|
|
13
|
+
before: SchemaPlan;
|
|
14
|
+
/** One entry per migration in the list, in order. */
|
|
15
|
+
results: MigrationRunResult[];
|
|
16
|
+
/** The plan after the post-flight `syncSchema()`: never blocking when this resolves. */
|
|
17
|
+
after: SchemaPlan;
|
|
18
|
+
}
|
|
10
19
|
/**
|
|
11
20
|
* The CMS instance: collections bound to adapters, plus the **Local API** — `find`, `findByID`,
|
|
12
21
|
* `create`, `update`, `delete`, `count`, `getGlobal`, `updateGlobal`.
|
|
@@ -33,13 +42,61 @@ export declare class ForgeCmsRuntime<TEnv = unknown, TCollections extends Collec
|
|
|
33
42
|
private wireManagedDeleteGuards;
|
|
34
43
|
/** Initialise all adapters with the runtime environment */
|
|
35
44
|
init(): this;
|
|
36
|
-
/**
|
|
45
|
+
/**
|
|
46
|
+
* Creates and additively upgrades every table the CMS uses: collections, `_global_<slug>`,
|
|
47
|
+
* `_versions_<slug>`, `_forge_storage_intents`, and the auth adapter's own tables.
|
|
48
|
+
*
|
|
49
|
+
* Plan first (spec 070): when the database implements `planSchema`, the whole schema — including the
|
|
50
|
+
* auth adapter's tables — is planned before anything runs. Any change that needs a reviewed
|
|
51
|
+
* migration throws `SchemaDriftError` with **no table touched anywhere**. Otherwise each area is
|
|
52
|
+
* synced (fresh tables and safe additive changes only). A database without `planSchema` keeps its
|
|
53
|
+
* own `syncSchema` behaviour, unplanned.
|
|
54
|
+
*/
|
|
37
55
|
syncSchema(): Promise<void>;
|
|
56
|
+
/**
|
|
57
|
+
* The complete schema drift plan (spec 070) for every table {@link syncSchema} manages, merged with
|
|
58
|
+
* the auth adapter's own (`AuthAdapter.planSchema`). Read-only: inspects the database and runs
|
|
59
|
+
* aggregate probes, never DDL or writes. Throws when the database adapter cannot inspect its
|
|
60
|
+
* persisted schema — an uninspectable schema is never reported as compatible.
|
|
61
|
+
*/
|
|
62
|
+
planSchema(): Promise<SchemaPlan>;
|
|
63
|
+
/**
|
|
64
|
+
* Runs reviewed migrations (spec 072) — the one supported way to apply changes `syncSchema()` refuses.
|
|
65
|
+
* An explicit deployment/maintenance step: `init()` and `syncSchema()` never call it.
|
|
66
|
+
*
|
|
67
|
+
* 1. Validates every definition (no I/O).
|
|
68
|
+
* 2. Preflight: `before = planSchema()`, the drift the migrations are meant to resolve.
|
|
69
|
+
* 3. The database adapter runs each pending migration as one transactional batch together with its
|
|
70
|
+
* `_forge_migrations` ledger entry (`DatabaseAdapter.runMigrations`).
|
|
71
|
+
* 4. Post-flight: `syncSchema()` applies the safe remainder and records baselines, then
|
|
72
|
+
* `after = planSchema()` must not block.
|
|
73
|
+
*
|
|
74
|
+
* Throws `MigrationError`. A post-flight failure (`MIGRATION_POSTFLIGHT_FAILED`) means the migrations
|
|
75
|
+
* **committed** and were not rolled back: inspect, then forward-fix or restore a backup.
|
|
76
|
+
*/
|
|
77
|
+
runMigrations(migrations: readonly MigrationDefinition[], options?: RunMigrationsOptions): Promise<MigrationReport>;
|
|
78
|
+
/**
|
|
79
|
+
* Read-only preflight (spec 072): validates `migrations` against the `_forge_migrations` ledger and
|
|
80
|
+
* reports each one as `applied`, `failed` or `pending`. Throws the same history/checksum
|
|
81
|
+
* `MigrationError`s `runMigrations` would, before anything runs.
|
|
82
|
+
*/
|
|
83
|
+
planMigrations(migrations: readonly MigrationDefinition[]): Promise<MigrationState[]>;
|
|
84
|
+
/** The `_forge_migrations` ledger in position order (spec 072); `[]` when no migration ran. */
|
|
85
|
+
readMigrationHistory(): Promise<MigrationRecord[]>;
|
|
86
|
+
private migrationsUnsupported;
|
|
87
|
+
/** Every table definition this runtime syncs through its database adapter. */
|
|
88
|
+
private tableDefinitions;
|
|
89
|
+
/**
|
|
90
|
+
* The refusal for a blocking plan. Duplicate version identities keep spec 062's domain diagnostic
|
|
91
|
+
* (examples and the inspection query) instead of the generic index conflict.
|
|
92
|
+
*/
|
|
93
|
+
private schemaDriftError;
|
|
38
94
|
/**
|
|
39
95
|
* Creates/extends one `_versions_<slug>` table additively. Adding its unique
|
|
40
96
|
* `(documentId, versionNumber)` index fails on a database that already holds duplicate version
|
|
41
97
|
* identities (only the pre-062 read-then-insert race produced them): history is then reported, never
|
|
42
|
-
* deleted, renumbered or merged — the operator decides (spec 062 §8
|
|
98
|
+
* deleted, renumbered or merged — the operator decides (spec 062 §8). Planning (spec 070) normally
|
|
99
|
+
* reports this before anything runs; this path covers adapters without `planSchema`.
|
|
43
100
|
*/
|
|
44
101
|
private syncVersionTable;
|
|
45
102
|
/** Find a collection definition by slug */
|
package/dist/runtime.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,KAAK,EACV,gBAAgB,EAChB,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EACjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,KAAK,EACV,gBAAgB,EAChB,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EACjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EACV,cAAc,EACd,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,oBAAoB,EAEpB,UAAU,EACX,MAAM,eAAe,CAAC;AAWvB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAarD,OAAO,KAAK,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAU5F,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EACf,eAAe,EACf,aAAa,EACb,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EAChB,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;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,OAAO,IAAI,eAAe,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC"}
|
package/dist/runtime.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MigrationError, SchemaDriftError, formatSchemaPlan, isSchemaDriftError, mergeSchemaPlans, planMigrationHistory, prepareMigrations, resolveCollectionIndexes } from '@forge-cms/db';
|
|
1
2
|
import { isReferenced, noReferenceAssertions, validateRelationSchema } from './relation-lifecycle.js';
|
|
2
3
|
import * as operations from './operations.js';
|
|
3
4
|
import { validateLocalizationSchema } from './localization.js';
|
|
@@ -83,25 +84,19 @@ export class ForgeCmsRuntime {
|
|
|
83
84
|
this.adapters.storage.init(env);
|
|
84
85
|
return this;
|
|
85
86
|
}
|
|
86
|
-
/**
|
|
87
|
+
/**
|
|
88
|
+
* Creates and additively upgrades every table the CMS uses: collections, `_global_<slug>`,
|
|
89
|
+
* `_versions_<slug>`, `_forge_storage_intents`, and the auth adapter's own tables.
|
|
90
|
+
*
|
|
91
|
+
* Plan first (spec 070): when the database implements `planSchema`, the whole schema — including the
|
|
92
|
+
* auth adapter's tables — is planned before anything runs. Any change that needs a reviewed
|
|
93
|
+
* migration throws `SchemaDriftError` with **no table touched anywhere**. Otherwise each area is
|
|
94
|
+
* synced (fresh tables and safe additive changes only). A database without `planSchema` keeps its
|
|
95
|
+
* own `syncSchema` behaviour, unplanned.
|
|
96
|
+
*/
|
|
87
97
|
async syncSchema() {
|
|
88
|
-
await this.adapters.database.syncSchema(this.config.collections);
|
|
89
|
-
await this.adapters.auth.syncSchema?.();
|
|
90
|
-
// Durable storage-cleanup intents (spec 067), only where uploads exist.
|
|
91
|
-
if (hasUploadCollections(this.config.collections)) {
|
|
92
|
-
await this.adapters.database.syncSchema([storageIntentsDefinition()]);
|
|
93
|
-
}
|
|
94
|
-
for (const global of this.config.globals ?? []) {
|
|
95
|
-
await this.adapters.database.syncSchema([
|
|
96
|
-
{
|
|
97
|
-
slug: `_global_${global.slug}`,
|
|
98
|
-
fields: global.fields,
|
|
99
|
-
...(global.drafts === true && { drafts: true })
|
|
100
|
-
}
|
|
101
|
-
]);
|
|
102
|
-
}
|
|
103
|
-
// Version tables for collections with versions enabled (spec 062 §1/§8).
|
|
104
98
|
const versioned = this.config.collections.filter((c) => versionOps.versionsEnabled(c));
|
|
99
|
+
// Checked before anything is created: history needs a document and its snapshot to commit together.
|
|
105
100
|
if (versioned.length > 0) {
|
|
106
101
|
const database = this.adapters.database;
|
|
107
102
|
if (typeof database.atomicWrite !== 'function') {
|
|
@@ -110,15 +105,185 @@ export class ForgeCmsRuntime {
|
|
|
110
105
|
`snapshot must commit together (specs 060/062); '${String(database.name)}' does not.`);
|
|
111
106
|
}
|
|
112
107
|
}
|
|
108
|
+
if (typeof this.adapters.database.planSchema === 'function') {
|
|
109
|
+
const plan = await this.planSchema();
|
|
110
|
+
if (plan.blocking)
|
|
111
|
+
throw await this.schemaDriftError(plan);
|
|
112
|
+
}
|
|
113
|
+
await this.adapters.database.syncSchema(this.config.collections);
|
|
114
|
+
await this.adapters.auth.syncSchema?.();
|
|
115
|
+
// Durable storage-cleanup intents (spec 067), only where uploads exist.
|
|
116
|
+
if (hasUploadCollections(this.config.collections)) {
|
|
117
|
+
await this.adapters.database.syncSchema([storageIntentsDefinition()]);
|
|
118
|
+
}
|
|
119
|
+
for (const global of this.config.globals ?? []) {
|
|
120
|
+
await this.adapters.database.syncSchema([globalTableDefinition(global)]);
|
|
121
|
+
}
|
|
122
|
+
// Version tables for collections with versions enabled (spec 062 §1/§8).
|
|
113
123
|
for (const collection of versioned) {
|
|
114
124
|
await this.syncVersionTable(collection);
|
|
115
125
|
}
|
|
116
126
|
}
|
|
127
|
+
/**
|
|
128
|
+
* The complete schema drift plan (spec 070) for every table {@link syncSchema} manages, merged with
|
|
129
|
+
* the auth adapter's own (`AuthAdapter.planSchema`). Read-only: inspects the database and runs
|
|
130
|
+
* aggregate probes, never DDL or writes. Throws when the database adapter cannot inspect its
|
|
131
|
+
* persisted schema — an uninspectable schema is never reported as compatible.
|
|
132
|
+
*/
|
|
133
|
+
async planSchema() {
|
|
134
|
+
const database = this.adapters.database;
|
|
135
|
+
if (typeof database.planSchema !== 'function') {
|
|
136
|
+
throw new Error(`The '${database.name}' database adapter cannot inspect its persisted schema: it does not ` +
|
|
137
|
+
`implement DatabaseAdapter.planSchema() (spec 070), so ForgeCMS cannot tell whether that ` +
|
|
138
|
+
`schema is compatible with this configuration.`);
|
|
139
|
+
}
|
|
140
|
+
const plans = [await database.planSchema(this.tableDefinitions())];
|
|
141
|
+
const auth = await this.adapters.auth.planSchema?.();
|
|
142
|
+
if (auth)
|
|
143
|
+
plans.push(auth);
|
|
144
|
+
return mergeSchemaPlans(plans);
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Runs reviewed migrations (spec 072) — the one supported way to apply changes `syncSchema()` refuses.
|
|
148
|
+
* An explicit deployment/maintenance step: `init()` and `syncSchema()` never call it.
|
|
149
|
+
*
|
|
150
|
+
* 1. Validates every definition (no I/O).
|
|
151
|
+
* 2. Preflight: `before = planSchema()`, the drift the migrations are meant to resolve.
|
|
152
|
+
* 3. The database adapter runs each pending migration as one transactional batch together with its
|
|
153
|
+
* `_forge_migrations` ledger entry (`DatabaseAdapter.runMigrations`).
|
|
154
|
+
* 4. Post-flight: `syncSchema()` applies the safe remainder and records baselines, then
|
|
155
|
+
* `after = planSchema()` must not block.
|
|
156
|
+
*
|
|
157
|
+
* Throws `MigrationError`. A post-flight failure (`MIGRATION_POSTFLIGHT_FAILED`) means the migrations
|
|
158
|
+
* **committed** and were not rolled back: inspect, then forward-fix or restore a backup.
|
|
159
|
+
*/
|
|
160
|
+
async runMigrations(migrations, options = {}) {
|
|
161
|
+
await prepareMigrations(migrations);
|
|
162
|
+
const database = this.adapters.database;
|
|
163
|
+
if (typeof database.runMigrations !== 'function')
|
|
164
|
+
throw this.migrationsUnsupported();
|
|
165
|
+
const before = await this.planSchema();
|
|
166
|
+
const results = await database.runMigrations(migrations, options);
|
|
167
|
+
const committed = results.filter((r) => r.outcome !== 'already-applied');
|
|
168
|
+
const postflight = (plan, cause) => new MigrationError({
|
|
169
|
+
code: 'MIGRATION_POSTFLIGHT_FAILED',
|
|
170
|
+
phase: 'postflight',
|
|
171
|
+
status: committed.length > 0 ? 'applied' : 'not-applied',
|
|
172
|
+
results,
|
|
173
|
+
...(plan !== undefined && { plan }),
|
|
174
|
+
message: (committed.length > 0
|
|
175
|
+
? `${committed.length} migration(s) committed (${committed.map((r) => `"${r.id}"`).join(', ')}) ` +
|
|
176
|
+
'and were NOT rolled back, but '
|
|
177
|
+
: 'No migration was pending, and ') +
|
|
178
|
+
'the schema still does not match this configuration. Inspect the plan, then forward-fix with ' +
|
|
179
|
+
'a new migration or restore a backup. Deploying older application code does not revert the ' +
|
|
180
|
+
'database.' +
|
|
181
|
+
(plan !== undefined ? `\n\n${formatSchemaPlan(plan)}` : '')
|
|
182
|
+
}, cause !== undefined ? { cause } : undefined);
|
|
183
|
+
try {
|
|
184
|
+
await this.syncSchema();
|
|
185
|
+
}
|
|
186
|
+
catch (err) {
|
|
187
|
+
throw postflight(isSchemaDriftError(err) ? err.plan : undefined, err);
|
|
188
|
+
}
|
|
189
|
+
let after;
|
|
190
|
+
try {
|
|
191
|
+
after = await this.planSchema();
|
|
192
|
+
}
|
|
193
|
+
catch (err) {
|
|
194
|
+
throw postflight(undefined, err);
|
|
195
|
+
}
|
|
196
|
+
if (after.blocking)
|
|
197
|
+
throw postflight(after);
|
|
198
|
+
return { before, results, after };
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Read-only preflight (spec 072): validates `migrations` against the `_forge_migrations` ledger and
|
|
202
|
+
* reports each one as `applied`, `failed` or `pending`. Throws the same history/checksum
|
|
203
|
+
* `MigrationError`s `runMigrations` would, before anything runs.
|
|
204
|
+
*/
|
|
205
|
+
async planMigrations(migrations) {
|
|
206
|
+
const prepared = await prepareMigrations(migrations);
|
|
207
|
+
const history = await this.readMigrationHistory();
|
|
208
|
+
return planMigrationHistory(history, prepared).states;
|
|
209
|
+
}
|
|
210
|
+
/** The `_forge_migrations` ledger in position order (spec 072); `[]` when no migration ran. */
|
|
211
|
+
async readMigrationHistory() {
|
|
212
|
+
const database = this.adapters.database;
|
|
213
|
+
if (typeof database.readMigrationHistory !== 'function')
|
|
214
|
+
throw this.migrationsUnsupported();
|
|
215
|
+
return database.readMigrationHistory();
|
|
216
|
+
}
|
|
217
|
+
migrationsUnsupported() {
|
|
218
|
+
return new MigrationError({
|
|
219
|
+
code: 'MIGRATION_UNSUPPORTED',
|
|
220
|
+
phase: 'preflight',
|
|
221
|
+
status: 'not-applied',
|
|
222
|
+
message: `The '${this.adapters.database.name}' database adapter cannot run reviewed migrations: it does ` +
|
|
223
|
+
'not implement DatabaseAdapter.runMigrations()/readMigrationHistory() (spec 072). Use ' +
|
|
224
|
+
'LibSqlDatabaseAdapter or D1DatabaseAdapter; InMemoryDatabaseAdapter persists nothing to migrate.'
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
/** Every table definition this runtime syncs through its database adapter. */
|
|
228
|
+
tableDefinitions() {
|
|
229
|
+
return [
|
|
230
|
+
...this.config.collections,
|
|
231
|
+
...(hasUploadCollections(this.config.collections) ? [storageIntentsDefinition()] : []),
|
|
232
|
+
...(this.config.globals ?? []).map(globalTableDefinition),
|
|
233
|
+
...this.config.collections
|
|
234
|
+
.filter((c) => versionOps.versionsEnabled(c))
|
|
235
|
+
.map((c) => versionOps.versionCollectionDefinition(c.slug))
|
|
236
|
+
];
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* The refusal for a blocking plan. Duplicate version identities keep spec 062's domain diagnostic
|
|
240
|
+
* (examples and the inspection query) instead of the generic index conflict.
|
|
241
|
+
*/
|
|
242
|
+
async schemaDriftError(plan) {
|
|
243
|
+
for (const collection of this.config.collections.filter((c) => versionOps.versionsEnabled(c))) {
|
|
244
|
+
const definition = versionOps.versionCollectionDefinition(collection.slug);
|
|
245
|
+
const identityIndex = resolveCollectionIndexes(definition)[0]?.name;
|
|
246
|
+
const conflict = plan.changes.find((change) => change.table === definition.slug &&
|
|
247
|
+
change.target.name === identityIndex &&
|
|
248
|
+
(change.duplicateGroups ?? 0) > 0);
|
|
249
|
+
if (!conflict)
|
|
250
|
+
continue;
|
|
251
|
+
try {
|
|
252
|
+
// Registers just the identity columns with the adapter so the scan can read them (the blocked
|
|
253
|
+
// plan added none of the table's new columns). This sync blocks by construction, whatever
|
|
254
|
+
// another process does meanwhile: the stored version table always has `data`/`createdAt`,
|
|
255
|
+
// which this definition omits (`column-removed`). So it runs no DDL and writes no baseline.
|
|
256
|
+
// Like any refused sync, it leaves the adapter unfit for use until a sync succeeds; that
|
|
257
|
+
// successful sync registers the full definition again.
|
|
258
|
+
const identity = definition.fields;
|
|
259
|
+
await this.adapters.database
|
|
260
|
+
.syncSchema([
|
|
261
|
+
{
|
|
262
|
+
...definition,
|
|
263
|
+
fields: {
|
|
264
|
+
...(identity.documentId && { documentId: identity.documentId }),
|
|
265
|
+
...(identity.versionNumber && { versionNumber: identity.versionNumber })
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
])
|
|
269
|
+
.catch(() => undefined);
|
|
270
|
+
const duplicates = await versionOps.findDuplicateVersionIdentities(this.adapters.database, definition.slug);
|
|
271
|
+
if (duplicates.length > 0) {
|
|
272
|
+
return new SchemaDriftError(plan, `${duplicateVersionMessage(definition.slug, duplicates)}\n\n${formatSchemaPlan(plan)}`);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
catch {
|
|
276
|
+
// Fall through to the generic report, which still names the conflict.
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
return new SchemaDriftError(plan);
|
|
280
|
+
}
|
|
117
281
|
/**
|
|
118
282
|
* Creates/extends one `_versions_<slug>` table additively. Adding its unique
|
|
119
283
|
* `(documentId, versionNumber)` index fails on a database that already holds duplicate version
|
|
120
284
|
* identities (only the pre-062 read-then-insert race produced them): history is then reported, never
|
|
121
|
-
* deleted, renumbered or merged — the operator decides (spec 062 §8
|
|
285
|
+
* deleted, renumbered or merged — the operator decides (spec 062 §8). Planning (spec 070) normally
|
|
286
|
+
* reports this before anything runs; this path covers adapters without `planSchema`.
|
|
122
287
|
*/
|
|
123
288
|
async syncVersionTable(collection) {
|
|
124
289
|
const definition = versionOps.versionCollectionDefinition(collection.slug);
|
|
@@ -135,17 +300,7 @@ export class ForgeCmsRuntime {
|
|
|
135
300
|
}
|
|
136
301
|
if (duplicates.length === 0)
|
|
137
302
|
throw err;
|
|
138
|
-
|
|
139
|
-
.slice(0, 5)
|
|
140
|
-
.map((d) => `document "${d.documentId}" version ${d.versionNumber} (${d.rows} rows)`)
|
|
141
|
-
.join('; ');
|
|
142
|
-
throw new Error(`Cannot add the unique (documentId, versionNumber) index to "${definition.slug}": it already ` +
|
|
143
|
-
`contains ${duplicates.length} duplicate version ${duplicates.length === 1 ? 'identity' : 'identities'} ` +
|
|
144
|
-
`— e.g. ${examples}. They were produced by concurrent updates before ForgeCMS enforced ` +
|
|
145
|
-
`version identity. ForgeCMS will not delete, renumber or merge version history automatically. ` +
|
|
146
|
-
`Inspect them with: SELECT "documentId", "versionNumber", COUNT(*) FROM "${definition.slug}" ` +
|
|
147
|
-
`GROUP BY "documentId", "versionNumber" HAVING COUNT(*) > 1; decide which rows to keep ` +
|
|
148
|
-
`(renumber or delete the extras after taking a backup), then restart.`, { cause: err });
|
|
303
|
+
throw new Error(duplicateVersionMessage(definition.slug, duplicates), { cause: err });
|
|
149
304
|
}
|
|
150
305
|
}
|
|
151
306
|
/** Find a collection definition by slug */
|
|
@@ -237,4 +392,26 @@ export class ForgeCmsRuntime {
|
|
|
237
392
|
return operations.preview(this, args);
|
|
238
393
|
}
|
|
239
394
|
}
|
|
395
|
+
/** The internal table a global is stored in. */
|
|
396
|
+
function globalTableDefinition(global) {
|
|
397
|
+
return {
|
|
398
|
+
slug: `_global_${global.slug}`,
|
|
399
|
+
fields: global.fields,
|
|
400
|
+
...(global.drafts === true && { drafts: true })
|
|
401
|
+
};
|
|
402
|
+
}
|
|
403
|
+
/** Spec 062's diagnostic for historical duplicate version identities. */
|
|
404
|
+
function duplicateVersionMessage(slug, duplicates) {
|
|
405
|
+
const examples = duplicates
|
|
406
|
+
.slice(0, 5)
|
|
407
|
+
.map((d) => `document "${d.documentId}" version ${d.versionNumber} (${d.rows} rows)`)
|
|
408
|
+
.join('; ');
|
|
409
|
+
return (`Cannot add the unique (documentId, versionNumber) index to "${slug}": it already ` +
|
|
410
|
+
`contains ${duplicates.length} duplicate version ${duplicates.length === 1 ? 'identity' : 'identities'} ` +
|
|
411
|
+
`— e.g. ${examples}. They were produced by concurrent updates before ForgeCMS enforced ` +
|
|
412
|
+
`version identity. ForgeCMS will not delete, renumber or merge version history automatically. ` +
|
|
413
|
+
`Inspect them with: SELECT "documentId", "versionNumber", COUNT(*) FROM "${slug}" ` +
|
|
414
|
+
`GROUP BY "documentId", "versionNumber" HAVING COUNT(*) > 1; decide which rows to keep ` +
|
|
415
|
+
`(renumber or delete the extras after taking a backup), then restart.`);
|
|
416
|
+
}
|
|
240
417
|
//# sourceMappingURL=runtime.js.map
|
package/dist/runtime.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAWA,OAAO,EACL,YAAY,EACZ,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,wBAAwB,EACzB,MAAM,sBAAsB,CAAC;AAsB9B,OAAO,KAAK,SAAS,MAAM,cAAc,CAAC;AAE1C,OAAO,KAAK,UAAU,MAAM,eAAe,CAAC;AAS5C;;;;;;;;;;;;GAYG;AACH,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B,UAAU,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY,GAAG;QACzG,UAAU,QAAQ,sEAAsE;QACxF,+FAA+F;QAC/F,2EAA2E,IAAI,IAAI;QACnF,wFAAwF;QACxF,sEAAsE,CACvE,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge-cms/runtime",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "Runtime orchestrator for ForgeCMS — binds schema, adapters, and handlers.",
|
|
5
5
|
"author": "ForgeCMS contributors",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,17 +35,17 @@
|
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@forge-cms/api": "0.
|
|
39
|
-
"@forge-cms/auth": "0.
|
|
40
|
-
"@forge-cms/
|
|
41
|
-
"@forge-cms/
|
|
42
|
-
"@forge-cms/
|
|
38
|
+
"@forge-cms/api": "0.8.1",
|
|
39
|
+
"@forge-cms/auth": "0.8.1",
|
|
40
|
+
"@forge-cms/storage": "0.8.1",
|
|
41
|
+
"@forge-cms/core": "0.8.1",
|
|
42
|
+
"@forge-cms/db": "0.8.1"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@libsql/client": "0.17.3",
|
|
46
46
|
"typescript": "5.9.2",
|
|
47
47
|
"vitest": "4.1.6",
|
|
48
|
-
"@forge-cms/testing": "0.
|
|
48
|
+
"@forge-cms/testing": "0.8.1"
|
|
49
49
|
},
|
|
50
50
|
"scripts": {
|
|
51
51
|
"build": "tsc -p tsconfig.build.json",
|