naro-cli 0.6.1 → 0.8.0
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/README.md +52 -4
- package/dist/artifact-types.d.ts +15 -0
- package/dist/{chunk-WKJELBOU.js → chunk-ONALKL7O.js} +3030 -603
- package/dist/deploy.d.ts +4 -2
- package/dist/deploy.js +1 -1
- package/dist/index.js +964 -48
- package/dist/output.d.ts +5 -0
- package/package.json +7 -3
package/README.md
CHANGED
|
@@ -27,6 +27,13 @@ Values you register are encrypted at rest, and `naro env pull` /
|
|
|
27
27
|
`naro env list --reveal` can read them back — your account credentials are
|
|
28
28
|
effectively your env credentials.
|
|
29
29
|
|
|
30
|
+
## Requirements
|
|
31
|
+
|
|
32
|
+
Next.js **15 or newer**. Next 14 and below are not supported — they stop at the
|
|
33
|
+
version gate right after install with `NEXT_VERSION_UNSUPPORTED`.
|
|
34
|
+
|
|
35
|
+
Vite, Create React App and plain static sites deploy too.
|
|
36
|
+
|
|
30
37
|
## Build cache
|
|
31
38
|
|
|
32
39
|
Deploys reuse the dependency and framework caches from your previous build,
|
|
@@ -55,6 +62,7 @@ naro project inspect Show the linked project
|
|
|
55
62
|
naro deploy [--prod] Build locally and deploy
|
|
56
63
|
naro deployments List deployments
|
|
57
64
|
naro inspect <deployment-id> One deployment + build logs
|
|
65
|
+
naro cancel <deployment-id> Stop a build that is still running
|
|
58
66
|
|
|
59
67
|
naro logs Runtime logs (production)
|
|
60
68
|
naro logs <deployment-id> Build logs of a deployment
|
|
@@ -68,12 +76,52 @@ naro env pull [.env.local]
|
|
|
68
76
|
|
|
69
77
|
naro domains list
|
|
70
78
|
naro domains add www.example.com Prints the DNS records to create
|
|
79
|
+
naro domains add example.com Apex: also connects www.example.com and
|
|
80
|
+
redirects the apex to it (--no-www to skip)
|
|
81
|
+
naro domains verify [host] Re-check DNS now and print what is missing
|
|
82
|
+
naro domains verify --wait Poll until it goes live (10 min budget)
|
|
71
83
|
naro domains remove www.example.com
|
|
72
84
|
|
|
85
|
+
naro db enable Create the project's database (Cloudflare D1)
|
|
86
|
+
naro db info Status, size, table count, limits
|
|
87
|
+
naro db query "select 1" Run SQL; --file query.sql, or pipe stdin
|
|
88
|
+
naro db push [--dry-run] Apply pending ./migrations (asks first; --yes in CI)
|
|
89
|
+
naro db dump --output backup.sql SQL dump, streamed from Cloudflare (stdout without
|
|
90
|
+
--output); --schema-only | --data-only, --table a,b
|
|
91
|
+
naro db restore --bookmark <id> Time Travel, last 30 days (or --timestamp <time>);
|
|
92
|
+
asks first, prints the command that undoes it
|
|
93
|
+
naro db pull Existing database, no migrations yet: writes its schema
|
|
94
|
+
as migrations/0001_remote_schema.sql, recorded as applied
|
|
95
|
+
naro migration new create_users Creates migrations/0001_create_users.sql
|
|
96
|
+
naro migration list Local files vs the d1_migrations ledger
|
|
97
|
+
naro gen types --output src/db.d.ts TypeScript types for the schema
|
|
98
|
+
|
|
73
99
|
naro promote <deployment-id> Publish a build to production
|
|
74
100
|
naro rollback [deployment-id] Back to the previous production build
|
|
75
101
|
```
|
|
76
102
|
|
|
103
|
+
`naro domains list` reads the stored status; `naro domains verify` is the one
|
|
104
|
+
that asks Cloudflare and the DNS again, so it is what turns a stuck "pending"
|
|
105
|
+
into the reason it is stuck. It exits non-zero while a domain is not live —
|
|
106
|
+
with or without `--wait` — so CI can gate on it:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
naro domains verify www.example.com --wait --json || exit 1
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
An apex (`example.com`) is added as a pair by default because most registrars
|
|
113
|
+
(Gabia, Whois, Cafe24, GoDaddy) cannot put a CNAME on an apex at all: the CNAME
|
|
114
|
+
goes on `www.example.com` and the apex answers with a 308 redirect to it.
|
|
115
|
+
`--no-www` registers the apex alone.
|
|
116
|
+
|
|
117
|
+
`naro db dump` asks Cloudflare for the dump and streams it straight from
|
|
118
|
+
Cloudflare's storage to the file — the bytes never pass through naro. While the
|
|
119
|
+
export runs, Cloudflare holds every other query to the database, so dump a busy
|
|
120
|
+
production database when a short pause is acceptable. It ends with the bookmark
|
|
121
|
+
the dump reflects; `naro db restore --bookmark <that>` brings the database back
|
|
122
|
+
to it. A restore rolls back everything written after that point — the
|
|
123
|
+
`d1_migrations` ledger included — and prints the bookmark that undoes it.
|
|
124
|
+
|
|
77
125
|
## Machine-readable output (CI / AI agents)
|
|
78
126
|
|
|
79
127
|
Every command supports `--json`: stdout carries exactly one JSON object,
|
|
@@ -93,10 +141,10 @@ $ naro deploy --prod --yes --json
|
|
|
93
141
|
|
|
94
142
|
Failures carry stable codes (`NOT_LOGGED_IN`, `PROJECT_NOT_LINKED`,
|
|
95
143
|
`FRAMEWORK_UNSUPPORTED`, `BUILD_FAILED`, `DEPLOYMENT_NOT_FOUND`,
|
|
96
|
-
`ENV_NOT_FOUND`, `
|
|
97
|
-
`CANCELED`, …). A destructive
|
|
98
|
-
`--yes` fails with
|
|
99
|
-
nothing:
|
|
144
|
+
`ENV_NOT_FOUND`, `DOMAIN_NOT_FOUND`, `DOMAIN_NOT_READY`,
|
|
145
|
+
`VALIDATION_FAILED`, `CONFIRMATION_REQUIRED`, `CANCELED`, …). A destructive
|
|
146
|
+
command run non-interactively without `--yes` fails with
|
|
147
|
+
`CONFIRMATION_REQUIRED` instead of silently doing nothing:
|
|
100
148
|
|
|
101
149
|
```json
|
|
102
150
|
{
|
package/dist/artifact-types.d.ts
CHANGED
|
@@ -40,3 +40,18 @@ export interface BuildObserver {
|
|
|
40
40
|
onStatus?(status: DeploymentStatus): void | Promise<void>;
|
|
41
41
|
onMetadata?(metadata: BuildMetadata): void | Promise<void>;
|
|
42
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* Mirrors the persisted deployment strategy record from the internal core
|
|
45
|
+
* package: what a previous deploy resolved for the project, handed back to
|
|
46
|
+
* the next build so it can skip the strategy ladder while the record's
|
|
47
|
+
* fingerprint still matches.
|
|
48
|
+
*/
|
|
49
|
+
export interface DeploymentStrategyRecord {
|
|
50
|
+
strategy: "vinext-cloudflare" | "opennext-cloudflare" | "split-cloudflare" | "aws-middleware-cloudflare-app" | "opennext-aws";
|
|
51
|
+
priority: number;
|
|
52
|
+
nextMajor: number;
|
|
53
|
+
variant?: string;
|
|
54
|
+
fingerprint: string;
|
|
55
|
+
resolvedAt: string;
|
|
56
|
+
deploymentId: string;
|
|
57
|
+
}
|