react-doctor 0.8.1-dev.5b468f8 → 0.8.1-dev.61bf03e
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 +4 -14
- package/dist/cli.js +148 -554
- package/dist/index.d.ts +0 -21
- package/dist/index.js +104 -463
- package/dist/lsp.js +104 -463
- package/dist/skills/react-doctor/SKILL.md +0 -5
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="1d61ce96-d819-561a-9f41-f616d6355f62")}catch(e){}}();
|
|
3
3
|
import { r as __toESM$1, t as __commonJSMin$1 } from "./chunk-N93fKeF6.js";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
5
|
import reactDoctorPlugin, { 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_RULES, classifySecurityScanFile, collectCrossFileDependencyProbes, resetManifestCaches, shouldReadSecurityScanContent } from "oxlint-plugin-react-doctor";
|
|
@@ -32854,6 +32854,44 @@ var AmbiguousProjectError = class extends Error {
|
|
|
32854
32854
|
}
|
|
32855
32855
|
};
|
|
32856
32856
|
const isProjectDiscoveryError = (value) => value instanceof ProjectNotFoundError || value instanceof NoReactDependencyError || value instanceof PackageJsonNotFoundError || value instanceof NotADirectoryError || value instanceof AmbiguousProjectError;
|
|
32857
|
+
const isErrnoException = (error) => error instanceof Error && "code" in error;
|
|
32858
|
+
const IGNORABLE_READDIR_ERROR_CODES = new Set([
|
|
32859
|
+
"EACCES",
|
|
32860
|
+
"EPERM",
|
|
32861
|
+
"ENOENT",
|
|
32862
|
+
"ENOTDIR",
|
|
32863
|
+
"EINVAL",
|
|
32864
|
+
"ELOOP",
|
|
32865
|
+
"ENAMETOOLONG"
|
|
32866
|
+
]);
|
|
32867
|
+
const isIgnorableReaddirError = (error) => isErrnoException(error) && typeof error.code === "string" && IGNORABLE_READDIR_ERROR_CODES.has(error.code);
|
|
32868
|
+
const readDirectoryEntries = (directoryPath) => {
|
|
32869
|
+
try {
|
|
32870
|
+
return NFS.readdirSync(directoryPath, { withFileTypes: true });
|
|
32871
|
+
} catch (error) {
|
|
32872
|
+
if (isIgnorableReaddirError(error)) return [];
|
|
32873
|
+
throw error;
|
|
32874
|
+
}
|
|
32875
|
+
};
|
|
32876
|
+
const isFile = (filePath) => {
|
|
32877
|
+
try {
|
|
32878
|
+
return NFS.statSync(filePath).isFile();
|
|
32879
|
+
} catch {
|
|
32880
|
+
return false;
|
|
32881
|
+
}
|
|
32882
|
+
};
|
|
32883
|
+
const isDirectory = (directoryPath) => {
|
|
32884
|
+
try {
|
|
32885
|
+
return NFS.statSync(directoryPath).isDirectory();
|
|
32886
|
+
} catch {
|
|
32887
|
+
return false;
|
|
32888
|
+
}
|
|
32889
|
+
};
|
|
32890
|
+
const isPlainObject = (value) => {
|
|
32891
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) return false;
|
|
32892
|
+
const prototype = Object.getPrototypeOf(value);
|
|
32893
|
+
return prototype === null || prototype === Object.prototype;
|
|
32894
|
+
};
|
|
32857
32895
|
const SOURCE_FILE_PATTERN = /\.(tsx?|jsx?|mts|mjs)$/;
|
|
32858
32896
|
const GENERATED_BUNDLE_FILE_PATTERN = /\.(iife|umd|global|min)\.m?js$/i;
|
|
32859
32897
|
const GENERATED_SOURCE_DIRECTORY_PATTERN = /(?:^|\/)__generated__\//;
|
|
@@ -33012,44 +33050,6 @@ const SUPPLY_CHAIN_OVERLAP_TIMEOUT_MS = 9e4;
|
|
|
33012
33050
|
const SUPPLY_CHAIN_CACHE_TTL_MS = 864e5;
|
|
33013
33051
|
const SUPPLY_CHAIN_CACHE_SUBDIR = "supply-chain";
|
|
33014
33052
|
const SUPPLY_CHAIN_IGNORED_PACKAGES = new Set(["next"]);
|
|
33015
|
-
const isErrnoException = (error) => error instanceof Error && "code" in error;
|
|
33016
|
-
const IGNORABLE_READDIR_ERROR_CODES = new Set([
|
|
33017
|
-
"EACCES",
|
|
33018
|
-
"EPERM",
|
|
33019
|
-
"ENOENT",
|
|
33020
|
-
"ENOTDIR",
|
|
33021
|
-
"EINVAL",
|
|
33022
|
-
"ELOOP",
|
|
33023
|
-
"ENAMETOOLONG"
|
|
33024
|
-
]);
|
|
33025
|
-
const isIgnorableReaddirError = (error) => isErrnoException(error) && typeof error.code === "string" && IGNORABLE_READDIR_ERROR_CODES.has(error.code);
|
|
33026
|
-
const readDirectoryEntries = (directoryPath) => {
|
|
33027
|
-
try {
|
|
33028
|
-
return NFS.readdirSync(directoryPath, { withFileTypes: true });
|
|
33029
|
-
} catch (error) {
|
|
33030
|
-
if (isIgnorableReaddirError(error)) return [];
|
|
33031
|
-
throw error;
|
|
33032
|
-
}
|
|
33033
|
-
};
|
|
33034
|
-
const isFile = (filePath) => {
|
|
33035
|
-
try {
|
|
33036
|
-
return NFS.statSync(filePath).isFile();
|
|
33037
|
-
} catch {
|
|
33038
|
-
return false;
|
|
33039
|
-
}
|
|
33040
|
-
};
|
|
33041
|
-
const isDirectory = (directoryPath) => {
|
|
33042
|
-
try {
|
|
33043
|
-
return NFS.statSync(directoryPath).isDirectory();
|
|
33044
|
-
} catch {
|
|
33045
|
-
return false;
|
|
33046
|
-
}
|
|
33047
|
-
};
|
|
33048
|
-
const isPlainObject = (value) => {
|
|
33049
|
-
if (typeof value !== "object" || value === null || Array.isArray(value)) return false;
|
|
33050
|
-
const prototype = Object.getPrototypeOf(value);
|
|
33051
|
-
return prototype === null || prototype === Object.prototype;
|
|
33052
|
-
};
|
|
33053
33053
|
const lastSourceMappingUrl = (fileContent) => {
|
|
33054
33054
|
const lastReference = [...fileContent.matchAll(/\/\/# sourceMappingURL=(\S+)/g)].at(-1);
|
|
33055
33055
|
return lastReference ? lastReference[1] : null;
|
|
@@ -33375,10 +33375,10 @@ const FALLBACK_TSCONFIG_FILENAMES = ["tsconfig.app.json", "tsconfig.build.json"]
|
|
|
33375
33375
|
const FRAMEWORK_PACKAGES = {
|
|
33376
33376
|
next: "nextjs",
|
|
33377
33377
|
"@tanstack/react-start": "tanstack-start",
|
|
33378
|
-
"@remix-run/react": "remix",
|
|
33379
|
-
gatsby: "gatsby",
|
|
33380
33378
|
vite: "vite",
|
|
33381
33379
|
"react-scripts": "cra",
|
|
33380
|
+
"@remix-run/react": "remix",
|
|
33381
|
+
gatsby: "gatsby",
|
|
33382
33382
|
expo: "expo",
|
|
33383
33383
|
"react-native": "react-native"
|
|
33384
33384
|
};
|
|
@@ -33402,17 +33402,11 @@ const NEXT_CONFIG_FILENAMES = [
|
|
|
33402
33402
|
];
|
|
33403
33403
|
const BABEL_CONFIG_FILENAMES = [
|
|
33404
33404
|
".babelrc",
|
|
33405
|
-
".babelrc.js",
|
|
33406
33405
|
".babelrc.json",
|
|
33407
|
-
".babelrc.cjs",
|
|
33408
|
-
".babelrc.mjs",
|
|
33409
|
-
".babelrc.cts",
|
|
33410
33406
|
"babel.config.js",
|
|
33411
33407
|
"babel.config.json",
|
|
33412
33408
|
"babel.config.cjs",
|
|
33413
|
-
"babel.config.mjs"
|
|
33414
|
-
"babel.config.ts",
|
|
33415
|
-
"babel.config.cts"
|
|
33409
|
+
"babel.config.mjs"
|
|
33416
33410
|
];
|
|
33417
33411
|
const VITE_CONFIG_FILENAMES = [
|
|
33418
33412
|
"vite.config.js",
|
|
@@ -33424,28 +33418,12 @@ const VITE_CONFIG_FILENAMES = [
|
|
|
33424
33418
|
"vitest.config.ts",
|
|
33425
33419
|
"vitest.config.js"
|
|
33426
33420
|
];
|
|
33427
|
-
const RSBUILD_CONFIG_FILENAMES = [
|
|
33428
|
-
"rsbuild.config.ts",
|
|
33429
|
-
"rsbuild.config.js",
|
|
33430
|
-
"rsbuild.config.mts",
|
|
33431
|
-
"rsbuild.config.mjs",
|
|
33432
|
-
"rsbuild.config.cts",
|
|
33433
|
-
"rsbuild.config.cjs"
|
|
33434
|
-
];
|
|
33435
|
-
const RSPACK_CONFIG_FILENAMES = [
|
|
33436
|
-
"rspack.config.ts",
|
|
33437
|
-
"rspack.config.js",
|
|
33438
|
-
"rspack.config.mts",
|
|
33439
|
-
"rspack.config.mjs",
|
|
33440
|
-
"rspack.config.cts",
|
|
33441
|
-
"rspack.config.cjs"
|
|
33442
|
-
];
|
|
33443
33421
|
const EXPO_APP_CONFIG_FILENAMES = [
|
|
33444
33422
|
"app.json",
|
|
33445
33423
|
"app.config.js",
|
|
33446
33424
|
"app.config.ts"
|
|
33447
33425
|
];
|
|
33448
|
-
const REACT_COMPILER_PACKAGE_REFERENCE_PATTERN = /babel-plugin-react-compiler|react-compiler-runtime|
|
|
33426
|
+
const REACT_COMPILER_PACKAGE_REFERENCE_PATTERN = /babel-plugin-react-compiler|react-compiler-runtime|["']react-compiler["']/;
|
|
33449
33427
|
const REACT_COMPILER_ENABLED_FLAG_PATTERN = /["']?reactCompiler["']?\s*:\s*(?:true\b|\{)/;
|
|
33450
33428
|
const STATIC_EXPORT_OUTPUT_PATTERN = /(?:^|[^.\w])["']?output["']?\s*:\s*["']export["']/m;
|
|
33451
33429
|
const hasCompilerPackage = (packageJson, compilerPackages) => {
|
|
@@ -33480,8 +33458,6 @@ const detectReactCompiler = (directory, packageJson) => {
|
|
|
33480
33458
|
if (hasCompilerInConfigFiles(directory, NEXT_CONFIG_FILENAMES)) return true;
|
|
33481
33459
|
if (hasCompilerInConfigFiles(directory, BABEL_CONFIG_FILENAMES)) return true;
|
|
33482
33460
|
if (hasCompilerInConfigFiles(directory, VITE_CONFIG_FILENAMES)) return true;
|
|
33483
|
-
if (hasCompilerInConfigFiles(directory, RSBUILD_CONFIG_FILENAMES)) return true;
|
|
33484
|
-
if (hasCompilerInConfigFiles(directory, RSPACK_CONFIG_FILENAMES)) return true;
|
|
33485
33461
|
if (hasCompilerInConfigFiles(directory, EXPO_APP_CONFIG_FILENAMES)) return true;
|
|
33486
33462
|
return hasCompilerPackageInAncestors(directory, REACT_COMPILER_TRANSFORM_PACKAGES);
|
|
33487
33463
|
};
|
|
@@ -33490,7 +33466,7 @@ const detectNextjsStaticExport = (directory) => NEXT_CONFIG_FILENAMES.some((file
|
|
|
33490
33466
|
const filePath = Path.join(directory, filename);
|
|
33491
33467
|
return isFile(filePath) && STATIC_EXPORT_OUTPUT_PATTERN.test(NFS.readFileSync(filePath, "utf-8"));
|
|
33492
33468
|
});
|
|
33493
|
-
const UNRESOLVABLE_PROTOCOL_VERSION = /^(?:
|
|
33469
|
+
const UNRESOLVABLE_PROTOCOL_VERSION = /^(?:file|git|github|https?|link|patch|portal|workspace|npm):/i;
|
|
33494
33470
|
const DIST_TAG_VERSION = /^[a-z][a-z0-9._-]*$/i;
|
|
33495
33471
|
const WILDCARD_VERSION = /^[*xX](?:\.[*xX])*$/;
|
|
33496
33472
|
const NPM_ALIAS_VERSION = /^npm:(?:@[^/]+\/[^@]+|[^@]+)@(.+)$/i;
|
|
@@ -33623,16 +33599,6 @@ const getLowestDependencyMajor = (version) => {
|
|
|
33623
33599
|
}
|
|
33624
33600
|
return lowestMajor;
|
|
33625
33601
|
};
|
|
33626
|
-
const getDependencyMajorWithinSupportedRange = (version, latestSupportedMajor) => {
|
|
33627
|
-
const normalizedVersion = normalizeDependencyVersion(version);
|
|
33628
|
-
if (normalizedVersion === null) return null;
|
|
33629
|
-
const validRange = import_semver.validRange(normalizedVersion);
|
|
33630
|
-
if (validRange === null) return null;
|
|
33631
|
-
const minimumVersion = import_semver.minVersion(validRange);
|
|
33632
|
-
if (minimumVersion === null || minimumVersion.major > latestSupportedMajor) return null;
|
|
33633
|
-
if (import_semver.intersects(validRange, `>=${latestSupportedMajor + 1}.0.0`)) return null;
|
|
33634
|
-
return minimumVersion.major;
|
|
33635
|
-
};
|
|
33636
33602
|
const isConcreteDependencyVersion = (version) => {
|
|
33637
33603
|
const normalizedVersion = normalizeDependencyVersion(version);
|
|
33638
33604
|
return normalizedVersion !== null && /\d/.test(normalizedVersion);
|
|
@@ -33676,18 +33642,9 @@ const parseReactMajorMinor = (reactVersion) => {
|
|
|
33676
33642
|
};
|
|
33677
33643
|
};
|
|
33678
33644
|
const parseLowerBoundVersion = (versionSpec) => import_semver.validRange(versionSpec) !== null ? import_semver.minVersion(versionSpec) : import_semver.coerce(versionSpec);
|
|
33679
|
-
const
|
|
33680
|
-
if (typeof
|
|
33681
|
-
const
|
|
33682
|
-
if (normalizedVersion === null) return null;
|
|
33683
|
-
const lowerBound = parseLowerBoundVersion(normalizedVersion);
|
|
33684
|
-
if (lowerBound === null) return null;
|
|
33685
|
-
if (lowerBound.major > 0) return Number.MAX_SAFE_INTEGER;
|
|
33686
|
-
return lowerBound.minor > 0 ? lowerBound.minor : null;
|
|
33687
|
-
};
|
|
33688
|
-
const parseDependencyMajorMinor = (dependencyVersion) => {
|
|
33689
|
-
if (typeof dependencyVersion !== "string") return null;
|
|
33690
|
-
const trimmed = dependencyVersion.trim();
|
|
33645
|
+
const parseTailwindMajorMinor = (tailwindVersion) => {
|
|
33646
|
+
if (typeof tailwindVersion !== "string") return null;
|
|
33647
|
+
const trimmed = tailwindVersion.trim();
|
|
33691
33648
|
if (trimmed.length === 0) return null;
|
|
33692
33649
|
const lowerBound = parseLowerBoundVersion(trimmed);
|
|
33693
33650
|
if (lowerBound === null || lowerBound.major <= 0) return null;
|
|
@@ -33696,7 +33653,6 @@ const parseDependencyMajorMinor = (dependencyVersion) => {
|
|
|
33696
33653
|
minor: lowerBound.minor
|
|
33697
33654
|
};
|
|
33698
33655
|
};
|
|
33699
|
-
const parseTailwindMajorMinor = (tailwindVersion) => parseDependencyMajorMinor(tailwindVersion);
|
|
33700
33656
|
const hasUpperBoundOnlyPeerRange = (range) => {
|
|
33701
33657
|
if (typeof range !== "string") return false;
|
|
33702
33658
|
const normalizedRange = normalizeDependencyVersion(range);
|
|
@@ -33718,7 +33674,7 @@ const resolveEffectiveReactMajor = (reactVersion, packageJson) => {
|
|
|
33718
33674
|
if (peerFloor === null) return hasUpperBoundOnlyPeerRange(peerReactRange) ? null : installedReactMajor;
|
|
33719
33675
|
return installedReactMajor !== null ? Math.min(installedReactMajor, peerFloor) : peerFloor;
|
|
33720
33676
|
};
|
|
33721
|
-
const isCatalogReference = (version) =>
|
|
33677
|
+
const isCatalogReference = (version) => version.startsWith("catalog:");
|
|
33722
33678
|
const extractCatalogName = (version) => {
|
|
33723
33679
|
if (!isCatalogReference(version)) return null;
|
|
33724
33680
|
const name = version.slice(8).trim();
|
|
@@ -33868,12 +33824,6 @@ const TAILWIND_ZOD_SECTIONS = [
|
|
|
33868
33824
|
"devDependencies",
|
|
33869
33825
|
"peerDependencies"
|
|
33870
33826
|
];
|
|
33871
|
-
const DEPENDENCY_SPEC_SECTIONS = [
|
|
33872
|
-
"dependencies",
|
|
33873
|
-
"devDependencies",
|
|
33874
|
-
"peerDependencies",
|
|
33875
|
-
"optionalDependencies"
|
|
33876
|
-
];
|
|
33877
33827
|
const EMPTY_DEPENDENCY_INFO = {
|
|
33878
33828
|
reactVersion: null,
|
|
33879
33829
|
tailwindVersion: null,
|
|
@@ -33883,7 +33833,7 @@ const EMPTY_DEPENDENCY_INFO = {
|
|
|
33883
33833
|
const pickConcreteVersion = (packageJson, packageName, sections) => {
|
|
33884
33834
|
for (const section of sections) {
|
|
33885
33835
|
const version = packageJson[section]?.[packageName];
|
|
33886
|
-
if (
|
|
33836
|
+
if (version === void 0) continue;
|
|
33887
33837
|
if (isCatalogReference(version)) return null;
|
|
33888
33838
|
if (isConcreteDependencyVersion(version)) return version;
|
|
33889
33839
|
}
|
|
@@ -33915,16 +33865,13 @@ const extractDependencyInfo = (packageJson) => {
|
|
|
33915
33865
|
};
|
|
33916
33866
|
};
|
|
33917
33867
|
const getDependencySpec = (packageJson, packageName) => {
|
|
33918
|
-
|
|
33919
|
-
|
|
33920
|
-
if (typeof spec === "string") return spec;
|
|
33921
|
-
}
|
|
33922
|
-
return null;
|
|
33868
|
+
const spec = packageJson.dependencies?.[packageName] ?? packageJson.devDependencies?.[packageName] ?? packageJson.peerDependencies?.[packageName] ?? packageJson.optionalDependencies?.[packageName];
|
|
33869
|
+
return typeof spec === "string" ? spec : null;
|
|
33923
33870
|
};
|
|
33924
33871
|
const getDependencyDeclaration = ({ packageJson, packageName, sections }) => {
|
|
33925
33872
|
for (const section of sections) {
|
|
33926
33873
|
const version = packageJson[section]?.[packageName];
|
|
33927
|
-
if (
|
|
33874
|
+
if (version === void 0) continue;
|
|
33928
33875
|
return {
|
|
33929
33876
|
catalogReference: extractCatalogName(version) ?? null,
|
|
33930
33877
|
hasDeclaration: true,
|
|
@@ -33958,15 +33905,24 @@ const getPreactVersion = (packageJson) => {
|
|
|
33958
33905
|
...packageJson.devDependencies
|
|
33959
33906
|
}.preact ?? null;
|
|
33960
33907
|
};
|
|
33961
|
-
const
|
|
33908
|
+
const TANSTACK_QUERY_PACKAGES = new Set([
|
|
33909
|
+
"@tanstack/react-query",
|
|
33910
|
+
"@tanstack/query-core",
|
|
33911
|
+
"react-query"
|
|
33912
|
+
]);
|
|
33913
|
+
const hasTanStackQuery = (packageJson) => {
|
|
33914
|
+
const allDependencies = {
|
|
33915
|
+
...packageJson.peerDependencies,
|
|
33916
|
+
...packageJson.dependencies,
|
|
33917
|
+
...packageJson.devDependencies
|
|
33918
|
+
};
|
|
33919
|
+
return Object.keys(allDependencies).some((packageName) => TANSTACK_QUERY_PACKAGES.has(packageName));
|
|
33920
|
+
};
|
|
33921
|
+
const resolveCatalogBackedDependencyVersion = ({ rootDirectory, rootPackageJson, packageName, version }) => {
|
|
33962
33922
|
if (version === null || !isCatalogReference(version)) return version;
|
|
33963
33923
|
const catalogName = extractCatalogName(version);
|
|
33964
|
-
const
|
|
33965
|
-
if (
|
|
33966
|
-
if (sourceDirectory !== rootDirectory || sourcePackageJson !== rootPackageJson) {
|
|
33967
|
-
const resolvedRootVersion = resolveCatalogVersion(rootPackageJson, packageName, rootDirectory, catalogName);
|
|
33968
|
-
if (resolvedRootVersion) return resolvedRootVersion;
|
|
33969
|
-
}
|
|
33924
|
+
const resolvedLocalVersion = resolveCatalogVersion(rootPackageJson, packageName, rootDirectory, catalogName);
|
|
33925
|
+
if (resolvedLocalVersion) return resolvedLocalVersion;
|
|
33970
33926
|
const monorepoRoot = findMonorepoRoot(rootDirectory);
|
|
33971
33927
|
if (!monorepoRoot) return version;
|
|
33972
33928
|
const monorepoPackageJsonPath = Path.join(monorepoRoot, "package.json");
|
|
@@ -34164,75 +34120,11 @@ const listWorkspacePackages = (rootDirectory) => {
|
|
|
34164
34120
|
}
|
|
34165
34121
|
return packages;
|
|
34166
34122
|
};
|
|
34167
|
-
const getPreferredDependencyVersion = ({ packageJson, packageNames }) => {
|
|
34168
|
-
const allDependencies = {
|
|
34169
|
-
...packageJson.devDependencies,
|
|
34170
|
-
...packageJson.peerDependencies,
|
|
34171
|
-
...packageJson.dependencies
|
|
34172
|
-
};
|
|
34173
|
-
for (const packageName of packageNames) {
|
|
34174
|
-
const version = allDependencies[packageName];
|
|
34175
|
-
if (version !== void 0) return version;
|
|
34176
|
-
}
|
|
34177
|
-
return null;
|
|
34178
|
-
};
|
|
34179
|
-
const TANSTACK_REACT_QUERY_PACKAGES = ["@tanstack/react-query", "react-query"];
|
|
34180
|
-
const getTanStackQueryVersion = (packageJson) => {
|
|
34181
|
-
return getPreferredDependencyVersion({
|
|
34182
|
-
packageJson,
|
|
34183
|
-
packageNames: TANSTACK_REACT_QUERY_PACKAGES
|
|
34184
|
-
});
|
|
34185
|
-
};
|
|
34186
|
-
const STYLED_COMPONENTS_PACKAGES = ["styled-components"];
|
|
34187
|
-
const getStyledComponentsVersion = (packageJson) => {
|
|
34188
|
-
return getPreferredDependencyVersion({
|
|
34189
|
-
packageJson,
|
|
34190
|
-
packageNames: STYLED_COMPONENTS_PACKAGES
|
|
34191
|
-
});
|
|
34192
|
-
};
|
|
34193
|
-
const I18N_PACKAGES = [
|
|
34194
|
-
"i18next",
|
|
34195
|
-
"react-i18next",
|
|
34196
|
-
"next-i18next",
|
|
34197
|
-
"react-intl",
|
|
34198
|
-
"next-intl",
|
|
34199
|
-
"use-intl",
|
|
34200
|
-
"@formatjs/intl",
|
|
34201
|
-
"@lingui/core",
|
|
34202
|
-
"@lingui/react",
|
|
34203
|
-
"typesafe-i18n",
|
|
34204
|
-
"@tolgee/react",
|
|
34205
|
-
"react-intl-universal"
|
|
34206
|
-
];
|
|
34207
|
-
const hasI18nDependency = (packageJson) => {
|
|
34208
|
-
const allDependencies = {
|
|
34209
|
-
...packageJson.peerDependencies,
|
|
34210
|
-
...packageJson.dependencies,
|
|
34211
|
-
...packageJson.devDependencies,
|
|
34212
|
-
...packageJson.optionalDependencies
|
|
34213
|
-
};
|
|
34214
|
-
return I18N_PACKAGES.some((packageName) => allDependencies[packageName] !== void 0);
|
|
34215
|
-
};
|
|
34216
34123
|
const REANIMATED_DEPENDENCY_NAME = "react-native-reanimated";
|
|
34217
34124
|
const MOBX_REACT_PACKAGE_NAME = "mobx-react";
|
|
34218
34125
|
const MOBX_REACT_LITE_PACKAGE_NAME = "mobx-react-lite";
|
|
34219
34126
|
const MOBX_STATE_TREE_PACKAGE_NAME = "mobx-state-tree";
|
|
34220
34127
|
const MOBX_REACT_OBSERVER_PACKAGE_NAME = "mobx-react-observer";
|
|
34221
|
-
const REACT_THREE_FIBER_DEPENDENCY_NAMES = ["@react-three/fiber", "react-three-fiber"];
|
|
34222
|
-
const REACT_THREE_FIBER_SECTIONS = [
|
|
34223
|
-
"dependencies",
|
|
34224
|
-
"peerDependencies",
|
|
34225
|
-
"optionalDependencies",
|
|
34226
|
-
"devDependencies"
|
|
34227
|
-
];
|
|
34228
|
-
const THREE_DEPENDENCY_SECTIONS = [
|
|
34229
|
-
"dependencies",
|
|
34230
|
-
"peerDependencies",
|
|
34231
|
-
"optionalDependencies",
|
|
34232
|
-
"devDependencies"
|
|
34233
|
-
];
|
|
34234
|
-
const REACT_THREE_FIBER_ECOSYSTEM_DEPENDENCY_NAMES = [...REACT_THREE_FIBER_DEPENDENCY_NAMES, "@react-three/drei"];
|
|
34235
|
-
const THREE_DEPENDENCY_NAMES = [...REACT_THREE_FIBER_ECOSYSTEM_DEPENDENCY_NAMES, "three"];
|
|
34236
34128
|
const SHOPIFY_FLASH_LIST_PACKAGE_NAME = "@shopify/flash-list";
|
|
34237
34129
|
const resolveWorkspaceDependencyVersion = ({ concreteVersion, packageName, rootDirectory, rootPackageJson, sections, workspaceDirectory, workspacePackageJson }) => {
|
|
34238
34130
|
const dependencyDeclaration = getDependencyDeclaration({
|
|
@@ -34243,7 +34135,7 @@ const resolveWorkspaceDependencyVersion = ({ concreteVersion, packageName, rootD
|
|
|
34243
34135
|
if (!dependencyDeclaration.hasDeclaration) return null;
|
|
34244
34136
|
return concreteVersion ?? resolveCatalogVersion(workspacePackageJson, packageName, workspaceDirectory, dependencyDeclaration.catalogReference) ?? resolveCatalogVersion(rootPackageJson, packageName, rootDirectory, dependencyDeclaration.catalogReference);
|
|
34245
34137
|
};
|
|
34246
|
-
const
|
|
34138
|
+
const shouldReplaceReactVersion = (currentVersion, nextVersion) => {
|
|
34247
34139
|
if (!currentVersion) return true;
|
|
34248
34140
|
const currentMajor = parseReactMajor(currentVersion);
|
|
34249
34141
|
const nextMajor = parseReactMajor(nextVersion);
|
|
@@ -34251,61 +34143,17 @@ const shouldReplaceWithLowerMajor = (currentVersion, nextVersion) => {
|
|
|
34251
34143
|
if (nextMajor === null) return false;
|
|
34252
34144
|
return nextMajor < currentMajor;
|
|
34253
34145
|
};
|
|
34254
|
-
const
|
|
34146
|
+
const shouldReplaceMobxFact = (currentFact, nextFact) => {
|
|
34255
34147
|
if (currentFact.version === null) return true;
|
|
34256
34148
|
if (nextFact.version === null) return false;
|
|
34257
34149
|
const currentMajor = getLowestDependencyMajor(currentFact.version);
|
|
34258
34150
|
const nextMajor = getLowestDependencyMajor(nextFact.version);
|
|
34259
34151
|
if (currentMajor === null) return false;
|
|
34260
34152
|
if (nextMajor === null) return true;
|
|
34261
|
-
if (currentMajor >
|
|
34262
|
-
if (nextMajor >
|
|
34263
|
-
return nextMajor < currentMajor;
|
|
34264
|
-
};
|
|
34265
|
-
const shouldReplaceStyledComponentsVersion = (currentVersion, nextVersion) => {
|
|
34266
|
-
if (!currentVersion) return true;
|
|
34267
|
-
const currentMajor = getLowestDependencyMajor(currentVersion);
|
|
34268
|
-
const nextMajor = getLowestDependencyMajor(nextVersion);
|
|
34269
|
-
if (currentMajor === null) return nextMajor !== null && nextMajor < 6;
|
|
34270
|
-
if (nextMajor === null) return currentMajor >= 6;
|
|
34153
|
+
if (currentMajor > 6) return false;
|
|
34154
|
+
if (nextMajor > 6) return true;
|
|
34271
34155
|
return nextMajor < currentMajor;
|
|
34272
34156
|
};
|
|
34273
|
-
const selectOldestDependencyVersion = (currentVersion, nextVersion) => {
|
|
34274
|
-
if (currentVersion === null || nextVersion === null) return null;
|
|
34275
|
-
const current = parseDependencyMajorMinor(currentVersion);
|
|
34276
|
-
const next = parseDependencyMajorMinor(nextVersion);
|
|
34277
|
-
if (current === null) return currentVersion;
|
|
34278
|
-
if (next === null) return nextVersion;
|
|
34279
|
-
if (next.major !== current.major) return next.major < current.major ? nextVersion : currentVersion;
|
|
34280
|
-
return next.minor < current.minor ? nextVersion : currentVersion;
|
|
34281
|
-
};
|
|
34282
|
-
const shouldReplaceMobxFact = (currentFact, nextFact) => {
|
|
34283
|
-
if (currentFact.sourceDirectory === null) return true;
|
|
34284
|
-
if (currentFact.version === null) return false;
|
|
34285
|
-
if (nextFact.version === null) return true;
|
|
34286
|
-
const currentMajor = getDependencyMajorWithinSupportedRange(currentFact.version, 6);
|
|
34287
|
-
const nextMajor = getDependencyMajorWithinSupportedRange(nextFact.version, 6);
|
|
34288
|
-
if (currentMajor === null) return false;
|
|
34289
|
-
if (nextMajor === null) return true;
|
|
34290
|
-
return selectOldestDependencyVersion(currentFact.version, nextFact.version) === nextFact.version;
|
|
34291
|
-
};
|
|
34292
|
-
const collectBindingVersion = (facts, packageJson, directory, packageName) => {
|
|
34293
|
-
const version = getDependencySpec(packageJson, packageName);
|
|
34294
|
-
if (version === null) return;
|
|
34295
|
-
const resolvedVersion = resolveCatalogBackedDependencyVersion({
|
|
34296
|
-
rootDirectory: directory,
|
|
34297
|
-
rootPackageJson: packageJson,
|
|
34298
|
-
packageName,
|
|
34299
|
-
version
|
|
34300
|
-
});
|
|
34301
|
-
if (packageName === MOBX_REACT_PACKAGE_NAME) {
|
|
34302
|
-
facts.mobxReactVersion = facts.hasMobxReact ? selectOldestDependencyVersion(facts.mobxReactVersion, resolvedVersion) : resolvedVersion;
|
|
34303
|
-
facts.hasMobxReact = true;
|
|
34304
|
-
return;
|
|
34305
|
-
}
|
|
34306
|
-
facts.mobxReactLiteVersion = facts.hasMobxReactLite ? selectOldestDependencyVersion(facts.mobxReactLiteVersion, resolvedVersion) : resolvedVersion;
|
|
34307
|
-
facts.hasMobxReactLite = true;
|
|
34308
|
-
};
|
|
34309
34157
|
const evaluateManifestFacts = (facts, packageJson, directory, rootDirectory, rootPackageJson) => {
|
|
34310
34158
|
if (facts.expo.version === null) {
|
|
34311
34159
|
const spec = getDependencySpec(packageJson, "expo");
|
|
@@ -34341,23 +34189,10 @@ const evaluateManifestFacts = (facts, packageJson, directory, rootDirectory, roo
|
|
|
34341
34189
|
};
|
|
34342
34190
|
if (shouldReplaceMobxFact(facts.mobx, nextMobxFact)) facts.mobx = nextMobxFact;
|
|
34343
34191
|
}
|
|
34344
|
-
|
|
34345
|
-
|
|
34192
|
+
facts.hasMobxReact = facts.hasMobxReact || getDependencySpec(packageJson, MOBX_REACT_PACKAGE_NAME) !== null;
|
|
34193
|
+
facts.hasMobxReactLite = facts.hasMobxReactLite || getDependencySpec(packageJson, MOBX_REACT_LITE_PACKAGE_NAME) !== null;
|
|
34346
34194
|
facts.hasMobxStateTree = facts.hasMobxStateTree || getDependencySpec(packageJson, MOBX_STATE_TREE_PACKAGE_NAME) !== null;
|
|
34347
34195
|
facts.hasMobxReactObserver = facts.hasMobxReactObserver || getDependencySpec(packageJson, MOBX_REACT_OBSERVER_PACKAGE_NAME) !== null;
|
|
34348
|
-
const zustandSpec = getDependencySpec(packageJson, "zustand");
|
|
34349
|
-
if (zustandSpec !== null) {
|
|
34350
|
-
const nextZustandFact = {
|
|
34351
|
-
version: resolveCatalogBackedDependencyVersion({
|
|
34352
|
-
rootDirectory: directory,
|
|
34353
|
-
rootPackageJson: packageJson,
|
|
34354
|
-
packageName: "zustand",
|
|
34355
|
-
version: zustandSpec
|
|
34356
|
-
}),
|
|
34357
|
-
sourceDirectory: directory
|
|
34358
|
-
};
|
|
34359
|
-
if (shouldReplaceSupportedDependencyFact(facts.zustand, nextZustandFact, 5)) facts.zustand = nextZustandFact;
|
|
34360
|
-
}
|
|
34361
34196
|
if (facts.reanimatedVersion === null) {
|
|
34362
34197
|
const spec = getDependencySpec(packageJson, REANIMATED_DEPENDENCY_NAME);
|
|
34363
34198
|
if (spec !== null) facts.reanimatedVersion = spec;
|
|
@@ -34366,52 +34201,6 @@ const evaluateManifestFacts = (facts, packageJson, directory, rootDirectory, roo
|
|
|
34366
34201
|
const spec = getDependencySpec(packageJson, "valtio");
|
|
34367
34202
|
if (spec !== null) facts.valtioVersion = spec;
|
|
34368
34203
|
}
|
|
34369
|
-
facts.tanstackQueryVersion ??= getTanStackQueryVersion(packageJson);
|
|
34370
|
-
const styledComponentsVersion = resolveCatalogBackedDependencyVersion({
|
|
34371
|
-
rootDirectory: directory,
|
|
34372
|
-
rootPackageJson: packageJson,
|
|
34373
|
-
packageName: "styled-components",
|
|
34374
|
-
version: getStyledComponentsVersion(packageJson)
|
|
34375
|
-
});
|
|
34376
|
-
if (styledComponentsVersion && shouldReplaceStyledComponentsVersion(facts.styledComponentsVersion, styledComponentsVersion)) facts.styledComponentsVersion = styledComponentsVersion;
|
|
34377
|
-
facts.hasI18nLibrary = facts.hasI18nLibrary || hasI18nDependency(packageJson);
|
|
34378
|
-
for (const packageName of REACT_THREE_FIBER_DEPENDENCY_NAMES) {
|
|
34379
|
-
const version = resolveCatalogBackedDependencyVersion({
|
|
34380
|
-
rootDirectory,
|
|
34381
|
-
rootPackageJson,
|
|
34382
|
-
sourceDirectory: directory,
|
|
34383
|
-
sourcePackageJson: packageJson,
|
|
34384
|
-
packageName,
|
|
34385
|
-
version: getDependencyDeclaration({
|
|
34386
|
-
packageName,
|
|
34387
|
-
packageJson,
|
|
34388
|
-
sections: REACT_THREE_FIBER_SECTIONS
|
|
34389
|
-
}).version
|
|
34390
|
-
});
|
|
34391
|
-
if (version === null) continue;
|
|
34392
|
-
if (shouldReplaceWithLowerMajor(facts.reactThreeFiber.version, version)) facts.reactThreeFiber = {
|
|
34393
|
-
packageName,
|
|
34394
|
-
version,
|
|
34395
|
-
sourceDirectory: directory
|
|
34396
|
-
};
|
|
34397
|
-
}
|
|
34398
|
-
const threeVersion = resolveCatalogBackedDependencyVersion({
|
|
34399
|
-
rootDirectory,
|
|
34400
|
-
rootPackageJson,
|
|
34401
|
-
sourceDirectory: directory,
|
|
34402
|
-
sourcePackageJson: packageJson,
|
|
34403
|
-
packageName: "three",
|
|
34404
|
-
version: getDependencyDeclaration({
|
|
34405
|
-
packageName: "three",
|
|
34406
|
-
packageJson,
|
|
34407
|
-
sections: THREE_DEPENDENCY_SECTIONS
|
|
34408
|
-
}).version
|
|
34409
|
-
});
|
|
34410
|
-
if (threeVersion !== null) {
|
|
34411
|
-
const currentRelease = parseThreeRelease(facts.threeVersion);
|
|
34412
|
-
const nextRelease = parseThreeRelease(threeVersion);
|
|
34413
|
-
if (facts.threeVersion === null || nextRelease !== null && (currentRelease === null || nextRelease < currentRelease)) facts.threeVersion = threeVersion;
|
|
34414
|
-
}
|
|
34415
34204
|
facts.hasReactNativeAwarePackage = facts.hasReactNativeAwarePackage || isPackageJsonReactNativeAware(packageJson);
|
|
34416
34205
|
facts.hasReanimatedAwarePackage = facts.hasReanimatedAwarePackage || isPackageJsonReanimatedAware(packageJson);
|
|
34417
34206
|
facts.hasSsrDependency = facts.hasSsrDependency || isPackageJsonSsrAware(packageJson);
|
|
@@ -34433,8 +34222,6 @@ const evaluateManifestFacts = (facts, packageJson, directory, rootDirectory, roo
|
|
|
34433
34222
|
if (currentRemotionMajorVersion === null || remotionMajorVersion < currentRemotionMajorVersion) facts.remotionVersion = resolvedRemotionVersion;
|
|
34434
34223
|
}
|
|
34435
34224
|
}
|
|
34436
|
-
facts.hasThree = facts.hasThree || THREE_DEPENDENCY_NAMES.some((dependencyName) => getDependencySpec(packageJson, dependencyName) !== null);
|
|
34437
|
-
facts.hasReactThreeFiber = facts.hasReactThreeFiber || REACT_THREE_FIBER_ECOSYSTEM_DEPENDENCY_NAMES.some((dependencyName) => getDependencySpec(packageJson, dependencyName) !== null);
|
|
34438
34225
|
};
|
|
34439
34226
|
const collectWorkspaceFacts = (rootDirectory, rootPackageJson, { collectReactGroup }) => {
|
|
34440
34227
|
const facts = {
|
|
@@ -34460,32 +34247,15 @@ const collectWorkspaceFacts = (rootDirectory, rootPackageJson, { collectReactGro
|
|
|
34460
34247
|
sourceDirectory: null
|
|
34461
34248
|
},
|
|
34462
34249
|
hasMobxReact: false,
|
|
34463
|
-
mobxReactVersion: null,
|
|
34464
34250
|
hasMobxReactLite: false,
|
|
34465
|
-
mobxReactLiteVersion: null,
|
|
34466
34251
|
hasMobxStateTree: false,
|
|
34467
34252
|
hasMobxReactObserver: false,
|
|
34468
|
-
zustand: {
|
|
34469
|
-
version: null,
|
|
34470
|
-
sourceDirectory: null
|
|
34471
|
-
},
|
|
34472
|
-
tanstackQueryVersion: null,
|
|
34473
|
-
styledComponentsVersion: null,
|
|
34474
|
-
hasI18nLibrary: false,
|
|
34475
34253
|
hasReactNativeAwarePackage: false,
|
|
34476
34254
|
hasReanimatedAwarePackage: false,
|
|
34477
34255
|
hasSsrDependency: false,
|
|
34478
34256
|
hasRemotionDependency: false,
|
|
34479
34257
|
hasUnknownRemotionVersion: false,
|
|
34480
34258
|
remotionVersion: null,
|
|
34481
|
-
hasThree: false,
|
|
34482
|
-
threeVersion: null,
|
|
34483
|
-
hasReactThreeFiber: false,
|
|
34484
|
-
reactThreeFiber: {
|
|
34485
|
-
packageName: null,
|
|
34486
|
-
version: null,
|
|
34487
|
-
sourceDirectory: null
|
|
34488
|
-
},
|
|
34489
34259
|
reanimatedVersion: null
|
|
34490
34260
|
};
|
|
34491
34261
|
evaluateManifestFacts(facts, rootPackageJson, rootDirectory, rootDirectory, rootPackageJson);
|
|
@@ -34528,7 +34298,7 @@ const collectWorkspaceFacts = (rootDirectory, rootPackageJson, { collectReactGro
|
|
|
34528
34298
|
workspaceDirectory,
|
|
34529
34299
|
workspacePackageJson
|
|
34530
34300
|
});
|
|
34531
|
-
if (reactVersion &&
|
|
34301
|
+
if (reactVersion && shouldReplaceReactVersion(facts.reactVersion, reactVersion)) facts.reactVersion = reactVersion;
|
|
34532
34302
|
if (tailwindVersion && !facts.tailwindVersion) facts.tailwindVersion = tailwindVersion;
|
|
34533
34303
|
if (zodVersion && !facts.zodVersion) facts.zodVersion = zodVersion;
|
|
34534
34304
|
const settledReactMajor = parseReactMajor(facts.reactVersion);
|
|
@@ -34724,13 +34494,9 @@ const discoverProjectWithoutPackageJson = (directory) => {
|
|
|
34724
34494
|
mobxVersion: null,
|
|
34725
34495
|
mobxMajorVersion: null,
|
|
34726
34496
|
hasMobxReact: false,
|
|
34727
|
-
mobxReactVersion: null,
|
|
34728
34497
|
hasMobxReactLite: false,
|
|
34729
|
-
mobxReactLiteVersion: null,
|
|
34730
34498
|
hasMobxStateTree: false,
|
|
34731
34499
|
hasMobxReactObserver: false,
|
|
34732
|
-
zustandVersion: null,
|
|
34733
|
-
zustandMajorVersion: null,
|
|
34734
34500
|
framework: "unknown",
|
|
34735
34501
|
hasTypeScript: hasOwnTsConfig,
|
|
34736
34502
|
hasReactCompiler: false,
|
|
@@ -34741,15 +34507,6 @@ const discoverProjectWithoutPackageJson = (directory) => {
|
|
|
34741
34507
|
hasRemotion: false,
|
|
34742
34508
|
remotionVersion: null,
|
|
34743
34509
|
remotionMajorVersion: null,
|
|
34744
|
-
hasI18nLibrary: false,
|
|
34745
|
-
tanstackQueryVersion: null,
|
|
34746
|
-
styledComponentsVersion: null,
|
|
34747
|
-
hasThree: false,
|
|
34748
|
-
threeVersion: null,
|
|
34749
|
-
threeRelease: null,
|
|
34750
|
-
hasReactThreeFiber: false,
|
|
34751
|
-
reactThreeFiberVersion: null,
|
|
34752
|
-
reactThreeFiberMajorVersion: null,
|
|
34753
34510
|
hasSsrDependency: false,
|
|
34754
34511
|
preactVersion: null,
|
|
34755
34512
|
preactMajorVersion: null,
|
|
@@ -34848,12 +34605,6 @@ const discoverProject = (directory) => {
|
|
|
34848
34605
|
packageName: SHOPIFY_FLASH_LIST_PACKAGE_NAME,
|
|
34849
34606
|
version: workspaceFacts.shopifyFlashList.version
|
|
34850
34607
|
}) : null;
|
|
34851
|
-
const zustandVersion = resolveCatalogBackedDependencyVersion({
|
|
34852
|
-
rootDirectory: directory,
|
|
34853
|
-
rootPackageJson: packageJson,
|
|
34854
|
-
packageName: "zustand",
|
|
34855
|
-
version: workspaceFacts.zustand.version
|
|
34856
|
-
});
|
|
34857
34608
|
const hasReanimated = hasReactNativeWorkspace && workspaceFacts.hasReanimatedAwarePackage;
|
|
34858
34609
|
const reanimatedVersion = hasReanimated ? workspaceFacts.reanimatedVersion : null;
|
|
34859
34610
|
const nextjsVersion = framework === "nextjs" ? resolveCatalogBackedDependencyVersion({
|
|
@@ -34876,19 +34627,6 @@ const discoverProject = (directory) => {
|
|
|
34876
34627
|
});
|
|
34877
34628
|
const preactVersion = getPreactVersion(packageJson);
|
|
34878
34629
|
const remotionVersion = workspaceFacts.remotionVersion;
|
|
34879
|
-
const tanstackQueryVersion = getTanStackQueryVersion(packageJson) ?? workspaceFacts.tanstackQueryVersion;
|
|
34880
|
-
const reactThreeFiberVersion = workspaceFacts.reactThreeFiber.packageName ? resolveCatalogBackedDependencyVersion({
|
|
34881
|
-
rootDirectory: directory,
|
|
34882
|
-
rootPackageJson: packageJson,
|
|
34883
|
-
packageName: workspaceFacts.reactThreeFiber.packageName,
|
|
34884
|
-
version: workspaceFacts.reactThreeFiber.version
|
|
34885
|
-
}) : null;
|
|
34886
|
-
const threeVersion = resolveCatalogBackedDependencyVersion({
|
|
34887
|
-
rootDirectory: directory,
|
|
34888
|
-
rootPackageJson: packageJson,
|
|
34889
|
-
packageName: "three",
|
|
34890
|
-
version: workspaceFacts.threeVersion
|
|
34891
|
-
});
|
|
34892
34630
|
const isPreES2023Target = hasTypeScript && detectPreES2023Target(directory);
|
|
34893
34631
|
const projectInfo = {
|
|
34894
34632
|
rootDirectory: directory,
|
|
@@ -34899,34 +34637,21 @@ const discoverProject = (directory) => {
|
|
|
34899
34637
|
zodVersion,
|
|
34900
34638
|
zodMajorVersion: zodVersion === null ? null : getLowestDependencyMajor(zodVersion),
|
|
34901
34639
|
mobxVersion,
|
|
34902
|
-
mobxMajorVersion: mobxVersion === null ? null :
|
|
34640
|
+
mobxMajorVersion: mobxVersion === null ? null : getLowestDependencyMajor(mobxVersion),
|
|
34903
34641
|
hasMobxReact: workspaceFacts.hasMobxReact,
|
|
34904
|
-
mobxReactVersion: workspaceFacts.mobxReactVersion,
|
|
34905
34642
|
hasMobxReactLite: workspaceFacts.hasMobxReactLite,
|
|
34906
|
-
mobxReactLiteVersion: workspaceFacts.mobxReactLiteVersion,
|
|
34907
34643
|
hasMobxStateTree: workspaceFacts.hasMobxStateTree,
|
|
34908
34644
|
hasMobxReactObserver: workspaceFacts.hasMobxReactObserver,
|
|
34909
|
-
zustandVersion,
|
|
34910
|
-
zustandMajorVersion: zustandVersion === null ? null : getLowestDependencyMajor(zustandVersion),
|
|
34911
34645
|
framework,
|
|
34912
34646
|
hasTypeScript,
|
|
34913
34647
|
hasReactCompiler: detectReactCompiler(directory, packageJson),
|
|
34914
34648
|
hasReactCompilerLintPlugin: detectReactCompilerLintPlugin(directory, packageJson),
|
|
34915
|
-
hasTanStackQuery:
|
|
34916
|
-
hasI18nLibrary: workspaceFacts.hasI18nLibrary,
|
|
34917
|
-
tanstackQueryVersion,
|
|
34918
|
-
styledComponentsVersion: workspaceFacts.styledComponentsVersion,
|
|
34649
|
+
hasTanStackQuery: hasTanStackQuery(packageJson),
|
|
34919
34650
|
valtioVersion,
|
|
34920
34651
|
valtioMajorVersion: valtioVersion === null ? null : getLowestDependencyMajor(valtioVersion),
|
|
34921
34652
|
hasRemotion: workspaceFacts.hasRemotionDependency,
|
|
34922
34653
|
remotionVersion,
|
|
34923
34654
|
remotionMajorVersion: remotionVersion === null ? null : getLowestDependencyMajor(remotionVersion),
|
|
34924
|
-
hasThree: workspaceFacts.hasThree,
|
|
34925
|
-
threeVersion,
|
|
34926
|
-
threeRelease: parseThreeRelease(threeVersion),
|
|
34927
|
-
hasReactThreeFiber: workspaceFacts.hasReactThreeFiber,
|
|
34928
|
-
reactThreeFiberVersion,
|
|
34929
|
-
reactThreeFiberMajorVersion: reactThreeFiberVersion === null ? null : getLowestDependencyMajor(reactThreeFiberVersion),
|
|
34930
34655
|
hasSsrDependency: workspaceFacts.hasSsrDependency,
|
|
34931
34656
|
preactVersion,
|
|
34932
34657
|
preactMajorVersion: parseReactMajor(preactVersion),
|
|
@@ -38201,10 +37926,10 @@ const SSR_FRAMEWORKS = new Set([
|
|
|
38201
37926
|
"gatsby",
|
|
38202
37927
|
"tanstack-start"
|
|
38203
37928
|
]);
|
|
38204
|
-
const
|
|
38205
|
-
if (
|
|
38206
|
-
const
|
|
38207
|
-
for (let candidate = earliest; candidate <=
|
|
37929
|
+
const addMajorLadder = (capabilities, name, major, earliest, latest) => {
|
|
37930
|
+
if (major === null) return;
|
|
37931
|
+
const cappedMajor = Math.min(major, latest);
|
|
37932
|
+
for (let candidate = earliest; candidate <= cappedMajor; candidate += 1) capabilities.add(`${name}:${candidate}`);
|
|
38208
37933
|
};
|
|
38209
37934
|
const buildCapabilities = (project) => {
|
|
38210
37935
|
const capabilities = /* @__PURE__ */ new Set();
|
|
@@ -38217,77 +37942,37 @@ const buildCapabilities = (project) => {
|
|
|
38217
37942
|
if (CLIENT_ONLY_FRAMEWORKS.has(project.framework)) capabilities.add("client-only");
|
|
38218
37943
|
if (project.isStaticExport) capabilities.add("nextjs:static-export");
|
|
38219
37944
|
if (project.nextjsMajorVersion !== null && project.nextjsMajorVersion >= 15) capabilities.add("nextjs:15");
|
|
38220
|
-
|
|
38221
|
-
addVersionCapabilityLadder(capabilities, "react", project.reactMajorVersion, 17, 30);
|
|
37945
|
+
addMajorLadder(capabilities, "react", project.reactMajorVersion, 17, 30);
|
|
38222
37946
|
if (project.reactMajorVersion !== null && project.reactMajorVersion >= 19 && isMajorMinorAtLeast(parseReactMajorMinor(project.reactVersion), {
|
|
38223
37947
|
major: 19,
|
|
38224
37948
|
minor: 2
|
|
38225
37949
|
})) capabilities.add("react:19.2");
|
|
38226
|
-
if (project.tailwindVersion !== null)
|
|
38227
|
-
|
|
38228
|
-
|
|
38229
|
-
|
|
38230
|
-
|
|
38231
|
-
minor: 4
|
|
38232
|
-
})) capabilities.add("tailwind:3.4");
|
|
38233
|
-
if (tailwindVersion !== null && isMajorMinorAtLeast(tailwindVersion, {
|
|
38234
|
-
major: 4,
|
|
38235
|
-
minor: 0
|
|
38236
|
-
})) capabilities.add("tailwind:4");
|
|
38237
|
-
}
|
|
37950
|
+
if (project.tailwindVersion !== null) capabilities.add("tailwind");
|
|
37951
|
+
if (project.tailwindVersion !== null && isMajorMinorAtLeast(parseTailwindMajorMinor(project.tailwindVersion), {
|
|
37952
|
+
major: 3,
|
|
37953
|
+
minor: 4
|
|
37954
|
+
})) capabilities.add("tailwind:3.4");
|
|
38238
37955
|
if (project.zodVersion !== null) capabilities.add("zod");
|
|
38239
37956
|
if (project.zodMajorVersion !== null && project.zodMajorVersion >= 4) capabilities.add("zod:4");
|
|
38240
37957
|
if (project.mobxVersion !== void 0 && project.mobxVersion !== null || project.hasMobxReact === true || project.hasMobxReactLite === true || project.hasMobxStateTree === true || project.hasMobxReactObserver === true) capabilities.add("mobx");
|
|
38241
37958
|
if (project.hasMobxReact === true) capabilities.add("mobx-react");
|
|
38242
37959
|
if (project.hasMobxReactLite === true) capabilities.add("mobx-react-lite");
|
|
38243
37960
|
if (project.hasMobxReact === true || project.hasMobxReactLite === true) capabilities.add("mobx-react-binding");
|
|
38244
|
-
const mobxReactVersion = parseDependencyMajorMinor(project.mobxReactVersion);
|
|
38245
|
-
const mobxReactLiteVersion = parseDependencyMajorMinor(project.mobxReactLiteVersion);
|
|
38246
|
-
const hasMobxReactObserverMemoGuard = mobxReactVersion !== null && isMajorMinorAtLeast(mobxReactVersion, {
|
|
38247
|
-
major: 7,
|
|
38248
|
-
minor: 3
|
|
38249
|
-
});
|
|
38250
|
-
const hasMobxReactLiteObserverMemoGuard = mobxReactLiteVersion !== null && isMajorMinorAtLeast(mobxReactLiteVersion, {
|
|
38251
|
-
major: 3,
|
|
38252
|
-
minor: 3
|
|
38253
|
-
});
|
|
38254
|
-
if (hasMobxReactObserverMemoGuard) capabilities.add("mobx-react-observer-memo-guard");
|
|
38255
|
-
if (hasMobxReactLiteObserverMemoGuard) capabilities.add("mobx-react-lite-observer-memo-guard");
|
|
38256
|
-
if (hasMobxReactObserverMemoGuard || hasMobxReactLiteObserverMemoGuard) capabilities.add("mobx-react-binding-observer-memo-guard");
|
|
38257
37961
|
if (project.hasMobxStateTree === true) capabilities.add("mobx-state-tree");
|
|
38258
37962
|
if (project.hasMobxReactObserver === true) capabilities.add("mobx-react-observer");
|
|
38259
|
-
if (project.mobxMajorVersion !== void 0 && project.mobxMajorVersion !== null && project.mobxMajorVersion >= 4 && project.mobxMajorVersion <= 6)
|
|
38260
|
-
const mobxVersion = parseDependencyMajorMinor(project.mobxVersion);
|
|
38261
|
-
if (project.mobxMajorVersion === 6 && mobxVersion !== null && isMajorMinorAtLeast(mobxVersion, {
|
|
38262
|
-
major: 6,
|
|
38263
|
-
minor: 10
|
|
38264
|
-
})) capabilities.add("mobx:6.10");
|
|
38265
|
-
if (project.zustandVersion !== void 0 && project.zustandVersion !== null) capabilities.add("zustand");
|
|
38266
|
-
if (project.zustandMajorVersion !== void 0 && project.zustandMajorVersion !== null && project.zustandMajorVersion >= 1 && project.zustandMajorVersion <= 5) addVersionCapabilityLadder(capabilities, "zustand", project.zustandMajorVersion, 1, 5);
|
|
37963
|
+
if (project.mobxMajorVersion !== void 0 && project.mobxMajorVersion !== null && project.mobxMajorVersion >= 4 && project.mobxMajorVersion <= 6) addMajorLadder(capabilities, "mobx", project.mobxMajorVersion, 4, 6);
|
|
38267
37964
|
if (project.isPreES2023Target) capabilities.add("pre-es2023");
|
|
38268
37965
|
if (project.hasReactCompiler) capabilities.add("react-compiler");
|
|
38269
|
-
if (
|
|
38270
|
-
if (project.styledComponentsVersion) {
|
|
38271
|
-
capabilities.add("styled-components");
|
|
38272
|
-
const styledComponentsMajor = getLowestDependencyMajor(project.styledComponentsVersion);
|
|
38273
|
-
if (styledComponentsMajor !== null && styledComponentsMajor >= 6) capabilities.add("styled-components:6");
|
|
38274
|
-
}
|
|
38275
|
-
if (project.hasI18nLibrary) capabilities.add("i18n");
|
|
37966
|
+
if (project.hasTanStackQuery) capabilities.add("tanstack-query");
|
|
38276
37967
|
if (project.valtioVersion !== null) capabilities.add("valtio");
|
|
38277
|
-
|
|
37968
|
+
addMajorLadder(capabilities, "valtio", project.valtioMajorVersion, 1, 10);
|
|
38278
37969
|
if (project.hasRemotion) {
|
|
38279
37970
|
capabilities.add("remotion");
|
|
38280
|
-
|
|
38281
|
-
}
|
|
38282
|
-
if (project.hasThree || project.hasReactThreeFiber) capabilities.add("three");
|
|
38283
|
-
addVersionCapabilityLadder(capabilities, "three", project.threeRelease ?? null, 145, 250);
|
|
38284
|
-
if (project.hasReactThreeFiber) {
|
|
38285
|
-
capabilities.add("r3f");
|
|
38286
|
-
addVersionCapabilityLadder(capabilities, "r3f", project.reactThreeFiberMajorVersion ?? null, 3, 10);
|
|
37971
|
+
addMajorLadder(capabilities, "remotion", project.remotionMajorVersion ?? null, 4, 30);
|
|
38287
37972
|
}
|
|
38288
37973
|
if (project.hasTypeScript) capabilities.add("typescript");
|
|
38289
37974
|
if (project.preactVersion !== null) capabilities.add("preact");
|
|
38290
|
-
|
|
37975
|
+
addMajorLadder(capabilities, "preact", project.preactMajorVersion, 10, 20);
|
|
38291
37976
|
if (project.preactVersion !== null && project.reactVersion === null) capabilities.add("pure-preact");
|
|
38292
37977
|
return capabilities;
|
|
38293
37978
|
};
|
|
@@ -38299,7 +37984,7 @@ const getCapabilities = (project) => {
|
|
|
38299
37984
|
capabilitiesByProject.set(project, capabilities);
|
|
38300
37985
|
return capabilities;
|
|
38301
37986
|
};
|
|
38302
|
-
const shouldEnableRule = (requires, tags, capabilities, ignoredTags, disabledWhen
|
|
37987
|
+
const shouldEnableRule = (requires, tags, capabilities, ignoredTags, disabledWhen) => {
|
|
38303
37988
|
if (requires) {
|
|
38304
37989
|
for (const capability of requires) if (!capabilities.has(capability)) return false;
|
|
38305
37990
|
}
|
|
@@ -38310,29 +37995,20 @@ const shouldEnableRule = (requires, tags, capabilities, ignoredTags, disabledWhe
|
|
|
38310
37995
|
if (tags) {
|
|
38311
37996
|
for (const tag of tags) if (ignoredTags.has(tag)) return false;
|
|
38312
37997
|
}
|
|
38313
|
-
if (includedTags && includedTags.size > 0) {
|
|
38314
|
-
if (!tags?.some((tag) => includedTags.has(tag))) return false;
|
|
38315
|
-
}
|
|
38316
37998
|
return true;
|
|
38317
37999
|
};
|
|
38318
|
-
const shouldEnableRuleByDefaultStatus = (options) => options.defaultEnabled !== false || options.hasExplicitOverride === true || options.includeTagDefaults && options.hasIncludedTags;
|
|
38319
38000
|
const yieldToEventLoop = () => new Promise((resolve) => {
|
|
38320
38001
|
setImmediate(resolve);
|
|
38321
38002
|
});
|
|
38322
38003
|
const createSecurityScanSession = (rootDirectory, options) => {
|
|
38323
38004
|
const capabilities = options.project ? getCapabilities(options.project) : /* @__PURE__ */ new Set();
|
|
38324
38005
|
const ignoredTags = options.ignoredTags ?? /* @__PURE__ */ new Set();
|
|
38325
|
-
const includedTags = options.includedTags ?? /* @__PURE__ */ new Set();
|
|
38326
38006
|
const enabledScanRules = REACT_DOCTOR_RULES.flatMap((entry) => {
|
|
38327
38007
|
const rule = entry.rule;
|
|
38328
38008
|
const scan = rule.scan;
|
|
38329
38009
|
if (typeof scan !== "function") return [];
|
|
38330
|
-
if (
|
|
38331
|
-
|
|
38332
|
-
includeTagDefaults: options.includeTagDefaults === true,
|
|
38333
|
-
hasIncludedTags: includedTags.size > 0
|
|
38334
|
-
})) return [];
|
|
38335
|
-
if (!shouldEnableRule(rule.requires, rule.tags, capabilities, ignoredTags, rule.disabledWhen, includedTags)) return [];
|
|
38010
|
+
if (rule.defaultEnabled === false) return [];
|
|
38011
|
+
if (!shouldEnableRule(rule.requires, rule.tags, capabilities, ignoredTags, rule.disabledWhen)) return [];
|
|
38336
38012
|
return [{
|
|
38337
38013
|
entry,
|
|
38338
38014
|
scan,
|
|
@@ -40318,9 +39994,8 @@ const buildUserPluginRules = (userPlugin, severityControls) => {
|
|
|
40318
39994
|
}
|
|
40319
39995
|
return enabled;
|
|
40320
39996
|
};
|
|
40321
|
-
const createOxlintConfig = ({ pluginPath, project, customRulesOnly = false, extendsPaths = [], ignoredTags = /* @__PURE__ */ new Set(),
|
|
40322
|
-
const
|
|
40323
|
-
const reactHooksJsPlugin = disableReactHooksJsPlugin || ruleSelection === "sidecar" || hasIncludedTags ? null : resolveReactHooksJsPlugin(project.hasReactCompiler || project.hasReactCompilerLintPlugin === true, customRulesOnly);
|
|
39997
|
+
const createOxlintConfig = ({ pluginPath, project, customRulesOnly = false, extendsPaths = [], ignoredTags = /* @__PURE__ */ new Set(), serverAuthFunctionNames, severityControls, userPlugins = [], disableReactHooksJsPlugin = false, ruleSelection, sidecarRuleIdFilter }) => {
|
|
39998
|
+
const reactHooksJsPlugin = disableReactHooksJsPlugin || ruleSelection === "sidecar" ? null : resolveReactHooksJsPlugin(project.hasReactCompiler || project.hasReactCompilerLintPlugin === true, customRulesOnly);
|
|
40324
39999
|
const reactCompilerRules = reactHooksJsPlugin ? applyRuleSeverityControls(filterRulesToAvailable(REACT_COMPILER_RULES, "react-hooks-js", reactHooksJsPlugin.availableRuleNames), severityControls) : {};
|
|
40325
40000
|
const jsPlugins = [];
|
|
40326
40001
|
if (reactHooksJsPlugin) jsPlugins.push(reactHooksJsPlugin.entry);
|
|
@@ -40335,14 +40010,9 @@ const createOxlintConfig = ({ pluginPath, project, customRulesOnly = false, exte
|
|
|
40335
40010
|
if (rule.scan !== void 0) continue;
|
|
40336
40011
|
if (customRulesOnly && registryEntry.originallyExternal) continue;
|
|
40337
40012
|
if (rule.framework !== "global" && !rule.requires) continue;
|
|
40338
|
-
if (!shouldEnableRule(rule.requires, rule.tags, capabilities, ignoredTags, rule.disabledWhen
|
|
40013
|
+
if (!shouldEnableRule(rule.requires, rule.tags, capabilities, ignoredTags, rule.disabledWhen)) continue;
|
|
40339
40014
|
const explicitRuleOverride = resolveRuleSeverityOverride({ ruleKey: registryEntry.key }, severityControls);
|
|
40340
|
-
if (
|
|
40341
|
-
defaultEnabled: rule.defaultEnabled,
|
|
40342
|
-
includeTagDefaults,
|
|
40343
|
-
hasIncludedTags,
|
|
40344
|
-
hasExplicitOverride: explicitRuleOverride !== void 0
|
|
40345
|
-
})) continue;
|
|
40015
|
+
if (rule.defaultEnabled === false && explicitRuleOverride === void 0) continue;
|
|
40346
40016
|
const severity = resolveRuleSeverityOverride({
|
|
40347
40017
|
ruleKey: registryEntry.key,
|
|
40348
40018
|
category: rule.category
|
|
@@ -40351,7 +40021,7 @@ const createOxlintConfig = ({ pluginPath, project, customRulesOnly = false, exte
|
|
|
40351
40021
|
enabledReactDoctorRules[registryEntry.key] = severity;
|
|
40352
40022
|
}
|
|
40353
40023
|
const userPluginRules = {};
|
|
40354
|
-
if (ruleSelection !== "sidecar"
|
|
40024
|
+
if (ruleSelection !== "sidecar") for (const userPlugin of userPlugins) {
|
|
40355
40025
|
Object.assign(userPluginRules, buildUserPluginRules(userPlugin, severityControls));
|
|
40356
40026
|
jsPlugins.push(userPlugin.entry);
|
|
40357
40027
|
}
|
|
@@ -40568,19 +40238,6 @@ const createSidecarLintCache = (cacheDirectory, rulesetHash) => {
|
|
|
40568
40238
|
}
|
|
40569
40239
|
};
|
|
40570
40240
|
};
|
|
40571
|
-
const fingerprintCacheByFilePath = /* @__PURE__ */ new Map();
|
|
40572
|
-
const fingerprintFileContents = (filePath, fingerprintLength) => {
|
|
40573
|
-
const fileStats = NFS.statSync(filePath, { bigint: true });
|
|
40574
|
-
const cachedFingerprint = fingerprintCacheByFilePath.get(filePath);
|
|
40575
|
-
if (cachedFingerprint?.modifiedTimeNanoseconds === fileStats.mtimeNs && cachedFingerprint.sizeBytes === fileStats.size) return cachedFingerprint.fingerprint;
|
|
40576
|
-
const fingerprint = crypto.createHash("sha256").update(NFS.readFileSync(filePath)).digest("hex").slice(0, fingerprintLength);
|
|
40577
|
-
fingerprintCacheByFilePath.set(filePath, {
|
|
40578
|
-
fingerprint,
|
|
40579
|
-
modifiedTimeNanoseconds: fileStats.mtimeNs,
|
|
40580
|
-
sizeBytes: fileStats.size
|
|
40581
|
-
});
|
|
40582
|
-
return fingerprint;
|
|
40583
|
-
};
|
|
40584
40241
|
const bundledRequire = createRequire(import.meta.url);
|
|
40585
40242
|
const childNodeVersionByBinaryPath = /* @__PURE__ */ new Map();
|
|
40586
40243
|
const resolveChildNodeVersion = (nodeBinaryPath) => {
|
|
@@ -40604,13 +40261,6 @@ const TOOLCHAIN_PACKAGE_SPECIFIERS = [
|
|
|
40604
40261
|
"oxlint-plugin-react-doctor/package.json",
|
|
40605
40262
|
"eslint-plugin-react-hooks/package.json"
|
|
40606
40263
|
];
|
|
40607
|
-
const resolvePluginFingerprint = () => {
|
|
40608
|
-
try {
|
|
40609
|
-
return fingerprintFileContents(bundledRequire.resolve("oxlint-plugin-react-doctor"), 16);
|
|
40610
|
-
} catch {
|
|
40611
|
-
return "unresolved";
|
|
40612
|
-
}
|
|
40613
|
-
};
|
|
40614
40264
|
const resolveOxlintToolchainVersions = (nodeBinaryPath = process.execPath) => {
|
|
40615
40265
|
const versions = [`node=${resolveChildNodeVersion(nodeBinaryPath)}`];
|
|
40616
40266
|
for (const specifier of TOOLCHAIN_PACKAGE_SPECIFIERS) try {
|
|
@@ -40620,7 +40270,6 @@ const resolveOxlintToolchainVersions = (nodeBinaryPath = process.execPath) => {
|
|
|
40620
40270
|
} catch {
|
|
40621
40271
|
versions.push(`${specifier}=missing`);
|
|
40622
40272
|
}
|
|
40623
|
-
versions.push(`oxlint-plugin-react-doctor#fingerprint=${resolvePluginFingerprint()}`);
|
|
40624
40273
|
return versions;
|
|
40625
40274
|
};
|
|
40626
40275
|
const esmRequire = createRequire(import.meta.url);
|
|
@@ -42096,7 +41745,7 @@ const reactHooksJsPluginDropNote = (error) => {
|
|
|
42096
41745
|
* 6. always restore disable directives + clean up the temp dir
|
|
42097
41746
|
*/
|
|
42098
41747
|
const runOxlint = async (options) => {
|
|
42099
|
-
const { rootDirectory, project, includePaths, nodeBinaryPath = process.execPath, customRulesOnly = false, respectInlineDisables = true, adoptExistingLintConfig = true, ignoredTags = /* @__PURE__ */ new Set(),
|
|
41748
|
+
const { rootDirectory, project, includePaths, nodeBinaryPath = process.execPath, customRulesOnly = false, respectInlineDisables = true, adoptExistingLintConfig = true, ignoredTags = /* @__PURE__ */ new Set(), userConfig, configSourceDirectory = rootDirectory, onPartialFailure, onFileCoverage, perFileLintCacheEnabled = false, sidecarLintCacheEnabled = false, onCacheStats, onSidecarStats, spawnTimeoutMs, outputMaxBytes, lintBatchOrdering = "cost" } = options;
|
|
42100
41749
|
const serverAuthFunctionNames = Array.isArray(userConfig?.serverAuthFunctionNames) ? userConfig.serverAuthFunctionNames.filter((entry) => typeof entry === "string" && entry.length > 0) : void 0;
|
|
42101
41750
|
const severityControls = buildRuleSeverityControls(userConfig);
|
|
42102
41751
|
validateRuleRegistration();
|
|
@@ -42110,15 +41759,13 @@ const runOxlint = async (options) => {
|
|
|
42110
41759
|
}
|
|
42111
41760
|
const pluginPath = resolvePluginPath();
|
|
42112
41761
|
const extendsPaths = (adoptExistingLintConfig && !customRulesOnly ? detectUserLintConfigPaths(rootDirectory) : []).filter(canOxlintExtendConfig);
|
|
42113
|
-
const userPlugins =
|
|
41762
|
+
const userPlugins = resolveUserPlugins(userConfig?.plugins, configSourceDirectory);
|
|
42114
41763
|
const buildConfig = (overrides) => createOxlintConfig({
|
|
42115
41764
|
pluginPath,
|
|
42116
41765
|
project,
|
|
42117
41766
|
customRulesOnly,
|
|
42118
41767
|
extendsPaths: overrides.extendsPaths,
|
|
42119
41768
|
ignoredTags,
|
|
42120
|
-
includedTags,
|
|
42121
|
-
includeTagDefaults,
|
|
42122
41769
|
serverAuthFunctionNames,
|
|
42123
41770
|
severityControls,
|
|
42124
41771
|
userPlugins,
|
|
@@ -42507,8 +42154,6 @@ var Linter = class Linter extends Service()("react-doctor/Linter") {
|
|
|
42507
42154
|
respectInlineDisables: input.respectInlineDisables,
|
|
42508
42155
|
adoptExistingLintConfig: input.adoptExistingLintConfig,
|
|
42509
42156
|
ignoredTags: input.ignoredTags,
|
|
42510
|
-
includedTags: input.includedTags,
|
|
42511
|
-
includeTagDefaults: input.includeTagDefaults,
|
|
42512
42157
|
userConfig: input.userConfig ?? null,
|
|
42513
42158
|
configSourceDirectory: input.configSourceDirectory,
|
|
42514
42159
|
onPartialFailure: (reason) => {
|
|
@@ -43357,9 +43002,7 @@ const runInspect = (input, hooks = {}) => gen(function* () {
|
|
|
43357
43002
|
const securityScanFailedRef = yield* make$13(false);
|
|
43358
43003
|
const securityScanFiber = yield* forkChild(runCollect(applyPerElementPipeline(isDiffMode ? empty$4 : unwrap(tryPromise(() => checkSecurityScanCooperative(scanDirectory, {
|
|
43359
43004
|
project,
|
|
43360
|
-
ignoredTags: input.ignoredTags
|
|
43361
|
-
includedTags: input.includedTags,
|
|
43362
|
-
includeTagDefaults: input.includeTagDefaults
|
|
43005
|
+
ignoredTags: input.ignoredTags
|
|
43363
43006
|
})).pipe(map$3((diagnostics) => fromIterable$1(diagnostics)), catch_$1(() => set(securityScanFailedRef, true).pipe(as(empty$4))))))).pipe(withSpan("SecurityScan.run")));
|
|
43364
43007
|
const shouldRunSupplyChain = !isDiffMode || (input.supplyChainManifestChanged ?? false);
|
|
43365
43008
|
const supplyChainOverlapTimeout = yield* SupplyChainOverlapTimeoutMs;
|
|
@@ -43450,8 +43093,6 @@ const runInspect = (input, hooks = {}) => gen(function* () {
|
|
|
43450
43093
|
respectInlineDisables: input.respectInlineDisables,
|
|
43451
43094
|
adoptExistingLintConfig: input.adoptExistingLintConfig,
|
|
43452
43095
|
ignoredTags: input.ignoredTags,
|
|
43453
|
-
includedTags: input.includedTags,
|
|
43454
|
-
includeTagDefaults: input.includeTagDefaults,
|
|
43455
43096
|
userConfig: resolvedConfig.config ?? void 0,
|
|
43456
43097
|
configSourceDirectory: resolvedConfig.configSourceDirectory ?? void 0,
|
|
43457
43098
|
onFileProgress: (scannedFileCount, totalFileCount) => {
|
|
@@ -44312,4 +43953,4 @@ const toJsonReport = (result, options) => buildJsonReport({
|
|
|
44312
43953
|
export { AmbiguousProjectError, NoReactDependencyError, NotADirectoryError, PackageJsonNotFoundError, ProjectNotFoundError, ReactDoctorError, buildJsonReport, buildJsonReportError, clearCaches, defineConfig, diagnose, filterSourceFiles, getDiffInfo, hasReactRuntime, isProjectDiscoveryError, isReactDoctorError, summarizeDiagnostics, toJsonReport };
|
|
44313
43954
|
|
|
44314
43955
|
//# sourceMappingURL=index.js.map
|
|
44315
|
-
//# debugId=
|
|
43956
|
+
//# debugId=1d61ce96-d819-561a-9f41-f616d6355f62
|