@opensaas/stack-cli 0.43.0 → 0.44.0-alpha.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/README.md +116 -135
- package/dist/.build-hash +1 -0
- package/dist/commands/db.d.ts +23 -0
- package/dist/commands/db.d.ts.map +1 -0
- package/dist/commands/db.js +43 -0
- package/dist/commands/db.js.map +1 -0
- package/dist/commands/dev.d.ts +12 -1
- package/dist/commands/dev.d.ts.map +1 -1
- package/dist/commands/dev.js +519 -22
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/fk-renames.d.ts +14 -0
- package/dist/commands/fk-renames.d.ts.map +1 -0
- package/dist/commands/fk-renames.js +90 -0
- package/dist/commands/fk-renames.js.map +1 -0
- package/dist/commands/generate.d.ts +61 -4
- package/dist/commands/generate.d.ts.map +1 -1
- package/dist/commands/generate.js +225 -138
- package/dist/commands/generate.js.map +1 -1
- package/dist/commands/init.d.ts +6 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +13 -2
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/junction-ids.d.ts +11 -0
- package/dist/commands/junction-ids.d.ts.map +1 -0
- package/dist/commands/junction-ids.js +81 -0
- package/dist/commands/junction-ids.js.map +1 -0
- package/dist/commands/migrate.d.ts +2 -0
- package/dist/commands/migrate.d.ts.map +1 -1
- package/dist/commands/migrate.js +47 -25
- package/dist/commands/migrate.js.map +1 -1
- package/dist/dev/app-runner.d.ts +70 -0
- package/dist/dev/app-runner.d.ts.map +1 -0
- package/dist/dev/app-runner.js +116 -0
- package/dist/dev/app-runner.js.map +1 -0
- package/dist/dev/control.d.ts +73 -0
- package/dist/dev/control.d.ts.map +1 -0
- package/dist/dev/control.js +251 -0
- package/dist/dev/control.js.map +1 -0
- package/dist/dev/staged-reconcile.d.ts +126 -0
- package/dist/dev/staged-reconcile.d.ts.map +1 -0
- package/dist/dev/staged-reconcile.js +289 -0
- package/dist/dev/staged-reconcile.js.map +1 -0
- package/dist/generator/config-load.d.ts +34 -0
- package/dist/generator/config-load.d.ts.map +1 -0
- package/dist/generator/config-load.js +64 -0
- package/dist/generator/config-load.js.map +1 -0
- package/dist/generator/context.d.ts +39 -3
- package/dist/generator/context.d.ts.map +1 -1
- package/dist/generator/context.js +245 -107
- package/dist/generator/context.js.map +1 -1
- package/dist/generator/contract-emit.d.ts +24 -0
- package/dist/generator/contract-emit.d.ts.map +1 -0
- package/dist/generator/contract-emit.js +34 -0
- package/dist/generator/contract-emit.js.map +1 -0
- package/dist/generator/contract-module.d.ts +39 -0
- package/dist/generator/contract-module.d.ts.map +1 -0
- package/dist/generator/contract-module.js +440 -0
- package/dist/generator/contract-module.js.map +1 -0
- package/dist/generator/extension-spaces.d.ts +142 -0
- package/dist/generator/extension-spaces.d.ts.map +1 -0
- package/dist/generator/extension-spaces.js +358 -0
- package/dist/generator/extension-spaces.js.map +1 -0
- package/dist/generator/index.d.ts +12 -4
- package/dist/generator/index.d.ts.map +1 -1
- package/dist/generator/index.js +7 -3
- package/dist/generator/index.js.map +1 -1
- package/dist/generator/lists.d.ts +6 -7
- package/dist/generator/lists.d.ts.map +1 -1
- package/dist/generator/lists.js +33 -13
- package/dist/generator/lists.js.map +1 -1
- package/dist/generator/output-paths.d.ts +62 -19
- package/dist/generator/output-paths.d.ts.map +1 -1
- package/dist/generator/output-paths.js +68 -30
- package/dist/generator/output-paths.js.map +1 -1
- package/dist/generator/prisma-cli.d.ts +61 -0
- package/dist/generator/prisma-cli.d.ts.map +1 -0
- package/dist/generator/prisma-cli.js +92 -0
- package/dist/generator/prisma-cli.js.map +1 -0
- package/dist/generator/prisma-config.d.ts +50 -31
- package/dist/generator/prisma-config.d.ts.map +1 -1
- package/dist/generator/prisma-config.js +72 -65
- package/dist/generator/prisma-config.js.map +1 -1
- package/dist/generator/source-text.d.ts +16 -0
- package/dist/generator/source-text.d.ts.map +1 -0
- package/dist/generator/source-text.js +35 -0
- package/dist/generator/source-text.js.map +1 -0
- package/dist/generator/tables.d.ts +5 -0
- package/dist/generator/tables.d.ts.map +1 -0
- package/dist/generator/tables.js +84 -0
- package/dist/generator/tables.js.map +1 -0
- package/dist/generator/types.d.ts +23 -3
- package/dist/generator/types.d.ts.map +1 -1
- package/dist/generator/types.js +291 -1171
- package/dist/generator/types.js.map +1 -1
- package/dist/index.js +20 -7
- package/dist/index.js.map +1 -1
- package/dist/mcp/lib/documentation-provider.d.ts.map +1 -1
- package/dist/mcp/lib/documentation-provider.js +44 -42
- package/dist/mcp/lib/documentation-provider.js.map +1 -1
- package/dist/mcp/lib/generators/feature-generator.d.ts.map +1 -1
- package/dist/mcp/lib/generators/feature-generator.js +124 -73
- package/dist/mcp/lib/generators/feature-generator.js.map +1 -1
- package/dist/mcp/lib/wizards/migration-wizard.js +6 -6
- package/dist/mcp/lib/wizards/migration-wizard.js.map +1 -1
- package/dist/mcp/lib/wizards/wizard-engine.d.ts.map +1 -1
- package/dist/mcp/lib/wizards/wizard-engine.js +3 -2
- package/dist/mcp/lib/wizards/wizard-engine.js.map +1 -1
- package/dist/mcp/server/stack-mcp-server.js +1 -1
- package/dist/migration/fk-renames.d.ts +39 -0
- package/dist/migration/fk-renames.d.ts.map +1 -0
- package/dist/migration/fk-renames.js +79 -0
- package/dist/migration/fk-renames.js.map +1 -0
- package/dist/migration/generators/migration-generator.d.ts +11 -0
- package/dist/migration/generators/migration-generator.d.ts.map +1 -1
- package/dist/migration/generators/migration-generator.js +83 -150
- package/dist/migration/generators/migration-generator.js.map +1 -1
- package/dist/migration/introspectors/prisma-introspector.d.ts.map +1 -1
- package/dist/migration/introspectors/prisma-introspector.js +1 -0
- package/dist/migration/introspectors/prisma-introspector.js.map +1 -1
- package/dist/migration/junction-ids.d.ts +15 -0
- package/dist/migration/junction-ids.d.ts.map +1 -0
- package/dist/migration/junction-ids.js +58 -0
- package/dist/migration/junction-ids.js.map +1 -0
- package/dist/migration/types.d.ts +2 -0
- package/dist/migration/types.d.ts.map +1 -1
- package/package.json +27 -15
- package/dist/generator/node-build.d.ts +0 -53
- package/dist/generator/node-build.d.ts.map +0 -1
- package/dist/generator/node-build.js +0 -280
- package/dist/generator/node-build.js.map +0 -1
- package/dist/generator/prisma.d.ts +0 -30
- package/dist/generator/prisma.d.ts.map +0 -1
- package/dist/generator/prisma.js +0 -422
- package/dist/generator/prisma.js.map +0 -1
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
import { randomBytes } from 'crypto';
|
|
2
|
+
import * as fs from 'fs';
|
|
3
|
+
import * as net from 'net';
|
|
4
|
+
import * as path from 'path';
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
/**
|
|
7
|
+
* The control channel between a second-terminal `opensaas db update` and the
|
|
8
|
+
* `opensaas dev` loop serving the project.
|
|
9
|
+
*
|
|
10
|
+
* The loop is the only process that may run the reconcile: PGlite's data
|
|
11
|
+
* directory is open in the loop, every other process reaches the database
|
|
12
|
+
* through the sidecar's single multiplexed backend, and only the loop holds
|
|
13
|
+
* the staged generation and the app child it has to restart. So the second
|
|
14
|
+
* terminal opens no database connection at all — it asks the loop, and prints
|
|
15
|
+
* what the loop reports.
|
|
16
|
+
*/
|
|
17
|
+
/** The control file, inside the Generated bundle beside the Dev database's. */
|
|
18
|
+
export const CONTROL_FILE = path.join('.opensaas', 'dev-loop.json');
|
|
19
|
+
const controlFileSchema = z.object({
|
|
20
|
+
pid: z.number().int().positive(),
|
|
21
|
+
port: z.number().int().positive(),
|
|
22
|
+
token: z.string().min(1),
|
|
23
|
+
});
|
|
24
|
+
const requestSchema = z.object({
|
|
25
|
+
token: z.string(),
|
|
26
|
+
command: z.literal('db-update'),
|
|
27
|
+
plan: z.string().optional(),
|
|
28
|
+
});
|
|
29
|
+
function controlFilePath(cwd) {
|
|
30
|
+
return path.join(cwd, CONTROL_FILE);
|
|
31
|
+
}
|
|
32
|
+
function isProcessAlive(pid) {
|
|
33
|
+
try {
|
|
34
|
+
process.kill(pid, 0);
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
return error instanceof Error && 'code' in error && error.code === 'EPERM';
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Opens the loop's control channel on a free loopback port and publishes it.
|
|
43
|
+
*
|
|
44
|
+
* The token is checked on every request: the port is reachable by anything
|
|
45
|
+
* running as any user on this machine, and a request makes the loop run a
|
|
46
|
+
* schema change.
|
|
47
|
+
*
|
|
48
|
+
* @param handler - Runs the request and reports through {@link ControlReply}.
|
|
49
|
+
*/
|
|
50
|
+
export async function startControlChannel(cwd, handler) {
|
|
51
|
+
const token = randomBytes(24).toString('hex');
|
|
52
|
+
const sockets = new Set();
|
|
53
|
+
const server = net.createServer((socket) => {
|
|
54
|
+
sockets.add(socket);
|
|
55
|
+
socket.once('close', () => sockets.delete(socket));
|
|
56
|
+
socket.setEncoding('utf-8');
|
|
57
|
+
let buffered = '';
|
|
58
|
+
let handled = false;
|
|
59
|
+
const send = (message) => {
|
|
60
|
+
if (socket.writableEnded)
|
|
61
|
+
return;
|
|
62
|
+
socket.write(`${JSON.stringify(message)}\n`);
|
|
63
|
+
};
|
|
64
|
+
socket.on('data', (chunk) => {
|
|
65
|
+
if (handled)
|
|
66
|
+
return;
|
|
67
|
+
buffered += chunk;
|
|
68
|
+
const newline = buffered.indexOf('\n');
|
|
69
|
+
if (newline === -1)
|
|
70
|
+
return;
|
|
71
|
+
handled = true;
|
|
72
|
+
let parsed;
|
|
73
|
+
try {
|
|
74
|
+
parsed = JSON.parse(buffered.slice(0, newline));
|
|
75
|
+
}
|
|
76
|
+
catch {
|
|
77
|
+
send({ kind: 'result', ok: false, message: 'Unreadable control request.' });
|
|
78
|
+
socket.end();
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
const request = requestSchema.safeParse(parsed);
|
|
82
|
+
if (!request.success || request.data.token !== token) {
|
|
83
|
+
send({ kind: 'result', ok: false, message: 'Control request refused.' });
|
|
84
|
+
socket.end();
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
let finished = false;
|
|
88
|
+
const reply = {
|
|
89
|
+
log: (message) => send({ kind: 'log', message }),
|
|
90
|
+
finish: (ok, message) => {
|
|
91
|
+
if (finished)
|
|
92
|
+
return;
|
|
93
|
+
finished = true;
|
|
94
|
+
send({ kind: 'result', ok, message });
|
|
95
|
+
socket.end();
|
|
96
|
+
},
|
|
97
|
+
};
|
|
98
|
+
handler(request.data, reply)
|
|
99
|
+
.then(() => reply.finish(true, 'Done.'))
|
|
100
|
+
.catch((error) => {
|
|
101
|
+
reply.finish(false, error instanceof Error ? error.message : String(error));
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
socket.on('error', () => socket.destroy());
|
|
105
|
+
});
|
|
106
|
+
await new Promise((resolve, reject) => {
|
|
107
|
+
server.once('error', reject);
|
|
108
|
+
server.listen(0, '127.0.0.1', () => {
|
|
109
|
+
server.off('error', reject);
|
|
110
|
+
resolve();
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
const address = server.address();
|
|
114
|
+
if (address === null || typeof address === 'string') {
|
|
115
|
+
server.close();
|
|
116
|
+
throw new Error('The dev loop control channel bound no TCP port.');
|
|
117
|
+
}
|
|
118
|
+
const file = controlFilePath(cwd);
|
|
119
|
+
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
120
|
+
// `mode` reaches open(2) and so applies only to a file this call creates,
|
|
121
|
+
// and writeFileSync follows symlinks. `wx` is O_CREAT|O_EXCL, so the token
|
|
122
|
+
// only ever lands in a file this call made: 0600 holds over a pre-created
|
|
123
|
+
// world-readable one, and a planted symlink cannot redirect it somewhere
|
|
124
|
+
// readable. Removing first and retrying keeps that guarantee across the
|
|
125
|
+
// stale file a previous loop left behind, and the removal is not the write.
|
|
126
|
+
const published = `${JSON.stringify({ pid: process.pid, port: address.port, token }, null, 2)}\n`;
|
|
127
|
+
const options = { encoding: 'utf-8', mode: 0o600, flag: 'wx' };
|
|
128
|
+
try {
|
|
129
|
+
fs.writeFileSync(file, published, options);
|
|
130
|
+
}
|
|
131
|
+
catch (error) {
|
|
132
|
+
if (!(error instanceof Error && 'code' in error && error.code === 'EEXIST')) {
|
|
133
|
+
server.close();
|
|
134
|
+
throw error;
|
|
135
|
+
}
|
|
136
|
+
fs.rmSync(file, { force: true });
|
|
137
|
+
try {
|
|
138
|
+
fs.writeFileSync(file, published, options);
|
|
139
|
+
}
|
|
140
|
+
catch (retryError) {
|
|
141
|
+
server.close();
|
|
142
|
+
throw retryError;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
const clearFile = () => {
|
|
146
|
+
fs.rmSync(file, { force: true });
|
|
147
|
+
};
|
|
148
|
+
return {
|
|
149
|
+
port: address.port,
|
|
150
|
+
file,
|
|
151
|
+
clearFile,
|
|
152
|
+
async close() {
|
|
153
|
+
clearFile();
|
|
154
|
+
const closed = new Promise((resolve) => server.close(() => resolve()));
|
|
155
|
+
for (const socket of sockets)
|
|
156
|
+
socket.destroy();
|
|
157
|
+
sockets.clear();
|
|
158
|
+
await closed;
|
|
159
|
+
},
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
/** Thrown when no `opensaas dev` loop is listening in this project. */
|
|
163
|
+
export class NoDevLoopError extends Error {
|
|
164
|
+
constructor() {
|
|
165
|
+
super('No `opensaas dev` loop is running in this project. `db update` applies the staged ' +
|
|
166
|
+
'schema change against the Dev database the loop owns and restarts the app it is ' +
|
|
167
|
+
'serving, so start `opensaas dev` in another terminal first.');
|
|
168
|
+
this.name = 'NoDevLoopError';
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
/** Thrown when the loop was reached but the exchange broke off part-way. */
|
|
172
|
+
export class DevLoopUnreachableError extends Error {
|
|
173
|
+
constructor() {
|
|
174
|
+
super('The `opensaas dev` loop stopped responding while applying the schema change. It may ' +
|
|
175
|
+
'have applied part of it, so check that terminal\u2019s output before retrying.');
|
|
176
|
+
this.name = 'DevLoopUnreachableError';
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Asks the running loop to reconcile and promote, printing what it reports.
|
|
181
|
+
*
|
|
182
|
+
* @returns whether the loop reported success.
|
|
183
|
+
* @throws {NoDevLoopError} when no loop is listening.
|
|
184
|
+
* @throws {DevLoopUnreachableError} when the connection drops mid-exchange.
|
|
185
|
+
*/
|
|
186
|
+
export async function requestDatabaseUpdate(cwd, plan, log) {
|
|
187
|
+
let published;
|
|
188
|
+
try {
|
|
189
|
+
published = controlFileSchema.parse(JSON.parse(fs.readFileSync(controlFilePath(cwd), 'utf-8')));
|
|
190
|
+
}
|
|
191
|
+
catch {
|
|
192
|
+
throw new NoDevLoopError();
|
|
193
|
+
}
|
|
194
|
+
if (!isProcessAlive(published.pid))
|
|
195
|
+
throw new NoDevLoopError();
|
|
196
|
+
return await new Promise((resolve, reject) => {
|
|
197
|
+
const socket = net.createConnection({ host: '127.0.0.1', port: published.port });
|
|
198
|
+
socket.setEncoding('utf-8');
|
|
199
|
+
let buffered = '';
|
|
200
|
+
let settled = false;
|
|
201
|
+
let connected = false;
|
|
202
|
+
const settle = (outcome) => {
|
|
203
|
+
if (settled)
|
|
204
|
+
return;
|
|
205
|
+
settled = true;
|
|
206
|
+
resolve(outcome);
|
|
207
|
+
socket.end();
|
|
208
|
+
};
|
|
209
|
+
socket.once('connect', () => {
|
|
210
|
+
connected = true;
|
|
211
|
+
socket.write(`${JSON.stringify({ token: published.token, command: 'db-update', plan })}\n`);
|
|
212
|
+
});
|
|
213
|
+
socket.on('data', (chunk) => {
|
|
214
|
+
buffered += chunk;
|
|
215
|
+
for (;;) {
|
|
216
|
+
const newline = buffered.indexOf('\n');
|
|
217
|
+
if (newline === -1)
|
|
218
|
+
break;
|
|
219
|
+
const line = buffered.slice(0, newline);
|
|
220
|
+
buffered = buffered.slice(newline + 1);
|
|
221
|
+
if (line.trim().length === 0)
|
|
222
|
+
continue;
|
|
223
|
+
let message;
|
|
224
|
+
try {
|
|
225
|
+
message = JSON.parse(line);
|
|
226
|
+
}
|
|
227
|
+
catch {
|
|
228
|
+
continue;
|
|
229
|
+
}
|
|
230
|
+
if (message.kind === 'log')
|
|
231
|
+
log(message.message);
|
|
232
|
+
else {
|
|
233
|
+
log(message.message);
|
|
234
|
+
settle(message.ok);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
// Ending without a result line is the loop going away mid-exchange, which
|
|
239
|
+
// is not the same as finding no listener at all: the schema change may be
|
|
240
|
+
// half applied, so this must not send the user off to start a second loop.
|
|
241
|
+
const abandon = () => {
|
|
242
|
+
if (settled)
|
|
243
|
+
return;
|
|
244
|
+
settled = true;
|
|
245
|
+
reject(connected ? new DevLoopUnreachableError() : new NoDevLoopError());
|
|
246
|
+
};
|
|
247
|
+
socket.once('error', abandon);
|
|
248
|
+
socket.once('close', abandon);
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
//# sourceMappingURL=control.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control.js","sourceRoot":"","sources":["../../src/dev/control.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,KAAK,GAAG,MAAM,KAAK,CAAA;AAC1B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAC5B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB;;;;;;;;;;GAUG;AAEH,+EAA+E;AAC/E,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,eAAe,CAAC,CAAA;AAEnE,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACjC,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IAChC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,G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AO,CAAC,CAAA;IAC/B,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import type { ResolvedWritePaths } from '../generator/index.js';
|
|
2
|
+
/** Where a staged generation lives, inside the Generated bundle. */
|
|
3
|
+
export declare const STAGING_DIR: string;
|
|
4
|
+
/** One operation `prisma db update` planned. */
|
|
5
|
+
export interface PlannedOperation {
|
|
6
|
+
readonly label: string;
|
|
7
|
+
readonly operationClass: string;
|
|
8
|
+
}
|
|
9
|
+
/** What one `db update` run planned. */
|
|
10
|
+
export interface ReconcilePlan {
|
|
11
|
+
readonly operations: readonly PlannedOperation[];
|
|
12
|
+
/** SQL the CLI previewed, present on a `--dry-run`. */
|
|
13
|
+
readonly statements: readonly string[];
|
|
14
|
+
/** The subjects whose data the plan would lose, as `--delete` names them. */
|
|
15
|
+
readonly dataLoss: readonly string[];
|
|
16
|
+
/** The models whose rows the plan would open to more readers or writers, as `--allow` names them. */
|
|
17
|
+
readonly accessWidening: readonly string[];
|
|
18
|
+
readonly destructive: boolean;
|
|
19
|
+
}
|
|
20
|
+
/** A `db update` run that failed, carrying the CLI's own words. */
|
|
21
|
+
export interface ReconcileFailure {
|
|
22
|
+
readonly exitCode: number | null;
|
|
23
|
+
readonly output: string;
|
|
24
|
+
}
|
|
25
|
+
export type ReconcileOutcome = {
|
|
26
|
+
readonly ok: true;
|
|
27
|
+
readonly plan: ReconcilePlan;
|
|
28
|
+
} | {
|
|
29
|
+
readonly ok: false;
|
|
30
|
+
readonly failure: ReconcileFailure;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Run `prisma db update` against a staged generation and report what it
|
|
34
|
+
* planned.
|
|
35
|
+
*
|
|
36
|
+
* @param configPath - The staged Prisma config, which names the staged
|
|
37
|
+
* Contract module and the project's own migrations directory.
|
|
38
|
+
* @param options.dryRun - Plan without applying, which is how a destructive
|
|
39
|
+
* change is discovered before anything is promoted.
|
|
40
|
+
* @param options.consent - A dry run's plan whose data loss and access
|
|
41
|
+
* widening this run may carry out, passed to Prisma as `--delete` and
|
|
42
|
+
* `--allow`. A question the plan did not list stays unanswered, so a plan
|
|
43
|
+
* that changed since the dry run fails rather than applying unasked.
|
|
44
|
+
*/
|
|
45
|
+
export declare function planDatabaseUpdate(cwd: string, configPath: string, options?: {
|
|
46
|
+
dryRun?: boolean;
|
|
47
|
+
consent?: ReconcilePlan;
|
|
48
|
+
}): Promise<ReconcileOutcome>;
|
|
49
|
+
/** A `refs/*.json` file and the bytes it held before the loop planned anything. */
|
|
50
|
+
interface RefSnapshot {
|
|
51
|
+
readonly file: string;
|
|
52
|
+
readonly contents: string;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* The migrations graph's named refs, as they stand.
|
|
56
|
+
*
|
|
57
|
+
* The loop owns these: `db update` advances the `db` ref to the contract it
|
|
58
|
+
* just reached, so a plan the loop discards has to leave the refs where it
|
|
59
|
+
* found them — otherwise the discarded schema's ref shadows the source
|
|
60
|
+
* contract on the next plan (ADR-0063).
|
|
61
|
+
*/
|
|
62
|
+
export declare function snapshotMigrationRefs(cwd: string): readonly RefSnapshot[];
|
|
63
|
+
/**
|
|
64
|
+
* Puts every snapshotted ref back, and removes any extra ref the run
|
|
65
|
+
* introduced into a space the snapshot already knew about.
|
|
66
|
+
*
|
|
67
|
+
* A space with no snapshotted ref at all was seeded by this run's own
|
|
68
|
+
* `generate` — a newly declared pack reaching `migrations/` for the first
|
|
69
|
+
* time — and is left untouched. That ref is not a discarded run's leftover;
|
|
70
|
+
* it is the new space's only record of itself, and deleting it strands the
|
|
71
|
+
* migration package `seedExtensionContractSpaces` just wrote refless (#1226).
|
|
72
|
+
*
|
|
73
|
+
* "No snapshotted ref" is a proxy for "space didn't exist yet," not a
|
|
74
|
+
* directly-checked fact: a space that existed before this run but already had
|
|
75
|
+
* no ref (already broken, by some other cause) reads the same way, and this
|
|
76
|
+
* run's own ref for it survives the prune too. That is no worse than the
|
|
77
|
+
* space already being broken.
|
|
78
|
+
*/
|
|
79
|
+
export declare function restoreMigrationRefs(cwd: string, snapshots: readonly RefSnapshot[]): void;
|
|
80
|
+
/**
|
|
81
|
+
* Restores the refs after an applied reconcile, unless the app space has no
|
|
82
|
+
* migration package yet: then Prisma's `db` ref write stays, because
|
|
83
|
+
* `migration plan --name init` derives its baseline from it (ADR-0065).
|
|
84
|
+
*/
|
|
85
|
+
export declare function restoreRefsAfterReconcile(cwd: string, snapshots: readonly RefSnapshot[]): void;
|
|
86
|
+
/** Thrown when promotion stopped part-way, leaving the live bundle split. */
|
|
87
|
+
export declare class PartialPromotionError extends Error {
|
|
88
|
+
/** The live files that already carry the staged generation. */
|
|
89
|
+
readonly promoted: readonly string[];
|
|
90
|
+
/** The live file the failure stopped on, still carrying the previous generation. */
|
|
91
|
+
readonly failedOn: string;
|
|
92
|
+
constructor(promoted: readonly string[], failedOn: string, cause: unknown);
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Move a staged generation into the places the app reads: the Contract module
|
|
96
|
+
* and its emitted artifacts, then the whole bundle directory — enumerating the
|
|
97
|
+
* bundle would strand the extra files a plugin's `afterGenerate` writes there.
|
|
98
|
+
* Called only once the database carries the schema they describe.
|
|
99
|
+
*
|
|
100
|
+
* Each file lands atomically. The set of them does not: the filesystem offers
|
|
101
|
+
* no multi-file commit, and a mid-promotion reader from another process can
|
|
102
|
+
* observe a mix of old and new artifacts (ADR-0072). This order is a stated,
|
|
103
|
+
* not incidental, response to that:
|
|
104
|
+
*
|
|
105
|
+
* - `tables.ts` is derived from the same computation as the Contract module
|
|
106
|
+
* (ADR-0051), so it lands immediately after the contract artifacts rather
|
|
107
|
+
* than wherever the bundle directory's unordered `readdirSync` happens to
|
|
108
|
+
* place it — narrowing, not closing, the window in which the two could
|
|
109
|
+
* disagree.
|
|
110
|
+
* - `prisma.config.ts` lands **last**, so its landing is the one signal that
|
|
111
|
+
* the whole set is in place — the ordering an outside observer's own
|
|
112
|
+
* end-of-promotion signal (a log line printed after this function returns,
|
|
113
|
+
* for instance) can rely on without inspecting anything else.
|
|
114
|
+
*
|
|
115
|
+
* A failure part-way through throws {@link PartialPromotionError} naming the
|
|
116
|
+
* split rather than a bare copy error.
|
|
117
|
+
*
|
|
118
|
+
* @throws {PartialPromotionError} when promotion stops after the first file.
|
|
119
|
+
*/
|
|
120
|
+
export declare function promoteStagedGeneration(staged: ResolvedWritePaths, live: ResolvedWritePaths, stagingDir: string): void;
|
|
121
|
+
/** Formats a plan the way the loop reports one that it is not applying. */
|
|
122
|
+
export declare function describePlan(plan: ReconcilePlan): string[];
|
|
123
|
+
/** A short, stable id for a plan, derived from its operations. */
|
|
124
|
+
export declare function planId(plan: ReconcilePlan): string;
|
|
125
|
+
export {};
|
|
126
|
+
//# sourceMappingURL=staged-reconcile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"staged-reconcile.d.ts","sourceRoot":"","sources":["../../src/dev/staged-reconcile.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAE/D,oEAAoE;AACpE,eAAO,MAAM,WAAW,QAAmC,CAAA;AAE3D,gDAAgD;AAChD,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;CAChC;AAED,wCAAwC;AACxC,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,UAAU,EAAE,SAAS,gBAAgB,EAAE,CAAA;IAChD,uDAAuD;IACvD,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAA;IACtC,6EAA6E;IAC7E,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAA;IACpC,qGAAqG;IACrG,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAA;IAC1C,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAA;CAC9B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