@lunora/cli 1.0.0-alpha.2 → 1.0.0-alpha.21
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 +217 -113
- package/dist/index.d.ts +217 -113
- package/dist/index.mjs +7 -7
- package/dist/packem_chunks/handler.mjs +80 -6
- package/dist/packem_chunks/handler10.mjs +1 -1
- package/dist/packem_chunks/handler11.mjs +1 -1
- package/dist/packem_chunks/handler12.mjs +1 -1
- package/dist/packem_chunks/handler13.mjs +1 -1
- package/dist/packem_chunks/handler14.mjs +2 -2
- package/dist/packem_chunks/handler15.mjs +1 -1
- package/dist/packem_chunks/handler16.mjs +5 -3
- package/dist/packem_chunks/handler17.mjs +1 -1
- package/dist/packem_chunks/handler18.mjs +4 -6
- package/dist/packem_chunks/handler19.mjs +3 -3
- package/dist/packem_chunks/handler2.mjs +2 -2
- package/dist/packem_chunks/handler20.mjs +1 -1
- package/dist/packem_chunks/handler21.mjs +2 -2
- package/dist/packem_chunks/handler3.mjs +1 -1
- package/dist/packem_chunks/handler4.mjs +1 -1
- package/dist/packem_chunks/handler5.mjs +2 -2
- package/dist/packem_chunks/handler6.mjs +2 -2
- package/dist/packem_chunks/handler7.mjs +1 -1
- package/dist/packem_chunks/handler8.mjs +1 -1
- package/dist/packem_chunks/handler9.mjs +1 -1
- package/dist/packem_chunks/planDevCommand.mjs +6 -49
- package/dist/packem_chunks/runCodegenCommand.mjs +2 -2
- package/dist/packem_chunks/runDeployCommand.mjs +3 -3
- package/dist/packem_chunks/runInitCommand.mjs +1948 -107
- package/dist/packem_chunks/runMigrateGenerateCommand.mjs +5 -5
- package/dist/packem_chunks/runResetCommand.mjs +4 -4
- package/dist/packem_chunks/runRpcCommand.mjs +1 -1
- package/dist/packem_shared/{COMMANDS-1V_KEx35.mjs → COMMANDS-D3h9Iwvl.mjs} +45 -6
- package/dist/packem_shared/{command-BDXcJCCJ.mjs → command-BC30oSBW.mjs} +1 -1
- package/dist/packem_shared/{runAddCommand-BZGkRnBs.mjs → commands-hl0mRqqg.mjs} +177 -25
- package/dist/packem_shared/{createLogger-CHPNjFw2.mjs → createLogger-B40gPzQo.mjs} +9 -4
- package/dist/packem_shared/detect-package-manager-DYp7n3mJ.mjs +61 -0
- package/dist/packem_shared/{diffSnapshots-RR2ZE8Ya.mjs → diffSnapshots-BeDvvNiF.mjs} +1 -1
- package/dist/packem_shared/{insertSchemaExtension-BuzF6-t2.mjs → insertSchemaExtension-DAqbfr9Z.mjs} +15 -10
- package/dist/packem_shared/{output-format-7gyGR3h8.mjs → output-format-wUvAN6AL.mjs} +1 -1
- package/dist/packem_shared/runAddCommand-vJdgiR5t.mjs +4 -0
- package/dist/packem_shared/{schemaIrToSnapshot-aBTo7TM5.mjs → schemaIrToSnapshot-DdsljJT-.mjs} +1 -1
- package/dist/packem_shared/storage-B7hHSTZP.mjs +84 -0
- package/dist/packem_shared/tui-prompts-M6OWsuyw.mjs +663 -0
- package/package.json +11 -10
- package/skills/lunora-setup-storage/SKILL.md +7 -3
- package/dist/packem_shared/features-ocSSpZtS.mjs +0 -24
- /package/dist/packem_shared/{defaultSpawner-DxI3mebw.mjs → createRecordingSpawner-DxI3mebw.mjs} +0 -0
|
@@ -2,12 +2,12 @@ import { existsSync } from 'node:fs';
|
|
|
2
2
|
import { mkdtemp, writeFile, rm } from 'node:fs/promises';
|
|
3
3
|
import { tmpdir } from 'node:os';
|
|
4
4
|
import { discoverSchema, schemaFromIr } from '@lunora/codegen';
|
|
5
|
-
import { promptYesNo } from '@lunora/config';
|
|
6
5
|
import { seedPlan } from '@lunora/seed';
|
|
7
6
|
import { join } from '@visulima/path';
|
|
8
7
|
import { Project } from 'ts-morph';
|
|
9
|
-
import { d as defineHandler } from '../packem_shared/command-
|
|
8
|
+
import { d as defineHandler } from '../packem_shared/command-BC30oSBW.mjs';
|
|
10
9
|
import { a as resolveProductionWorkerUrl } from '../packem_shared/resolve-target-qbsJ_5sF.mjs';
|
|
10
|
+
import { b as tuiConfirm } from '../packem_shared/tui-prompts-M6OWsuyw.mjs';
|
|
11
11
|
import { runImportCommand } from '../packem_shared/DEFAULT_IMPORT_BATCH_SIZE-Ck-2bU08.mjs';
|
|
12
12
|
import { runResetCommand } from './runResetCommand.mjs';
|
|
13
13
|
|
|
@@ -88,10 +88,8 @@ const confirmRemoteSeedTarget = async (options, generated) => {
|
|
|
88
88
|
options.logger.error("seed: refusing to insert into a non-local target without confirmation — re-run with --yes");
|
|
89
89
|
return seedFailure(1);
|
|
90
90
|
}
|
|
91
|
-
const confirmer = options.confirm ??
|
|
92
|
-
const confirmed = await confirmer(
|
|
93
|
-
`This will insert ${String(generated)} generated row(s) into ${options.url ?? "the production worker"}. Continue? [y/N] `
|
|
94
|
-
);
|
|
91
|
+
const confirmer = options.confirm ?? tuiConfirm;
|
|
92
|
+
const confirmed = await confirmer(`This will insert ${String(generated)} generated row(s) into ${options.url ?? "the production worker"}. Continue?`);
|
|
95
93
|
if (!confirmed) {
|
|
96
94
|
options.logger.info("seed: aborted");
|
|
97
95
|
return seedFailure(1);
|
|
@@ -2,10 +2,10 @@ import { existsSync } from 'node:fs';
|
|
|
2
2
|
import { join } from 'node:path';
|
|
3
3
|
import { runCodegen } from '@lunora/codegen';
|
|
4
4
|
import { p as parseApiSpec } from '../packem_shared/api-spec-CtA6ilu4.mjs';
|
|
5
|
-
import { d as defineHandler } from '../packem_shared/command-
|
|
6
|
-
import { v as validateOutputFormat, i as isJsonFormat, p as printJson, l as loggerForFormat } from '../packem_shared/output-format-
|
|
5
|
+
import { d as defineHandler } from '../packem_shared/command-BC30oSBW.mjs';
|
|
6
|
+
import { v as validateOutputFormat, i as isJsonFormat, p as printJson, l as loggerForFormat } from '../packem_shared/output-format-wUvAN6AL.mjs';
|
|
7
7
|
import { r as runSchemaDriftGate } from '../packem_shared/schema-drift-gate-BtBt0as0.mjs';
|
|
8
|
-
import { defaultSpawner } from '../packem_shared/
|
|
8
|
+
import { defaultSpawner } from '../packem_shared/createRecordingSpawner-DxI3mebw.mjs';
|
|
9
9
|
import { validateWranglerProject } from '@lunora/config';
|
|
10
10
|
|
|
11
11
|
const runTypecheckStep = async (cwd, spawner) => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { mkdtempSync, rmSync, existsSync, readdirSync, statSync } from 'node:fs';
|
|
2
2
|
import { tmpdir } from 'node:os';
|
|
3
3
|
import { join, relative } from 'node:path';
|
|
4
|
-
import { d as defineHandler } from '../packem_shared/command-
|
|
5
|
-
import { defaultSpawner } from '../packem_shared/
|
|
4
|
+
import { d as defineHandler } from '../packem_shared/command-BC30oSBW.mjs';
|
|
5
|
+
import { defaultSpawner } from '../packem_shared/createRecordingSpawner-DxI3mebw.mjs';
|
|
6
6
|
|
|
7
7
|
const walk = (root) => {
|
|
8
8
|
const entries = [];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { readFileSync, existsSync } from 'node:fs';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
3
|
import { parse } from 'jsonc-parser';
|
|
4
|
-
import { d as defineHandler } from '../packem_shared/command-
|
|
4
|
+
import { d as defineHandler } from '../packem_shared/command-BC30oSBW.mjs';
|
|
5
5
|
import { o as openUrl } from '../packem_shared/open-url-Dfq6fAyT.mjs';
|
|
6
6
|
|
|
7
7
|
const DEFAULT_DEV_PORT = 8787;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { writeFileSync, existsSync, readFileSync } from 'node:fs';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
3
|
import { DEV_VARS_FILE, DEV_VARS_KEY_PATTERN, DEV_VARS_EXAMPLE_FILE, parseDevVariableEntries, isPlaceholderValue } from '@lunora/config';
|
|
4
|
-
import { d as defineHandler } from '../packem_shared/command-
|
|
5
|
-
import { defaultSpawner } from '../packem_shared/
|
|
4
|
+
import { d as defineHandler } from '../packem_shared/command-BC30oSBW.mjs';
|
|
5
|
+
import { defaultSpawner } from '../packem_shared/createRecordingSpawner-DxI3mebw.mjs';
|
|
6
6
|
import { execFile } from 'node:child_process';
|
|
7
7
|
|
|
8
8
|
const execCode = (error) => {
|
|
@@ -2,7 +2,7 @@ import { existsSync } from 'node:fs';
|
|
|
2
2
|
import { mkdir, readFile, writeFile } from 'node:fs/promises';
|
|
3
3
|
import { join } from 'node:path';
|
|
4
4
|
import { r as resolveAdminBaseUrl } from '../packem_shared/admin-url-4UzT-CI4.mjs';
|
|
5
|
-
import { d as defineHandler } from '../packem_shared/command-
|
|
5
|
+
import { d as defineHandler } from '../packem_shared/command-BC30oSBW.mjs';
|
|
6
6
|
import { a as resolveProductionWorkerUrl } from '../packem_shared/resolve-target-qbsJ_5sF.mjs';
|
|
7
7
|
import { runExportCommand, runImportCommand } from '../packem_shared/DEFAULT_IMPORT_BATCH_SIZE-Ck-2bU08.mjs';
|
|
8
8
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { p as parseApiSpec } from '../packem_shared/api-spec-CtA6ilu4.mjs';
|
|
2
|
-
import { d as defineHandler } from '../packem_shared/command-
|
|
2
|
+
import { d as defineHandler } from '../packem_shared/command-BC30oSBW.mjs';
|
|
3
3
|
import { runDeployCommand } from './runDeployCommand.mjs';
|
|
4
4
|
|
|
5
5
|
const DEFAULT_OUT_DIR = ".lunora/build";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { d as defineHandler } from '../packem_shared/command-
|
|
1
|
+
import { d as defineHandler } from '../packem_shared/command-BC30oSBW.mjs';
|
|
2
2
|
import { i as isDockerAvailable } from '../packem_shared/docker-hMQ97KSQ.mjs';
|
|
3
|
-
import { defaultSpawner } from '../packem_shared/
|
|
3
|
+
import { defaultSpawner } from '../packem_shared/createRecordingSpawner-DxI3mebw.mjs';
|
|
4
4
|
|
|
5
5
|
const SUBCOMMANDS = /* @__PURE__ */ new Set(["build", "delete", "images", "info", "list", "push"]);
|
|
6
6
|
const NEEDS_DOCKER = /* @__PURE__ */ new Set(["build", "push"]);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as defineHandler } from '../packem_shared/command-
|
|
2
|
-
import { defaultSpawner } from '../packem_shared/
|
|
1
|
+
import { d as defineHandler } from '../packem_shared/command-BC30oSBW.mjs';
|
|
2
|
+
import { defaultSpawner } from '../packem_shared/createRecordingSpawner-DxI3mebw.mjs';
|
|
3
3
|
|
|
4
4
|
const withEnv = (args, env) => {
|
|
5
5
|
if (env !== void 0) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as defineHandler } from '../packem_shared/command-
|
|
1
|
+
import { d as defineHandler } from '../packem_shared/command-BC30oSBW.mjs';
|
|
2
2
|
import { o as openUrl } from '../packem_shared/open-url-Dfq6fAyT.mjs';
|
|
3
3
|
|
|
4
4
|
const DEFAULT_DOCS_URL = "https://lunora.anolilab.dev/docs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from 'node:fs';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
3
|
import { findWranglerFile, readWranglerJsonc, validateWranglerConfig, isPlaceholderValue, DEV_VARS_FILE, parseDevVariableEntries, inferLunoraBindings } from '@lunora/config';
|
|
4
|
-
import { d as defineHandler } from '../packem_shared/command-
|
|
4
|
+
import { d as defineHandler } from '../packem_shared/command-BC30oSBW.mjs';
|
|
5
5
|
|
|
6
6
|
const SECRET_KEY_PATTERN = /(?:KEY|PASSWORD|SECRET|TOKEN)$/u;
|
|
7
7
|
const isD1PlaceholderId = (databaseId) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as defineHandler } from '../packem_shared/command-
|
|
1
|
+
import { d as defineHandler } from '../packem_shared/command-BC30oSBW.mjs';
|
|
2
2
|
import { a as resolveProductionWorkerUrl } from '../packem_shared/resolve-target-qbsJ_5sF.mjs';
|
|
3
3
|
import { runExportCommand } from '../packem_shared/DEFAULT_IMPORT_BATCH_SIZE-Ck-2bU08.mjs';
|
|
4
4
|
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { spawn } from 'node:child_process';
|
|
2
|
-
import { detectAgentRules, inferLunoraBindings, packageNamesFromBindings, ensureDevVarsExample, ensureDevVariables,
|
|
2
|
+
import { detectAgentRules, resolveRemoteEnabled, readProjectRemotePreference, inferLunoraBindings, packageNamesFromBindings, ensureDevVarsExample, ensureDevVariables, isInteractive, DEV_VARS_FILE, DEV_VARS_EXAMPLE_FILE, claimAgentRulesHint, AGENT_RULES_HINT, materializeRemoteWranglerConfig, formatLunoraEvent } from '@lunora/config';
|
|
3
3
|
import { p as parseApiSpec } from '../packem_shared/api-spec-CtA6ilu4.mjs';
|
|
4
|
-
import { existsSync, watch
|
|
4
|
+
import { existsSync, watch } from 'node:fs';
|
|
5
5
|
import { join } from 'node:path';
|
|
6
6
|
import { runCodegen } from '@lunora/codegen';
|
|
7
|
-
import { d as defineHandler } from '../packem_shared/command-
|
|
8
|
-
import {
|
|
7
|
+
import { d as defineHandler } from '../packem_shared/command-BC30oSBW.mjs';
|
|
8
|
+
import { d as detectPackageManager, e as execArgsFor } from '../packem_shared/detect-package-manager-DYp7n3mJ.mjs';
|
|
9
9
|
import { createServer, request } from 'node:http';
|
|
10
10
|
import { connect } from 'node:net';
|
|
11
11
|
import { loadStudioAssets, studioAssetsStamp, renderStudioHtml, resolveAdminToken, SCHEMA_EDIT_ENDPOINT, POLICY_SCAFFOLD_ENDPOINT, SEED_ENDPOINT, serveJsonHandler, handleSchemaEditRequest, handlePolicyScaffoldRequest, handleSeedRequest } from '@lunora/config/studio-host';
|
|
12
|
+
import { c as createTuiConfirm } from '../packem_shared/tui-prompts-M6OWsuyw.mjs';
|
|
12
13
|
|
|
13
14
|
const DEFAULT_DEBOUNCE_MS = 100;
|
|
14
15
|
const PATH_SEGMENT_SEPARATOR = /[/\\]/u;
|
|
@@ -70,50 +71,6 @@ const startCodegenWatch = (options) => {
|
|
|
70
71
|
};
|
|
71
72
|
};
|
|
72
73
|
|
|
73
|
-
const FALLBACK = "pnpm";
|
|
74
|
-
const KNOWN_MANAGERS = ["pnpm", "yarn", "npm", "bun"];
|
|
75
|
-
const parseDeclaredManager = (declared) => {
|
|
76
|
-
if (typeof declared !== "string") {
|
|
77
|
-
return void 0;
|
|
78
|
-
}
|
|
79
|
-
return KNOWN_MANAGERS.find((manager) => declared.startsWith(`${manager}@`));
|
|
80
|
-
};
|
|
81
|
-
const readDeclaredManager = (directory) => {
|
|
82
|
-
const candidate = join$1(directory, "package.json");
|
|
83
|
-
if (!existsSync(candidate)) {
|
|
84
|
-
return void 0;
|
|
85
|
-
}
|
|
86
|
-
try {
|
|
87
|
-
const parsed = JSON.parse(readFileSync(candidate, "utf8"));
|
|
88
|
-
return parseDeclaredManager(parsed.packageManager);
|
|
89
|
-
} catch {
|
|
90
|
-
return void 0;
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
const detectPackageManager = (startDirectory) => {
|
|
94
|
-
let directory = startDirectory;
|
|
95
|
-
while (directory && directory !== dirname(directory)) {
|
|
96
|
-
const declared = readDeclaredManager(directory);
|
|
97
|
-
if (declared !== void 0) {
|
|
98
|
-
return declared;
|
|
99
|
-
}
|
|
100
|
-
directory = dirname(directory);
|
|
101
|
-
}
|
|
102
|
-
return FALLBACK;
|
|
103
|
-
};
|
|
104
|
-
const execArgsFor = (manager, command, args) => {
|
|
105
|
-
if (manager === "yarn") {
|
|
106
|
-
return { args: [command, ...args], command: "yarn" };
|
|
107
|
-
}
|
|
108
|
-
if (manager === "bun") {
|
|
109
|
-
return { args: ["x", command, ...args], command: "bun" };
|
|
110
|
-
}
|
|
111
|
-
if (manager === "npm") {
|
|
112
|
-
return { args: ["--", command, ...args], command: "npx" };
|
|
113
|
-
}
|
|
114
|
-
return { args: ["exec", command, ...args], command: "pnpm" };
|
|
115
|
-
};
|
|
116
|
-
|
|
117
74
|
const PROXY_PREFIX = "/_lunora";
|
|
118
75
|
const pathnameOf = (url) => {
|
|
119
76
|
const queryIndex = url.indexOf("?");
|
|
@@ -441,7 +398,7 @@ const offerDevVariablesScaffold = async (options, cwd) => {
|
|
|
441
398
|
} catch {
|
|
442
399
|
}
|
|
443
400
|
const result = await (options.ensureEnv ?? ensureDevVariables)({
|
|
444
|
-
confirm:
|
|
401
|
+
confirm: createTuiConfirm(),
|
|
445
402
|
cwd,
|
|
446
403
|
info: (message) => {
|
|
447
404
|
options.logger.info(message);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { runCodegen } from '@lunora/codegen';
|
|
2
2
|
import { p as parseApiSpec } from '../packem_shared/api-spec-CtA6ilu4.mjs';
|
|
3
|
-
import { d as defineHandler } from '../packem_shared/command-
|
|
4
|
-
import { v as validateOutputFormat, p as printJson, l as loggerForFormat, i as isJsonFormat } from '../packem_shared/output-format-
|
|
3
|
+
import { d as defineHandler } from '../packem_shared/command-BC30oSBW.mjs';
|
|
4
|
+
import { v as validateOutputFormat, p as printJson, l as loggerForFormat, i as isJsonFormat } from '../packem_shared/output-format-wUvAN6AL.mjs';
|
|
5
5
|
|
|
6
6
|
const CRON_TRIGGER_LIMIT = 3;
|
|
7
7
|
const runCodegenCommand = (options) => {
|
|
@@ -6,11 +6,11 @@ import { Spinner } from '@visulima/spinner';
|
|
|
6
6
|
import { Project } from 'ts-morph';
|
|
7
7
|
import { p as parseApiSpec } from '../packem_shared/api-spec-CtA6ilu4.mjs';
|
|
8
8
|
import { r as readWranglerName } from '../packem_shared/wrangler-name-cy4yhm9j.mjs';
|
|
9
|
-
import { d as defineHandler } from '../packem_shared/command-
|
|
9
|
+
import { d as defineHandler } from '../packem_shared/command-BC30oSBW.mjs';
|
|
10
10
|
import { a as isRailpackAvailable, i as isDockerAvailable } from '../packem_shared/docker-hMQ97KSQ.mjs';
|
|
11
|
-
import { v as validateOutputFormat, i as isJsonFormat, p as printJson, l as loggerForFormat } from '../packem_shared/output-format-
|
|
11
|
+
import { v as validateOutputFormat, i as isJsonFormat, p as printJson, l as loggerForFormat } from '../packem_shared/output-format-wUvAN6AL.mjs';
|
|
12
12
|
import { containerBuildTag } from '@lunora/container';
|
|
13
|
-
import { defaultSpawner } from '../packem_shared/
|
|
13
|
+
import { defaultSpawner } from '../packem_shared/createRecordingSpawner-DxI3mebw.mjs';
|
|
14
14
|
import { r as resolveWorkerUrl } from '../packem_shared/resolve-target-qbsJ_5sF.mjs';
|
|
15
15
|
import { r as runSchemaDriftGate } from '../packem_shared/schema-drift-gate-BtBt0as0.mjs';
|
|
16
16
|
import { runMigrateDataCommand } from './runMigrateGenerateCommand.mjs';
|