@lunora/cli 1.0.0-alpha.96 → 1.0.0-alpha.98
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
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { COMMANDS, VERSION, runCli } from './packem_shared/COMMANDS-
|
|
1
|
+
export { COMMANDS, VERSION, runCli } from './packem_shared/COMMANDS-BOJIDoVY.mjs';
|
|
2
2
|
export { runCodegenCommand } from './packem_chunks/runCodegenCommand.mjs';
|
|
3
3
|
export { DEFAULT_IMPORT_BATCH_SIZE, runExportCommand, runImportCommand } from './packem_shared/DEFAULT_IMPORT_BATCH_SIZE-D0VOTerB.mjs';
|
|
4
4
|
export { runDeployCommand } from './packem_chunks/runDeployCommand.mjs';
|
|
@@ -18,6 +18,33 @@ const runTypecheckStep = async (cwd, spawner) => {
|
|
|
18
18
|
const result = await spawner({ args: exec.args, command: exec.command, cwd });
|
|
19
19
|
return result.code === 0 ? {} : { error: `type errors: tsc --noEmit exited ${String(result.code)}` };
|
|
20
20
|
};
|
|
21
|
+
const HEALTH_PATH = "/_lunora/health";
|
|
22
|
+
const joinHealthUrl = (base) => (base.endsWith("/") ? base.slice(0, -1) : base) + HEALTH_PATH;
|
|
23
|
+
const runHealthProbeStep = async (healthUrl, healthFetch) => {
|
|
24
|
+
const url = joinHealthUrl(healthUrl);
|
|
25
|
+
let response;
|
|
26
|
+
try {
|
|
27
|
+
response = await healthFetch(url);
|
|
28
|
+
} catch (error) {
|
|
29
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
30
|
+
return { error: `health probe failed: could not reach ${url} (${message})` };
|
|
31
|
+
}
|
|
32
|
+
if (response.ok) {
|
|
33
|
+
return {};
|
|
34
|
+
}
|
|
35
|
+
return { error: `health probe failed: ${url} returned HTTP ${String(response.status)}` };
|
|
36
|
+
};
|
|
37
|
+
const probeHealthIfRequested = async (options, logger) => {
|
|
38
|
+
if (options.healthUrl === void 0 || options.healthUrl === "") {
|
|
39
|
+
return void 0;
|
|
40
|
+
}
|
|
41
|
+
const probe = await runHealthProbeStep(options.healthUrl, options.healthFetch ?? ((url) => fetch(url)));
|
|
42
|
+
if (probe.error === void 0) {
|
|
43
|
+
logger.success(`verify: health probe ok (${joinHealthUrl(options.healthUrl)})`);
|
|
44
|
+
return void 0;
|
|
45
|
+
}
|
|
46
|
+
return probe.error;
|
|
47
|
+
};
|
|
21
48
|
const reportVerifyResult = (logger, errors, warnings, wranglerPath) => {
|
|
22
49
|
if (errors.length === 0 && warnings.length === 0) {
|
|
23
50
|
logger.success("verify: project is valid");
|
|
@@ -73,6 +100,10 @@ const runVerifyCommand = async (options) => {
|
|
|
73
100
|
warnings.push(typecheck.warning);
|
|
74
101
|
}
|
|
75
102
|
}
|
|
103
|
+
const healthError = await probeHealthIfRequested(options, logger);
|
|
104
|
+
if (healthError !== void 0) {
|
|
105
|
+
errors.push(healthError);
|
|
106
|
+
}
|
|
76
107
|
const result = reportVerifyResult(logger, errors, warnings, validation.wranglerPath);
|
|
77
108
|
if (isJsonFormat(options.format)) {
|
|
78
109
|
printJson(result);
|
|
@@ -85,6 +116,7 @@ const execute = defineHandler(async ({ cwd, logger, options }) => {
|
|
|
85
116
|
apiSpec: parseApiSpec(options.apiSpec),
|
|
86
117
|
cwd,
|
|
87
118
|
format: options.format,
|
|
119
|
+
healthUrl: options.healthUrl,
|
|
88
120
|
logger,
|
|
89
121
|
// `--no-typecheck` is declared as a `no-*` option but cerebro exposes it
|
|
90
122
|
// under the negated `typecheck` key (false when passed, true when absent).
|
|
@@ -724,7 +724,8 @@ const verifyCommand = {
|
|
|
724
724
|
description: "Validate wrangler.jsonc + codegen dry-run + tsc --noEmit (no files written)",
|
|
725
725
|
examples: [
|
|
726
726
|
["lunora verify", "Validate wrangler + codegen + tsc"],
|
|
727
|
-
["lunora verify --no-typecheck", "Skip the TypeScript type-check"]
|
|
727
|
+
["lunora verify --no-typecheck", "Skip the TypeScript type-check"],
|
|
728
|
+
["lunora verify --health-url https://my-app.workers.dev", "Also probe the deployment's /_lunora/health"]
|
|
728
729
|
],
|
|
729
730
|
group: "Deploy",
|
|
730
731
|
loader: () => import('../packem_chunks/handler19.mjs').then((m) => {
|
|
@@ -735,6 +736,11 @@ const verifyCommand = {
|
|
|
735
736
|
{ description: "Treat breaking schema drift as a warning instead of a failure", name: "allow-schema-drift", type: Boolean },
|
|
736
737
|
{ description: `Which API spec(s) to emit: ${API_SPEC_HELP} (default openapi)`, name: "api-spec", type: String },
|
|
737
738
|
{ description: "Output format: pretty (default) or json", name: "format", type: String },
|
|
739
|
+
{
|
|
740
|
+
description: "Probe this deployment's /_lunora/health endpoint (off by default; keeps verify offline-safe)",
|
|
741
|
+
name: "health-url",
|
|
742
|
+
type: String
|
|
743
|
+
},
|
|
738
744
|
{ description: "Skip the TypeScript type-check step", name: "no-typecheck", type: Boolean }
|
|
739
745
|
]
|
|
740
746
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lunora/cli",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.98",
|
|
4
4
|
"description": "The Lunora CLI: init, dev, deploy, codegen, run, reset, and migrate commands",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent-skills",
|
|
@@ -52,14 +52,14 @@
|
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"@bomb.sh/tab": "0.0.19",
|
|
55
|
-
"@lunora/bindings": "1.0.0-alpha.
|
|
56
|
-
"@lunora/codegen": "1.0.0-alpha.
|
|
57
|
-
"@lunora/config": "1.0.0-alpha.
|
|
58
|
-
"@lunora/container": "1.0.0-alpha.
|
|
59
|
-
"@lunora/d1": "1.0.0-alpha.
|
|
60
|
-
"@lunora/errors": "1.0.0-alpha.
|
|
61
|
-
"@lunora/runtime": "1.0.0-alpha.
|
|
62
|
-
"@lunora/seed": "1.0.0-alpha.
|
|
55
|
+
"@lunora/bindings": "1.0.0-alpha.10",
|
|
56
|
+
"@lunora/codegen": "1.0.0-alpha.52",
|
|
57
|
+
"@lunora/config": "1.0.0-alpha.78",
|
|
58
|
+
"@lunora/container": "1.0.0-alpha.14",
|
|
59
|
+
"@lunora/d1": "1.0.0-alpha.38",
|
|
60
|
+
"@lunora/errors": "1.0.0-alpha.7",
|
|
61
|
+
"@lunora/runtime": "1.0.0-alpha.35",
|
|
62
|
+
"@lunora/seed": "1.0.0-alpha.29",
|
|
63
63
|
"@visulima/cerebro": "3.0.0",
|
|
64
64
|
"@visulima/error": "6.0.0",
|
|
65
65
|
"@visulima/fs": "5.0.4",
|