@devdogsuga/devtools 0.1.51-next.541 → 0.1.51-next.545
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 +6 -3
- package/dist/{cli-BoTmTNqH.js → cli-DNZ-6WEI.js} +105 -61
- package/dist/{root-CsocfxnK.js → failure-log-MSdCgvLc.js} +5 -75
- package/dist/launch.js +28 -11
- package/dist/{load-Cp8AMERM.js → load-Z2CXCpyx.js} +7 -4
- package/dist/load-yn7JCcS2.js +2 -0
- package/dist/{menu-C30rQm5v.js → menu-oQE5IqAI.js} +168 -146
- package/dist/root-DfH38DFq.js +2 -0
- package/dist/root-PA8K5G2d.js +77 -0
- package/dist/{supabase-project-BoJKMCxL.js → run-CRBte7p0.js} +235 -249
- package/dist/{session-rbONwFvY.js → session-CuexI1f9.js} +1 -1
- package/dist/{session-CmDxHEMn.js → session-DzgtIg6K.js} +1 -1
- package/dist/spawn-BvLQzc_K.js +100 -0
- package/dist/{stack-7Lbym6Wq.js → stack-BRevXgI3.js} +1 -1
- package/dist/stack-Cl_B_dt7.js +2 -0
- package/dist/{telemetry-BKFDtzXI.js → telemetry-BDTAGquh.js} +19 -4
- package/dist/telemetry.js +2 -2
- package/dist/with-env.js +15 -17
- package/package.json +6 -4
- package/dist/load-Czhayrsk.js +0 -2
- package/dist/stack-7qA2UP9g.js +0 -2
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as discoverRepoRoot, t as RepoNotFoundError } from "./root-PA8K5G2d.js";
|
|
2
|
+
import { c as cliName, n as noteError, s as ownVersion } from "./failure-log-MSdCgvLc.js";
|
|
2
3
|
import { readFileSync } from "node:fs";
|
|
3
4
|
import * as Sentry from "@sentry/node";
|
|
4
5
|
//#region ../cli-core/src/mode.ts
|
|
@@ -299,6 +300,20 @@ function hasRealCaller(inRepo, isTTY) {
|
|
|
299
300
|
return inRepo || isTTY;
|
|
300
301
|
}
|
|
301
302
|
/**
|
|
303
|
+
* A failure the person caused and can fix without anyone's help: the wrong
|
|
304
|
+
* directory, a bad flag, a database that has not been set up. These are
|
|
305
|
+
* printed and exit non-zero but are not bugs, so they are never sent to Sentry
|
|
306
|
+
* (the failure log still records them). Matched by name as well as class so
|
|
307
|
+
* that `UsageError` (`ui.ts`, which imports this module) and the product
|
|
308
|
+
* commands' known errors need no import cycle; a command's own error class
|
|
309
|
+
* opts in by setting `expected = true`.
|
|
310
|
+
*/
|
|
311
|
+
function isExpectedFailure(err) {
|
|
312
|
+
if (err instanceof RepoNotFoundError) return true;
|
|
313
|
+
if (!(err instanceof Error)) return false;
|
|
314
|
+
return err.name === "UsageError" || err.expected === true;
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
302
317
|
* Initializes `@sentry/node` for this CLI process. Safe to call more than
|
|
303
318
|
* once (idempotent) and safe to call with no DSN configured (no-ops via
|
|
304
319
|
* `buildSentryOptions`, see its header).
|
|
@@ -334,7 +349,7 @@ function initDevtoolsTelemetry(command) {
|
|
|
334
349
|
*/
|
|
335
350
|
async function captureDevtoolsError(err) {
|
|
336
351
|
noteError(err);
|
|
337
|
-
if (!devtoolsTelemetryEnabled()) return;
|
|
352
|
+
if (!devtoolsTelemetryEnabled() || isExpectedFailure(err)) return;
|
|
338
353
|
sent(Sentry.captureException(err));
|
|
339
354
|
await Sentry.flush(2e3);
|
|
340
355
|
}
|
|
@@ -347,7 +362,7 @@ async function captureDevtoolsError(err) {
|
|
|
347
362
|
*/
|
|
348
363
|
function reportDevtoolsError(err) {
|
|
349
364
|
noteError(err);
|
|
350
|
-
if (!devtoolsTelemetryEnabled()) return;
|
|
365
|
+
if (!devtoolsTelemetryEnabled() || isExpectedFailure(err)) return;
|
|
351
366
|
sent(Sentry.captureException(err));
|
|
352
367
|
}
|
|
353
368
|
/**
|
|
@@ -381,4 +396,4 @@ async function captureDevtoolsDeprecation(message, fingerprint, tags) {
|
|
|
381
396
|
await Sentry.flush(1e3);
|
|
382
397
|
}
|
|
383
398
|
//#endregion
|
|
384
|
-
export { hasRealCaller as a,
|
|
399
|
+
export { hasRealCaller as a, lastSentryEventId as c, resolveDevtoolsDsn as d, hasYes as f, stripTierFlag as h, devtoolsTelemetryEnabled as i, reportDevtoolsError as l, stripNoEnvFlag as m, captureDevtoolsError as n, initDevtoolsTelemetry as o, isNonInteractive as p, devtoolsEnvironment as r, isExpectedFailure as s, captureDevtoolsDeprecation as t, reportDevtoolsFailure as u };
|
package/dist/telemetry.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as hasRealCaller, c as
|
|
2
|
-
export { captureDevtoolsDeprecation, captureDevtoolsError, devtoolsEnvironment, devtoolsTelemetryEnabled, hasRealCaller, initDevtoolsTelemetry, lastSentryEventId, reportDevtoolsError, reportDevtoolsFailure, resolveDevtoolsDsn };
|
|
1
|
+
import { a as hasRealCaller, c as lastSentryEventId, d as resolveDevtoolsDsn, i as devtoolsTelemetryEnabled, l as reportDevtoolsError, n as captureDevtoolsError, o as initDevtoolsTelemetry, r as devtoolsEnvironment, s as isExpectedFailure, t as captureDevtoolsDeprecation, u as reportDevtoolsFailure } from "./telemetry-BDTAGquh.js";
|
|
2
|
+
export { captureDevtoolsDeprecation, captureDevtoolsError, devtoolsEnvironment, devtoolsTelemetryEnabled, hasRealCaller, initDevtoolsTelemetry, isExpectedFailure, lastSentryEventId, reportDevtoolsError, reportDevtoolsFailure, resolveDevtoolsDsn };
|
package/dist/with-env.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { r as spawnProcess, t as exec } from "./spawn-BvLQzc_K.js";
|
|
2
|
+
import { _ as UnknownEnvironmentError, a as LocalStackOfflineError, c as applyDeployTierAliases, d as loadEnvironment, l as applyWranglerLocalDatabaseAlias, m as probeLocalStack, n as GENERATED_FILE, o as MissingEnvFileError } from "./load-Z2CXCpyx.js";
|
|
3
|
+
import { n as availableTiers, s as askSession, t as SESSION_SELECTORS } from "./session-CuexI1f9.js";
|
|
3
4
|
import { createRequire } from "node:module";
|
|
4
5
|
import { existsSync, statSync, writeFileSync } from "node:fs";
|
|
5
6
|
import { dirname, join, resolve } from "node:path";
|
|
6
|
-
import { execFile, spawn } from "node:child_process";
|
|
7
7
|
import { fileURLToPath } from "node:url";
|
|
8
8
|
import { Command } from "commander";
|
|
9
9
|
//#region ../cli-core/src/env-runtime/confirm.ts
|
|
@@ -48,16 +48,15 @@ async function confirmProduction(options) {
|
|
|
48
48
|
* when `config.toml` is newer than it.
|
|
49
49
|
*/
|
|
50
50
|
function supabaseStatus(root) {
|
|
51
|
-
return
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}, (err, stdout) => err ? reject(new Error(err.message)) : resolve(stdout));
|
|
51
|
+
return exec("supabase", [
|
|
52
|
+
"status",
|
|
53
|
+
"-o",
|
|
54
|
+
"env"
|
|
55
|
+
], {
|
|
56
|
+
cwd: root,
|
|
57
|
+
timeout: 3e4
|
|
58
|
+
}).then(({ stdout }) => stdout, (err) => {
|
|
59
|
+
throw new Error(err.message);
|
|
61
60
|
});
|
|
62
61
|
}
|
|
63
62
|
/**
|
|
@@ -226,7 +225,7 @@ if (canAsk && resolution.tier === "development" && resolution.devDatabase === "l
|
|
|
226
225
|
}
|
|
227
226
|
if (start) {
|
|
228
227
|
if (await new Promise((done) => {
|
|
229
|
-
|
|
228
|
+
spawnProcess("pnpm", [
|
|
230
229
|
"devtools",
|
|
231
230
|
"db",
|
|
232
231
|
"start"
|
|
@@ -237,8 +236,7 @@ if (canAsk && resolution.tier === "development" && resolution.devDatabase === "l
|
|
|
237
236
|
DEPLOY_ENV: "development",
|
|
238
237
|
DEV_DB: "local"
|
|
239
238
|
},
|
|
240
|
-
stdio: "inherit"
|
|
241
|
-
shell: process.platform === "win32"
|
|
239
|
+
stdio: "inherit"
|
|
242
240
|
}).on("error", () => done(1)).on("exit", (exitCode) => done(exitCode ?? 1));
|
|
243
241
|
}) !== 0) {
|
|
244
242
|
console.error("with-env: `pnpm devtools db start` failed; see above.");
|
|
@@ -340,7 +338,7 @@ if (opts.worker !== void 0) {
|
|
|
340
338
|
env.WORKER_ENV_FILE = workerEnvFile.path;
|
|
341
339
|
for (let i = 0; i < args.length; i++) if (args[i] === "{env-file}") args[i] = workerEnvFile.path;
|
|
342
340
|
}
|
|
343
|
-
const child =
|
|
341
|
+
const child = spawnProcess(windows ? process.execPath : args[0], windows ? [
|
|
344
342
|
dotenvxCli(),
|
|
345
343
|
"run",
|
|
346
344
|
"--quiet",
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devdogsuga/devtools",
|
|
3
|
-
"version": "0.1.51-next.
|
|
3
|
+
"version": "0.1.51-next.545",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
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
|
|
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 devtools` in a product repo, `pnpm dlx @devdogsuga/devtools` (or the `devtools` bin once installed) from inside a clone.",
|
|
7
7
|
"license": "BSD-3-Clause",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
"@yarnpkg/fslib": "^3.1.5",
|
|
33
33
|
"@yarnpkg/shell": "^4.1.3",
|
|
34
34
|
"commander": "^14.0.3",
|
|
35
|
+
"cross-spawn": "^7.0.6",
|
|
35
36
|
"dotenv": "^17.4.2",
|
|
36
37
|
"postgres": "^3.4.9",
|
|
37
38
|
"tsx": "^4.23.12",
|
|
@@ -39,14 +40,15 @@
|
|
|
39
40
|
"zod": "4.4.3"
|
|
40
41
|
},
|
|
41
42
|
"devDependencies": {
|
|
43
|
+
"@types/cross-spawn": "^6.0.6",
|
|
42
44
|
"@types/node": "^26.2.0",
|
|
43
45
|
"@vitest/coverage-v8": "^4.1.11",
|
|
44
46
|
"eslint": "^9.39.5",
|
|
45
47
|
"tsdown": "^0.23.0",
|
|
46
48
|
"vitest": "^4.1.11",
|
|
49
|
+
"@devdogsuga/cli-core": "0.0.0",
|
|
47
50
|
"@devdogsuga/config": "0.1.4-next.526",
|
|
48
|
-
"@devdogsuga/sdk": "0.1.0"
|
|
49
|
-
"@devdogsuga/cli-core": "0.0.0"
|
|
51
|
+
"@devdogsuga/sdk": "0.1.0"
|
|
50
52
|
},
|
|
51
53
|
"scripts": {
|
|
52
54
|
"build": "tsdown && node scripts/write-build-info.mjs && node ../../scripts/check-bundle-imports.mjs",
|
package/dist/load-Czhayrsk.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { a as LocalStackOfflineError, c as applyDeployTierAliases, d as loadEnvironment, f as parseRawAssignments, i as LOCAL_STACK_PORT, l as applyWranglerLocalDatabaseAlias, m as selectEnvFiles, n as GENERATED_FILE, o as MissingEnvFileError, p as probeLocalStack, r as HYPERDRIVE_LOCAL_CONNECTION_ENV, s as SHELL_KEYS_ENV, t as DEV_DB_ENV, u as isDevDatabase } from "./load-Cp8AMERM.js";
|
|
2
|
-
export { DEV_DB_ENV, GENERATED_FILE, HYPERDRIVE_LOCAL_CONNECTION_ENV, LOCAL_STACK_PORT, LocalStackOfflineError, MissingEnvFileError, SHELL_KEYS_ENV, applyDeployTierAliases, applyWranglerLocalDatabaseAlias, isDevDatabase, loadEnvironment, parseRawAssignments, probeLocalStack, selectEnvFiles };
|
package/dist/stack-7qA2UP9g.js
DELETED