naro-cli 0.6.0 → 0.7.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-TYBC3YSK.js → chunk-E2M6CQL7.js} +3253 -701
- package/dist/deploy.d.ts +6 -3
- package/dist/deploy.js +1 -1
- package/dist/index.js +598 -41
- package/dist/output.d.ts +5 -0
- package/package.json +7 -3
package/README.md
CHANGED
|
@@ -27,6 +27,27 @@ 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
|
+
|
|
37
|
+
## Build cache
|
|
38
|
+
|
|
39
|
+
Deploys reuse the dependency and framework caches from your previous build,
|
|
40
|
+
which are stored per project and restored before the install step. The
|
|
41
|
+
archives are zstd-compressed, so caching needs `zstd` on your PATH:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
brew install zstd # macOS
|
|
45
|
+
apt install zstd # Debian/Ubuntu
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Without it deploys still work — they just build from scratch every time and
|
|
49
|
+
say so in the build log.
|
|
50
|
+
|
|
30
51
|
## Commands
|
|
31
52
|
|
|
32
53
|
```text
|
|
@@ -41,6 +62,7 @@ naro project inspect Show the linked project
|
|
|
41
62
|
naro deploy [--prod] Build locally and deploy
|
|
42
63
|
naro deployments List deployments
|
|
43
64
|
naro inspect <deployment-id> One deployment + build logs
|
|
65
|
+
naro cancel <deployment-id> Stop a build that is still running
|
|
44
66
|
|
|
45
67
|
naro logs Runtime logs (production)
|
|
46
68
|
naro logs <deployment-id> Build logs of a deployment
|
|
@@ -54,12 +76,38 @@ naro env pull [.env.local]
|
|
|
54
76
|
|
|
55
77
|
naro domains list
|
|
56
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)
|
|
57
83
|
naro domains remove www.example.com
|
|
58
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 migration new create_users Creates migrations/0001_create_users.sql
|
|
90
|
+
naro migration list Local files vs the d1_migrations ledger
|
|
91
|
+
naro gen types --output src/db.d.ts TypeScript types for the schema
|
|
92
|
+
|
|
59
93
|
naro promote <deployment-id> Publish a build to production
|
|
60
94
|
naro rollback [deployment-id] Back to the previous production build
|
|
61
95
|
```
|
|
62
96
|
|
|
97
|
+
`naro domains list` reads the stored status; `naro domains verify` is the one
|
|
98
|
+
that asks Cloudflare and the DNS again, so it is what turns a stuck "pending"
|
|
99
|
+
into the reason it is stuck. It exits non-zero while a domain is not live —
|
|
100
|
+
with or without `--wait` — so CI can gate on it:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
naro domains verify www.example.com --wait --json || exit 1
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
An apex (`example.com`) is added as a pair by default because most registrars
|
|
107
|
+
(Gabia, Whois, Cafe24, GoDaddy) cannot put a CNAME on an apex at all: the CNAME
|
|
108
|
+
goes on `www.example.com` and the apex answers with a 308 redirect to it.
|
|
109
|
+
`--no-www` registers the apex alone.
|
|
110
|
+
|
|
63
111
|
## Machine-readable output (CI / AI agents)
|
|
64
112
|
|
|
65
113
|
Every command supports `--json`: stdout carries exactly one JSON object,
|
|
@@ -79,10 +127,10 @@ $ naro deploy --prod --yes --json
|
|
|
79
127
|
|
|
80
128
|
Failures carry stable codes (`NOT_LOGGED_IN`, `PROJECT_NOT_LINKED`,
|
|
81
129
|
`FRAMEWORK_UNSUPPORTED`, `BUILD_FAILED`, `DEPLOYMENT_NOT_FOUND`,
|
|
82
|
-
`ENV_NOT_FOUND`, `
|
|
83
|
-
`CANCELED`, …). A destructive
|
|
84
|
-
`--yes` fails with
|
|
85
|
-
nothing:
|
|
130
|
+
`ENV_NOT_FOUND`, `DOMAIN_NOT_FOUND`, `DOMAIN_NOT_READY`,
|
|
131
|
+
`VALIDATION_FAILED`, `CONFIRMATION_REQUIRED`, `CANCELED`, …). A destructive
|
|
132
|
+
command run non-interactively without `--yes` fails with
|
|
133
|
+
`CONFIRMATION_REQUIRED` instead of silently doing nothing:
|
|
86
134
|
|
|
87
135
|
```json
|
|
88
136
|
{
|
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
|
+
}
|