react-doctor 0.9.12-dev.28a1a9f → 0.9.12-dev.3eda608
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 +27 -0
- package/dist/active-run-trace-dlIZeEvb.js +18 -0
- package/dist/active-scan-abort-registry-DwG6tSPy.js +28 -0
- package/dist/{build-section-divider-CdnczCsb.js → build-section-divider-I2zZDzJ9.js} +8 -22
- package/dist/{ci-CvrWkFyG.js → ci-DAWNYwqh.js} +12 -11
- package/dist/cli.js +76 -24
- package/dist/{design-C6QoD6j5.js → design-CT-fWB1q.js} +4 -4
- package/dist/{devtools-D8NTVj81.js → devtools-BiC-AP3B.js} +3 -3
- package/dist/{exit-gracefully-dQBRJxyW.js → exit-gracefully-BFTG5jEM.js} +15 -9
- package/dist/get-east-asian-width-Cglw13G7.js +444 -0
- package/dist/{report-error-DspMW6A2.js → handle-error-wVABvSAi.js} +6 -61
- package/dist/index.d.ts +32 -0
- package/dist/index.js +76 -2
- package/dist/{inspect-CEYHtLuK.js → inspect-BimAQ5xM.js} +16 -15
- package/dist/{install-BPQG8X-S.js → install-Oi0h_G7g.js} +9 -8
- package/dist/{install-doctor-script-BZJlaCgz.js → install-doctor-script-02_POH23.js} +6 -441
- package/dist/{install-github-workflow-DQIDvKig.js → install-github-workflow-CDDxuboB.js} +6 -6
- package/dist/{install-react-doctor-C3iiSm4r.js → install-react-doctor-CTsuBvs7.js} +8 -8
- package/dist/{run-scan-app-lYmDIiT4.js → jsx-runtime-KCzhtnA2.js} +280 -2774
- package/dist/{print-branded-header-B594Zejh.js → print-branded-header-Btnndqn7.js} +4 -4
- package/dist/prompt-runtime-scan-url-CkdYtR0M.js +240 -0
- package/dist/{read-object-file-CIVH-Cg-.js → read-object-file-DhRQQnN-.js} +4 -4
- package/dist/{record-metric-CFPfyOEW.js → record-metric-Bca1TzEP.js} +95 -8
- package/dist/report-error-89sVIL94.js +64 -0
- package/dist/{report-workflow-result-GxDOhexG.js → report-workflow-result-CA8lTeDk.js} +5 -5
- package/dist/{resolve-scope-CNV3HRNo.js → resolve-scope-poO8hFkD.js} +6 -6
- package/dist/{rules-C1Nt63By.js → rules-B16IRDyg.js} +6 -6
- package/dist/run-scan-app-NI3PasUA.js +2508 -0
- package/dist/runtime-scan/browser-probe.iife.js +855 -0
- package/dist/runtime-scan-B9Nytu3v.js +770 -0
- package/dist/sanitize-runtime-url-pzQIwyc8.js +76 -0
- package/dist/{scan-D-Y1Qifl.js → scan-DoM4T1ov.js} +10 -22
- package/dist/{should-fail-scan-gate-XdfNPXf9.js → should-fail-scan-gate-CFyk-8U3.js} +12 -111
- package/dist/{should-skip-prompts-DXyhnzjP.js → should-skip-prompts--6z1nvz1.js} +4 -4
- package/dist/should-use-tui-6f8qLHfp.js +25 -0
- package/dist/skills/improve-threejs/SKILL.md +102 -0
- package/dist/skills/performance/SKILL.md +113 -0
- package/dist/skills/react-doctor/SKILL.md +6 -0
- package/dist/{unref-stdin-CwYEtpri.js → telemetry-runtime-AGGMneW6.js} +5 -23
- package/dist/unref-stdin-BKT_s38a.js +12 -0
- package/dist/{version-tT7fsrFN.js → version-Nk1e-_N3.js} +4 -4
- package/dist/{why-4B0HPeQG.js → why-BujUNbke.js} +4 -4
- package/dist/with-run-span-Yaips-em.js +110 -0
- package/package.json +5 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
-
import {
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="39bd5097-8273-53c7-a179-61e3b9523977")}catch(e){}}();
|
|
3
|
+
import { An as gen, Kt as highlighter, Tn as log, _ as VERSION } from "./record-metric-Bca1TzEP.js";
|
|
4
4
|
//#region src/cli/utils/print-branded-header.ts
|
|
5
5
|
/**
|
|
6
6
|
* Single branded line every command prints first when not in JSON
|
|
@@ -18,5 +18,5 @@ const printBrandedHeader = gen(function* () {
|
|
|
18
18
|
//#endregion
|
|
19
19
|
export { printBrandedHeader as t };
|
|
20
20
|
|
|
21
|
-
//# sourceMappingURL=print-branded-header-
|
|
22
|
-
//# debugId=
|
|
21
|
+
//# sourceMappingURL=print-branded-header-Btnndqn7.js.map
|
|
22
|
+
//# debugId=39bd5097-8273-53c7-a179-61e3b9523977
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="a9b4b145-96c4-5a0c-8b5d-a2bc9a3acd51")}catch(e){}}();
|
|
3
|
+
import { t as unrefStdin } from "./unref-stdin-BKT_s38a.js";
|
|
4
|
+
import { a as RUNTIME_SCAN_LOCAL_DEV_PORTS, t as sanitizeRuntimeUrl, u as RUNTIME_SCAN_MAX_STRING_LENGTH } from "./sanitize-runtime-url-pzQIwyc8.js";
|
|
5
|
+
import { a as useExitOnCtrlC, c as Spinner, d as useInput, h as Box, i as import_react, m as Text, n as registerMountedTuiRenderer, o as terminalSymbols, p as render, r as useStdoutDimensions, s as isPrintableInput, t as require_jsx_runtime } from "./jsx-runtime-KCzhtnA2.js";
|
|
6
|
+
import * as http from "node:http";
|
|
7
|
+
//#region src/cli/runtime-scan/detect-local-runtime-urls.ts
|
|
8
|
+
const LOCAL_HTTP_HOSTS = ["127.0.0.1", "::1"];
|
|
9
|
+
const probeLocalHttpHost = (port, host) => new Promise((resolve) => {
|
|
10
|
+
let didResolve = false;
|
|
11
|
+
const resolveOnce = (isReachable) => {
|
|
12
|
+
if (didResolve) return;
|
|
13
|
+
didResolve = true;
|
|
14
|
+
resolve(isReachable);
|
|
15
|
+
};
|
|
16
|
+
const request = http.request({
|
|
17
|
+
agent: false,
|
|
18
|
+
host,
|
|
19
|
+
method: "HEAD",
|
|
20
|
+
path: "/",
|
|
21
|
+
port
|
|
22
|
+
}, (response) => {
|
|
23
|
+
response.resume();
|
|
24
|
+
resolveOnce(true);
|
|
25
|
+
});
|
|
26
|
+
request.setTimeout(300, () => request.destroy());
|
|
27
|
+
request.on("error", () => resolveOnce(false));
|
|
28
|
+
request.on("close", () => resolveOnce(false));
|
|
29
|
+
request.end();
|
|
30
|
+
});
|
|
31
|
+
const probeLocalHttpPort = async (port) => {
|
|
32
|
+
if (!(await Promise.all(LOCAL_HTTP_HOSTS.map((host) => probeLocalHttpHost(port, host)))).some(Boolean)) return null;
|
|
33
|
+
return {
|
|
34
|
+
port,
|
|
35
|
+
url: `http://localhost:${port}`
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
const detectLocalRuntimeUrls = async (ports = RUNTIME_SCAN_LOCAL_DEV_PORTS) => {
|
|
39
|
+
const probeResults = await Promise.all(ports.map(probeLocalHttpPort));
|
|
40
|
+
const suggestions = [];
|
|
41
|
+
for (const probeResult of probeResults) if (probeResult !== null) suggestions.push(probeResult);
|
|
42
|
+
return suggestions;
|
|
43
|
+
};
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region src/cli/ink/prompt-runtime-scan-url.tsx
|
|
46
|
+
var import_jsx_runtime = require_jsx_runtime();
|
|
47
|
+
const RuntimeScanUrlPrompt = ({ discoverLocalUrls = detectLocalRuntimeUrls, onSubmit }) => {
|
|
48
|
+
const [mode, setMode] = (0, import_react.useState)("select");
|
|
49
|
+
const [suggestions, setSuggestions] = (0, import_react.useState)([]);
|
|
50
|
+
const [isDetecting, setIsDetecting] = (0, import_react.useState)(true);
|
|
51
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react.useState)(0);
|
|
52
|
+
const [url, setUrl] = (0, import_react.useState)("");
|
|
53
|
+
const [validationMessage, setValidationMessage] = (0, import_react.useState)(null);
|
|
54
|
+
const { columns: terminalColumns, rows: terminalRows } = useStdoutDimensions();
|
|
55
|
+
useExitOnCtrlC();
|
|
56
|
+
(0, import_react.useEffect)(() => {
|
|
57
|
+
let isMounted = true;
|
|
58
|
+
discoverLocalUrls().then((detectedSuggestions) => {
|
|
59
|
+
if (!isMounted) return;
|
|
60
|
+
setSuggestions(detectedSuggestions);
|
|
61
|
+
setIsDetecting(false);
|
|
62
|
+
}, () => {
|
|
63
|
+
if (isMounted) setIsDetecting(false);
|
|
64
|
+
});
|
|
65
|
+
return () => {
|
|
66
|
+
isMounted = false;
|
|
67
|
+
};
|
|
68
|
+
}, [discoverLocalUrls]);
|
|
69
|
+
const updateUrl = (nextUrl) => {
|
|
70
|
+
setUrl(nextUrl.slice(0, RUNTIME_SCAN_MAX_STRING_LENGTH));
|
|
71
|
+
setValidationMessage(null);
|
|
72
|
+
};
|
|
73
|
+
useInput((input, key) => {
|
|
74
|
+
if (mode === "select") {
|
|
75
|
+
const optionCount = suggestions.length + 1;
|
|
76
|
+
if (key.escape || input === "q") return onSubmit(null);
|
|
77
|
+
if (key.upArrow || input === "k") return setSelectedIndex(Math.max(0, selectedIndex - 1));
|
|
78
|
+
if (key.downArrow || input === "j") return setSelectedIndex(Math.min(optionCount - 1, selectedIndex + 1));
|
|
79
|
+
if (key.return) {
|
|
80
|
+
const selectedSuggestion = suggestions[selectedIndex];
|
|
81
|
+
if (selectedSuggestion !== void 0) return onSubmit(selectedSuggestion.url);
|
|
82
|
+
setMode("custom");
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
if (isPrintableInput(input) && !key.ctrl && !key.meta) {
|
|
86
|
+
setMode("custom");
|
|
87
|
+
updateUrl(input);
|
|
88
|
+
}
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
if (key.escape) return setMode("select");
|
|
92
|
+
if (key.backspace || key.delete) return updateUrl(url.slice(0, -1));
|
|
93
|
+
if (key.ctrl && input === "u") return updateUrl("");
|
|
94
|
+
if (key.return) {
|
|
95
|
+
const trimmedUrl = url.trim();
|
|
96
|
+
try {
|
|
97
|
+
sanitizeRuntimeUrl(trimmedUrl);
|
|
98
|
+
onSubmit(trimmedUrl);
|
|
99
|
+
} catch {
|
|
100
|
+
setValidationMessage("Enter an absolute URL starting with http:// or https://.");
|
|
101
|
+
}
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
if (isPrintableInput(input) && !key.ctrl && !key.meta) updateUrl(url + input);
|
|
105
|
+
});
|
|
106
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
|
|
107
|
+
alignItems: "center",
|
|
108
|
+
height: terminalRows,
|
|
109
|
+
justifyContent: "center",
|
|
110
|
+
width: terminalColumns,
|
|
111
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, {
|
|
112
|
+
borderColor: "magenta",
|
|
113
|
+
borderStyle: "round",
|
|
114
|
+
flexDirection: "column",
|
|
115
|
+
paddingX: 1,
|
|
116
|
+
width: Math.min(terminalColumns, 72),
|
|
117
|
+
children: [
|
|
118
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
|
|
119
|
+
color: "magenta",
|
|
120
|
+
bold: true,
|
|
121
|
+
children: "React Doctor"
|
|
122
|
+
}),
|
|
123
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
|
|
124
|
+
bold: true,
|
|
125
|
+
children: "Choose an app to scan"
|
|
126
|
+
}),
|
|
127
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
|
|
128
|
+
dimColor: true,
|
|
129
|
+
children: "We’ll open Chrome and scan one interaction."
|
|
130
|
+
}),
|
|
131
|
+
mode === "select" ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, {
|
|
132
|
+
flexDirection: "column",
|
|
133
|
+
marginTop: 1,
|
|
134
|
+
children: [
|
|
135
|
+
isDetecting ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
|
|
136
|
+
dimColor: true,
|
|
137
|
+
children: [
|
|
138
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
|
|
139
|
+
color: "cyan",
|
|
140
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Spinner, { type: "dots" })
|
|
141
|
+
}),
|
|
142
|
+
" ",
|
|
143
|
+
"Looking for local apps…"
|
|
144
|
+
]
|
|
145
|
+
}) : null,
|
|
146
|
+
!isDetecting && suggestions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
|
|
147
|
+
dimColor: true,
|
|
148
|
+
children: "No local HTTP apps detected."
|
|
149
|
+
}) : null,
|
|
150
|
+
suggestions.map((suggestion, suggestionIndex) => {
|
|
151
|
+
const isSelected = suggestionIndex === selectedIndex;
|
|
152
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
|
|
153
|
+
bold: isSelected,
|
|
154
|
+
color: isSelected ? "cyan" : void 0,
|
|
155
|
+
children: [
|
|
156
|
+
isSelected ? terminalSymbols.pointer : terminalSymbols.pointerSmall,
|
|
157
|
+
" ",
|
|
158
|
+
suggestion.url,
|
|
159
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
|
|
160
|
+
dimColor: true,
|
|
161
|
+
children: " detected"
|
|
162
|
+
})
|
|
163
|
+
]
|
|
164
|
+
}, suggestion.url);
|
|
165
|
+
}),
|
|
166
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
|
|
167
|
+
bold: selectedIndex === suggestions.length,
|
|
168
|
+
color: selectedIndex === suggestions.length ? "cyan" : void 0,
|
|
169
|
+
children: [
|
|
170
|
+
selectedIndex === suggestions.length ? terminalSymbols.pointer : terminalSymbols.pointerSmall,
|
|
171
|
+
" ",
|
|
172
|
+
"Enter another URL"
|
|
173
|
+
]
|
|
174
|
+
}),
|
|
175
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
|
|
176
|
+
marginTop: 1,
|
|
177
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
|
|
178
|
+
dimColor: true,
|
|
179
|
+
children: "↑↓ choose · Enter continue · Esc cancel"
|
|
180
|
+
})
|
|
181
|
+
})
|
|
182
|
+
]
|
|
183
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, {
|
|
184
|
+
flexDirection: "column",
|
|
185
|
+
marginTop: 1,
|
|
186
|
+
children: [
|
|
187
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
|
|
188
|
+
dimColor: true,
|
|
189
|
+
children: "App URL"
|
|
190
|
+
}),
|
|
191
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
|
|
192
|
+
wrap: "truncate-end",
|
|
193
|
+
children: [
|
|
194
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
|
|
195
|
+
color: "cyan",
|
|
196
|
+
children: "› "
|
|
197
|
+
}),
|
|
198
|
+
url,
|
|
199
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
|
|
200
|
+
inverse: true,
|
|
201
|
+
children: " "
|
|
202
|
+
})
|
|
203
|
+
]
|
|
204
|
+
}),
|
|
205
|
+
validationMessage === null ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
|
|
206
|
+
color: "red",
|
|
207
|
+
children: validationMessage
|
|
208
|
+
}),
|
|
209
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
|
|
210
|
+
marginTop: 1,
|
|
211
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
|
|
212
|
+
dimColor: true,
|
|
213
|
+
children: "Enter continue · Esc back · Ctrl+U clear"
|
|
214
|
+
})
|
|
215
|
+
})
|
|
216
|
+
]
|
|
217
|
+
})
|
|
218
|
+
]
|
|
219
|
+
})
|
|
220
|
+
});
|
|
221
|
+
};
|
|
222
|
+
const promptRuntimeScanUrl = () => new Promise((resolve) => {
|
|
223
|
+
let disposeRenderer = () => {};
|
|
224
|
+
const submitUrl = (url) => {
|
|
225
|
+
disposeRenderer();
|
|
226
|
+
unrefStdin();
|
|
227
|
+
resolve(url);
|
|
228
|
+
};
|
|
229
|
+
disposeRenderer = registerMountedTuiRenderer(render(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(RuntimeScanUrlPrompt, { onSubmit: submitUrl }), {
|
|
230
|
+
alternateScreen: true,
|
|
231
|
+
exitOnCtrlC: false,
|
|
232
|
+
stdin: process.stdin,
|
|
233
|
+
stdout: process.stderr
|
|
234
|
+
}));
|
|
235
|
+
});
|
|
236
|
+
//#endregion
|
|
237
|
+
export { promptRuntimeScanUrl };
|
|
238
|
+
|
|
239
|
+
//# sourceMappingURL=prompt-runtime-scan-url-CkdYtR0M.js.map
|
|
240
|
+
//# debugId=a9b4b145-96c4-5a0c-8b5d-a2bc9a3acd51
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
-
import {
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="13731145-4398-5999-9681-9db70a3e1b43")}catch(e){}}();
|
|
3
|
+
import { Sr as isPlainObject } from "./record-metric-Bca1TzEP.js";
|
|
4
4
|
import * as fs$1 from "node:fs";
|
|
5
5
|
import { parseJSON5 } from "confbox";
|
|
6
6
|
//#region src/cli/utils/read-object-file.ts
|
|
@@ -20,5 +20,5 @@ const readObjectFile = (filePath) => {
|
|
|
20
20
|
//#endregion
|
|
21
21
|
export { readObjectFile as t };
|
|
22
22
|
|
|
23
|
-
//# sourceMappingURL=read-object-file-
|
|
24
|
-
//# debugId=
|
|
23
|
+
//# sourceMappingURL=read-object-file-DhRQQnN-.js.map
|
|
24
|
+
//# debugId=13731145-4398-5999-9681-9db70a3e1b43
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="6e77c176-cda8-521f-9fc7-5d6bd350a9d2")}catch(e){}}();
|
|
3
3
|
import { i as __toESM$1, r as __require, t as __commonJSMin$1 } from "./chunk-ChKA3wi6.js";
|
|
4
4
|
import { n as require_picomatch, t as require_semver } from "./semver-DFtnEmN-.js";
|
|
5
5
|
import { createRequire } from "node:module";
|
|
@@ -63691,6 +63691,18 @@ const detectPreES2023Target = (directory) => {
|
|
|
63691
63691
|
}
|
|
63692
63692
|
return false;
|
|
63693
63693
|
};
|
|
63694
|
+
const SHADCN_CONFIG_FILE_NAME = "components.json";
|
|
63695
|
+
const detectShadcnUi = (directory) => {
|
|
63696
|
+
if (isFile(path$1$1.join(directory, SHADCN_CONFIG_FILE_NAME))) return true;
|
|
63697
|
+
if (isProjectBoundary(directory)) return false;
|
|
63698
|
+
let ancestorDirectory = path$1$1.dirname(directory);
|
|
63699
|
+
while (ancestorDirectory !== path$1$1.dirname(ancestorDirectory)) {
|
|
63700
|
+
if (isFile(path$1$1.join(ancestorDirectory, SHADCN_CONFIG_FILE_NAME))) return true;
|
|
63701
|
+
if (isProjectBoundary(ancestorDirectory)) return false;
|
|
63702
|
+
ancestorDirectory = path$1$1.dirname(ancestorDirectory);
|
|
63703
|
+
}
|
|
63704
|
+
return false;
|
|
63705
|
+
};
|
|
63694
63706
|
const FRAMEWORK_PACKAGES = {
|
|
63695
63707
|
next: "nextjs",
|
|
63696
63708
|
"@tanstack/react-start": "tanstack-start",
|
|
@@ -64456,6 +64468,29 @@ const getTanStackQueryVersion = (packageJson) => {
|
|
|
64456
64468
|
packageNames: TANSTACK_REACT_QUERY_PACKAGES
|
|
64457
64469
|
});
|
|
64458
64470
|
};
|
|
64471
|
+
const hasAnyDependency = (packageJson, packageNames) => {
|
|
64472
|
+
const allDependencies = {
|
|
64473
|
+
...packageJson.peerDependencies,
|
|
64474
|
+
...packageJson.dependencies,
|
|
64475
|
+
...packageJson.devDependencies,
|
|
64476
|
+
...packageJson.optionalDependencies
|
|
64477
|
+
};
|
|
64478
|
+
return packageNames.some((packageName) => allDependencies[packageName] !== void 0);
|
|
64479
|
+
};
|
|
64480
|
+
const BASE_UI_PACKAGES = ["@base-ui-components/react", "@base-ui/react"];
|
|
64481
|
+
const hasBaseUiDependency = (packageJson) => hasAnyDependency(packageJson, BASE_UI_PACKAGES);
|
|
64482
|
+
const RADIX_UNIFIED_PACKAGE = "radix-ui";
|
|
64483
|
+
const RADIX_PRIMITIVE_PACKAGE_PREFIX = "@radix-ui/react-";
|
|
64484
|
+
const RADIX_NON_PRIMITIVE_PACKAGES = new Set(["@radix-ui/react-icons"]);
|
|
64485
|
+
const hasRadixUiDependency = (packageJson) => {
|
|
64486
|
+
const allDependencies = {
|
|
64487
|
+
...packageJson.peerDependencies,
|
|
64488
|
+
...packageJson.dependencies,
|
|
64489
|
+
...packageJson.devDependencies,
|
|
64490
|
+
...packageJson.optionalDependencies
|
|
64491
|
+
};
|
|
64492
|
+
return Object.keys(allDependencies).some((packageName) => packageName === RADIX_UNIFIED_PACKAGE || packageName.startsWith(RADIX_PRIMITIVE_PACKAGE_PREFIX) && !RADIX_NON_PRIMITIVE_PACKAGES.has(packageName));
|
|
64493
|
+
};
|
|
64459
64494
|
const STYLED_COMPONENTS_PACKAGES = ["styled-components"];
|
|
64460
64495
|
const getStyledComponentsVersion = (packageJson) => {
|
|
64461
64496
|
return getPreferredDependencyVersion({
|
|
@@ -64486,6 +64521,10 @@ const hasI18nDependency = (packageJson) => {
|
|
|
64486
64521
|
};
|
|
64487
64522
|
return I18N_PACKAGES.some((packageName) => allDependencies[packageName] !== void 0);
|
|
64488
64523
|
};
|
|
64524
|
+
const REACT_ARIA_COMPONENT_PACKAGES = ["react-aria-components"];
|
|
64525
|
+
const TANSTACK_TABLE_PACKAGES = ["@tanstack/react-table"];
|
|
64526
|
+
const TANSTACK_VIRTUAL_PACKAGES = ["@tanstack/react-virtual"];
|
|
64527
|
+
const TANSTACK_FORM_PACKAGES = ["@tanstack/react-form"];
|
|
64489
64528
|
const REANIMATED_DEPENDENCY_NAME = "react-native-reanimated";
|
|
64490
64529
|
const MOBX_REACT_PACKAGE_NAME = "mobx-react";
|
|
64491
64530
|
const MOBX_REACT_LITE_PACKAGE_NAME = "mobx-react-lite";
|
|
@@ -64676,6 +64715,13 @@ const evaluateManifestFacts = (facts, packageJson, directory, rootDirectory, roo
|
|
|
64676
64715
|
});
|
|
64677
64716
|
if (styledComponentsVersion && shouldReplaceStyledComponentsVersion(facts.styledComponentsVersion, styledComponentsVersion)) facts.styledComponentsVersion = styledComponentsVersion;
|
|
64678
64717
|
facts.hasI18nLibrary = facts.hasI18nLibrary || hasI18nDependency(packageJson);
|
|
64718
|
+
facts.hasShadcnUi = facts.hasShadcnUi || detectShadcnUi(directory);
|
|
64719
|
+
facts.hasRadixUi = facts.hasRadixUi || hasRadixUiDependency(packageJson);
|
|
64720
|
+
facts.hasBaseUi = facts.hasBaseUi || hasBaseUiDependency(packageJson);
|
|
64721
|
+
facts.hasReactAriaComponents = facts.hasReactAriaComponents || hasAnyDependency(packageJson, REACT_ARIA_COMPONENT_PACKAGES);
|
|
64722
|
+
facts.hasTanstackTable = facts.hasTanstackTable || hasAnyDependency(packageJson, TANSTACK_TABLE_PACKAGES);
|
|
64723
|
+
facts.hasTanstackVirtual = facts.hasTanstackVirtual || hasAnyDependency(packageJson, TANSTACK_VIRTUAL_PACKAGES);
|
|
64724
|
+
facts.hasTanstackForm = facts.hasTanstackForm || hasAnyDependency(packageJson, TANSTACK_FORM_PACKAGES);
|
|
64679
64725
|
for (const packageName of REACT_THREE_FIBER_DEPENDENCY_NAMES) {
|
|
64680
64726
|
const version = resolveCatalogBackedDependencyVersion({
|
|
64681
64727
|
rootDirectory,
|
|
@@ -64778,6 +64824,13 @@ const collectWorkspaceFacts = (rootDirectory, rootPackageJson, { collectReactGro
|
|
|
64778
64824
|
tanstackQueryVersion: null,
|
|
64779
64825
|
styledComponentsVersion: null,
|
|
64780
64826
|
hasI18nLibrary: false,
|
|
64827
|
+
hasShadcnUi: false,
|
|
64828
|
+
hasRadixUi: false,
|
|
64829
|
+
hasBaseUi: false,
|
|
64830
|
+
hasReactAriaComponents: false,
|
|
64831
|
+
hasTanstackTable: false,
|
|
64832
|
+
hasTanstackVirtual: false,
|
|
64833
|
+
hasTanstackForm: false,
|
|
64781
64834
|
hasReactNativeAwarePackage: false,
|
|
64782
64835
|
hasReanimatedAwarePackage: false,
|
|
64783
64836
|
hasSsrDependency: false,
|
|
@@ -65122,6 +65175,12 @@ const discoverProjectWithoutPackageJson = (directory, options) => {
|
|
|
65122
65175
|
remotionVersion: null,
|
|
65123
65176
|
remotionMajorVersion: null,
|
|
65124
65177
|
hasI18nLibrary: false,
|
|
65178
|
+
hasRadixUi: false,
|
|
65179
|
+
hasBaseUi: false,
|
|
65180
|
+
hasReactAriaComponents: false,
|
|
65181
|
+
hasTanstackTable: false,
|
|
65182
|
+
hasTanstackVirtual: false,
|
|
65183
|
+
hasTanstackForm: false,
|
|
65125
65184
|
tanstackQueryVersion: null,
|
|
65126
65185
|
styledComponentsVersion: null,
|
|
65127
65186
|
hasThree: false,
|
|
@@ -65143,6 +65202,7 @@ const discoverProjectWithoutPackageJson = (directory, options) => {
|
|
|
65143
65202
|
shopifyFlashListMajorVersion: null,
|
|
65144
65203
|
hasReanimated: false,
|
|
65145
65204
|
reanimatedVersion: null,
|
|
65205
|
+
hasShadcnUi: detectShadcnUi(directory),
|
|
65146
65206
|
isPreES2023Target: hasOwnTsConfig && detectPreES2023Target(directory),
|
|
65147
65207
|
isStaticExport: false,
|
|
65148
65208
|
sourceFileCount
|
|
@@ -65305,6 +65365,12 @@ const discoverProject = (directory, options = {}) => {
|
|
|
65305
65365
|
hasReactCompilerLintPlugin: detectReactCompilerLintPlugin(directory, packageJson),
|
|
65306
65366
|
hasTanStackQuery: tanstackQueryVersion !== null,
|
|
65307
65367
|
hasI18nLibrary: workspaceFacts.hasI18nLibrary,
|
|
65368
|
+
hasRadixUi: workspaceFacts.hasRadixUi,
|
|
65369
|
+
hasBaseUi: workspaceFacts.hasBaseUi,
|
|
65370
|
+
hasReactAriaComponents: workspaceFacts.hasReactAriaComponents,
|
|
65371
|
+
hasTanstackTable: workspaceFacts.hasTanstackTable,
|
|
65372
|
+
hasTanstackVirtual: workspaceFacts.hasTanstackVirtual,
|
|
65373
|
+
hasTanstackForm: workspaceFacts.hasTanstackForm,
|
|
65308
65374
|
tanstackQueryVersion,
|
|
65309
65375
|
styledComponentsVersion: workspaceFacts.styledComponentsVersion,
|
|
65310
65376
|
valtioVersion,
|
|
@@ -65331,6 +65397,7 @@ const discoverProject = (directory, options = {}) => {
|
|
|
65331
65397
|
shopifyFlashListMajorVersion: shopifyFlashListVersion === null ? null : getLowestDependencyMajor(shopifyFlashListVersion),
|
|
65332
65398
|
hasReanimated,
|
|
65333
65399
|
reanimatedVersion,
|
|
65400
|
+
hasShadcnUi: workspaceFacts.hasShadcnUi,
|
|
65334
65401
|
isPreES2023Target,
|
|
65335
65402
|
isStaticExport: framework === "nextjs" && detectNextjsStaticExport(workspaceFacts.next.sourceDirectory ?? directory),
|
|
65336
65403
|
sourceFileCount
|
|
@@ -69335,6 +69402,13 @@ const buildCapabilities = (project) => {
|
|
|
69335
69402
|
minor: 0
|
|
69336
69403
|
})) capabilities.add("tailwind:4");
|
|
69337
69404
|
}
|
|
69405
|
+
if (project.hasShadcnUi === true) capabilities.add("shadcn");
|
|
69406
|
+
if (project.hasRadixUi === true) capabilities.add("radix-ui");
|
|
69407
|
+
if (project.hasBaseUi === true) capabilities.add("base-ui");
|
|
69408
|
+
if (project.hasReactAriaComponents === true) capabilities.add("react-aria");
|
|
69409
|
+
if (project.hasTanstackTable === true) capabilities.add("tanstack-table");
|
|
69410
|
+
if (project.hasTanstackVirtual === true) capabilities.add("tanstack-virtual");
|
|
69411
|
+
if (project.hasTanstackForm === true) capabilities.add("tanstack-form");
|
|
69338
69412
|
if (project.zodVersion !== null) capabilities.add("zod");
|
|
69339
69413
|
if (project.zodMajorVersion !== null && project.zodMajorVersion >= 4) capabilities.add("zod:4");
|
|
69340
69414
|
if (project.mobxVersion !== void 0 && project.mobxVersion !== null || project.hasMobxReact === true || project.hasMobxReactLite === true || project.hasMobxStateTree === true || project.hasMobxReactObserver === true) capabilities.add("mobx");
|
|
@@ -76415,6 +76489,7 @@ const METRIC = {
|
|
|
76415
76489
|
ciConfigured: "ci.configured",
|
|
76416
76490
|
rulesChanged: "rules.changed",
|
|
76417
76491
|
rulesQueried: "rules.queried",
|
|
76492
|
+
runtimeScanUrlPromptShown: "runtime_scan.url_prompt_shown",
|
|
76418
76493
|
tuiCompactReportShown: "tui.compact_report_shown",
|
|
76419
76494
|
tuiFindingNavigated: "tui.finding_navigated",
|
|
76420
76495
|
tuiIssueStreamShown: "tui.issue_stream_shown",
|
|
@@ -76468,7 +76543,7 @@ const makeNoopConsole = () => ({
|
|
|
76468
76543
|
});
|
|
76469
76544
|
//#endregion
|
|
76470
76545
|
//#region src/cli/utils/version.ts
|
|
76471
|
-
const VERSION = "0.9.12-dev.
|
|
76546
|
+
const VERSION = "0.9.12-dev.3eda608";
|
|
76472
76547
|
//#endregion
|
|
76473
76548
|
//#region src/cli/utils/json-mode.ts
|
|
76474
76549
|
let context = null;
|
|
@@ -76506,13 +76581,14 @@ const installSilentConsole = () => {
|
|
|
76506
76581
|
"trace"
|
|
76507
76582
|
]) target[key] = source[key];
|
|
76508
76583
|
};
|
|
76509
|
-
const enableJsonMode = ({ compact, directory, outputFile }) => {
|
|
76584
|
+
const enableJsonMode = ({ compact, directory, outputFile, writeCancellationError }) => {
|
|
76510
76585
|
context = {
|
|
76511
76586
|
compact,
|
|
76512
76587
|
directory,
|
|
76513
76588
|
startTime: performance$1.now(),
|
|
76514
76589
|
mode: "full",
|
|
76515
|
-
outputFile: null
|
|
76590
|
+
outputFile: null,
|
|
76591
|
+
writeCancellationError
|
|
76516
76592
|
};
|
|
76517
76593
|
installSilentConsole();
|
|
76518
76594
|
if (outputFile) {
|
|
@@ -76551,6 +76627,13 @@ const writeJsonErrorReport = (error, sentryEventId) => {
|
|
|
76551
76627
|
process.stdout.write(INTERNAL_ERROR_JSON_FALLBACK);
|
|
76552
76628
|
}
|
|
76553
76629
|
};
|
|
76630
|
+
const writeJsonCancellationReport = () => {
|
|
76631
|
+
if (context?.writeCancellationError !== void 0) {
|
|
76632
|
+
context.writeCancellationError();
|
|
76633
|
+
return;
|
|
76634
|
+
}
|
|
76635
|
+
writeJsonErrorReport(/* @__PURE__ */ new Error("Scan cancelled by user (SIGINT/SIGTERM)"));
|
|
76636
|
+
};
|
|
76554
76637
|
//#endregion
|
|
76555
76638
|
//#region src/cli/utils/run-id.ts
|
|
76556
76639
|
let cachedRunId;
|
|
@@ -76559,10 +76642,14 @@ const getRunId = () => {
|
|
|
76559
76642
|
return cachedRunId;
|
|
76560
76643
|
};
|
|
76561
76644
|
//#endregion
|
|
76645
|
+
//#region src/cli/utils/scrub-run-arguments.ts
|
|
76646
|
+
const scrubRunArguments = (argumentsList) => anonymizeText(argumentsList.map((argument) => argument.replace(/^((?:--[^=]+=)?)(?:https?|wss?):\/\/.+$/i, "$1<url>")).join(" "));
|
|
76647
|
+
//#endregion
|
|
76562
76648
|
//#region src/cli/utils/build-run-context.ts
|
|
76563
76649
|
const ROOT_SUBCOMMANDS = new Set([
|
|
76564
76650
|
"design",
|
|
76565
76651
|
"install",
|
|
76652
|
+
"scan",
|
|
76566
76653
|
"setup"
|
|
76567
76654
|
]);
|
|
76568
76655
|
const detectInvokedVia = () => {
|
|
@@ -76603,7 +76690,7 @@ const buildRunContext = () => {
|
|
|
76603
76690
|
runId: getRunId(),
|
|
76604
76691
|
origin: detectOrigin(),
|
|
76605
76692
|
command: detectCommand(userArguments),
|
|
76606
|
-
argv:
|
|
76693
|
+
argv: scrubRunArguments(userArguments),
|
|
76607
76694
|
cwd: scrubSensitivePaths(process.cwd()),
|
|
76608
76695
|
node: process.version,
|
|
76609
76696
|
nodeMajor: detectNodeMajor(),
|
|
@@ -76798,7 +76885,7 @@ const recordDistribution = (name, value, options = {}) => {
|
|
|
76798
76885
|
} catch {}
|
|
76799
76886
|
};
|
|
76800
76887
|
//#endregion
|
|
76801
|
-
export {
|
|
76888
|
+
export { Linter as $, CANONICAL_DISCORD_URL as $n, layerObservability as $t, SCAN_RESULT_CACHE_FILENAME as A, gen as An, discoverSupportedSubprojects as At, isNonInteractiveEnvironment as B, sync as Bn, getDiffInfo as Bt, CI_TRUST_COMPANIES as C, error as Cn, messageFromUnknown as Cr, collectSourceFileCountsByDirectory as Ct, NANOSECONDS_PER_MILLISECOND as D, Diagnostic as Dn, createNodeReadFileLinesSync as Dt, MINIMUM_VTE_VERSION_FOR_HYPERLINKS as E, warn$1 as En, countOptInProjectRuleSelections as Et, STAGED_FILES_TEMP_DIR_PREFIX as F, provide as Fn, formatErrorChain as Ft, isCiEnvironment as G, provide$2 as Gn, hashFileContents as Gt, isDebugFlagEnabled as H, void_ as Hn, groupBy as Ht, STAGED_SNAPSHOT_ADDITIONAL_CONFIG_FILENAMES as I, provideContext as In, formatReactDoctorError as It, Config as J, makeUnsafe$5 as Jn, isPathInsideDirectory as Jt, isCiOrCodingAgentEnvironment as K, succeed$3 as Kn, highlighter as Kt, TUI_REPORT_COMPACT_MAX_ROWS as L, provideService as Ln, getBaselineDiffPlan as Lt, SENTRY_DSN as M, map$3 as Mn, filterPathsOutsideDirectories as Mt, SENTRY_FLUSH_TIMEOUT_MS as N, orElseSucceed as Nn, filterSourceFiles as Nt, REACT_DOCTOR_CONFIG_PROJECT_NAME as O, decodeUnknownSync as On, createOxlintSpawnSlots as Ot, SENTRY_RELEASE_PREFIX as P, promise as Pn, findLegacyConfig as Pt, LintPartialFailures as Q, AXIOM_DEFAULT_DOMAIN as Qn, isScanComplete as Qt, TUI_REPORT_DETAIL_WIDTH_FRACTION as R, runPromise as Rn, getChangedLineRanges as Rt, BASELINE_FILES_TEMP_DIR_PREFIX as S, Console as Sn, isPlainObject as Sr, clearConfigCache as St, METRIC as T, log as Tn, computeDiagnosticDelta as Tt, ACTION_INPUT_ENVIRONMENT_VARIABLES as U, buildWithScope as Un, hasPublishedFixRecipe as Ut, isGitHookEnvironment as V, try_ as Vn, getEquivalentRuleKeys as Vt, detectRunnerOs as W, mergeAll$1 as Wn, hasSupportedFrameworkOrLibrary as Wt, Git as X, void_$1 as Xn, isReactDoctorError as Xt, Files as Y, fail$5 as Yn, isProjectDiscoveryError as Yt, LEGACY_CONFIG_FILENAME as Z, ParentSpan as Zn, isSameRuleKey as Zt, VERSION as _, shouldUseMaintainabilityLayer as _n, STAGED_FILES_PROJECT_CONFIG_FILENAMES as _r, buildRuleSeverityControls as _t, isEnvFlagEnabled as a, materializeSourceTree as an, DIAGNOSTIC_CATEGORY_BUCKETS as ar, Progress as at, AXIOM_METRICS_DATASET as b, validateConfigTypes as bn, isErrnoException as br, canonicalizeUserRuleKey as bt, setSentryProjectInfo as c, resolveGithubActionsScoreMetadata as cn, GITHUB_ACTIONS_SETUP_URL as cr, Score as ct, isJsonModeActive as d, resolveScanConcurrency as dn, JSX_DUPLICATION_SOURCE_FILE_PATTERN as dr, SupplyChain as dt, listSourceFiles as en, CANONICAL_GITHUB_URL as er, Maintainability as et, setJsonReportDirectory as f, resolveScanTarget as fn, JSX_FILE_PATTERN as fr, anonymizeInPlace as ft, writeJsonReport as g, setColorEnabled as gn, SKILL_NAME as gr, buildRuleDocsUrl as gt, writeJsonErrorReport as h, scrubSensitivePaths as hn, SHARE_BASE_URL as hr, buildJsonReport as ht, isTelemetryEnabled as i, mapWithConcurrency as in, CONFIG_SCHEMA_URL as ir, PerFileLintCacheEnabled as it, SCAN_RESULT_CACHE_MAX_HASHED_FILE_SIZE_BYTES as j, makeSpan$1 as jn, filterDiagnosticsForSurface as jt, RUN_GIT_MAX_BUFFER_BYTES as k, make$30 as kn, detectAiTrainingEnvironment as kt, getRunId as l, resolveLintBatchOrdering as ln, GIT_SHOW_MAX_BUFFER_BYTES as lr, SidecarLintCacheEnabled as lt, writeJsonCancellationReport as m, runInspect as mn, OXLINT_NODE_REQUIREMENT as mr, atomicWriteJson as mt, recordDistribution as n, listWorkspacePackages as nn, COMPILER_CLEANUP_BUCKET as nr, OxlintConcurrency as nt, buildSentryScope as o, mergeReactDoctorConfigs as on, DOCS_URL as or, Project as ot, setJsonReportMode as p, restoreLegacyThrow as pn, MILLISECONDS_PER_SECOND as pr, anonymizeText as pt, isCodingAgentEnvironment as q, close as qn, isMonorepoRoot as qt, toSpanAttributes as r, loadConfigWithSource as rn, COMPILER_CLEANUP_RULE_KEYS as rr, OxlintSpawnSlots as rt, buildSentryProjectContext as s, remainingDeadlineBudgetMs as sn, ENTERPRISE_CONTACT_URL as sr, Reporter as st, recordCount as t, listSourceFilesCooperative as tn, CI_URL as tr, NodeResolver as tt, enableJsonMode as u, resolveReactDoctorCacheDir as un, HTML_FILE_PATTERN as ur, StagedFiles as ut, makeNoopConsole as v, summarizeDiagnostics as vn, getCategoryImpact as vr, buildSkippedChecks as vt, GH_DEFAULT_BRANCH_PROBE_TIMEOUT_MS as w, info as wn, toCanonicalPath as wr, computeConfigFingerprint as wt, AXIOM_TRACES_DATASET as x, yieldToEventLoop as xn, isFile as xr, classifyFileContext as xt, AXIOM_INGEST_TOKEN as y, toRelativePath as yn, isDirectory as yr, calculateScore as yt, CliInputError as z, runSync as zn, getDiagnosticRuleIdentity as zt };
|
|
76802
76889
|
|
|
76803
|
-
//# sourceMappingURL=record-metric-
|
|
76804
|
-
//# debugId=
|
|
76890
|
+
//# sourceMappingURL=record-metric-Bca1TzEP.js.map
|
|
76891
|
+
//# debugId=6e77c176-cda8-521f-9fc7-5d6bd350a9d2
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="2a1bf492-62ee-594f-ab9f-33aea0031ea6")}catch(e){}}();
|
|
3
|
+
import { N as SENTRY_FLUSH_TIMEOUT_MS, T as METRIC, Xt as isReactDoctorError, l as getRunId, o as buildSentryScope, t as recordCount } from "./record-metric-Bca1TzEP.js";
|
|
4
|
+
import { n as shutdownTelemetry, r as isExpectedUserError } from "./telemetry-runtime-AGGMneW6.js";
|
|
5
|
+
import { r as recordRunTraceId, t as getActiveRunTrace } from "./active-run-trace-dlIZeEvb.js";
|
|
6
|
+
import * as Sentry from "@sentry/node";
|
|
7
|
+
//#region src/cli/utils/report-error.ts
|
|
8
|
+
/**
|
|
9
|
+
* Sends an error to Sentry — enriched with a fresh snapshot of the current run
|
|
10
|
+
* (version, platform, CI/agent, invocation, scanned project) and, when a run
|
|
11
|
+
* transaction is in flight, linked to its trace via the scope's propagation
|
|
12
|
+
* context so the crash and its transaction share a `trace_id` — then waits for
|
|
13
|
+
* delivery before the caller exits. The CLI tears down synchronously after
|
|
14
|
+
* rendering an error, so the awaited `flush` is what actually gets the event
|
|
15
|
+
* (and any in-flight transaction) off the machine.
|
|
16
|
+
*
|
|
17
|
+
* Returns the Sentry event id so the caller can surface it as a reference the
|
|
18
|
+
* user can quote when reporting the bug; returns `undefined` when Sentry was
|
|
19
|
+
* never initialized (`--no-score`, tests, or a missing DSN) or delivery failed.
|
|
20
|
+
* Swallows any transport failure so telemetry can never mask the user's
|
|
21
|
+
* original error.
|
|
22
|
+
*/
|
|
23
|
+
const reportErrorToSentry = async (error) => {
|
|
24
|
+
if (!Sentry.isInitialized()) return void 0;
|
|
25
|
+
if (isExpectedUserError(error)) return void 0;
|
|
26
|
+
try {
|
|
27
|
+
const { tags, contexts } = buildSentryScope();
|
|
28
|
+
let reason = "unknown";
|
|
29
|
+
if (isReactDoctorError(error)) reason = error.reason._tag;
|
|
30
|
+
else if (error instanceof Error) reason = error.name;
|
|
31
|
+
recordCount(METRIC.cliError, 1, {
|
|
32
|
+
command: typeof tags.command === "string" ? tags.command : void 0,
|
|
33
|
+
reason
|
|
34
|
+
});
|
|
35
|
+
const runTrace = getActiveRunTrace();
|
|
36
|
+
const eventId = Sentry.withScope((scope) => {
|
|
37
|
+
for (const [name, context] of Object.entries(contexts)) scope.setContext(name, context);
|
|
38
|
+
scope.setTags(tags);
|
|
39
|
+
if (runTrace) {
|
|
40
|
+
scope.setContext("axiom", {
|
|
41
|
+
traceId: runTrace.traceId,
|
|
42
|
+
runId: getRunId()
|
|
43
|
+
});
|
|
44
|
+
scope.setPropagationContext({
|
|
45
|
+
traceId: runTrace.traceId,
|
|
46
|
+
parentSpanId: runTrace.spanId,
|
|
47
|
+
sampled: runTrace.sampled,
|
|
48
|
+
sampleRand: Math.random()
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
recordRunTraceId(scope.getPropagationContext().traceId);
|
|
52
|
+
return Sentry.captureException(error);
|
|
53
|
+
});
|
|
54
|
+
await Promise.all([Sentry.flush(SENTRY_FLUSH_TIMEOUT_MS), shutdownTelemetry()]);
|
|
55
|
+
return eventId;
|
|
56
|
+
} catch {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
//#endregion
|
|
61
|
+
export { reportErrorToSentry as t };
|
|
62
|
+
|
|
63
|
+
//# sourceMappingURL=report-error-89sVIL94.js.map
|
|
64
|
+
//# debugId=2a1bf492-62ee-594f-ab9f-33aea0031ea6
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
-
import {
|
|
4
|
-
import { u as isCommandAvailable } from "./install-github-workflow-
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="b40baba6-3bdf-5920-8f2b-4474aa1b0c8f")}catch(e){}}();
|
|
3
|
+
import { O as REACT_DOCTOR_CONFIG_PROJECT_NAME, T as METRIC, t as recordCount } from "./record-metric-Bca1TzEP.js";
|
|
4
|
+
import { u as isCommandAvailable } from "./install-github-workflow-CDDxuboB.js";
|
|
5
5
|
import { spawn } from "node:child_process";
|
|
6
6
|
import * as path$1 from "node:path";
|
|
7
7
|
import process$1 from "node:process";
|
|
@@ -275,5 +275,5 @@ const reportWorkflowResult = (workflowSpinner, result, projectRoot) => {
|
|
|
275
275
|
//#endregion
|
|
276
276
|
export { recordGate as a, ACTION_UPGRADE_EVENT as c, INSTALL_AGENTS_PREFERENCE_ID as d, ONBOARDING_EVENT as f, detectAvailableAgents as h, readPreference as i, CI_PITCH_EVENT as l, computeDefaultSelectedAgents as m, openUrl as n, runMigrations as o, SETUP_HINT_EVENT as p, isGatePending as r, writePreference as s, reportWorkflowResult as t, HANDOFF_TARGET_PREFERENCE_ID as u };
|
|
277
277
|
|
|
278
|
-
//# sourceMappingURL=report-workflow-result-
|
|
279
|
-
//# debugId=
|
|
278
|
+
//# sourceMappingURL=report-workflow-result-CA8lTeDk.js.map
|
|
279
|
+
//# debugId=b40baba6-3bdf-5920-8f2b-4474aa1b0c8f
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { d as detectDefaultBranch, f as runCommand, l as prompts, u as isCommandAvailable } from "./install-github-workflow-
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="0e60661e-d9e9-5e3b-8499-70c3b2492f60")}catch(e){}}();
|
|
3
|
+
import { Jt as isPathInsideDirectory, Nt as filterSourceFiles, wr as toCanonicalPath } from "./record-metric-Bca1TzEP.js";
|
|
4
|
+
import { N as cliLogger } from "./install-doctor-script-02_POH23.js";
|
|
5
|
+
import { d as detectDefaultBranch, f as runCommand, l as prompts, u as isCommandAvailable } from "./install-github-workflow-CDDxuboB.js";
|
|
6
6
|
import * as path$1 from "node:path";
|
|
7
7
|
//#region src/cli/utils/path-format.ts
|
|
8
8
|
const toForwardSlashes = (filePath) => filePath.replaceAll("\\", "/");
|
|
@@ -335,5 +335,5 @@ const finalizeScope = async ({ requested, diffInfo, skipPrompts, isQuiet }) => {
|
|
|
335
335
|
//#endregion
|
|
336
336
|
export { isValidBlockingLevel as a, openWorkflowPullRequest as c, warnDeprecatedDiff as i, stageWorkflowFile as l, isScopeValue as n, pickBlockingLevel as o, resolveScope as r, resolveBlockingLevel as s, finalizeScope as t, toForwardSlashes as u };
|
|
337
337
|
|
|
338
|
-
//# sourceMappingURL=resolve-scope-
|
|
339
|
-
//# debugId=
|
|
338
|
+
//# sourceMappingURL=resolve-scope-poO8hFkD.js.map
|
|
339
|
+
//# debugId=0e60661e-d9e9-5e3b-8499-70c3b2492f60
|