@lunora/cli 1.0.0-alpha.464 → 1.0.0-alpha.466

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.
@@ -0,0 +1 @@
1
+ import"./admin-token-VdUnvnKW.mjs";import"./admin-url-DJB8P6Jh.mjs";import"./platform-diagnostics-Cn2g6Jh-.mjs";import"./api-spec-lYyq4vL6.mjs";import{f,b as x,r as D,a as L,s as P}from"../packem_chunks/handler.mjs";import"./vectorize-metadata-BVSF8z2h.mjs";import"./binding-manifest-file-CQ1eQYy1.mjs";import"./command-B6vu47iR.mjs";import"./deploy-target-resolve-BTCW1Iv4.mjs";import"./EXIT_CODE-DVjUgIaG.mjs";import"./resolve-target-C_ZloTvd.mjs";import"./health-probe-BLnoq_oC.mjs";import"./createRecordingSpawner-01ZngIwK.mjs";export{f as execute,x as provisionBindings,D as runDeployCommand,L as runPreDeployPipeline,P as smokeLoadLazyModules};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunora/cli",
3
- "version": "1.0.0-alpha.464",
3
+ "version": "1.0.0-alpha.466",
4
4
  "description": "The Lunora CLI: init, dev, deploy, codegen, migrate, seed, doctor, insights, logs, registry, and the rest of the project commands",
5
5
  "keywords": [
6
6
  "agent-skills",
@@ -59,12 +59,12 @@
59
59
  "@lunora/advisor": "1.0.0-alpha.280",
60
60
  "@lunora/bindings": "1.0.0-alpha.146",
61
61
  "@lunora/codegen": "1.0.0-alpha.384",
62
- "@lunora/config": "1.0.0-alpha.439",
62
+ "@lunora/config": "1.0.0-alpha.441",
63
63
  "@lunora/container": "1.0.0-alpha.104",
64
64
  "@lunora/d1": "1.0.0-alpha.227",
65
65
  "@lunora/errors": ">=1.0.0-alpha.51 <2.0.0-0",
66
- "@lunora/mcp": "1.0.0-alpha.283",
67
- "@lunora/runtime": "1.0.0-alpha.267",
66
+ "@lunora/mcp": "1.0.0-alpha.284",
67
+ "@lunora/runtime": "1.0.0-alpha.268",
68
68
  "@lunora/seed": "1.0.0-alpha.276",
69
69
  "@lunora/wire": "1.0.0-alpha.6",
70
70
  "@visulima/cerebro": "4.0.1",
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: lunora-deploy
3
- description: Deploys a Lunora app to Cloudflare Workers + Durable Objects and gets wrangler.jsonc, remote resources and secrets to line up. Covers `lunora deploy` (and `--env`, `--dry-run`, `--migrate`), the `lunora doctor` / `lunora verify` / `lunora prepare` preflights, Durable Object bindings (SHARD, SHARD_REGISTRY, SCHEDULER), the `DB` D1 binding and its placeholder id, R2 buckets, production secrets (`lunora env push`, `wrangler secret put`) versus `.dev.vars`, the schema-drift gate, the architecture diff, and rollback with `lunora cloudflare deployments`. Use when the user asks to "deploy", "ship to production", "set up a staging environment", wire CI deploys, or when a deploy fails on a binding, a placeholder `database_id`, an unexported Durable Object class, a missing secret, or "schema drift gate blocked deploy".
3
+ description: Deploys a Lunora app to Cloudflare Workers + Durable Objects and gets wrangler.jsonc, remote resources and secrets to line up. Covers `lunora deploy` (and `--env`, `--dry-run`, `--migrate`), isolated per-PR previews (`lunora preview deploy | list | delete`), the `lunora doctor` / `lunora verify` / `lunora prepare` preflights, Durable Object bindings (SHARD, SHARD_REGISTRY, SCHEDULER), the `DB` D1 binding and its placeholder id, R2 buckets, production secrets (`lunora env push`, `wrangler secret put`) versus `.dev.vars`, the schema-drift gate, the architecture diff, and rollback with `lunora cloudflare deployments`. Use when the user asks to "deploy", "ship to production", "set up a staging environment", wire CI deploys, or when a deploy fails on a binding, a placeholder `database_id`, an unexported Durable Object class, a missing secret, or "schema drift gate blocked deploy".
4
4
  ---
5
5
 
6
6
  # Lunora Deploy
@@ -45,8 +45,9 @@ In order, stopping at the first failure:
45
45
  7. **Secrets gate** — lists the secrets the app's packages need and checks
46
46
  which are set on the worker. Interactive runs offer to mint and push the
47
47
  generatable ones (`BETTER_AUTH_SECRET`, `LUNORA_ADMIN_TOKEN`, …). In CI a
48
- missing required secret aborts the deploy. Skipped for `--dry-run`, and
49
- when the worker doesn't exist yet.
48
+ missing required secret aborts the deploy. Skipped for `--dry-run`, for
49
+ `lunora preview` (it uploads its own secrets), and when the worker doesn't
50
+ exist yet.
50
51
  8. **Services, then `wrangler deploy`** — services declared in
51
52
  `lunora.config` deploy first (`--skip-services` to skip), then the app.
52
53
  9. **After a successful deploy** — records the URL as the project link
@@ -81,6 +82,41 @@ whole deploy:
81
82
  lunora deploy --migrate --migrate-yes --migrate-url https://app.example.com
82
83
  ```
83
84
 
85
+ ## Per-PR previews
86
+
87
+ `lunora deploy --preview` is refused: a Worker version shares production's
88
+ Durable Objects, D1 and R2, and gets no preview URL. Use `lunora preview`:
89
+
90
+ ```bash
91
+ lunora preview deploy 123 --seed # own Worker + DO namespace + D1/KV/R2, migrated, seeded
92
+ lunora preview deploy 123 --dry-run # the plan and env block, no API call
93
+ lunora preview list
94
+ lunora preview delete 123 # Worker + every resource on its record
95
+ ```
96
+
97
+ - Records are keyed by `lunora.appId` in `package.json` (the first local
98
+ `lunora preview deploy` writes it; commit it, CI cannot mint one), so a Worker rename does not
99
+ lose a preview. Old Worker-name keys are re-keyed on the next deploy/delete.
100
+ - `--env <name>` plans from that Wrangler environment (top level plus `env.<name>`)
101
+ for an app whose bindings live only there; recorded, so `delete` needs no flag for the
102
+ resources. If that environment names a different `account_id`, pass the same `--env` to
103
+ `list`/`delete` (or set `CLOUDFLARE_ACCOUNT_ID`); they refuse rather than guess.
104
+ Without it, env-only bindings are refused. CI leaves it unset.
105
+ - Resources are named `<worker>-preview-<name>-<binding>` and recorded in the
106
+ account's `lunora-preview-registry` KV namespace; `delete` only removes what a
107
+ record lists, and refuses anything production's config names.
108
+ - Mintable secrets are minted per deploy, or derived from
109
+ `LUNORA_PREVIEW_SECRET_SEED` when set (stable across deploys); a provider key
110
+ reaches the preview only via `--secret KEY` (value from the environment).
111
+ - Production `vars` are copied; override one with `--var KEY=VALUE` (e.g. an
112
+ auth base URL pointing at the preview's workers.dev URL).
113
+ - Refused (with the list) when the app binds Hyperdrive, services, queues,
114
+ workflows, Vectorize or another binding a preview cannot isolate yet.
115
+ - Token needs Workers Scripts, D1, Workers KV Storage and Workers R2 Storage:
116
+ Edit. Cloudflare only; celld and Node refuse.
117
+ - `lunora init --ci github|gitlab` scaffolds the deploy-on-PR and
118
+ delete-on-close jobs.
119
+
84
120
  ## Preflight
85
121
 
86
122
  ```bash
@@ -1 +0,0 @@
1
- import"./admin-token-VdUnvnKW.mjs";import"./admin-url-DJB8P6Jh.mjs";import"./platform-diagnostics-Cn2g6Jh-.mjs";import"./api-spec-lYyq4vL6.mjs";import{e as x,b as D,r as L,a as P,s as b}from"../packem_chunks/handler.mjs";import"./vectorize-metadata-BVSF8z2h.mjs";import"./binding-manifest-file-CQ1eQYy1.mjs";import"./command-B6vu47iR.mjs";import"./deploy-target-resolve-BTCW1Iv4.mjs";import"./EXIT_CODE-DVjUgIaG.mjs";import"./resolve-target-C_ZloTvd.mjs";import"./health-probe-BLnoq_oC.mjs";import"./createRecordingSpawner-01ZngIwK.mjs";export{x as execute,D as provisionBindings,L as runDeployCommand,P as runPreDeployPipeline,b as smokeLoadLazyModules};