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,76 @@
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]="b4527e97-9810-523f-85e3-f830b2a6da0f")}catch(e){}}();
3
+ import { z as CliInputError } from "./record-metric-u8youmM2.js";
4
+ //#region src/cli/runtime-scan/constants.ts
5
+ const RUNTIME_SCAN_MAX_COMPONENT_EVENTS = 2e3;
6
+ const RUNTIME_SCAN_MAX_SNAPSHOT_PAYLOAD_BYTES = 5 * 1024 * 1024;
7
+ const RUNTIME_SCAN_MAX_SNAPSHOT_BYTES = RUNTIME_SCAN_MAX_SNAPSHOT_PAYLOAD_BYTES - 64 * 1024;
8
+ Math.floor(RUNTIME_SCAN_MAX_SNAPSHOT_BYTES / 3);
9
+ const RUNTIME_SCAN_MAX_TRACE_BYTES = 512 * 1024 * 1024;
10
+ const RUNTIME_SCAN_MAX_STRING_LENGTH = 4096;
11
+ const RUNTIME_SCAN_LAYOUT_THRASH_RATIO = .25;
12
+ const RUNTIME_SCAN_MAX_RECORDING_DURATION_MS = 300 * 1e3;
13
+ const RUNTIME_SCAN_SNAPSHOT_TIMEOUT_MS = 1e4;
14
+ const RUNTIME_SCAN_LOCAL_DEV_PORTS = [
15
+ 1234,
16
+ ...Array.from({ length: 11 }, (_unusedValue, portOffset) => 3e3 + portOffset),
17
+ ...Array.from({ length: 11 }, (_unusedValue, portOffset) => 4e3 + portOffset),
18
+ 4173,
19
+ 4200,
20
+ 4321,
21
+ ...Array.from({ length: 11 }, (_unusedValue, portOffset) => 5e3 + portOffset),
22
+ ...Array.from({ length: 11 }, (_unusedValue, portOffset) => 5173 + portOffset),
23
+ ...Array.from({ length: 11 }, (_unusedValue, portOffset) => 8e3 + portOffset),
24
+ ...Array.from({ length: 11 }, (_unusedValue, portOffset) => 8080 + portOffset),
25
+ 8888
26
+ ];
27
+ const RUNTIME_SCAN_BROWSER_WIDTH_PX = 1440;
28
+ const RUNTIME_SCAN_TRACE_FILE_EXTENSION = ".json.gz";
29
+ const RUNTIME_SCAN_TRACING_COMPLETE_TIMEOUT_MS = 1e4;
30
+ const RUNTIME_SCAN_PROBE_RELATIVE_PATH = "runtime-scan/browser-probe.iife.js";
31
+ const RUNTIME_SCAN_PROBE_SNAPSHOT_BINDING_NAME_PLACEHOLDER = "__REACT_DOCTOR_RUNTIME_SCAN_CAPTURE__";
32
+ const RUNTIME_SCAN_PROBE_SNAPSHOT_ATTRIBUTE_NAME_PLACEHOLDER = "data-react-doctor-runtime-scan-snapshot";
33
+ const RUNTIME_SCAN_PROBE_SNAPSHOT_TOKEN_PLACEHOLDER = "__REACT_DOCTOR_RUNTIME_SCAN_TOKEN__";
34
+ const RUNTIME_SCAN_SAFE_CDP_PAGE_URLS = [
35
+ "about:blank",
36
+ "chrome://newtab/",
37
+ "chrome://new-tab-page/"
38
+ ];
39
+ const RUNTIME_SCAN_CONTROL_CHARACTERS_PATTERN = /[\u0000-\u001f\u007f-\u009f]/g;
40
+ const RUNTIME_SCAN_TRACE_CATEGORIES = [
41
+ "-*",
42
+ "blink.console",
43
+ "blink.user_timing",
44
+ "devtools.timeline",
45
+ "disabled-by-default-devtools.timeline",
46
+ "disabled-by-default-devtools.timeline.invalidationTracking",
47
+ "disabled-by-default-devtools.timeline.frame",
48
+ "disabled-by-default-devtools.timeline.stack",
49
+ "disabled-by-default-v8.cpu_profiler",
50
+ "disabled-by-default-v8.cpu_profiler.hires",
51
+ "latencyInfo",
52
+ "loading",
53
+ "v8",
54
+ "v8.execute"
55
+ ];
56
+ //#endregion
57
+ //#region src/cli/runtime-scan/sanitize-runtime-url.ts
58
+ const sanitizeRuntimeUrl = (rawUrl) => {
59
+ let parsedUrl;
60
+ try {
61
+ parsedUrl = new URL(rawUrl);
62
+ } catch {
63
+ throw new CliInputError(`Expected an absolute http(s) URL, received "${rawUrl}".`);
64
+ }
65
+ if (parsedUrl.protocol !== "http:" && parsedUrl.protocol !== "https:") throw new CliInputError(`Expected an http(s) URL, received "${parsedUrl.protocol}".`);
66
+ parsedUrl.username = "";
67
+ parsedUrl.password = "";
68
+ parsedUrl.search = "";
69
+ parsedUrl.hash = "";
70
+ return parsedUrl.href;
71
+ };
72
+ //#endregion
73
+ export { RUNTIME_SCAN_SNAPSHOT_TIMEOUT_MS as _, RUNTIME_SCAN_LOCAL_DEV_PORTS as a, RUNTIME_SCAN_TRACING_COMPLETE_TIMEOUT_MS as b, RUNTIME_SCAN_MAX_SNAPSHOT_BYTES as c, RUNTIME_SCAN_MAX_TRACE_BYTES as d, RUNTIME_SCAN_PROBE_RELATIVE_PATH as f, RUNTIME_SCAN_SAFE_CDP_PAGE_URLS as g, RUNTIME_SCAN_PROBE_SNAPSHOT_TOKEN_PLACEHOLDER as h, RUNTIME_SCAN_LAYOUT_THRASH_RATIO as i, RUNTIME_SCAN_MAX_SNAPSHOT_PAYLOAD_BYTES as l, RUNTIME_SCAN_PROBE_SNAPSHOT_BINDING_NAME_PLACEHOLDER as m, RUNTIME_SCAN_BROWSER_WIDTH_PX as n, RUNTIME_SCAN_MAX_COMPONENT_EVENTS as o, RUNTIME_SCAN_PROBE_SNAPSHOT_ATTRIBUTE_NAME_PLACEHOLDER as p, RUNTIME_SCAN_CONTROL_CHARACTERS_PATTERN as r, RUNTIME_SCAN_MAX_RECORDING_DURATION_MS as s, sanitizeRuntimeUrl as t, RUNTIME_SCAN_MAX_STRING_LENGTH as u, RUNTIME_SCAN_TRACE_CATEGORIES as v, RUNTIME_SCAN_TRACE_FILE_EXTENSION as y };
74
+
75
+ //# sourceMappingURL=sanitize-runtime-url-crVHbQlW.js.map
76
+ //# debugId=b4527e97-9810-523f-85e3-f830b2a6da0f
@@ -0,0 +1,47 @@
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]="b175018f-1367-55cb-96f8-2d078eb1c348")}catch(e){}}();
3
+ import { T as METRIC, fn as resolveScanTarget, t as recordCount } from "./record-metric-u8youmM2.js";
4
+ import { i as warnDeprecatedDiff } from "./resolve-scope-CHCpJtks.js";
5
+ import { a as validateModeFlags, r as validateFilePathSelectionFlags, v as resolveCliInspectOptions } from "./should-fail-scan-gate-Cw6KeoRT.js";
6
+ import { n as warnDeprecatedFailOn, r as runProjectMigrations, t as inspectAction } from "./inspect-BIfnzKGq.js";
7
+ import { n as shouldUseTui, r as resolveTuiEnvironment } from "./should-use-tui-S9255AG_.js";
8
+ import path from "node:path";
9
+ //#region src/cli/commands/scan.ts
10
+ const runScanCommand = async (input) => {
11
+ if (input.flags.cache === false) process.env.REACT_DOCTOR_NO_CACHE = "1";
12
+ if (input.filePaths !== void 0) validateFilePathSelectionFlags(input.flags);
13
+ const tuiEnvironment = {
14
+ flags: input.flags,
15
+ ...resolveTuiEnvironment()
16
+ };
17
+ if (input.filePaths !== void 0) {
18
+ await inspectAction(input.directory, input.flags, input.invocationCommand, input.filePaths);
19
+ return;
20
+ }
21
+ if (!shouldUseTui(tuiEnvironment)) {
22
+ await inspectAction(input.directory, input.flags, input.invocationCommand);
23
+ return;
24
+ }
25
+ await runProjectMigrations(path.resolve(input.directory));
26
+ const scanTarget = await resolveScanTarget(input.directory, { allowAmbiguous: true });
27
+ validateModeFlags(input.flags);
28
+ warnDeprecatedFailOn(input.flags, scanTarget.userConfig);
29
+ warnDeprecatedDiff(input.flags, scanTarget.userConfig);
30
+ recordCount(METRIC.cliInvoked, 1, { command: input.invocationCommand });
31
+ const { runScanApp } = await import("./run-scan-app-yTBDucJ3.js");
32
+ const { shouldFail } = await runScanApp({
33
+ directory: input.directory,
34
+ scanTarget,
35
+ options: resolveCliInspectOptions(input.flags, null),
36
+ projectFlag: input.flags.project,
37
+ skipPrompts: input.flags.yes ?? false,
38
+ blocking: input.flags.blocking ?? input.flags.failOn,
39
+ flags: input.flags
40
+ });
41
+ if (shouldFail) process.exitCode = 1;
42
+ };
43
+ //#endregion
44
+ export { runScanCommand };
45
+
46
+ //# sourceMappingURL=scan-CNSRWEtJ.js.map
47
+ //# debugId=b175018f-1367-55cb-96f8-2d078eb1c348