@devdogsuga/devtools 0.1.41 → 0.1.43
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 +18 -0
- package/dist/{cli-CeCAuSJd.js → cli-B_AiECh4.js} +190 -90
- package/dist/{failure-log-B5GG_8T1.js → failure-log-DOt6E3hS.js} +1 -1
- package/dist/launch.js +8 -8
- package/dist/{local-env-hH4encfD.js → local-env-BuHU5Ckd.js} +84 -23
- package/dist/local-env-MqH18s-N.js +2 -0
- package/dist/{menu-Craj11Sn.js → menu-DYQ-Dd-O.js} +15 -11
- package/dist/{peers-RBplwovA.js → peers-DvUH5VxX.js} +128 -3
- package/dist/{root-C2OmZDwD.js → root-CjPWNkBu.js} +12 -7
- package/dist/{stack-7PuRcaI2.js → stack-C_50FafG.js} +5 -5
- package/dist/stack-o1Kml3V0.js +2 -0
- package/dist/{supabase-project-Bw8sBFcE.js → supabase-project-C93xRFkN.js} +22 -14
- package/dist/{telemetry-Do13RFhc.js → telemetry-C07-ioHm.js} +139 -3
- package/dist/telemetry.js +1 -1
- package/env.ts +1 -1
- package/package.json +6 -5
- package/dist/local-env-CR3McKHZ.js +0 -2
- package/dist/stack-B5UHASY2.js +0 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as cliName, n as noteError } from "./failure-log-
|
|
2
|
-
import { a as ownVersion, n as discoverRepoRoot } from "./root-
|
|
1
|
+
import { a as cliName, n as noteError } from "./failure-log-DOt6E3hS.js";
|
|
2
|
+
import { a as ownVersion, n as discoverRepoRoot } from "./root-CjPWNkBu.js";
|
|
3
3
|
import { readFileSync } from "node:fs";
|
|
4
4
|
import * as Sentry from "@sentry/node";
|
|
5
|
-
import
|
|
5
|
+
import "@sentry/core";
|
|
6
6
|
//#region ../cli-core/src/mode.ts
|
|
7
7
|
/**
|
|
8
8
|
* Non-interactive mode: the one definition both published CLIs share.
|
|
@@ -75,6 +75,142 @@ function stripTierFlag(argv) {
|
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
77
|
//#endregion
|
|
78
|
+
//#region ../telemetry/dist/constants.js
|
|
79
|
+
/**
|
|
80
|
+
* `tracesSampleRate` by environment. Every environment not listed samples at
|
|
81
|
+
* 0 — that is the "else 0" branch, not an omission, and covers `development`,
|
|
82
|
+
* `ci`, and `local` today without needing an entry each.
|
|
83
|
+
*/
|
|
84
|
+
const TRACES_SAMPLE_RATE_BY_ENVIRONMENT = {
|
|
85
|
+
production: .2,
|
|
86
|
+
staging: .05
|
|
87
|
+
};
|
|
88
|
+
function tracesSampleRateFor(environment) {
|
|
89
|
+
return TRACES_SAMPLE_RATE_BY_ENVIRONMENT[environment] ?? 0;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Tag keys every surface should spell the same way, so a Sentry search for
|
|
93
|
+
* `service:platform` or `alert:true` works regardless of which app or
|
|
94
|
+
* package produced the event.
|
|
95
|
+
*/
|
|
96
|
+
const TAG_KEYS = {
|
|
97
|
+
/** Which of {@link SERVICES} produced the event. */
|
|
98
|
+
SERVICE: "service",
|
|
99
|
+
/** Set to `"true"` on every event sent through {@link alert}. */
|
|
100
|
+
ALERT: "alert"
|
|
101
|
+
};
|
|
102
|
+
//#endregion
|
|
103
|
+
//#region ../telemetry/dist/scrub.js
|
|
104
|
+
/**
|
|
105
|
+
* Pure scrubbing functions plus the `beforeSend` that composes them.
|
|
106
|
+
*
|
|
107
|
+
* Every function here operates on plain strings or a plain `Event` object —
|
|
108
|
+
* no Sentry client, no network, nothing that needs a DSN to unit-test.
|
|
109
|
+
*/
|
|
110
|
+
const POSIX_PATH = /(?<=^|[\s"'(<])\/(?:[^\s"'()<>:]+\/)+([^\s"'()<>:]+)/g;
|
|
111
|
+
const WINDOWS_PATH = /[A-Za-z]:\\(?:[^\s"'()<>]+\\)*([^\s"'()<>]+)/g;
|
|
112
|
+
/** Replaces absolute filesystem paths in `text` with just their basename. */
|
|
113
|
+
function scrubPaths(text) {
|
|
114
|
+
return text.replace(WINDOWS_PATH, "$1").replace(POSIX_PATH, "$1");
|
|
115
|
+
}
|
|
116
|
+
const EMAIL = /[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g;
|
|
117
|
+
/** Redacts anything that looks like an email address. */
|
|
118
|
+
function scrubEmails(text) {
|
|
119
|
+
return text.replace(EMAIL, "[redacted-email]");
|
|
120
|
+
}
|
|
121
|
+
const ENV_ASSIGNMENT = /\b([A-Z][A-Z0-9_]{2,}(?:_KEY|_TOKEN|_SECRET|_PASSWORD)\w*)=[^\s"'`)]+/g;
|
|
122
|
+
const BEARER_TOKEN = /\b[Bb]earer\s+[A-Za-z0-9._-]+/g;
|
|
123
|
+
/** Redacts env-var-style assignments and bearer tokens. */
|
|
124
|
+
function scrubSecrets(text) {
|
|
125
|
+
return text.replace(ENV_ASSIGNMENT, "$1=[redacted]").replace(BEARER_TOKEN, "Bearer [redacted]");
|
|
126
|
+
}
|
|
127
|
+
/** Runs all three text scrubbers, in order. */
|
|
128
|
+
function scrubText(text) {
|
|
129
|
+
return scrubSecrets(scrubEmails(scrubPaths(text)));
|
|
130
|
+
}
|
|
131
|
+
function scrubFrame(frame) {
|
|
132
|
+
return {
|
|
133
|
+
...frame,
|
|
134
|
+
filename: frame.filename ? scrubText(frame.filename) : frame.filename,
|
|
135
|
+
abs_path: frame.abs_path ? scrubText(frame.abs_path) : frame.abs_path,
|
|
136
|
+
context_line: frame.context_line ? scrubText(frame.context_line) : frame.context_line
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
function scrubException(exception) {
|
|
140
|
+
return {
|
|
141
|
+
...exception,
|
|
142
|
+
value: exception.value ? scrubText(exception.value) : exception.value,
|
|
143
|
+
stacktrace: exception.stacktrace ? {
|
|
144
|
+
...exception.stacktrace,
|
|
145
|
+
frames: exception.stacktrace.frames?.map(scrubFrame)
|
|
146
|
+
} : exception.stacktrace
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Applies every scrubber to the parts of an event that carry free text:
|
|
151
|
+
* the top-level message, each exception's message and stack frames, and
|
|
152
|
+
* breadcrumb messages. Never returns `null` — this is a scrub, not a filter;
|
|
153
|
+
* see {@link browserNoiseFilter} in `./browser-filter.ts` for dropping
|
|
154
|
+
* events outright.
|
|
155
|
+
*/
|
|
156
|
+
function scrubEvent(event, _hint) {
|
|
157
|
+
return {
|
|
158
|
+
...event,
|
|
159
|
+
message: event.message ? scrubText(event.message) : event.message,
|
|
160
|
+
exception: event.exception ? { values: event.exception.values?.map(scrubException) } : event.exception,
|
|
161
|
+
breadcrumbs: event.breadcrumbs?.map((crumb) => crumb.message ? {
|
|
162
|
+
...crumb,
|
|
163
|
+
message: scrubText(crumb.message)
|
|
164
|
+
} : crumb)
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
//#endregion
|
|
168
|
+
//#region ../telemetry/dist/options.js
|
|
169
|
+
/**
|
|
170
|
+
* Chains `beforeSend`-shaped functions left to right, short-circuiting the
|
|
171
|
+
* moment one drops the event. Used to compose the shared scrubbers with a
|
|
172
|
+
* consumer's own additions (e.g. {@link browserNoiseFilter} on the browser
|
|
173
|
+
* side only) without every consumer re-implementing the chaining.
|
|
174
|
+
*/
|
|
175
|
+
function composeBeforeSend(...fns) {
|
|
176
|
+
return (event, hint) => {
|
|
177
|
+
let current = event;
|
|
178
|
+
for (const fn of fns) {
|
|
179
|
+
if (current === null) return null;
|
|
180
|
+
current = fn(current, hint);
|
|
181
|
+
}
|
|
182
|
+
return current;
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* The options every `Sentry.init()` call in the workspace shares: DSN,
|
|
187
|
+
* environment, release passthrough, the sample-rate table, Sentry Logs, PII
|
|
188
|
+
* off by default, and the scrubbing `beforeSend` chain.
|
|
189
|
+
*
|
|
190
|
+
* Returns `undefined` when `dsn` is falsy, so every consumer can write
|
|
191
|
+
* `const opts = buildSentryOptions(...); if (opts) Sentry.init(opts);` and
|
|
192
|
+
* no-op cleanly with no DSN configured (the normal case in local dev).
|
|
193
|
+
*
|
|
194
|
+
* The return type is `@sentry/core`'s `Options` (`CoreOptions`) — the
|
|
195
|
+
* options shape shared by `@sentry/node`, `@sentry/cloudflare`, and
|
|
196
|
+
* `@sentry/nextjs`'s `init()` calls alike, so this same object is valid
|
|
197
|
+
* input to any of them.
|
|
198
|
+
*/
|
|
199
|
+
function buildSentryOptions({ service, environment, dsn, release, extraBeforeSend = [] }) {
|
|
200
|
+
if (!dsn) return void 0;
|
|
201
|
+
return {
|
|
202
|
+
dsn,
|
|
203
|
+
environment,
|
|
204
|
+
release,
|
|
205
|
+
tracesSampleRate: tracesSampleRateFor(environment),
|
|
206
|
+
sampleRate: 1,
|
|
207
|
+
enableLogs: true,
|
|
208
|
+
sendDefaultPii: false,
|
|
209
|
+
initialScope: { tags: { [TAG_KEYS.SERVICE]: service } },
|
|
210
|
+
beforeSend: composeBeforeSend(scrubEvent, ...extraBeforeSend)
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
//#endregion
|
|
78
214
|
//#region ../cli-core/src/telemetry.ts
|
|
79
215
|
/**
|
|
80
216
|
* devtools' own Sentry wiring — the CLI is a consumer of
|
package/dist/telemetry.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as hasRealCaller, c as reportDevtoolsError, i as devtoolsTelemetryEnabled, l as reportDevtoolsFailure, n as captureDevtoolsError, o as initDevtoolsTelemetry, r as devtoolsEnvironment, s as lastSentryEventId, t as captureDevtoolsDeprecation, u as resolveDevtoolsDsn } from "./telemetry-
|
|
1
|
+
import { a as hasRealCaller, c as reportDevtoolsError, i as devtoolsTelemetryEnabled, l as reportDevtoolsFailure, n as captureDevtoolsError, o as initDevtoolsTelemetry, r as devtoolsEnvironment, s as lastSentryEventId, t as captureDevtoolsDeprecation, u as resolveDevtoolsDsn } from "./telemetry-C07-ioHm.js";
|
|
2
2
|
export { captureDevtoolsDeprecation, captureDevtoolsError, devtoolsEnvironment, devtoolsTelemetryEnabled, hasRealCaller, initDevtoolsTelemetry, lastSentryEventId, reportDevtoolsError, reportDevtoolsFailure, resolveDevtoolsDsn };
|
package/env.ts
CHANGED
|
@@ -50,7 +50,7 @@ declare({
|
|
|
50
50
|
"A Supabase personal access token, carrying full account privileges " +
|
|
51
51
|
"across both Supabase organizations. Only `supabase config push` " +
|
|
52
52
|
"needs it -- the one mutation with no dry run -- so in GitHub it " +
|
|
53
|
-
"reaches the production
|
|
53
|
+
"reaches the production environment only, behind required " +
|
|
54
54
|
"reviewers.",
|
|
55
55
|
scope: "environment",
|
|
56
56
|
secrecy: "secret",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devdogsuga/devtools",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.43",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Contributor CLI for a DevDogsUGA checkout: the real tools with the session's tier filled in, a menu over them, and the checks CI runs. Ships built JS; run via `pnpm dlx @devdogsuga/devtools` (or the `devtools` bin once installed) from inside a DevDogsUGA clone.",
|
|
@@ -24,14 +24,14 @@
|
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@clack/prompts": "1.7.0",
|
|
27
|
+
"@sentry/core": "10.75.1",
|
|
27
28
|
"@sentry/node": "10.75.1",
|
|
28
29
|
"@supabase/supabase-js": "^2.112.3",
|
|
29
30
|
"dotenv": "^17.4.2",
|
|
30
31
|
"postgres": "^3.4.9",
|
|
31
32
|
"tsx": "^4.23.12",
|
|
32
33
|
"typescript": "^6.0.3",
|
|
33
|
-
"zod": "4.4.3"
|
|
34
|
-
"@devdogsuga/telemetry": "0.1.5"
|
|
34
|
+
"zod": "4.4.3"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"@devdogsuga/db": "*",
|
|
@@ -52,9 +52,10 @@
|
|
|
52
52
|
"tsdown": "^0.23.0",
|
|
53
53
|
"vitest": "^4.1.11",
|
|
54
54
|
"@devdogsuga/cli-core": "0.0.0",
|
|
55
|
+
"@devdogsuga/db": "0.1.5",
|
|
56
|
+
"@devdogsuga/telemetry": "0.1.5",
|
|
55
57
|
"@devdogsuga/config": "0.1.3",
|
|
56
|
-
"@devdogsuga/
|
|
57
|
-
"@devdogsuga/env": "0.1.6"
|
|
58
|
+
"@devdogsuga/env": "0.1.7"
|
|
58
59
|
},
|
|
59
60
|
"scripts": {
|
|
60
61
|
"build": "tsdown && node scripts/write-build-info.mjs && node ../../scripts/check-bundle-imports.mjs",
|
package/dist/stack-B5UHASY2.js
DELETED