react-doctor 0.9.12-dev.ffc2d14 → 0.9.13-dev.d030b11
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 +33 -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-BuOtLrzK.js → build-section-divider-Dhl7C8kp.js} +8 -22
- package/dist/{ci-DVVsf25h.js → ci-CPJtbXo4.js} +12 -11
- package/dist/cli.js +116 -35
- package/dist/{design-Y1pcA2uj.js → design-CI6oM-NB.js} +4 -4
- package/dist/{devtools-D8NTVj81.js → devtools-CC2PAZ85.js} +3 -3
- package/dist/{exit-gracefully-DnXGONjj.js → exit-gracefully-Zhbpfy2i.js} +15 -9
- package/dist/get-east-asian-width-Bv2TD3Xj.js +444 -0
- package/dist/{report-error-MGKyeIns.js → handle-error-LYTGcmFr.js} +18 -68
- package/dist/index.d.ts +32 -0
- package/dist/index.js +593 -286
- package/dist/{inspect-g3_lzs3l.js → inspect-BZ-i49rK.js} +38 -28
- package/dist/{install-02Lq6wKC.js → install-Cf-tjrbB.js} +9 -8
- package/dist/{install-doctor-script-DmEWQpVJ.js → install-doctor-script-BGdm_niA.js} +7 -449
- package/dist/{install-github-workflow-Dx6Pl9Wl.js → install-github-workflow-CwcDLQCy.js} +10 -6
- package/dist/{install-react-doctor-CMCXgenA.js → install-react-doctor-DcJ90NzQ.js} +8 -8
- package/dist/{run-scan-app-CDDu7P32.js → jsx-runtime-Cq-_Fvkx.js} +280 -2774
- package/dist/path-format-DnHpmJwG.js +9 -0
- package/dist/{print-branded-header-kbvWYuGv.js → print-branded-header-DM0JRJnn.js} +4 -4
- package/dist/project-analysis-worker.js +59 -54
- package/dist/prompt-runtime-scan-url-BpHApg0d.js +240 -0
- package/dist/{read-object-file-Cwhr9OIi.js → read-object-file-DMUSluLA.js} +4 -4
- package/dist/{record-metric-CFfsgcVs.js → record-metric-BRc98SXW.js} +556 -235
- package/dist/report-error-BpWTkd5U.js +64 -0
- package/dist/{report-workflow-result-DGg9xopH.js → report-workflow-result-DXSpYstq.js} +5 -5
- package/dist/{resolve-scope-CXS-5jLR.js → resolve-scope-CJXv5ePP.js} +8 -10
- package/dist/{rules-CThlosPx.js → rules-CZk5ywQe.js} +6 -6
- package/dist/run-scan-app-BtY0jXpd.js +2511 -0
- package/dist/runtime-scan/browser-probe.iife.js +855 -0
- package/dist/runtime-scan-iztAEKV3.js +770 -0
- package/dist/sanitize-runtime-url-DbrHDuC1.js +76 -0
- package/dist/scan-GPvogJT-.js +47 -0
- package/dist/{should-fail-scan-gate-C0Bo5Gqy.js → should-fail-scan-gate-Uk7rJiMQ.js} +20 -112
- package/dist/{should-skip-prompts-BqrtVX4G.js → should-skip-prompts-DzpvkZcL.js} +4 -4
- package/dist/should-use-tui-CH5oI2Vu.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-BxyvqsOy.js → telemetry-runtime-hAsPFFEx.js} +55 -25
- package/dist/unref-stdin-SK3WfwxS.js +12 -0
- package/dist/{version-S-8vvWFi.js → version-BiWDQQgs.js} +4 -4
- package/dist/{why-DXfx0oL9.js → why-B8sLOroq.js} +4 -4
- package/dist/with-run-span-BWmpgEhA.js +110 -0
- package/package.json +9 -6
- package/dist/scan-4I1mvxBO.js +0 -53
|
@@ -1,15 +1,16 @@
|
|
|
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 { i as __toESM
|
|
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]="208a3329-9d08-5c10-9870-09285c73ceb9")}catch(e){}}();
|
|
3
|
+
import { i as __toESM, r as __require, t as __commonJSMin } 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";
|
|
6
6
|
import * as NodeChildProcess from "node:child_process";
|
|
7
7
|
import { execFile, execFileSync, spawn, spawnSync } from "node:child_process";
|
|
8
8
|
import * as path$1$1 from "node:path";
|
|
9
|
-
import path from "node:path";
|
|
9
|
+
import path, { join, posix } from "node:path";
|
|
10
10
|
import * as fs$1$3 from "node:fs";
|
|
11
|
-
import fs from "node:fs";
|
|
11
|
+
import fs, { existsSync } from "node:fs";
|
|
12
12
|
import ts from "typescript";
|
|
13
|
+
import { parseSync } from "oxc-parser";
|
|
13
14
|
import { ALL_REACT_DOCTOR_RULE_KEYS, CROSS_FILE_DEPENDENCY_COLLECTORS, CROSS_FILE_RULE_IDS, FRAMEWORK_SPECIFIC_RULE_KEYS, FRAMEWORK_TOKENS, MOTION_LIBRARY_PACKAGES, REACT_COMPILER_RULES, REACT_DOCTOR_OPT_IN_PROJECT_RULE_IDS, REACT_DOCTOR_PROJECT_RULES, REACT_DOCTOR_RULES, REACT_DOCTOR_RULE_REGISTRY, REACT_DOCTOR_SCAN_RULES, classifySecurityScanFile, collectCrossFileDependencyProbes, resetManifestCaches, shouldReadSecurityScanContent } from "oxlint-plugin-react-doctor/core";
|
|
14
15
|
import * as Crypto from "node:crypto";
|
|
15
16
|
import crypto, { createHash, randomUUID } from "node:crypto";
|
|
@@ -19,15 +20,15 @@ import { fileURLToPath } from "node:url";
|
|
|
19
20
|
import * as OS from "node:os";
|
|
20
21
|
import os from "node:os";
|
|
21
22
|
import { createJiti } from "jiti";
|
|
22
|
-
import { parseJSON5 } from "confbox";
|
|
23
|
+
import { parseJSON5, parseJSONC } from "confbox";
|
|
23
24
|
import * as fs$1 from "node:fs/promises";
|
|
24
25
|
import { PassThrough } from "node:stream";
|
|
25
26
|
import { convertToTSX } from "@astrojs/compiler/sync";
|
|
26
27
|
import { STATUS_CODES } from "node:http";
|
|
27
28
|
import { gzipSync } from "node:zlib";
|
|
28
29
|
import { performance as performance$1 } from "node:perf_hooks";
|
|
29
|
-
//#region ../core/dist/collect-unplugin-auto-import-global-scopes-
|
|
30
|
-
var import_picomatch = /* @__PURE__ */ __toESM
|
|
30
|
+
//#region ../core/dist/collect-unplugin-auto-import-global-scopes-Dwzr_czq.js
|
|
31
|
+
var import_picomatch = /* @__PURE__ */ __toESM(require_picomatch(), 1);
|
|
31
32
|
const HTML_FILE_PATTERN = /\.html$/i;
|
|
32
33
|
const SOURCE_FILE_PATTERN = /\.(?:astro|tsx?|jsx?|mts|mjs|[hH][tT][mM][lL])$/;
|
|
33
34
|
const GENERATED_BUNDLE_FILE_PATTERN = /\.(iife|umd|global|min)\.m?js$/i;
|
|
@@ -311,6 +312,7 @@ const ES_TARGET_YEAR_BY_NAME = {
|
|
|
311
312
|
* compiler options — the root config first, then a monorepo base config.
|
|
312
313
|
*/
|
|
313
314
|
const TSCONFIG_FILENAMES = ["tsconfig.json", "tsconfig.base.json"];
|
|
315
|
+
const DISABLE_DIRECTIVE_BACKUP_DIRECTORY_SEGMENTS = [".react-doctor", "audit-backups"];
|
|
314
316
|
/**
|
|
315
317
|
* Project-config files that `StagedFiles.materialize` copies into
|
|
316
318
|
* the temp directory alongside staged sources so oxlint resolves
|
|
@@ -570,6 +572,74 @@ const compileGlobPatternsLenient = (patterns, onInvalid) => {
|
|
|
570
572
|
}
|
|
571
573
|
return compiled;
|
|
572
574
|
};
|
|
575
|
+
const isOxcAstNode = (value) => Boolean(value) && typeof value === "object" && typeof value.type === "string";
|
|
576
|
+
const getStaticModuleSpecifier = (value) => {
|
|
577
|
+
if (!isOxcAstNode(value)) return void 0;
|
|
578
|
+
if (typeof value.value === "string") return value.value;
|
|
579
|
+
if (value.type === "TemplateLiteral" && Array.isArray(value.expressions) && value.expressions.length === 0 && Array.isArray(value.quasis) && isOxcAstNode(value.quasis[0]) && value.quasis[0].value && typeof value.quasis[0].value === "object" && "cooked" in value.quasis[0].value && typeof value.quasis[0].value.cooked === "string") return value.quasis[0].value.cooked;
|
|
580
|
+
};
|
|
581
|
+
const collectStaticModuleSpecifiers = (sourceText, options = {}) => {
|
|
582
|
+
const { filePath = "module.tsx", includeTypeOnly = true } = options;
|
|
583
|
+
const parsedModule = parseSync(filePath, sourceText, { sourceType: "unambiguous" });
|
|
584
|
+
const moduleSpecifiers = /* @__PURE__ */ new Set();
|
|
585
|
+
const addSpecifier = (value) => {
|
|
586
|
+
const moduleSpecifier = getStaticModuleSpecifier(value);
|
|
587
|
+
if (moduleSpecifier) moduleSpecifiers.add(moduleSpecifier);
|
|
588
|
+
};
|
|
589
|
+
const visitNode = (value) => {
|
|
590
|
+
if (Array.isArray(value)) {
|
|
591
|
+
for (const child of value) visitNode(child);
|
|
592
|
+
return;
|
|
593
|
+
}
|
|
594
|
+
if (!isOxcAstNode(value)) return;
|
|
595
|
+
if (value.type === "ImportDeclaration") {
|
|
596
|
+
const specifiers = Array.isArray(value.specifiers) ? value.specifiers : [];
|
|
597
|
+
const hasRuntimeSpecifier = specifiers.some((specifier) => !isOxcAstNode(specifier) || specifier.importKind !== "type");
|
|
598
|
+
if (includeTypeOnly || value.importKind !== "type" && (specifiers.length === 0 || hasRuntimeSpecifier)) addSpecifier(value.source);
|
|
599
|
+
} else if (value.type === "ExportNamedDeclaration") {
|
|
600
|
+
const specifiers = Array.isArray(value.specifiers) ? value.specifiers : [];
|
|
601
|
+
const hasRuntimeSpecifier = specifiers.some((specifier) => !isOxcAstNode(specifier) || specifier.exportKind !== "type");
|
|
602
|
+
if (includeTypeOnly || value.exportKind !== "type" && (specifiers.length === 0 || hasRuntimeSpecifier)) addSpecifier(value.source);
|
|
603
|
+
} else if (value.type === "ExportAllDeclaration" || value.type === "ImportExpression") {
|
|
604
|
+
if (includeTypeOnly || value.exportKind !== "type") addSpecifier(value.source);
|
|
605
|
+
} else if (value.type === "TSImportType") {
|
|
606
|
+
if (includeTypeOnly) addSpecifier(value.source);
|
|
607
|
+
} else if (value.type === "TSExternalModuleReference") addSpecifier(value.expression);
|
|
608
|
+
else if (value.type === "CallExpression" && isOxcAstNode(value.callee) && value.callee.type === "Identifier" && value.callee.name === "require" && Array.isArray(value.arguments) && value.arguments.length > 0) addSpecifier(value.arguments[0]);
|
|
609
|
+
for (const child of Object.values(value)) visitNode(child);
|
|
610
|
+
};
|
|
611
|
+
visitNode(parsedModule.program);
|
|
612
|
+
return moduleSpecifiers;
|
|
613
|
+
};
|
|
614
|
+
const toPosixPath = (filePath) => filePath.replace(/\\/g, "/");
|
|
615
|
+
const isPathInsideDirectoryOrEqual = (candidatePath, directoryPath) => {
|
|
616
|
+
const normalizedCandidatePath = posix.normalize(toPosixPath(candidatePath));
|
|
617
|
+
const normalizedDirectoryPath = posix.normalize(toPosixPath(directoryPath));
|
|
618
|
+
const relativePath = posix.relative(normalizedDirectoryPath, normalizedCandidatePath);
|
|
619
|
+
return relativePath === "" || relativePath !== ".." && !relativePath.startsWith("../") && !posix.isAbsolute(relativePath);
|
|
620
|
+
};
|
|
621
|
+
const RESOLVABLE_EXTENSIONS = [
|
|
622
|
+
".ts",
|
|
623
|
+
".tsx",
|
|
624
|
+
".js",
|
|
625
|
+
".jsx",
|
|
626
|
+
".mjs",
|
|
627
|
+
".mts",
|
|
628
|
+
".cjs",
|
|
629
|
+
".cts",
|
|
630
|
+
".es6"
|
|
631
|
+
];
|
|
632
|
+
const resolveEntryWithExtensions = (basePath) => {
|
|
633
|
+
if (existsSync(basePath)) return basePath;
|
|
634
|
+
for (const extension of RESOLVABLE_EXTENSIONS) {
|
|
635
|
+
const withExtension = basePath + extension;
|
|
636
|
+
if (existsSync(withExtension)) return withExtension;
|
|
637
|
+
}
|
|
638
|
+
for (const extension of RESOLVABLE_EXTENSIONS) {
|
|
639
|
+
const indexCandidate = join(basePath, `index${extension}`);
|
|
640
|
+
if (existsSync(indexCandidate)) return indexCandidate;
|
|
641
|
+
}
|
|
642
|
+
};
|
|
573
643
|
/**
|
|
574
644
|
* Resolves a path to its canonical, symlink-free form, falling back to
|
|
575
645
|
* the input when it cannot be realpath'd (broken symlink, permission
|
|
@@ -22136,7 +22206,7 @@ Union([
|
|
|
22136
22206
|
]);
|
|
22137
22207
|
//#endregion
|
|
22138
22208
|
//#region ../../node_modules/.pnpm/baseline-browser-mapping@2.9.19/node_modules/baseline-browser-mapping/dist/index.cjs
|
|
22139
|
-
var require_dist = /* @__PURE__ */ __commonJSMin
|
|
22209
|
+
var require_dist = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
22140
22210
|
const s = {
|
|
22141
22211
|
chrome: { releases: [
|
|
22142
22212
|
[
|
|
@@ -41386,7 +41456,7 @@ var require_dist = /* @__PURE__ */ __commonJSMin$1(((exports) => {
|
|
|
41386
41456
|
}));
|
|
41387
41457
|
//#endregion
|
|
41388
41458
|
//#region ../../node_modules/.pnpm/node-releases@2.0.27/node_modules/node-releases/data/processed/envs.json
|
|
41389
|
-
var require_envs = /* @__PURE__ */ __commonJSMin
|
|
41459
|
+
var require_envs = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
41390
41460
|
module.exports = [
|
|
41391
41461
|
{
|
|
41392
41462
|
"name": "nodejs",
|
|
@@ -44168,7 +44238,7 @@ var require_envs = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
|
44168
44238
|
}));
|
|
44169
44239
|
//#endregion
|
|
44170
44240
|
//#region ../../node_modules/.pnpm/caniuse-lite@1.0.30001769/node_modules/caniuse-lite/data/browsers.js
|
|
44171
|
-
var require_browsers$1 = /* @__PURE__ */ __commonJSMin
|
|
44241
|
+
var require_browsers$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
44172
44242
|
module.exports = {
|
|
44173
44243
|
A: "ie",
|
|
44174
44244
|
B: "edge",
|
|
@@ -44193,12 +44263,12 @@ var require_browsers$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
|
44193
44263
|
}));
|
|
44194
44264
|
//#endregion
|
|
44195
44265
|
//#region ../../node_modules/.pnpm/caniuse-lite@1.0.30001769/node_modules/caniuse-lite/dist/unpacker/browsers.js
|
|
44196
|
-
var require_browsers = /* @__PURE__ */ __commonJSMin
|
|
44266
|
+
var require_browsers = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
44197
44267
|
module.exports.browsers = require_browsers$1();
|
|
44198
44268
|
}));
|
|
44199
44269
|
//#endregion
|
|
44200
44270
|
//#region ../../node_modules/.pnpm/caniuse-lite@1.0.30001769/node_modules/caniuse-lite/data/browserVersions.js
|
|
44201
|
-
var require_browserVersions$1 = /* @__PURE__ */ __commonJSMin
|
|
44271
|
+
var require_browserVersions$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
44202
44272
|
module.exports = {
|
|
44203
44273
|
"0": "117",
|
|
44204
44274
|
"1": "118",
|
|
@@ -44450,12 +44520,12 @@ var require_browserVersions$1 = /* @__PURE__ */ __commonJSMin$1(((exports, modul
|
|
|
44450
44520
|
}));
|
|
44451
44521
|
//#endregion
|
|
44452
44522
|
//#region ../../node_modules/.pnpm/caniuse-lite@1.0.30001769/node_modules/caniuse-lite/dist/unpacker/browserVersions.js
|
|
44453
|
-
var require_browserVersions = /* @__PURE__ */ __commonJSMin
|
|
44523
|
+
var require_browserVersions = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
44454
44524
|
module.exports.browserVersions = require_browserVersions$1();
|
|
44455
44525
|
}));
|
|
44456
44526
|
//#endregion
|
|
44457
44527
|
//#region ../../node_modules/.pnpm/caniuse-lite@1.0.30001769/node_modules/caniuse-lite/data/agents.js
|
|
44458
|
-
var require_agents$1 = /* @__PURE__ */ __commonJSMin
|
|
44528
|
+
var require_agents$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
44459
44529
|
module.exports = {
|
|
44460
44530
|
A: {
|
|
44461
44531
|
A: {
|
|
@@ -48824,7 +48894,7 @@ var require_agents$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
|
48824
48894
|
}));
|
|
48825
48895
|
//#endregion
|
|
48826
48896
|
//#region ../../node_modules/.pnpm/caniuse-lite@1.0.30001769/node_modules/caniuse-lite/dist/unpacker/agents.js
|
|
48827
|
-
var require_agents = /* @__PURE__ */ __commonJSMin
|
|
48897
|
+
var require_agents = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
48828
48898
|
const browsers = require_browsers().browsers;
|
|
48829
48899
|
const versions = require_browserVersions().browserVersions;
|
|
48830
48900
|
const agentsData = require_agents$1();
|
|
@@ -48857,7 +48927,7 @@ var require_agents = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
|
48857
48927
|
}));
|
|
48858
48928
|
//#endregion
|
|
48859
48929
|
//#region ../../node_modules/.pnpm/electron-to-chromium@1.5.286/node_modules/electron-to-chromium/versions.js
|
|
48860
|
-
var require_versions = /* @__PURE__ */ __commonJSMin
|
|
48930
|
+
var require_versions = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
48861
48931
|
module.exports = {
|
|
48862
48932
|
"0.20": "39",
|
|
48863
48933
|
"0.21": "41",
|
|
@@ -49091,7 +49161,7 @@ var require_versions = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
|
49091
49161
|
}));
|
|
49092
49162
|
//#endregion
|
|
49093
49163
|
//#region ../../node_modules/.pnpm/node-releases@2.0.27/node_modules/node-releases/data/release-schedule/release-schedule.json
|
|
49094
|
-
var require_release_schedule = /* @__PURE__ */ __commonJSMin
|
|
49164
|
+
var require_release_schedule = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
49095
49165
|
module.exports = {
|
|
49096
49166
|
"v0.8": {
|
|
49097
49167
|
"start": "2012-06-25",
|
|
@@ -49248,7 +49318,7 @@ var require_release_schedule = /* @__PURE__ */ __commonJSMin$1(((exports, module
|
|
|
49248
49318
|
}));
|
|
49249
49319
|
//#endregion
|
|
49250
49320
|
//#region ../../node_modules/.pnpm/browserslist@4.28.1/node_modules/browserslist/error.js
|
|
49251
|
-
var require_error = /* @__PURE__ */ __commonJSMin
|
|
49321
|
+
var require_error = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
49252
49322
|
function BrowserslistError(message) {
|
|
49253
49323
|
this.name = "BrowserslistError";
|
|
49254
49324
|
this.message = message;
|
|
@@ -49260,7 +49330,7 @@ var require_error = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
|
49260
49330
|
}));
|
|
49261
49331
|
//#endregion
|
|
49262
49332
|
//#region ../../node_modules/.pnpm/caniuse-lite@1.0.30001769/node_modules/caniuse-lite/dist/lib/statuses.js
|
|
49263
|
-
var require_statuses = /* @__PURE__ */ __commonJSMin
|
|
49333
|
+
var require_statuses = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
49264
49334
|
module.exports = {
|
|
49265
49335
|
1: "ls",
|
|
49266
49336
|
2: "rec",
|
|
@@ -49273,7 +49343,7 @@ var require_statuses = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
|
49273
49343
|
}));
|
|
49274
49344
|
//#endregion
|
|
49275
49345
|
//#region ../../node_modules/.pnpm/caniuse-lite@1.0.30001769/node_modules/caniuse-lite/dist/lib/supported.js
|
|
49276
|
-
var require_supported = /* @__PURE__ */ __commonJSMin
|
|
49346
|
+
var require_supported = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
49277
49347
|
module.exports = {
|
|
49278
49348
|
y: 1,
|
|
49279
49349
|
n: 2,
|
|
@@ -49286,7 +49356,7 @@ var require_supported = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
|
49286
49356
|
}));
|
|
49287
49357
|
//#endregion
|
|
49288
49358
|
//#region ../../node_modules/.pnpm/caniuse-lite@1.0.30001769/node_modules/caniuse-lite/dist/unpacker/feature.js
|
|
49289
|
-
var require_feature = /* @__PURE__ */ __commonJSMin
|
|
49359
|
+
var require_feature = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
49290
49360
|
const statuses = require_statuses();
|
|
49291
49361
|
const supported = require_supported();
|
|
49292
49362
|
const browsers = require_browsers().browsers;
|
|
@@ -49329,7 +49399,7 @@ var require_feature = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
|
49329
49399
|
}));
|
|
49330
49400
|
//#endregion
|
|
49331
49401
|
//#region ../../node_modules/.pnpm/caniuse-lite@1.0.30001769/node_modules/caniuse-lite/dist/unpacker/region.js
|
|
49332
|
-
var require_region = /* @__PURE__ */ __commonJSMin
|
|
49402
|
+
var require_region = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
49333
49403
|
const browsers = require_browsers().browsers;
|
|
49334
49404
|
function unpackRegion(packed) {
|
|
49335
49405
|
return Object.keys(packed).reduce((list, browser) => {
|
|
@@ -49348,7 +49418,7 @@ var require_region = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
|
49348
49418
|
}));
|
|
49349
49419
|
//#endregion
|
|
49350
49420
|
//#region ../../node_modules/.pnpm/browserslist@4.28.1/node_modules/browserslist/node.js
|
|
49351
|
-
var require_node = /* @__PURE__ */ __commonJSMin
|
|
49421
|
+
var require_node = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
49352
49422
|
var feature = require_feature().default;
|
|
49353
49423
|
var region = require_region().default;
|
|
49354
49424
|
var fs$2 = __require("fs");
|
|
@@ -49641,7 +49711,7 @@ var require_node = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
|
49641
49711
|
}));
|
|
49642
49712
|
//#endregion
|
|
49643
49713
|
//#region ../../node_modules/.pnpm/browserslist@4.28.1/node_modules/browserslist/parse.js
|
|
49644
|
-
var require_parse = /* @__PURE__ */ __commonJSMin
|
|
49714
|
+
var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
49645
49715
|
var AND_REGEXP = /^\s+and\s+(.*)/i;
|
|
49646
49716
|
var OR_REGEXP = /^(?:,\s*|\s+or\s+)(.*)/i;
|
|
49647
49717
|
function flatten(array) {
|
|
@@ -49707,7 +49777,7 @@ var require_parse = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
|
49707
49777
|
}));
|
|
49708
49778
|
//#endregion
|
|
49709
49779
|
//#region ../../node_modules/.pnpm/browserslist@4.28.1/node_modules/browserslist/index.js
|
|
49710
|
-
var require_browserslist = /* @__PURE__ */ __commonJSMin
|
|
49780
|
+
var require_browserslist = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
49711
49781
|
var bbm = require_dist();
|
|
49712
49782
|
var jsReleases = require_envs();
|
|
49713
49783
|
var agents = require_agents().agents;
|
|
@@ -50729,8 +50799,8 @@ var require_browserslist = /* @__PURE__ */ __commonJSMin$1(((exports, module) =>
|
|
|
50729
50799
|
}));
|
|
50730
50800
|
//#endregion
|
|
50731
50801
|
//#region ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/Brand.js
|
|
50732
|
-
var import_semver = /* @__PURE__ */ __toESM
|
|
50733
|
-
var import_browserslist = /* @__PURE__ */ __toESM
|
|
50802
|
+
var import_semver = /* @__PURE__ */ __toESM(require_semver(), 1);
|
|
50803
|
+
var import_browserslist = /* @__PURE__ */ __toESM(require_browserslist(), 1);
|
|
50734
50804
|
/**
|
|
50735
50805
|
* Returns a `Constructor` that **does not apply any runtime checks** and just
|
|
50736
50806
|
* returns the provided value.
|
|
@@ -60327,6 +60397,72 @@ const warn$1 = (...args) => consoleWith((console) => sync$2(() => {
|
|
|
60327
60397
|
}));
|
|
60328
60398
|
//#endregion
|
|
60329
60399
|
//#region ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/Cache.js
|
|
60400
|
+
var import_picocolors = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
60401
|
+
let p = process || {}, argv = p.argv || [], env = p.env || {};
|
|
60402
|
+
let isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
|
|
60403
|
+
let formatter = (open, close, replace = open) => (input) => {
|
|
60404
|
+
let string = "" + input, index = string.indexOf(close, open.length);
|
|
60405
|
+
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
60406
|
+
};
|
|
60407
|
+
let replaceClose = (string, close, replace, index) => {
|
|
60408
|
+
let result = "", cursor = 0;
|
|
60409
|
+
do {
|
|
60410
|
+
result += string.substring(cursor, index) + replace;
|
|
60411
|
+
cursor = index + close.length;
|
|
60412
|
+
index = string.indexOf(close, cursor);
|
|
60413
|
+
} while (~index);
|
|
60414
|
+
return result + string.substring(cursor);
|
|
60415
|
+
};
|
|
60416
|
+
let createColors = (enabled = isColorSupported) => {
|
|
60417
|
+
let f = enabled ? formatter : () => String;
|
|
60418
|
+
return {
|
|
60419
|
+
isColorSupported: enabled,
|
|
60420
|
+
reset: f("\x1B[0m", "\x1B[0m"),
|
|
60421
|
+
bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
|
|
60422
|
+
dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
|
|
60423
|
+
italic: f("\x1B[3m", "\x1B[23m"),
|
|
60424
|
+
underline: f("\x1B[4m", "\x1B[24m"),
|
|
60425
|
+
inverse: f("\x1B[7m", "\x1B[27m"),
|
|
60426
|
+
hidden: f("\x1B[8m", "\x1B[28m"),
|
|
60427
|
+
strikethrough: f("\x1B[9m", "\x1B[29m"),
|
|
60428
|
+
black: f("\x1B[30m", "\x1B[39m"),
|
|
60429
|
+
red: f("\x1B[31m", "\x1B[39m"),
|
|
60430
|
+
green: f("\x1B[32m", "\x1B[39m"),
|
|
60431
|
+
yellow: f("\x1B[33m", "\x1B[39m"),
|
|
60432
|
+
blue: f("\x1B[34m", "\x1B[39m"),
|
|
60433
|
+
magenta: f("\x1B[35m", "\x1B[39m"),
|
|
60434
|
+
cyan: f("\x1B[36m", "\x1B[39m"),
|
|
60435
|
+
white: f("\x1B[37m", "\x1B[39m"),
|
|
60436
|
+
gray: f("\x1B[90m", "\x1B[39m"),
|
|
60437
|
+
bgBlack: f("\x1B[40m", "\x1B[49m"),
|
|
60438
|
+
bgRed: f("\x1B[41m", "\x1B[49m"),
|
|
60439
|
+
bgGreen: f("\x1B[42m", "\x1B[49m"),
|
|
60440
|
+
bgYellow: f("\x1B[43m", "\x1B[49m"),
|
|
60441
|
+
bgBlue: f("\x1B[44m", "\x1B[49m"),
|
|
60442
|
+
bgMagenta: f("\x1B[45m", "\x1B[49m"),
|
|
60443
|
+
bgCyan: f("\x1B[46m", "\x1B[49m"),
|
|
60444
|
+
bgWhite: f("\x1B[47m", "\x1B[49m"),
|
|
60445
|
+
blackBright: f("\x1B[90m", "\x1B[39m"),
|
|
60446
|
+
redBright: f("\x1B[91m", "\x1B[39m"),
|
|
60447
|
+
greenBright: f("\x1B[92m", "\x1B[39m"),
|
|
60448
|
+
yellowBright: f("\x1B[93m", "\x1B[39m"),
|
|
60449
|
+
blueBright: f("\x1B[94m", "\x1B[39m"),
|
|
60450
|
+
magentaBright: f("\x1B[95m", "\x1B[39m"),
|
|
60451
|
+
cyanBright: f("\x1B[96m", "\x1B[39m"),
|
|
60452
|
+
whiteBright: f("\x1B[97m", "\x1B[39m"),
|
|
60453
|
+
bgBlackBright: f("\x1B[100m", "\x1B[49m"),
|
|
60454
|
+
bgRedBright: f("\x1B[101m", "\x1B[49m"),
|
|
60455
|
+
bgGreenBright: f("\x1B[102m", "\x1B[49m"),
|
|
60456
|
+
bgYellowBright: f("\x1B[103m", "\x1B[49m"),
|
|
60457
|
+
bgBlueBright: f("\x1B[104m", "\x1B[49m"),
|
|
60458
|
+
bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
|
|
60459
|
+
bgCyanBright: f("\x1B[106m", "\x1B[49m"),
|
|
60460
|
+
bgWhiteBright: f("\x1B[107m", "\x1B[49m")
|
|
60461
|
+
};
|
|
60462
|
+
};
|
|
60463
|
+
module.exports = createColors();
|
|
60464
|
+
module.exports.createColors = createColors;
|
|
60465
|
+
})))(), 1);
|
|
60330
60466
|
/**
|
|
60331
60467
|
* Caches values loaded by an Effect lookup function.
|
|
60332
60468
|
*
|
|
@@ -62296,27 +62432,6 @@ function traceSegmentInternal(segments, memo, line, column, bias) {
|
|
|
62296
62432
|
}
|
|
62297
62433
|
//#endregion
|
|
62298
62434
|
//#region ../core/dist/index.js
|
|
62299
|
-
var __create = Object.create;
|
|
62300
|
-
var __defProp = Object.defineProperty;
|
|
62301
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
62302
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
62303
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
62304
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
62305
|
-
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
62306
|
-
var __copyProps = (to, from, except, desc) => {
|
|
62307
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
62308
|
-
key = keys[i];
|
|
62309
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
62310
|
-
get: ((k) => from[k]).bind(null, key),
|
|
62311
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
62312
|
-
});
|
|
62313
|
-
}
|
|
62314
|
-
return to;
|
|
62315
|
-
};
|
|
62316
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
62317
|
-
value: mod,
|
|
62318
|
-
enumerable: true
|
|
62319
|
-
}) : target, mod));
|
|
62320
62435
|
var ProjectNotFoundError = class extends Error {
|
|
62321
62436
|
name = "ProjectNotFoundError";
|
|
62322
62437
|
directory;
|
|
@@ -63320,6 +63435,11 @@ const analyzeConfigIdentifier = (identifier, analysis, allowCompilerTransform, i
|
|
|
63320
63435
|
const topLevelBinding = getTopLevelBinding(analysis.sourceFile, identifier.text);
|
|
63321
63436
|
return Boolean(topLevelBinding && analyzeConfigNode(topLevelBinding, analysis, allowCompilerTransform, isCompilerTransformCollection, overriddenPropertyNames));
|
|
63322
63437
|
};
|
|
63438
|
+
const hasReactCompilerConfigInSentryWrapperArgument = (callExpression, analysis, moduleSpecifier, exportName) => {
|
|
63439
|
+
if (moduleSpecifier !== "@sentry/nextjs" || exportName !== "withSentryConfig") return false;
|
|
63440
|
+
const [configArgument] = callExpression.arguments;
|
|
63441
|
+
return Boolean(configArgument && analyzeConfigNode(configArgument, analysis, false));
|
|
63442
|
+
};
|
|
63323
63443
|
const analyzeConfigCallTarget = (callExpression, analysis, allowCompilerTransform) => {
|
|
63324
63444
|
const target = callExpression.expression;
|
|
63325
63445
|
const callableRequiredModuleSpecifier = getRequireModuleSpecifier(target);
|
|
@@ -63343,6 +63463,7 @@ const analyzeConfigCallTarget = (callExpression, analysis, allowCompilerTransfor
|
|
|
63343
63463
|
if (requiredModuleSpecifier !== null) {
|
|
63344
63464
|
if (ts.isCallExpression(target.expression) && ts.isIdentifier(target.expression.expression) && (analysis.localBindings.has(target.expression.expression.text) || getScopedConfigBinding(target.expression.expression).wasFound || hasTopLevelValueBinding(analysis.sourceFile, "require"))) return false;
|
|
63345
63465
|
if (allowCompilerTransform && isCompilerTransformModule(requiredModuleSpecifier, propertyName)) return true;
|
|
63466
|
+
if (hasReactCompilerConfigInSentryWrapperArgument(callExpression, analysis, requiredModuleSpecifier, propertyName)) return true;
|
|
63346
63467
|
const hasCompilerTransform = analyzeImportedConfig({
|
|
63347
63468
|
analysis,
|
|
63348
63469
|
moduleSpecifier: requiredModuleSpecifier,
|
|
@@ -63357,6 +63478,7 @@ const analyzeConfigCallTarget = (callExpression, analysis, allowCompilerTransfor
|
|
|
63357
63478
|
const importBinding = analysis.localBindings.has(target.expression.text) || getScopedConfigBinding(target.expression).wasFound ? null : getImportBinding(analysis.sourceFile, target.expression.text);
|
|
63358
63479
|
if (importBinding?.isNamespace) {
|
|
63359
63480
|
if (allowCompilerTransform && isCompilerTransformModule(importBinding.moduleSpecifier, propertyName)) return true;
|
|
63481
|
+
if (hasReactCompilerConfigInSentryWrapperArgument(callExpression, analysis, importBinding.moduleSpecifier, propertyName)) return true;
|
|
63360
63482
|
const hasCompilerTransform = analyzeImportedConfig({
|
|
63361
63483
|
analysis,
|
|
63362
63484
|
moduleSpecifier: importBinding.moduleSpecifier,
|
|
@@ -63458,6 +63580,7 @@ const analyzeConfigNode = (node, analysis, allowCompilerTransform, isCompilerTra
|
|
|
63458
63580
|
const importBinding = getImportBinding(analysis.sourceFile, node.expression.text);
|
|
63459
63581
|
if (importBinding) {
|
|
63460
63582
|
if (allowCompilerTransform && isCompilerTransformModule(importBinding.moduleSpecifier, importBinding.exportName)) return true;
|
|
63583
|
+
if (hasReactCompilerConfigInSentryWrapperArgument(node, analysis, importBinding.moduleSpecifier, importBinding.exportName)) return true;
|
|
63461
63584
|
if (allowCompilerTransform && importBinding.moduleSpecifier === "@rolldown/plugin-babel" && importBinding.exportName === "default" && node.arguments.some((argument) => analyzeConfigNode(argument, analysis, false))) return true;
|
|
63462
63585
|
const hasCompilerTransform = analyzeImportedConfig({
|
|
63463
63586
|
analysis,
|
|
@@ -63691,6 +63814,18 @@ const detectPreES2023Target = (directory) => {
|
|
|
63691
63814
|
}
|
|
63692
63815
|
return false;
|
|
63693
63816
|
};
|
|
63817
|
+
const SHADCN_CONFIG_FILE_NAME = "components.json";
|
|
63818
|
+
const detectShadcnUi = (directory) => {
|
|
63819
|
+
if (isFile(path$1$1.join(directory, SHADCN_CONFIG_FILE_NAME))) return true;
|
|
63820
|
+
if (isProjectBoundary(directory)) return false;
|
|
63821
|
+
let ancestorDirectory = path$1$1.dirname(directory);
|
|
63822
|
+
while (ancestorDirectory !== path$1$1.dirname(ancestorDirectory)) {
|
|
63823
|
+
if (isFile(path$1$1.join(ancestorDirectory, SHADCN_CONFIG_FILE_NAME))) return true;
|
|
63824
|
+
if (isProjectBoundary(ancestorDirectory)) return false;
|
|
63825
|
+
ancestorDirectory = path$1$1.dirname(ancestorDirectory);
|
|
63826
|
+
}
|
|
63827
|
+
return false;
|
|
63828
|
+
};
|
|
63694
63829
|
const FRAMEWORK_PACKAGES = {
|
|
63695
63830
|
next: "nextjs",
|
|
63696
63831
|
"@tanstack/react-start": "tanstack-start",
|
|
@@ -64456,6 +64591,29 @@ const getTanStackQueryVersion = (packageJson) => {
|
|
|
64456
64591
|
packageNames: TANSTACK_REACT_QUERY_PACKAGES
|
|
64457
64592
|
});
|
|
64458
64593
|
};
|
|
64594
|
+
const hasAnyDependency = (packageJson, packageNames) => {
|
|
64595
|
+
const allDependencies = {
|
|
64596
|
+
...packageJson.peerDependencies,
|
|
64597
|
+
...packageJson.dependencies,
|
|
64598
|
+
...packageJson.devDependencies,
|
|
64599
|
+
...packageJson.optionalDependencies
|
|
64600
|
+
};
|
|
64601
|
+
return packageNames.some((packageName) => allDependencies[packageName] !== void 0);
|
|
64602
|
+
};
|
|
64603
|
+
const BASE_UI_PACKAGES = ["@base-ui-components/react", "@base-ui/react"];
|
|
64604
|
+
const hasBaseUiDependency = (packageJson) => hasAnyDependency(packageJson, BASE_UI_PACKAGES);
|
|
64605
|
+
const RADIX_UNIFIED_PACKAGE = "radix-ui";
|
|
64606
|
+
const RADIX_PRIMITIVE_PACKAGE_PREFIX = "@radix-ui/react-";
|
|
64607
|
+
const RADIX_NON_PRIMITIVE_PACKAGES = new Set(["@radix-ui/react-icons"]);
|
|
64608
|
+
const hasRadixUiDependency = (packageJson) => {
|
|
64609
|
+
const allDependencies = {
|
|
64610
|
+
...packageJson.peerDependencies,
|
|
64611
|
+
...packageJson.dependencies,
|
|
64612
|
+
...packageJson.devDependencies,
|
|
64613
|
+
...packageJson.optionalDependencies
|
|
64614
|
+
};
|
|
64615
|
+
return Object.keys(allDependencies).some((packageName) => packageName === RADIX_UNIFIED_PACKAGE || packageName.startsWith(RADIX_PRIMITIVE_PACKAGE_PREFIX) && !RADIX_NON_PRIMITIVE_PACKAGES.has(packageName));
|
|
64616
|
+
};
|
|
64459
64617
|
const STYLED_COMPONENTS_PACKAGES = ["styled-components"];
|
|
64460
64618
|
const getStyledComponentsVersion = (packageJson) => {
|
|
64461
64619
|
return getPreferredDependencyVersion({
|
|
@@ -64486,6 +64644,10 @@ const hasI18nDependency = (packageJson) => {
|
|
|
64486
64644
|
};
|
|
64487
64645
|
return I18N_PACKAGES.some((packageName) => allDependencies[packageName] !== void 0);
|
|
64488
64646
|
};
|
|
64647
|
+
const REACT_ARIA_COMPONENT_PACKAGES = ["react-aria-components"];
|
|
64648
|
+
const TANSTACK_TABLE_PACKAGES = ["@tanstack/react-table"];
|
|
64649
|
+
const TANSTACK_VIRTUAL_PACKAGES = ["@tanstack/react-virtual"];
|
|
64650
|
+
const TANSTACK_FORM_PACKAGES = ["@tanstack/react-form"];
|
|
64489
64651
|
const REANIMATED_DEPENDENCY_NAME = "react-native-reanimated";
|
|
64490
64652
|
const MOBX_REACT_PACKAGE_NAME = "mobx-react";
|
|
64491
64653
|
const MOBX_REACT_LITE_PACKAGE_NAME = "mobx-react-lite";
|
|
@@ -64676,6 +64838,13 @@ const evaluateManifestFacts = (facts, packageJson, directory, rootDirectory, roo
|
|
|
64676
64838
|
});
|
|
64677
64839
|
if (styledComponentsVersion && shouldReplaceStyledComponentsVersion(facts.styledComponentsVersion, styledComponentsVersion)) facts.styledComponentsVersion = styledComponentsVersion;
|
|
64678
64840
|
facts.hasI18nLibrary = facts.hasI18nLibrary || hasI18nDependency(packageJson);
|
|
64841
|
+
facts.hasShadcnUi = facts.hasShadcnUi || detectShadcnUi(directory);
|
|
64842
|
+
facts.hasRadixUi = facts.hasRadixUi || hasRadixUiDependency(packageJson);
|
|
64843
|
+
facts.hasBaseUi = facts.hasBaseUi || hasBaseUiDependency(packageJson);
|
|
64844
|
+
facts.hasReactAriaComponents = facts.hasReactAriaComponents || hasAnyDependency(packageJson, REACT_ARIA_COMPONENT_PACKAGES);
|
|
64845
|
+
facts.hasTanstackTable = facts.hasTanstackTable || hasAnyDependency(packageJson, TANSTACK_TABLE_PACKAGES);
|
|
64846
|
+
facts.hasTanstackVirtual = facts.hasTanstackVirtual || hasAnyDependency(packageJson, TANSTACK_VIRTUAL_PACKAGES);
|
|
64847
|
+
facts.hasTanstackForm = facts.hasTanstackForm || hasAnyDependency(packageJson, TANSTACK_FORM_PACKAGES);
|
|
64679
64848
|
for (const packageName of REACT_THREE_FIBER_DEPENDENCY_NAMES) {
|
|
64680
64849
|
const version = resolveCatalogBackedDependencyVersion({
|
|
64681
64850
|
rootDirectory,
|
|
@@ -64778,6 +64947,13 @@ const collectWorkspaceFacts = (rootDirectory, rootPackageJson, { collectReactGro
|
|
|
64778
64947
|
tanstackQueryVersion: null,
|
|
64779
64948
|
styledComponentsVersion: null,
|
|
64780
64949
|
hasI18nLibrary: false,
|
|
64950
|
+
hasShadcnUi: false,
|
|
64951
|
+
hasRadixUi: false,
|
|
64952
|
+
hasBaseUi: false,
|
|
64953
|
+
hasReactAriaComponents: false,
|
|
64954
|
+
hasTanstackTable: false,
|
|
64955
|
+
hasTanstackVirtual: false,
|
|
64956
|
+
hasTanstackForm: false,
|
|
64781
64957
|
hasReactNativeAwarePackage: false,
|
|
64782
64958
|
hasReanimatedAwarePackage: false,
|
|
64783
64959
|
hasSsrDependency: false,
|
|
@@ -65122,6 +65298,12 @@ const discoverProjectWithoutPackageJson = (directory, options) => {
|
|
|
65122
65298
|
remotionVersion: null,
|
|
65123
65299
|
remotionMajorVersion: null,
|
|
65124
65300
|
hasI18nLibrary: false,
|
|
65301
|
+
hasRadixUi: false,
|
|
65302
|
+
hasBaseUi: false,
|
|
65303
|
+
hasReactAriaComponents: false,
|
|
65304
|
+
hasTanstackTable: false,
|
|
65305
|
+
hasTanstackVirtual: false,
|
|
65306
|
+
hasTanstackForm: false,
|
|
65125
65307
|
tanstackQueryVersion: null,
|
|
65126
65308
|
styledComponentsVersion: null,
|
|
65127
65309
|
hasThree: false,
|
|
@@ -65143,6 +65325,7 @@ const discoverProjectWithoutPackageJson = (directory, options) => {
|
|
|
65143
65325
|
shopifyFlashListMajorVersion: null,
|
|
65144
65326
|
hasReanimated: false,
|
|
65145
65327
|
reanimatedVersion: null,
|
|
65328
|
+
hasShadcnUi: detectShadcnUi(directory),
|
|
65146
65329
|
isPreES2023Target: hasOwnTsConfig && detectPreES2023Target(directory),
|
|
65147
65330
|
isStaticExport: false,
|
|
65148
65331
|
sourceFileCount
|
|
@@ -65305,6 +65488,12 @@ const discoverProject = (directory, options = {}) => {
|
|
|
65305
65488
|
hasReactCompilerLintPlugin: detectReactCompilerLintPlugin(directory, packageJson),
|
|
65306
65489
|
hasTanStackQuery: tanstackQueryVersion !== null,
|
|
65307
65490
|
hasI18nLibrary: workspaceFacts.hasI18nLibrary,
|
|
65491
|
+
hasRadixUi: workspaceFacts.hasRadixUi,
|
|
65492
|
+
hasBaseUi: workspaceFacts.hasBaseUi,
|
|
65493
|
+
hasReactAriaComponents: workspaceFacts.hasReactAriaComponents,
|
|
65494
|
+
hasTanstackTable: workspaceFacts.hasTanstackTable,
|
|
65495
|
+
hasTanstackVirtual: workspaceFacts.hasTanstackVirtual,
|
|
65496
|
+
hasTanstackForm: workspaceFacts.hasTanstackForm,
|
|
65308
65497
|
tanstackQueryVersion,
|
|
65309
65498
|
styledComponentsVersion: workspaceFacts.styledComponentsVersion,
|
|
65310
65499
|
valtioVersion,
|
|
@@ -65331,6 +65520,7 @@ const discoverProject = (directory, options = {}) => {
|
|
|
65331
65520
|
shopifyFlashListMajorVersion: shopifyFlashListVersion === null ? null : getLowestDependencyMajor(shopifyFlashListVersion),
|
|
65332
65521
|
hasReanimated,
|
|
65333
65522
|
reanimatedVersion,
|
|
65523
|
+
hasShadcnUi: workspaceFacts.hasShadcnUi,
|
|
65334
65524
|
isPreES2023Target,
|
|
65335
65525
|
isStaticExport: framework === "nextjs" && detectNextjsStaticExport(workspaceFacts.next.sourceDirectory ?? directory),
|
|
65336
65526
|
sourceFileCount
|
|
@@ -65518,12 +65708,26 @@ const getEquivalentRuleKeys = (ruleKey) => {
|
|
|
65518
65708
|
const nativeRuleKey = canonicalizeRuleKey(ruleKey);
|
|
65519
65709
|
return [nativeRuleKey, ...getLegacyRuleKeysForNative(nativeRuleKey)];
|
|
65520
65710
|
};
|
|
65521
|
-
|
|
65522
|
-
|
|
65523
|
-
|
|
65524
|
-
|
|
65525
|
-
|
|
65711
|
+
/**
|
|
65712
|
+
* Resolves the absolute path to read for a diagnostic's `filePath`,
|
|
65713
|
+
* accounting for the various shapes oxlint emits:
|
|
65714
|
+
*
|
|
65715
|
+
* - `file://` URL — decode to an absolute filesystem path.
|
|
65716
|
+
* - Absolute POSIX (`/abs/path/file.tsx`) — pass through.
|
|
65717
|
+
* - Absolute Windows (`C:/...` or `C:\...`) — pass through.
|
|
65718
|
+
* - `./relative` or bare relative — join against `rootDirectory`.
|
|
65719
|
+
*
|
|
65720
|
+
* Shared between the streaming diagnostic pipeline and the legacy
|
|
65721
|
+
* array-shaped `mergeAndFilterDiagnostics` wrapper so file-line lookups
|
|
65722
|
+
* use one canonical resolution path.
|
|
65723
|
+
*/
|
|
65724
|
+
const resolveCandidateReadPath = (rootDirectory, filePath) => {
|
|
65725
|
+
if (filePath.startsWith("file://")) return fileURLToPath(filePath);
|
|
65726
|
+
const normalizedFile = filePath.replace(/\\/g, "/");
|
|
65727
|
+
if (normalizedFile.startsWith("/") || /^[a-zA-Z]:\//.test(normalizedFile) || /^[a-zA-Z]:\\/.test(filePath)) return filePath;
|
|
65728
|
+
return `${rootDirectory.replace(/\\/g, "/").replace(/\/$/, "")}/${normalizedFile.replace(/^\.\//, "")}`;
|
|
65526
65729
|
};
|
|
65730
|
+
const toNormalizedRelativePath = (filePath, rootDirectory) => path$1$1.relative(path$1$1.resolve(rootDirectory), path$1$1.resolve(resolveCandidateReadPath(rootDirectory, filePath))).replaceAll("\\", "/") || ".";
|
|
65527
65731
|
const warnConfigIssue = (message) => {
|
|
65528
65732
|
process.stderr.write(`[react-doctor] ${message}\n`);
|
|
65529
65733
|
};
|
|
@@ -65572,7 +65776,7 @@ const compileIgnoreOverrides = (userConfig) => {
|
|
|
65572
65776
|
};
|
|
65573
65777
|
const isDiagnosticIgnoredByOverrides = (diagnostic, rootDirectory, overrides) => {
|
|
65574
65778
|
if (overrides.length === 0) return false;
|
|
65575
|
-
const relativeFilePath =
|
|
65779
|
+
const relativeFilePath = toNormalizedRelativePath(diagnostic.filePath, rootDirectory);
|
|
65576
65780
|
const ruleIdentifier = `${diagnostic.plugin}/${diagnostic.rule}`;
|
|
65577
65781
|
return overrides.some((override) => override.filePatterns.some((pattern) => pattern.test(relativeFilePath)) && hasMatchingRuleOverride(override.ruleIds, ruleIdentifier));
|
|
65578
65782
|
};
|
|
@@ -65912,7 +66116,7 @@ const compileIgnoredFilePatterns = (userConfig) => {
|
|
|
65912
66116
|
};
|
|
65913
66117
|
const isFileIgnoredByPatterns = (filePath, rootDirectory, patterns) => {
|
|
65914
66118
|
if (patterns.length === 0) return false;
|
|
65915
|
-
const relativePath =
|
|
66119
|
+
const relativePath = toNormalizedRelativePath(filePath, rootDirectory);
|
|
65916
66120
|
return patterns.some((pattern) => pattern.test(relativePath));
|
|
65917
66121
|
};
|
|
65918
66122
|
const SCRIPT_EXTENSION_FRAGMENT = "[cm]?[jt]sx?";
|
|
@@ -66036,25 +66240,6 @@ const classifyPackageRole = (filename) => {
|
|
|
66036
66240
|
return result;
|
|
66037
66241
|
};
|
|
66038
66242
|
/**
|
|
66039
|
-
* Resolves the absolute path to read for a diagnostic's `filePath`,
|
|
66040
|
-
* accounting for the various shapes oxlint emits:
|
|
66041
|
-
*
|
|
66042
|
-
* - `file://` URL — decode to an absolute filesystem path.
|
|
66043
|
-
* - Absolute POSIX (`/abs/path/file.tsx`) — pass through.
|
|
66044
|
-
* - Absolute Windows (`C:/...` or `C:\...`) — pass through.
|
|
66045
|
-
* - `./relative` or bare relative — join against `rootDirectory`.
|
|
66046
|
-
*
|
|
66047
|
-
* Shared between the streaming diagnostic pipeline and the legacy
|
|
66048
|
-
* array-shaped `mergeAndFilterDiagnostics` wrapper so file-line lookups
|
|
66049
|
-
* use one canonical resolution path.
|
|
66050
|
-
*/
|
|
66051
|
-
const resolveCandidateReadPath = (rootDirectory, filePath) => {
|
|
66052
|
-
if (filePath.startsWith("file://")) return fileURLToPath(filePath);
|
|
66053
|
-
const normalizedFile = filePath.replace(/\\/g, "/");
|
|
66054
|
-
if (normalizedFile.startsWith("/") || /^[a-zA-Z]:\//.test(normalizedFile) || /^[a-zA-Z]:\\/.test(filePath)) return filePath;
|
|
66055
|
-
return `${rootDirectory.replace(/\\/g, "/").replace(/\/$/, "")}/${normalizedFile.replace(/^\.\//, "")}`;
|
|
66056
|
-
};
|
|
66057
|
-
/**
|
|
66058
66243
|
* Shared raw-line scanners that detect whether a diagnostic site is
|
|
66059
66244
|
* enclosed by a configured `textComponents` entry or a
|
|
66060
66245
|
* `rawTextWrapperComponents` entry. Both checks are used by the
|
|
@@ -67738,6 +67923,28 @@ const checkExpoEnvLocalFiles = (context) => {
|
|
|
67738
67923
|
help: `Add \`.env*.local\` to your .gitignore. If already committed, untrack with \`git rm --cached ${committedEnvFiles.join(" ")}\``
|
|
67739
67924
|
})];
|
|
67740
67925
|
};
|
|
67926
|
+
const JAVASCRIPT_MODULE_FILE_PATTERN = /\.[cm]?[jt]sx?$/;
|
|
67927
|
+
const hasStaticModuleSubpath = (rootDirectory, packageName) => {
|
|
67928
|
+
const packageSubpathPrefix = `${packageName}/`;
|
|
67929
|
+
for (const { absolutePath, name } of walkSourceTreeFiles(rootDirectory)) {
|
|
67930
|
+
if (!JAVASCRIPT_MODULE_FILE_PATTERN.test(name)) continue;
|
|
67931
|
+
let sourceText;
|
|
67932
|
+
try {
|
|
67933
|
+
sourceText = fs$1$3.readFileSync(absolutePath, "utf-8");
|
|
67934
|
+
} catch {
|
|
67935
|
+
continue;
|
|
67936
|
+
}
|
|
67937
|
+
if (!sourceText.includes(packageSubpathPrefix)) continue;
|
|
67938
|
+
let moduleSpecifiers;
|
|
67939
|
+
try {
|
|
67940
|
+
moduleSpecifiers = collectStaticModuleSpecifiers(sourceText, { filePath: absolutePath });
|
|
67941
|
+
} catch {
|
|
67942
|
+
continue;
|
|
67943
|
+
}
|
|
67944
|
+
for (const moduleSpecifier of moduleSpecifiers) if (moduleSpecifier.startsWith(packageSubpathPrefix)) return true;
|
|
67945
|
+
}
|
|
67946
|
+
return false;
|
|
67947
|
+
};
|
|
67741
67948
|
const isExpoSdkAtLeast = (expoSdkMajor, minMajor) => expoSdkMajor !== null && expoSdkMajor >= minMajor;
|
|
67742
67949
|
const UNIMODULES_HELP = "Remove every `@unimodules/*` and `react-native-unimodules` package — their functionality now lives in `expo-modules-core`. See https://expo.fyi/r/sdk-44-remove-unimodules";
|
|
67743
67950
|
const FIREBASE_HELP = "Use the Firebase JS SDK or React Native Firebase directly. See https://expo.fyi/firebase-migration-guide";
|
|
@@ -67791,7 +67998,8 @@ const FLAGGED_DEPENDENCIES = [
|
|
|
67791
67998
|
packageName: "@expo/metro-config",
|
|
67792
67999
|
rule: "expo-no-redundant-dependency",
|
|
67793
68000
|
message: "\"@expo/metro-config\" should not be a direct dependency. Expo pins the compatible Metro config, and a direct entry can drift to a version that breaks bundling",
|
|
67794
|
-
help: "Remove `@expo/metro-config` and import `expo/metro-config` in your metro.config.js"
|
|
68001
|
+
help: "Remove `@expo/metro-config` and import `expo/metro-config` in your metro.config.js",
|
|
68002
|
+
skipWhenSubpathImported: true
|
|
67795
68003
|
},
|
|
67796
68004
|
{
|
|
67797
68005
|
packageName: "@types/react-native",
|
|
@@ -67852,8 +68060,9 @@ const FLAGGED_DEPENDENCIES = [
|
|
|
67852
68060
|
];
|
|
67853
68061
|
const checkExpoFlaggedDependencies = (context) => FLAGGED_DEPENDENCIES.filter((flaggedDependency) => {
|
|
67854
68062
|
if (!context.directDependencyNames.has(flaggedDependency.packageName)) return false;
|
|
67855
|
-
if (flaggedDependency.minSdkMajor
|
|
67856
|
-
|
|
68063
|
+
if (flaggedDependency.minSdkMajor !== void 0 && !isExpoSdkAtLeast(context.expoSdkMajor, flaggedDependency.minSdkMajor)) return false;
|
|
68064
|
+
if (flaggedDependency.skipWhenSubpathImported && hasStaticModuleSubpath(context.rootDirectory, flaggedDependency.packageName)) return false;
|
|
68065
|
+
return true;
|
|
67857
68066
|
}).map((flaggedDependency) => buildExpoDiagnostic({
|
|
67858
68067
|
rule: flaggedDependency.rule,
|
|
67859
68068
|
message: flaggedDependency.message,
|
|
@@ -67922,18 +68131,58 @@ const METRO_CONFIG_FILE_NAMES = [
|
|
|
67922
68131
|
const EXPO_METRO_CONFIG_EXTEND_SIGNALS = [
|
|
67923
68132
|
"expo/metro-config",
|
|
67924
68133
|
"@sentry/react-native/metro",
|
|
67925
|
-
"getSentryExpoConfig"
|
|
68134
|
+
"getSentryExpoConfig",
|
|
68135
|
+
"posthog-react-native/metro",
|
|
68136
|
+
"getPostHogExpoConfig"
|
|
67926
68137
|
];
|
|
68138
|
+
const resolveLocalMetroConfigModule = (moduleSpecifier, importingFilePath, rootDirectory) => {
|
|
68139
|
+
if (!moduleSpecifier.startsWith(".")) return void 0;
|
|
68140
|
+
const importedPath = path$1$1.resolve(path$1$1.dirname(importingFilePath), moduleSpecifier);
|
|
68141
|
+
const candidateBasePaths = [
|
|
68142
|
+
importedPath,
|
|
68143
|
+
importedPath.replace(/\.[cm]?js$/, ""),
|
|
68144
|
+
path$1$1.join(importedPath, "index")
|
|
68145
|
+
];
|
|
68146
|
+
for (const candidateBasePath of candidateBasePaths) {
|
|
68147
|
+
const resolvedPath = resolveEntryWithExtensions(candidateBasePath);
|
|
68148
|
+
if (resolvedPath !== void 0 && isFile(resolvedPath) && isPathInsideDirectoryOrEqual(resolvedPath, rootDirectory)) return resolvedPath;
|
|
68149
|
+
}
|
|
68150
|
+
};
|
|
68151
|
+
const hasExpoMetroConfigSignal = (metroConfigPath, rootDirectory) => {
|
|
68152
|
+
const pendingFilePaths = [metroConfigPath];
|
|
68153
|
+
const visitedFilePaths = /* @__PURE__ */ new Set();
|
|
68154
|
+
while (pendingFilePaths.length > 0) {
|
|
68155
|
+
const currentFilePath = pendingFilePaths.pop();
|
|
68156
|
+
if (currentFilePath === void 0 || visitedFilePaths.has(currentFilePath)) continue;
|
|
68157
|
+
if (visitedFilePaths.size >= 100) return true;
|
|
68158
|
+
visitedFilePaths.add(currentFilePath);
|
|
68159
|
+
let contents;
|
|
68160
|
+
try {
|
|
68161
|
+
contents = fs$1$3.readFileSync(currentFilePath, "utf-8");
|
|
68162
|
+
} catch {
|
|
68163
|
+
return true;
|
|
68164
|
+
}
|
|
68165
|
+
if (EXPO_METRO_CONFIG_EXTEND_SIGNALS.some((signal) => contents.includes(signal))) return true;
|
|
68166
|
+
let moduleSpecifiers;
|
|
68167
|
+
try {
|
|
68168
|
+
moduleSpecifiers = collectStaticModuleSpecifiers(contents, {
|
|
68169
|
+
filePath: currentFilePath,
|
|
68170
|
+
includeTypeOnly: false
|
|
68171
|
+
});
|
|
68172
|
+
} catch {
|
|
68173
|
+
continue;
|
|
68174
|
+
}
|
|
68175
|
+
for (const moduleSpecifier of moduleSpecifiers) {
|
|
68176
|
+
const localModulePath = resolveLocalMetroConfigModule(moduleSpecifier, currentFilePath, rootDirectory);
|
|
68177
|
+
if (localModulePath !== void 0 && !visitedFilePaths.has(localModulePath)) pendingFilePaths.push(localModulePath);
|
|
68178
|
+
}
|
|
68179
|
+
}
|
|
68180
|
+
return false;
|
|
68181
|
+
};
|
|
67927
68182
|
const checkExpoMetroConfig = (context) => {
|
|
67928
68183
|
const metroConfigPath = METRO_CONFIG_FILE_NAMES.map((fileName) => path$1$1.join(context.rootDirectory, fileName)).find((candidatePath) => isFile(candidatePath));
|
|
67929
68184
|
if (metroConfigPath === void 0) return [];
|
|
67930
|
-
|
|
67931
|
-
try {
|
|
67932
|
-
contents = fs$1$3.readFileSync(metroConfigPath, "utf-8");
|
|
67933
|
-
} catch {
|
|
67934
|
-
return [];
|
|
67935
|
-
}
|
|
67936
|
-
if (EXPO_METRO_CONFIG_EXTEND_SIGNALS.some((signal) => contents.includes(signal))) return [];
|
|
68185
|
+
if (hasExpoMetroConfigSignal(metroConfigPath, context.rootDirectory)) return [];
|
|
67937
68186
|
return [buildExpoDiagnostic({
|
|
67938
68187
|
rule: "expo-metro-config",
|
|
67939
68188
|
filePath: path$1$1.basename(metroConfigPath),
|
|
@@ -69335,6 +69584,13 @@ const buildCapabilities = (project) => {
|
|
|
69335
69584
|
minor: 0
|
|
69336
69585
|
})) capabilities.add("tailwind:4");
|
|
69337
69586
|
}
|
|
69587
|
+
if (project.hasShadcnUi === true) capabilities.add("shadcn");
|
|
69588
|
+
if (project.hasRadixUi === true) capabilities.add("radix-ui");
|
|
69589
|
+
if (project.hasBaseUi === true) capabilities.add("base-ui");
|
|
69590
|
+
if (project.hasReactAriaComponents === true) capabilities.add("react-aria");
|
|
69591
|
+
if (project.hasTanstackTable === true) capabilities.add("tanstack-table");
|
|
69592
|
+
if (project.hasTanstackVirtual === true) capabilities.add("tanstack-virtual");
|
|
69593
|
+
if (project.hasTanstackForm === true) capabilities.add("tanstack-form");
|
|
69338
69594
|
if (project.zodVersion !== null) capabilities.add("zod");
|
|
69339
69595
|
if (project.zodMajorVersion !== null && project.zodMajorVersion >= 4) capabilities.add("zod:4");
|
|
69340
69596
|
if (project.mobxVersion !== void 0 && project.mobxVersion !== null || project.hasMobxReact === true || project.hasMobxReactLite === true || project.hasMobxStateTree === true || project.hasMobxReactObserver === true) capabilities.add("mobx");
|
|
@@ -69512,72 +69768,6 @@ const checkSecurityScanCooperative = async (rootDirectory, options = {}) => {
|
|
|
69512
69768
|
}
|
|
69513
69769
|
return session.diagnostics;
|
|
69514
69770
|
};
|
|
69515
|
-
var import_picocolors = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
69516
|
-
let p = process || {}, argv = p.argv || [], env = p.env || {};
|
|
69517
|
-
let isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
|
|
69518
|
-
let formatter = (open, close, replace = open) => (input) => {
|
|
69519
|
-
let string = "" + input, index = string.indexOf(close, open.length);
|
|
69520
|
-
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
69521
|
-
};
|
|
69522
|
-
let replaceClose = (string, close, replace, index) => {
|
|
69523
|
-
let result = "", cursor = 0;
|
|
69524
|
-
do {
|
|
69525
|
-
result += string.substring(cursor, index) + replace;
|
|
69526
|
-
cursor = index + close.length;
|
|
69527
|
-
index = string.indexOf(close, cursor);
|
|
69528
|
-
} while (~index);
|
|
69529
|
-
return result + string.substring(cursor);
|
|
69530
|
-
};
|
|
69531
|
-
let createColors = (enabled = isColorSupported) => {
|
|
69532
|
-
let f = enabled ? formatter : () => String;
|
|
69533
|
-
return {
|
|
69534
|
-
isColorSupported: enabled,
|
|
69535
|
-
reset: f("\x1B[0m", "\x1B[0m"),
|
|
69536
|
-
bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
|
|
69537
|
-
dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
|
|
69538
|
-
italic: f("\x1B[3m", "\x1B[23m"),
|
|
69539
|
-
underline: f("\x1B[4m", "\x1B[24m"),
|
|
69540
|
-
inverse: f("\x1B[7m", "\x1B[27m"),
|
|
69541
|
-
hidden: f("\x1B[8m", "\x1B[28m"),
|
|
69542
|
-
strikethrough: f("\x1B[9m", "\x1B[29m"),
|
|
69543
|
-
black: f("\x1B[30m", "\x1B[39m"),
|
|
69544
|
-
red: f("\x1B[31m", "\x1B[39m"),
|
|
69545
|
-
green: f("\x1B[32m", "\x1B[39m"),
|
|
69546
|
-
yellow: f("\x1B[33m", "\x1B[39m"),
|
|
69547
|
-
blue: f("\x1B[34m", "\x1B[39m"),
|
|
69548
|
-
magenta: f("\x1B[35m", "\x1B[39m"),
|
|
69549
|
-
cyan: f("\x1B[36m", "\x1B[39m"),
|
|
69550
|
-
white: f("\x1B[37m", "\x1B[39m"),
|
|
69551
|
-
gray: f("\x1B[90m", "\x1B[39m"),
|
|
69552
|
-
bgBlack: f("\x1B[40m", "\x1B[49m"),
|
|
69553
|
-
bgRed: f("\x1B[41m", "\x1B[49m"),
|
|
69554
|
-
bgGreen: f("\x1B[42m", "\x1B[49m"),
|
|
69555
|
-
bgYellow: f("\x1B[43m", "\x1B[49m"),
|
|
69556
|
-
bgBlue: f("\x1B[44m", "\x1B[49m"),
|
|
69557
|
-
bgMagenta: f("\x1B[45m", "\x1B[49m"),
|
|
69558
|
-
bgCyan: f("\x1B[46m", "\x1B[49m"),
|
|
69559
|
-
bgWhite: f("\x1B[47m", "\x1B[49m"),
|
|
69560
|
-
blackBright: f("\x1B[90m", "\x1B[39m"),
|
|
69561
|
-
redBright: f("\x1B[91m", "\x1B[39m"),
|
|
69562
|
-
greenBright: f("\x1B[92m", "\x1B[39m"),
|
|
69563
|
-
yellowBright: f("\x1B[93m", "\x1B[39m"),
|
|
69564
|
-
blueBright: f("\x1B[94m", "\x1B[39m"),
|
|
69565
|
-
magentaBright: f("\x1B[95m", "\x1B[39m"),
|
|
69566
|
-
cyanBright: f("\x1B[96m", "\x1B[39m"),
|
|
69567
|
-
whiteBright: f("\x1B[97m", "\x1B[39m"),
|
|
69568
|
-
bgBlackBright: f("\x1B[100m", "\x1B[49m"),
|
|
69569
|
-
bgRedBright: f("\x1B[101m", "\x1B[49m"),
|
|
69570
|
-
bgGreenBright: f("\x1B[102m", "\x1B[49m"),
|
|
69571
|
-
bgYellowBright: f("\x1B[103m", "\x1B[49m"),
|
|
69572
|
-
bgBlueBright: f("\x1B[104m", "\x1B[49m"),
|
|
69573
|
-
bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
|
|
69574
|
-
bgCyanBright: f("\x1B[106m", "\x1B[49m"),
|
|
69575
|
-
bgWhiteBright: f("\x1B[107m", "\x1B[49m")
|
|
69576
|
-
};
|
|
69577
|
-
};
|
|
69578
|
-
module.exports = createColors();
|
|
69579
|
-
module.exports.createColors = createColors;
|
|
69580
|
-
})))(), 1);
|
|
69581
69771
|
const highlighter = {
|
|
69582
69772
|
error: import_picocolors.default.red,
|
|
69583
69773
|
warn: import_picocolors.default.yellow,
|
|
@@ -69753,6 +69943,12 @@ const withProjectAnalysisWorkerSlot = async (task, abortSignal) => {
|
|
|
69753
69943
|
});
|
|
69754
69944
|
return projectAnalysisWorkerSlots.run(task, abortSignal);
|
|
69755
69945
|
};
|
|
69946
|
+
const toRelativePath = (filePath, rootDirectory) => {
|
|
69947
|
+
const normalizedFilePath = filePath.replace(/\\/g, "/");
|
|
69948
|
+
const normalizedRoot = rootDirectory.replace(/\\/g, "/").replace(/\/$/, "") + "/";
|
|
69949
|
+
if (normalizedFilePath.startsWith(normalizedRoot)) return normalizedFilePath.slice(normalizedRoot.length);
|
|
69950
|
+
return normalizedFilePath.replace(/^\.\//, "");
|
|
69951
|
+
};
|
|
69756
69952
|
const REACT_DOCTOR_TOOLCHAIN_PACKAGES = new Set([
|
|
69757
69953
|
"react-doctor",
|
|
69758
69954
|
"eslint-plugin-react-doctor",
|
|
@@ -70581,7 +70777,6 @@ const readTextFileUpToCharacterLimit = async (input) => {
|
|
|
70581
70777
|
input.signal?.throwIfAborted();
|
|
70582
70778
|
return buffer.subarray(0, readOffset).toString("utf-8");
|
|
70583
70779
|
};
|
|
70584
|
-
const toNormalizedRelativePath = (filePath, rootDirectory) => path$1$1.relative(path$1$1.resolve(rootDirectory), path$1$1.resolve(rootDirectory, filePath)).replaceAll("\\", "/") || ".";
|
|
70585
70780
|
const buildJsxSourceReader = async (input) => {
|
|
70586
70781
|
const ignoredFilePatterns = compileGlobPatternsLenient(input.ignorePatterns ?? [], (error) => warnConfigIssue(`ignore.files: ${error.message}`));
|
|
70587
70782
|
const sourceFiles = (await listSourceFilesWithSizeCooperative(input.rootDirectory, input.signal)).filter((sourceFile) => JSX_DUPLICATION_SOURCE_FILE_PATTERN.test(sourceFile.path) && classifyFileContext(sourceFile.path) === "production" && !isFileIgnoredByPatterns(sourceFile.path, input.rootDirectory, ignoredFilePatterns));
|
|
@@ -70993,7 +71188,11 @@ var Git = class Git extends Service()("react-doctor/Git") {
|
|
|
70993
71188
|
const symref = yield* runGit(directory, ["symbolic-ref", "refs/remotes/origin/HEAD"]);
|
|
70994
71189
|
if (symref.status === 0) {
|
|
70995
71190
|
const trimmed = trimOrNull(symref.stdout);
|
|
70996
|
-
if (trimmed !== null)
|
|
71191
|
+
if (trimmed !== null) {
|
|
71192
|
+
const branchName = trimmed.replace("refs/remotes/origin/", "");
|
|
71193
|
+
const remoteBranch = `origin/${branchName}`;
|
|
71194
|
+
return (yield* branchExists(directory, remoteBranch)) ? remoteBranch : branchName;
|
|
71195
|
+
}
|
|
70997
71196
|
}
|
|
70998
71197
|
const candidates = yield* runGit(directory, [
|
|
70999
71198
|
"for-each-ref",
|
|
@@ -71001,7 +71200,10 @@ var Git = class Git extends Service()("react-doctor/Git") {
|
|
|
71001
71200
|
...DEFAULT_BRANCH_CANDIDATES.map((candidate) => `refs/heads/${candidate}`)
|
|
71002
71201
|
]);
|
|
71003
71202
|
if (candidates.status !== 0) return null;
|
|
71004
|
-
|
|
71203
|
+
const localBranch = trimOrNull(candidates.stdout.split("\n")[0] ?? "");
|
|
71204
|
+
if (localBranch === null) return null;
|
|
71205
|
+
const remoteBranch = `origin/${localBranch}`;
|
|
71206
|
+
return (yield* branchExists(directory, remoteBranch)) ? remoteBranch : localBranch;
|
|
71005
71207
|
}).pipe(withSpan("Git.defaultBranch"));
|
|
71006
71208
|
const branchExists = (directory, branch) => runGit(directory, [
|
|
71007
71209
|
"rev-parse",
|
|
@@ -71338,59 +71540,11 @@ const isLocalPathExtend = (entry) => {
|
|
|
71338
71540
|
for (const prefix of EXTENDS_LOCAL_PATH_PREFIXES) if (entry.startsWith(prefix)) return true;
|
|
71339
71541
|
return false;
|
|
71340
71542
|
};
|
|
71341
|
-
const stripJsoncComments = (raw) => {
|
|
71342
|
-
let result = "";
|
|
71343
|
-
let cursor = 0;
|
|
71344
|
-
let inString = false;
|
|
71345
|
-
let stringQuote = "";
|
|
71346
|
-
while (cursor < raw.length) {
|
|
71347
|
-
const character = raw[cursor];
|
|
71348
|
-
const nextCharacter = raw[cursor + 1];
|
|
71349
|
-
if (inString) {
|
|
71350
|
-
result += character;
|
|
71351
|
-
if (character === "\\" && cursor + 1 < raw.length) {
|
|
71352
|
-
result += nextCharacter;
|
|
71353
|
-
cursor += 2;
|
|
71354
|
-
continue;
|
|
71355
|
-
}
|
|
71356
|
-
if (character === stringQuote) inString = false;
|
|
71357
|
-
cursor += 1;
|
|
71358
|
-
continue;
|
|
71359
|
-
}
|
|
71360
|
-
if (character === "\"" || character === "'") {
|
|
71361
|
-
inString = true;
|
|
71362
|
-
stringQuote = character;
|
|
71363
|
-
result += character;
|
|
71364
|
-
cursor += 1;
|
|
71365
|
-
continue;
|
|
71366
|
-
}
|
|
71367
|
-
if (character === "/" && nextCharacter === "/") {
|
|
71368
|
-
const lineEndIndex = raw.indexOf("\n", cursor);
|
|
71369
|
-
cursor = lineEndIndex === -1 ? raw.length : lineEndIndex;
|
|
71370
|
-
continue;
|
|
71371
|
-
}
|
|
71372
|
-
if (character === "/" && nextCharacter === "*") {
|
|
71373
|
-
const blockEndIndex = raw.indexOf("*/", cursor + 2);
|
|
71374
|
-
cursor = blockEndIndex === -1 ? raw.length : blockEndIndex + 2;
|
|
71375
|
-
continue;
|
|
71376
|
-
}
|
|
71377
|
-
result += character;
|
|
71378
|
-
cursor += 1;
|
|
71379
|
-
}
|
|
71380
|
-
return result;
|
|
71381
|
-
};
|
|
71382
|
-
const parseJsonOrJsonc = (raw) => {
|
|
71383
|
-
try {
|
|
71384
|
-
return JSON.parse(raw);
|
|
71385
|
-
} catch {
|
|
71386
|
-
return JSON.parse(stripJsoncComments(raw));
|
|
71387
|
-
}
|
|
71388
|
-
};
|
|
71389
71543
|
const canOxlintExtendConfig = (configPath) => {
|
|
71390
71544
|
if (!configPath.endsWith(".eslintrc.json")) return true;
|
|
71391
71545
|
let parsed;
|
|
71392
71546
|
try {
|
|
71393
|
-
parsed =
|
|
71547
|
+
parsed = parseJSONC(fs$1$3.readFileSync(configPath, "utf-8"), { allowTrailingComma: true });
|
|
71394
71548
|
} catch {
|
|
71395
71549
|
return true;
|
|
71396
71550
|
}
|
|
@@ -71499,7 +71653,39 @@ const detectUserLintConfigPaths = (rootDirectory) => {
|
|
|
71499
71653
|
}
|
|
71500
71654
|
return [];
|
|
71501
71655
|
};
|
|
71656
|
+
const readAdoptedLintConfigSettings = (configPaths) => {
|
|
71657
|
+
const mergedSettings = /* @__PURE__ */ new Map();
|
|
71658
|
+
for (const configPath of configPaths) {
|
|
71659
|
+
let parsed;
|
|
71660
|
+
try {
|
|
71661
|
+
parsed = parseJSONC(fs$1$3.readFileSync(configPath, "utf-8"), { allowTrailingComma: true });
|
|
71662
|
+
} catch {
|
|
71663
|
+
continue;
|
|
71664
|
+
}
|
|
71665
|
+
if (!isPlainObject(parsed)) continue;
|
|
71666
|
+
const settings = parsed.settings;
|
|
71667
|
+
if (!isPlainObject(settings)) continue;
|
|
71668
|
+
for (const [pluginName, pluginSettings] of Object.entries(settings)) {
|
|
71669
|
+
if (pluginName === "react-doctor") continue;
|
|
71670
|
+
mergedSettings.set(pluginName, pluginSettings);
|
|
71671
|
+
}
|
|
71672
|
+
}
|
|
71673
|
+
return Object.fromEntries(mergedSettings);
|
|
71674
|
+
};
|
|
71502
71675
|
const DISABLE_DIRECTIVE_PATTERN = /(eslint|oxlint)-disable/;
|
|
71676
|
+
const getBackupRootDirectory = (rootDirectory) => path$1$1.join(rootDirectory, ...DISABLE_DIRECTIVE_BACKUP_DIRECTORY_SEGMENTS);
|
|
71677
|
+
const getBackupPath = (rootDirectory, absolutePath) => {
|
|
71678
|
+
if (!isPathInsideDirectory(absolutePath, rootDirectory)) return null;
|
|
71679
|
+
return path$1$1.join(getBackupRootDirectory(rootDirectory), path$1$1.relative(rootDirectory, absolutePath));
|
|
71680
|
+
};
|
|
71681
|
+
const removeBackupRootIfEmpty = (rootDirectory) => {
|
|
71682
|
+
const backupRootDirectory = getBackupRootDirectory(rootDirectory);
|
|
71683
|
+
if (!walkSourceTreeFiles(backupRootDirectory).next().done) return;
|
|
71684
|
+
fs$1$3.rmSync(backupRootDirectory, {
|
|
71685
|
+
recursive: true,
|
|
71686
|
+
force: true
|
|
71687
|
+
});
|
|
71688
|
+
};
|
|
71503
71689
|
const neutralizedFileLeases = /* @__PURE__ */ new Map();
|
|
71504
71690
|
const activeNeutralizationInitializations = /* @__PURE__ */ new Set();
|
|
71505
71691
|
const directoriesOverlap = (left, right) => {
|
|
@@ -71591,8 +71777,50 @@ const collectNeutralizationCandidatePaths = (rootDirectory, discoveredRelativePa
|
|
|
71591
71777
|
}
|
|
71592
71778
|
return candidatePaths;
|
|
71593
71779
|
};
|
|
71780
|
+
const recoverOrphanedBackups = (rootDirectory) => {
|
|
71781
|
+
const blockedPaths = /* @__PURE__ */ new Set();
|
|
71782
|
+
const backupRootDirectory = getBackupRootDirectory(rootDirectory);
|
|
71783
|
+
for (const { absolutePath: backupPath } of walkSourceTreeFiles(backupRootDirectory)) {
|
|
71784
|
+
const originalPath = path$1$1.join(rootDirectory, path$1$1.relative(backupRootDirectory, backupPath));
|
|
71785
|
+
if (neutralizedFileLeases.has(originalPath)) continue;
|
|
71786
|
+
let backupContent;
|
|
71787
|
+
let currentContent;
|
|
71788
|
+
try {
|
|
71789
|
+
backupContent = fs$1$3.readFileSync(backupPath, "utf-8");
|
|
71790
|
+
currentContent = fs$1$3.readFileSync(originalPath, "utf-8");
|
|
71791
|
+
} catch (error) {
|
|
71792
|
+
process.stderr.write(`[react-doctor] Could not recover ${originalPath}: ${messageFromUnknown(error)}. The backup remains at ${backupPath}.\n`);
|
|
71793
|
+
blockedPaths.add(originalPath);
|
|
71794
|
+
continue;
|
|
71795
|
+
}
|
|
71796
|
+
if (currentContent === backupContent) {
|
|
71797
|
+
try {
|
|
71798
|
+
fs$1$3.rmSync(backupPath);
|
|
71799
|
+
} catch (error) {
|
|
71800
|
+
process.stderr.write(`[react-doctor] Failed to delete stale backup ${backupPath}: ${messageFromUnknown(error)}\n`);
|
|
71801
|
+
blockedPaths.add(originalPath);
|
|
71802
|
+
}
|
|
71803
|
+
continue;
|
|
71804
|
+
}
|
|
71805
|
+
if (currentContent !== neutralizeContent(backupContent)) {
|
|
71806
|
+
process.stderr.write(`[react-doctor] Did not overwrite changed file ${originalPath}. Recover it manually from ${backupPath}.\n`);
|
|
71807
|
+
blockedPaths.add(originalPath);
|
|
71808
|
+
continue;
|
|
71809
|
+
}
|
|
71810
|
+
try {
|
|
71811
|
+
fs$1$3.writeFileSync(originalPath, backupContent);
|
|
71812
|
+
fs$1$3.rmSync(backupPath);
|
|
71813
|
+
} catch (error) {
|
|
71814
|
+
process.stderr.write(`[react-doctor] Failed to restore ${originalPath} from backup: ${messageFromUnknown(error)}\n`);
|
|
71815
|
+
blockedPaths.add(originalPath);
|
|
71816
|
+
}
|
|
71817
|
+
}
|
|
71818
|
+
removeBackupRootIfEmpty(rootDirectory);
|
|
71819
|
+
return blockedPaths;
|
|
71820
|
+
};
|
|
71594
71821
|
const neutralizeDisableDirectives = async (rootDirectory, includePaths, options = {}) => {
|
|
71595
71822
|
const resolvedRootDirectory = fs$1$3.realpathSync(rootDirectory);
|
|
71823
|
+
const blockedPaths = /* @__PURE__ */ new Set();
|
|
71596
71824
|
const leasedPaths = /* @__PURE__ */ new Set();
|
|
71597
71825
|
let isRestored = false;
|
|
71598
71826
|
const restore = () => {
|
|
@@ -71605,16 +71833,24 @@ const neutralizeDisableDirectives = async (rootDirectory, includePaths, options
|
|
|
71605
71833
|
if (lease.referenceCount > 0) continue;
|
|
71606
71834
|
neutralizedFileLeases.delete(absolutePath);
|
|
71607
71835
|
try {
|
|
71608
|
-
fs$1$3.
|
|
71836
|
+
const currentContent = fs$1$3.readFileSync(absolutePath, "utf-8");
|
|
71837
|
+
if (currentContent !== lease.neutralizedContent && currentContent !== lease.originalContent) {
|
|
71838
|
+
process.stderr.write(`[react-doctor] Did not overwrite changed file ${absolutePath}. Recover it manually from ${lease.backupPath}.\n`);
|
|
71839
|
+
continue;
|
|
71840
|
+
}
|
|
71841
|
+
if (currentContent === lease.neutralizedContent) fs$1$3.writeFileSync(absolutePath, lease.originalContent);
|
|
71842
|
+
fs$1$3.rmSync(lease.backupPath, { force: true });
|
|
71609
71843
|
} catch (error) {
|
|
71610
|
-
process.stderr.write(`[react-doctor] Failed to restore inline disable directives in ${absolutePath}: ${messageFromUnknown(error)}
|
|
71844
|
+
process.stderr.write(`[react-doctor] Failed to restore inline disable directives in ${absolutePath}: ${messageFromUnknown(error)}. The backup remains at ${lease.backupPath}.\n`);
|
|
71611
71845
|
}
|
|
71612
71846
|
}
|
|
71847
|
+
removeBackupRootIfEmpty(resolvedRootDirectory);
|
|
71613
71848
|
};
|
|
71614
71849
|
const onExit = () => restore();
|
|
71615
71850
|
process.once("exit", onExit);
|
|
71616
71851
|
const leaseCandidatePath = (absolutePath) => {
|
|
71617
71852
|
if (leasedPaths.has(absolutePath)) return;
|
|
71853
|
+
if (blockedPaths.has(absolutePath)) return;
|
|
71618
71854
|
const existingLease = neutralizedFileLeases.get(absolutePath);
|
|
71619
71855
|
if (existingLease) {
|
|
71620
71856
|
existingLease.referenceCount += 1;
|
|
@@ -71629,9 +71865,20 @@ const neutralizeDisableDirectives = async (rootDirectory, includePaths, options
|
|
|
71629
71865
|
}
|
|
71630
71866
|
const neutralizedContent = neutralizeContent(originalContent);
|
|
71631
71867
|
if (neutralizedContent !== originalContent) {
|
|
71868
|
+
const backupPath = getBackupPath(resolvedRootDirectory, absolutePath);
|
|
71869
|
+
if (backupPath === null) return;
|
|
71870
|
+
try {
|
|
71871
|
+
fs$1$3.mkdirSync(path$1$1.dirname(backupPath), { recursive: true });
|
|
71872
|
+
fs$1$3.writeFileSync(backupPath, originalContent, { flag: "wx" });
|
|
71873
|
+
} catch (error) {
|
|
71874
|
+
process.stderr.write(`[react-doctor] Did not modify ${absolutePath}: ${messageFromUnknown(error)}. Check ${backupPath}.\n`);
|
|
71875
|
+
return;
|
|
71876
|
+
}
|
|
71632
71877
|
fs$1$3.writeFileSync(absolutePath, neutralizedContent);
|
|
71633
71878
|
neutralizedFileLeases.set(absolutePath, {
|
|
71879
|
+
backupPath,
|
|
71634
71880
|
originalContent,
|
|
71881
|
+
neutralizedContent,
|
|
71635
71882
|
referenceCount: 1
|
|
71636
71883
|
});
|
|
71637
71884
|
leasedPaths.add(absolutePath);
|
|
@@ -71639,6 +71886,8 @@ const neutralizeDisableDirectives = async (rootDirectory, includePaths, options
|
|
|
71639
71886
|
};
|
|
71640
71887
|
try {
|
|
71641
71888
|
await withOverlappingInitializationLock(resolvedRootDirectory, async () => {
|
|
71889
|
+
for (const blockedPath of recoverOrphanedBackups(resolvedRootDirectory)) blockedPaths.add(blockedPath);
|
|
71890
|
+
if (options.recoverOnly) return;
|
|
71642
71891
|
for (const absolutePath of collectNeutralizationCandidatePaths(resolvedRootDirectory, [], includePaths)) if (neutralizedFileLeases.has(absolutePath)) leaseCandidatePath(absolutePath);
|
|
71643
71892
|
const discoveredRelativePaths = await (options.findFiles ?? findFilesWithDisableDirectives)(resolvedRootDirectory, includePaths);
|
|
71644
71893
|
for (const absolutePath of collectNeutralizationCandidatePaths(resolvedRootDirectory, discoveredRelativePaths, includePaths)) leaseCandidatePath(absolutePath);
|
|
@@ -71819,7 +72068,7 @@ const buildUserPluginRules = (userPlugin, severityControls) => {
|
|
|
71819
72068
|
}
|
|
71820
72069
|
return enabled;
|
|
71821
72070
|
};
|
|
71822
|
-
const createOxlintConfig = ({ pluginPath, project, customRulesOnly = false, extendsPaths = [], ignoredTags = /* @__PURE__ */ new Set(), includedTags = /* @__PURE__ */ new Set(), includeTagDefaults = false, runtimeGlobals, unpluginAutoImportGlobalScopes, serverAuthFunctionNames, projectIndexModuleSources, severityControls, userPlugins = [], disableReactHooksJsPlugin = false, ruleSelection, sidecarRuleIdFilter }) => {
|
|
72071
|
+
const createOxlintConfig = ({ pluginPath, project, customRulesOnly = false, extendsPaths = [], ignoredTags = /* @__PURE__ */ new Set(), includedTags = /* @__PURE__ */ new Set(), includeTagDefaults = false, runtimeGlobals, unpluginAutoImportGlobalScopes, serverAuthFunctionNames, projectIndexModuleSources, severityControls, adoptedSettings = {}, userPlugins = [], disableReactHooksJsPlugin = false, ruleSelection, sidecarRuleIdFilter }) => {
|
|
71823
72072
|
const hasIncludedTags = includedTags.size > 0;
|
|
71824
72073
|
const reactHooksJsPlugin = disableReactHooksJsPlugin || ruleSelection === "sidecar" || hasIncludedTags ? null : resolveReactHooksJsPlugin(project.hasReactCompiler || project.hasReactCompilerLintPlugin === true, customRulesOnly);
|
|
71825
72074
|
const reactCompilerRules = reactHooksJsPlugin ? applyRuleSeverityControls(filterRulesToAvailable(REACT_COMPILER_RULES, "react-hooks-js", reactHooksJsPlugin.availableRuleNames), severityControls) : {};
|
|
@@ -71874,23 +72123,26 @@ const createOxlintConfig = ({ pluginPath, project, customRulesOnly = false, exte
|
|
|
71874
72123
|
},
|
|
71875
72124
|
plugins: [],
|
|
71876
72125
|
jsPlugins: [...jsPlugins, pluginPath],
|
|
71877
|
-
settings: {
|
|
71878
|
-
|
|
71879
|
-
|
|
71880
|
-
|
|
71881
|
-
|
|
71882
|
-
|
|
71883
|
-
|
|
71884
|
-
|
|
71885
|
-
unpluginAutoImportGlobalScopes
|
|
71886
|
-
|
|
71887
|
-
|
|
71888
|
-
|
|
71889
|
-
|
|
71890
|
-
|
|
71891
|
-
|
|
71892
|
-
|
|
71893
|
-
|
|
72126
|
+
settings: {
|
|
72127
|
+
...adoptedSettings,
|
|
72128
|
+
"react-doctor": {
|
|
72129
|
+
portedRuleMode: "curated",
|
|
72130
|
+
framework: project.framework,
|
|
72131
|
+
rootDirectory: settingsRootDirectory,
|
|
72132
|
+
capabilities: [...capabilities].sort(),
|
|
72133
|
+
...runtimeGlobals && runtimeGlobals.length > 0 ? { runtimeGlobals: [...runtimeGlobals] } : {},
|
|
72134
|
+
...unpluginAutoImportGlobalScopes && unpluginAutoImportGlobalScopes.length > 0 ? {
|
|
72135
|
+
unpluginAutoImportRootDirectories: [...new Set([settingsRootDirectory, project.rootDirectory])],
|
|
72136
|
+
unpluginAutoImportGlobalScopes: unpluginAutoImportGlobalScopes.map((scope) => ({
|
|
72137
|
+
directory: scope.directory,
|
|
72138
|
+
names: [...scope.names]
|
|
72139
|
+
}))
|
|
72140
|
+
} : {},
|
|
72141
|
+
...project.shopifyFlashListMajorVersion !== null ? { shopifyFlashListMajorVersion: project.shopifyFlashListMajorVersion } : {},
|
|
72142
|
+
...serverAuthFunctionNames && serverAuthFunctionNames.length > 0 ? { serverAuthFunctionNames: [...serverAuthFunctionNames] } : {},
|
|
72143
|
+
...projectIndexModuleSources !== void 0 ? { projectIndexModuleSources: [...projectIndexModuleSources] } : {}
|
|
72144
|
+
}
|
|
72145
|
+
},
|
|
71894
72146
|
rules: {
|
|
71895
72147
|
...reactCompilerRules,
|
|
71896
72148
|
...enabledReactDoctorRules,
|
|
@@ -73024,6 +73276,46 @@ const buildProfiledNodeArguments = (input) => [
|
|
|
73024
73276
|
...input.heapProfileDirectory ? ["--heap-prof", `--heap-prof-dir=${input.heapProfileDirectory}`] : [],
|
|
73025
73277
|
...input.argumentsList
|
|
73026
73278
|
];
|
|
73279
|
+
const buildOxlintTimingArguments = (argumentsList) => {
|
|
73280
|
+
const timingArguments = [...argumentsList];
|
|
73281
|
+
const formatFlagIndex = timingArguments.indexOf("--format");
|
|
73282
|
+
if (formatFlagIndex === -1 || formatFlagIndex + 1 >= timingArguments.length) throw new Error("Oxlint timing arguments require a --format value");
|
|
73283
|
+
timingArguments[formatFlagIndex + 1] = "default";
|
|
73284
|
+
timingArguments.push("--debug", "timings", "--quiet");
|
|
73285
|
+
return timingArguments;
|
|
73286
|
+
};
|
|
73287
|
+
const captureOxlintRuleTimings = (input) => new Promise((resolve, reject) => {
|
|
73288
|
+
const timingEnvironment = { ...input.environment };
|
|
73289
|
+
timingEnvironment.REACT_DOCTOR_RULE_TIMINGS_DIR = void 0;
|
|
73290
|
+
const timingChild = spawn(input.nodeBinaryPath, buildOxlintTimingArguments(input.argumentsList), {
|
|
73291
|
+
cwd: input.rootDirectory,
|
|
73292
|
+
env: timingEnvironment,
|
|
73293
|
+
stdio: [
|
|
73294
|
+
"ignore",
|
|
73295
|
+
"pipe",
|
|
73296
|
+
"pipe"
|
|
73297
|
+
]
|
|
73298
|
+
});
|
|
73299
|
+
const stdoutBuffers = [];
|
|
73300
|
+
const stderrBuffers = [];
|
|
73301
|
+
timingChild.stdout.on("data", (buffer) => stdoutBuffers.push(buffer));
|
|
73302
|
+
timingChild.stderr.on("data", (buffer) => stderrBuffers.push(buffer));
|
|
73303
|
+
timingChild.on("error", reject);
|
|
73304
|
+
timingChild.on("close", (_code, signal) => {
|
|
73305
|
+
if (signal) {
|
|
73306
|
+
reject(/* @__PURE__ */ new Error(`Oxlint timing pass was killed by ${signal}`));
|
|
73307
|
+
return;
|
|
73308
|
+
}
|
|
73309
|
+
const timingOutput = `${Buffer.concat(stdoutBuffers).toString("utf8")}\n${Buffer.concat(stderrBuffers).toString("utf8")}`;
|
|
73310
|
+
if (!timingOutput.includes("Rule timings:")) {
|
|
73311
|
+
resolve();
|
|
73312
|
+
return;
|
|
73313
|
+
}
|
|
73314
|
+
fs$1$3.mkdirSync(input.timingDirectory, { recursive: true });
|
|
73315
|
+
fs$1$3.writeFileSync(path$1$1.join(input.timingDirectory, `oxlint-${timingChild.pid ?? process.pid}.timings.txt`), timingOutput);
|
|
73316
|
+
resolve();
|
|
73317
|
+
});
|
|
73318
|
+
});
|
|
73027
73319
|
const lowerChildProcessPriority = (processId) => {
|
|
73028
73320
|
if (processId === void 0) return;
|
|
73029
73321
|
try {
|
|
@@ -73145,7 +73437,18 @@ const spawnOxlint = (args, rootDirectory, nodeBinaryPath, spawnTimeoutMs = OXLIN
|
|
|
73145
73437
|
return;
|
|
73146
73438
|
}
|
|
73147
73439
|
}
|
|
73148
|
-
|
|
73440
|
+
const timingDirectory = SANITIZED_ENV.REACT_DOCTOR_OXLINT_TIMINGS_DIR;
|
|
73441
|
+
if (timingDirectory === void 0) {
|
|
73442
|
+
resolve(output);
|
|
73443
|
+
return;
|
|
73444
|
+
}
|
|
73445
|
+
captureOxlintRuleTimings({
|
|
73446
|
+
argumentsList: args,
|
|
73447
|
+
environment: SANITIZED_ENV,
|
|
73448
|
+
nodeBinaryPath,
|
|
73449
|
+
rootDirectory,
|
|
73450
|
+
timingDirectory
|
|
73451
|
+
}).then(() => resolve(output), reject);
|
|
73149
73452
|
});
|
|
73150
73453
|
});
|
|
73151
73454
|
const PARALLELISM_EXHAUSTION_ERROR_CODES = new Set([
|
|
@@ -73948,9 +74251,11 @@ const runOxlint = async (options) => {
|
|
|
73948
74251
|
return [];
|
|
73949
74252
|
}
|
|
73950
74253
|
const pluginPath = resolvePluginPath();
|
|
73951
|
-
const
|
|
74254
|
+
const detectedConfigPaths = adoptExistingLintConfig && !customRulesOnly ? detectUserLintConfigPaths(rootDirectory) : [];
|
|
74255
|
+
const extendsPaths = detectedConfigPaths.filter(canOxlintExtendConfig);
|
|
74256
|
+
const adoptedSettings = detectedConfigPaths.length > 0 ? readAdoptedLintConfigSettings(detectedConfigPaths) : {};
|
|
73952
74257
|
const userPlugins = includedTags.size > 0 ? [] : resolveUserPlugins(userConfig?.plugins, configSourceDirectory);
|
|
73953
|
-
const restoreDisableDirectives =
|
|
74258
|
+
const restoreDisableDirectives = await neutralizeDisableDirectives(rootDirectory, includePaths ?? options.precomputedSourceFiles?.map((sourceFile) => sourceFile.path), { recoverOnly: respectInlineDisables });
|
|
73954
74259
|
const configDirectory = fs$1$3.mkdtempSync(path$1$1.join(os.tmpdir(), "react-doctor-oxlintrc-"));
|
|
73955
74260
|
const configPath = path$1$1.join(configDirectory, "oxlintrc.json");
|
|
73956
74261
|
try {
|
|
@@ -74010,6 +74315,7 @@ const runOxlint = async (options) => {
|
|
|
74010
74315
|
serverAuthFunctionNames,
|
|
74011
74316
|
projectIndexModuleSources,
|
|
74012
74317
|
severityControls,
|
|
74318
|
+
adoptedSettings,
|
|
74013
74319
|
userPlugins,
|
|
74014
74320
|
disableReactHooksJsPlugin: overrides.disableReactHooksJsPlugin,
|
|
74015
74321
|
ruleSelection: overrides.ruleSelection,
|
|
@@ -75793,8 +76099,9 @@ const findWorstScoredProject = (projects) => {
|
|
|
75793
76099
|
return worst;
|
|
75794
76100
|
};
|
|
75795
76101
|
const toJsonReportDiagnostic = (diagnostic, projectRoot, reportRoot) => {
|
|
75796
|
-
const
|
|
75797
|
-
const
|
|
76102
|
+
const resolvedFilePath = resolveCandidateReadPath(projectRoot, diagnostic.filePath);
|
|
76103
|
+
const normalizedFilePath = toNormalizedRelativePath(resolvedFilePath, projectRoot);
|
|
76104
|
+
const reportRelativeFilePath = toNormalizedRelativePath(resolvedFilePath, reportRoot);
|
|
75798
76105
|
const ruleIdentity = getDiagnosticRuleIdentity(diagnostic);
|
|
75799
76106
|
return {
|
|
75800
76107
|
...diagnostic,
|
|
@@ -76415,11 +76722,13 @@ const METRIC = {
|
|
|
76415
76722
|
ciConfigured: "ci.configured",
|
|
76416
76723
|
rulesChanged: "rules.changed",
|
|
76417
76724
|
rulesQueried: "rules.queried",
|
|
76725
|
+
runtimeScanUrlPromptShown: "runtime_scan.url_prompt_shown",
|
|
76418
76726
|
tuiCompactReportShown: "tui.compact_report_shown",
|
|
76419
76727
|
tuiFindingNavigated: "tui.finding_navigated",
|
|
76420
76728
|
tuiIssueStreamShown: "tui.issue_stream_shown",
|
|
76421
76729
|
tuiProjectPathContextShown: "tui.project_path_context_shown",
|
|
76422
76730
|
tuiProjectSelectShown: "tui.project_select_shown",
|
|
76731
|
+
tuiCiRecommendationShown: "tui.ci_recommendation_shown",
|
|
76423
76732
|
tuiReportActionSelected: "tui.report_action_selected",
|
|
76424
76733
|
tuiCancelled: "tui.cancelled",
|
|
76425
76734
|
tuiScanInlineShown: "tui.scan_inline_shown",
|
|
@@ -76468,7 +76777,7 @@ const makeNoopConsole = () => ({
|
|
|
76468
76777
|
});
|
|
76469
76778
|
//#endregion
|
|
76470
76779
|
//#region src/cli/utils/version.ts
|
|
76471
|
-
const VERSION = "0.9.
|
|
76780
|
+
const VERSION = "0.9.13-dev.d030b11";
|
|
76472
76781
|
//#endregion
|
|
76473
76782
|
//#region src/cli/utils/json-mode.ts
|
|
76474
76783
|
let context = null;
|
|
@@ -76506,13 +76815,14 @@ const installSilentConsole = () => {
|
|
|
76506
76815
|
"trace"
|
|
76507
76816
|
]) target[key] = source[key];
|
|
76508
76817
|
};
|
|
76509
|
-
const enableJsonMode = ({ compact, directory, outputFile }) => {
|
|
76818
|
+
const enableJsonMode = ({ compact, directory, outputFile, writeCancellationError }) => {
|
|
76510
76819
|
context = {
|
|
76511
76820
|
compact,
|
|
76512
76821
|
directory,
|
|
76513
76822
|
startTime: performance$1.now(),
|
|
76514
76823
|
mode: "full",
|
|
76515
|
-
outputFile: null
|
|
76824
|
+
outputFile: null,
|
|
76825
|
+
writeCancellationError
|
|
76516
76826
|
};
|
|
76517
76827
|
installSilentConsole();
|
|
76518
76828
|
if (outputFile) {
|
|
@@ -76551,6 +76861,13 @@ const writeJsonErrorReport = (error, sentryEventId) => {
|
|
|
76551
76861
|
process.stdout.write(INTERNAL_ERROR_JSON_FALLBACK);
|
|
76552
76862
|
}
|
|
76553
76863
|
};
|
|
76864
|
+
const writeJsonCancellationReport = () => {
|
|
76865
|
+
if (context?.writeCancellationError !== void 0) {
|
|
76866
|
+
context.writeCancellationError();
|
|
76867
|
+
return;
|
|
76868
|
+
}
|
|
76869
|
+
writeJsonErrorReport(/* @__PURE__ */ new Error("Scan cancelled by user (SIGINT/SIGTERM)"));
|
|
76870
|
+
};
|
|
76554
76871
|
//#endregion
|
|
76555
76872
|
//#region src/cli/utils/run-id.ts
|
|
76556
76873
|
let cachedRunId;
|
|
@@ -76559,10 +76876,14 @@ const getRunId = () => {
|
|
|
76559
76876
|
return cachedRunId;
|
|
76560
76877
|
};
|
|
76561
76878
|
//#endregion
|
|
76879
|
+
//#region src/cli/utils/scrub-run-arguments.ts
|
|
76880
|
+
const scrubRunArguments = (argumentsList) => anonymizeText(argumentsList.map((argument) => argument.replace(/^((?:--[^=]+=)?)(?:https?|wss?):\/\/.+$/i, "$1<url>")).join(" "));
|
|
76881
|
+
//#endregion
|
|
76562
76882
|
//#region src/cli/utils/build-run-context.ts
|
|
76563
76883
|
const ROOT_SUBCOMMANDS = new Set([
|
|
76564
76884
|
"design",
|
|
76565
76885
|
"install",
|
|
76886
|
+
"scan",
|
|
76566
76887
|
"setup"
|
|
76567
76888
|
]);
|
|
76568
76889
|
const detectInvokedVia = () => {
|
|
@@ -76603,7 +76924,7 @@ const buildRunContext = () => {
|
|
|
76603
76924
|
runId: getRunId(),
|
|
76604
76925
|
origin: detectOrigin(),
|
|
76605
76926
|
command: detectCommand(userArguments),
|
|
76606
|
-
argv:
|
|
76927
|
+
argv: scrubRunArguments(userArguments),
|
|
76607
76928
|
cwd: scrubSensitivePaths(process.cwd()),
|
|
76608
76929
|
node: process.version,
|
|
76609
76930
|
nodeMajor: detectNodeMajor(),
|
|
@@ -76798,7 +77119,7 @@ const recordDistribution = (name, value, options = {}) => {
|
|
|
76798
77119
|
} catch {}
|
|
76799
77120
|
};
|
|
76800
77121
|
//#endregion
|
|
76801
|
-
export {
|
|
77122
|
+
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
77123
|
|
|
76803
|
-
//# sourceMappingURL=record-metric-
|
|
76804
|
-
//# debugId=
|
|
77124
|
+
//# sourceMappingURL=record-metric-BRc98SXW.js.map
|
|
77125
|
+
//# debugId=208a3329-9d08-5c10-9870-09285c73ceb9
|