react-doctor 0.9.12 → 0.9.13-dev.fd23edc

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.
Files changed (52) hide show
  1. package/README.md +34 -1
  2. package/bin/react-doctor.js +1 -9
  3. package/dist/active-run-trace-dlIZeEvb.js +18 -0
  4. package/dist/active-scan-abort-registry-DwG6tSPy.js +28 -0
  5. package/dist/{build-section-divider-BsQvH-7I.js → build-section-divider-CUtO-gXD.js} +10 -25
  6. package/dist/{ci-B4x4RjKD.js → ci-DjilJaw4.js} +13 -12
  7. package/dist/cli.js +121 -41
  8. package/dist/{design-A48PNCf_.js → design-CXLKbARh.js} +4 -4
  9. package/dist/{devtools-DPRVRu3S.js → devtools-CC2PAZ85.js} +4 -4
  10. package/dist/{exit-gracefully-Bk531kS-.js → exit-gracefully-DTLgxZZ5.js} +15 -9
  11. package/dist/get-east-asian-width-Bv2TD3Xj.js +444 -0
  12. package/dist/{report-error-Pb2uO8EG.js → handle-error-BqaqFvmc.js} +18 -68
  13. package/dist/index.d.ts +53 -42
  14. package/dist/index.js +55119 -54689
  15. package/dist/{inspect-CwH84aSA.js → inspect-BIfnzKGq.js} +44 -33
  16. package/dist/{install-doctor-script-DLayXS7q.js → install-doctor-script-B1U08lUD.js} +7 -449
  17. package/dist/{install-github-workflow-Goz-KFqb.js → install-github-workflow-CkOl0wCn.js} +10 -6
  18. package/dist/{install-sFN_w425.js → install-nhJ65X-y.js} +9 -8
  19. package/dist/{install-react-doctor-Bq7dfEBI.js → install-react-doctor-Dm35Egex.js} +47 -45
  20. package/dist/{run-scan-app-DXBMW54J.js → jsx-runtime-C1t3eR6p.js} +281 -2759
  21. package/dist/path-format-DnHpmJwG.js +9 -0
  22. package/dist/{print-branded-header-D_J8Qdsj.js → print-branded-header-qOJiGkuW.js} +4 -4
  23. package/dist/project-analysis-worker.d.ts +1 -0
  24. package/dist/project-analysis-worker.js +51901 -0
  25. package/dist/prompt-runtime-scan-url-m88LMtMP.js +240 -0
  26. package/dist/{read-object-file-Hk79zI91.js → read-object-file-Cv41FpZo.js} +4 -4
  27. package/dist/{record-metric-CsQXJewH.js → record-metric-u8youmM2.js} +3257 -6019
  28. package/dist/report-error-CkFgxJTQ.js +64 -0
  29. package/dist/{report-workflow-result-6n_wSqzA.js → report-workflow-result-Wh1SQuOu.js} +5 -5
  30. package/dist/{resolve-scope-DP6rYlNO.js → resolve-scope-CHCpJtks.js} +8 -10
  31. package/dist/{rules-BnIZ4Fq_.js → rules-C30QFptP.js} +6 -6
  32. package/dist/run-scan-app-yTBDucJ3.js +2511 -0
  33. package/dist/runtime-scan/browser-probe.iife.js +855 -0
  34. package/dist/runtime-scan-VH25Yf8H.js +770 -0
  35. package/dist/sanitize-runtime-url-crVHbQlW.js +76 -0
  36. package/dist/scan-CNSRWEtJ.js +47 -0
  37. package/dist/semver-DFtnEmN-.js +3219 -0
  38. package/dist/{should-fail-scan-gate-DzZuTxim.js → should-fail-scan-gate-Cw6KeoRT.js} +160 -184
  39. package/dist/{should-skip-prompts-D1GWG2qN.js → should-skip-prompts-B5zkkkKR.js} +4 -4
  40. package/dist/should-use-tui-S9255AG_.js +25 -0
  41. package/dist/skills/improve-threejs/SKILL.md +102 -0
  42. package/dist/skills/performance/SKILL.md +113 -0
  43. package/dist/skills/react-doctor/SKILL.md +6 -0
  44. package/dist/{unref-stdin-0a_0uwC6.js → telemetry-runtime-B2rpGWMl.js} +57 -33
  45. package/dist/unref-stdin-SK3WfwxS.js +12 -0
  46. package/dist/{version-Bo5QDp7F.js → version-KQbGQSGN.js} +4 -4
  47. package/dist/{why-BFYbtnm8.js → why-B-l2qTCV.js} +4 -4
  48. package/dist/with-run-span-Dk1M8cnH.js +110 -0
  49. package/package.json +9 -10
  50. package/dist/chunk-q7NCDQ7-.js +0 -28
  51. package/dist/lsp.js +0 -81145
  52. package/dist/scan-CnnXz78m.js +0 -53
@@ -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]="e1796673-35c6-524e-8a7c-4e2d431c5a18")}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-u8youmM2.js";
4
+ import { n as shutdownTelemetry, r as isExpectedUserError } from "./telemetry-runtime-B2rpGWMl.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-CkFgxJTQ.js.map
64
+ //# debugId=e1796673-35c6-524e-8a7c-4e2d431c5a18
@@ -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]="6a18efb9-8d5d-57ab-ad74-c7e1a3e26f98")}catch(e){}}();
3
- import { D as REACT_DOCTOR_CONFIG_PROJECT_NAME, t as recordCount, w as METRIC } from "./record-metric-CsQXJewH.js";
4
- import { u as isCommandAvailable } from "./install-github-workflow-Goz-KFqb.js";
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]="dab94c07-c930-5e26-bd14-ab67fced3dd1")}catch(e){}}();
3
+ import { O as REACT_DOCTOR_CONFIG_PROJECT_NAME, T as METRIC, t as recordCount } from "./record-metric-u8youmM2.js";
4
+ import { u as isCommandAvailable } from "./install-github-workflow-CkOl0wCn.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-6n_wSqzA.js.map
279
- //# debugId=6a18efb9-8d5d-57ab-ad74-c7e1a3e26f98
278
+ //# sourceMappingURL=report-workflow-result-Wh1SQuOu.js.map
279
+ //# debugId=dab94c07-c930-5e26-bd14-ab67fced3dd1
@@ -1,12 +1,10 @@
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]="91bae93d-e0d4-5d73-b045-c007c70bccc8")}catch(e){}}();
3
- import { Jt as filterSourceFiles, Rn as toCanonicalPath, pn as isPathInsideDirectory } from "./record-metric-CsQXJewH.js";
4
- import { L as cliLogger } from "./install-doctor-script-DLayXS7q.js";
5
- import { d as detectDefaultBranch, f as runCommand, l as prompts, u as isCommandAvailable } from "./install-github-workflow-Goz-KFqb.js";
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]="7f1513de-80f8-540d-b2ba-70a625935795")}catch(e){}}();
3
+ import { Jt as isPathInsideDirectory, Nt as filterSourceFiles, wr as toCanonicalPath } from "./record-metric-u8youmM2.js";
4
+ import { t as toForwardSlashes } from "./path-format-DnHpmJwG.js";
5
+ import { M as cliLogger } from "./install-doctor-script-B1U08lUD.js";
6
+ import { d as detectDefaultBranch, f as runCommand, l as prompts, u as isCommandAvailable } from "./install-github-workflow-CkOl0wCn.js";
6
7
  import * as path$1 from "node:path";
7
- //#region src/cli/utils/path-format.ts
8
- const toForwardSlashes = (filePath) => filePath.replaceAll("\\", "/");
9
- //#endregion
10
8
  //#region src/cli/utils/open-workflow-pull-request.ts
11
9
  const NEW_BRANCH_PREFIX = "react-doctor/add-github-actions";
12
10
  const DEFAULT_COMMIT_MESSAGE = "ci: add React Doctor GitHub Actions workflow";
@@ -333,7 +331,7 @@ const finalizeScope = async ({ requested, diffInfo, skipPrompts, isQuiet }) => {
333
331
  return scanScope === "changed" ? "changed" : "full";
334
332
  };
335
333
  //#endregion
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 };
334
+ 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 };
337
335
 
338
- //# sourceMappingURL=resolve-scope-DP6rYlNO.js.map
339
- //# debugId=91bae93d-e0d4-5d73-b045-c007c70bccc8
336
+ //# sourceMappingURL=resolve-scope-CHCpJtks.js.map
337
+ //# debugId=7f1513de-80f8-540d-b2ba-70a625935795
@@ -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]="469d8db8-2134-57b0-92b2-b50a27d964b9")}catch(e){}}();
3
- import { Bn as validateConfigTypes, Pt as buildRuleDocsUrl, Q as COMPILER_CLEANUP_RULE_KEYS, Rt as clearConfigCache, Sn as loadConfigWithSource, Z as COMPILER_CLEANUP_BUCKET, _n as isSameRuleKey, cn as highlighter, mn as isPlainObject, rn as getEquivalentRuleKeys, t as recordCount, w as METRIC } from "./record-metric-CsQXJewH.js";
4
- import { L as cliLogger, n as findNearestPackageDirectory } from "./install-doctor-script-DLayXS7q.js";
5
- import { t as readObjectFile } from "./read-object-file-Hk79zI91.js";
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]="2180e238-8b72-5638-8135-c7e5f2e3a6dc")}catch(e){}}();
3
+ import { Kt as highlighter, Sr as isPlainObject, St as clearConfigCache, T as METRIC, Vt as getEquivalentRuleKeys, Zt as isSameRuleKey, bn as validateConfigTypes, gt as buildRuleDocsUrl, nr as COMPILER_CLEANUP_BUCKET, rn as loadConfigWithSource, rr as COMPILER_CLEANUP_RULE_KEYS, t as recordCount } from "./record-metric-u8youmM2.js";
4
+ import { M as cliLogger, n as findNearestPackageDirectory } from "./install-doctor-script-B1U08lUD.js";
5
+ import { t as readObjectFile } from "./read-object-file-Cv41FpZo.js";
6
6
  import * as path$1 from "node:path";
7
7
  import * as fs$1 from "node:fs";
8
8
  import { REACT_DOCTOR_RULES } from "oxlint-plugin-react-doctor/core";
@@ -577,5 +577,5 @@ const rulesUnignoreTagAction = async (tag, options) => {
577
577
  //#endregion
578
578
  export { rulesCategoryAction, rulesDisableAction, rulesEnableAction, rulesExplainAction, rulesIgnoreTagAction, rulesListAction, rulesSetAction, rulesUnignoreTagAction };
579
579
 
580
- //# sourceMappingURL=rules-BnIZ4Fq_.js.map
581
- //# debugId=469d8db8-2134-57b0-92b2-b50a27d964b9
580
+ //# sourceMappingURL=rules-C30QFptP.js.map
581
+ //# debugId=2180e238-8b72-5638-8135-c7e5f2e3a6dc