@lunora/cli 1.0.0-alpha.4 → 1.0.0-alpha.400

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.
Files changed (130) hide show
  1. package/LICENSE.md +33 -0
  2. package/README.md +3 -1
  3. package/__assets__/package-og.svg +1 -1
  4. package/dist/bin.mjs +2 -10
  5. package/dist/index.d.mts +1161 -372
  6. package/dist/index.d.ts +1161 -372
  7. package/dist/index.mjs +1 -19
  8. package/dist/packem_chunks/dispatch.mjs +1 -0
  9. package/dist/packem_chunks/handler.mjs +1 -78
  10. package/dist/packem_chunks/handler10.mjs +1 -22
  11. package/dist/packem_chunks/handler11.mjs +1 -192
  12. package/dist/packem_chunks/handler12.mjs +1 -131
  13. package/dist/packem_chunks/handler13.mjs +3 -65
  14. package/dist/packem_chunks/handler14.mjs +1 -58
  15. package/dist/packem_chunks/handler15.mjs +1 -79
  16. package/dist/packem_chunks/handler16.mjs +1 -43
  17. package/dist/packem_chunks/handler17.mjs +7 -105
  18. package/dist/packem_chunks/handler18.mjs +1 -172
  19. package/dist/packem_chunks/handler19.mjs +1 -89
  20. package/dist/packem_chunks/handler2.mjs +1 -114
  21. package/dist/packem_chunks/handler20.mjs +3 -94
  22. package/dist/packem_chunks/handler21.mjs +3 -311
  23. package/dist/packem_chunks/handler22.mjs +1 -0
  24. package/dist/packem_chunks/handler23.mjs +2 -0
  25. package/dist/packem_chunks/handler24.mjs +99 -0
  26. package/dist/packem_chunks/handler25.mjs +2 -0
  27. package/dist/packem_chunks/handler26.mjs +9 -0
  28. package/dist/packem_chunks/handler27.mjs +1 -0
  29. package/dist/packem_chunks/handler3.mjs +1 -204
  30. package/dist/packem_chunks/handler4.mjs +3 -33
  31. package/dist/packem_chunks/handler5.mjs +1 -49
  32. package/dist/packem_chunks/handler6.mjs +1 -91
  33. package/dist/packem_chunks/handler7.mjs +1 -42
  34. package/dist/packem_chunks/handler8.mjs +2 -174
  35. package/dist/packem_chunks/handler9.mjs +1 -16
  36. package/dist/packem_chunks/runCodegenCommand.mjs +4 -52
  37. package/dist/packem_chunks/runDeployCommand.mjs +11 -504
  38. package/dist/packem_chunks/runDevCommand.mjs +2 -0
  39. package/dist/packem_chunks/runInitCommand.mjs +1176 -576
  40. package/dist/packem_chunks/runResetCommand.mjs +1 -41
  41. package/dist/packem_chunks/runRpcCommand.mjs +1 -68
  42. package/dist/packem_shared/COMMANDS-aSTSMwZS.mjs +1 -0
  43. package/dist/packem_shared/DEFAULT_IMPORT_BATCH_SIZE-CyIsI3S1.mjs +1 -0
  44. package/dist/packem_shared/EXIT_CODE-D_XCixv8.mjs +1 -0
  45. package/dist/packem_shared/admin-token-VdUnvnKW.mjs +1 -0
  46. package/dist/packem_shared/admin-url-DJB8P6Jh.mjs +1 -0
  47. package/dist/packem_shared/api-spec-lYyq4vL6.mjs +1 -0
  48. package/dist/packem_shared/binding-manifest-file-CQ1eQYy1.mjs +2 -0
  49. package/dist/packem_shared/buildRegistryIndex-Dc8D8AR6.mjs +1 -0
  50. package/dist/packem_shared/cap-error-body-YBKO32BF.mjs +1 -0
  51. package/dist/packem_shared/catalog-CahzmDLV.mjs +1 -0
  52. package/dist/packem_shared/cli-CFsmCYWp.mjs +2 -0
  53. package/dist/packem_shared/cli-manifest-DoQ_3bzs.mjs +1 -0
  54. package/dist/packem_shared/cloudflare-credentials-BVmZnDZk.mjs +1 -0
  55. package/dist/packem_shared/codegen-error-AmH54ofi.mjs +3 -0
  56. package/dist/packem_shared/command-BgjsvUFg.mjs +1 -0
  57. package/dist/packem_shared/commands-DvSfLvyt.mjs +13 -0
  58. package/dist/packem_shared/createLogger-4TujevyB.mjs +2 -0
  59. package/dist/packem_shared/createRecordingSpawner-Ch7zuQQE.mjs +1 -0
  60. package/dist/packem_shared/deploy-target-resolve-BTCW1Iv4.mjs +1 -0
  61. package/dist/packem_shared/diffSnapshots-htqNZT8Q.mjs +7 -0
  62. package/dist/packem_shared/docker-AqLAkOyY.mjs +1 -0
  63. package/dist/packem_shared/health-probe-Bw9JFfIy.mjs +1 -0
  64. package/dist/packem_shared/import-BRM1hs7j.mjs +12 -0
  65. package/dist/packem_shared/index-oHZBGBwB.mjs +1 -0
  66. package/dist/packem_shared/insertSchemaExtension-DuiV6cba.mjs +8 -0
  67. package/dist/packem_shared/lint-ignore-report-DKZagpqk.mjs +2 -0
  68. package/dist/packem_shared/mcp-config-file-CcDTeXIq.mjs +2 -0
  69. package/dist/packem_shared/open-url-EnKy--w-.mjs +1 -0
  70. package/dist/packem_shared/output-format-DWe_tkTR.mjs +2 -0
  71. package/dist/packem_shared/parseManifest-CwPTKdtS.mjs +1 -0
  72. package/dist/packem_shared/path-containment-CgxYZggb.mjs +1 -0
  73. package/dist/packem_shared/plan-DVfi3TrN.mjs +5 -0
  74. package/dist/packem_shared/planDevCommand-IglbXy5A.mjs +1 -0
  75. package/dist/packem_shared/platform-diagnostics-Cn2g6Jh-.mjs +4 -0
  76. package/dist/packem_shared/prompt-cancelled-BvsNxg_Q.mjs +1 -0
  77. package/dist/packem_shared/render-lunora-error-C3OJY5wk.mjs +2 -0
  78. package/dist/packem_shared/resolve-Bdc9KEUv.mjs +5 -0
  79. package/dist/packem_shared/resolve-target-C_ZloTvd.mjs +1 -0
  80. package/dist/packem_shared/runAddCommand-BChdJQ5L.mjs +1 -0
  81. package/dist/packem_shared/runExportCommand-slAq5BCF.mjs +5 -0
  82. package/dist/packem_shared/runMigrateGenerateCommand-BwemPIOz.mjs +11 -0
  83. package/dist/packem_shared/schemaIrToSnapshot-BHuNOfgs.mjs +1 -0
  84. package/dist/packem_shared/secret-key-8DPOH98z.mjs +1 -0
  85. package/dist/packem_shared/shared-D-zCOmgY.mjs +1 -0
  86. package/dist/packem_shared/storage-DNzYhXR-.mjs +1 -0
  87. package/dist/packem_shared/tui-prompts-B3YwUhGw.mjs +4 -0
  88. package/dist/packem_shared/variables-CPYyJtsL.mjs +1 -0
  89. package/dist/packem_shared/wrangler-name-Dsk5K1f-.mjs +1 -0
  90. package/dist/packem_shared/wrangler-secrets-CTQPpalP.mjs +1 -0
  91. package/package.json +41 -19
  92. package/skills/README.md +35 -17
  93. package/skills/lunora/SKILL.md +154 -64
  94. package/skills/lunora-create-package/SKILL.md +97 -84
  95. package/skills/lunora-deploy/SKILL.md +175 -105
  96. package/skills/lunora-functions/SKILL.md +362 -56
  97. package/skills/lunora-migration-helper/SKILL.md +162 -137
  98. package/skills/lunora-performance-audit/SKILL.md +137 -95
  99. package/skills/lunora-quickstart/SKILL.md +137 -136
  100. package/skills/lunora-realtime/SKILL.md +140 -99
  101. package/skills/lunora-setup-auth/SKILL.md +162 -102
  102. package/skills/lunora-setup-hyperdrive/SKILL.md +130 -109
  103. package/skills/lunora-setup-hyperdrive-global/SKILL.md +93 -90
  104. package/skills/lunora-setup-mail/SKILL.md +85 -113
  105. package/skills/lunora-setup-scheduler/SKILL.md +132 -96
  106. package/skills/lunora-setup-storage/SKILL.md +189 -91
  107. package/dist/packem_chunks/planDevCommand.mjs +0 -543
  108. package/dist/packem_chunks/runMigrateGenerateCommand.mjs +0 -397
  109. package/dist/packem_shared/COMMANDS-CHw4zOZ9.mjs +0 -922
  110. package/dist/packem_shared/DEFAULT_IMPORT_BATCH_SIZE-Ck-2bU08.mjs +0 -244
  111. package/dist/packem_shared/admin-url-4UzT-CI4.mjs +0 -19
  112. package/dist/packem_shared/api-spec-CtA6ilu4.mjs +0 -13
  113. package/dist/packem_shared/buildRegistryIndex-BcYe607_.mjs +0 -38
  114. package/dist/packem_shared/command-BDXcJCCJ.mjs +0 -14
  115. package/dist/packem_shared/commands-SUPdjsu5.mjs +0 -787
  116. package/dist/packem_shared/createLogger-CHPNjFw2.mjs +0 -73
  117. package/dist/packem_shared/defaultSpawner-DxI3mebw.mjs +0 -43
  118. package/dist/packem_shared/diffSnapshots-RR2ZE8Ya.mjs +0 -161
  119. package/dist/packem_shared/docker-hMQ97KSQ.mjs +0 -21
  120. package/dist/packem_shared/features-ocSSpZtS.mjs +0 -24
  121. package/dist/packem_shared/insertSchemaExtension-BuzF6-t2.mjs +0 -59
  122. package/dist/packem_shared/open-url-Dfq6fAyT.mjs +0 -41
  123. package/dist/packem_shared/output-format-7gyGR3h8.mjs +0 -17
  124. package/dist/packem_shared/parseArgs-YXFuKdEk.mjs +0 -56
  125. package/dist/packem_shared/parseManifest--vZf2FY1.mjs +0 -94
  126. package/dist/packem_shared/resolve-target-qbsJ_5sF.mjs +0 -16
  127. package/dist/packem_shared/runAddCommand-Txwh1Xw1.mjs +0 -4
  128. package/dist/packem_shared/schema-drift-gate-BtBt0as0.mjs +0 -79
  129. package/dist/packem_shared/schemaIrToSnapshot-aBTo7TM5.mjs +0 -43
  130. package/dist/packem_shared/wrangler-name-cy4yhm9j.mjs +0 -12
@@ -1,79 +0,0 @@
1
- import { existsSync, readFileSync, writeFileSync } from 'node:fs';
2
- import { evaluateSchemaDrift, parseSchemaSnapshot, SchemaSnapshotParseError, serializeSchemaSnapshot } from '@lunora/codegen';
3
-
4
- const readBaseline = (snapshotPath) => {
5
- if (!existsSync(snapshotPath)) {
6
- return { status: "absent" };
7
- }
8
- let content;
9
- try {
10
- content = readFileSync(snapshotPath, "utf8");
11
- } catch {
12
- return { status: "corrupt" };
13
- }
14
- try {
15
- const snapshot = parseSchemaSnapshot(content);
16
- return snapshot === void 0 ? { status: "corrupt" } : { snapshot, status: "ok" };
17
- } catch (error) {
18
- if (error instanceof SchemaSnapshotParseError) {
19
- return { status: "corrupt" };
20
- }
21
- throw error;
22
- }
23
- };
24
- const writeBaseline = (snapshotPath, snapshot) => {
25
- writeFileSync(snapshotPath, serializeSchemaSnapshot(snapshot), "utf8");
26
- };
27
- const corruptBaselineResult = (context) => {
28
- const reason = `schema-drift gate: the committed baseline ${context.snapshotPath} is unreadable or malformed, so schema drift cannot be checked. Fix it (e.g. resolve a merge conflict in lunora/.lunora-schema.json), or pass --update-schema-baseline to regenerate it from the current schema.`;
29
- if (context.updateBaseline && !context.readOnly) {
30
- context.logger.warn(
31
- `schema baseline was unreadable; regenerating from the current schema on success (--update-schema-baseline): ${context.snapshotPath}`
32
- );
33
- return { blocked: false, changes: [], reason, rebless: context.rebless };
34
- }
35
- if (!context.readOnly) {
36
- context.logger.error(reason);
37
- }
38
- return { blocked: true, changes: [], reason };
39
- };
40
- const blockedDecisionResult = (decision, context) => {
41
- if (!context.readOnly) {
42
- context.logger.error(decision.reason);
43
- }
44
- if (context.updateBaseline && !context.readOnly) {
45
- context.logger.warn(`schema baseline will be re-blessed despite breaking drift on success (--update-schema-baseline): ${context.snapshotPath}`);
46
- return { blocked: false, changes: decision.changes, reason: decision.reason, rebless: context.rebless };
47
- }
48
- return { blocked: true, changes: decision.changes, reason: decision.reason };
49
- };
50
- const runSchemaDriftGate = (options) => {
51
- const { allowDrift, codegen, logger, readOnly = false, updateBaseline = false } = options;
52
- const snapshotPath = codegen.schemaSnapshotPath;
53
- const baseline = readBaseline(snapshotPath);
54
- const context = {
55
- logger,
56
- readOnly,
57
- rebless: () => {
58
- writeBaseline(snapshotPath, codegen.schemaSnapshot);
59
- },
60
- snapshotPath,
61
- updateBaseline
62
- };
63
- if (baseline.status === "corrupt") {
64
- return corruptBaselineResult(context);
65
- }
66
- const decision = evaluateSchemaDrift({ allowDrift, baseline: baseline.status === "ok" ? baseline.snapshot : void 0, current: codegen.schemaSnapshot });
67
- if (decision.blocked) {
68
- return blockedDecisionResult(decision, context);
69
- }
70
- if (decision.changes.length > 0) {
71
- if (!readOnly) {
72
- logger.info(decision.reason);
73
- }
74
- return { blocked: false, changes: decision.changes, reason: decision.reason, rebless: readOnly ? void 0 : context.rebless };
75
- }
76
- return { blocked: false, changes: decision.changes, reason: decision.reason };
77
- };
78
-
79
- export { runSchemaDriftGate as r };
@@ -1,43 +0,0 @@
1
- import { validatorKindToSqlType } from './diffSnapshots-RR2ZE8Ya.mjs';
2
-
3
- const validatorToColumn = (validator) => {
4
- if (validator.kind === "optional" && validator.inner) {
5
- return {
6
- nullable: true,
7
- sqlType: validatorKindToSqlType(validator.inner.kind)
8
- };
9
- }
10
- return {
11
- nullable: false,
12
- sqlType: validatorKindToSqlType(validator.kind)
13
- };
14
- };
15
- const isGlobal = (mode) => mode === "global";
16
- const schemaIrToSnapshot = (ir) => {
17
- const tables = {};
18
- for (const table of ir.tables) {
19
- if (!isGlobal(table.shardMode)) {
20
- continue;
21
- }
22
- const columns = {};
23
- for (const [columnName, validator] of Object.entries(table.shape)) {
24
- columns[columnName] = validatorToColumn(validator);
25
- }
26
- const indexes = {};
27
- for (const index of table.indexes) {
28
- indexes[index.name] = {
29
- fields: [...index.fields],
30
- name: index.name,
31
- unique: index.unique ?? false
32
- };
33
- }
34
- tables[table.name] = {
35
- columns,
36
- indexes,
37
- name: table.name
38
- };
39
- }
40
- return { tables, version: 1 };
41
- };
42
-
43
- export { schemaIrToSnapshot as default };
@@ -1,12 +0,0 @@
1
- import { findWranglerFile, readWranglerJsonc } from '@lunora/config';
2
-
3
- const readWranglerName = (cwd) => {
4
- const wranglerPath = findWranglerFile(cwd);
5
- if (!wranglerPath) {
6
- return void 0;
7
- }
8
- const { parsed } = readWranglerJsonc(wranglerPath);
9
- return typeof parsed?.name === "string" && parsed.name.length > 0 ? parsed.name : void 0;
10
- };
11
-
12
- export { readWranglerName as r };