@lunora/cli 1.0.0-alpha.87 → 1.0.0-alpha.89
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/index.mjs +1 -1
- package/dist/packem_chunks/handler.mjs +2 -2
- package/dist/packem_chunks/handler15.mjs +1 -1
- package/dist/packem_chunks/handler16.mjs +12 -3
- package/dist/packem_chunks/handler17.mjs +1 -1
- package/dist/packem_chunks/handler2.mjs +1 -1
- package/dist/packem_chunks/handler20.mjs +1 -1
- package/dist/packem_chunks/handler5.mjs +1 -1
- package/dist/packem_chunks/handler6.mjs +1 -1
- package/dist/packem_chunks/handler9.mjs +18 -11
- package/dist/packem_chunks/planDevCommand.mjs +13 -9
- package/dist/packem_chunks/runDeployCommand.mjs +14 -5
- package/dist/packem_chunks/runInitCommand.mjs +3 -3
- package/dist/packem_shared/{commands-CKg6zztp.mjs → commands-D5Yxt9VY.mjs} +11 -14
- package/dist/packem_shared/{detect-package-manager-DvEthdCw.mjs → detect-package-manager-v4hHpQd0.mjs} +6 -1
- package/dist/packem_shared/{runAddCommand-DBfaRmZ3.mjs → runAddCommand-D1hgfqFQ.mjs} +1 -1
- package/dist/packem_shared/{storage-BDaKEAHr.mjs → storage-BXU4ax4O.mjs} +1 -1
- package/dist/packem_shared/{wrangler-secrets-Dq_Fkbm-.mjs → wrangler-secrets-Coni-mER.mjs} +1 -1
- package/package.json +5 -5
package/dist/index.mjs
CHANGED
|
@@ -15,4 +15,4 @@ export { createRecordingSpawner, defaultSpawner } from './packem_shared/createRe
|
|
|
15
15
|
export { default as parseManifest } from './packem_shared/parseManifest-Dbp-Q2q3.mjs';
|
|
16
16
|
export { REQUIRED_COMPATIBILITY_DATE, REQUIRED_FLAG, validateWranglerProject as validateWrangler, validateWranglerConfig } from '@lunora/config';
|
|
17
17
|
export { buildRegistryIndex } from './packem_shared/buildRegistryIndex-BS5ig822.mjs';
|
|
18
|
-
export { r as runAddCommand, a as runBuildIndexCommand, b as runRegistryViewCommand } from './packem_shared/commands-
|
|
18
|
+
export { r as runAddCommand, a as runBuildIndexCommand, b as runRegistryViewCommand } from './packem_shared/commands-D5Yxt9VY.mjs';
|
|
@@ -4,8 +4,8 @@ import { join, basename } from '@visulima/path';
|
|
|
4
4
|
import { d as defineHandler } from '../packem_shared/command-lYnl4QyF.mjs';
|
|
5
5
|
import { v as validateOutputFormat, i as isJsonFormat, p as printJson, l as loggerForFormat } from '../packem_shared/output-format-B4642rjE.mjs';
|
|
6
6
|
import { t as tuiText, a as tuiSelect } from '../packem_shared/tui-prompts-BjEN8XgP.mjs';
|
|
7
|
-
import { n as normalizeFeature, E as EMAIL_ITEM, s as sanitizeBucketName, d as deriveBucketName, p as promptBucketName, r as resolveTypedDestination, M as MAIL_DESTINATION_PROMPT, a as sanitizeDatabaseName, b as deriveDatabaseName, c as promptDatabaseName, D as DEFAULT_AUTH_ITEM, e as promptAuthProvider, A as AUTH_PROVIDER_OPTIONS, w as withStorageBucketName, f as withMailDestination, g as withAuthDatabaseName } from '../packem_shared/storage-
|
|
8
|
-
import { r as runAddCommand } from '../packem_shared/commands-
|
|
7
|
+
import { n as normalizeFeature, E as EMAIL_ITEM, s as sanitizeBucketName, d as deriveBucketName, p as promptBucketName, r as resolveTypedDestination, M as MAIL_DESTINATION_PROMPT, a as sanitizeDatabaseName, b as deriveDatabaseName, c as promptDatabaseName, D as DEFAULT_AUTH_ITEM, e as promptAuthProvider, A as AUTH_PROVIDER_OPTIONS, w as withStorageBucketName, f as withMailDestination, g as withAuthDatabaseName } from '../packem_shared/storage-BXU4ax4O.mjs';
|
|
8
|
+
import { r as runAddCommand } from '../packem_shared/commands-D5Yxt9VY.mjs';
|
|
9
9
|
|
|
10
10
|
const providerToItem = (provider) => {
|
|
11
11
|
const value = provider.trim().toLowerCase();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readLinkedProject } from '@lunora/config';
|
|
2
2
|
import { d as defineHandler } from '../packem_shared/command-lYnl4QyF.mjs';
|
|
3
|
-
import { e as execArgsFor, d as detectPackageManager } from '../packem_shared/detect-package-manager-
|
|
3
|
+
import { e as execArgsFor, d as detectPackageManager } from '../packem_shared/detect-package-manager-v4hHpQd0.mjs';
|
|
4
4
|
import { defaultSpawner } from '../packem_shared/createRecordingSpawner-WuSn20kb.mjs';
|
|
5
5
|
|
|
6
6
|
const LOG_FORMATS = /* @__PURE__ */ new Set(["json", "pretty"]);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { runCodegen } from '@lunora/codegen';
|
|
2
|
-
import { validateWranglerProject, inferLunoraBindings, reconcileWranglerBindings, reconcileWranglerCompatibilityDate } from '@lunora/config';
|
|
2
|
+
import { validateWranglerProject, inferLunoraBindings, reconcileWranglerBindings, reconcileWranglerCompatibilityDate, reconcileWranglerCrons } from '@lunora/config';
|
|
3
3
|
import { p as parseApiSpec } from '../packem_shared/api-spec-Bx0iKbxA.mjs';
|
|
4
4
|
import { r as renderCodegenFailure } from '../packem_shared/codegen-error-DJG-ghs_.mjs';
|
|
5
5
|
import { d as defineHandler } from '../packem_shared/command-lYnl4QyF.mjs';
|
|
6
6
|
import { r as runSchemaDriftGate } from '../packem_shared/schema-drift-gate-BtBt0as0.mjs';
|
|
7
7
|
|
|
8
|
-
const provisionBindings = async (cwd, logger) => {
|
|
8
|
+
const provisionBindings = async (cwd, logger, cronTriggers = []) => {
|
|
9
9
|
try {
|
|
10
10
|
const inferred = await inferLunoraBindings({ projectRoot: cwd });
|
|
11
11
|
const reconciled = reconcileWranglerBindings(cwd, inferred);
|
|
@@ -30,6 +30,15 @@ const provisionBindings = async (cwd, logger) => {
|
|
|
30
30
|
const message = error instanceof Error ? error.message : String(error);
|
|
31
31
|
logger.warn(`compatibility date sync skipped: ${message}`);
|
|
32
32
|
}
|
|
33
|
+
try {
|
|
34
|
+
const reconciled = reconcileWranglerCrons(cwd, cronTriggers);
|
|
35
|
+
if (reconciled.changed) {
|
|
36
|
+
logger.success(`synced ${String(cronTriggers.length)} cron trigger(s) → ${reconciled.wranglerPath ?? "wrangler.jsonc"}`);
|
|
37
|
+
}
|
|
38
|
+
} catch (error) {
|
|
39
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
40
|
+
logger.warn(`cron trigger sync skipped: ${message}`);
|
|
41
|
+
}
|
|
33
42
|
};
|
|
34
43
|
const runPrepareCommand = async (options) => {
|
|
35
44
|
const cwd = options.cwd ?? process.cwd();
|
|
@@ -61,7 +70,7 @@ const runPrepareCommand = async (options) => {
|
|
|
61
70
|
validation: { problems: [], wranglerPath: void 0 }
|
|
62
71
|
};
|
|
63
72
|
}
|
|
64
|
-
await provisionBindings(cwd, options.logger);
|
|
73
|
+
await provisionBindings(cwd, options.logger, codegen.cronTriggers);
|
|
65
74
|
const validation = validateWranglerProject({ projectRoot: cwd });
|
|
66
75
|
if (validation.problems.length > 0) {
|
|
67
76
|
options.logger.error("wrangler.jsonc validation failed:");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { d as defineHandler } from '../packem_shared/command-lYnl4QyF.mjs';
|
|
2
|
-
import { r as runAddCommand, b as runRegistryViewCommand, a as runBuildIndexCommand } from '../packem_shared/commands-
|
|
2
|
+
import { r as runAddCommand, b as runRegistryViewCommand, a as runBuildIndexCommand } from '../packem_shared/commands-D5Yxt9VY.mjs';
|
|
3
3
|
|
|
4
4
|
const execute = defineHandler(({ argument, cwd, logger, options }) => {
|
|
5
5
|
const subcommand = argument[0];
|
|
@@ -2,7 +2,7 @@ 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
4
|
import { d as defineHandler } from '../packem_shared/command-lYnl4QyF.mjs';
|
|
5
|
-
import { e as execArgsFor, d as detectPackageManager } from '../packem_shared/detect-package-manager-
|
|
5
|
+
import { e as execArgsFor, d as detectPackageManager } from '../packem_shared/detect-package-manager-v4hHpQd0.mjs';
|
|
6
6
|
import { defaultSpawner } from '../packem_shared/createRecordingSpawner-WuSn20kb.mjs';
|
|
7
7
|
|
|
8
8
|
const walk = (root) => {
|
|
@@ -4,7 +4,7 @@ import { runCodegen } from '@lunora/codegen';
|
|
|
4
4
|
import { p as parseApiSpec } from '../packem_shared/api-spec-Bx0iKbxA.mjs';
|
|
5
5
|
import { a as renderCodegenHint } from '../packem_shared/codegen-error-DJG-ghs_.mjs';
|
|
6
6
|
import { d as defineHandler } from '../packem_shared/command-lYnl4QyF.mjs';
|
|
7
|
-
import { e as execArgsFor, d as detectPackageManager } from '../packem_shared/detect-package-manager-
|
|
7
|
+
import { e as execArgsFor, d as detectPackageManager } from '../packem_shared/detect-package-manager-v4hHpQd0.mjs';
|
|
8
8
|
import { v as validateOutputFormat, i as isJsonFormat, p as printJson, l as loggerForFormat } from '../packem_shared/output-format-B4642rjE.mjs';
|
|
9
9
|
import { r as runSchemaDriftGate } from '../packem_shared/schema-drift-gate-BtBt0as0.mjs';
|
|
10
10
|
import { defaultSpawner } from '../packem_shared/createRecordingSpawner-WuSn20kb.mjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { d as defineHandler } from '../packem_shared/command-lYnl4QyF.mjs';
|
|
2
|
-
import { e as execArgsFor, d as detectPackageManager } from '../packem_shared/detect-package-manager-
|
|
2
|
+
import { e as execArgsFor, d as detectPackageManager } from '../packem_shared/detect-package-manager-v4hHpQd0.mjs';
|
|
3
3
|
import { i as isDockerAvailable } from '../packem_shared/docker-hMQ97KSQ.mjs';
|
|
4
4
|
import { defaultSpawner } from '../packem_shared/createRecordingSpawner-WuSn20kb.mjs';
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { d as defineHandler } from '../packem_shared/command-lYnl4QyF.mjs';
|
|
2
|
-
import { e as execArgsFor, d as detectPackageManager } from '../packem_shared/detect-package-manager-
|
|
2
|
+
import { e as execArgsFor, d as detectPackageManager } from '../packem_shared/detect-package-manager-v4hHpQd0.mjs';
|
|
3
3
|
import { defaultSpawner } from '../packem_shared/createRecordingSpawner-WuSn20kb.mjs';
|
|
4
4
|
|
|
5
5
|
const withEnv = (args, env) => {
|
|
@@ -2,9 +2,9 @@ import { existsSync, readFileSync, writeFileSync } from 'node:fs';
|
|
|
2
2
|
import { join } from 'node:path';
|
|
3
3
|
import { DEV_VARS_FILE, DEV_VARS_KEY_PATTERN, generateSecretValue, DEV_VARS_EXAMPLE_FILE, parseDevVariableEntries, isPlaceholderValue, packageNamesFromBindings, inferLunoraBindings, requiredSecrets, isMintableSecretKey } from '@lunora/config';
|
|
4
4
|
import { d as defineHandler } from '../packem_shared/command-lYnl4QyF.mjs';
|
|
5
|
-
import { d as detectPackageManager, e as execArgsFor } from '../packem_shared/detect-package-manager-
|
|
5
|
+
import { d as detectPackageManager, e as execArgsFor } from '../packem_shared/detect-package-manager-v4hHpQd0.mjs';
|
|
6
6
|
import { defaultSpawner } from '../packem_shared/createRecordingSpawner-WuSn20kb.mjs';
|
|
7
|
-
import { l as listRemoteSecrets } from '../packem_shared/wrangler-secrets-
|
|
7
|
+
import { l as listRemoteSecrets } from '../packem_shared/wrangler-secrets-Coni-mER.mjs';
|
|
8
8
|
|
|
9
9
|
const NEWLINE_PRESENT = /[\r\n]/u;
|
|
10
10
|
const UNREPRESENTABLE_PRESENT = /["\\]/u;
|
|
@@ -15,21 +15,28 @@ const parseDevVariables = (content) => {
|
|
|
15
15
|
}
|
|
16
16
|
return map;
|
|
17
17
|
};
|
|
18
|
-
const
|
|
18
|
+
const escapeRegExp = (value) => value.replaceAll(/[.*+?^${}()|[\]\\]/gu, String.raw`\$&`);
|
|
19
|
+
const devVariableLinePattern = (key, global) => new RegExp(String.raw`^[ \t]*${escapeRegExp(key)}[ \t]*=.*(\r?\n|$)`, global ? "gmu" : "mu");
|
|
19
20
|
const upsertDevVariableLine = (content, key, value) => {
|
|
20
21
|
const rendered = `${key}="${value}"`;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
if (content === "") {
|
|
26
|
-
return `${rendered}
|
|
22
|
+
if (!devVariableLinePattern(key, false).test(content)) {
|
|
23
|
+
if (content === "") {
|
|
24
|
+
return `${rendered}
|
|
27
25
|
`;
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
}
|
|
27
|
+
return content.endsWith("\n") ? `${content}${rendered}
|
|
30
28
|
` : `${content}
|
|
31
29
|
${rendered}
|
|
32
30
|
`;
|
|
31
|
+
}
|
|
32
|
+
let replacedFirst = false;
|
|
33
|
+
return content.replace(devVariableLinePattern(key, true), (_match, newline) => {
|
|
34
|
+
if (replacedFirst) {
|
|
35
|
+
return "";
|
|
36
|
+
}
|
|
37
|
+
replacedFirst = true;
|
|
38
|
+
return `${rendered}${newline}`;
|
|
39
|
+
});
|
|
33
40
|
};
|
|
34
41
|
const removeDevVariableLine = (content, key) => content.replaceAll(new RegExp(String.raw`^[ \t]*${key}[ \t]*=.*(?:\r?\n|$)`, "gmu"), "");
|
|
35
42
|
const redact = (value) => {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { spawnSync, spawn } from 'node:child_process';
|
|
2
|
+
import { existsSync, watch, readFileSync, statSync, openSync, readSync, closeSync, mkdirSync } from 'node:fs';
|
|
3
|
+
import { join, dirname } from 'node:path';
|
|
2
4
|
import { runCodegen } from '@lunora/codegen';
|
|
3
5
|
import { detectAgentRules, claimDevServerState, clearDevServerState, readDevServerState, readLiveDevServerState, detectFramework, readProjectDependencyNames, DEV_HANDOFF_ENV, isRecordedProcessCurrent, DEV_LOG_FILE, DEV_LOG_FILE_ENV, DEV_DAEMON_ENV, updateDevServerState, detectAiAgent, resolveRemoteEnabled, readProjectRemotePreference, inferLunoraBindings, packageNamesFromBindings, ensureDevVarsExample, ensureDevVariables, isInteractive, DEV_VARS_FILE, DEV_VARS_EXAMPLE_FILE, fillDevSecrets, claimAgentRulesHint, AGENT_RULES_HINT, findWranglerFile, readWranglerJsonc, discoverContainerInfo, streamContainerLogs, materializeRemoteWranglerConfig, formatLunoraEvent } from '@lunora/config';
|
|
4
6
|
import { p as parseApiSpec } from '../packem_shared/api-spec-Bx0iKbxA.mjs';
|
|
5
|
-
import { existsSync, watch, readFileSync, statSync, openSync, readSync, closeSync, mkdirSync } from 'node:fs';
|
|
6
|
-
import { join, dirname } from 'node:path';
|
|
7
7
|
import { r as renderCodegenFailure } from '../packem_shared/codegen-error-DJG-ghs_.mjs';
|
|
8
8
|
import { d as defineHandler } from '../packem_shared/command-lYnl4QyF.mjs';
|
|
9
|
-
import { d as detectPackageManager, e as execArgsFor, r as runScriptCommand } from '../packem_shared/detect-package-manager-
|
|
9
|
+
import { d as detectPackageManager, e as execArgsFor, r as runScriptCommand } from '../packem_shared/detect-package-manager-v4hHpQd0.mjs';
|
|
10
10
|
import { createServer, connect } from 'node:net';
|
|
11
11
|
import { forceJsonLogging } from '../packem_shared/createLogger-CIWSHrTL.mjs';
|
|
12
12
|
import { networkInterfaces } from 'node:os';
|
|
@@ -726,14 +726,18 @@ const resolveRemotePlan = (options, cwd) => {
|
|
|
726
726
|
}
|
|
727
727
|
return { args: ["--config", result.configPath], plan: { bindings, cleanup, enabled: true } };
|
|
728
728
|
};
|
|
729
|
-
const
|
|
730
|
-
|
|
731
|
-
if (
|
|
732
|
-
const
|
|
733
|
-
if (
|
|
729
|
+
const readDevIp = (wranglerPath) => readWranglerJsonc(wranglerPath).parsed?.dev?.ip;
|
|
730
|
+
const resolveLoopbackArgs = (cwd, hasLoopback, sidecarConfigFile) => {
|
|
731
|
+
if (sidecarConfigFile !== void 0) {
|
|
732
|
+
const sidecarConfigPath = join(cwd, sidecarConfigFile);
|
|
733
|
+
if (existsSync(sidecarConfigPath) && readDevIp(sidecarConfigPath) !== void 0) {
|
|
734
734
|
return [];
|
|
735
735
|
}
|
|
736
736
|
}
|
|
737
|
+
const wranglerPath = findWranglerFile(cwd);
|
|
738
|
+
if (wranglerPath !== void 0 && readDevIp(wranglerPath) !== void 0) {
|
|
739
|
+
return [];
|
|
740
|
+
}
|
|
737
741
|
return hasLoopback() ? [] : ["--ip", "127.0.0.1"];
|
|
738
742
|
};
|
|
739
743
|
const resolveWorkerPort = async (options, cwd) => {
|
|
@@ -757,7 +761,7 @@ const planDevCommand = (options) => {
|
|
|
757
761
|
const exec2 = viteDevCommand(cwd);
|
|
758
762
|
let sidecar;
|
|
759
763
|
if (flavor === "framework-worker") {
|
|
760
|
-
const loopbackArgs2 = resolveLoopbackArgs(cwd, options.hasIpv6Loopback ?? hasIpv6Loopback);
|
|
764
|
+
const loopbackArgs2 = resolveLoopbackArgs(cwd, options.hasIpv6Loopback ?? hasIpv6Loopback, DEV_WRANGLER_CONFIG);
|
|
761
765
|
const sidecarExec = execArgsFor(manager, "wrangler", ["dev", "--config", DEV_WRANGLER_CONFIG, ...loopbackArgs2, "--var", "WORKER_ENV:development"]);
|
|
762
766
|
sidecar = { args: sidecarExec.args, command: sidecarExec.command, cwd, tag: "worker" };
|
|
763
767
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from 'node:fs';
|
|
2
2
|
import { runCodegen, discoverMigrations } from '@lunora/codegen';
|
|
3
|
-
import { readLinkedProject, writeLinkedProject, validateWranglerProject, inferLunoraBindings, reconcileWranglerBindings, reconcileWranglerCompatibilityDate, DEV_VARS_FILE, parseDevVariableEntries, isMintableSecretKey, findWranglerFile, readWranglerJsonc, discoverContainerInfo, packageNamesFromBindings, requiredSecrets, generateSecretValue } from '@lunora/config';
|
|
3
|
+
import { readLinkedProject, writeLinkedProject, validateWranglerProject, inferLunoraBindings, reconcileWranglerBindings, reconcileWranglerCompatibilityDate, reconcileWranglerCrons, DEV_VARS_FILE, parseDevVariableEntries, isMintableSecretKey, findWranglerFile, readWranglerJsonc, discoverContainerInfo, packageNamesFromBindings, requiredSecrets, generateSecretValue } from '@lunora/config';
|
|
4
4
|
import { join } from '@visulima/path';
|
|
5
5
|
import { Spinner } from '@visulima/spinner';
|
|
6
6
|
import { Project } from 'ts-morph';
|
|
7
7
|
import { p as parseApiSpec } from '../packem_shared/api-spec-Bx0iKbxA.mjs';
|
|
8
8
|
import { r as readWranglerName } from '../packem_shared/wrangler-name-cy4yhm9j.mjs';
|
|
9
9
|
import { d as defineHandler } from '../packem_shared/command-lYnl4QyF.mjs';
|
|
10
|
-
import { e as execArgsFor, d as detectPackageManager } from '../packem_shared/detect-package-manager-
|
|
10
|
+
import { e as execArgsFor, d as detectPackageManager } from '../packem_shared/detect-package-manager-v4hHpQd0.mjs';
|
|
11
11
|
import { a as isRailpackAvailable, i as isDockerAvailable } from '../packem_shared/docker-hMQ97KSQ.mjs';
|
|
12
12
|
import { v as validateOutputFormat, i as isJsonFormat, p as printJson, l as loggerForFormat } from '../packem_shared/output-format-B4642rjE.mjs';
|
|
13
13
|
import { containerBuildTag } from '@lunora/container';
|
|
@@ -15,7 +15,7 @@ import { defaultSpawner } from '../packem_shared/createRecordingSpawner-WuSn20kb
|
|
|
15
15
|
import { r as resolveWorkerUrl } from '../packem_shared/resolve-target-qbsJ_5sF.mjs';
|
|
16
16
|
import { r as runSchemaDriftGate } from '../packem_shared/schema-drift-gate-BtBt0as0.mjs';
|
|
17
17
|
import { c as createTuiConfirm } from '../packem_shared/tui-prompts-BjEN8XgP.mjs';
|
|
18
|
-
import { l as listRemoteSecrets } from '../packem_shared/wrangler-secrets-
|
|
18
|
+
import { l as listRemoteSecrets } from '../packem_shared/wrangler-secrets-Coni-mER.mjs';
|
|
19
19
|
import { runMigrateDataCommand } from './runMigrateGenerateCommand.mjs';
|
|
20
20
|
|
|
21
21
|
const WORKERS_DEV_URL = /https?:\/\/[^\s"'<>]+\.workers\.dev[^\s"'<>]*/u;
|
|
@@ -181,7 +181,7 @@ const buildContainerImages = async (cwd, options) => {
|
|
|
181
181
|
});
|
|
182
182
|
return result.code === 0 ? void 0 : result.error ?? "railpack build failed";
|
|
183
183
|
};
|
|
184
|
-
const provisionBindings = async (cwd, logger) => {
|
|
184
|
+
const provisionBindings = async (cwd, logger, cronTriggers = []) => {
|
|
185
185
|
try {
|
|
186
186
|
const inferred = await inferLunoraBindings({ projectRoot: cwd });
|
|
187
187
|
const reconciled = reconcileWranglerBindings(cwd, inferred);
|
|
@@ -206,6 +206,15 @@ const provisionBindings = async (cwd, logger) => {
|
|
|
206
206
|
const message = error instanceof Error ? error.message : String(error);
|
|
207
207
|
logger.warn(`compatibility date sync skipped: ${message}`);
|
|
208
208
|
}
|
|
209
|
+
try {
|
|
210
|
+
const reconciled = reconcileWranglerCrons(cwd, cronTriggers);
|
|
211
|
+
if (reconciled.changed) {
|
|
212
|
+
logger.success(`synced ${String(cronTriggers.length)} cron trigger(s) → ${reconciled.wranglerPath ?? "wrangler.jsonc"}`);
|
|
213
|
+
}
|
|
214
|
+
} catch (error) {
|
|
215
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
216
|
+
logger.warn(`cron trigger sync skipped: ${message}`);
|
|
217
|
+
}
|
|
209
218
|
};
|
|
210
219
|
const warnDevVariablesNotPushed = (cwd, logger) => {
|
|
211
220
|
const devVariablesPath = join(cwd, DEV_VARS_FILE);
|
|
@@ -519,7 +528,7 @@ const executeDeploy = async (options) => {
|
|
|
519
528
|
}
|
|
520
529
|
reblessSchemaBaseline = gate.rebless;
|
|
521
530
|
}
|
|
522
|
-
await provisionBindings(cwd, options.logger);
|
|
531
|
+
await provisionBindings(cwd, options.logger, codegen?.cronTriggers ?? []);
|
|
523
532
|
const migratePreflightError = validateMigrateDeployPreflight(options);
|
|
524
533
|
if (migratePreflightError !== void 0) {
|
|
525
534
|
return { code: 1, descriptor: void 0, error: migratePreflightError, validation: { problems: [], wranglerPath: void 0 } };
|
|
@@ -7,15 +7,15 @@ import { downloadTemplate } from 'giget';
|
|
|
7
7
|
import { modify, applyEdits } from 'jsonc-parser';
|
|
8
8
|
import { join, dirname } from 'node:path';
|
|
9
9
|
import { d as defineHandler } from '../packem_shared/command-lYnl4QyF.mjs';
|
|
10
|
-
import { d as detectPackageManager, a as detectInstalledManagers, i as installArgsFor, r as runScriptCommand } from '../packem_shared/detect-package-manager-
|
|
10
|
+
import { d as detectPackageManager, a as detectInstalledManagers, i as installArgsFor, r as runScriptCommand } from '../packem_shared/detect-package-manager-v4hHpQd0.mjs';
|
|
11
11
|
import MagicString from 'magic-string';
|
|
12
12
|
import { Project, SyntaxKind } from 'ts-morph';
|
|
13
13
|
import { P as PromptCancelledError } from '../packem_shared/prompt-cancelled-APzX1Im-.mjs';
|
|
14
|
-
import { c as resolveTagVersions, d as resolveSourceRef, e as resolvePinnedSourceRef, f as resolveDistTag, r as runAddCommand } from '../packem_shared/commands-
|
|
14
|
+
import { c as resolveTagVersions, d as resolveSourceRef, e as resolvePinnedSourceRef, f as resolveDistTag, r as runAddCommand } from '../packem_shared/commands-D5Yxt9VY.mjs';
|
|
15
15
|
import { defaultSpawner } from '../packem_shared/createRecordingSpawner-WuSn20kb.mjs';
|
|
16
16
|
import { d as tuiMascot, e as tuiStep, f as tuiMoonrise, t as tuiText, g as tuiHeadline, h as tuiInfo, a as tuiSelect, b as tuiConfirm, w as withTuiSpinner, i as tuiNextSteps, j as tuiTasks, k as tuiMultiSelect, l as withTuiBadgeProgress } from '../packem_shared/tui-prompts-BjEN8XgP.mjs';
|
|
17
17
|
import { logStep } from '../packem_shared/createLogger-CIWSHrTL.mjs';
|
|
18
|
-
import { E as EMAIL_ITEM, p as promptBucketName, w as withStorageBucketName, M as MAIL_DESTINATION_PROMPT, r as resolveTypedDestination, f as withMailDestination, e as promptAuthProvider, c as promptDatabaseName, g as withAuthDatabaseName } from '../packem_shared/storage-
|
|
18
|
+
import { E as EMAIL_ITEM, p as promptBucketName, w as withStorageBucketName, M as MAIL_DESTINATION_PROMPT, r as resolveTypedDestination, f as withMailDestination, e as promptAuthProvider, c as promptDatabaseName, g as withAuthDatabaseName } from '../packem_shared/storage-BXU4ax4O.mjs';
|
|
19
19
|
import dns from 'node:dns/promises';
|
|
20
20
|
|
|
21
21
|
const GITHUB_CONTENT = `name: Deploy
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { existsSync, readFileSync, writeFileSync, mkdirSync, mkdtempSync, rmSync } from 'node:fs';
|
|
2
2
|
import { dirname, join, relative } from '@visulima/path';
|
|
3
|
-
import { DEV_VARS_FILE, parseDevVariableEntries } from '@lunora/config';
|
|
3
|
+
import { DEV_VARS_FILE, parseDevVariableEntries, findWranglerFile, readWranglerJsonc } from '@lunora/config';
|
|
4
4
|
import { modify, applyEdits, parse } from 'jsonc-parser';
|
|
5
5
|
import { fileURLToPath } from 'node:url';
|
|
6
6
|
import { LunoraError } from '@lunora/errors';
|
|
@@ -522,20 +522,14 @@ const reconcileFile = (file, itemKey, itemDirectory, projectRoot, logger, lock,
|
|
|
522
522
|
}
|
|
523
523
|
return reconcileWholeFile(file, itemKey, itemDirectory, projectRoot, logger, lock, reconcileOptions, useUmbrella);
|
|
524
524
|
};
|
|
525
|
-
const WORKER_ENTRY_FALLBACKS = ["src/server.ts", "src/server/index.ts", "src/index.ts", "src/worker.ts"];
|
|
526
|
-
const WRANGLER_MAIN_RE = /"main"\s*:\s*"([^"]+)"/u;
|
|
525
|
+
const WORKER_ENTRY_FALLBACKS = ["src/server.ts", "src/server/index.ts", "src/server/index.tsx", "src/index.ts", "src/worker.ts"];
|
|
527
526
|
const readWranglerMain = (projectRoot) => {
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
continue;
|
|
532
|
-
}
|
|
533
|
-
const match = WRANGLER_MAIN_RE.exec(readFileSync(path, "utf8"));
|
|
534
|
-
if (match?.[1]) {
|
|
535
|
-
return match[1];
|
|
536
|
-
}
|
|
527
|
+
const wranglerPath = findWranglerFile(projectRoot);
|
|
528
|
+
if (wranglerPath === void 0) {
|
|
529
|
+
return void 0;
|
|
537
530
|
}
|
|
538
|
-
|
|
531
|
+
const { parsed } = readWranglerJsonc(wranglerPath);
|
|
532
|
+
return typeof parsed?.main === "string" ? parsed.main : void 0;
|
|
539
533
|
};
|
|
540
534
|
const findWorkerEntry = (projectRoot) => {
|
|
541
535
|
const main = readWranglerMain(projectRoot);
|
|
@@ -547,7 +541,10 @@ const findWorkerEntry = (projectRoot) => {
|
|
|
547
541
|
}
|
|
548
542
|
const content = readFileSync(absolute, "utf8");
|
|
549
543
|
if (!content.includes("createShardDO(")) {
|
|
550
|
-
|
|
544
|
+
if (candidate === main) {
|
|
545
|
+
break;
|
|
546
|
+
}
|
|
547
|
+
continue;
|
|
551
548
|
}
|
|
552
549
|
return { entryPath: absolute, main: candidate, source: content };
|
|
553
550
|
}
|
|
@@ -3,6 +3,8 @@ import { LunoraError } from '@lunora/errors';
|
|
|
3
3
|
import { findPackageManagerSync, identifyInitiatingPackageManager } from '@visulima/package/package-manager';
|
|
4
4
|
|
|
5
5
|
const INSTALL_PREFERENCE = ["pnpm", "bun", "yarn", "npm"];
|
|
6
|
+
const KNOWN_PACKAGE_MANAGERS = /* @__PURE__ */ new Set(["bun", "npm", "pnpm", "yarn"]);
|
|
7
|
+
const isKnownPackageManager = (name) => KNOWN_PACKAGE_MANAGERS.has(name);
|
|
6
8
|
const isManagerInstalled = (manager) => {
|
|
7
9
|
try {
|
|
8
10
|
return spawnSync(manager, ["--version"], { stdio: "ignore", timeout: 5e3 }).status === 0;
|
|
@@ -21,7 +23,10 @@ const detectPackageManager = (startDirectory) => {
|
|
|
21
23
|
}
|
|
22
24
|
const initiating = identifyInitiatingPackageManager();
|
|
23
25
|
if (initiating !== void 0) {
|
|
24
|
-
|
|
26
|
+
const name = initiating.name === "cnpm" ? "npm" : initiating.name;
|
|
27
|
+
if (isKnownPackageManager(name)) {
|
|
28
|
+
return name;
|
|
29
|
+
}
|
|
25
30
|
}
|
|
26
31
|
const [installed] = detectInstalledManagers();
|
|
27
32
|
if (installed !== void 0) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import 'node:fs';
|
|
2
2
|
import '@visulima/path';
|
|
3
|
-
export { r as runAddCommand, a as runBuildIndexCommand, g as runListCommand, b as runRegistryViewCommand } from './commands-
|
|
3
|
+
export { r as runAddCommand, a as runBuildIndexCommand, g as runListCommand, b as runRegistryViewCommand } from './commands-D5Yxt9VY.mjs';
|
|
4
4
|
import './buildRegistryIndex-BS5ig822.mjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { execFile } from 'node:child_process';
|
|
2
|
-
import { e as execArgsFor, d as detectPackageManager } from './detect-package-manager-
|
|
2
|
+
import { e as execArgsFor, d as detectPackageManager } from './detect-package-manager-v4hHpQd0.mjs';
|
|
3
3
|
|
|
4
4
|
const execCode = (error) => {
|
|
5
5
|
if (!error) {
|
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.89",
|
|
4
4
|
"description": "The Lunora CLI: init, dev, deploy, codegen, run, reset, and migrate commands",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent-skills",
|
|
@@ -52,12 +52,12 @@
|
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"@bomb.sh/tab": "0.0.18",
|
|
55
|
-
"@lunora/codegen": "1.0.0-alpha.
|
|
56
|
-
"@lunora/config": "1.0.0-alpha.
|
|
55
|
+
"@lunora/codegen": "1.0.0-alpha.46",
|
|
56
|
+
"@lunora/config": "1.0.0-alpha.70",
|
|
57
57
|
"@lunora/container": "1.0.0-alpha.12",
|
|
58
|
-
"@lunora/d1": "1.0.0-alpha.
|
|
58
|
+
"@lunora/d1": "1.0.0-alpha.32",
|
|
59
59
|
"@lunora/errors": "1.0.0-alpha.5",
|
|
60
|
-
"@lunora/seed": "1.0.0-alpha.
|
|
60
|
+
"@lunora/seed": "1.0.0-alpha.26",
|
|
61
61
|
"@visulima/cerebro": "3.0.0",
|
|
62
62
|
"@visulima/error": "6.0.0",
|
|
63
63
|
"@visulima/fs": "5.0.0",
|