@devdogsuga/devtools 0.1.51-next.526 → 0.1.51-next.538
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as ownPackageDir, g as positionals, h as flagValue, l as ownVersion, n as discoverRepoRoot, r as findRepoRoot, u as cliName } from "./root-CsocfxnK.js";
|
|
2
|
-
import { A as
|
|
2
|
+
import { A as helpPath, C as currentProduct, D as isProductMode, E as activeCatalog, M as renderHelp, S as ProductConfigError, T as loadProductConfig, _ as bail, a as recordEnteredTier, b as explainError, c as describeEnvironment, d as resolveDbConnection, f as sessionIsLocal, i as beginInvocation, j as renderCommandList, k as catalog, l as probeEnvironment, n as bareGroupStartPath, o as recordResolved, p as sessionLabel, r as runMenu, s as reproducibleCommand, t as bareGroupStartFlags, u as nonEmpty, v as errorMessage, x as unwrap, y as explain } from "./menu-C30rQm5v.js";
|
|
3
3
|
import { A as dryRunKind, C as layoutAt, E as resolveLayout, O as reportRan, P as wouldRunLine, S as findApp, T as resolveAppPath, _ as loadEnvLoad, b as appWorkspaceRoot, c as reportRuns, f as supabase, g as loadEnv, h as getEnvSync, j as isDryRun, k as runInGroup, l as run$1, m as supabaseRoot, s as dbPush, u as runWithStderr, v as loadEnvSession, w as listApps, x as devdogsugaRootOrNull, y as repoPeerUrl } from "./supabase-project-BoJKMCxL.js";
|
|
4
4
|
import { d as hasYes, f as isNonInteractive, n as captureDevtoolsError, o as initDevtoolsTelemetry } from "./telemetry-BKFDtzXI.js";
|
|
5
5
|
import { t as runStackCommand } from "./stack-7Lbym6Wq.js";
|
|
@@ -4906,16 +4906,26 @@ function runStatus(argv, cwd) {
|
|
|
4906
4906
|
]
|
|
4907
4907
|
});
|
|
4908
4908
|
}
|
|
4909
|
+
/** The Supabase CLI version a product repo pins, or null outside one. */
|
|
4910
|
+
function productPin(cwd) {
|
|
4911
|
+
try {
|
|
4912
|
+
return loadProductConfig(cwd).supabase.version;
|
|
4913
|
+
} catch {
|
|
4914
|
+
return null;
|
|
4915
|
+
}
|
|
4916
|
+
}
|
|
4909
4917
|
/**
|
|
4910
4918
|
* Runs `supabase status -o env` in `cwd` and extracts the local API URL and
|
|
4911
4919
|
* service role key. Throws a descriptive error if Supabase isn't running or
|
|
4912
4920
|
* the CLI isn't installed.
|
|
4913
4921
|
*
|
|
4914
|
-
*
|
|
4915
|
-
* a sibling project, where the Supabase CLI is normally installed globally
|
|
4916
|
-
* this monorepo, where it is a workspace devDependency and not on PATH at all
|
|
4917
|
-
*
|
|
4918
|
-
*
|
|
4922
|
+
* Up to three invocations are tried, because this wizard runs in three worlds:
|
|
4923
|
+
* a sibling project, where the Supabase CLI is normally installed globally;
|
|
4924
|
+
* this monorepo, where it is a workspace devDependency and not on PATH at all;
|
|
4925
|
+
* and a product repo (`devtools.config.json`), where `devtools setup` ran the
|
|
4926
|
+
* pinned CLI through `npx` and a new member has none installed. A global install
|
|
4927
|
+
* wins, since `pnpm exec` in a non-pnpm project would fail for reasons that have
|
|
4928
|
+
* nothing to do with Supabase.
|
|
4919
4929
|
*/
|
|
4920
4930
|
function detectLocalSupabase(cwd) {
|
|
4921
4931
|
const repoRoot = discoverRepoRoot(cwd);
|
|
@@ -4923,29 +4933,36 @@ function detectLocalSupabase(cwd) {
|
|
|
4923
4933
|
const layout = layoutAt(repoRoot);
|
|
4924
4934
|
if (layout.kind === "backstage" && layout.hasDevdogsuga) cwd = layout.devdogsugaRoot;
|
|
4925
4935
|
}
|
|
4936
|
+
const status = [
|
|
4937
|
+
"status",
|
|
4938
|
+
"-o",
|
|
4939
|
+
"env"
|
|
4940
|
+
];
|
|
4941
|
+
const attempts = [["supabase", ...status], [
|
|
4942
|
+
"pnpm",
|
|
4943
|
+
"exec",
|
|
4944
|
+
"supabase",
|
|
4945
|
+
...status
|
|
4946
|
+
]];
|
|
4947
|
+
const pin = productPin(cwd);
|
|
4948
|
+
if (pin !== null) attempts.push([
|
|
4949
|
+
"npx",
|
|
4950
|
+
"--yes",
|
|
4951
|
+
`supabase@${pin}`,
|
|
4952
|
+
...status
|
|
4953
|
+
]);
|
|
4926
4954
|
let output;
|
|
4927
|
-
|
|
4928
|
-
|
|
4929
|
-
|
|
4930
|
-
|
|
4931
|
-
|
|
4932
|
-
|
|
4933
|
-
|
|
4934
|
-
|
|
4935
|
-
|
|
4936
|
-
|
|
4937
|
-
|
|
4938
|
-
"exec",
|
|
4939
|
-
"supabase",
|
|
4940
|
-
"status",
|
|
4941
|
-
"-o",
|
|
4942
|
-
"env"
|
|
4943
|
-
], cwd);
|
|
4944
|
-
} catch {
|
|
4945
|
-
if (first.code === "ENOENT") throw new Error("supabase CLI not found — install it from https://supabase.com/docs/guides/cli");
|
|
4946
|
-
const stderr = (first.stderr ?? "").trim();
|
|
4947
|
-
throw new Error(stderr || (first instanceof Error ? first.message : String(first)));
|
|
4948
|
-
}
|
|
4955
|
+
let first;
|
|
4956
|
+
for (const argv of attempts) try {
|
|
4957
|
+
output = runStatus(argv, cwd);
|
|
4958
|
+
break;
|
|
4959
|
+
} catch (error) {
|
|
4960
|
+
first ??= error;
|
|
4961
|
+
}
|
|
4962
|
+
if (output === void 0) {
|
|
4963
|
+
if (first.code === "ENOENT") throw new Error("supabase CLI not found — install it from https://supabase.com/docs/guides/cli");
|
|
4964
|
+
const stderr = (first.stderr ?? "").trim();
|
|
4965
|
+
throw new Error(stderr || (first instanceof Error ? first.message : String(first)));
|
|
4949
4966
|
}
|
|
4950
4967
|
const env = parse(output);
|
|
4951
4968
|
const apiUrl = env["API_URL"];
|
package/dist/launch.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as installFailureLog, n as discoverRepoRoot, r as findRepoRoot, t as RepoNotFoundError, u as cliName } from "./root-CsocfxnK.js";
|
|
2
|
-
import {
|
|
2
|
+
import { A as helpPath, O as setProductMode, _ as bail, g as setMenuEnvHook, h as realEnvEntryDeps, k as catalog, m as enterSessionEnvironment, n as bareGroupStartPath, u as nonEmpty, v as errorMessage, w as findProductRoot, x as unwrap } from "./menu-C30rQm5v.js";
|
|
3
3
|
import { D as formatCommand, M as resolveDryRun, N as setDryRun, _ as loadEnvLoad, j as isDryRun, v as loadEnvSession } from "./supabase-project-BoJKMCxL.js";
|
|
4
4
|
import { d as hasYes, f as isNonInteractive, m as stripTierFlag, n as captureDevtoolsError, o as initDevtoolsTelemetry, p as stripNoEnvFlag, s as lastSentryEventId } from "./telemetry-BKFDtzXI.js";
|
|
5
5
|
import { confirm, select } from "@clack/prompts";
|
|
@@ -124,6 +124,14 @@ function ignoreClosedPipes() {
|
|
|
124
124
|
}
|
|
125
125
|
//#endregion
|
|
126
126
|
//#region src/launch.ts
|
|
127
|
+
/** The catalog node `rest` dispatches to. */
|
|
128
|
+
function declaredCommand(rest) {
|
|
129
|
+
const path = helpPath(rest);
|
|
130
|
+
for (let length = path.length; length > 0; length -= 1) {
|
|
131
|
+
const node = catalog.findCommand(path.slice(0, length));
|
|
132
|
+
if (node) return node;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
127
135
|
/**
|
|
128
136
|
* Whether the command `rest` dispatches to is declared `envFree` in
|
|
129
137
|
* the command catalog — the leading run of non-flag tokens is the
|
|
@@ -139,12 +147,7 @@ function ignoreClosedPipes() {
|
|
|
139
147
|
* remember to add here too.
|
|
140
148
|
*/
|
|
141
149
|
function isEnvFreeCommand(rest) {
|
|
142
|
-
|
|
143
|
-
for (let length = path.length; length > 0; length -= 1) {
|
|
144
|
-
const node = catalog.findCommand(path.slice(0, length));
|
|
145
|
-
if (node) return node.envFree === true;
|
|
146
|
-
}
|
|
147
|
-
return false;
|
|
150
|
+
return declaredCommand(rest)?.envFree === true;
|
|
148
151
|
}
|
|
149
152
|
/**
|
|
150
153
|
* Whether the command reads nothing but the checkout, so the session behaves
|
|
@@ -153,7 +156,7 @@ function isEnvFreeCommand(rest) {
|
|
|
153
156
|
* runner that has no `.env` at all.
|
|
154
157
|
*/
|
|
155
158
|
function skipsEnvEntry(rest) {
|
|
156
|
-
return
|
|
159
|
+
return declaredCommand(rest)?.noEnv === true;
|
|
157
160
|
}
|
|
158
161
|
/** The offer's stack start (`env-entry.ts` holds the TTY prompt, this holds
|
|
159
162
|
* the lifecycle command), imported lazily like the rest of the commands. */
|
|
@@ -169,7 +172,7 @@ async function startStack() {
|
|
|
169
172
|
* post-tier-resolution path.
|
|
170
173
|
*/
|
|
171
174
|
async function dispatch(argv) {
|
|
172
|
-
const { main } = await import("./cli-
|
|
175
|
+
const { main } = await import("./cli-CT8KKwtW.js");
|
|
173
176
|
try {
|
|
174
177
|
await main(argv);
|
|
175
178
|
} catch (err) {
|
|
@@ -500,6 +500,7 @@ const moderationCommand = {
|
|
|
500
500
|
summary: "Send one signed moderation action to a receiver.",
|
|
501
501
|
hint: "like a moderator's decision, without the platform",
|
|
502
502
|
envFree: true,
|
|
503
|
+
noEnv: true,
|
|
503
504
|
options: [
|
|
504
505
|
TO,
|
|
505
506
|
SECRET,
|
|
@@ -533,6 +534,7 @@ const moderationCommand = {
|
|
|
533
534
|
summary: "Send the conformance sequence and check each answer.",
|
|
534
535
|
hint: "pass or fail",
|
|
535
536
|
envFree: true,
|
|
537
|
+
noEnv: true,
|
|
536
538
|
options: [TO, SECRET]
|
|
537
539
|
}]
|
|
538
540
|
};
|
|
@@ -1976,4 +1978,4 @@ async function runMenu(catalog, dispatch, env = probeEnvironment(), options = {}
|
|
|
1976
1978
|
return dispatch(chosen.argv);
|
|
1977
1979
|
}
|
|
1978
1980
|
//#endregion
|
|
1979
|
-
export {
|
|
1981
|
+
export { helpPath as A, currentProduct as C, isProductMode as D, activeCatalog as E, renderHelp as M, setProductMode as O, ProductConfigError as S, loadProductConfig as T, bail as _, recordEnteredTier as a, explainError as b, describeEnvironment as c, resolveDbConnection as d, sessionIsLocal as f, setMenuEnvHook as g, realEnvEntryDeps as h, beginInvocation as i, renderCommandList as j, catalog as k, probeEnvironment as l, enterSessionEnvironment as m, bareGroupStartPath as n, recordResolved as o, sessionLabel as p, runMenu as r, reproducibleCommand as s, bareGroupStartFlags as t, nonEmpty as u, errorMessage as v, findProductRoot as w, unwrap as x, explain as y };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devdogsuga/devtools",
|
|
3
|
-
"version": "0.1.51-next.
|
|
3
|
+
"version": "0.1.51-next.538",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Contributor CLI for DevDogs repositories (the platform monorepo, DogDays, DogPack): the real tools with the session's tier filled in, `setup`, `db sync`, `db types`, `dev-data`, a menu over them, the checks CI runs, and the `with-env` launcher. Ships built JS; run via `pnpm dlx @devdogsuga/devtools` or `npx @devdogsuga/devtools` (or the `devtools` bin once installed) from inside a clone.",
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
"eslint": "^9.39.5",
|
|
45
45
|
"tsdown": "^0.23.0",
|
|
46
46
|
"vitest": "^4.1.11",
|
|
47
|
-
"@devdogsuga/
|
|
47
|
+
"@devdogsuga/sdk": "0.1.0",
|
|
48
48
|
"@devdogsuga/config": "0.1.4-next.526",
|
|
49
|
-
"@devdogsuga/
|
|
49
|
+
"@devdogsuga/cli-core": "0.0.0"
|
|
50
50
|
},
|
|
51
51
|
"scripts": {
|
|
52
52
|
"build": "tsdown && node scripts/write-build-info.mjs && node ../../scripts/check-bundle-imports.mjs",
|