naro-cli 0.12.0 → 0.13.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 CHANGED
@@ -69,6 +69,15 @@ naro logs <deployment-id> Build logs of a deployment
69
69
  naro logs --type build --follow Stream build logs until READY/FAILED
70
70
  naro logs --env preview Preview-surface runtime logs
71
71
 
72
+ naro insights Speed Insights: Web Vitals p75 (--metric lcp, --range 7d)
73
+ naro insights --route '/posts/[id]' The paths under one route
74
+ naro insights --env preview The same for the preview worker
75
+ naro insights enable | disable Turn measuring on or off
76
+
77
+ naro protection Preview protection: on or off, and whether a bypass secret is set
78
+ naro protection enable | disable Protect the preview URL (members only) or open it to anyone with the link (disable asks first; --yes in CI)
79
+ naro protection bypass [remove] Create (shown once) or remove the secret automation sends as x-naro-protection-bypass (replacing or removing asks first; --yes in CI)
80
+
72
81
  naro env list [--reveal] Secrets masked unless --reveal
73
82
  naro env add DATABASE_URL production
74
83
  naro env remove DATABASE_URL
@@ -160,6 +169,18 @@ naro policy set posts --from-file policy.json
160
169
  Shorthand: writes the policies naro_select … naro_delete
161
170
  naro policy remove todos Drop every policy on the table: back to deny (asks first)
162
171
 
172
+ naro storage Naro Storage: on or off, limits, usage, buckets
173
+ naro storage enable Turn it on: the project's R2 bucket, bound to the backend
174
+ naro storage bucket create avatars --public --file-size-limit 5MiB --allowed-mime-types image/png,image/jpeg
175
+ naro storage bucket update avatars --private | --file-size-limit none | --allowed-mime-types any
176
+ naro storage bucket update docs --public (asks first: anyone with an object's URL can download it)
177
+ naro storage bucket list | empty <name> | remove <name> [--empty] (empty and remove ask first)
178
+ naro storage ls naro://avatars/u1 [--recursive]
179
+ naro storage cp ./me.png naro://avatars/u1/me.png [--upsert] Up to 50 MiB, with the service key
180
+ naro storage cp naro://docs/team-1/plan.pdf ./ Replaces a local file of the same name
181
+ naro storage rm naro://avatars/u1/old.png [--recursive] (asks first)
182
+ naro storage rm naro://avatars/u1/ --recursive Everything under u1/; written u1, an object u1 too
183
+
163
184
  naro promote <deployment-id> Publish a build to production
164
185
  naro rollback [deployment-id] Back to the previous production build
165
186
  ```
@@ -768,6 +789,50 @@ An `--update-check` you give replaces the default: without
768
789
 
769
790
  ## Release notes
770
791
 
792
+ ### 0.13.0
793
+
794
+ - `naro insights` shows the project's Speed Insights from the terminal: each
795
+ Web Vital's p75 with its good, needs-improvement and poor shares, then the
796
+ selected metric (`--metric`, `--range`) by page, device, the elements
797
+ behind slow visits and deployment. Production by default; `--env preview`
798
+ reads the preview worker. `--route '/posts/[id]'` lists the paths under
799
+ one route, `--json` prints the whole report, and
800
+ `naro insights enable | disable` turns measuring on or off for production
801
+ and preview together (one switch, so `--env` is refused there).
802
+ - `naro protection` shows whether the project's preview URL is protected and
803
+ whether a bypass secret is set. Protection is on by default: only members
804
+ of the project can open `<name>-preview.naro.sh`, after signing in to naro.
805
+ A GET or HEAD that is a page navigation (`Sec-Fetch-Mode: navigate`), or that
806
+ sends no `Sec-Fetch-Mode` and an `Accept` including `text/html`, is
807
+ redirected to the naro sign-in; every other request gets
808
+ `401 PREVIEW_PROTECTED`. A request the browser sends without cookies (a
809
+ `<link rel="manifest">` without `crossorigin="use-credentials"`) gets 401
810
+ too.
811
+ `naro protection enable` and `naro protection disable` switch it (the edge
812
+ picks the change up within about a minute). `naro protection bypass`
813
+ creates the secret CI or a monitor sends as the `x-naro-protection-bypass`
814
+ header (shown once; it replaces any earlier one) and
815
+ `naro protection bypass remove` deletes it. `disable`, a `bypass` that
816
+ replaces a secret and `bypass remove` ask first; without a terminal they need
817
+ `--yes` and exit 1 with `CONFIRMATION_REQUIRED` otherwise, nothing written.
818
+ The Naro backend API (`/_naro/v1`) and production are never protected.
819
+ - `naro storage` manages the project's Naro Storage: `enable` turns it on,
820
+ `bucket list | create | update | empty | remove` manage the buckets
821
+ (public or private, the largest file, the types taken), and `ls`, `cp`
822
+ and `rm` work on `naro://<bucket>/<path>` with the project's service key
823
+ (`NARO_SERVICE_KEY`, or fetched with a warning) — the bytes go to the
824
+ project's backend, not through naro. One upload is 50 MiB at most.
825
+ `bucket update --public`, `empty`, `remove` and `rm` ask first; without a
826
+ terminal they need `--yes` (`CONFIRMATION_REQUIRED` otherwise, nothing
827
+ sent).
828
+ - `naro policy create` and `naro policy set` take `storage.objects`, as
829
+ migrations already did. A backend from before Storage answers
830
+ `409 BACKEND_OUTDATED`.
831
+ - `naro db push --dry-run`, `naro db reset` and `naro db lint` read
832
+ `CREATE POLICY … ON storage.objects`. 0.12.0 refused such a file on this
833
+ machine (`schema storage does not exist`), and its `db lint` and
834
+ `db reset` did not know Storage's policies.
835
+
771
836
  ### 0.12.0
772
837
 
773
838
  - Migrations and `naro db query` take Postgres's `CREATE POLICY`,
@@ -837,7 +902,9 @@ command run non-interactively without `--yes` fails with
837
902
 
838
903
  `--yes` (or `-y`) suppresses every prompt — destructive actions
839
904
  (production rollback/promote, env/domain removal, database reset, backend key
840
- rotation, policy removal and drop) run unconfirmed, so use it deliberately in
905
+ rotation, policy removal and drop, opening the preview with
906
+ `naro protection disable`, replacing or removing the bypass secret) run
907
+ unconfirmed, so use it deliberately in
841
908
  automation.
842
909
 
843
910
  ## CI authentication
@@ -864,4 +931,5 @@ NARO_TOKEN=$(naro token) npx naro-cli deploy --prod --yes --json
864
931
  | ------------------------ | ---------------------------------------------- |
865
932
  | `NARO_TOKEN` | CI/agent access token (skips `naro login`) |
866
933
  | `NARO_CONTROL_PLANE_URL` | Custom control plane (default https://naro.sh) |
934
+ | `NARO_SERVICE_KEY` | Service key for `naro storage ls\|cp\|rm` |
867
935
  | `NARO_SUPABASE_URL/KEY` | Auth backend override (self-hosted setups) |