@lunora/cli 1.0.0-alpha.248 → 1.0.0-alpha.249
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/bin.mjs +1 -1
- package/dist/index.d.mts +189 -34
- package/dist/index.d.ts +189 -34
- package/dist/index.mjs +1 -1
- package/dist/packem_chunks/dispatch.mjs +1 -0
- package/dist/packem_chunks/handler.mjs +1 -1
- package/dist/packem_chunks/handler10.mjs +1 -3
- package/dist/packem_chunks/handler11.mjs +2 -2
- package/dist/packem_chunks/handler12.mjs +1 -1
- package/dist/packem_chunks/handler13.mjs +1 -1
- package/dist/packem_chunks/handler14.mjs +1 -1
- package/dist/packem_chunks/handler15.mjs +1 -1
- package/dist/packem_chunks/handler16.mjs +2 -2
- package/dist/packem_chunks/handler17.mjs +1 -1
- package/dist/packem_chunks/handler18.mjs +1 -1
- package/dist/packem_chunks/handler19.mjs +7 -7
- package/dist/packem_chunks/handler2.mjs +1 -2
- package/dist/packem_chunks/handler20.mjs +1 -1
- package/dist/packem_chunks/handler21.mjs +1 -1
- package/dist/packem_chunks/handler22.mjs +3 -3
- package/dist/packem_chunks/handler23.mjs +1 -1
- package/dist/packem_chunks/handler24.mjs +2 -2
- package/dist/packem_chunks/handler25.mjs +15 -15
- package/dist/packem_chunks/handler26.mjs +8 -8
- package/dist/packem_chunks/handler3.mjs +1 -1
- package/dist/packem_chunks/handler4.mjs +1 -1
- package/dist/packem_chunks/handler5.mjs +1 -1
- package/dist/packem_chunks/handler6.mjs +1 -1
- package/dist/packem_chunks/handler7.mjs +3 -3
- package/dist/packem_chunks/handler8.mjs +1 -1
- package/dist/packem_chunks/handler9.mjs +1 -1
- package/dist/packem_chunks/planDevCommand.mjs +6 -6
- package/dist/packem_chunks/runCodegenCommand.mjs +4 -4
- package/dist/packem_chunks/runDeployCommand.mjs +3 -3
- package/dist/packem_chunks/runInitCommand.mjs +52 -52
- package/dist/packem_chunks/runResetCommand.mjs +1 -1
- package/dist/packem_chunks/runRpcCommand.mjs +1 -1
- package/dist/packem_shared/COMMANDS-DEcogfwP.mjs +1 -0
- package/dist/packem_shared/DEFAULT_IMPORT_BATCH_SIZE-BgMPHEoe.mjs +1 -0
- package/dist/packem_shared/EXIT_CODE-08cwt3MK.mjs +1 -0
- package/dist/packem_shared/cli-CSnnYlA3.mjs +2 -0
- package/dist/packem_shared/command-Mmxzxyr5.mjs +1 -0
- package/dist/packem_shared/commands-Dr7KeeZ9.mjs +13 -0
- package/dist/packem_shared/createRecordingSpawner-sS7LEN7x.mjs +1 -0
- package/dist/packem_shared/import-D7qdpSmJ.mjs +12 -0
- package/dist/packem_shared/{prompt-cancelled-C8Sj7OqI.mjs → prompt-cancelled-BvsNxg_Q.mjs} +1 -1
- package/dist/packem_shared/render-lunora-error--4tmM6mt.mjs +3 -0
- package/dist/packem_shared/{resolve-B9ReA3FV.mjs → resolve-ZDra033Q.mjs} +2 -2
- package/dist/packem_shared/{resolve-target-BRvw8Pf7.mjs → resolve-target-C_ZloTvd.mjs} +1 -1
- package/dist/packem_shared/runAddCommand-M8Z6aCaL.mjs +1 -0
- package/dist/packem_shared/runExportCommand-LEwEr8p0.mjs +5 -0
- package/dist/packem_shared/runMigrateGenerateCommand-BMS_KnVC.mjs +11 -0
- package/dist/packem_shared/{storage-B0ixDDxG.mjs → storage-BEbcFWu4.mjs} +1 -1
- package/dist/packem_shared/{tui-prompts-DzYd2fL3.mjs → tui-prompts-B3YwUhGw.mjs} +1 -1
- package/dist/packem_shared/{wrangler-secrets-CCdt0mUl.mjs → wrangler-secrets-C9lJnd5N.mjs} +1 -1
- package/package.json +11 -11
- package/skills/lunora/SKILL.md +58 -0
- package/skills/lunora-functions/SKILL.md +42 -0
- package/skills/lunora-performance-audit/SKILL.md +37 -1
- package/skills/lunora-realtime/SKILL.md +15 -9
- package/dist/packem_chunks/runMigrateGenerateCommand.mjs +0 -11
- package/dist/packem_shared/COMMANDS-Z-YcPyYn.mjs +0 -1
- package/dist/packem_shared/DEFAULT_IMPORT_BATCH_SIZE-BMH-ZXl5.mjs +0 -1
- package/dist/packem_shared/cli-CbScYTbi.mjs +0 -3
- package/dist/packem_shared/command-CrAs0XG_.mjs +0 -1
- package/dist/packem_shared/commands-I18aR_DJ.mjs +0 -15
- package/dist/packem_shared/createRecordingSpawner-DJlNacZ6.mjs +0 -1
- package/dist/packem_shared/import-Dqd1MOOv.mjs +0 -12
- package/dist/packem_shared/output-format-B91O3X28.mjs +0 -2
- package/dist/packem_shared/runAddCommand-BXea8slz.mjs +0 -1
- package/dist/packem_shared/runExportCommand-Dq-SpjAe.mjs +0 -5
package/dist/bin.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{r as e}from"./packem_shared/cli-
|
|
2
|
+
import{r as e}from"./packem_shared/cli-CSnnYlA3.mjs";try{const r=await e();process.exit(r)}catch(r){process.stderr.write(`${r instanceof Error?r.message:String(r)}
|
|
3
3
|
`),process.exit(1)}
|
package/dist/index.d.mts
CHANGED
|
@@ -58,12 +58,53 @@ declare const createLogger: () => Logger;
|
|
|
58
58
|
* the package barrel) stays side-effect-free.
|
|
59
59
|
*/
|
|
60
60
|
declare const pail: PailLogger;
|
|
61
|
+
/**
|
|
62
|
+
* The two renderings every Lunora command speaks. `pretty` is the human-facing
|
|
63
|
+
* default; `json` puts the command's structured result on stdout as a single
|
|
64
|
+
* JSON document and moves every human line to stderr.
|
|
65
|
+
*
|
|
66
|
+
* Resolved ONCE, by `defineHandler`, from the raw `--format` string — a command
|
|
67
|
+
* body receives this narrowed type and never re-validates it.
|
|
68
|
+
*/
|
|
69
|
+
type OutputFormat = "json" | "pretty";
|
|
70
|
+
/**
|
|
71
|
+
* The envelope `--format json` puts on stdout — the same three keys for every
|
|
72
|
+
* command, so a consumer parses one shape and never has to know which command
|
|
73
|
+
* produced it.
|
|
74
|
+
*
|
|
75
|
+
* - `code` is the exit code the process will terminate with.
|
|
76
|
+
* - `data` is the command's own payload, and is absent when the run produced
|
|
77
|
+
* none — which is what a failure before any work looks like.
|
|
78
|
+
* - `error` is the single-line reason for a non-zero `code`. It is the half that
|
|
79
|
+
* makes a FAILURE machine-readable: before the envelope, a failed command wrote
|
|
80
|
+
* nothing at all to stdout and the reason could only be scraped out of English
|
|
81
|
+
* prose on stderr.
|
|
82
|
+
*
|
|
83
|
+
* `defineHandler` serializes exactly these keys, once, after the body returns —
|
|
84
|
+
* so a body may return a richer result for its in-process callers without
|
|
85
|
+
* widening the document, and a failure gets one for free.
|
|
86
|
+
*/
|
|
87
|
+
interface CommandResult<TData> {
|
|
88
|
+
/** Process exit code — one of `EXIT_CODE`. */
|
|
89
|
+
code: number;
|
|
90
|
+
/** The command's structured payload. Absent when the run produced none. */
|
|
91
|
+
data?: TData;
|
|
92
|
+
/**
|
|
93
|
+
* Set by a command that forwards `--format json` to a child process which
|
|
94
|
+
* writes the document itself (`wrangler … --json`, `wrangler tail`). The
|
|
95
|
+
* envelope is suppressed for that run: stdout already carries exactly one
|
|
96
|
+
* document, and appending a second would make the stream unparseable.
|
|
97
|
+
*/
|
|
98
|
+
delegated?: boolean;
|
|
99
|
+
/** Why the run failed. Set whenever `code` is non-zero and a reason is known. */
|
|
100
|
+
error?: string;
|
|
101
|
+
}
|
|
61
102
|
interface CodegenCommandOptions {
|
|
62
103
|
/** Which API spec(s) to emit. Defaults to codegen's `"openapi"` when omitted. */
|
|
63
104
|
apiSpec?: ApiSpec;
|
|
64
105
|
cwd?: string;
|
|
65
106
|
/** Output format: `pretty` (default) or `json`. */
|
|
66
|
-
format?:
|
|
107
|
+
format?: OutputFormat;
|
|
67
108
|
logger: Logger;
|
|
68
109
|
/**
|
|
69
110
|
* Fail the run when any ERROR-level advisory is reported. Defaults to CI
|
|
@@ -74,7 +115,8 @@ interface CodegenCommandOptions {
|
|
|
74
115
|
/** Deploy target the emitted `ctx.*` surface is tailored to. Resolved by the caller; falls back to `"target"` in `lunora.config.*`, then `"cloudflare"`. */
|
|
75
116
|
target?: string;
|
|
76
117
|
}
|
|
77
|
-
|
|
118
|
+
/** The `--format json` payload: what codegen wrote, and what it has to say about it. */
|
|
119
|
+
interface CodegenCommandData {
|
|
78
120
|
advisories: ReadonlyArray<{
|
|
79
121
|
detail: string;
|
|
80
122
|
level: Finding["level"];
|
|
@@ -82,12 +124,21 @@ interface CodegenCommandResult {
|
|
|
82
124
|
remediation: string;
|
|
83
125
|
}>;
|
|
84
126
|
cronTriggers: ReadonlyArray<string>;
|
|
85
|
-
/** Set when the run failed: an invalid `--format`, an unregistered target, or an error-level platform diagnostic. */
|
|
86
|
-
error?: string;
|
|
87
127
|
/** ERROR-level advisories that made the run fail, when strict mode is on. */
|
|
88
128
|
failedAdvisories: number;
|
|
89
129
|
outputDirectory: string;
|
|
90
130
|
}
|
|
131
|
+
interface CodegenCommandResult extends CodegenCommandData {
|
|
132
|
+
/**
|
|
133
|
+
* Exit code, when the run resolved one itself. Only a USAGE refusal does —
|
|
134
|
+
* every other outcome is classified from `error`/`failedAdvisories` by
|
|
135
|
+
* `execute`, which cannot tell a bad `--format` (the invocation is wrong,
|
|
136
|
+
* exit 2) from a failed codegen (exit 1) after the fact.
|
|
137
|
+
*/
|
|
138
|
+
code?: number;
|
|
139
|
+
/** Set when the run failed: an unregistered target, or an error-level platform diagnostic. */
|
|
140
|
+
error?: string;
|
|
141
|
+
}
|
|
91
142
|
declare const runCodegenCommand: (options: CodegenCommandOptions) => CodegenCommandResult;
|
|
92
143
|
/**
|
|
93
144
|
* Minimal projection of `globalThis.fetch` for the transfer commands: `body` is
|
|
@@ -111,6 +162,12 @@ type StreamingFetchLike = (input: string, init?: {
|
|
|
111
162
|
interface ExportCommandOptions {
|
|
112
163
|
cwd?: string;
|
|
113
164
|
fetchImpl?: StreamingFetchLike;
|
|
165
|
+
/**
|
|
166
|
+
* Output format: `pretty` (default) or `json`. `json` reports the run as a
|
|
167
|
+
* single document and therefore requires a file destination — with `--out -`
|
|
168
|
+
* (or none) stdout already carries the NDJSON stream.
|
|
169
|
+
*/
|
|
170
|
+
format?: OutputFormat;
|
|
114
171
|
logger: Logger;
|
|
115
172
|
/** Output file path; `undefined`/`-` streams to stdout. */
|
|
116
173
|
out?: string;
|
|
@@ -123,9 +180,17 @@ interface ExportCommandOptions {
|
|
|
123
180
|
/** Worker URL (default `http://localhost:8787`). */
|
|
124
181
|
url?: string;
|
|
125
182
|
}
|
|
126
|
-
|
|
183
|
+
/** The `--format json` payload: what was dumped, from which tables, and where to. */
|
|
184
|
+
interface ExportCommandData {
|
|
185
|
+
bytes: number;
|
|
186
|
+
/** The file the dump landed in. */
|
|
187
|
+
out: string;
|
|
188
|
+
rows: number;
|
|
189
|
+
/** The table allowlist, omitted when the export covered every table. */
|
|
190
|
+
tables?: string[];
|
|
191
|
+
}
|
|
192
|
+
interface ExportCommandResult extends CommandResult<ExportCommandData> {
|
|
127
193
|
bytes: number;
|
|
128
|
-
code: number;
|
|
129
194
|
/** Number of NDJSON lines streamed (0 on error). */
|
|
130
195
|
rows: number;
|
|
131
196
|
}
|
|
@@ -213,6 +278,8 @@ interface ImportCommandOptions {
|
|
|
213
278
|
fetchImpl?: StreamingFetchLike;
|
|
214
279
|
/** Source NDJSON file. Required. */
|
|
215
280
|
file: string;
|
|
281
|
+
/** Output format: `pretty` (default) or `json`. */
|
|
282
|
+
format?: OutputFormat;
|
|
216
283
|
/**
|
|
217
284
|
* Which reader to use. Omit to auto-detect between a Convex export snapshot
|
|
218
285
|
* and a plain NDJSON file; `supabase`/`firebase` must be explicit, because a
|
|
@@ -284,9 +351,15 @@ interface ImportSummary {
|
|
|
284
351
|
};
|
|
285
352
|
warnings?: string[];
|
|
286
353
|
}
|
|
287
|
-
|
|
354
|
+
/** The `--format json` payload: which file went in, and what the endpoint made of it. */
|
|
355
|
+
interface ImportCommandData {
|
|
356
|
+
file: string;
|
|
357
|
+
inserted: number;
|
|
358
|
+
/** The batcher's own roll-up: inserted-per-table, conflicts, row errors, unreached shards. */
|
|
359
|
+
summary: ImportSummary;
|
|
360
|
+
}
|
|
361
|
+
interface ImportCommandResult extends CommandResult<ImportCommandData> {
|
|
288
362
|
body: ImportSummary | undefined;
|
|
289
|
-
code: number;
|
|
290
363
|
/** Total inserted rows across batches. */
|
|
291
364
|
inserted: number;
|
|
292
365
|
}
|
|
@@ -296,6 +369,50 @@ declare const runImportCommand: (options: ImportCommandOptions) => Promise<Impor
|
|
|
296
369
|
* stub; production uses {@link isDockerAvailable}.
|
|
297
370
|
*/
|
|
298
371
|
type DockerProbe = () => boolean;
|
|
372
|
+
/**
|
|
373
|
+
* Every exit code `lunora` can terminate with. Stable — a value never changes
|
|
374
|
+
* meaning, and a new bucket takes the next free number.
|
|
375
|
+
*/
|
|
376
|
+
declare const EXIT_CODE: {
|
|
377
|
+
/** The command did what was asked. */
|
|
378
|
+
readonly SUCCESS: 0;
|
|
379
|
+
/** A failure that fits none of the narrower buckets. */
|
|
380
|
+
readonly FAILURE: 1;
|
|
381
|
+
/** Bad usage, bad input, or a validation failure — the invocation itself, or the project source it read, is wrong. */
|
|
382
|
+
readonly USAGE: 2;
|
|
383
|
+
/** Not authenticated: no credential, or an expired one. */
|
|
384
|
+
readonly AUTH: 3;
|
|
385
|
+
/** Authenticated, but not allowed to do this. */
|
|
386
|
+
readonly PERMISSION: 4;
|
|
387
|
+
/** The named thing does not exist. */
|
|
388
|
+
readonly NOT_FOUND: 5;
|
|
389
|
+
/** The write lost a race, or the name is already taken. */
|
|
390
|
+
readonly CONFLICT: 6;
|
|
391
|
+
/** Rate limited — back off and retry. */
|
|
392
|
+
readonly RATE_LIMITED: 7;
|
|
393
|
+
/** The far side is unavailable or timed out. Retryable. */
|
|
394
|
+
readonly UNAVAILABLE: 8;
|
|
395
|
+
/** A local tool the command shells out to (wrangler, git, docker, …) is missing, or not running. */
|
|
396
|
+
readonly MISSING_DEPENDENCY: 9;
|
|
397
|
+
/** Interactive cancel — the POSIX `128 + SIGINT` convention. */
|
|
398
|
+
readonly CANCELLED: 130;
|
|
399
|
+
};
|
|
400
|
+
/** One of {@link EXIT_CODE}'s values. */
|
|
401
|
+
type ExitCode = (typeof EXIT_CODE)[keyof typeof EXIT_CODE];
|
|
402
|
+
/** The exit code for a transport status; `undefined` and anything unmapped are a general failure. */
|
|
403
|
+
declare const exitCodeForStatus: (status: number | undefined) => ExitCode;
|
|
404
|
+
/**
|
|
405
|
+
* The exit code for a Lunora error `code`, resolved through the catalog. An
|
|
406
|
+
* unregistered code has no status to derive from, so it is a general failure.
|
|
407
|
+
*/
|
|
408
|
+
declare const exitCodeForCode: (code: string) => ExitCode;
|
|
409
|
+
/**
|
|
410
|
+
* The exit code for a thrown value. A Lunora error is classified by its `code`
|
|
411
|
+
* (override table first) and then by the `status` the instance carries — which
|
|
412
|
+
* is the catalog's, unless the throw site passed a more specific one (the
|
|
413
|
+
* upstream-API codes do). Anything else is a general failure.
|
|
414
|
+
*/
|
|
415
|
+
declare const exitCodeForError: (error: unknown) => ExitCode;
|
|
299
416
|
/**
|
|
300
417
|
* The shared `/_lunora/health` probe used by `lunora verify --health-url` and
|
|
301
418
|
* `lunora deploy --health-check`.
|
|
@@ -429,6 +546,8 @@ interface RunCommandOptions {
|
|
|
429
546
|
claims?: string;
|
|
430
547
|
cwd?: string;
|
|
431
548
|
fetchImpl?: FetchLike;
|
|
549
|
+
/** Output format: `pretty` (default) or `json`. */
|
|
550
|
+
format?: OutputFormat;
|
|
432
551
|
functionPath: string;
|
|
433
552
|
logger: Logger;
|
|
434
553
|
shard?: string;
|
|
@@ -439,6 +558,8 @@ interface RunCommandOptions {
|
|
|
439
558
|
interface RunCommandResult {
|
|
440
559
|
body: unknown;
|
|
441
560
|
code: number;
|
|
561
|
+
/** Why the call failed before (or at) the RPC, for the `--format json` envelope. */
|
|
562
|
+
error?: string;
|
|
442
563
|
requestUrl: string;
|
|
443
564
|
}
|
|
444
565
|
declare const runRpcCommand: (options: RunCommandOptions) => Promise<RunCommandResult>;
|
|
@@ -474,7 +595,7 @@ interface DeployCommandOptions {
|
|
|
474
595
|
/** Fetch implementation injected in tests for `--migrate` RPC calls. */
|
|
475
596
|
fetchImpl?: FetchLike;
|
|
476
597
|
/** Output format: `pretty` (default) or `json`. */
|
|
477
|
-
format?:
|
|
598
|
+
format?: OutputFormat;
|
|
478
599
|
/**
|
|
479
600
|
* After a successful live deploy, probe the new version's health route
|
|
480
601
|
* (`/_lunora/health/ready`, falling back to `/_lunora/health`) and fail the
|
|
@@ -651,9 +772,9 @@ interface DeployCommandResult {
|
|
|
651
772
|
*/
|
|
652
773
|
type PreDeployCommand = "build" | "deploy" | "prepare";
|
|
653
774
|
/**
|
|
654
|
-
* Run a deploy
|
|
655
|
-
*
|
|
656
|
-
*
|
|
775
|
+
* Run a deploy. In `--format json` mode the human/progress channel is already on
|
|
776
|
+
* stderr (`defineHandler` routed it) and the Vercel-style summary is skipped, so
|
|
777
|
+
* stdout is left to the single result document `execute` returns.
|
|
657
778
|
*/
|
|
658
779
|
declare const runDeployCommand: (options: DeployCommandOptions) => Promise<DeployCommandResult>;
|
|
659
780
|
/**
|
|
@@ -945,6 +1066,23 @@ type CiProvider = "github" | "gitlab";
|
|
|
945
1066
|
type AuthUiItem = "auth-ui-angular" | "auth-ui-react" | "auth-ui-solid" | "auth-ui-solid-v2" | "auth-ui-svelte" | "auth-ui-vue";
|
|
946
1067
|
/** A registry item a feature can install. */
|
|
947
1068
|
type FeatureItem = "auth" | "auth-auth0" | "auth-clerk" | AuthUiItem | "mail";
|
|
1069
|
+
/** One catalog entry as `lunora registry list` reports it. */
|
|
1070
|
+
interface CatalogItem {
|
|
1071
|
+
description?: string;
|
|
1072
|
+
name: string;
|
|
1073
|
+
}
|
|
1074
|
+
/** A built index entry (catalog item plus its short `title`). */
|
|
1075
|
+
interface IndexItem extends CatalogItem {
|
|
1076
|
+
title?: string;
|
|
1077
|
+
}
|
|
1078
|
+
/**
|
|
1079
|
+
* Build the catalog (`index.json` contents) from a local registry root by
|
|
1080
|
+
* reading every item's `registry.json`. Used by both `lunora registry build`
|
|
1081
|
+
* and the registry tests so the committed index can't drift from the item dirs.
|
|
1082
|
+
*/
|
|
1083
|
+
declare const buildRegistryIndex: (root: string) => {
|
|
1084
|
+
items: IndexItem[];
|
|
1085
|
+
};
|
|
948
1086
|
/** A single file the item scaffolds into the project. */
|
|
949
1087
|
interface RegistryFile {
|
|
950
1088
|
/** Source path inside the item dir (e.g. `schema.ts`). */
|
|
@@ -1015,10 +1153,10 @@ interface AddCommandOptions {
|
|
|
1015
1153
|
diff?: boolean;
|
|
1016
1154
|
/** Print the plan and stop without writing anything. */
|
|
1017
1155
|
dryRun?: boolean;
|
|
1156
|
+
/** Output format: `pretty` (default) or `json` — a JSON snapshot of the plan/list. */
|
|
1157
|
+
format?: OutputFormat;
|
|
1018
1158
|
/** Local registry root (offline / tests). Expects per-item subdirs, each with a `registry.json`. */
|
|
1019
1159
|
from?: string;
|
|
1020
|
-
/** Emit a JSON snapshot of the plan/result. */
|
|
1021
|
-
json?: boolean;
|
|
1022
1160
|
/** `--list`: enumerate available items instead of adding. */
|
|
1023
1161
|
list?: boolean;
|
|
1024
1162
|
logger: Logger;
|
|
@@ -1042,10 +1180,42 @@ interface AddCommandOptions {
|
|
|
1042
1180
|
/** Skip the package.json mutation confirmation prompt. */
|
|
1043
1181
|
yes?: boolean;
|
|
1044
1182
|
}
|
|
1045
|
-
|
|
1183
|
+
/**
|
|
1184
|
+
* One item in the `--format json` plan snapshot. Carries the concrete binding
|
|
1185
|
+
* VALUES, not just the key paths, so a plan consumer can audit the mutation
|
|
1186
|
+
* before it is applied.
|
|
1187
|
+
*/
|
|
1188
|
+
interface RegistryPlanItem {
|
|
1189
|
+
bindings: {
|
|
1190
|
+
path: string;
|
|
1191
|
+
value: unknown;
|
|
1192
|
+
}[];
|
|
1193
|
+
deps: string[];
|
|
1194
|
+
devDependencies: string[];
|
|
1195
|
+
entrypointReexports: {
|
|
1196
|
+
comment?: string;
|
|
1197
|
+
module: string;
|
|
1198
|
+
}[];
|
|
1199
|
+
envVars: {
|
|
1200
|
+
name: string;
|
|
1201
|
+
secret?: boolean;
|
|
1202
|
+
value?: string;
|
|
1203
|
+
}[];
|
|
1204
|
+
files: {
|
|
1205
|
+
merge: RegistryFile["merge"];
|
|
1206
|
+
to: string;
|
|
1207
|
+
}[];
|
|
1208
|
+
name: string;
|
|
1209
|
+
requires: ReadonlyArray<string>;
|
|
1210
|
+
title?: string;
|
|
1211
|
+
}
|
|
1212
|
+
/** The `--format json` payload: the catalog (`list`) or the resolved plan (`add`). */
|
|
1213
|
+
interface RegistryCommandData {
|
|
1214
|
+
items: ReadonlyArray<CatalogItem | RegistryPlanItem>;
|
|
1215
|
+
}
|
|
1216
|
+
interface AddCommandResult extends CommandResult<RegistryCommandData> {
|
|
1046
1217
|
/** Bindings written to wrangler.jsonc. */
|
|
1047
1218
|
bindings: ReadonlyArray<string>;
|
|
1048
|
-
code: number;
|
|
1049
1219
|
/** Deps added to package.json. */
|
|
1050
1220
|
deps: ReadonlyArray<string>;
|
|
1051
1221
|
/** Files skipped because they already existed. */
|
|
@@ -1272,27 +1442,12 @@ interface MigrateGenerateCommandResult {
|
|
|
1272
1442
|
code: number;
|
|
1273
1443
|
/** Whether the diff was empty (no changes detected). */
|
|
1274
1444
|
empty: boolean;
|
|
1445
|
+
/** Why it failed, when the reason is known — the shared `CommandResult` contract. */
|
|
1446
|
+
error?: string;
|
|
1275
1447
|
/** Absolute path to the migration file (empty string when nothing was written). */
|
|
1276
1448
|
migrationFile: string;
|
|
1277
1449
|
}
|
|
1278
1450
|
declare const runMigrateGenerateCommand: (options: MigrateGenerateCommandOptions) => MigrateGenerateCommandResult;
|
|
1279
|
-
/** One catalog entry as `lunora registry list` reports it. */
|
|
1280
|
-
interface CatalogItem {
|
|
1281
|
-
description?: string;
|
|
1282
|
-
name: string;
|
|
1283
|
-
}
|
|
1284
|
-
/** A built index entry (catalog item plus its short `title`). */
|
|
1285
|
-
interface IndexItem extends CatalogItem {
|
|
1286
|
-
title?: string;
|
|
1287
|
-
}
|
|
1288
|
-
/**
|
|
1289
|
-
* Build the catalog (`index.json` contents) from a local registry root by
|
|
1290
|
-
* reading every item's `registry.json`. Used by both `lunora registry build`
|
|
1291
|
-
* and the registry tests so the committed index can't drift from the item dirs.
|
|
1292
|
-
*/
|
|
1293
|
-
declare const buildRegistryIndex: (root: string) => {
|
|
1294
|
-
items: IndexItem[];
|
|
1295
|
-
};
|
|
1296
1451
|
/** `lunora registry add` (one or more item names): scaffold items into the project. */
|
|
1297
1452
|
declare const runAddCommand: (options: AddCommandOptions) => Promise<AddCommandResult>;
|
|
1298
1453
|
/**
|
|
@@ -1423,4 +1578,4 @@ declare const diffSnapshots: (previous: SchemaSnapshot | undefined, next: Schema
|
|
|
1423
1578
|
*/
|
|
1424
1579
|
declare const renderMigrationFile: (name: string, diff: SchemaDiff, generatedAt: string) => string;
|
|
1425
1580
|
declare const schemaIrToSnapshot: (ir: SchemaIR) => SchemaSnapshot;
|
|
1426
|
-
export { type AddCommandOptions, type AddCommandResult, COMMANDS, type ColumnSnapshot, type CommandName, DEFAULT_IMPORT_BATCH_SIZE, type DeployCommandOptions, type DeployCommandResult, type DeployedIdentity, type DevCommandOptions, type DevCommandPlan, type DiffEntry, type ExportCommandOptions, type ExportCommandResult, type FetchLike, type ImportCommandOptions, type ImportCommandResult, type IndexSnapshot, type InitCommandOptions, type InitCommandResult, type InsertSchemaExtensionResult, type Logger, type MigrateGenerateCommandOptions, type MigrateGenerateCommandResult, type RecordedSpawn, type RegistryBinding, type RegistryFile, type RegistryManifest, type ResetCommandOptions, type ResetCommandResult, type RunCliOptions, type RunCommandOptions, type RunCommandResult, type SchemaDiff, type SchemaSnapshot, type SpawnDescriptor, type SpawnResult, type Spawner, type StreamingFetchLike, type TableSnapshot, type Template, type UnsupportedEntry, VERSION, buildRegistryIndex, createLogger, createRecordingSpawner, defaultSpawner, diffSnapshots, insertSchemaExtension, pail, parseManifest, planDevCommand, renderAddColumn, renderCreateIndex, renderCreateTable, renderDropIndex, renderDropTable, renderMigrationFile, runAddCommand, runBuildIndexCommand, runCli, runCodegenCommand, runDeployCommand, runDevCommand, runExportCommand, runImportCommand, runInitCommand, runMigrateGenerateCommand, runRegistryViewCommand, runResetCommand, runRpcCommand, schemaIrToSnapshot, validatorKindToSqlType };
|
|
1581
|
+
export { type AddCommandOptions, type AddCommandResult, COMMANDS, type ColumnSnapshot, type CommandName, DEFAULT_IMPORT_BATCH_SIZE, type DeployCommandOptions, type DeployCommandResult, type DeployedIdentity, type DevCommandOptions, type DevCommandPlan, type DiffEntry, EXIT_CODE, type ExitCode, type ExportCommandOptions, type ExportCommandResult, type FetchLike, type ImportCommandOptions, type ImportCommandResult, type IndexSnapshot, type InitCommandOptions, type InitCommandResult, type InsertSchemaExtensionResult, type Logger, type MigrateGenerateCommandOptions, type MigrateGenerateCommandResult, type RecordedSpawn, type RegistryBinding, type RegistryFile, type RegistryManifest, type ResetCommandOptions, type ResetCommandResult, type RunCliOptions, type RunCommandOptions, type RunCommandResult, type SchemaDiff, type SchemaSnapshot, type SpawnDescriptor, type SpawnResult, type Spawner, type StreamingFetchLike, type TableSnapshot, type Template, type UnsupportedEntry, VERSION, buildRegistryIndex, createLogger, createRecordingSpawner, defaultSpawner, diffSnapshots, exitCodeForCode, exitCodeForError, exitCodeForStatus, insertSchemaExtension, pail, parseManifest, planDevCommand, renderAddColumn, renderCreateIndex, renderCreateTable, renderDropIndex, renderDropTable, renderMigrationFile, runAddCommand, runBuildIndexCommand, runCli, runCodegenCommand, runDeployCommand, runDevCommand, runExportCommand, runImportCommand, runInitCommand, runMigrateGenerateCommand, runRegistryViewCommand, runResetCommand, runRpcCommand, schemaIrToSnapshot, validatorKindToSqlType };
|