react-doctor 0.9.12-dev.bd08406 → 0.9.12-dev.ca30808
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 +6 -0
- package/dist/{build-section-divider-DjX3mmIx.js → build-section-divider-DGcPvzjX.js} +7 -7
- package/dist/{ci-D0OU7_5i.js → ci-DZ9QnUV4.js} +12 -12
- package/dist/cli.js +67 -38
- package/dist/{design-D-9YrV4y.js → design-BlxQroSp.js} +4 -4
- package/dist/{devtools-BiC-AP3B.js → devtools-CC2PAZ85.js} +3 -3
- package/dist/{exit-gracefully-DuS_nzeq.js → exit-gracefully-Dt1ix6Xh.js} +6 -6
- package/dist/{get-east-asian-width-Cglw13G7.js → get-east-asian-width-Bv2TD3Xj.js} +3 -3
- package/dist/{handle-error-BzC_gVSx.js → handle-error-Cslt8b7C.js} +17 -12
- package/dist/index.js +459 -285
- package/dist/{inspect-NIjyNi5S.js → inspect-Dd1qqPJf.js} +38 -29
- package/dist/{install-BcGDtIYv.js → install-DeWeUjqr.js} +9 -9
- package/dist/{install-doctor-script-W-u3DPjZ.js → install-doctor-script-DbKR-GHo.js} +7 -14
- package/dist/{install-github-workflow-DqodeftR.js → install-github-workflow-Bkv_CMdF.js} +10 -6
- package/dist/{install-react-doctor-C3r0K9JP.js → install-react-doctor-DkfLDtWd.js} +8 -8
- package/dist/{jsx-runtime-BXnpEdz3.js → jsx-runtime-DwPH8QhA.js} +7 -7
- package/dist/path-format-DnHpmJwG.js +9 -0
- package/dist/{print-branded-header-eiCaprox.js → print-branded-header-CFNvp2ey.js} +4 -4
- package/dist/project-analysis-worker.js +53 -52
- package/dist/{prompt-runtime-scan-url-CAZLxZl0.js → prompt-runtime-scan-url-BuXp7_n4.js} +6 -6
- package/dist/{read-object-file-D4DobruV.js → read-object-file-CEbx-anl.js} +4 -4
- package/dist/{record-metric-CECbS8Qh.js → record-metric-BzGcVSov.js} +405 -230
- package/dist/{report-error-Ckftf8UM.js → report-error-ZMTPN93d.js} +5 -5
- package/dist/{report-workflow-result-MtfAsorD.js → report-workflow-result-CKUjTJpB.js} +5 -5
- package/dist/{resolve-scope-IDn0nWJF.js → resolve-scope-BgrQEVtj.js} +8 -10
- package/dist/{rules-6hA6QP9L.js → rules-DizN5gJ6.js} +6 -6
- package/dist/{run-scan-app-DNHg67cm.js → run-scan-app-CjSGMmOE.js} +17 -14
- package/dist/{runtime-scan-Dqqn1kW3.js → runtime-scan-DINB89wl.js} +9 -9
- package/dist/{sanitize-runtime-url-DhYx4VYy.js → sanitize-runtime-url-CFvLC0Vp.js} +4 -4
- package/dist/{scan-DtjqkKaM.js → scan-CEvjogRY.js} +17 -11
- package/dist/{should-fail-scan-gate-CXE70SlM.js → should-fail-scan-gate-gpuv_UOL.js} +19 -12
- package/dist/{should-skip-prompts-DwpFmYZZ.js → should-skip-prompts-F0NaNR8z.js} +4 -4
- package/dist/{should-use-tui-Cze9CmaN.js → should-use-tui-Dve0A4YR.js} +4 -4
- package/dist/{telemetry-runtime-DVy10F6G.js → telemetry-runtime-Bs7DsGaF.js} +55 -7
- package/dist/{unref-stdin-BKT_s38a.js → unref-stdin-SK3WfwxS.js} +3 -3
- package/dist/{version-Cr0PARuU.js → version-DVa-lN1C.js} +4 -4
- package/dist/{why-DnrSKh_M.js → why-BqR3fLtE.js} +4 -4
- package/dist/{with-run-span-BsK0r1ay.js → with-run-span-NbAvibgv.js} +5 -5
- package/package.json +3 -2
|
@@ -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]="903f2afd-3ece-5d3d-b803-69dfd65d9350")}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-hOS9iAJg.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;
|
|
@@ -65585,12 +65700,26 @@ const getEquivalentRuleKeys = (ruleKey) => {
|
|
|
65585
65700
|
const nativeRuleKey = canonicalizeRuleKey(ruleKey);
|
|
65586
65701
|
return [nativeRuleKey, ...getLegacyRuleKeysForNative(nativeRuleKey)];
|
|
65587
65702
|
};
|
|
65588
|
-
|
|
65589
|
-
|
|
65590
|
-
|
|
65591
|
-
|
|
65592
|
-
|
|
65703
|
+
/**
|
|
65704
|
+
* Resolves the absolute path to read for a diagnostic's `filePath`,
|
|
65705
|
+
* accounting for the various shapes oxlint emits:
|
|
65706
|
+
*
|
|
65707
|
+
* - `file://` URL — decode to an absolute filesystem path.
|
|
65708
|
+
* - Absolute POSIX (`/abs/path/file.tsx`) — pass through.
|
|
65709
|
+
* - Absolute Windows (`C:/...` or `C:\...`) — pass through.
|
|
65710
|
+
* - `./relative` or bare relative — join against `rootDirectory`.
|
|
65711
|
+
*
|
|
65712
|
+
* Shared between the streaming diagnostic pipeline and the legacy
|
|
65713
|
+
* array-shaped `mergeAndFilterDiagnostics` wrapper so file-line lookups
|
|
65714
|
+
* use one canonical resolution path.
|
|
65715
|
+
*/
|
|
65716
|
+
const resolveCandidateReadPath = (rootDirectory, filePath) => {
|
|
65717
|
+
if (filePath.startsWith("file://")) return fileURLToPath(filePath);
|
|
65718
|
+
const normalizedFile = filePath.replace(/\\/g, "/");
|
|
65719
|
+
if (normalizedFile.startsWith("/") || /^[a-zA-Z]:\//.test(normalizedFile) || /^[a-zA-Z]:\\/.test(filePath)) return filePath;
|
|
65720
|
+
return `${rootDirectory.replace(/\\/g, "/").replace(/\/$/, "")}/${normalizedFile.replace(/^\.\//, "")}`;
|
|
65593
65721
|
};
|
|
65722
|
+
const toNormalizedRelativePath = (filePath, rootDirectory) => path$1$1.relative(path$1$1.resolve(rootDirectory), path$1$1.resolve(resolveCandidateReadPath(rootDirectory, filePath))).replaceAll("\\", "/") || ".";
|
|
65594
65723
|
const warnConfigIssue = (message) => {
|
|
65595
65724
|
process.stderr.write(`[react-doctor] ${message}\n`);
|
|
65596
65725
|
};
|
|
@@ -65639,7 +65768,7 @@ const compileIgnoreOverrides = (userConfig) => {
|
|
|
65639
65768
|
};
|
|
65640
65769
|
const isDiagnosticIgnoredByOverrides = (diagnostic, rootDirectory, overrides) => {
|
|
65641
65770
|
if (overrides.length === 0) return false;
|
|
65642
|
-
const relativeFilePath =
|
|
65771
|
+
const relativeFilePath = toNormalizedRelativePath(diagnostic.filePath, rootDirectory);
|
|
65643
65772
|
const ruleIdentifier = `${diagnostic.plugin}/${diagnostic.rule}`;
|
|
65644
65773
|
return overrides.some((override) => override.filePatterns.some((pattern) => pattern.test(relativeFilePath)) && hasMatchingRuleOverride(override.ruleIds, ruleIdentifier));
|
|
65645
65774
|
};
|
|
@@ -65979,7 +66108,7 @@ const compileIgnoredFilePatterns = (userConfig) => {
|
|
|
65979
66108
|
};
|
|
65980
66109
|
const isFileIgnoredByPatterns = (filePath, rootDirectory, patterns) => {
|
|
65981
66110
|
if (patterns.length === 0) return false;
|
|
65982
|
-
const relativePath =
|
|
66111
|
+
const relativePath = toNormalizedRelativePath(filePath, rootDirectory);
|
|
65983
66112
|
return patterns.some((pattern) => pattern.test(relativePath));
|
|
65984
66113
|
};
|
|
65985
66114
|
const SCRIPT_EXTENSION_FRAGMENT = "[cm]?[jt]sx?";
|
|
@@ -66103,25 +66232,6 @@ const classifyPackageRole = (filename) => {
|
|
|
66103
66232
|
return result;
|
|
66104
66233
|
};
|
|
66105
66234
|
/**
|
|
66106
|
-
* Resolves the absolute path to read for a diagnostic's `filePath`,
|
|
66107
|
-
* accounting for the various shapes oxlint emits:
|
|
66108
|
-
*
|
|
66109
|
-
* - `file://` URL — decode to an absolute filesystem path.
|
|
66110
|
-
* - Absolute POSIX (`/abs/path/file.tsx`) — pass through.
|
|
66111
|
-
* - Absolute Windows (`C:/...` or `C:\...`) — pass through.
|
|
66112
|
-
* - `./relative` or bare relative — join against `rootDirectory`.
|
|
66113
|
-
*
|
|
66114
|
-
* Shared between the streaming diagnostic pipeline and the legacy
|
|
66115
|
-
* array-shaped `mergeAndFilterDiagnostics` wrapper so file-line lookups
|
|
66116
|
-
* use one canonical resolution path.
|
|
66117
|
-
*/
|
|
66118
|
-
const resolveCandidateReadPath = (rootDirectory, filePath) => {
|
|
66119
|
-
if (filePath.startsWith("file://")) return fileURLToPath(filePath);
|
|
66120
|
-
const normalizedFile = filePath.replace(/\\/g, "/");
|
|
66121
|
-
if (normalizedFile.startsWith("/") || /^[a-zA-Z]:\//.test(normalizedFile) || /^[a-zA-Z]:\\/.test(filePath)) return filePath;
|
|
66122
|
-
return `${rootDirectory.replace(/\\/g, "/").replace(/\/$/, "")}/${normalizedFile.replace(/^\.\//, "")}`;
|
|
66123
|
-
};
|
|
66124
|
-
/**
|
|
66125
66235
|
* Shared raw-line scanners that detect whether a diagnostic site is
|
|
66126
66236
|
* enclosed by a configured `textComponents` entry or a
|
|
66127
66237
|
* `rawTextWrapperComponents` entry. Both checks are used by the
|
|
@@ -67805,6 +67915,28 @@ const checkExpoEnvLocalFiles = (context) => {
|
|
|
67805
67915
|
help: `Add \`.env*.local\` to your .gitignore. If already committed, untrack with \`git rm --cached ${committedEnvFiles.join(" ")}\``
|
|
67806
67916
|
})];
|
|
67807
67917
|
};
|
|
67918
|
+
const JAVASCRIPT_MODULE_FILE_PATTERN = /\.[cm]?[jt]sx?$/;
|
|
67919
|
+
const hasStaticModuleSubpath = (rootDirectory, packageName) => {
|
|
67920
|
+
const packageSubpathPrefix = `${packageName}/`;
|
|
67921
|
+
for (const { absolutePath, name } of walkSourceTreeFiles(rootDirectory)) {
|
|
67922
|
+
if (!JAVASCRIPT_MODULE_FILE_PATTERN.test(name)) continue;
|
|
67923
|
+
let sourceText;
|
|
67924
|
+
try {
|
|
67925
|
+
sourceText = fs$1$3.readFileSync(absolutePath, "utf-8");
|
|
67926
|
+
} catch {
|
|
67927
|
+
continue;
|
|
67928
|
+
}
|
|
67929
|
+
if (!sourceText.includes(packageSubpathPrefix)) continue;
|
|
67930
|
+
let moduleSpecifiers;
|
|
67931
|
+
try {
|
|
67932
|
+
moduleSpecifiers = collectStaticModuleSpecifiers(sourceText, { filePath: absolutePath });
|
|
67933
|
+
} catch {
|
|
67934
|
+
continue;
|
|
67935
|
+
}
|
|
67936
|
+
for (const moduleSpecifier of moduleSpecifiers) if (moduleSpecifier.startsWith(packageSubpathPrefix)) return true;
|
|
67937
|
+
}
|
|
67938
|
+
return false;
|
|
67939
|
+
};
|
|
67808
67940
|
const isExpoSdkAtLeast = (expoSdkMajor, minMajor) => expoSdkMajor !== null && expoSdkMajor >= minMajor;
|
|
67809
67941
|
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";
|
|
67810
67942
|
const FIREBASE_HELP = "Use the Firebase JS SDK or React Native Firebase directly. See https://expo.fyi/firebase-migration-guide";
|
|
@@ -67858,7 +67990,8 @@ const FLAGGED_DEPENDENCIES = [
|
|
|
67858
67990
|
packageName: "@expo/metro-config",
|
|
67859
67991
|
rule: "expo-no-redundant-dependency",
|
|
67860
67992
|
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",
|
|
67861
|
-
help: "Remove `@expo/metro-config` and import `expo/metro-config` in your metro.config.js"
|
|
67993
|
+
help: "Remove `@expo/metro-config` and import `expo/metro-config` in your metro.config.js",
|
|
67994
|
+
skipWhenSubpathImported: true
|
|
67862
67995
|
},
|
|
67863
67996
|
{
|
|
67864
67997
|
packageName: "@types/react-native",
|
|
@@ -67919,8 +68052,9 @@ const FLAGGED_DEPENDENCIES = [
|
|
|
67919
68052
|
];
|
|
67920
68053
|
const checkExpoFlaggedDependencies = (context) => FLAGGED_DEPENDENCIES.filter((flaggedDependency) => {
|
|
67921
68054
|
if (!context.directDependencyNames.has(flaggedDependency.packageName)) return false;
|
|
67922
|
-
if (flaggedDependency.minSdkMajor
|
|
67923
|
-
|
|
68055
|
+
if (flaggedDependency.minSdkMajor !== void 0 && !isExpoSdkAtLeast(context.expoSdkMajor, flaggedDependency.minSdkMajor)) return false;
|
|
68056
|
+
if (flaggedDependency.skipWhenSubpathImported && hasStaticModuleSubpath(context.rootDirectory, flaggedDependency.packageName)) return false;
|
|
68057
|
+
return true;
|
|
67924
68058
|
}).map((flaggedDependency) => buildExpoDiagnostic({
|
|
67925
68059
|
rule: flaggedDependency.rule,
|
|
67926
68060
|
message: flaggedDependency.message,
|
|
@@ -67989,18 +68123,58 @@ const METRO_CONFIG_FILE_NAMES = [
|
|
|
67989
68123
|
const EXPO_METRO_CONFIG_EXTEND_SIGNALS = [
|
|
67990
68124
|
"expo/metro-config",
|
|
67991
68125
|
"@sentry/react-native/metro",
|
|
67992
|
-
"getSentryExpoConfig"
|
|
68126
|
+
"getSentryExpoConfig",
|
|
68127
|
+
"posthog-react-native/metro",
|
|
68128
|
+
"getPostHogExpoConfig"
|
|
67993
68129
|
];
|
|
68130
|
+
const resolveLocalMetroConfigModule = (moduleSpecifier, importingFilePath, rootDirectory) => {
|
|
68131
|
+
if (!moduleSpecifier.startsWith(".")) return void 0;
|
|
68132
|
+
const importedPath = path$1$1.resolve(path$1$1.dirname(importingFilePath), moduleSpecifier);
|
|
68133
|
+
const candidateBasePaths = [
|
|
68134
|
+
importedPath,
|
|
68135
|
+
importedPath.replace(/\.[cm]?js$/, ""),
|
|
68136
|
+
path$1$1.join(importedPath, "index")
|
|
68137
|
+
];
|
|
68138
|
+
for (const candidateBasePath of candidateBasePaths) {
|
|
68139
|
+
const resolvedPath = resolveEntryWithExtensions(candidateBasePath);
|
|
68140
|
+
if (resolvedPath !== void 0 && isFile(resolvedPath) && isPathInsideDirectoryOrEqual(resolvedPath, rootDirectory)) return resolvedPath;
|
|
68141
|
+
}
|
|
68142
|
+
};
|
|
68143
|
+
const hasExpoMetroConfigSignal = (metroConfigPath, rootDirectory) => {
|
|
68144
|
+
const pendingFilePaths = [metroConfigPath];
|
|
68145
|
+
const visitedFilePaths = /* @__PURE__ */ new Set();
|
|
68146
|
+
while (pendingFilePaths.length > 0) {
|
|
68147
|
+
const currentFilePath = pendingFilePaths.pop();
|
|
68148
|
+
if (currentFilePath === void 0 || visitedFilePaths.has(currentFilePath)) continue;
|
|
68149
|
+
if (visitedFilePaths.size >= 100) return true;
|
|
68150
|
+
visitedFilePaths.add(currentFilePath);
|
|
68151
|
+
let contents;
|
|
68152
|
+
try {
|
|
68153
|
+
contents = fs$1$3.readFileSync(currentFilePath, "utf-8");
|
|
68154
|
+
} catch {
|
|
68155
|
+
return true;
|
|
68156
|
+
}
|
|
68157
|
+
if (EXPO_METRO_CONFIG_EXTEND_SIGNALS.some((signal) => contents.includes(signal))) return true;
|
|
68158
|
+
let moduleSpecifiers;
|
|
68159
|
+
try {
|
|
68160
|
+
moduleSpecifiers = collectStaticModuleSpecifiers(contents, {
|
|
68161
|
+
filePath: currentFilePath,
|
|
68162
|
+
includeTypeOnly: false
|
|
68163
|
+
});
|
|
68164
|
+
} catch {
|
|
68165
|
+
continue;
|
|
68166
|
+
}
|
|
68167
|
+
for (const moduleSpecifier of moduleSpecifiers) {
|
|
68168
|
+
const localModulePath = resolveLocalMetroConfigModule(moduleSpecifier, currentFilePath, rootDirectory);
|
|
68169
|
+
if (localModulePath !== void 0 && !visitedFilePaths.has(localModulePath)) pendingFilePaths.push(localModulePath);
|
|
68170
|
+
}
|
|
68171
|
+
}
|
|
68172
|
+
return false;
|
|
68173
|
+
};
|
|
67994
68174
|
const checkExpoMetroConfig = (context) => {
|
|
67995
68175
|
const metroConfigPath = METRO_CONFIG_FILE_NAMES.map((fileName) => path$1$1.join(context.rootDirectory, fileName)).find((candidatePath) => isFile(candidatePath));
|
|
67996
68176
|
if (metroConfigPath === void 0) return [];
|
|
67997
|
-
|
|
67998
|
-
try {
|
|
67999
|
-
contents = fs$1$3.readFileSync(metroConfigPath, "utf-8");
|
|
68000
|
-
} catch {
|
|
68001
|
-
return [];
|
|
68002
|
-
}
|
|
68003
|
-
if (EXPO_METRO_CONFIG_EXTEND_SIGNALS.some((signal) => contents.includes(signal))) return [];
|
|
68177
|
+
if (hasExpoMetroConfigSignal(metroConfigPath, context.rootDirectory)) return [];
|
|
68004
68178
|
return [buildExpoDiagnostic({
|
|
68005
68179
|
rule: "expo-metro-config",
|
|
68006
68180
|
filePath: path$1$1.basename(metroConfigPath),
|
|
@@ -69586,72 +69760,6 @@ const checkSecurityScanCooperative = async (rootDirectory, options = {}) => {
|
|
|
69586
69760
|
}
|
|
69587
69761
|
return session.diagnostics;
|
|
69588
69762
|
};
|
|
69589
|
-
var import_picocolors = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
69590
|
-
let p = process || {}, argv = p.argv || [], env = p.env || {};
|
|
69591
|
-
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);
|
|
69592
|
-
let formatter = (open, close, replace = open) => (input) => {
|
|
69593
|
-
let string = "" + input, index = string.indexOf(close, open.length);
|
|
69594
|
-
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
69595
|
-
};
|
|
69596
|
-
let replaceClose = (string, close, replace, index) => {
|
|
69597
|
-
let result = "", cursor = 0;
|
|
69598
|
-
do {
|
|
69599
|
-
result += string.substring(cursor, index) + replace;
|
|
69600
|
-
cursor = index + close.length;
|
|
69601
|
-
index = string.indexOf(close, cursor);
|
|
69602
|
-
} while (~index);
|
|
69603
|
-
return result + string.substring(cursor);
|
|
69604
|
-
};
|
|
69605
|
-
let createColors = (enabled = isColorSupported) => {
|
|
69606
|
-
let f = enabled ? formatter : () => String;
|
|
69607
|
-
return {
|
|
69608
|
-
isColorSupported: enabled,
|
|
69609
|
-
reset: f("\x1B[0m", "\x1B[0m"),
|
|
69610
|
-
bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
|
|
69611
|
-
dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
|
|
69612
|
-
italic: f("\x1B[3m", "\x1B[23m"),
|
|
69613
|
-
underline: f("\x1B[4m", "\x1B[24m"),
|
|
69614
|
-
inverse: f("\x1B[7m", "\x1B[27m"),
|
|
69615
|
-
hidden: f("\x1B[8m", "\x1B[28m"),
|
|
69616
|
-
strikethrough: f("\x1B[9m", "\x1B[29m"),
|
|
69617
|
-
black: f("\x1B[30m", "\x1B[39m"),
|
|
69618
|
-
red: f("\x1B[31m", "\x1B[39m"),
|
|
69619
|
-
green: f("\x1B[32m", "\x1B[39m"),
|
|
69620
|
-
yellow: f("\x1B[33m", "\x1B[39m"),
|
|
69621
|
-
blue: f("\x1B[34m", "\x1B[39m"),
|
|
69622
|
-
magenta: f("\x1B[35m", "\x1B[39m"),
|
|
69623
|
-
cyan: f("\x1B[36m", "\x1B[39m"),
|
|
69624
|
-
white: f("\x1B[37m", "\x1B[39m"),
|
|
69625
|
-
gray: f("\x1B[90m", "\x1B[39m"),
|
|
69626
|
-
bgBlack: f("\x1B[40m", "\x1B[49m"),
|
|
69627
|
-
bgRed: f("\x1B[41m", "\x1B[49m"),
|
|
69628
|
-
bgGreen: f("\x1B[42m", "\x1B[49m"),
|
|
69629
|
-
bgYellow: f("\x1B[43m", "\x1B[49m"),
|
|
69630
|
-
bgBlue: f("\x1B[44m", "\x1B[49m"),
|
|
69631
|
-
bgMagenta: f("\x1B[45m", "\x1B[49m"),
|
|
69632
|
-
bgCyan: f("\x1B[46m", "\x1B[49m"),
|
|
69633
|
-
bgWhite: f("\x1B[47m", "\x1B[49m"),
|
|
69634
|
-
blackBright: f("\x1B[90m", "\x1B[39m"),
|
|
69635
|
-
redBright: f("\x1B[91m", "\x1B[39m"),
|
|
69636
|
-
greenBright: f("\x1B[92m", "\x1B[39m"),
|
|
69637
|
-
yellowBright: f("\x1B[93m", "\x1B[39m"),
|
|
69638
|
-
blueBright: f("\x1B[94m", "\x1B[39m"),
|
|
69639
|
-
magentaBright: f("\x1B[95m", "\x1B[39m"),
|
|
69640
|
-
cyanBright: f("\x1B[96m", "\x1B[39m"),
|
|
69641
|
-
whiteBright: f("\x1B[97m", "\x1B[39m"),
|
|
69642
|
-
bgBlackBright: f("\x1B[100m", "\x1B[49m"),
|
|
69643
|
-
bgRedBright: f("\x1B[101m", "\x1B[49m"),
|
|
69644
|
-
bgGreenBright: f("\x1B[102m", "\x1B[49m"),
|
|
69645
|
-
bgYellowBright: f("\x1B[103m", "\x1B[49m"),
|
|
69646
|
-
bgBlueBright: f("\x1B[104m", "\x1B[49m"),
|
|
69647
|
-
bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
|
|
69648
|
-
bgCyanBright: f("\x1B[106m", "\x1B[49m"),
|
|
69649
|
-
bgWhiteBright: f("\x1B[107m", "\x1B[49m")
|
|
69650
|
-
};
|
|
69651
|
-
};
|
|
69652
|
-
module.exports = createColors();
|
|
69653
|
-
module.exports.createColors = createColors;
|
|
69654
|
-
})))(), 1);
|
|
69655
69763
|
const highlighter = {
|
|
69656
69764
|
error: import_picocolors.default.red,
|
|
69657
69765
|
warn: import_picocolors.default.yellow,
|
|
@@ -69827,6 +69935,12 @@ const withProjectAnalysisWorkerSlot = async (task, abortSignal) => {
|
|
|
69827
69935
|
});
|
|
69828
69936
|
return projectAnalysisWorkerSlots.run(task, abortSignal);
|
|
69829
69937
|
};
|
|
69938
|
+
const toRelativePath = (filePath, rootDirectory) => {
|
|
69939
|
+
const normalizedFilePath = filePath.replace(/\\/g, "/");
|
|
69940
|
+
const normalizedRoot = rootDirectory.replace(/\\/g, "/").replace(/\/$/, "") + "/";
|
|
69941
|
+
if (normalizedFilePath.startsWith(normalizedRoot)) return normalizedFilePath.slice(normalizedRoot.length);
|
|
69942
|
+
return normalizedFilePath.replace(/^\.\//, "");
|
|
69943
|
+
};
|
|
69830
69944
|
const REACT_DOCTOR_TOOLCHAIN_PACKAGES = new Set([
|
|
69831
69945
|
"react-doctor",
|
|
69832
69946
|
"eslint-plugin-react-doctor",
|
|
@@ -70655,7 +70769,6 @@ const readTextFileUpToCharacterLimit = async (input) => {
|
|
|
70655
70769
|
input.signal?.throwIfAborted();
|
|
70656
70770
|
return buffer.subarray(0, readOffset).toString("utf-8");
|
|
70657
70771
|
};
|
|
70658
|
-
const toNormalizedRelativePath = (filePath, rootDirectory) => path$1$1.relative(path$1$1.resolve(rootDirectory), path$1$1.resolve(rootDirectory, filePath)).replaceAll("\\", "/") || ".";
|
|
70659
70772
|
const buildJsxSourceReader = async (input) => {
|
|
70660
70773
|
const ignoredFilePatterns = compileGlobPatternsLenient(input.ignorePatterns ?? [], (error) => warnConfigIssue(`ignore.files: ${error.message}`));
|
|
70661
70774
|
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));
|
|
@@ -71067,7 +71180,11 @@ var Git = class Git extends Service()("react-doctor/Git") {
|
|
|
71067
71180
|
const symref = yield* runGit(directory, ["symbolic-ref", "refs/remotes/origin/HEAD"]);
|
|
71068
71181
|
if (symref.status === 0) {
|
|
71069
71182
|
const trimmed = trimOrNull(symref.stdout);
|
|
71070
|
-
if (trimmed !== null)
|
|
71183
|
+
if (trimmed !== null) {
|
|
71184
|
+
const branchName = trimmed.replace("refs/remotes/origin/", "");
|
|
71185
|
+
const remoteBranch = `origin/${branchName}`;
|
|
71186
|
+
return (yield* branchExists(directory, remoteBranch)) ? remoteBranch : branchName;
|
|
71187
|
+
}
|
|
71071
71188
|
}
|
|
71072
71189
|
const candidates = yield* runGit(directory, [
|
|
71073
71190
|
"for-each-ref",
|
|
@@ -71075,7 +71192,10 @@ var Git = class Git extends Service()("react-doctor/Git") {
|
|
|
71075
71192
|
...DEFAULT_BRANCH_CANDIDATES.map((candidate) => `refs/heads/${candidate}`)
|
|
71076
71193
|
]);
|
|
71077
71194
|
if (candidates.status !== 0) return null;
|
|
71078
|
-
|
|
71195
|
+
const localBranch = trimOrNull(candidates.stdout.split("\n")[0] ?? "");
|
|
71196
|
+
if (localBranch === null) return null;
|
|
71197
|
+
const remoteBranch = `origin/${localBranch}`;
|
|
71198
|
+
return (yield* branchExists(directory, remoteBranch)) ? remoteBranch : localBranch;
|
|
71079
71199
|
}).pipe(withSpan("Git.defaultBranch"));
|
|
71080
71200
|
const branchExists = (directory, branch) => runGit(directory, [
|
|
71081
71201
|
"rev-parse",
|
|
@@ -71412,59 +71532,11 @@ const isLocalPathExtend = (entry) => {
|
|
|
71412
71532
|
for (const prefix of EXTENDS_LOCAL_PATH_PREFIXES) if (entry.startsWith(prefix)) return true;
|
|
71413
71533
|
return false;
|
|
71414
71534
|
};
|
|
71415
|
-
const stripJsoncComments = (raw) => {
|
|
71416
|
-
let result = "";
|
|
71417
|
-
let cursor = 0;
|
|
71418
|
-
let inString = false;
|
|
71419
|
-
let stringQuote = "";
|
|
71420
|
-
while (cursor < raw.length) {
|
|
71421
|
-
const character = raw[cursor];
|
|
71422
|
-
const nextCharacter = raw[cursor + 1];
|
|
71423
|
-
if (inString) {
|
|
71424
|
-
result += character;
|
|
71425
|
-
if (character === "\\" && cursor + 1 < raw.length) {
|
|
71426
|
-
result += nextCharacter;
|
|
71427
|
-
cursor += 2;
|
|
71428
|
-
continue;
|
|
71429
|
-
}
|
|
71430
|
-
if (character === stringQuote) inString = false;
|
|
71431
|
-
cursor += 1;
|
|
71432
|
-
continue;
|
|
71433
|
-
}
|
|
71434
|
-
if (character === "\"" || character === "'") {
|
|
71435
|
-
inString = true;
|
|
71436
|
-
stringQuote = character;
|
|
71437
|
-
result += character;
|
|
71438
|
-
cursor += 1;
|
|
71439
|
-
continue;
|
|
71440
|
-
}
|
|
71441
|
-
if (character === "/" && nextCharacter === "/") {
|
|
71442
|
-
const lineEndIndex = raw.indexOf("\n", cursor);
|
|
71443
|
-
cursor = lineEndIndex === -1 ? raw.length : lineEndIndex;
|
|
71444
|
-
continue;
|
|
71445
|
-
}
|
|
71446
|
-
if (character === "/" && nextCharacter === "*") {
|
|
71447
|
-
const blockEndIndex = raw.indexOf("*/", cursor + 2);
|
|
71448
|
-
cursor = blockEndIndex === -1 ? raw.length : blockEndIndex + 2;
|
|
71449
|
-
continue;
|
|
71450
|
-
}
|
|
71451
|
-
result += character;
|
|
71452
|
-
cursor += 1;
|
|
71453
|
-
}
|
|
71454
|
-
return result;
|
|
71455
|
-
};
|
|
71456
|
-
const parseJsonOrJsonc = (raw) => {
|
|
71457
|
-
try {
|
|
71458
|
-
return JSON.parse(raw);
|
|
71459
|
-
} catch {
|
|
71460
|
-
return JSON.parse(stripJsoncComments(raw));
|
|
71461
|
-
}
|
|
71462
|
-
};
|
|
71463
71535
|
const canOxlintExtendConfig = (configPath) => {
|
|
71464
71536
|
if (!configPath.endsWith(".eslintrc.json")) return true;
|
|
71465
71537
|
let parsed;
|
|
71466
71538
|
try {
|
|
71467
|
-
parsed =
|
|
71539
|
+
parsed = parseJSONC(fs$1$3.readFileSync(configPath, "utf-8"), { allowTrailingComma: true });
|
|
71468
71540
|
} catch {
|
|
71469
71541
|
return true;
|
|
71470
71542
|
}
|
|
@@ -71573,7 +71645,39 @@ const detectUserLintConfigPaths = (rootDirectory) => {
|
|
|
71573
71645
|
}
|
|
71574
71646
|
return [];
|
|
71575
71647
|
};
|
|
71648
|
+
const readAdoptedLintConfigSettings = (configPaths) => {
|
|
71649
|
+
const mergedSettings = /* @__PURE__ */ new Map();
|
|
71650
|
+
for (const configPath of configPaths) {
|
|
71651
|
+
let parsed;
|
|
71652
|
+
try {
|
|
71653
|
+
parsed = parseJSONC(fs$1$3.readFileSync(configPath, "utf-8"), { allowTrailingComma: true });
|
|
71654
|
+
} catch {
|
|
71655
|
+
continue;
|
|
71656
|
+
}
|
|
71657
|
+
if (!isPlainObject(parsed)) continue;
|
|
71658
|
+
const settings = parsed.settings;
|
|
71659
|
+
if (!isPlainObject(settings)) continue;
|
|
71660
|
+
for (const [pluginName, pluginSettings] of Object.entries(settings)) {
|
|
71661
|
+
if (pluginName === "react-doctor") continue;
|
|
71662
|
+
mergedSettings.set(pluginName, pluginSettings);
|
|
71663
|
+
}
|
|
71664
|
+
}
|
|
71665
|
+
return Object.fromEntries(mergedSettings);
|
|
71666
|
+
};
|
|
71576
71667
|
const DISABLE_DIRECTIVE_PATTERN = /(eslint|oxlint)-disable/;
|
|
71668
|
+
const getBackupRootDirectory = (rootDirectory) => path$1$1.join(rootDirectory, ...DISABLE_DIRECTIVE_BACKUP_DIRECTORY_SEGMENTS);
|
|
71669
|
+
const getBackupPath = (rootDirectory, absolutePath) => {
|
|
71670
|
+
if (!isPathInsideDirectory(absolutePath, rootDirectory)) return null;
|
|
71671
|
+
return path$1$1.join(getBackupRootDirectory(rootDirectory), path$1$1.relative(rootDirectory, absolutePath));
|
|
71672
|
+
};
|
|
71673
|
+
const removeBackupRootIfEmpty = (rootDirectory) => {
|
|
71674
|
+
const backupRootDirectory = getBackupRootDirectory(rootDirectory);
|
|
71675
|
+
if (!walkSourceTreeFiles(backupRootDirectory).next().done) return;
|
|
71676
|
+
fs$1$3.rmSync(backupRootDirectory, {
|
|
71677
|
+
recursive: true,
|
|
71678
|
+
force: true
|
|
71679
|
+
});
|
|
71680
|
+
};
|
|
71577
71681
|
const neutralizedFileLeases = /* @__PURE__ */ new Map();
|
|
71578
71682
|
const activeNeutralizationInitializations = /* @__PURE__ */ new Set();
|
|
71579
71683
|
const directoriesOverlap = (left, right) => {
|
|
@@ -71665,8 +71769,50 @@ const collectNeutralizationCandidatePaths = (rootDirectory, discoveredRelativePa
|
|
|
71665
71769
|
}
|
|
71666
71770
|
return candidatePaths;
|
|
71667
71771
|
};
|
|
71772
|
+
const recoverOrphanedBackups = (rootDirectory) => {
|
|
71773
|
+
const blockedPaths = /* @__PURE__ */ new Set();
|
|
71774
|
+
const backupRootDirectory = getBackupRootDirectory(rootDirectory);
|
|
71775
|
+
for (const { absolutePath: backupPath } of walkSourceTreeFiles(backupRootDirectory)) {
|
|
71776
|
+
const originalPath = path$1$1.join(rootDirectory, path$1$1.relative(backupRootDirectory, backupPath));
|
|
71777
|
+
if (neutralizedFileLeases.has(originalPath)) continue;
|
|
71778
|
+
let backupContent;
|
|
71779
|
+
let currentContent;
|
|
71780
|
+
try {
|
|
71781
|
+
backupContent = fs$1$3.readFileSync(backupPath, "utf-8");
|
|
71782
|
+
currentContent = fs$1$3.readFileSync(originalPath, "utf-8");
|
|
71783
|
+
} catch (error) {
|
|
71784
|
+
process.stderr.write(`[react-doctor] Could not recover ${originalPath}: ${messageFromUnknown(error)}. The backup remains at ${backupPath}.\n`);
|
|
71785
|
+
blockedPaths.add(originalPath);
|
|
71786
|
+
continue;
|
|
71787
|
+
}
|
|
71788
|
+
if (currentContent === backupContent) {
|
|
71789
|
+
try {
|
|
71790
|
+
fs$1$3.rmSync(backupPath);
|
|
71791
|
+
} catch (error) {
|
|
71792
|
+
process.stderr.write(`[react-doctor] Failed to delete stale backup ${backupPath}: ${messageFromUnknown(error)}\n`);
|
|
71793
|
+
blockedPaths.add(originalPath);
|
|
71794
|
+
}
|
|
71795
|
+
continue;
|
|
71796
|
+
}
|
|
71797
|
+
if (currentContent !== neutralizeContent(backupContent)) {
|
|
71798
|
+
process.stderr.write(`[react-doctor] Did not overwrite changed file ${originalPath}. Recover it manually from ${backupPath}.\n`);
|
|
71799
|
+
blockedPaths.add(originalPath);
|
|
71800
|
+
continue;
|
|
71801
|
+
}
|
|
71802
|
+
try {
|
|
71803
|
+
fs$1$3.writeFileSync(originalPath, backupContent);
|
|
71804
|
+
fs$1$3.rmSync(backupPath);
|
|
71805
|
+
} catch (error) {
|
|
71806
|
+
process.stderr.write(`[react-doctor] Failed to restore ${originalPath} from backup: ${messageFromUnknown(error)}\n`);
|
|
71807
|
+
blockedPaths.add(originalPath);
|
|
71808
|
+
}
|
|
71809
|
+
}
|
|
71810
|
+
removeBackupRootIfEmpty(rootDirectory);
|
|
71811
|
+
return blockedPaths;
|
|
71812
|
+
};
|
|
71668
71813
|
const neutralizeDisableDirectives = async (rootDirectory, includePaths, options = {}) => {
|
|
71669
71814
|
const resolvedRootDirectory = fs$1$3.realpathSync(rootDirectory);
|
|
71815
|
+
const blockedPaths = /* @__PURE__ */ new Set();
|
|
71670
71816
|
const leasedPaths = /* @__PURE__ */ new Set();
|
|
71671
71817
|
let isRestored = false;
|
|
71672
71818
|
const restore = () => {
|
|
@@ -71679,16 +71825,24 @@ const neutralizeDisableDirectives = async (rootDirectory, includePaths, options
|
|
|
71679
71825
|
if (lease.referenceCount > 0) continue;
|
|
71680
71826
|
neutralizedFileLeases.delete(absolutePath);
|
|
71681
71827
|
try {
|
|
71682
|
-
fs$1$3.
|
|
71828
|
+
const currentContent = fs$1$3.readFileSync(absolutePath, "utf-8");
|
|
71829
|
+
if (currentContent !== lease.neutralizedContent && currentContent !== lease.originalContent) {
|
|
71830
|
+
process.stderr.write(`[react-doctor] Did not overwrite changed file ${absolutePath}. Recover it manually from ${lease.backupPath}.\n`);
|
|
71831
|
+
continue;
|
|
71832
|
+
}
|
|
71833
|
+
if (currentContent === lease.neutralizedContent) fs$1$3.writeFileSync(absolutePath, lease.originalContent);
|
|
71834
|
+
fs$1$3.rmSync(lease.backupPath, { force: true });
|
|
71683
71835
|
} catch (error) {
|
|
71684
|
-
process.stderr.write(`[react-doctor] Failed to restore inline disable directives in ${absolutePath}: ${messageFromUnknown(error)}
|
|
71836
|
+
process.stderr.write(`[react-doctor] Failed to restore inline disable directives in ${absolutePath}: ${messageFromUnknown(error)}. The backup remains at ${lease.backupPath}.\n`);
|
|
71685
71837
|
}
|
|
71686
71838
|
}
|
|
71839
|
+
removeBackupRootIfEmpty(resolvedRootDirectory);
|
|
71687
71840
|
};
|
|
71688
71841
|
const onExit = () => restore();
|
|
71689
71842
|
process.once("exit", onExit);
|
|
71690
71843
|
const leaseCandidatePath = (absolutePath) => {
|
|
71691
71844
|
if (leasedPaths.has(absolutePath)) return;
|
|
71845
|
+
if (blockedPaths.has(absolutePath)) return;
|
|
71692
71846
|
const existingLease = neutralizedFileLeases.get(absolutePath);
|
|
71693
71847
|
if (existingLease) {
|
|
71694
71848
|
existingLease.referenceCount += 1;
|
|
@@ -71703,9 +71857,20 @@ const neutralizeDisableDirectives = async (rootDirectory, includePaths, options
|
|
|
71703
71857
|
}
|
|
71704
71858
|
const neutralizedContent = neutralizeContent(originalContent);
|
|
71705
71859
|
if (neutralizedContent !== originalContent) {
|
|
71860
|
+
const backupPath = getBackupPath(resolvedRootDirectory, absolutePath);
|
|
71861
|
+
if (backupPath === null) return;
|
|
71862
|
+
try {
|
|
71863
|
+
fs$1$3.mkdirSync(path$1$1.dirname(backupPath), { recursive: true });
|
|
71864
|
+
fs$1$3.writeFileSync(backupPath, originalContent, { flag: "wx" });
|
|
71865
|
+
} catch (error) {
|
|
71866
|
+
process.stderr.write(`[react-doctor] Did not modify ${absolutePath}: ${messageFromUnknown(error)}. Check ${backupPath}.\n`);
|
|
71867
|
+
return;
|
|
71868
|
+
}
|
|
71706
71869
|
fs$1$3.writeFileSync(absolutePath, neutralizedContent);
|
|
71707
71870
|
neutralizedFileLeases.set(absolutePath, {
|
|
71871
|
+
backupPath,
|
|
71708
71872
|
originalContent,
|
|
71873
|
+
neutralizedContent,
|
|
71709
71874
|
referenceCount: 1
|
|
71710
71875
|
});
|
|
71711
71876
|
leasedPaths.add(absolutePath);
|
|
@@ -71713,6 +71878,8 @@ const neutralizeDisableDirectives = async (rootDirectory, includePaths, options
|
|
|
71713
71878
|
};
|
|
71714
71879
|
try {
|
|
71715
71880
|
await withOverlappingInitializationLock(resolvedRootDirectory, async () => {
|
|
71881
|
+
for (const blockedPath of recoverOrphanedBackups(resolvedRootDirectory)) blockedPaths.add(blockedPath);
|
|
71882
|
+
if (options.recoverOnly) return;
|
|
71716
71883
|
for (const absolutePath of collectNeutralizationCandidatePaths(resolvedRootDirectory, [], includePaths)) if (neutralizedFileLeases.has(absolutePath)) leaseCandidatePath(absolutePath);
|
|
71717
71884
|
const discoveredRelativePaths = await (options.findFiles ?? findFilesWithDisableDirectives)(resolvedRootDirectory, includePaths);
|
|
71718
71885
|
for (const absolutePath of collectNeutralizationCandidatePaths(resolvedRootDirectory, discoveredRelativePaths, includePaths)) leaseCandidatePath(absolutePath);
|
|
@@ -71893,7 +72060,7 @@ const buildUserPluginRules = (userPlugin, severityControls) => {
|
|
|
71893
72060
|
}
|
|
71894
72061
|
return enabled;
|
|
71895
72062
|
};
|
|
71896
|
-
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 }) => {
|
|
72063
|
+
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 }) => {
|
|
71897
72064
|
const hasIncludedTags = includedTags.size > 0;
|
|
71898
72065
|
const reactHooksJsPlugin = disableReactHooksJsPlugin || ruleSelection === "sidecar" || hasIncludedTags ? null : resolveReactHooksJsPlugin(project.hasReactCompiler || project.hasReactCompilerLintPlugin === true, customRulesOnly);
|
|
71899
72066
|
const reactCompilerRules = reactHooksJsPlugin ? applyRuleSeverityControls(filterRulesToAvailable(REACT_COMPILER_RULES, "react-hooks-js", reactHooksJsPlugin.availableRuleNames), severityControls) : {};
|
|
@@ -71948,23 +72115,26 @@ const createOxlintConfig = ({ pluginPath, project, customRulesOnly = false, exte
|
|
|
71948
72115
|
},
|
|
71949
72116
|
plugins: [],
|
|
71950
72117
|
jsPlugins: [...jsPlugins, pluginPath],
|
|
71951
|
-
settings: {
|
|
71952
|
-
|
|
71953
|
-
|
|
71954
|
-
|
|
71955
|
-
|
|
71956
|
-
|
|
71957
|
-
|
|
71958
|
-
|
|
71959
|
-
unpluginAutoImportGlobalScopes
|
|
71960
|
-
|
|
71961
|
-
|
|
71962
|
-
|
|
71963
|
-
|
|
71964
|
-
|
|
71965
|
-
|
|
71966
|
-
|
|
71967
|
-
|
|
72118
|
+
settings: {
|
|
72119
|
+
...adoptedSettings,
|
|
72120
|
+
"react-doctor": {
|
|
72121
|
+
portedRuleMode: "curated",
|
|
72122
|
+
framework: project.framework,
|
|
72123
|
+
rootDirectory: settingsRootDirectory,
|
|
72124
|
+
capabilities: [...capabilities].sort(),
|
|
72125
|
+
...runtimeGlobals && runtimeGlobals.length > 0 ? { runtimeGlobals: [...runtimeGlobals] } : {},
|
|
72126
|
+
...unpluginAutoImportGlobalScopes && unpluginAutoImportGlobalScopes.length > 0 ? {
|
|
72127
|
+
unpluginAutoImportRootDirectories: [...new Set([settingsRootDirectory, project.rootDirectory])],
|
|
72128
|
+
unpluginAutoImportGlobalScopes: unpluginAutoImportGlobalScopes.map((scope) => ({
|
|
72129
|
+
directory: scope.directory,
|
|
72130
|
+
names: [...scope.names]
|
|
72131
|
+
}))
|
|
72132
|
+
} : {},
|
|
72133
|
+
...project.shopifyFlashListMajorVersion !== null ? { shopifyFlashListMajorVersion: project.shopifyFlashListMajorVersion } : {},
|
|
72134
|
+
...serverAuthFunctionNames && serverAuthFunctionNames.length > 0 ? { serverAuthFunctionNames: [...serverAuthFunctionNames] } : {},
|
|
72135
|
+
...projectIndexModuleSources !== void 0 ? { projectIndexModuleSources: [...projectIndexModuleSources] } : {}
|
|
72136
|
+
}
|
|
72137
|
+
},
|
|
71968
72138
|
rules: {
|
|
71969
72139
|
...reactCompilerRules,
|
|
71970
72140
|
...enabledReactDoctorRules,
|
|
@@ -74073,9 +74243,11 @@ const runOxlint = async (options) => {
|
|
|
74073
74243
|
return [];
|
|
74074
74244
|
}
|
|
74075
74245
|
const pluginPath = resolvePluginPath();
|
|
74076
|
-
const
|
|
74246
|
+
const detectedConfigPaths = adoptExistingLintConfig && !customRulesOnly ? detectUserLintConfigPaths(rootDirectory) : [];
|
|
74247
|
+
const extendsPaths = detectedConfigPaths.filter(canOxlintExtendConfig);
|
|
74248
|
+
const adoptedSettings = detectedConfigPaths.length > 0 ? readAdoptedLintConfigSettings(detectedConfigPaths) : {};
|
|
74077
74249
|
const userPlugins = includedTags.size > 0 ? [] : resolveUserPlugins(userConfig?.plugins, configSourceDirectory);
|
|
74078
|
-
const restoreDisableDirectives =
|
|
74250
|
+
const restoreDisableDirectives = await neutralizeDisableDirectives(rootDirectory, includePaths ?? options.precomputedSourceFiles?.map((sourceFile) => sourceFile.path), { recoverOnly: respectInlineDisables });
|
|
74079
74251
|
const configDirectory = fs$1$3.mkdtempSync(path$1$1.join(os.tmpdir(), "react-doctor-oxlintrc-"));
|
|
74080
74252
|
const configPath = path$1$1.join(configDirectory, "oxlintrc.json");
|
|
74081
74253
|
try {
|
|
@@ -74135,6 +74307,7 @@ const runOxlint = async (options) => {
|
|
|
74135
74307
|
serverAuthFunctionNames,
|
|
74136
74308
|
projectIndexModuleSources,
|
|
74137
74309
|
severityControls,
|
|
74310
|
+
adoptedSettings,
|
|
74138
74311
|
userPlugins,
|
|
74139
74312
|
disableReactHooksJsPlugin: overrides.disableReactHooksJsPlugin,
|
|
74140
74313
|
ruleSelection: overrides.ruleSelection,
|
|
@@ -75918,8 +76091,9 @@ const findWorstScoredProject = (projects) => {
|
|
|
75918
76091
|
return worst;
|
|
75919
76092
|
};
|
|
75920
76093
|
const toJsonReportDiagnostic = (diagnostic, projectRoot, reportRoot) => {
|
|
75921
|
-
const
|
|
75922
|
-
const
|
|
76094
|
+
const resolvedFilePath = resolveCandidateReadPath(projectRoot, diagnostic.filePath);
|
|
76095
|
+
const normalizedFilePath = toNormalizedRelativePath(resolvedFilePath, projectRoot);
|
|
76096
|
+
const reportRelativeFilePath = toNormalizedRelativePath(resolvedFilePath, reportRoot);
|
|
75923
76097
|
const ruleIdentity = getDiagnosticRuleIdentity(diagnostic);
|
|
75924
76098
|
return {
|
|
75925
76099
|
...diagnostic,
|
|
@@ -76546,6 +76720,7 @@ const METRIC = {
|
|
|
76546
76720
|
tuiIssueStreamShown: "tui.issue_stream_shown",
|
|
76547
76721
|
tuiProjectPathContextShown: "tui.project_path_context_shown",
|
|
76548
76722
|
tuiProjectSelectShown: "tui.project_select_shown",
|
|
76723
|
+
tuiCiRecommendationShown: "tui.ci_recommendation_shown",
|
|
76549
76724
|
tuiReportActionSelected: "tui.report_action_selected",
|
|
76550
76725
|
tuiCancelled: "tui.cancelled",
|
|
76551
76726
|
tuiScanInlineShown: "tui.scan_inline_shown",
|
|
@@ -76594,7 +76769,7 @@ const makeNoopConsole = () => ({
|
|
|
76594
76769
|
});
|
|
76595
76770
|
//#endregion
|
|
76596
76771
|
//#region src/cli/utils/version.ts
|
|
76597
|
-
const VERSION = "0.9.12-dev.
|
|
76772
|
+
const VERSION = "0.9.12-dev.ca30808";
|
|
76598
76773
|
//#endregion
|
|
76599
76774
|
//#region src/cli/utils/json-mode.ts
|
|
76600
76775
|
let context = null;
|
|
@@ -76938,5 +77113,5 @@ const recordDistribution = (name, value, options = {}) => {
|
|
|
76938
77113
|
//#endregion
|
|
76939
77114
|
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 };
|
|
76940
77115
|
|
|
76941
|
-
//# sourceMappingURL=record-metric-
|
|
76942
|
-
//# debugId=
|
|
77116
|
+
//# sourceMappingURL=record-metric-BzGcVSov.js.map
|
|
77117
|
+
//# debugId=903f2afd-3ece-5d3d-b803-69dfd65d9350
|