@devdogsuga/devtools 0.1.26 → 0.1.27
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 +72 -11
- package/bin/devtools.mjs +4 -4
- package/dist/cli-CZKkNHK5.js +6619 -0
- package/dist/failure-log-BBPGejQv.js +256 -0
- package/dist/launch.js +267 -281
- package/dist/local-env-D8HC2JK_.js +351 -0
- package/dist/local-env-DrBCXqD8.js +2 -0
- package/dist/menu-CQBsQRgH.js +1684 -0
- package/dist/peer-redirect-hooks.js +15 -0
- package/dist/peers-RBplwovA.js +229 -0
- package/dist/root-C2OmZDwD.js +94 -0
- package/dist/stack-Bx-55oi_.js +2 -0
- package/dist/stack-BynCgRVS.js +181 -0
- package/dist/supabase-project-0knM0mqd.js +426 -0
- package/dist/telemetry-C4foD8MD.js +249 -0
- package/dist/telemetry.js +2 -148
- package/package.json +10 -29
- package/bin/devtools-ci-bare.mjs +0 -48
- package/bin/devtools-ci.mjs +0 -31
- package/dist/args.d.ts +0 -26
- package/dist/args.js +0 -78
- package/dist/bws/bw.d.ts +0 -18
- package/dist/bws/bw.js +0 -70
- package/dist/bws/client.d.ts +0 -43
- package/dist/bws/client.js +0 -363
- package/dist/bws/environments.d.ts +0 -96
- package/dist/bws/environments.js +0 -111
- package/dist/bws/pace.d.ts +0 -25
- package/dist/bws/pace.js +0 -43
- package/dist/bws/retry.d.ts +0 -12
- package/dist/bws/retry.js +0 -39
- package/dist/bws/store.d.ts +0 -1
- package/dist/bws/store.js +0 -32
- package/dist/bws/token.d.ts +0 -31
- package/dist/bws/token.js +0 -88
- package/dist/bws/vault.d.ts +0 -29
- package/dist/bws/vault.js +0 -200
- package/dist/catalog.d.ts +0 -57
- package/dist/catalog.js +0 -57
- package/dist/cf/build.d.ts +0 -13
- package/dist/cf/build.js +0 -65
- package/dist/cf/commands.d.ts +0 -1
- package/dist/cf/commands.js +0 -172
- package/dist/cf/local-env.d.ts +0 -58
- package/dist/cf/local-env.js +0 -177
- package/dist/ci.d.ts +0 -1
- package/dist/ci.js +0 -328
- package/dist/cli.d.ts +0 -11
- package/dist/cli.js +0 -1094
- package/dist/commands.d.ts +0 -261
- package/dist/commands.js +0 -1318
- package/dist/completions.d.ts +0 -4
- package/dist/completions.js +0 -110
- package/dist/cron/commands.d.ts +0 -47
- package/dist/cron/commands.js +0 -372
- package/dist/cron/discovery.d.ts +0 -55
- package/dist/cron/discovery.js +0 -85
- package/dist/cron/schema.d.ts +0 -45
- package/dist/cron/schema.js +0 -35
- package/dist/db/config-push.d.ts +0 -8
- package/dist/db/config-push.js +0 -11
- package/dist/db/connection.d.ts +0 -79
- package/dist/db/connection.js +0 -114
- package/dist/db/exec.d.ts +0 -1
- package/dist/db/exec.js +0 -11
- package/dist/db/generate-types.d.ts +0 -1
- package/dist/db/generate-types.js +0 -4
- package/dist/db/generated-env.d.ts +0 -69
- package/dist/db/generated-env.js +0 -113
- package/dist/db/introspect.d.ts +0 -1
- package/dist/db/introspect.js +0 -122
- package/dist/db/local-env.d.ts +0 -65
- package/dist/db/local-env.js +0 -23
- package/dist/db/new-migration.d.ts +0 -8
- package/dist/db/new-migration.js +0 -69
- package/dist/db/pooler.d.ts +0 -23
- package/dist/db/pooler.js +0 -55
- package/dist/db/run.d.ts +0 -68
- package/dist/db/run.js +0 -156
- package/dist/db/seed-buckets.d.ts +0 -2
- package/dist/db/seed-buckets.js +0 -4
- package/dist/db/seed-production.d.ts +0 -8
- package/dist/db/seed-production.js +0 -79
- package/dist/db/seed-roles.d.ts +0 -7
- package/dist/db/seed-roles.js +0 -33
- package/dist/db/session-refresh.d.ts +0 -43
- package/dist/db/session-refresh.js +0 -40
- package/dist/deploy/migrations.d.ts +0 -20
- package/dist/deploy/migrations.js +0 -68
- package/dist/deploy/orphans.d.ts +0 -20
- package/dist/deploy/orphans.js +0 -177
- package/dist/deploy/preflight.d.ts +0 -53
- package/dist/deploy/preflight.js +0 -189
- package/dist/deploy/report.d.ts +0 -26
- package/dist/deploy/report.js +0 -70
- package/dist/deploy/require-planner.d.ts +0 -2
- package/dist/deploy/require-planner.js +0 -60
- package/dist/deploy/require-token.d.ts +0 -15
- package/dist/deploy/require-token.js +0 -78
- package/dist/deploy/secrets-file.d.ts +0 -17
- package/dist/deploy/secrets-file.js +0 -166
- package/dist/deploy/write-env.d.ts +0 -40
- package/dist/deploy/write-env.js +0 -395
- package/dist/docs/index-pages.d.ts +0 -38
- package/dist/docs/index-pages.js +0 -186
- package/dist/emails/commands.d.ts +0 -15
- package/dist/emails/commands.js +0 -130
- package/dist/emails/email-types.d.ts +0 -13
- package/dist/emails/email-types.js +0 -1
- package/dist/emails/fixtures.d.ts +0 -20
- package/dist/emails/fixtures.js +0 -20
- package/dist/env/audit.d.ts +0 -206
- package/dist/env/audit.js +0 -436
- package/dist/env/cloudflare.d.ts +0 -21
- package/dist/env/cloudflare.js +0 -61
- package/dist/env/commands.d.ts +0 -99
- package/dist/env/commands.js +0 -613
- package/dist/env/discovery.d.ts +0 -15
- package/dist/env/discovery.js +0 -239
- package/dist/env/document.d.ts +0 -119
- package/dist/env/document.js +0 -323
- package/dist/env/example.d.ts +0 -68
- package/dist/env/example.js +0 -605
- package/dist/env/selection.d.ts +0 -105
- package/dist/env/selection.js +0 -228
- package/dist/env-entry.d.ts +0 -49
- package/dist/env-entry.js +0 -204
- package/dist/environment-doctor.d.ts +0 -45
- package/dist/environment-doctor.js +0 -429
- package/dist/environment.d.ts +0 -92
- package/dist/environment.js +0 -185
- package/dist/fingerprint.d.ts +0 -10
- package/dist/fingerprint.js +0 -18
- package/dist/gen/campus-map.d.ts +0 -1
- package/dist/gen/campus-map.js +0 -473
- package/dist/gen/commands.d.ts +0 -1
- package/dist/gen/commands.js +0 -25
- package/dist/gen/hypno.d.ts +0 -1
- package/dist/gen/hypno.js +0 -134
- package/dist/gh/client.d.ts +0 -80
- package/dist/gh/client.js +0 -259
- package/dist/gh/environments.d.ts +0 -83
- package/dist/gh/environments.js +0 -178
- package/dist/gh/rulesets/actors.d.ts +0 -14
- package/dist/gh/rulesets/actors.js +0 -69
- package/dist/gh/rulesets/api.d.ts +0 -15
- package/dist/gh/rulesets/api.js +0 -104
- package/dist/gh/rulesets/commands.d.ts +0 -3
- package/dist/gh/rulesets/commands.js +0 -203
- package/dist/gh/rulesets/desired.d.ts +0 -112
- package/dist/gh/rulesets/desired.js +0 -271
- package/dist/gh/rulesets/diff.d.ts +0 -65
- package/dist/gh/rulesets/diff.js +0 -170
- package/dist/gh/rulesets/types.d.ts +0 -76
- package/dist/gh/rulesets/types.js +0 -13
- package/dist/gh/settings/api.d.ts +0 -40
- package/dist/gh/settings/api.js +0 -180
- package/dist/gh/settings/commands.d.ts +0 -1
- package/dist/gh/settings/commands.js +0 -254
- package/dist/gh/settings/desired.d.ts +0 -53
- package/dist/gh/settings/desired.js +0 -43
- package/dist/gh/settings/diff.d.ts +0 -57
- package/dist/gh/settings/diff.js +0 -161
- package/dist/gh/settings/types.d.ts +0 -92
- package/dist/gh/settings/types.js +0 -11
- package/dist/gh/settings/workflows.d.ts +0 -41
- package/dist/gh/settings/workflows.js +0 -128
- package/dist/grantRoot.d.ts +0 -42
- package/dist/grantRoot.js +0 -89
- package/dist/help.d.ts +0 -18
- package/dist/help.js +0 -169
- package/dist/images/commands.d.ts +0 -32
- package/dist/images/commands.js +0 -231
- package/dist/images/events.d.ts +0 -47
- package/dist/images/events.js +0 -116
- package/dist/images/graphics.d.ts +0 -70
- package/dist/images/graphics.js +0 -234
- package/dist/images/open-graph-types.d.ts +0 -75
- package/dist/images/open-graph-types.js +0 -1
- package/dist/images/prompts.d.ts +0 -34
- package/dist/images/prompts.js +0 -100
- package/dist/images/render.d.ts +0 -21
- package/dist/images/render.js +0 -61
- package/dist/images/select.d.ts +0 -64
- package/dist/images/select.js +0 -96
- package/dist/instance.d.ts +0 -69
- package/dist/instance.js +0 -102
- package/dist/invocation.d.ts +0 -49
- package/dist/invocation.js +0 -78
- package/dist/launch-ci.d.ts +0 -1
- package/dist/launch-ci.js +0 -90
- package/dist/launch.d.ts +0 -18
- package/dist/menu.d.ts +0 -43
- package/dist/menu.js +0 -300
- package/dist/moderation.d.ts +0 -70
- package/dist/moderation.js +0 -128
- package/dist/oauth/browser.d.ts +0 -1
- package/dist/oauth/browser.js +0 -13
- package/dist/oauth/config.d.ts +0 -24
- package/dist/oauth/config.js +0 -24
- package/dist/oauth/connect-url.d.ts +0 -17
- package/dist/oauth/connect-url.js +0 -23
- package/dist/oauth/db.d.ts +0 -37
- package/dist/oauth/db.js +0 -108
- package/dist/oauth/device.d.ts +0 -93
- package/dist/oauth/device.js +0 -198
- package/dist/oauth/discovery.d.ts +0 -28
- package/dist/oauth/discovery.js +0 -54
- package/dist/oauth/env-file.d.ts +0 -6
- package/dist/oauth/env-file.js +0 -35
- package/dist/oauth/exchange.d.ts +0 -43
- package/dist/oauth/exchange.js +0 -93
- package/dist/oauth/label.d.ts +0 -1
- package/dist/oauth/label.js +0 -25
- package/dist/oauth/loopback.d.ts +0 -52
- package/dist/oauth/loopback.js +0 -168
- package/dist/oauth/pkce.d.ts +0 -6
- package/dist/oauth/pkce.js +0 -34
- package/dist/oauth/target.d.ts +0 -54
- package/dist/oauth/target.js +0 -102
- package/dist/oauth/transport.d.ts +0 -41
- package/dist/oauth/transport.js +0 -32
- package/dist/oauth/wizard.d.ts +0 -40
- package/dist/oauth/wizard.js +0 -578
- package/dist/persona.d.ts +0 -18
- package/dist/persona.js +0 -221
- package/dist/pick.d.ts +0 -6
- package/dist/pick.js +0 -64
- package/dist/pipes.d.ts +0 -1
- package/dist/pipes.js +0 -25
- package/dist/planner/checks.d.ts +0 -26
- package/dist/planner/checks.js +0 -104
- package/dist/planner/commands.d.ts +0 -10
- package/dist/planner/commands.js +0 -367
- package/dist/planner/db.d.ts +0 -15
- package/dist/planner/db.js +0 -33
- package/dist/planner/role.d.ts +0 -33
- package/dist/planner/role.js +0 -68
- package/dist/repo/peer-redirect-hooks.d.ts +0 -16
- package/dist/repo/peer-redirect-hooks.js +0 -10
- package/dist/repo/peer-redirect.d.ts +0 -4
- package/dist/repo/peer-redirect.js +0 -26
- package/dist/repo/peers.d.ts +0 -39
- package/dist/repo/peers.js +0 -139
- package/dist/repo/resolve.d.ts +0 -41
- package/dist/repo/resolve.js +0 -152
- package/dist/repo/root.d.ts +0 -23
- package/dist/repo/root.js +0 -91
- package/dist/repo/source.d.ts +0 -14
- package/dist/repo/source.js +0 -54
- package/dist/repo/supabase-project.d.ts +0 -60
- package/dist/repo/supabase-project.js +0 -124
- package/dist/repo/tsx-loader.d.ts +0 -6
- package/dist/repo/tsx-loader.js +0 -41
- package/dist/run/pick.d.ts +0 -90
- package/dist/run/pick.js +0 -664
- package/dist/setup.d.ts +0 -1
- package/dist/setup.js +0 -280
- package/dist/stack.d.ts +0 -48
- package/dist/stack.js +0 -403
- package/dist/telemetry.d.ts +0 -59
- package/dist/tier.d.ts +0 -40
- package/dist/tier.js +0 -96
- package/dist/ui.d.ts +0 -40
- package/dist/ui.js +0 -71
- package/dist/version.d.ts +0 -7
- package/dist/version.js +0 -17
- package/dist/workers.d.ts +0 -5
- package/dist/workers.js +0 -33
- package/dist/workflows/commands.d.ts +0 -54
- package/dist/workflows/commands.js +0 -763
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This repo's Supabase project id — read from `supabase/config.toml` — and
|
|
3
|
-
* the container-name conventions the Supabase CLI derives from it.
|
|
4
|
-
*
|
|
5
|
-
* Shared by `environment.ts`'s adaptive-menu probe (does a stack answer for
|
|
6
|
-
* THIS project?) and the foreign-stack detection in `db/generated-env.ts`
|
|
7
|
-
* and `stack.ts` (does a DIFFERENT project's stack hold the shared ports? —
|
|
8
|
-
* the case where `supabase status -o env` fails not because nothing is
|
|
9
|
-
* running, but because what is running on 127.0.0.1:54321 belongs to
|
|
10
|
-
* another workspace, or to this same repo before/after a `project_id`
|
|
11
|
-
* rename). One project-id reader and one container-name parser, so both
|
|
12
|
-
* questions agree on what "this project" means.
|
|
13
|
-
*/
|
|
14
|
-
import { execFileSync } from "node:child_process";
|
|
15
|
-
import { readFileSync } from "node:fs";
|
|
16
|
-
import { join } from "node:path";
|
|
17
|
-
/**
|
|
18
|
-
* Reads `project_id` out of `<repoRoot>/supabase/config.toml`, or `null`
|
|
19
|
-
* when the file is missing or unparsable.
|
|
20
|
-
*
|
|
21
|
-
* Regex, not a TOML parser: it is one line, the shape has been stable
|
|
22
|
-
* across every CLI version this repo has seen, and a parser on a path some
|
|
23
|
-
* callers pay before their first real subprocess is a cost that stays
|
|
24
|
-
* invisible until it is why the tool feels slow.
|
|
25
|
-
*/
|
|
26
|
-
export function readProjectId(repoRoot) {
|
|
27
|
-
try {
|
|
28
|
-
const path = join(repoRoot, "supabase", "config.toml");
|
|
29
|
-
const match = /^\s*project_id\s*=\s*"([^"]+)"/m.exec(readFileSync(path, "utf8"));
|
|
30
|
-
return match?.[1] ?? null;
|
|
31
|
-
}
|
|
32
|
-
catch {
|
|
33
|
-
return null;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* The Supabase CLI's container name prefix for a project id, or the bare
|
|
38
|
-
* `supabase_db_` fallback when the id could not be read.
|
|
39
|
-
*
|
|
40
|
-
* Falling back to the bare prefix means a machine whose `config.toml`
|
|
41
|
-
* cannot be read still detects *a* stack, at the cost of over-matching a
|
|
42
|
-
* differently-named project — deliberate, and unchanged from this
|
|
43
|
-
* function's original home in `environment.ts`: over-matching offers
|
|
44
|
-
* `stop`/a foreign-stack hint for a stack that turns out to be this
|
|
45
|
-
* project's own, which is harmless to see and decline, while
|
|
46
|
-
* under-matching hides a real signal entirely.
|
|
47
|
-
*/
|
|
48
|
-
export function containerPrefix(projectId) {
|
|
49
|
-
return projectId ? `supabase_db_${projectId}` : "supabase_db_";
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* The local stack's API port, published by its Kong container. Mirrors
|
|
53
|
-
* `@devdogsuga/env/load`'s `LOCAL_STACK_PORT`, which this module cannot import
|
|
54
|
-
* statically (that package is an optional peer, loaded on demand).
|
|
55
|
-
*/
|
|
56
|
-
export const STACK_API_PORT = 54321;
|
|
57
|
-
function defaultExec(file, args) {
|
|
58
|
-
try {
|
|
59
|
-
return execFileSync(file, args, {
|
|
60
|
-
encoding: "utf8",
|
|
61
|
-
stdio: ["ignore", "pipe", "ignore"],
|
|
62
|
-
timeout: 3000,
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
catch {
|
|
66
|
-
return null;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* `docker ps --format '{{.Names}}'`, split into trimmed, non-empty names —
|
|
71
|
-
* or `null` when Docker could not be read at all (no daemon, not
|
|
72
|
-
* installed, timed out). With `publish`, only the containers publishing that
|
|
73
|
-
* host port. `execute` is injectable for tests, mirroring `environment.ts`'s
|
|
74
|
-
* own probes.
|
|
75
|
-
*/
|
|
76
|
-
export function listContainerNames(publish, execute = defaultExec) {
|
|
77
|
-
const filter = publish === undefined ? [] : ["--filter", `publish=${publish}`];
|
|
78
|
-
const out = execute("docker", ["ps", ...filter, "--format", "{{.Names}}"]);
|
|
79
|
-
if (out === null)
|
|
80
|
-
return null;
|
|
81
|
-
return out
|
|
82
|
-
.split("\n")
|
|
83
|
-
.map((name) => name.trim())
|
|
84
|
-
.filter((name) => name.length > 0);
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Finds the `supabase_kong_<id>` container among `names` whose id differs
|
|
88
|
-
* from `projectId` — the signature of a stack started from a DIFFERENT
|
|
89
|
-
* Supabase project (this same repo before/after a rename, or another
|
|
90
|
-
* project entirely) holding the shared ports. Kong is the container that
|
|
91
|
-
* publishes the API port, so callers pass the names `listContainerNames`
|
|
92
|
-
* returns for `STACK_API_PORT`: that names the stack actually on 54321,
|
|
93
|
-
* not just any Supabase stack on the machine.
|
|
94
|
-
*
|
|
95
|
-
* Returns that foreign id, or `null` when every matching container belongs
|
|
96
|
-
* to this project, none match at all, or `projectId` itself could not be
|
|
97
|
-
* read — with no known id of our own, there is nothing to compare against,
|
|
98
|
-
* and guessing would risk telling a contributor their OWN stack is
|
|
99
|
-
* foreign.
|
|
100
|
-
*/
|
|
101
|
-
export function foreignStackProjectId(names, projectId) {
|
|
102
|
-
if (projectId === null)
|
|
103
|
-
return null;
|
|
104
|
-
for (const name of names) {
|
|
105
|
-
const match = /^supabase_kong_(.+)$/.exec(name);
|
|
106
|
-
if (!match)
|
|
107
|
-
continue;
|
|
108
|
-
const id = match[1];
|
|
109
|
-
if (id !== projectId)
|
|
110
|
-
return id;
|
|
111
|
-
}
|
|
112
|
-
return null;
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* The actionable message for a detected foreign stack — shared by
|
|
116
|
-
* `db/generated-env.ts` (a failed `supabase status -o env`) and `stack.ts`
|
|
117
|
-
* (a failed `supabase start`), so both name the same fix in the same
|
|
118
|
-
* words.
|
|
119
|
-
*/
|
|
120
|
-
export function foreignStackMessage(foreignProjectId) {
|
|
121
|
-
return (`The stack on port ${STACK_API_PORT} belongs to project "${foreignProjectId}", not ` +
|
|
122
|
-
"this checkout's. Stop it with `supabase stop --project-id " +
|
|
123
|
-
`${foreignProjectId}\` then \`pnpm devtools db start\`.`);
|
|
124
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Imports a repo TypeScript file at an absolute path, loaded through tsx.
|
|
3
|
-
* Returns the module namespace, typed as `T` by the caller (there is no way
|
|
4
|
-
* to know the shape of an arbitrary repo file's exports statically here).
|
|
5
|
-
*/
|
|
6
|
-
export declare function importRepoTs<T>(absolutePath: string): Promise<T>;
|
package/dist/repo/tsx-loader.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Loads the repo's own TypeScript at runtime: env manifests
|
|
3
|
-
* (each app's `src/env.ts` and friends), cron contracts
|
|
4
|
-
* (each app's `cloudflare/scheduled.ts`), and — via `source.ts` — the
|
|
5
|
-
* `devdogs-source` condition packages (`open-graph`, `email`, `docs`).
|
|
6
|
-
*
|
|
7
|
-
* Uses `tsx`'s programmatic API (`register()` from `tsx/esm/api`), NOT the
|
|
8
|
-
* `--conditions=devdogs-source` CLI flag the old in-repo devtools used —
|
|
9
|
-
* this package ships built JS and runs from `dist/`, so there is no `tsx`
|
|
10
|
-
* process wrapping it anymore (see the package README / CUTOVER note on
|
|
11
|
-
* "built JS, tsx only for repo TS").
|
|
12
|
-
*
|
|
13
|
-
* Gotcha (FINDINGS.md experiments 3 and 4, gotcha C): do NOT pass a
|
|
14
|
-
* `namespace` to `register()`. It silently breaks tsx's own relative
|
|
15
|
-
* `./foo.js` → `./foo.ts` extension-fallback resolution for files loaded
|
|
16
|
-
* under that registration — exactly the convention `open-graph`, `email`,
|
|
17
|
-
* and any future `devdogs-source` package use for their internal relative
|
|
18
|
-
* imports. `register({})` (no options) is the only form validated.
|
|
19
|
-
*/
|
|
20
|
-
import { pathToFileURL } from "node:url";
|
|
21
|
-
let registered = false;
|
|
22
|
-
/** Idempotent: registers tsx's ESM loader hooks once per process. */
|
|
23
|
-
async function ensureRegistered() {
|
|
24
|
-
if (registered)
|
|
25
|
-
return;
|
|
26
|
-
const { register } = await import("tsx/esm/api");
|
|
27
|
-
// `register()`'s return value is an unregister callback (`() => Promise<void>`),
|
|
28
|
-
// not something this process ever calls: the hooks stay installed for the
|
|
29
|
-
// CLI's whole lifetime.
|
|
30
|
-
register();
|
|
31
|
-
registered = true;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Imports a repo TypeScript file at an absolute path, loaded through tsx.
|
|
35
|
-
* Returns the module namespace, typed as `T` by the caller (there is no way
|
|
36
|
-
* to know the shape of an arbitrary repo file's exports statically here).
|
|
37
|
-
*/
|
|
38
|
-
export async function importRepoTs(absolutePath) {
|
|
39
|
-
await ensureRegistered();
|
|
40
|
-
return import(pathToFileURL(absolutePath).href);
|
|
41
|
-
}
|
package/dist/run/pick.d.ts
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
export interface App {
|
|
2
|
-
name: string;
|
|
3
|
-
script: string;
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* Whether to ask at all.
|
|
7
|
-
*
|
|
8
|
-
* Every one of these is a case where a prompt is either impossible or wrong:
|
|
9
|
-
*
|
|
10
|
-
* * `CI`, set by GitHub Actions and every other runner. No workflow reaches
|
|
11
|
-
* this today (see the header), but a workflow that blocked on a
|
|
12
|
-
* multiselect would hang until its timeout with no output saying why, and
|
|
13
|
-
* that failure is bad enough to keep guarding against.
|
|
14
|
-
* * No TTY: a pipe, a `pnpm` invoked by a script, an editor task runner.
|
|
15
|
-
* Nobody is there to answer. Every other picker in this repo checks the
|
|
16
|
-
* same thing.
|
|
17
|
-
* * An explicit filter. The caller has already said which packages, and
|
|
18
|
-
* asking again would be asking them to repeat themselves.
|
|
19
|
-
* * `DEVDOGS_PICK=0`, the escape hatch and the recursion guard above.
|
|
20
|
-
*/
|
|
21
|
-
export declare function shouldAsk(args: string[]): boolean;
|
|
22
|
-
/**
|
|
23
|
-
* Pulls every `--filter`/`-F`/`--scope` value out of `args`, returning the
|
|
24
|
-
* package patterns named and the remaining args with those flags removed.
|
|
25
|
-
*
|
|
26
|
-
* `--scope` is folded into the same bucket as `--filter` here: pnpm has no
|
|
27
|
-
* `--scope` flag of its own, so a caller who still types the turbo-era name
|
|
28
|
-
* gets it translated into a real `--filter` value rather than passed through
|
|
29
|
-
* to a `pnpm` invocation that would reject it outright.
|
|
30
|
-
*
|
|
31
|
-
* Exported for the same reason `parseTierArg` is: pure, no `process.exit`, so
|
|
32
|
-
* it is unit-testable without going through `passthrough`.
|
|
33
|
-
*/
|
|
34
|
-
export declare function extractFilters(args: readonly string[]): {
|
|
35
|
-
filters: string[];
|
|
36
|
-
rest: string[];
|
|
37
|
-
};
|
|
38
|
-
export interface DevPlan {
|
|
39
|
-
/** Apps whose dev server is `vinext dev`, started directly, one each. */
|
|
40
|
-
vinext: string[];
|
|
41
|
-
/** The `pnpm` args for every other selected app's `dev`, or null for none. */
|
|
42
|
-
others: string[] | null;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Splits a `dev` run between apps whose dev server is `vinext dev` and the
|
|
46
|
-
* rest.
|
|
47
|
-
*
|
|
48
|
-
* A vinext app's server code runs in workerd, which only sees what
|
|
49
|
-
* `@cloudflare/vite-plugin` hands it: the app dir's own `.dev.vars`/`.env`, or
|
|
50
|
-
* with `CLOUDFLARE_INCLUDE_PROCESS_ENV` the whole `process.env`. The repo's
|
|
51
|
-
* `.env` is at the root, so through the app's own `with-env vinext dev` script
|
|
52
|
-
* the Worker gets nothing and env validation fails. So a vinext app skips its
|
|
53
|
-
* script and runs `pnpm --filter <app> exec vinext dev` with the env
|
|
54
|
-
* `scopedProcessEnv` builds, the same way `workflows run` starts one: the
|
|
55
|
-
* flag set, and every other app's variables left out. Its script's own
|
|
56
|
-
* `with-env` would load the whole `.env` back in, so it is not used.
|
|
57
|
-
*
|
|
58
|
-
* Everything else still runs its own `dev` script under one `pnpm --parallel`.
|
|
59
|
-
* `apps` is every app with a `dev` script; `filters` the selection (empty for
|
|
60
|
-
* all of them). Only apps are named here: no other package has a `dev`
|
|
61
|
-
* script.
|
|
62
|
-
*/
|
|
63
|
-
export declare function planDev(apps: readonly App[], filters: readonly string[], rest: readonly string[]): DevPlan;
|
|
64
|
-
export interface TierArgResult {
|
|
65
|
-
/** The validated tier, or absent when `--tier` was not passed. */
|
|
66
|
-
tier?: string;
|
|
67
|
-
/** `args` with `--tier` and its value removed, so pnpm never sees them. */
|
|
68
|
-
rest: string[];
|
|
69
|
-
/** Set instead of `tier` when parsing failed; `rest` is unchanged on error. */
|
|
70
|
-
error?: string;
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Parses and strips `--tier <value>` from pnpm-bound args, mirroring the
|
|
74
|
-
* `--all` strip above.
|
|
75
|
-
*
|
|
76
|
-
* Pure on purpose — no `process.exit` — so this is unit-testable without
|
|
77
|
-
* going through `passthrough`, which every other path in this file ends at
|
|
78
|
-
* and which a test cannot observe return from. `runTask` is the one caller,
|
|
79
|
-
* and it is the one that turns `error` into an exit.
|
|
80
|
-
*/
|
|
81
|
-
export declare function parseTierArg(args: readonly string[]): TierArgResult;
|
|
82
|
-
/**
|
|
83
|
-
* Runs one root task, asking which apps first where that makes sense.
|
|
84
|
-
*
|
|
85
|
-
* Never returns: every path ends in `passthrough`, which exits with the
|
|
86
|
-
* underlying `pnpm` invocation's own status. That is why `cli.ts` dispatches
|
|
87
|
-
* this before `intro()`. There is no `outro()` to reach, and a banner would
|
|
88
|
-
* land on the stream a dev server is about to take over.
|
|
89
|
-
*/
|
|
90
|
-
export declare function runTask(argv: string[]): Promise<never>;
|