naro-cli 0.23.0 → 0.25.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 +83 -18
- package/dist/args.d.ts +49 -0
- package/dist/{chunk-ALK4VTL2.js → chunk-R4XGSZQL.js} +1268 -513
- package/dist/chunk-X5TUBMEU.js +35536 -0
- package/dist/commands/confirm.d.ts +10 -0
- package/dist/commands/db-lint.d.ts +16 -0
- package/dist/deploy.d.ts +2 -0
- package/dist/deploy.js +5 -1
- package/dist/env-services.d.ts +44 -0
- package/dist/functions/read-capped.d.ts +1 -0
- package/dist/index.js +8901 -7750
- package/package.json +6 -6
|
@@ -8,5 +8,15 @@ export declare function cannotAsk(context: CommandContext): boolean;
|
|
|
8
8
|
* Gate for destructive actions. Throws instead of silently returning so a
|
|
9
9
|
* declined/unavailable confirmation is a real failure (exit 1, structured
|
|
10
10
|
* JSON) — CI must never read "nothing happened" as success.
|
|
11
|
+
*
|
|
12
|
+
* What asks: removing or deleting something (`remove`, `delete`, `realtime
|
|
13
|
+
* tables remove`), and a change that reaches past the value typed — what
|
|
14
|
+
* production serves (`promote`, `rollback`, `cancel`), keys that stop working
|
|
15
|
+
* (`backend keys rotate`, `signing-key rotate`), a service turned off
|
|
16
|
+
* (`storage disable`), who can see the project (`protection disable`), or an
|
|
17
|
+
* address given up (`project set --subdomain`, `dns records update`). Adding
|
|
18
|
+
* or switching a setting whose value the person typed in full (`naro firewall
|
|
19
|
+
* add`, `naro flags on`) does not ask: MCP marks those destructive because no
|
|
20
|
+
* one watches its calls (PR #429 and #433 reviews).
|
|
11
21
|
*/
|
|
12
22
|
export declare function confirmOrAbort(context: CommandContext, question: string): Promise<void>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { CommandContext } from "../context";
|
|
2
|
+
export { DIAGNOSTICS_SQL, lintDatabase, POLICY_READ_SQL, POLICY_TABLE_PROBE, type DatabaseLint, } from "@next-deploy/sdk";
|
|
3
|
+
/**
|
|
4
|
+
* `naro db lint [--json] [--strict]` — read-only diagnostics over the schema
|
|
5
|
+
* `GET /tables` describes and the checks D1 allows. The rules are the ones D1
|
|
6
|
+
* actually trips on (spec §17.3); there is no performance heuristic, because
|
|
7
|
+
* D1 keeps no execution statistics to base one on.
|
|
8
|
+
*
|
|
9
|
+
* A project with a backend also gets its row-level security checked: a table
|
|
10
|
+
* with no policy is a warning (the Data API refuses every request to it) and a
|
|
11
|
+
* policy that cannot work on today's schema is an error (spec P2-7b).
|
|
12
|
+
*
|
|
13
|
+
* The exit code is the point: an error fails the run so CI can gate on it, a
|
|
14
|
+
* warning does not unless `--strict` says it should.
|
|
15
|
+
*/
|
|
16
|
+
export declare function runDbLint(context: CommandContext): Promise<void>;
|
package/dist/deploy.d.ts
CHANGED
|
@@ -112,4 +112,6 @@ export interface DeployResult {
|
|
|
112
112
|
* Shared by `naro deploy` and the MCP `deploy` tool.
|
|
113
113
|
*/
|
|
114
114
|
export declare function deployDirectory(sourceDir: string, options: DeployOptions, log: (message: string) => void): Promise<DeployResult>;
|
|
115
|
+
export { lintDatabase, type DatabaseLint } from "./commands/db-lint";
|
|
116
|
+
export { readCapped } from "./functions/read-capped";
|
|
115
117
|
export { assertFunctionsNode, deployFunctions, type DeployedFunction, type DeployFunctionsOptions, type DeployFunctionsResult, } from "./functions/deploy";
|
package/dist/deploy.js
CHANGED
|
@@ -4,20 +4,24 @@ import {
|
|
|
4
4
|
deployDirectory,
|
|
5
5
|
deployFunctions,
|
|
6
6
|
eventsObserver,
|
|
7
|
+
lintDatabase,
|
|
7
8
|
localDependencies,
|
|
8
9
|
parseDotenv,
|
|
10
|
+
readCapped,
|
|
9
11
|
readProjectEnv,
|
|
10
12
|
slugify,
|
|
11
13
|
workingTreeNotices
|
|
12
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-X5TUBMEU.js";
|
|
13
15
|
import "./chunk-K3NQKI34.js";
|
|
14
16
|
export {
|
|
15
17
|
assertFunctionsNode,
|
|
16
18
|
deployDirectory,
|
|
17
19
|
deployFunctions,
|
|
18
20
|
eventsObserver,
|
|
21
|
+
lintDatabase,
|
|
19
22
|
localDependencies,
|
|
20
23
|
parseDotenv,
|
|
24
|
+
readCapped,
|
|
21
25
|
readProjectEnv,
|
|
22
26
|
slugify,
|
|
23
27
|
workingTreeNotices
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which outside service the env keys a deploy is missing belong to, and where
|
|
3
|
+
* that service keeps their values.
|
|
4
|
+
*
|
|
5
|
+
* The deploy already works out the names it needs by scanning the source
|
|
6
|
+
* (`scanEnvReferences`), but a list of bare names only helps someone who
|
|
7
|
+
* already knows where each value comes from. The first thing anyone moving an
|
|
8
|
+
* existing app here hits is exactly that gap: the app talks to a Supabase
|
|
9
|
+
* project that is already running, and the deploy asks for
|
|
10
|
+
* `NEXT_PUBLIC_SUPABASE_URL` without saying it is asking for something they
|
|
11
|
+
* have in another browser tab.
|
|
12
|
+
*
|
|
13
|
+
* This only names the service and the screen its values are on. Nothing here
|
|
14
|
+
* reaches Supabase's API, stores a token or creates anything there — the
|
|
15
|
+
* values still arrive the way every other env var does, from `.env.local`
|
|
16
|
+
* with the user's consent or from `naro env add`.
|
|
17
|
+
*/
|
|
18
|
+
/** The key without that prefix. The longest match wins, so order is free. */
|
|
19
|
+
export declare function bareEnvKey(key: string): string;
|
|
20
|
+
/**
|
|
21
|
+
* The given keys that name a Supabase project, in the order given.
|
|
22
|
+
*
|
|
23
|
+
* Everything Supabase hands a project is `SUPABASE_*`: the project URL, the
|
|
24
|
+
* publishable and secret keys, the legacy `anon` and `service_role` keys, the
|
|
25
|
+
* JWT secret, the account's access token, the database password. Matching the
|
|
26
|
+
* prefix rather than a fixed list keeps a name we have not seen — Supabase
|
|
27
|
+
* renamed its keys once already — from dropping out. A name that merely
|
|
28
|
+
* contains the word (`MY_SUPABASE_URL`) is not one of theirs.
|
|
29
|
+
*
|
|
30
|
+
* Belonging to Supabase is not the same as being on one of the screens
|
|
31
|
+
* `envServiceHints` knows; that function decides which of these it can place.
|
|
32
|
+
*/
|
|
33
|
+
export declare function supabaseKeys(keys: readonly string[]): string[];
|
|
34
|
+
/**
|
|
35
|
+
* Lines naming the service the missing keys belong to, to print under the
|
|
36
|
+
* "env var(s) needed" line. Empty when nothing is recognised, which is the
|
|
37
|
+
* common case — this adds to that line, it never replaces it.
|
|
38
|
+
*
|
|
39
|
+
* Adding a second service means another `supabaseKeys`-shaped filter and
|
|
40
|
+
* another branch here. It is deliberately not a table of services yet: the
|
|
41
|
+
* useful half of each entry is the screen its values are on, and that is
|
|
42
|
+
* prose we can only write for a dashboard we have actually checked.
|
|
43
|
+
*/
|
|
44
|
+
export declare function envServiceHints(keys: readonly string[]): string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { readCapped } from "@next-deploy/core";
|