@lunora/cli 1.0.0-alpha.247 → 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-create-package/SKILL.md +4 -3
- 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/index.d.ts
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 };
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as o,V as a,r as n}from"./packem_shared/cli-
|
|
1
|
+
import{C as o,V as a,r as n}from"./packem_shared/cli-CSnnYlA3.mjs";import{runCodegenCommand as m}from"./packem_chunks/runCodegenCommand.mjs";import{runDeployCommand as p}from"./packem_chunks/runDeployCommand.mjs";import{planDevCommand as C,runDevCommand as f}from"./packem_chunks/planDevCommand.mjs";import{runInitCommand as s}from"./packem_chunks/runInitCommand.mjs";import{runMigrateGenerateCommand as u}from"./packem_shared/runMigrateGenerateCommand-BMS_KnVC.mjs";import{runResetCommand as E}from"./packem_chunks/runResetCommand.mjs";import{runRpcCommand as D}from"./packem_chunks/runRpcCommand.mjs";import{EXIT_CODE as R,exitCodeForCode as S,exitCodeForError as A,exitCodeForStatus as c}from"./packem_shared/EXIT_CODE-08cwt3MK.mjs";import{insertSchemaExtension as _}from"./packem_shared/insertSchemaExtension-DuiV6cba.mjs";import{createLogger as F,pail as b}from"./packem_shared/createLogger-Cl18I8AX.mjs";import{diffSnapshots as h,renderAddColumn as y,renderCreateIndex as L,renderCreateTable as w,renderDropIndex as B,renderDropTable as P,renderMigrationFile as U,validatorKindToSqlType as V}from"./packem_shared/diffSnapshots-DtC5Cs4Z.mjs";import{default as G}from"./packem_shared/schemaIrToSnapshot-irmd5g0Y.mjs";import{createRecordingSpawner as Q,defaultSpawner as j}from"./packem_shared/createRecordingSpawner-sS7LEN7x.mjs";import{default as H}from"./packem_shared/parseManifest-CwPTKdtS.mjs";import{D as X,r as Y}from"./packem_shared/import-D7qdpSmJ.mjs";import{REQUIRED_COMPATIBILITY_DATE as k,REQUIRED_FLAG as z,validateWranglerProject as J,validateWranglerConfig as $}from"@lunora/config/cloudflare";import{b as er}from"./packem_shared/catalog-Cbzph90w.mjs";import{r as ar,a as nr,b as tr}from"./packem_shared/commands-Dr7KeeZ9.mjs";import{runExportCommand as dr}from"./packem_shared/runExportCommand-LEwEr8p0.mjs";export{o as COMMANDS,X as DEFAULT_IMPORT_BATCH_SIZE,R as EXIT_CODE,k as REQUIRED_COMPATIBILITY_DATE,z as REQUIRED_FLAG,a as VERSION,er as buildRegistryIndex,F as createLogger,Q as createRecordingSpawner,j as defaultSpawner,h as diffSnapshots,S as exitCodeForCode,A as exitCodeForError,c as exitCodeForStatus,_ as insertSchemaExtension,b as pail,H as parseManifest,C as planDevCommand,y as renderAddColumn,L as renderCreateIndex,w as renderCreateTable,B as renderDropIndex,P as renderDropTable,U as renderMigrationFile,ar as runAddCommand,nr as runBuildIndexCommand,n as runCli,m as runCodegenCommand,p as runDeployCommand,f as runDevCommand,dr as runExportCommand,Y as runImportCommand,s as runInitCommand,u as runMigrateGenerateCommand,tr as runRegistryViewCommand,E as runResetCommand,D as runRpcCommand,G as schemaIrToSnapshot,J as validateWrangler,$ as validateWranglerConfig,V as validatorKindToSqlType};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as u}from"../packem_shared/command-Mmxzxyr5.mjs";import{EXIT_CODE as c}from"../packem_shared/EXIT_CODE-08cwt3MK.mjs";import{a as m}from"../packem_shared/resolve-target-C_ZloTvd.mjs";import{runMigrateGenerateCommand as l,runMigrateDataCommand as g,runMigrateToHyperdriveCommand as p,runMigrateCreateCommand as y}from"../packem_shared/runMigrateGenerateCommand-BMS_KnVC.mjs";const b=n=>{const{argument:o,cwd:r,logger:t,options:a}=n,e=l({cwd:r,logger:t,name:o[1]??a.name});return{code:e.code,data:{empty:e.empty,migrationFile:e.migrationFile===""?void 0:e.migrationFile,subcommand:"generate"},...e.error===void 0?{}:{error:e.error}}},f=async n=>{const{logger:o,options:r}=n,t=await p({batchSize:r.batchSize,fromToken:r.fromToken??r.token,fromUrl:r.fromUrl??r.url,logger:o,out:r.out,prod:r.prod===!0,tables:r.tables,toToken:r.toToken??r.token,toUrl:r.toUrl??r.url,yes:r.yes===!0});return{code:t.code,data:{bytes:t.bytes,exported:t.exported,imported:t.imported,subcommand:"d1-to-hyperdrive"},...t.error===void 0?{}:{error:t.error}}},w=async n=>{const{argument:o,cwd:r,logger:t,options:a}=n,e=o[1]??a.name;if(!e){const i="migrate create requires a name. Usage: lunora migrate create <name> [--table <table>]";return t.error(i),{code:c.USAGE,error:i}}const s=await y({cwd:r,logger:t,name:e,table:a.table});return{code:s.code,data:{file:s.file===""?void 0:s.file,name:e,subcommand:"create"}}},h=async(n,o)=>{const{argument:r,cwd:t,logger:a,options:e}=n,s=r[1]??e.name;if(!s){const d=`migrate ${o} requires a migration id. Usage: lunora migrate ${o} <id>`;return a.error(d),{code:c.USAGE,error:d}}const i=await g({batchSize:e.batchSize,cwd:t,dryRun:e.dryRun===!0,id:s,logger:a,maxBatches:e.steps,prod:e.prod===!0,subcommand:o,token:e.token,url:m({cwd:t,prod:e.prod===!0,url:e.url}),yes:e.yes===!0});return{code:i.code,data:{id:s,result:i.body,subcommand:o}}},C=u(async({argument:n,cwd:o,logger:r,options:t})=>{const a=n[0],e={argument:n,cwd:o,logger:r,options:t};switch(a){case"create":return await w(e);case"d1-to-hyperdrive":return await f(e);case"down":case"status":case"up":return await h(e,a);case"generate":return b(e);default:{const s=`unknown migrate subcommand: "${a??""}" — expected generate | create | up | down | status`;return e.logger.error(s),{code:c.USAGE,error:s}}}});export{C as execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{existsSync as k,readFileSync as
|
|
1
|
+
import{existsSync as k,readFileSync as A}from"node:fs";import{applyLintIgnores as I,detectLintTools as N}from"@lunora/config";import{findWranglerFile as U}from"@lunora/config/cloudflare";import{join as w,basename as h}from"@visulima/path";import{d as S}from"../packem_shared/command-Mmxzxyr5.mjs";import{EXIT_CODE as o}from"../packem_shared/EXIT_CODE-08cwt3MK.mjs";import{r as D}from"../packem_shared/lint-ignore-report-DKZagpqk.mjs";import{t as y,a as E}from"../packem_shared/tui-prompts-B3YwUhGw.mjs";import{i as _}from"../packem_shared/resolve-ZDra033Q.mjs";import{r as L}from"../packem_shared/commands-Dr7KeeZ9.mjs";import{n as M,i as O,A as P,E as R,s as j,d as f,p as $,r as g,M as F,a as C,b as v,c as p,D as m,e as x,f as H,g as i,h as z,j as B,w as G,k as W,l as V}from"../packem_shared/storage-BEbcFWu4.mjs";const q=e=>{const r=e.trim().toLowerCase();return B.find(a=>a.value===r||a.label.toLowerCase()===r||r==="auth0"&&a.value==="auth-auth0"||r==="clerk"&&a.value==="auth-clerk")?.value},T=e=>{try{const r=JSON.parse(A(w(e,"package.json"),"utf8"));return{...r.dependencies,...r.devDependencies}}catch{return{}}},J=async e=>{const r=e.cwd??process.cwd(),t=H(T(r));return t!==void 0?t:e.yes===!0?(e.logger.warn(`add: couldn't detect your framework — using "${i}". Pass a specific item (e.g. \`lunora add auth-ui-vue\`) to override.`),i):await(e.promptSelect??((c,n,d)=>y(c,n,d)))("Which framework is your app?",z,{default:i})??i},X=async e=>{if(e.provider!==void 0&&e.provider!==""){const t=q(e.provider);return t===void 0?(e.logger.warn(`add: unknown --provider "${e.provider}" — using "${m}" (email & password).`),m):t}if(e.yes===!0)return m;const r=e.promptSelect??((t,a,c)=>y(t,a,c));return x(r)},l=e=>e.promptText??((r,t)=>E(r,t)),K=async e=>{const r=h(e.cwd??process.cwd());if(e.bucket!==void 0&&e.bucket!==""){const t=j(e.bucket);if(t!==void 0)return t;const a=f(r);return e.logger.warn(`add: "${e.bucket}" isn't a valid R2 bucket name (lowercase alphanumeric + hyphens, 3–63 chars) — using "${a}".`),a}return e.yes===!0?f(r):$(l(e),r)},Q=async e=>{const r=t=>{e.logger.warn(`add: ${t}`)};if(e.mailTo!==void 0&&e.mailTo!=="")return g(e.mailTo,r);if(e.yes!==!0)return g(await l(e)(F,{placeholder:"you@yourdomain.com"}),r)},Y=async e=>{const r=h(e.cwd??process.cwd());if(e.db!==void 0&&e.db!==""){const t=C(e.db);if(t!==void 0)return t;const a=v(r);return e.logger.warn(`add: "${e.db}" isn't a usable D1 database name — using "${a}".`),a}return e.yes===!0?v(r):p(l(e),r)},Z=async(e,r)=>e.kind==="auth"?[await X(r)]:e.kind==="auth-ui"?[await J(r)]:e.kind==="email"?[R]:[e.item],ee=(e,r)=>{D(I(e,N(e)),r)},re=e=>!_(e)||e.yes===!0,ae=async e=>{const r=e.cwd??process.cwd(),t=e.feature===void 0?void 0:M(e.feature);if(t===void 0)return e.logger.error("add requires a feature or registry item. Usage: lunora add <auth|email|storage|crons|presence|…>"),{code:o.USAGE,items:[]};if(!k(w(r,"lunora"))||U(r)===void 0)return e.logger.error("add: not a Lunora project here (need a lunora/ directory and a wrangler.jsonc). Run `lunora init` first."),{code:o.USAGE,items:[]};if(t.kind==="auth-ui"&&O(T(r)))return e.logger.error(`add: ${P}`),{code:o.USAGE,items:[]};const a=await Z(t,e),c=[];if(a.includes("storage")){const s=await K(e);c.push(u=>G(u,s))}if(a.includes("mail")){const s=await Q(e);s!==void 0&&c.push(u=>W(u,s))}if(a.some(s=>s==="auth"||s.startsWith("auth-"))){const s=await Y(e);c.push(u=>V(u,s))}const n=c.length>0?s=>{let u=s;for(const b of c)u=b(u);return u}:void 0,d=await L({allowUnsafeSource:e.allowUnsafeSource,confirm:e.confirm,cwd:r,from:e.from,logger:e.logger,names:[...a],ref:e.ref,source:e.source,transformManifest:n,yes:re(e)});return d.code===0&&ee(r,e.logger),{code:d.code,items:a}},ge=S(async({argument:e,cwd:r,logger:t,options:a})=>{const c=await ae({allowUnsafeSource:a.allowUnsafeSource===!0,bucket:a.bucket,cwd:r,db:a.db,feature:e[0],from:a.from,logger:t,mailTo:a.mailTo,provider:a.provider,ref:a.ref,source:a.source,yes:a.yes===!0});return{code:c.code,data:{items:c.items},...c.error===void 0?{}:{error:c.error}}});export{ge as execute,ae as runAddFeature};
|
|
@@ -1,3 +1 @@
|
|
|
1
|
-
import{readFileSync as
|
|
2
|
-
`),{code:0};if(r.bindings.length===0)t.info("No bindings declared.");else{const o=Math.max(...r.bindings.map(a=>a.type.length));t.info(`${String(r.bindings.length)} binding(s):`);for(const a of r.bindings){const f=[a.resource,a.className,a.resourceId].filter(b=>b!==void 0).join(" ");t.info(` ${a.type.padEnd(o)} ${a.binding}${f===""?"":` ${f}`}`)}}return r.crons.length>0&&t.info(`${String(r.crons.length)} cron trigger(s): ${r.crons.join(", ")}`),r.vars.length>0&&t.info(`${String(r.vars.length)} var(s): ${r.vars.join(", ")}`),r.unknown.length>0&&t.warn(`not modelled by the manifest: ${r.unknown.join(", ")} — anything they bind must be provisioned by hand.`),{code:0}},N=n=>{const e=n.cwd??process.cwd();if(n.bindings===!0)return{...I({cwd:e,json:n.json===!0,logger:n.logger,out:n.out}),snapshot:void 0};if(n.out!==void 0)return n.logger.error("--out only applies with --bindings; the full info snapshot prints to stdout under --json."),{code:1,snapshot:void 0};const i=P(e);return n.json?process.stdout.write(`${JSON.stringify(i,void 0,2)}
|
|
3
|
-
`):M(i,n.logger),{code:0,snapshot:i}},L=w(({cwd:n,logger:e,options:i})=>N({bindings:i.bindings===!0,cwd:n,json:i.json===!0,logger:e,out:i.out}));export{P as collectInfo,L as execute,N as runInfoCommand};
|
|
1
|
+
import{readFileSync as m,existsSync as u}from"node:fs";import{join as g}from"node:path";import{discoverSchema as h}from"@lunora/codegen";import{readLinkedProject as p}from"@lunora/config";import{findWranglerFile as $}from"@lunora/config/cloudflare";import{parse as v}from"jsonc-parser";import{Project as k}from"ts-morph";import{w,d as b}from"../packem_shared/binding-manifest-file-CQ1eQYy1.mjs";import{d as j}from"../packem_shared/command-Mmxzxyr5.mjs";import{EXIT_CODE as d}from"../packem_shared/EXIT_CODE-08cwt3MK.mjs";const f=(n,e)=>{if(n===null||typeof n!="object")return;const i=n[e];return typeof i=="string"&&i.length>0?i:void 0},S=(n,e)=>{if(n===null||typeof n!="object")return[];const i=n[e];return Array.isArray(i)?i:[]},x=(n,e)=>{const{manifest:i}=b(e);return{bindings:(i?.bindings??[]).map(r=>`${r.type}:${r.binding}`),compatibilityDate:f(n,"compatibility_date"),compatibilityFlags:S(n,"compatibility_flags").filter(r=>typeof r=="string"),main:f(n,"main"),name:f(n,"name")}},E=n=>({tables:n.tables.map(e=>{let i="root";return e.shardMode==="global"?i="global":typeof e.shardMode=="object"&&(i=`shardBy(${e.shardMode.field})`),{indexes:e.indexes.length,name:e.name,shard:i}}),vectorIndexes:n.vectorIndexes.length}),F=n=>{const e=g(n,"package.json");if(!u(e))return[];let i;try{i=JSON.parse(m(e,"utf8"))}catch{return[]}if(i===null||typeof i!="object")return[];const r=["dependencies","devDependencies","peerDependencies","optionalDependencies"],s=new Map;for(const a of r){const t=i[a];if(!(t===null||typeof t!="object"))for(const[o,c]of Object.entries(t))o.startsWith("@lunora/")&&typeof c=="string"&&!s.has(o)&&s.set(o,c)}return[...s.entries()].toSorted(([a],[t])=>a.localeCompare(t)).map(([a,t])=>({name:a,version:t}))},P=n=>{const e=F(n),i=$(n);let r;if(i)try{r=x(v(m(i,"utf8")),n)}catch{r=void 0}const s=g(n,"lunora","schema.ts");let a,t;if(u(s))try{const o=new k({skipAddingFilesFromTsConfig:!0,useInMemoryFileSystem:!1});a=E(h(o,s))}catch(o){t=o instanceof Error?o.message:String(o)}return{link:p(n),lunoraPackages:e,projectRoot:n,schema:a,schemaError:t,wrangler:r,wranglerPath:i}},I=(n,e)=>{if(e.info(`project: ${n.projectRoot}`),e.info(""),e.info("@lunora/* packages:"),n.lunoraPackages.length===0)e.info(" (none found in package.json)");else for(const i of n.lunoraPackages)e.info(` ${i.name}@${i.version}`);if(e.info(""),n.wrangler?(e.info(`wrangler: ${n.wranglerPath??""}`),e.info(` name: ${n.wrangler.name??"<unset>"}`),e.info(` main: ${n.wrangler.main??"<unset>"}`),e.info(` compatibility_date: ${n.wrangler.compatibilityDate??"<unset>"}`),e.info(` compatibility_flags: ${n.wrangler.compatibilityFlags.join(", ")||"<none>"}`),e.info(` bindings: ${n.wrangler.bindings.join(", ")||"<none>"}`)):e.info("wrangler: (not found)"),e.info(""),n.link?(e.info(`link: ${n.link.workerName??"(unnamed)"} -> ${n.link.workerUrl??"<no url>"}`),n.link.env!==void 0&&e.info(` env: ${n.link.env}`)):e.info("link: (not linked — run `lunora link --url <https://your-worker>`)"),e.info(""),n.schemaError!==void 0)e.warn(`schema: parse error — ${n.schemaError}`);else if(n.schema){e.info(`schema: ${String(n.schema.tables.length)} table(s), ${String(n.schema.vectorIndexes)} vector index(es)`);for(const i of n.schema.tables)e.info(` ${i.name} [${i.shard}, ${String(i.indexes)} index(es)]`)}else e.info("schema: (no lunora/schema.ts)")},M=n=>{const{cwd:e,json:i,logger:r,out:s}=n;if(s!==void 0){const{error:o}=w({destination:s,logger:r,projectRoot:e});return o!==void 0?(r.error(o),{code:d.USAGE,error:o}):{code:0}}const{error:a,manifest:t}=b(e);if(t===void 0){const o=a??"could not derive the binding manifest";return r.error(o),{code:d.USAGE,error:o}}if(i)return{code:0,data:t};if(t.bindings.length===0)r.info("No bindings declared.");else{const o=Math.max(...t.bindings.map(c=>c.type.length));r.info(`${String(t.bindings.length)} binding(s):`);for(const c of t.bindings){const l=[c.resource,c.className,c.resourceId].filter(y=>y!==void 0).join(" ");r.info(` ${c.type.padEnd(o)} ${c.binding}${l===""?"":` ${l}`}`)}}return t.crons.length>0&&r.info(`${String(t.crons.length)} cron trigger(s): ${t.crons.join(", ")}`),t.vars.length>0&&r.info(`${String(t.vars.length)} var(s): ${t.vars.join(", ")}`),t.unknown.length>0&&r.warn(`not modelled by the manifest: ${t.unknown.join(", ")} — anything they bind must be provisioned by hand.`),{code:0,data:t}},A=n=>{const e=n.cwd??process.cwd(),i=n.format==="json",{logger:r}=n;if(n.bindings===!0)return M({cwd:e,json:i,logger:r,out:n.out});if(n.out!==void 0){const a="--out only applies with --bindings; the full info snapshot prints to stdout under --format json.";return r.error(a),{code:d.USAGE,error:a}}const s=P(e);return i||I(s,r),{code:0,data:s,snapshot:s}},L=j(({cwd:n,format:e,logger:i,options:r})=>A({bindings:r.bindings===!0,cwd:n,format:e,logger:i,out:r.out}));export{P as collectInfo,L as execute,A as runInfoCommand};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as
|
|
2
|
-
`)},
|
|
1
|
+
import{r as v}from"../packem_shared/admin-token-VdUnvnKW.mjs";import{r as y}from"../packem_shared/admin-url-BhF5ufg1.mjs";import{d as M}from"../packem_shared/command-Mmxzxyr5.mjs";import{EXIT_CODE as d,exitCodeForStatus as T}from"../packem_shared/EXIT_CODE-08cwt3MK.mjs";import{a as x}from"../packem_shared/resolve-target-C_ZloTvd.mjs";const I="__lunora_admin__:getFunctionStats",E=10,f=(r,o)=>({calls:r.calls,conflicts:r.conflicts??0,errors:r.errors,lastErrorMessage:r.lastErrorMessage,maxDurationMs:r.maxDurationMs,meanDurationMs:r.calls===0?0:r.totalDurationMs/r.calls,path:r.path,rate:o}),O=(r,o)=>{const t=r.filter(e=>(e.conflicts??0)>0).map(e=>f(e,e.calls===0?0:(e.conflicts??0)/e.calls)).toSorted((e,s)=>s.rate-e.rate||s.conflicts-e.conflicts).slice(0,o),n=r.filter(e=>e.errors>0).map(e=>f(e,e.calls===0?0:e.errors/e.calls)).toSorted((e,s)=>s.rate-e.rate||s.errors-e.errors).slice(0,o),a=r.map(e=>f(e,0)).toSorted((e,s)=>s.maxDurationMs-e.maxDurationMs).slice(0,o);return{errorHotspots:n,latencyOutliers:a,totalFunctions:r.length,writeContention:t}},p=r=>`${(r*100).toFixed(1)}%`,$=r=>r<1e3?`${Math.round(r).toString()}ms`:`${(r/1e3).toFixed(2)}s`,m=(r,o,t,n)=>[r,...o.length===0?[` ${t}`]:o.map(a=>` ${n(a)}`)],_=r=>{const o=t=>t.lastErrorMessage?` — ${t.lastErrorMessage}`:"";return[`Insights over ${r.totalFunctions.toString()} function${r.totalFunctions===1?"":"s"}`,"",...m("Write-conflict hot-spots (OCC contention — candidates for sharding):",r.writeContention,"none — no write conflicts observed",t=>`${t.path} ${t.conflicts.toString()}/${t.calls.toString()} calls (${p(t.rate)})`),"",...m("Error hot-spots:",r.errorHotspots,"none — no errors observed",t=>`${t.path} ${t.errors.toString()}/${t.calls.toString()} calls (${p(t.rate)})${o(t)}`),"",...m("Latency outliers (slowest single call):",r.latencyOutliers,"none — no functions have run",t=>`${t.path} max ${$(t.maxDurationMs)}, mean ${$(t.meanDurationMs)} over ${t.calls.toString()} calls`)].join(`
|
|
2
|
+
`)},i=(r,o,t)=>(r.error(o),{code:t,error:o}),k=r=>r===void 0||!Number.isFinite(r)||r<=0?E:Math.floor(r),A=async r=>{const{logger:o}=r;if(r.prod&&r.url===void 0)return i(o,"--prod requires an explicit --url (refusing to report from the implicit localhost worker)",d.USAGE);const t=y(r.url,o,r.cwd);if(t===void 0)return{code:d.USAGE,error:"could not resolve a usable worker URL"};const{token:n}=v({cwd:r.cwd??process.cwd(),token:r.token,url:t});if(!n)return i(o,"admin token required — pass --token, set LUNORA_ADMIN_TOKEN, or add it to .dev.vars (local targets only)",d.AUTH);const a=`${t}/_lunora/rpc`,e=globalThis.fetch;if(typeof e!="function")throw new TypeError("no fetch implementation available — pass fetchImpl or run on Node >= 18");const s={args:{},functionPath:I};r.shard!==void 0&&(s.shardKey=r.shard),o.info(`POST ${a} -> insights`);const l=await e(a,{body:JSON.stringify(s),headers:{authorization:`Bearer ${n}`,"content-type":"application/json"},method:"POST"}),c=await l.text();if(!l.ok)return i(o,`insights failed: HTTP ${String(l.status)}: ${c}`,T(l.status));let u;try{u=JSON.parse(c)}catch{return i(o,`insights failed: worker returned non-JSON: ${c}`,1)}const S=u.result??u,{functions:h}=S;if(!Array.isArray(h))return i(o,"insights failed: response carried no `functions` array",1);const g=O(h,k(r.limit));return r.format!=="json"&&o.info(_(g)),{code:0,report:g}},C=M(async({cwd:r,format:o,logger:t,options:n})=>{const a=n.limit===void 0?void 0:Number.parseInt(n.limit,10),e=await A({cwd:r,fetchImpl:void 0,format:o,limit:a,logger:t,prod:n.prod,shard:n.shard,token:n.token,url:x({cwd:r,prod:n.prod===!0,url:n.url})});return{code:e.code,data:e.report,error:e.error}});export{O as buildInsightsReport,C as execute,_ as formatInsightsReport,A as runInsightsCommand};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{existsSync as u,rmSync as
|
|
1
|
+
import{existsSync as u,rmSync as a}from"node:fs";import{join as i}from"node:path";import{writeLinkedProject as d,LINKED_PROJECT_FILE as o}from"@lunora/config";import{d as k}from"../packem_shared/command-Mmxzxyr5.mjs";import{EXIT_CODE as c}from"../packem_shared/EXIT_CODE-08cwt3MK.mjs";import{r as s}from"../packem_shared/wrangler-name-Dsk5K1f-.mjs";const v=r=>{try{const{protocol:n}=new URL(r);return n==="http:"||n==="https:"}catch{return!1}},f=(r,n)=>{const e=i(r,o);return u(e)?(a(e),n.success(`link: removed ${o}`),{code:0}):(n.warn(`link: no ${o} to remove`),{code:0})},w=r=>{const n=r.cwd??process.cwd(),{logger:e}=r;if(r.remove)return f(n,e);if(r.url===void 0||r.url==="")return e.error("link requires a deployed Worker URL. Usage: lunora link --url <https://your-worker>"),{code:c.USAGE};if(!v(r.url))return e.error(`link: invalid --url "${r.url}" — expected an http(s) URL`),{code:c.USAGE};const l=r.now??(()=>new Date().toISOString()),t={env:r.env,linkedAt:l(),workerName:r.name??s(n),workerUrl:r.url},m=d(n,t);return e.success(`link: ${t.workerName??"(unnamed worker)"} -> ${r.url}`),e.info(`link: wrote ${m}`),t.env!==void 0&&e.info(`link: environment "${t.env}"`),{code:0,link:t}},y=k(({cwd:r,logger:n,options:e})=>w({cwd:r,env:e.env,logger:n,name:e.name,remove:e.remove===!0,url:e.url}));export{y as execute,w as runLinkCommand};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as i}from"../packem_shared/deploy-target-DCWwiuAe.mjs";import{d as c}from"../packem_shared/command-
|
|
1
|
+
import{p as i}from"../packem_shared/deploy-target-DCWwiuAe.mjs";import{d as c}from"../packem_shared/command-Mmxzxyr5.mjs";import{EXIT_CODE as t}from"../packem_shared/EXIT_CODE-08cwt3MK.mjs";import{runPreDeployPipeline as d}from"./runDeployCommand.mjs";const l=async r=>{const a=r.cwd??process.cwd(),e=await d({allowSchemaDrift:r.allowSchemaDrift,apiSpec:r.apiSpec,cwd:a,logger:r.logger,spawner:r.spawner,strictAdvisories:r.strictAdvisories,target:r.target,updateSchemaBaseline:r.updateSchemaBaseline},"prepare");return e.error!==void 0?{code:e.code??t.USAGE,error:e.error,...e.schemaDrift===void 0?{}:{schemaDrift:e.schemaDrift},validation:e.validation}:(e.reblessSchemaBaseline?.(),r.logger.success("project is ready to deploy"),{code:0,validation:e.validation})},S=c(({cwd:r,logger:a,options:e})=>l({allowSchemaDrift:e.allowSchemaDrift===!0,apiSpec:i(e.apiSpec),cwd:r,logger:a,strictAdvisories:e.strictAdvisories,target:e.target,updateSchemaBaseline:e.updateSchemaBaseline===!0}));export{S as execute,l as runPrepareCommand};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d}from"../packem_shared/command-
|
|
1
|
+
import{d as l}from"../packem_shared/command-Mmxzxyr5.mjs";import{EXIT_CODE as n}from"../packem_shared/EXIT_CODE-08cwt3MK.mjs";import{r as s,b as t,a as o}from"../packem_shared/commands-Dr7KeeZ9.mjs";const y=l(({argument:a,cwd:u,format:m,logger:e,options:r})=>{const f=a[0],c=a.slice(1);if(f==="add")return s({allowUnsafeSource:r.allowUnsafeSource===!0,cwd:u,diff:r.diff===!0,dryRun:r.dryRun===!0,format:m,from:r.from,logger:e,names:c,overwrite:r.overwrite===!0,ref:r.ref,source:r.source,yes:r.yes===!0});if(f==="list")return s({allowUnsafeSource:r.allowUnsafeSource===!0,cwd:u,format:m,from:r.from,list:!0,logger:e,names:[],ref:r.ref,source:r.source});if(f==="view")return t({allowUnsafeSource:r.allowUnsafeSource===!0,cwd:u,from:r.from,logger:e,names:c,ref:r.ref,source:r.source});if(f==="build")return o({check:r.check===!0,cwd:u,from:r.from,logger:e,names:[],out:r.out});const d="registry: unknown subcommand. Usage: lunora registry <add|list|view|build> [names…]";return e.error(d),{code:n.USAGE,error:d}});export{y as execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{existsSync as c,readFileSync as g,readdirSync as f,statSync as k,mkdirSync as w,writeFileSync as y}from"node:fs";import{fileURLToPath as R}from"node:url";import{AGENT_RULES_DIR as u,detectAgentRules as v,LUNORA_SKILL_NAMES as L}from"@lunora/config";import{join as i,relative as A,resolve as
|
|
1
|
+
import{existsSync as c,readFileSync as g,readdirSync as f,statSync as k,mkdirSync as w,writeFileSync as y}from"node:fs";import{fileURLToPath as R}from"node:url";import{AGENT_RULES_DIR as u,detectAgentRules as v,LUNORA_SKILL_NAMES as L}from"@lunora/config";import{join as i,relative as A,resolve as E,dirname as d}from"@visulima/path";import{d as I}from"../packem_shared/command-Mmxzxyr5.mjs";import{EXIT_CODE as $}from"../packem_shared/EXIT_CODE-08cwt3MK.mjs";const b=(e=d(R(import.meta.url)))=>{let r=e;for(let n=0;n<6;n+=1){const t=i(r,"package.json");if(c(t))try{if(JSON.parse(g(t,"utf8")).name==="@lunora/cli"){const o=i(r,"skills");return c(o)?o:void 0}}catch{}const s=d(r);if(s===r)break;r=s}},_=e=>f(e).filter(r=>{const n=i(e,r);return k(n).isDirectory()&&c(i(n,"SKILL.md"))}),m=(e,r,n)=>{w(r,{recursive:!0});let t=!1;for(const s of f(e)){const l=i(e,s),o=i(r,s);if(k(l).isDirectory()){t=m(l,o,n)||t;continue}c(o)&&!n||(y(o,g(l)),t=!0)}return t},j=["pnpm-workspace.yaml","pnpm-lock.yaml","yarn.lock","package-lock.json","bun.lock","bun.lockb",".git"],O=e=>{let r=e;for(;;){if(j.some(t=>c(i(r,t))))return r;const n=d(r);if(n===r)return e;r=n}},p=(e,r)=>r===void 0?O(e):E(e,r),x=e=>{const r=e.cwd??process.cwd(),n=p(r,e.dir),t=e.overwrite===!0,s=b();if(s===void 0)return e.logger.error("rules: could not locate the bundled skills (is @lunora/cli installed correctly?)."),{code:1,installed:[],skipped:[]};const l=[],o=[];for(const a of _(s)){const h=i(n,u,a);m(i(s,a),h,t)?l.push(a):o.push(a)}const S=A(r,i(n,u))||u;return l.length>0&&e.logger.success(`Installed ${String(l.length)} Lunora skill(s) into ${S}/: ${l.join(", ")}.`),o.length>0&&e.logger.info(`Skipped ${String(o.length)} existing skill(s) (re-run with --overwrite to replace): ${o.join(", ")}.`),e.logger.info("Your AI coding agent will pick these up automatically. Start with the `lunora` skill."),{code:0,installed:l,skipped:o}},D=e=>{const r=e.cwd??process.cwd(),n=p(r,e.dir),t=v(n);return t.installed?(e.logger.success(`Lunora agent rules are installed (${String(t.present.length)}/${String(L.length)} skills).`),t.missing.length>0&&e.logger.info(`Missing: ${t.missing.join(", ")}. Run \`lunora rules install\` to add them.`),{code:0,installed:t.present,skipped:[]}):(e.logger.warn("Lunora agent rules are not installed. Run `lunora rules install` so your AI agent knows how to use Lunora."),{code:e.strict===!0?1:0,installed:t.present,skipped:[]})},B=I(({argument:e,cwd:r,logger:n,options:t})=>{const s=e[0]??"check";return s==="install"?x({cwd:r,dir:t.dir,logger:n,overwrite:t.overwrite===!0}):s==="check"?D({cwd:r,dir:t.dir,logger:n,strict:t.strict===!0}):(n.error("rules: unknown subcommand. Usage: lunora rules <install|check>"),{code:$.USAGE})});export{B as execute,_ as listBundledSkills,b as resolveBundledSkillsDirectory,D as runRulesCheck,x as runRulesInstall};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{existsSync as S}from"node:fs";import{mkdtemp as
|
|
1
|
+
import{existsSync as S}from"node:fs";import{mkdtemp as v,writeFile as k,rm as j}from"node:fs/promises";import{tmpdir as R}from"node:os";import{discoverSchema as C,schemaFromIr as T}from"@lunora/codegen";import{seedPlan as $}from"@lunora/seed";import{join as w}from"@visulima/path";import{Project as A}from"ts-morph";import{t as y}from"../packem_shared/admin-token-VdUnvnKW.mjs";import{d as E}from"../packem_shared/command-Mmxzxyr5.mjs";import{EXIT_CODE as u}from"../packem_shared/EXIT_CODE-08cwt3MK.mjs";import{a as F}from"../packem_shared/resolve-target-C_ZloTvd.mjs";import{b as N}from"../packem_shared/tui-prompts-B3YwUhGw.mjs";import{runResetCommand as U}from"./runResetCommand.mjs";import{r as I}from"../packem_shared/import-D7qdpSmJ.mjs";const O=(e,r)=>typeof r=="bigint"?Number(r):r instanceof ArrayBuffer?[...new Uint8Array(r)]:r,f=(e,r)=>({code:e,error:r,ndjson:""}),x=(e,r)=>{if(!S(r)){const o=`schema not found: ${r} — run \`vis generate lunora-table --name=<name>\` to create one`;return e.logger.error(o),f(u.NOT_FOUND,o)}if(e.reset===!0&&y({prod:e.prod,url:e.url})){const o="--reset only clears local .wrangler/state and cannot be combined with --prod or a remote --url";return e.logger.error(o),f(u.USAGE,o)}},z=async(e,r,o,t,n)=>{const s=await v(w(R(),"lunora-seed-")),d=w(s,"rows.ndjson");await k(d,e,"utf8");try{const a=await I({batchSize:n.batchSize,cwd:t,fetchImpl:n.fetchImpl,file:d,logger:n.logger,prod:n.prod,token:n.token,url:n.url,yes:!0}),i=a.body?.conflicts??0;return i>0&&n.logger.warn(`${String(i)} row(s) skipped — their _id already exists. Seeding is deterministic; re-run with --reset to wipe local state first, or a different --seed for fresh ids.`),{code:a.code,data:{conflicts:i,generated:r,inserted:a.inserted,tables:o},ndjson:e,...a.error===void 0?{}:{error:a.error}}}finally{await j(s,{force:!0,recursive:!0}).catch(()=>{})}},D=(e,r)=>{if(e.table===void 0||r.tables.some(n=>n.name===e.table))return;const o=r.tables.map(n=>n.name).join(", "),t=`unknown table "${e.table}" — schema defines: ${o||"(no tables)"}`;return e.logger.error(t),f(u.USAGE,t)},_=async(e,r)=>{if(!y({prod:e.prod,url:e.url})||e.yes===!0)return;if(!process.stdin.isTTY&&e.confirm===void 0){const s="seed: refusing to insert into a non-local target without confirmation — re-run with --yes";return e.logger.error(s),f(u.USAGE,s)}if(!await(e.confirm??N)(`This will insert ${String(r)} generated row(s) into ${e.url??"the production worker"}. Continue?`))return e.logger.info("seed: aborted"),f(u.CANCELLED,"seed: aborted at the confirmation prompt")},G=e=>{const r=[];for(const{rows:o,table:t}of e)for(const n of o)r.push(JSON.stringify({doc:n,table:t},O));return{lines:r,ndjson:r.length>0?`${r.join(`
|
|
2
2
|
`)}
|
|
3
|
-
`:"",a=
|
|
3
|
+
`:""}},P=async e=>{const r=e.cwd??process.cwd(),o=e.format==="json",t=w(r,"lunora","schema.ts"),n=x(e,t);if(n!==void 0)return n;const s=new A({skipAddingFilesFromTsConfig:!0}),d=C(s,t),a=D(e,d);if(a!==void 0)return a;const i=T(d),l=$(i,{defaultCount:e.count??10,now:e.now,only:e.table===void 0?void 0:[e.table],seed:e.seed??0}),{lines:h,ndjson:c}=G(l),m=h.length;if(e.dryRun===!0)return!o&&c.length>0&&process.stdout.write(c),e.logger.info(`generated ${String(m)} row(s) across ${String(l.length)} table(s) — dry run, nothing inserted`),{code:0,data:{conflicts:0,generated:m,inserted:0,rows:o?h.map(g=>JSON.parse(g)):void 0,tables:l.length},ndjson:c};if(m===0)return e.logger.warn("no rows generated — nothing to insert"),{code:0,data:{conflicts:0,generated:0,inserted:0,tables:l.length},ndjson:c};if(e.reset===!0){const g=await U({confirm:e.confirm,cwd:r,logger:e.logger,yes:e.yes});if(g.code!==0)return{code:g.code,error:"seed: --reset could not clear local state",ndjson:c}}const b=await _(e,m);return b!==void 0?b:z(c,m,l.length,r,e)},ee=E(async({cwd:e,format:r,logger:o,options:t})=>{const n=await P({batchSize:t.batchSize,count:t.count,cwd:e,dryRun:t.dryRun===!0,format:r,logger:o,prod:t.prod===!0,reset:t.reset===!0,now:t.now,seed:t.seed,table:t.table,token:t.token,url:F({cwd:e,prod:t.prod===!0,url:t.url}),yes:t.yes===!0});return{code:n.code,data:n.data,error:n.error}});export{ee as execute,P as runSeedCommand};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{existsSync as
|
|
1
|
+
import{existsSync as m}from"node:fs";import{join as p}from"node:path";import{runCodegen as u}from"@lunora/codegen";import{a as v,e as g,r as y}from"../packem_shared/platform-diagnostics-Cn2g6Jh-.mjs";import{p as w,r as S}from"../packem_shared/deploy-target-DCWwiuAe.mjs";import{r as k}from"../packem_shared/codegen-error-AmH54ofi.mjs";import{d as j}from"../packem_shared/command-Mmxzxyr5.mjs";import{EXIT_CODE as E}from"../packem_shared/EXIT_CODE-08cwt3MK.mjs";import{r as A,p as D}from"../packem_shared/schema-drift-gate-BDCkQ1S6.mjs";import{defaultSpawner as R}from"../packem_shared/createRecordingSpawner-sS7LEN7x.mjs";import{validateWranglerProject as $}from"@lunora/config/cloudflare";import{execArgsFor as b,detectPackageManager as U}from"@lunora/config";const x=async(r,a,t)=>{if(!m(p(r,"tsconfig.json")))return{warning:"no tsconfig.json found — skipping TypeScript type-check"};const o=b(U(r),"tsc",["--noEmit","-p","tsconfig.json"]),e=await a({args:o.args,command:o.command,cwd:r,stdoutToStderr:t==="json"});return e.code===0?{}:{error:`type errors: tsc --noEmit exited ${String(e.code)}`}},P=async(r,a)=>{if(r.healthUrl===void 0||r.healthUrl==="")return;const t=await D({baseUrl:r.healthUrl,fetchImpl:r.healthFetch});if(t.error===void 0){a.success(`verify: health probe ok (${t.url})`);return}return t.error},T=(r,a)=>{const{errorAdvisories:t,names:o,shouldBlock:e}=g(r,y(a));if(e)return`${t.length.toString()} ERROR-level ${t.length===1?"advisory":"advisories"} (${o.join(", ")}). Pass --no-strict-advisories to downgrade this to a warning and continue.`},C=(r,a,t,o)=>{if(a.length===0&&t.length===0)return r.success("verify: project is valid"),{code:0,errors:[],warnings:[],wranglerPath:o};if(t.length>0){r.warn("verify: warnings:");for(const e of t)r.warn(` - ${e}`)}if(a.length>0){r.error("verify: errors:");for(const e of a){r.error(` - ${e}`);const n=k(e);n!==void 0&&r.error(n)}return{code:1,error:a[0],errors:a,warnings:t,wranglerPath:o}}return r.success("verify: project is valid (with warnings)"),{code:0,errors:[],warnings:t,wranglerPath:o}},H=async r=>{const a=r.cwd??process.cwd(),{logger:t}=r,o=$({environment:r.env,projectRoot:a}),e=[...o.report.errors],n=[...o.report.warnings];try{const s=S(a,r.target);if(s.target===void 0){const c=s.error??"unknown deploy target";return t.error(c),{code:E.USAGE,error:c,errors:[c],warnings:[],wranglerPath:void 0}}const i=u({apiSpec:r.apiSpec,dryRun:!0,projectRoot:a,target:s.target}),f=v(i.platformDiagnostics,t);e.push(...f.errors),n.push(...f.warnings);const l=T(i.advisories,r);l!==void 0&&e.push(l);const h=A({allowDrift:r.allowSchemaDrift===!0,codegen:i,command:"verify",logger:t,readOnly:!0});h.blocked&&e.push(h.reason)}catch(s){const i=s instanceof Error?s.message:String(s);e.push(`codegen failed: ${i}`)}if(r.typecheck!==!1){const s=await x(a,r.spawner??R,r.format??"pretty");s.error!==void 0&&e.push(s.error),s.warning!==void 0&&n.push(s.warning)}const d=await P(r,t);return d!==void 0&&e.push(d),C(t,e,n,o.wranglerPath)},J=j(async({cwd:r,format:a,logger:t,options:o})=>{const e=await H({allowSchemaDrift:o.allowSchemaDrift===!0,apiSpec:w(o.apiSpec),cwd:r,env:o.env,format:a,healthUrl:o.healthUrl,logger:t,strictAdvisories:o.strictAdvisories,target:o.target,typecheck:o.typecheck===!1?!1:void 0});return{code:e.code,data:{errors:e.errors,warnings:e.warnings,wranglerPath:e.wranglerPath},error:e.error}});export{J as execute,H as runVerifyCommand};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{readLiveDevServerState as c}from"@lunora/config";import{d as i}from"../packem_shared/command-
|
|
1
|
+
import{readLiveDevServerState as c}from"@lunora/config";import{d as i}from"../packem_shared/command-Mmxzxyr5.mjs";import{o as a}from"../packem_shared/open-url-EnKy--w-.mjs";const n="http://127.0.0.1:6173",d="/__lunora",u=/\/$/u,l=r=>{const e=c(r);return e===void 0?n:e.studioUrl!==void 0?e.studioUrl:e.mode==="vite"?`${e.url.replace(u,"")}${d}`:n},m=async r=>{const e=l(r.cwd??process.cwd()),{logger:t}=r;t.info(`opening ${e}`);try{await a(e,{opener:r.opener})}catch(o){const s=o instanceof Error?o.message:String(o);return t.error(`view: failed to open URL: ${s}`),{code:1,url:e}}return{code:0,url:e}},v=i(({cwd:r,logger:e})=>m({cwd:r,logger:e}));export{v as execute,m as runViewCommand};
|