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/cli.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]="c5ad9312-01de-535b-a900-0d45e296a4fa")}catch(e){}}();
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import * as NodeChildProcess from "node:child_process";
|
|
5
5
|
import { execFile, execFileSync, spawn, spawnSync } from "node:child_process";
|
|
@@ -36022,6 +36022,44 @@ var AmbiguousProjectError = class extends Error {
|
|
|
36022
36022
|
}
|
|
36023
36023
|
};
|
|
36024
36024
|
const isProjectDiscoveryError = (value) => value instanceof ProjectNotFoundError || value instanceof NoReactDependencyError || value instanceof PackageJsonNotFoundError || value instanceof NotADirectoryError || value instanceof AmbiguousProjectError;
|
|
36025
|
+
const isErrnoException = (error) => error instanceof Error && "code" in error;
|
|
36026
|
+
const IGNORABLE_READDIR_ERROR_CODES = new Set([
|
|
36027
|
+
"EACCES",
|
|
36028
|
+
"EPERM",
|
|
36029
|
+
"ENOENT",
|
|
36030
|
+
"ENOTDIR",
|
|
36031
|
+
"EINVAL",
|
|
36032
|
+
"ELOOP",
|
|
36033
|
+
"ENAMETOOLONG"
|
|
36034
|
+
]);
|
|
36035
|
+
const isIgnorableReaddirError = (error) => isErrnoException(error) && typeof error.code === "string" && IGNORABLE_READDIR_ERROR_CODES.has(error.code);
|
|
36036
|
+
const readDirectoryEntries = (directoryPath) => {
|
|
36037
|
+
try {
|
|
36038
|
+
return NFS.readdirSync(directoryPath, { withFileTypes: true });
|
|
36039
|
+
} catch (error) {
|
|
36040
|
+
if (isIgnorableReaddirError(error)) return [];
|
|
36041
|
+
throw error;
|
|
36042
|
+
}
|
|
36043
|
+
};
|
|
36044
|
+
const isFile = (filePath) => {
|
|
36045
|
+
try {
|
|
36046
|
+
return NFS.statSync(filePath).isFile();
|
|
36047
|
+
} catch {
|
|
36048
|
+
return false;
|
|
36049
|
+
}
|
|
36050
|
+
};
|
|
36051
|
+
const isDirectory = (directoryPath) => {
|
|
36052
|
+
try {
|
|
36053
|
+
return NFS.statSync(directoryPath).isDirectory();
|
|
36054
|
+
} catch {
|
|
36055
|
+
return false;
|
|
36056
|
+
}
|
|
36057
|
+
};
|
|
36058
|
+
const isPlainObject = (value) => {
|
|
36059
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) return false;
|
|
36060
|
+
const prototype = Object.getPrototypeOf(value);
|
|
36061
|
+
return prototype === null || prototype === Object.prototype;
|
|
36062
|
+
};
|
|
36025
36063
|
const SOURCE_FILE_PATTERN = /\.(tsx?|jsx?|mts|mjs)$/;
|
|
36026
36064
|
const GENERATED_BUNDLE_FILE_PATTERN = /\.(iife|umd|global|min)\.m?js$/i;
|
|
36027
36065
|
const GENERATED_SOURCE_DIRECTORY_PATTERN = /(?:^|\/)__generated__\//;
|
|
@@ -36214,44 +36252,6 @@ const SUPPLY_CHAIN_OVERLAP_TIMEOUT_MS = 9e4;
|
|
|
36214
36252
|
const SUPPLY_CHAIN_CACHE_TTL_MS = 864e5;
|
|
36215
36253
|
const SUPPLY_CHAIN_CACHE_SUBDIR = "supply-chain";
|
|
36216
36254
|
const SUPPLY_CHAIN_IGNORED_PACKAGES = new Set(["next"]);
|
|
36217
|
-
const isErrnoException = (error) => error instanceof Error && "code" in error;
|
|
36218
|
-
const IGNORABLE_READDIR_ERROR_CODES = new Set([
|
|
36219
|
-
"EACCES",
|
|
36220
|
-
"EPERM",
|
|
36221
|
-
"ENOENT",
|
|
36222
|
-
"ENOTDIR",
|
|
36223
|
-
"EINVAL",
|
|
36224
|
-
"ELOOP",
|
|
36225
|
-
"ENAMETOOLONG"
|
|
36226
|
-
]);
|
|
36227
|
-
const isIgnorableReaddirError = (error) => isErrnoException(error) && typeof error.code === "string" && IGNORABLE_READDIR_ERROR_CODES.has(error.code);
|
|
36228
|
-
const readDirectoryEntries = (directoryPath) => {
|
|
36229
|
-
try {
|
|
36230
|
-
return NFS.readdirSync(directoryPath, { withFileTypes: true });
|
|
36231
|
-
} catch (error) {
|
|
36232
|
-
if (isIgnorableReaddirError(error)) return [];
|
|
36233
|
-
throw error;
|
|
36234
|
-
}
|
|
36235
|
-
};
|
|
36236
|
-
const isFile = (filePath) => {
|
|
36237
|
-
try {
|
|
36238
|
-
return NFS.statSync(filePath).isFile();
|
|
36239
|
-
} catch {
|
|
36240
|
-
return false;
|
|
36241
|
-
}
|
|
36242
|
-
};
|
|
36243
|
-
const isDirectory = (directoryPath) => {
|
|
36244
|
-
try {
|
|
36245
|
-
return NFS.statSync(directoryPath).isDirectory();
|
|
36246
|
-
} catch {
|
|
36247
|
-
return false;
|
|
36248
|
-
}
|
|
36249
|
-
};
|
|
36250
|
-
const isPlainObject = (value) => {
|
|
36251
|
-
if (typeof value !== "object" || value === null || Array.isArray(value)) return false;
|
|
36252
|
-
const prototype = Object.getPrototypeOf(value);
|
|
36253
|
-
return prototype === null || prototype === Object.prototype;
|
|
36254
|
-
};
|
|
36255
36255
|
const lastSourceMappingUrl = (fileContent) => {
|
|
36256
36256
|
const lastReference = [...fileContent.matchAll(/\/\/# sourceMappingURL=(\S+)/g)].at(-1);
|
|
36257
36257
|
return lastReference ? lastReference[1] : null;
|
|
@@ -36571,10 +36571,10 @@ const FALLBACK_TSCONFIG_FILENAMES = ["tsconfig.app.json", "tsconfig.build.json"]
|
|
|
36571
36571
|
const FRAMEWORK_PACKAGES = {
|
|
36572
36572
|
next: "nextjs",
|
|
36573
36573
|
"@tanstack/react-start": "tanstack-start",
|
|
36574
|
-
"@remix-run/react": "remix",
|
|
36575
|
-
gatsby: "gatsby",
|
|
36576
36574
|
vite: "vite",
|
|
36577
36575
|
"react-scripts": "cra",
|
|
36576
|
+
"@remix-run/react": "remix",
|
|
36577
|
+
gatsby: "gatsby",
|
|
36578
36578
|
expo: "expo",
|
|
36579
36579
|
"react-native": "react-native"
|
|
36580
36580
|
};
|
|
@@ -36598,17 +36598,11 @@ const NEXT_CONFIG_FILENAMES = [
|
|
|
36598
36598
|
];
|
|
36599
36599
|
const BABEL_CONFIG_FILENAMES = [
|
|
36600
36600
|
".babelrc",
|
|
36601
|
-
".babelrc.js",
|
|
36602
36601
|
".babelrc.json",
|
|
36603
|
-
".babelrc.cjs",
|
|
36604
|
-
".babelrc.mjs",
|
|
36605
|
-
".babelrc.cts",
|
|
36606
36602
|
"babel.config.js",
|
|
36607
36603
|
"babel.config.json",
|
|
36608
36604
|
"babel.config.cjs",
|
|
36609
|
-
"babel.config.mjs"
|
|
36610
|
-
"babel.config.ts",
|
|
36611
|
-
"babel.config.cts"
|
|
36605
|
+
"babel.config.mjs"
|
|
36612
36606
|
];
|
|
36613
36607
|
const VITE_CONFIG_FILENAMES = [
|
|
36614
36608
|
"vite.config.js",
|
|
@@ -36620,28 +36614,12 @@ const VITE_CONFIG_FILENAMES = [
|
|
|
36620
36614
|
"vitest.config.ts",
|
|
36621
36615
|
"vitest.config.js"
|
|
36622
36616
|
];
|
|
36623
|
-
const RSBUILD_CONFIG_FILENAMES = [
|
|
36624
|
-
"rsbuild.config.ts",
|
|
36625
|
-
"rsbuild.config.js",
|
|
36626
|
-
"rsbuild.config.mts",
|
|
36627
|
-
"rsbuild.config.mjs",
|
|
36628
|
-
"rsbuild.config.cts",
|
|
36629
|
-
"rsbuild.config.cjs"
|
|
36630
|
-
];
|
|
36631
|
-
const RSPACK_CONFIG_FILENAMES = [
|
|
36632
|
-
"rspack.config.ts",
|
|
36633
|
-
"rspack.config.js",
|
|
36634
|
-
"rspack.config.mts",
|
|
36635
|
-
"rspack.config.mjs",
|
|
36636
|
-
"rspack.config.cts",
|
|
36637
|
-
"rspack.config.cjs"
|
|
36638
|
-
];
|
|
36639
36617
|
const EXPO_APP_CONFIG_FILENAMES = [
|
|
36640
36618
|
"app.json",
|
|
36641
36619
|
"app.config.js",
|
|
36642
36620
|
"app.config.ts"
|
|
36643
36621
|
];
|
|
36644
|
-
const REACT_COMPILER_PACKAGE_REFERENCE_PATTERN = /babel-plugin-react-compiler|react-compiler-runtime|
|
|
36622
|
+
const REACT_COMPILER_PACKAGE_REFERENCE_PATTERN = /babel-plugin-react-compiler|react-compiler-runtime|["']react-compiler["']/;
|
|
36645
36623
|
const REACT_COMPILER_ENABLED_FLAG_PATTERN = /["']?reactCompiler["']?\s*:\s*(?:true\b|\{)/;
|
|
36646
36624
|
const STATIC_EXPORT_OUTPUT_PATTERN = /(?:^|[^.\w])["']?output["']?\s*:\s*["']export["']/m;
|
|
36647
36625
|
const hasCompilerPackage = (packageJson, compilerPackages) => {
|
|
@@ -36676,8 +36654,6 @@ const detectReactCompiler = (directory, packageJson) => {
|
|
|
36676
36654
|
if (hasCompilerInConfigFiles(directory, NEXT_CONFIG_FILENAMES)) return true;
|
|
36677
36655
|
if (hasCompilerInConfigFiles(directory, BABEL_CONFIG_FILENAMES)) return true;
|
|
36678
36656
|
if (hasCompilerInConfigFiles(directory, VITE_CONFIG_FILENAMES)) return true;
|
|
36679
|
-
if (hasCompilerInConfigFiles(directory, RSBUILD_CONFIG_FILENAMES)) return true;
|
|
36680
|
-
if (hasCompilerInConfigFiles(directory, RSPACK_CONFIG_FILENAMES)) return true;
|
|
36681
36657
|
if (hasCompilerInConfigFiles(directory, EXPO_APP_CONFIG_FILENAMES)) return true;
|
|
36682
36658
|
return hasCompilerPackageInAncestors(directory, REACT_COMPILER_TRANSFORM_PACKAGES);
|
|
36683
36659
|
};
|
|
@@ -36686,7 +36662,7 @@ const detectNextjsStaticExport = (directory) => NEXT_CONFIG_FILENAMES.some((file
|
|
|
36686
36662
|
const filePath = Path.join(directory, filename);
|
|
36687
36663
|
return isFile(filePath) && STATIC_EXPORT_OUTPUT_PATTERN.test(NFS.readFileSync(filePath, "utf-8"));
|
|
36688
36664
|
});
|
|
36689
|
-
const UNRESOLVABLE_PROTOCOL_VERSION = /^(?:
|
|
36665
|
+
const UNRESOLVABLE_PROTOCOL_VERSION = /^(?:file|git|github|https?|link|patch|portal|workspace|npm):/i;
|
|
36690
36666
|
const DIST_TAG_VERSION = /^[a-z][a-z0-9._-]*$/i;
|
|
36691
36667
|
const WILDCARD_VERSION = /^[*xX](?:\.[*xX])*$/;
|
|
36692
36668
|
const NPM_ALIAS_VERSION = /^npm:(?:@[^/]+\/[^@]+|[^@]+)@(.+)$/i;
|
|
@@ -36819,16 +36795,6 @@ const getLowestDependencyMajor = (version) => {
|
|
|
36819
36795
|
}
|
|
36820
36796
|
return lowestMajor;
|
|
36821
36797
|
};
|
|
36822
|
-
const getDependencyMajorWithinSupportedRange = (version, latestSupportedMajor) => {
|
|
36823
|
-
const normalizedVersion = normalizeDependencyVersion(version);
|
|
36824
|
-
if (normalizedVersion === null) return null;
|
|
36825
|
-
const validRange = import_semver.validRange(normalizedVersion);
|
|
36826
|
-
if (validRange === null) return null;
|
|
36827
|
-
const minimumVersion = import_semver.minVersion(validRange);
|
|
36828
|
-
if (minimumVersion === null || minimumVersion.major > latestSupportedMajor) return null;
|
|
36829
|
-
if (import_semver.intersects(validRange, `>=${latestSupportedMajor + 1}.0.0`)) return null;
|
|
36830
|
-
return minimumVersion.major;
|
|
36831
|
-
};
|
|
36832
36798
|
const isConcreteDependencyVersion = (version) => {
|
|
36833
36799
|
const normalizedVersion = normalizeDependencyVersion(version);
|
|
36834
36800
|
return normalizedVersion !== null && /\d/.test(normalizedVersion);
|
|
@@ -36872,18 +36838,9 @@ const parseReactMajorMinor = (reactVersion) => {
|
|
|
36872
36838
|
};
|
|
36873
36839
|
};
|
|
36874
36840
|
const parseLowerBoundVersion = (versionSpec) => import_semver.validRange(versionSpec) !== null ? import_semver.minVersion(versionSpec) : import_semver.coerce(versionSpec);
|
|
36875
|
-
const
|
|
36876
|
-
if (typeof
|
|
36877
|
-
const
|
|
36878
|
-
if (normalizedVersion === null) return null;
|
|
36879
|
-
const lowerBound = parseLowerBoundVersion(normalizedVersion);
|
|
36880
|
-
if (lowerBound === null) return null;
|
|
36881
|
-
if (lowerBound.major > 0) return Number.MAX_SAFE_INTEGER;
|
|
36882
|
-
return lowerBound.minor > 0 ? lowerBound.minor : null;
|
|
36883
|
-
};
|
|
36884
|
-
const parseDependencyMajorMinor = (dependencyVersion) => {
|
|
36885
|
-
if (typeof dependencyVersion !== "string") return null;
|
|
36886
|
-
const trimmed = dependencyVersion.trim();
|
|
36841
|
+
const parseTailwindMajorMinor = (tailwindVersion) => {
|
|
36842
|
+
if (typeof tailwindVersion !== "string") return null;
|
|
36843
|
+
const trimmed = tailwindVersion.trim();
|
|
36887
36844
|
if (trimmed.length === 0) return null;
|
|
36888
36845
|
const lowerBound = parseLowerBoundVersion(trimmed);
|
|
36889
36846
|
if (lowerBound === null || lowerBound.major <= 0) return null;
|
|
@@ -36892,7 +36849,6 @@ const parseDependencyMajorMinor = (dependencyVersion) => {
|
|
|
36892
36849
|
minor: lowerBound.minor
|
|
36893
36850
|
};
|
|
36894
36851
|
};
|
|
36895
|
-
const parseTailwindMajorMinor = (tailwindVersion) => parseDependencyMajorMinor(tailwindVersion);
|
|
36896
36852
|
const hasUpperBoundOnlyPeerRange = (range) => {
|
|
36897
36853
|
if (typeof range !== "string") return false;
|
|
36898
36854
|
const normalizedRange = normalizeDependencyVersion(range);
|
|
@@ -36914,7 +36870,7 @@ const resolveEffectiveReactMajor = (reactVersion, packageJson) => {
|
|
|
36914
36870
|
if (peerFloor === null) return hasUpperBoundOnlyPeerRange(peerReactRange) ? null : installedReactMajor;
|
|
36915
36871
|
return installedReactMajor !== null ? Math.min(installedReactMajor, peerFloor) : peerFloor;
|
|
36916
36872
|
};
|
|
36917
|
-
const isCatalogReference = (version) =>
|
|
36873
|
+
const isCatalogReference = (version) => version.startsWith("catalog:");
|
|
36918
36874
|
const extractCatalogName = (version) => {
|
|
36919
36875
|
if (!isCatalogReference(version)) return null;
|
|
36920
36876
|
const name = version.slice(8).trim();
|
|
@@ -37064,12 +37020,6 @@ const TAILWIND_ZOD_SECTIONS = [
|
|
|
37064
37020
|
"devDependencies",
|
|
37065
37021
|
"peerDependencies"
|
|
37066
37022
|
];
|
|
37067
|
-
const DEPENDENCY_SPEC_SECTIONS = [
|
|
37068
|
-
"dependencies",
|
|
37069
|
-
"devDependencies",
|
|
37070
|
-
"peerDependencies",
|
|
37071
|
-
"optionalDependencies"
|
|
37072
|
-
];
|
|
37073
37023
|
const EMPTY_DEPENDENCY_INFO = {
|
|
37074
37024
|
reactVersion: null,
|
|
37075
37025
|
tailwindVersion: null,
|
|
@@ -37079,7 +37029,7 @@ const EMPTY_DEPENDENCY_INFO = {
|
|
|
37079
37029
|
const pickConcreteVersion = (packageJson, packageName, sections) => {
|
|
37080
37030
|
for (const section of sections) {
|
|
37081
37031
|
const version = packageJson[section]?.[packageName];
|
|
37082
|
-
if (
|
|
37032
|
+
if (version === void 0) continue;
|
|
37083
37033
|
if (isCatalogReference(version)) return null;
|
|
37084
37034
|
if (isConcreteDependencyVersion(version)) return version;
|
|
37085
37035
|
}
|
|
@@ -37111,16 +37061,13 @@ const extractDependencyInfo = (packageJson) => {
|
|
|
37111
37061
|
};
|
|
37112
37062
|
};
|
|
37113
37063
|
const getDependencySpec = (packageJson, packageName) => {
|
|
37114
|
-
|
|
37115
|
-
|
|
37116
|
-
if (typeof spec === "string") return spec;
|
|
37117
|
-
}
|
|
37118
|
-
return null;
|
|
37064
|
+
const spec = packageJson.dependencies?.[packageName] ?? packageJson.devDependencies?.[packageName] ?? packageJson.peerDependencies?.[packageName] ?? packageJson.optionalDependencies?.[packageName];
|
|
37065
|
+
return typeof spec === "string" ? spec : null;
|
|
37119
37066
|
};
|
|
37120
37067
|
const getDependencyDeclaration = ({ packageJson, packageName, sections }) => {
|
|
37121
37068
|
for (const section of sections) {
|
|
37122
37069
|
const version = packageJson[section]?.[packageName];
|
|
37123
|
-
if (
|
|
37070
|
+
if (version === void 0) continue;
|
|
37124
37071
|
return {
|
|
37125
37072
|
catalogReference: extractCatalogName(version) ?? null,
|
|
37126
37073
|
hasDeclaration: true,
|
|
@@ -37154,15 +37101,24 @@ const getPreactVersion = (packageJson) => {
|
|
|
37154
37101
|
...packageJson.devDependencies
|
|
37155
37102
|
}.preact ?? null;
|
|
37156
37103
|
};
|
|
37157
|
-
const
|
|
37104
|
+
const TANSTACK_QUERY_PACKAGES = new Set([
|
|
37105
|
+
"@tanstack/react-query",
|
|
37106
|
+
"@tanstack/query-core",
|
|
37107
|
+
"react-query"
|
|
37108
|
+
]);
|
|
37109
|
+
const hasTanStackQuery = (packageJson) => {
|
|
37110
|
+
const allDependencies = {
|
|
37111
|
+
...packageJson.peerDependencies,
|
|
37112
|
+
...packageJson.dependencies,
|
|
37113
|
+
...packageJson.devDependencies
|
|
37114
|
+
};
|
|
37115
|
+
return Object.keys(allDependencies).some((packageName) => TANSTACK_QUERY_PACKAGES.has(packageName));
|
|
37116
|
+
};
|
|
37117
|
+
const resolveCatalogBackedDependencyVersion = ({ rootDirectory, rootPackageJson, packageName, version }) => {
|
|
37158
37118
|
if (version === null || !isCatalogReference(version)) return version;
|
|
37159
37119
|
const catalogName = extractCatalogName(version);
|
|
37160
|
-
const
|
|
37161
|
-
if (
|
|
37162
|
-
if (sourceDirectory !== rootDirectory || sourcePackageJson !== rootPackageJson) {
|
|
37163
|
-
const resolvedRootVersion = resolveCatalogVersion(rootPackageJson, packageName, rootDirectory, catalogName);
|
|
37164
|
-
if (resolvedRootVersion) return resolvedRootVersion;
|
|
37165
|
-
}
|
|
37120
|
+
const resolvedLocalVersion = resolveCatalogVersion(rootPackageJson, packageName, rootDirectory, catalogName);
|
|
37121
|
+
if (resolvedLocalVersion) return resolvedLocalVersion;
|
|
37166
37122
|
const monorepoRoot = findMonorepoRoot(rootDirectory);
|
|
37167
37123
|
if (!monorepoRoot) return version;
|
|
37168
37124
|
const monorepoPackageJsonPath = Path.join(monorepoRoot, "package.json");
|
|
@@ -37360,75 +37316,11 @@ const listWorkspacePackages = (rootDirectory) => {
|
|
|
37360
37316
|
}
|
|
37361
37317
|
return packages;
|
|
37362
37318
|
};
|
|
37363
|
-
const getPreferredDependencyVersion = ({ packageJson, packageNames }) => {
|
|
37364
|
-
const allDependencies = {
|
|
37365
|
-
...packageJson.devDependencies,
|
|
37366
|
-
...packageJson.peerDependencies,
|
|
37367
|
-
...packageJson.dependencies
|
|
37368
|
-
};
|
|
37369
|
-
for (const packageName of packageNames) {
|
|
37370
|
-
const version = allDependencies[packageName];
|
|
37371
|
-
if (version !== void 0) return version;
|
|
37372
|
-
}
|
|
37373
|
-
return null;
|
|
37374
|
-
};
|
|
37375
|
-
const TANSTACK_REACT_QUERY_PACKAGES = ["@tanstack/react-query", "react-query"];
|
|
37376
|
-
const getTanStackQueryVersion = (packageJson) => {
|
|
37377
|
-
return getPreferredDependencyVersion({
|
|
37378
|
-
packageJson,
|
|
37379
|
-
packageNames: TANSTACK_REACT_QUERY_PACKAGES
|
|
37380
|
-
});
|
|
37381
|
-
};
|
|
37382
|
-
const STYLED_COMPONENTS_PACKAGES = ["styled-components"];
|
|
37383
|
-
const getStyledComponentsVersion = (packageJson) => {
|
|
37384
|
-
return getPreferredDependencyVersion({
|
|
37385
|
-
packageJson,
|
|
37386
|
-
packageNames: STYLED_COMPONENTS_PACKAGES
|
|
37387
|
-
});
|
|
37388
|
-
};
|
|
37389
|
-
const I18N_PACKAGES = [
|
|
37390
|
-
"i18next",
|
|
37391
|
-
"react-i18next",
|
|
37392
|
-
"next-i18next",
|
|
37393
|
-
"react-intl",
|
|
37394
|
-
"next-intl",
|
|
37395
|
-
"use-intl",
|
|
37396
|
-
"@formatjs/intl",
|
|
37397
|
-
"@lingui/core",
|
|
37398
|
-
"@lingui/react",
|
|
37399
|
-
"typesafe-i18n",
|
|
37400
|
-
"@tolgee/react",
|
|
37401
|
-
"react-intl-universal"
|
|
37402
|
-
];
|
|
37403
|
-
const hasI18nDependency = (packageJson) => {
|
|
37404
|
-
const allDependencies = {
|
|
37405
|
-
...packageJson.peerDependencies,
|
|
37406
|
-
...packageJson.dependencies,
|
|
37407
|
-
...packageJson.devDependencies,
|
|
37408
|
-
...packageJson.optionalDependencies
|
|
37409
|
-
};
|
|
37410
|
-
return I18N_PACKAGES.some((packageName) => allDependencies[packageName] !== void 0);
|
|
37411
|
-
};
|
|
37412
37319
|
const REANIMATED_DEPENDENCY_NAME = "react-native-reanimated";
|
|
37413
37320
|
const MOBX_REACT_PACKAGE_NAME = "mobx-react";
|
|
37414
37321
|
const MOBX_REACT_LITE_PACKAGE_NAME = "mobx-react-lite";
|
|
37415
37322
|
const MOBX_STATE_TREE_PACKAGE_NAME = "mobx-state-tree";
|
|
37416
37323
|
const MOBX_REACT_OBSERVER_PACKAGE_NAME = "mobx-react-observer";
|
|
37417
|
-
const REACT_THREE_FIBER_DEPENDENCY_NAMES = ["@react-three/fiber", "react-three-fiber"];
|
|
37418
|
-
const REACT_THREE_FIBER_SECTIONS = [
|
|
37419
|
-
"dependencies",
|
|
37420
|
-
"peerDependencies",
|
|
37421
|
-
"optionalDependencies",
|
|
37422
|
-
"devDependencies"
|
|
37423
|
-
];
|
|
37424
|
-
const THREE_DEPENDENCY_SECTIONS = [
|
|
37425
|
-
"dependencies",
|
|
37426
|
-
"peerDependencies",
|
|
37427
|
-
"optionalDependencies",
|
|
37428
|
-
"devDependencies"
|
|
37429
|
-
];
|
|
37430
|
-
const REACT_THREE_FIBER_ECOSYSTEM_DEPENDENCY_NAMES = [...REACT_THREE_FIBER_DEPENDENCY_NAMES, "@react-three/drei"];
|
|
37431
|
-
const THREE_DEPENDENCY_NAMES = [...REACT_THREE_FIBER_ECOSYSTEM_DEPENDENCY_NAMES, "three"];
|
|
37432
37324
|
const SHOPIFY_FLASH_LIST_PACKAGE_NAME = "@shopify/flash-list";
|
|
37433
37325
|
const resolveWorkspaceDependencyVersion = ({ concreteVersion, packageName, rootDirectory, rootPackageJson, sections, workspaceDirectory, workspacePackageJson }) => {
|
|
37434
37326
|
const dependencyDeclaration = getDependencyDeclaration({
|
|
@@ -37439,7 +37331,7 @@ const resolveWorkspaceDependencyVersion = ({ concreteVersion, packageName, rootD
|
|
|
37439
37331
|
if (!dependencyDeclaration.hasDeclaration) return null;
|
|
37440
37332
|
return concreteVersion ?? resolveCatalogVersion(workspacePackageJson, packageName, workspaceDirectory, dependencyDeclaration.catalogReference) ?? resolveCatalogVersion(rootPackageJson, packageName, rootDirectory, dependencyDeclaration.catalogReference);
|
|
37441
37333
|
};
|
|
37442
|
-
const
|
|
37334
|
+
const shouldReplaceReactVersion = (currentVersion, nextVersion) => {
|
|
37443
37335
|
if (!currentVersion) return true;
|
|
37444
37336
|
const currentMajor = parseReactMajor(currentVersion);
|
|
37445
37337
|
const nextMajor = parseReactMajor(nextVersion);
|
|
@@ -37447,61 +37339,17 @@ const shouldReplaceWithLowerMajor = (currentVersion, nextVersion) => {
|
|
|
37447
37339
|
if (nextMajor === null) return false;
|
|
37448
37340
|
return nextMajor < currentMajor;
|
|
37449
37341
|
};
|
|
37450
|
-
const
|
|
37342
|
+
const shouldReplaceMobxFact = (currentFact, nextFact) => {
|
|
37451
37343
|
if (currentFact.version === null) return true;
|
|
37452
37344
|
if (nextFact.version === null) return false;
|
|
37453
37345
|
const currentMajor = getLowestDependencyMajor(currentFact.version);
|
|
37454
37346
|
const nextMajor = getLowestDependencyMajor(nextFact.version);
|
|
37455
37347
|
if (currentMajor === null) return false;
|
|
37456
37348
|
if (nextMajor === null) return true;
|
|
37457
|
-
if (currentMajor >
|
|
37458
|
-
if (nextMajor >
|
|
37459
|
-
return nextMajor < currentMajor;
|
|
37460
|
-
};
|
|
37461
|
-
const shouldReplaceStyledComponentsVersion = (currentVersion, nextVersion) => {
|
|
37462
|
-
if (!currentVersion) return true;
|
|
37463
|
-
const currentMajor = getLowestDependencyMajor(currentVersion);
|
|
37464
|
-
const nextMajor = getLowestDependencyMajor(nextVersion);
|
|
37465
|
-
if (currentMajor === null) return nextMajor !== null && nextMajor < 6;
|
|
37466
|
-
if (nextMajor === null) return currentMajor >= 6;
|
|
37349
|
+
if (currentMajor > 6) return false;
|
|
37350
|
+
if (nextMajor > 6) return true;
|
|
37467
37351
|
return nextMajor < currentMajor;
|
|
37468
37352
|
};
|
|
37469
|
-
const selectOldestDependencyVersion = (currentVersion, nextVersion) => {
|
|
37470
|
-
if (currentVersion === null || nextVersion === null) return null;
|
|
37471
|
-
const current = parseDependencyMajorMinor(currentVersion);
|
|
37472
|
-
const next = parseDependencyMajorMinor(nextVersion);
|
|
37473
|
-
if (current === null) return currentVersion;
|
|
37474
|
-
if (next === null) return nextVersion;
|
|
37475
|
-
if (next.major !== current.major) return next.major < current.major ? nextVersion : currentVersion;
|
|
37476
|
-
return next.minor < current.minor ? nextVersion : currentVersion;
|
|
37477
|
-
};
|
|
37478
|
-
const shouldReplaceMobxFact = (currentFact, nextFact) => {
|
|
37479
|
-
if (currentFact.sourceDirectory === null) return true;
|
|
37480
|
-
if (currentFact.version === null) return false;
|
|
37481
|
-
if (nextFact.version === null) return true;
|
|
37482
|
-
const currentMajor = getDependencyMajorWithinSupportedRange(currentFact.version, 6);
|
|
37483
|
-
const nextMajor = getDependencyMajorWithinSupportedRange(nextFact.version, 6);
|
|
37484
|
-
if (currentMajor === null) return false;
|
|
37485
|
-
if (nextMajor === null) return true;
|
|
37486
|
-
return selectOldestDependencyVersion(currentFact.version, nextFact.version) === nextFact.version;
|
|
37487
|
-
};
|
|
37488
|
-
const collectBindingVersion = (facts, packageJson, directory, packageName) => {
|
|
37489
|
-
const version = getDependencySpec(packageJson, packageName);
|
|
37490
|
-
if (version === null) return;
|
|
37491
|
-
const resolvedVersion = resolveCatalogBackedDependencyVersion({
|
|
37492
|
-
rootDirectory: directory,
|
|
37493
|
-
rootPackageJson: packageJson,
|
|
37494
|
-
packageName,
|
|
37495
|
-
version
|
|
37496
|
-
});
|
|
37497
|
-
if (packageName === MOBX_REACT_PACKAGE_NAME) {
|
|
37498
|
-
facts.mobxReactVersion = facts.hasMobxReact ? selectOldestDependencyVersion(facts.mobxReactVersion, resolvedVersion) : resolvedVersion;
|
|
37499
|
-
facts.hasMobxReact = true;
|
|
37500
|
-
return;
|
|
37501
|
-
}
|
|
37502
|
-
facts.mobxReactLiteVersion = facts.hasMobxReactLite ? selectOldestDependencyVersion(facts.mobxReactLiteVersion, resolvedVersion) : resolvedVersion;
|
|
37503
|
-
facts.hasMobxReactLite = true;
|
|
37504
|
-
};
|
|
37505
37353
|
const evaluateManifestFacts = (facts, packageJson, directory, rootDirectory, rootPackageJson) => {
|
|
37506
37354
|
if (facts.expo.version === null) {
|
|
37507
37355
|
const spec = getDependencySpec(packageJson, "expo");
|
|
@@ -37537,23 +37385,10 @@ const evaluateManifestFacts = (facts, packageJson, directory, rootDirectory, roo
|
|
|
37537
37385
|
};
|
|
37538
37386
|
if (shouldReplaceMobxFact(facts.mobx, nextMobxFact)) facts.mobx = nextMobxFact;
|
|
37539
37387
|
}
|
|
37540
|
-
|
|
37541
|
-
|
|
37388
|
+
facts.hasMobxReact = facts.hasMobxReact || getDependencySpec(packageJson, MOBX_REACT_PACKAGE_NAME) !== null;
|
|
37389
|
+
facts.hasMobxReactLite = facts.hasMobxReactLite || getDependencySpec(packageJson, MOBX_REACT_LITE_PACKAGE_NAME) !== null;
|
|
37542
37390
|
facts.hasMobxStateTree = facts.hasMobxStateTree || getDependencySpec(packageJson, MOBX_STATE_TREE_PACKAGE_NAME) !== null;
|
|
37543
37391
|
facts.hasMobxReactObserver = facts.hasMobxReactObserver || getDependencySpec(packageJson, MOBX_REACT_OBSERVER_PACKAGE_NAME) !== null;
|
|
37544
|
-
const zustandSpec = getDependencySpec(packageJson, "zustand");
|
|
37545
|
-
if (zustandSpec !== null) {
|
|
37546
|
-
const nextZustandFact = {
|
|
37547
|
-
version: resolveCatalogBackedDependencyVersion({
|
|
37548
|
-
rootDirectory: directory,
|
|
37549
|
-
rootPackageJson: packageJson,
|
|
37550
|
-
packageName: "zustand",
|
|
37551
|
-
version: zustandSpec
|
|
37552
|
-
}),
|
|
37553
|
-
sourceDirectory: directory
|
|
37554
|
-
};
|
|
37555
|
-
if (shouldReplaceSupportedDependencyFact(facts.zustand, nextZustandFact, 5)) facts.zustand = nextZustandFact;
|
|
37556
|
-
}
|
|
37557
37392
|
if (facts.reanimatedVersion === null) {
|
|
37558
37393
|
const spec = getDependencySpec(packageJson, REANIMATED_DEPENDENCY_NAME);
|
|
37559
37394
|
if (spec !== null) facts.reanimatedVersion = spec;
|
|
@@ -37562,52 +37397,6 @@ const evaluateManifestFacts = (facts, packageJson, directory, rootDirectory, roo
|
|
|
37562
37397
|
const spec = getDependencySpec(packageJson, "valtio");
|
|
37563
37398
|
if (spec !== null) facts.valtioVersion = spec;
|
|
37564
37399
|
}
|
|
37565
|
-
facts.tanstackQueryVersion ??= getTanStackQueryVersion(packageJson);
|
|
37566
|
-
const styledComponentsVersion = resolveCatalogBackedDependencyVersion({
|
|
37567
|
-
rootDirectory: directory,
|
|
37568
|
-
rootPackageJson: packageJson,
|
|
37569
|
-
packageName: "styled-components",
|
|
37570
|
-
version: getStyledComponentsVersion(packageJson)
|
|
37571
|
-
});
|
|
37572
|
-
if (styledComponentsVersion && shouldReplaceStyledComponentsVersion(facts.styledComponentsVersion, styledComponentsVersion)) facts.styledComponentsVersion = styledComponentsVersion;
|
|
37573
|
-
facts.hasI18nLibrary = facts.hasI18nLibrary || hasI18nDependency(packageJson);
|
|
37574
|
-
for (const packageName of REACT_THREE_FIBER_DEPENDENCY_NAMES) {
|
|
37575
|
-
const version = resolveCatalogBackedDependencyVersion({
|
|
37576
|
-
rootDirectory,
|
|
37577
|
-
rootPackageJson,
|
|
37578
|
-
sourceDirectory: directory,
|
|
37579
|
-
sourcePackageJson: packageJson,
|
|
37580
|
-
packageName,
|
|
37581
|
-
version: getDependencyDeclaration({
|
|
37582
|
-
packageName,
|
|
37583
|
-
packageJson,
|
|
37584
|
-
sections: REACT_THREE_FIBER_SECTIONS
|
|
37585
|
-
}).version
|
|
37586
|
-
});
|
|
37587
|
-
if (version === null) continue;
|
|
37588
|
-
if (shouldReplaceWithLowerMajor(facts.reactThreeFiber.version, version)) facts.reactThreeFiber = {
|
|
37589
|
-
packageName,
|
|
37590
|
-
version,
|
|
37591
|
-
sourceDirectory: directory
|
|
37592
|
-
};
|
|
37593
|
-
}
|
|
37594
|
-
const threeVersion = resolveCatalogBackedDependencyVersion({
|
|
37595
|
-
rootDirectory,
|
|
37596
|
-
rootPackageJson,
|
|
37597
|
-
sourceDirectory: directory,
|
|
37598
|
-
sourcePackageJson: packageJson,
|
|
37599
|
-
packageName: "three",
|
|
37600
|
-
version: getDependencyDeclaration({
|
|
37601
|
-
packageName: "three",
|
|
37602
|
-
packageJson,
|
|
37603
|
-
sections: THREE_DEPENDENCY_SECTIONS
|
|
37604
|
-
}).version
|
|
37605
|
-
});
|
|
37606
|
-
if (threeVersion !== null) {
|
|
37607
|
-
const currentRelease = parseThreeRelease(facts.threeVersion);
|
|
37608
|
-
const nextRelease = parseThreeRelease(threeVersion);
|
|
37609
|
-
if (facts.threeVersion === null || nextRelease !== null && (currentRelease === null || nextRelease < currentRelease)) facts.threeVersion = threeVersion;
|
|
37610
|
-
}
|
|
37611
37400
|
facts.hasReactNativeAwarePackage = facts.hasReactNativeAwarePackage || isPackageJsonReactNativeAware(packageJson);
|
|
37612
37401
|
facts.hasReanimatedAwarePackage = facts.hasReanimatedAwarePackage || isPackageJsonReanimatedAware(packageJson);
|
|
37613
37402
|
facts.hasSsrDependency = facts.hasSsrDependency || isPackageJsonSsrAware(packageJson);
|
|
@@ -37629,8 +37418,6 @@ const evaluateManifestFacts = (facts, packageJson, directory, rootDirectory, roo
|
|
|
37629
37418
|
if (currentRemotionMajorVersion === null || remotionMajorVersion < currentRemotionMajorVersion) facts.remotionVersion = resolvedRemotionVersion;
|
|
37630
37419
|
}
|
|
37631
37420
|
}
|
|
37632
|
-
facts.hasThree = facts.hasThree || THREE_DEPENDENCY_NAMES.some((dependencyName) => getDependencySpec(packageJson, dependencyName) !== null);
|
|
37633
|
-
facts.hasReactThreeFiber = facts.hasReactThreeFiber || REACT_THREE_FIBER_ECOSYSTEM_DEPENDENCY_NAMES.some((dependencyName) => getDependencySpec(packageJson, dependencyName) !== null);
|
|
37634
37421
|
};
|
|
37635
37422
|
const collectWorkspaceFacts = (rootDirectory, rootPackageJson, { collectReactGroup }) => {
|
|
37636
37423
|
const facts = {
|
|
@@ -37656,32 +37443,15 @@ const collectWorkspaceFacts = (rootDirectory, rootPackageJson, { collectReactGro
|
|
|
37656
37443
|
sourceDirectory: null
|
|
37657
37444
|
},
|
|
37658
37445
|
hasMobxReact: false,
|
|
37659
|
-
mobxReactVersion: null,
|
|
37660
37446
|
hasMobxReactLite: false,
|
|
37661
|
-
mobxReactLiteVersion: null,
|
|
37662
37447
|
hasMobxStateTree: false,
|
|
37663
37448
|
hasMobxReactObserver: false,
|
|
37664
|
-
zustand: {
|
|
37665
|
-
version: null,
|
|
37666
|
-
sourceDirectory: null
|
|
37667
|
-
},
|
|
37668
|
-
tanstackQueryVersion: null,
|
|
37669
|
-
styledComponentsVersion: null,
|
|
37670
|
-
hasI18nLibrary: false,
|
|
37671
37449
|
hasReactNativeAwarePackage: false,
|
|
37672
37450
|
hasReanimatedAwarePackage: false,
|
|
37673
37451
|
hasSsrDependency: false,
|
|
37674
37452
|
hasRemotionDependency: false,
|
|
37675
37453
|
hasUnknownRemotionVersion: false,
|
|
37676
37454
|
remotionVersion: null,
|
|
37677
|
-
hasThree: false,
|
|
37678
|
-
threeVersion: null,
|
|
37679
|
-
hasReactThreeFiber: false,
|
|
37680
|
-
reactThreeFiber: {
|
|
37681
|
-
packageName: null,
|
|
37682
|
-
version: null,
|
|
37683
|
-
sourceDirectory: null
|
|
37684
|
-
},
|
|
37685
37455
|
reanimatedVersion: null
|
|
37686
37456
|
};
|
|
37687
37457
|
evaluateManifestFacts(facts, rootPackageJson, rootDirectory, rootDirectory, rootPackageJson);
|
|
@@ -37724,7 +37494,7 @@ const collectWorkspaceFacts = (rootDirectory, rootPackageJson, { collectReactGro
|
|
|
37724
37494
|
workspaceDirectory,
|
|
37725
37495
|
workspacePackageJson
|
|
37726
37496
|
});
|
|
37727
|
-
if (reactVersion &&
|
|
37497
|
+
if (reactVersion && shouldReplaceReactVersion(facts.reactVersion, reactVersion)) facts.reactVersion = reactVersion;
|
|
37728
37498
|
if (tailwindVersion && !facts.tailwindVersion) facts.tailwindVersion = tailwindVersion;
|
|
37729
37499
|
if (zodVersion && !facts.zodVersion) facts.zodVersion = zodVersion;
|
|
37730
37500
|
const settledReactMajor = parseReactMajor(facts.reactVersion);
|
|
@@ -37917,13 +37687,9 @@ const discoverProjectWithoutPackageJson = (directory) => {
|
|
|
37917
37687
|
mobxVersion: null,
|
|
37918
37688
|
mobxMajorVersion: null,
|
|
37919
37689
|
hasMobxReact: false,
|
|
37920
|
-
mobxReactVersion: null,
|
|
37921
37690
|
hasMobxReactLite: false,
|
|
37922
|
-
mobxReactLiteVersion: null,
|
|
37923
37691
|
hasMobxStateTree: false,
|
|
37924
37692
|
hasMobxReactObserver: false,
|
|
37925
|
-
zustandVersion: null,
|
|
37926
|
-
zustandMajorVersion: null,
|
|
37927
37693
|
framework: "unknown",
|
|
37928
37694
|
hasTypeScript: hasOwnTsConfig,
|
|
37929
37695
|
hasReactCompiler: false,
|
|
@@ -37934,15 +37700,6 @@ const discoverProjectWithoutPackageJson = (directory) => {
|
|
|
37934
37700
|
hasRemotion: false,
|
|
37935
37701
|
remotionVersion: null,
|
|
37936
37702
|
remotionMajorVersion: null,
|
|
37937
|
-
hasI18nLibrary: false,
|
|
37938
|
-
tanstackQueryVersion: null,
|
|
37939
|
-
styledComponentsVersion: null,
|
|
37940
|
-
hasThree: false,
|
|
37941
|
-
threeVersion: null,
|
|
37942
|
-
threeRelease: null,
|
|
37943
|
-
hasReactThreeFiber: false,
|
|
37944
|
-
reactThreeFiberVersion: null,
|
|
37945
|
-
reactThreeFiberMajorVersion: null,
|
|
37946
37703
|
hasSsrDependency: false,
|
|
37947
37704
|
preactVersion: null,
|
|
37948
37705
|
preactMajorVersion: null,
|
|
@@ -38041,12 +37798,6 @@ const discoverProject = (directory) => {
|
|
|
38041
37798
|
packageName: SHOPIFY_FLASH_LIST_PACKAGE_NAME,
|
|
38042
37799
|
version: workspaceFacts.shopifyFlashList.version
|
|
38043
37800
|
}) : null;
|
|
38044
|
-
const zustandVersion = resolveCatalogBackedDependencyVersion({
|
|
38045
|
-
rootDirectory: directory,
|
|
38046
|
-
rootPackageJson: packageJson,
|
|
38047
|
-
packageName: "zustand",
|
|
38048
|
-
version: workspaceFacts.zustand.version
|
|
38049
|
-
});
|
|
38050
37801
|
const hasReanimated = hasReactNativeWorkspace && workspaceFacts.hasReanimatedAwarePackage;
|
|
38051
37802
|
const reanimatedVersion = hasReanimated ? workspaceFacts.reanimatedVersion : null;
|
|
38052
37803
|
const nextjsVersion = framework === "nextjs" ? resolveCatalogBackedDependencyVersion({
|
|
@@ -38069,19 +37820,6 @@ const discoverProject = (directory) => {
|
|
|
38069
37820
|
});
|
|
38070
37821
|
const preactVersion = getPreactVersion(packageJson);
|
|
38071
37822
|
const remotionVersion = workspaceFacts.remotionVersion;
|
|
38072
|
-
const tanstackQueryVersion = getTanStackQueryVersion(packageJson) ?? workspaceFacts.tanstackQueryVersion;
|
|
38073
|
-
const reactThreeFiberVersion = workspaceFacts.reactThreeFiber.packageName ? resolveCatalogBackedDependencyVersion({
|
|
38074
|
-
rootDirectory: directory,
|
|
38075
|
-
rootPackageJson: packageJson,
|
|
38076
|
-
packageName: workspaceFacts.reactThreeFiber.packageName,
|
|
38077
|
-
version: workspaceFacts.reactThreeFiber.version
|
|
38078
|
-
}) : null;
|
|
38079
|
-
const threeVersion = resolveCatalogBackedDependencyVersion({
|
|
38080
|
-
rootDirectory: directory,
|
|
38081
|
-
rootPackageJson: packageJson,
|
|
38082
|
-
packageName: "three",
|
|
38083
|
-
version: workspaceFacts.threeVersion
|
|
38084
|
-
});
|
|
38085
37823
|
const isPreES2023Target = hasTypeScript && detectPreES2023Target(directory);
|
|
38086
37824
|
const projectInfo = {
|
|
38087
37825
|
rootDirectory: directory,
|
|
@@ -38092,34 +37830,21 @@ const discoverProject = (directory) => {
|
|
|
38092
37830
|
zodVersion,
|
|
38093
37831
|
zodMajorVersion: zodVersion === null ? null : getLowestDependencyMajor(zodVersion),
|
|
38094
37832
|
mobxVersion,
|
|
38095
|
-
mobxMajorVersion: mobxVersion === null ? null :
|
|
37833
|
+
mobxMajorVersion: mobxVersion === null ? null : getLowestDependencyMajor(mobxVersion),
|
|
38096
37834
|
hasMobxReact: workspaceFacts.hasMobxReact,
|
|
38097
|
-
mobxReactVersion: workspaceFacts.mobxReactVersion,
|
|
38098
37835
|
hasMobxReactLite: workspaceFacts.hasMobxReactLite,
|
|
38099
|
-
mobxReactLiteVersion: workspaceFacts.mobxReactLiteVersion,
|
|
38100
37836
|
hasMobxStateTree: workspaceFacts.hasMobxStateTree,
|
|
38101
37837
|
hasMobxReactObserver: workspaceFacts.hasMobxReactObserver,
|
|
38102
|
-
zustandVersion,
|
|
38103
|
-
zustandMajorVersion: zustandVersion === null ? null : getLowestDependencyMajor(zustandVersion),
|
|
38104
37838
|
framework,
|
|
38105
37839
|
hasTypeScript,
|
|
38106
37840
|
hasReactCompiler: detectReactCompiler(directory, packageJson),
|
|
38107
37841
|
hasReactCompilerLintPlugin: detectReactCompilerLintPlugin(directory, packageJson),
|
|
38108
|
-
hasTanStackQuery:
|
|
38109
|
-
hasI18nLibrary: workspaceFacts.hasI18nLibrary,
|
|
38110
|
-
tanstackQueryVersion,
|
|
38111
|
-
styledComponentsVersion: workspaceFacts.styledComponentsVersion,
|
|
37842
|
+
hasTanStackQuery: hasTanStackQuery(packageJson),
|
|
38112
37843
|
valtioVersion,
|
|
38113
37844
|
valtioMajorVersion: valtioVersion === null ? null : getLowestDependencyMajor(valtioVersion),
|
|
38114
37845
|
hasRemotion: workspaceFacts.hasRemotionDependency,
|
|
38115
37846
|
remotionVersion,
|
|
38116
37847
|
remotionMajorVersion: remotionVersion === null ? null : getLowestDependencyMajor(remotionVersion),
|
|
38117
|
-
hasThree: workspaceFacts.hasThree,
|
|
38118
|
-
threeVersion,
|
|
38119
|
-
threeRelease: parseThreeRelease(threeVersion),
|
|
38120
|
-
hasReactThreeFiber: workspaceFacts.hasReactThreeFiber,
|
|
38121
|
-
reactThreeFiberVersion,
|
|
38122
|
-
reactThreeFiberMajorVersion: reactThreeFiberVersion === null ? null : getLowestDependencyMajor(reactThreeFiberVersion),
|
|
38123
37848
|
hasSsrDependency: workspaceFacts.hasSsrDependency,
|
|
38124
37849
|
preactVersion,
|
|
38125
37850
|
preactMajorVersion: parseReactMajor(preactVersion),
|
|
@@ -41429,10 +41154,10 @@ const SSR_FRAMEWORKS = new Set([
|
|
|
41429
41154
|
"gatsby",
|
|
41430
41155
|
"tanstack-start"
|
|
41431
41156
|
]);
|
|
41432
|
-
const
|
|
41433
|
-
if (
|
|
41434
|
-
const
|
|
41435
|
-
for (let candidate = earliest; candidate <=
|
|
41157
|
+
const addMajorLadder = (capabilities, name, major, earliest, latest) => {
|
|
41158
|
+
if (major === null) return;
|
|
41159
|
+
const cappedMajor = Math.min(major, latest);
|
|
41160
|
+
for (let candidate = earliest; candidate <= cappedMajor; candidate += 1) capabilities.add(`${name}:${candidate}`);
|
|
41436
41161
|
};
|
|
41437
41162
|
const buildCapabilities = (project) => {
|
|
41438
41163
|
const capabilities = /* @__PURE__ */ new Set();
|
|
@@ -41445,77 +41170,37 @@ const buildCapabilities = (project) => {
|
|
|
41445
41170
|
if (CLIENT_ONLY_FRAMEWORKS.has(project.framework)) capabilities.add("client-only");
|
|
41446
41171
|
if (project.isStaticExport) capabilities.add("nextjs:static-export");
|
|
41447
41172
|
if (project.nextjsMajorVersion !== null && project.nextjsMajorVersion >= 15) capabilities.add("nextjs:15");
|
|
41448
|
-
|
|
41449
|
-
addVersionCapabilityLadder(capabilities, "react", project.reactMajorVersion, 17, 30);
|
|
41173
|
+
addMajorLadder(capabilities, "react", project.reactMajorVersion, 17, 30);
|
|
41450
41174
|
if (project.reactMajorVersion !== null && project.reactMajorVersion >= 19 && isMajorMinorAtLeast(parseReactMajorMinor(project.reactVersion), {
|
|
41451
41175
|
major: 19,
|
|
41452
41176
|
minor: 2
|
|
41453
41177
|
})) capabilities.add("react:19.2");
|
|
41454
|
-
if (project.tailwindVersion !== null)
|
|
41455
|
-
|
|
41456
|
-
|
|
41457
|
-
|
|
41458
|
-
|
|
41459
|
-
minor: 4
|
|
41460
|
-
})) capabilities.add("tailwind:3.4");
|
|
41461
|
-
if (tailwindVersion !== null && isMajorMinorAtLeast(tailwindVersion, {
|
|
41462
|
-
major: 4,
|
|
41463
|
-
minor: 0
|
|
41464
|
-
})) capabilities.add("tailwind:4");
|
|
41465
|
-
}
|
|
41178
|
+
if (project.tailwindVersion !== null) capabilities.add("tailwind");
|
|
41179
|
+
if (project.tailwindVersion !== null && isMajorMinorAtLeast(parseTailwindMajorMinor(project.tailwindVersion), {
|
|
41180
|
+
major: 3,
|
|
41181
|
+
minor: 4
|
|
41182
|
+
})) capabilities.add("tailwind:3.4");
|
|
41466
41183
|
if (project.zodVersion !== null) capabilities.add("zod");
|
|
41467
41184
|
if (project.zodMajorVersion !== null && project.zodMajorVersion >= 4) capabilities.add("zod:4");
|
|
41468
41185
|
if (project.mobxVersion !== void 0 && project.mobxVersion !== null || project.hasMobxReact === true || project.hasMobxReactLite === true || project.hasMobxStateTree === true || project.hasMobxReactObserver === true) capabilities.add("mobx");
|
|
41469
41186
|
if (project.hasMobxReact === true) capabilities.add("mobx-react");
|
|
41470
41187
|
if (project.hasMobxReactLite === true) capabilities.add("mobx-react-lite");
|
|
41471
41188
|
if (project.hasMobxReact === true || project.hasMobxReactLite === true) capabilities.add("mobx-react-binding");
|
|
41472
|
-
const mobxReactVersion = parseDependencyMajorMinor(project.mobxReactVersion);
|
|
41473
|
-
const mobxReactLiteVersion = parseDependencyMajorMinor(project.mobxReactLiteVersion);
|
|
41474
|
-
const hasMobxReactObserverMemoGuard = mobxReactVersion !== null && isMajorMinorAtLeast(mobxReactVersion, {
|
|
41475
|
-
major: 7,
|
|
41476
|
-
minor: 3
|
|
41477
|
-
});
|
|
41478
|
-
const hasMobxReactLiteObserverMemoGuard = mobxReactLiteVersion !== null && isMajorMinorAtLeast(mobxReactLiteVersion, {
|
|
41479
|
-
major: 3,
|
|
41480
|
-
minor: 3
|
|
41481
|
-
});
|
|
41482
|
-
if (hasMobxReactObserverMemoGuard) capabilities.add("mobx-react-observer-memo-guard");
|
|
41483
|
-
if (hasMobxReactLiteObserverMemoGuard) capabilities.add("mobx-react-lite-observer-memo-guard");
|
|
41484
|
-
if (hasMobxReactObserverMemoGuard || hasMobxReactLiteObserverMemoGuard) capabilities.add("mobx-react-binding-observer-memo-guard");
|
|
41485
41189
|
if (project.hasMobxStateTree === true) capabilities.add("mobx-state-tree");
|
|
41486
41190
|
if (project.hasMobxReactObserver === true) capabilities.add("mobx-react-observer");
|
|
41487
|
-
if (project.mobxMajorVersion !== void 0 && project.mobxMajorVersion !== null && project.mobxMajorVersion >= 4 && project.mobxMajorVersion <= 6)
|
|
41488
|
-
const mobxVersion = parseDependencyMajorMinor(project.mobxVersion);
|
|
41489
|
-
if (project.mobxMajorVersion === 6 && mobxVersion !== null && isMajorMinorAtLeast(mobxVersion, {
|
|
41490
|
-
major: 6,
|
|
41491
|
-
minor: 10
|
|
41492
|
-
})) capabilities.add("mobx:6.10");
|
|
41493
|
-
if (project.zustandVersion !== void 0 && project.zustandVersion !== null) capabilities.add("zustand");
|
|
41494
|
-
if (project.zustandMajorVersion !== void 0 && project.zustandMajorVersion !== null && project.zustandMajorVersion >= 1 && project.zustandMajorVersion <= 5) addVersionCapabilityLadder(capabilities, "zustand", project.zustandMajorVersion, 1, 5);
|
|
41191
|
+
if (project.mobxMajorVersion !== void 0 && project.mobxMajorVersion !== null && project.mobxMajorVersion >= 4 && project.mobxMajorVersion <= 6) addMajorLadder(capabilities, "mobx", project.mobxMajorVersion, 4, 6);
|
|
41495
41192
|
if (project.isPreES2023Target) capabilities.add("pre-es2023");
|
|
41496
41193
|
if (project.hasReactCompiler) capabilities.add("react-compiler");
|
|
41497
|
-
if (
|
|
41498
|
-
if (project.styledComponentsVersion) {
|
|
41499
|
-
capabilities.add("styled-components");
|
|
41500
|
-
const styledComponentsMajor = getLowestDependencyMajor(project.styledComponentsVersion);
|
|
41501
|
-
if (styledComponentsMajor !== null && styledComponentsMajor >= 6) capabilities.add("styled-components:6");
|
|
41502
|
-
}
|
|
41503
|
-
if (project.hasI18nLibrary) capabilities.add("i18n");
|
|
41194
|
+
if (project.hasTanStackQuery) capabilities.add("tanstack-query");
|
|
41504
41195
|
if (project.valtioVersion !== null) capabilities.add("valtio");
|
|
41505
|
-
|
|
41196
|
+
addMajorLadder(capabilities, "valtio", project.valtioMajorVersion, 1, 10);
|
|
41506
41197
|
if (project.hasRemotion) {
|
|
41507
41198
|
capabilities.add("remotion");
|
|
41508
|
-
|
|
41509
|
-
}
|
|
41510
|
-
if (project.hasThree || project.hasReactThreeFiber) capabilities.add("three");
|
|
41511
|
-
addVersionCapabilityLadder(capabilities, "three", project.threeRelease ?? null, 145, 250);
|
|
41512
|
-
if (project.hasReactThreeFiber) {
|
|
41513
|
-
capabilities.add("r3f");
|
|
41514
|
-
addVersionCapabilityLadder(capabilities, "r3f", project.reactThreeFiberMajorVersion ?? null, 3, 10);
|
|
41199
|
+
addMajorLadder(capabilities, "remotion", project.remotionMajorVersion ?? null, 4, 30);
|
|
41515
41200
|
}
|
|
41516
41201
|
if (project.hasTypeScript) capabilities.add("typescript");
|
|
41517
41202
|
if (project.preactVersion !== null) capabilities.add("preact");
|
|
41518
|
-
|
|
41203
|
+
addMajorLadder(capabilities, "preact", project.preactMajorVersion, 10, 20);
|
|
41519
41204
|
if (project.preactVersion !== null && project.reactVersion === null) capabilities.add("pure-preact");
|
|
41520
41205
|
return capabilities;
|
|
41521
41206
|
};
|
|
@@ -41527,7 +41212,7 @@ const getCapabilities = (project) => {
|
|
|
41527
41212
|
capabilitiesByProject.set(project, capabilities);
|
|
41528
41213
|
return capabilities;
|
|
41529
41214
|
};
|
|
41530
|
-
const shouldEnableRule = (requires, tags, capabilities, ignoredTags, disabledWhen
|
|
41215
|
+
const shouldEnableRule = (requires, tags, capabilities, ignoredTags, disabledWhen) => {
|
|
41531
41216
|
if (requires) {
|
|
41532
41217
|
for (const capability of requires) if (!capabilities.has(capability)) return false;
|
|
41533
41218
|
}
|
|
@@ -41538,29 +41223,20 @@ const shouldEnableRule = (requires, tags, capabilities, ignoredTags, disabledWhe
|
|
|
41538
41223
|
if (tags) {
|
|
41539
41224
|
for (const tag of tags) if (ignoredTags.has(tag)) return false;
|
|
41540
41225
|
}
|
|
41541
|
-
if (includedTags && includedTags.size > 0) {
|
|
41542
|
-
if (!tags?.some((tag) => includedTags.has(tag))) return false;
|
|
41543
|
-
}
|
|
41544
41226
|
return true;
|
|
41545
41227
|
};
|
|
41546
|
-
const shouldEnableRuleByDefaultStatus = (options) => options.defaultEnabled !== false || options.hasExplicitOverride === true || options.includeTagDefaults && options.hasIncludedTags;
|
|
41547
41228
|
const yieldToEventLoop = () => new Promise((resolve) => {
|
|
41548
41229
|
setImmediate(resolve);
|
|
41549
41230
|
});
|
|
41550
41231
|
const createSecurityScanSession = (rootDirectory, options) => {
|
|
41551
41232
|
const capabilities = options.project ? getCapabilities(options.project) : /* @__PURE__ */ new Set();
|
|
41552
41233
|
const ignoredTags = options.ignoredTags ?? /* @__PURE__ */ new Set();
|
|
41553
|
-
const includedTags = options.includedTags ?? /* @__PURE__ */ new Set();
|
|
41554
41234
|
const enabledScanRules = REACT_DOCTOR_RULES.flatMap((entry) => {
|
|
41555
41235
|
const rule = entry.rule;
|
|
41556
41236
|
const scan = rule.scan;
|
|
41557
41237
|
if (typeof scan !== "function") return [];
|
|
41558
|
-
if (
|
|
41559
|
-
|
|
41560
|
-
includeTagDefaults: options.includeTagDefaults === true,
|
|
41561
|
-
hasIncludedTags: includedTags.size > 0
|
|
41562
|
-
})) return [];
|
|
41563
|
-
if (!shouldEnableRule(rule.requires, rule.tags, capabilities, ignoredTags, rule.disabledWhen, includedTags)) return [];
|
|
41238
|
+
if (rule.defaultEnabled === false) return [];
|
|
41239
|
+
if (!shouldEnableRule(rule.requires, rule.tags, capabilities, ignoredTags, rule.disabledWhen)) return [];
|
|
41564
41240
|
return [{
|
|
41565
41241
|
entry,
|
|
41566
41242
|
scan,
|
|
@@ -43562,9 +43238,8 @@ const buildUserPluginRules = (userPlugin, severityControls) => {
|
|
|
43562
43238
|
}
|
|
43563
43239
|
return enabled;
|
|
43564
43240
|
};
|
|
43565
|
-
const createOxlintConfig = ({ pluginPath, project, customRulesOnly = false, extendsPaths = [], ignoredTags = /* @__PURE__ */ new Set(),
|
|
43566
|
-
const
|
|
43567
|
-
const reactHooksJsPlugin = disableReactHooksJsPlugin || ruleSelection === "sidecar" || hasIncludedTags ? null : resolveReactHooksJsPlugin(project.hasReactCompiler || project.hasReactCompilerLintPlugin === true, customRulesOnly);
|
|
43241
|
+
const createOxlintConfig = ({ pluginPath, project, customRulesOnly = false, extendsPaths = [], ignoredTags = /* @__PURE__ */ new Set(), serverAuthFunctionNames, severityControls, userPlugins = [], disableReactHooksJsPlugin = false, ruleSelection, sidecarRuleIdFilter }) => {
|
|
43242
|
+
const reactHooksJsPlugin = disableReactHooksJsPlugin || ruleSelection === "sidecar" ? null : resolveReactHooksJsPlugin(project.hasReactCompiler || project.hasReactCompilerLintPlugin === true, customRulesOnly);
|
|
43568
43243
|
const reactCompilerRules = reactHooksJsPlugin ? applyRuleSeverityControls(filterRulesToAvailable(REACT_COMPILER_RULES, "react-hooks-js", reactHooksJsPlugin.availableRuleNames), severityControls) : {};
|
|
43569
43244
|
const jsPlugins = [];
|
|
43570
43245
|
if (reactHooksJsPlugin) jsPlugins.push(reactHooksJsPlugin.entry);
|
|
@@ -43579,14 +43254,9 @@ const createOxlintConfig = ({ pluginPath, project, customRulesOnly = false, exte
|
|
|
43579
43254
|
if (rule.scan !== void 0) continue;
|
|
43580
43255
|
if (customRulesOnly && registryEntry.originallyExternal) continue;
|
|
43581
43256
|
if (rule.framework !== "global" && !rule.requires) continue;
|
|
43582
|
-
if (!shouldEnableRule(rule.requires, rule.tags, capabilities, ignoredTags, rule.disabledWhen
|
|
43257
|
+
if (!shouldEnableRule(rule.requires, rule.tags, capabilities, ignoredTags, rule.disabledWhen)) continue;
|
|
43583
43258
|
const explicitRuleOverride = resolveRuleSeverityOverride({ ruleKey: registryEntry.key }, severityControls);
|
|
43584
|
-
if (
|
|
43585
|
-
defaultEnabled: rule.defaultEnabled,
|
|
43586
|
-
includeTagDefaults,
|
|
43587
|
-
hasIncludedTags,
|
|
43588
|
-
hasExplicitOverride: explicitRuleOverride !== void 0
|
|
43589
|
-
})) continue;
|
|
43259
|
+
if (rule.defaultEnabled === false && explicitRuleOverride === void 0) continue;
|
|
43590
43260
|
const severity = resolveRuleSeverityOverride({
|
|
43591
43261
|
ruleKey: registryEntry.key,
|
|
43592
43262
|
category: rule.category
|
|
@@ -43595,7 +43265,7 @@ const createOxlintConfig = ({ pluginPath, project, customRulesOnly = false, exte
|
|
|
43595
43265
|
enabledReactDoctorRules[registryEntry.key] = severity;
|
|
43596
43266
|
}
|
|
43597
43267
|
const userPluginRules = {};
|
|
43598
|
-
if (ruleSelection !== "sidecar"
|
|
43268
|
+
if (ruleSelection !== "sidecar") for (const userPlugin of userPlugins) {
|
|
43599
43269
|
Object.assign(userPluginRules, buildUserPluginRules(userPlugin, severityControls));
|
|
43600
43270
|
jsPlugins.push(userPlugin.entry);
|
|
43601
43271
|
}
|
|
@@ -43812,19 +43482,6 @@ const createSidecarLintCache = (cacheDirectory, rulesetHash) => {
|
|
|
43812
43482
|
}
|
|
43813
43483
|
};
|
|
43814
43484
|
};
|
|
43815
|
-
const fingerprintCacheByFilePath = /* @__PURE__ */ new Map();
|
|
43816
|
-
const fingerprintFileContents = (filePath, fingerprintLength) => {
|
|
43817
|
-
const fileStats = NFS.statSync(filePath, { bigint: true });
|
|
43818
|
-
const cachedFingerprint = fingerprintCacheByFilePath.get(filePath);
|
|
43819
|
-
if (cachedFingerprint?.modifiedTimeNanoseconds === fileStats.mtimeNs && cachedFingerprint.sizeBytes === fileStats.size) return cachedFingerprint.fingerprint;
|
|
43820
|
-
const fingerprint = crypto.createHash("sha256").update(NFS.readFileSync(filePath)).digest("hex").slice(0, fingerprintLength);
|
|
43821
|
-
fingerprintCacheByFilePath.set(filePath, {
|
|
43822
|
-
fingerprint,
|
|
43823
|
-
modifiedTimeNanoseconds: fileStats.mtimeNs,
|
|
43824
|
-
sizeBytes: fileStats.size
|
|
43825
|
-
});
|
|
43826
|
-
return fingerprint;
|
|
43827
|
-
};
|
|
43828
43485
|
const bundledRequire$3 = createRequire(import.meta.url);
|
|
43829
43486
|
const childNodeVersionByBinaryPath = /* @__PURE__ */ new Map();
|
|
43830
43487
|
const resolveChildNodeVersion = (nodeBinaryPath) => {
|
|
@@ -43848,13 +43505,6 @@ const TOOLCHAIN_PACKAGE_SPECIFIERS$1 = [
|
|
|
43848
43505
|
"oxlint-plugin-react-doctor/package.json",
|
|
43849
43506
|
"eslint-plugin-react-hooks/package.json"
|
|
43850
43507
|
];
|
|
43851
|
-
const resolvePluginFingerprint = () => {
|
|
43852
|
-
try {
|
|
43853
|
-
return fingerprintFileContents(bundledRequire$3.resolve("oxlint-plugin-react-doctor"), 16);
|
|
43854
|
-
} catch {
|
|
43855
|
-
return "unresolved";
|
|
43856
|
-
}
|
|
43857
|
-
};
|
|
43858
43508
|
const resolveOxlintToolchainVersions = (nodeBinaryPath = process.execPath) => {
|
|
43859
43509
|
const versions = [`node=${resolveChildNodeVersion(nodeBinaryPath)}`];
|
|
43860
43510
|
for (const specifier of TOOLCHAIN_PACKAGE_SPECIFIERS$1) try {
|
|
@@ -43864,7 +43514,6 @@ const resolveOxlintToolchainVersions = (nodeBinaryPath = process.execPath) => {
|
|
|
43864
43514
|
} catch {
|
|
43865
43515
|
versions.push(`${specifier}=missing`);
|
|
43866
43516
|
}
|
|
43867
|
-
versions.push(`oxlint-plugin-react-doctor#fingerprint=${resolvePluginFingerprint()}`);
|
|
43868
43517
|
return versions;
|
|
43869
43518
|
};
|
|
43870
43519
|
const esmRequire = createRequire(import.meta.url);
|
|
@@ -45340,7 +44989,7 @@ const reactHooksJsPluginDropNote = (error) => {
|
|
|
45340
44989
|
* 6. always restore disable directives + clean up the temp dir
|
|
45341
44990
|
*/
|
|
45342
44991
|
const runOxlint = async (options) => {
|
|
45343
|
-
const { rootDirectory, project, includePaths, nodeBinaryPath = process.execPath, customRulesOnly = false, respectInlineDisables = true, adoptExistingLintConfig = true, ignoredTags = /* @__PURE__ */ new Set(),
|
|
44992
|
+
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;
|
|
45344
44993
|
const serverAuthFunctionNames = Array.isArray(userConfig?.serverAuthFunctionNames) ? userConfig.serverAuthFunctionNames.filter((entry) => typeof entry === "string" && entry.length > 0) : void 0;
|
|
45345
44994
|
const severityControls = buildRuleSeverityControls(userConfig);
|
|
45346
44995
|
validateRuleRegistration();
|
|
@@ -45354,15 +45003,13 @@ const runOxlint = async (options) => {
|
|
|
45354
45003
|
}
|
|
45355
45004
|
const pluginPath = resolvePluginPath();
|
|
45356
45005
|
const extendsPaths = (adoptExistingLintConfig && !customRulesOnly ? detectUserLintConfigPaths(rootDirectory) : []).filter(canOxlintExtendConfig);
|
|
45357
|
-
const userPlugins =
|
|
45006
|
+
const userPlugins = resolveUserPlugins(userConfig?.plugins, configSourceDirectory);
|
|
45358
45007
|
const buildConfig = (overrides) => createOxlintConfig({
|
|
45359
45008
|
pluginPath,
|
|
45360
45009
|
project,
|
|
45361
45010
|
customRulesOnly,
|
|
45362
45011
|
extendsPaths: overrides.extendsPaths,
|
|
45363
45012
|
ignoredTags,
|
|
45364
|
-
includedTags,
|
|
45365
|
-
includeTagDefaults,
|
|
45366
45013
|
serverAuthFunctionNames,
|
|
45367
45014
|
severityControls,
|
|
45368
45015
|
userPlugins,
|
|
@@ -45751,8 +45398,6 @@ var Linter = class Linter extends Service()("react-doctor/Linter") {
|
|
|
45751
45398
|
respectInlineDisables: input.respectInlineDisables,
|
|
45752
45399
|
adoptExistingLintConfig: input.adoptExistingLintConfig,
|
|
45753
45400
|
ignoredTags: input.ignoredTags,
|
|
45754
|
-
includedTags: input.includedTags,
|
|
45755
|
-
includeTagDefaults: input.includeTagDefaults,
|
|
45756
45401
|
userConfig: input.userConfig ?? null,
|
|
45757
45402
|
configSourceDirectory: input.configSourceDirectory,
|
|
45758
45403
|
onPartialFailure: (reason) => {
|
|
@@ -46601,9 +46246,7 @@ const runInspect = (input, hooks = {}) => gen(function* () {
|
|
|
46601
46246
|
const securityScanFailedRef = yield* make$13(false);
|
|
46602
46247
|
const securityScanFiber = yield* forkChild(runCollect(applyPerElementPipeline(isDiffMode ? empty$4 : unwrap(tryPromise(() => checkSecurityScanCooperative(scanDirectory, {
|
|
46603
46248
|
project,
|
|
46604
|
-
ignoredTags: input.ignoredTags
|
|
46605
|
-
includedTags: input.includedTags,
|
|
46606
|
-
includeTagDefaults: input.includeTagDefaults
|
|
46249
|
+
ignoredTags: input.ignoredTags
|
|
46607
46250
|
})).pipe(map$3((diagnostics) => fromIterable$1(diagnostics)), catch_$1(() => set(securityScanFailedRef, true).pipe(as(empty$4))))))).pipe(withSpan("SecurityScan.run")));
|
|
46608
46251
|
const shouldRunSupplyChain = !isDiffMode || (input.supplyChainManifestChanged ?? false);
|
|
46609
46252
|
const supplyChainOverlapTimeout = yield* SupplyChainOverlapTimeoutMs;
|
|
@@ -46694,8 +46337,6 @@ const runInspect = (input, hooks = {}) => gen(function* () {
|
|
|
46694
46337
|
respectInlineDisables: input.respectInlineDisables,
|
|
46695
46338
|
adoptExistingLintConfig: input.adoptExistingLintConfig,
|
|
46696
46339
|
ignoredTags: input.ignoredTags,
|
|
46697
|
-
includedTags: input.includedTags,
|
|
46698
|
-
includeTagDefaults: input.includeTagDefaults,
|
|
46699
46340
|
userConfig: resolvedConfig.config ?? void 0,
|
|
46700
46341
|
configSourceDirectory: resolvedConfig.configSourceDirectory ?? void 0,
|
|
46701
46342
|
onFileProgress: (scannedFileCount, totalFileCount) => {
|
|
@@ -47840,7 +47481,7 @@ const makeNoopConsole = () => ({
|
|
|
47840
47481
|
});
|
|
47841
47482
|
//#endregion
|
|
47842
47483
|
//#region src/cli/utils/version.ts
|
|
47843
|
-
const VERSION = "0.8.1-dev.
|
|
47484
|
+
const VERSION = "0.8.1-dev.61bf03e";
|
|
47844
47485
|
//#endregion
|
|
47845
47486
|
//#region src/cli/utils/json-mode.ts
|
|
47846
47487
|
let context = null;
|
|
@@ -47927,11 +47568,7 @@ const getRunId = () => {
|
|
|
47927
47568
|
};
|
|
47928
47569
|
//#endregion
|
|
47929
47570
|
//#region src/cli/utils/build-run-context.ts
|
|
47930
|
-
const ROOT_SUBCOMMANDS = new Set([
|
|
47931
|
-
"design",
|
|
47932
|
-
"install",
|
|
47933
|
-
"setup"
|
|
47934
|
-
]);
|
|
47571
|
+
const ROOT_SUBCOMMANDS = new Set(["install", "setup"]);
|
|
47935
47572
|
const detectInvokedVia = () => {
|
|
47936
47573
|
const userAgent = process.env.npm_config_user_agent;
|
|
47937
47574
|
if (!userAgent) return "unknown";
|
|
@@ -48015,9 +47652,7 @@ const buildSentryProjectContext = (projectInfo) => ({
|
|
|
48015
47652
|
reactMajorVersion: projectInfo.reactMajorVersion,
|
|
48016
47653
|
hasTypeScript: projectInfo.hasTypeScript,
|
|
48017
47654
|
hasReactCompiler: projectInfo.hasReactCompiler,
|
|
48018
|
-
|
|
48019
|
-
mobxVersion: projectInfo.mobxVersion,
|
|
48020
|
-
styledComponentsVersion: projectInfo.styledComponentsVersion,
|
|
47655
|
+
hasTanStackQuery: projectInfo.hasTanStackQuery,
|
|
48021
47656
|
tailwindVersion: projectInfo.tailwindVersion,
|
|
48022
47657
|
zodVersion: projectInfo.zodVersion,
|
|
48023
47658
|
preactVersion: projectInfo.preactVersion,
|
|
@@ -48198,13 +47833,13 @@ const isDevVersion = (version) => version === "0.0.0" || version.includes("-");
|
|
|
48198
47833
|
* uploads source-map artifacts under, so stack frames symbolicate. Honors the
|
|
48199
47834
|
* standard `SENTRY_RELEASE` override.
|
|
48200
47835
|
*/
|
|
48201
|
-
const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.8.1-dev.
|
|
47836
|
+
const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.8.1-dev.61bf03e`;
|
|
48202
47837
|
/**
|
|
48203
47838
|
* Deployment environment shown in Sentry's environment filter. Defaults to
|
|
48204
47839
|
* `production` for tagged releases and `development` for dev/unbuilt versions,
|
|
48205
47840
|
* overridable via the standard `SENTRY_ENVIRONMENT` env var.
|
|
48206
47841
|
*/
|
|
48207
|
-
const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.8.1-dev.
|
|
47842
|
+
const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.8.1-dev.61bf03e") ? "development" : "production");
|
|
48208
47843
|
/**
|
|
48209
47844
|
* Performance-tracing sample rate in `[0, 1]`. Reads `SENTRY_TRACES_SAMPLE_RATE`
|
|
48210
47845
|
* (set to `0` to disable tracing) and falls back to
|
|
@@ -60530,8 +60165,6 @@ const buildScanResultCacheKey = (input) => {
|
|
|
60530
60165
|
warnings: input.options.warnings,
|
|
60531
60166
|
adoptExistingLintConfig: input.options.adoptExistingLintConfig,
|
|
60532
60167
|
ignoredTags: [...input.options.ignoredTags].sort(),
|
|
60533
|
-
includedTags: [...input.options.includedTags].sort(),
|
|
60534
|
-
includeTagDefaults: input.options.includeTagDefaults,
|
|
60535
60168
|
concurrency: input.options.concurrency,
|
|
60536
60169
|
lintBatchOrdering: resolveLintBatchOrdering(),
|
|
60537
60170
|
baselineRef: input.options.baseline?.ref,
|
|
@@ -61358,8 +60991,8 @@ const createDiagnosticEvidenceReader = (rootDirectory, options = {}) => {
|
|
|
61358
60991
|
//#endregion
|
|
61359
60992
|
//#region src/cli/utils/build-no-score-message.ts
|
|
61360
60993
|
const ENTERPRISE_CONTACT_HINT = `Want something custom to your company? Contact us at ${ENTERPRISE_CONTACT_URL}.`;
|
|
61361
|
-
const buildNoScoreMessage = (isScoreDisabled
|
|
61362
|
-
return `${isScoreDisabled ?
|
|
60994
|
+
const buildNoScoreMessage = (isScoreDisabled) => {
|
|
60995
|
+
return `${isScoreDisabled ? "Score disabled by --no-score." : "Score unavailable (could not reach the score API)."} ${ENTERPRISE_CONTACT_HINT}`;
|
|
61363
60996
|
};
|
|
61364
60997
|
//#endregion
|
|
61365
60998
|
//#region src/cli/utils/render-agent-guidance.ts
|
|
@@ -62484,47 +62117,40 @@ const buildChangedLineMatcher = (directory, changedLineRanges) => {
|
|
|
62484
62117
|
return diagnosticIntersectsLineRanges(diagnostic, ranges);
|
|
62485
62118
|
};
|
|
62486
62119
|
};
|
|
62487
|
-
const buildIgnoredTags = (userConfig
|
|
62120
|
+
const buildIgnoredTags = (userConfig) => {
|
|
62488
62121
|
const tags = /* @__PURE__ */ new Set();
|
|
62489
62122
|
if (userConfig?.ignore?.tags) for (const tag of userConfig.ignore.tags) tags.add(tag);
|
|
62490
|
-
for (const tag of includedTags) tags.delete(tag);
|
|
62491
62123
|
return tags;
|
|
62492
62124
|
};
|
|
62493
|
-
const mergeInspectOptions = (inputOptions, userConfig) => {
|
|
62494
|
-
|
|
62495
|
-
|
|
62496
|
-
|
|
62497
|
-
|
|
62498
|
-
|
|
62499
|
-
|
|
62500
|
-
|
|
62501
|
-
|
|
62502
|
-
|
|
62503
|
-
|
|
62504
|
-
|
|
62505
|
-
|
|
62506
|
-
|
|
62507
|
-
|
|
62508
|
-
|
|
62509
|
-
|
|
62510
|
-
|
|
62511
|
-
|
|
62512
|
-
|
|
62513
|
-
|
|
62514
|
-
|
|
62515
|
-
|
|
62516
|
-
|
|
62517
|
-
|
|
62518
|
-
|
|
62519
|
-
|
|
62520
|
-
|
|
62521
|
-
|
|
62522
|
-
maxDurationMs: inputOptions.maxDurationMs ?? null,
|
|
62523
|
-
baseline: inputOptions.baseline ?? null,
|
|
62524
|
-
changedLineRanges: inputOptions.changedLineRanges ?? null,
|
|
62525
|
-
supplyChainManifestChanged: inputOptions.supplyChainManifestChanged ?? false
|
|
62526
|
-
};
|
|
62527
|
-
};
|
|
62125
|
+
const mergeInspectOptions = (inputOptions, userConfig) => ({
|
|
62126
|
+
lint: inputOptions.lint ?? userConfig?.lint ?? true,
|
|
62127
|
+
deadCode: inputOptions.deadCode ?? userConfig?.deadCode ?? true,
|
|
62128
|
+
supplyChain: inputOptions.supplyChain ?? userConfig?.supplyChain?.enabled ?? true,
|
|
62129
|
+
verbose: inputOptions.verbose ?? userConfig?.verbose ?? false,
|
|
62130
|
+
outputDirectory: inputOptions.outputDirectory || null,
|
|
62131
|
+
scoreOnly: inputOptions.scoreOnly ?? false,
|
|
62132
|
+
noScore: inputOptions.noScore ?? userConfig?.noScore ?? false,
|
|
62133
|
+
isCi: inputOptions.isCi ?? false,
|
|
62134
|
+
isCiOrCodingAgentEnvironment: isCiOrCodingAgentEnvironment(),
|
|
62135
|
+
isNonInteractiveEnvironment: isNonInteractiveEnvironment(),
|
|
62136
|
+
silent: inputOptions.silent ?? false,
|
|
62137
|
+
includePaths: inputOptions.includePaths ?? [],
|
|
62138
|
+
customRulesOnly: userConfig?.customRulesOnly ?? false,
|
|
62139
|
+
share: userConfig?.share ?? true,
|
|
62140
|
+
respectInlineDisables: inputOptions.respectInlineDisables ?? userConfig?.respectInlineDisables ?? true,
|
|
62141
|
+
warnings: inputOptions.warnings ?? userConfig?.warnings ?? true,
|
|
62142
|
+
categoryFilters: new Set(resolveCliCategories(inputOptions.categoryFilters) ?? []),
|
|
62143
|
+
adoptExistingLintConfig: userConfig?.adoptExistingLintConfig ?? true,
|
|
62144
|
+
ignoredTags: buildIgnoredTags(userConfig),
|
|
62145
|
+
outputSurface: inputOptions.outputSurface ?? "cli",
|
|
62146
|
+
suppressRendering: inputOptions.suppressRendering ?? false,
|
|
62147
|
+
concurrentScan: inputOptions.concurrentScan ?? false,
|
|
62148
|
+
concurrency: inputOptions.concurrency,
|
|
62149
|
+
maxDurationMs: inputOptions.maxDurationMs ?? null,
|
|
62150
|
+
baseline: inputOptions.baseline ?? null,
|
|
62151
|
+
changedLineRanges: inputOptions.changedLineRanges ?? null,
|
|
62152
|
+
supplyChainManifestChanged: inputOptions.supplyChainManifestChanged ?? false
|
|
62153
|
+
});
|
|
62528
62154
|
const deriveScope = (options) => {
|
|
62529
62155
|
if (options.baseline) return "changed";
|
|
62530
62156
|
if (options.changedLineRanges !== null) return "lines";
|
|
@@ -62655,8 +62281,6 @@ const runBaselineComparison = async (params) => {
|
|
|
62655
62281
|
warnings: params.options.warnings,
|
|
62656
62282
|
adoptExistingLintConfig: params.options.adoptExistingLintConfig,
|
|
62657
62283
|
ignoredTags: params.options.ignoredTags,
|
|
62658
|
-
includedTags: params.options.includedTags,
|
|
62659
|
-
includeTagDefaults: params.options.includeTagDefaults,
|
|
62660
62284
|
nodeBinaryPath: params.resolvedNodeBinaryPath ?? void 0,
|
|
62661
62285
|
runDeadCode: false,
|
|
62662
62286
|
isCi: params.options.isCi,
|
|
@@ -62750,8 +62374,6 @@ const runInspectWithRuntime = async (directory, options, userConfig, hasConfigOv
|
|
|
62750
62374
|
warnings: options.warnings,
|
|
62751
62375
|
adoptExistingLintConfig: options.adoptExistingLintConfig,
|
|
62752
62376
|
ignoredTags: options.ignoredTags,
|
|
62753
|
-
includedTags: options.includedTags,
|
|
62754
|
-
includeTagDefaults: options.includeTagDefaults,
|
|
62755
62377
|
nodeBinaryPath: resolvedNodeBinaryPath ?? void 0,
|
|
62756
62378
|
runDeadCode: options.deadCode,
|
|
62757
62379
|
isCi: options.isCi,
|
|
@@ -62940,7 +62562,7 @@ const finalizeAndRender = (input) => gen(function* () {
|
|
|
62940
62562
|
securityScanFailed
|
|
62941
62563
|
});
|
|
62942
62564
|
const hasSkippedChecks = skippedChecks.length > 0;
|
|
62943
|
-
const noScoreMessage = buildNoScoreMessage(options.noScore
|
|
62565
|
+
const noScoreMessage = buildNoScoreMessage(options.noScore);
|
|
62944
62566
|
const buildResult = () => ({
|
|
62945
62567
|
diagnostics: [...diagnostics],
|
|
62946
62568
|
score,
|
|
@@ -65045,25 +64667,21 @@ const resolveParallelFlag = (parallel) => parallel === false ? 1 : void 0;
|
|
|
65045
64667
|
*/
|
|
65046
64668
|
const resolveCliInspectOptions = (flags, userConfig) => {
|
|
65047
64669
|
const wantsWarningGate = pickBlockingLevel(flags, userConfig) === "warning";
|
|
65048
|
-
const isDesignScan = flags.design === true;
|
|
65049
64670
|
return {
|
|
65050
64671
|
lint: flags.lint,
|
|
65051
|
-
deadCode:
|
|
65052
|
-
supplyChain:
|
|
64672
|
+
deadCode: flags.deadCode,
|
|
64673
|
+
supplyChain: flags.supplyChain,
|
|
65053
64674
|
verbose: flags.verbose,
|
|
65054
64675
|
outputDirectory: flags.outputDir,
|
|
65055
64676
|
respectInlineDisables: flags.respectInlineDisables === false ? false : void 0,
|
|
65056
64677
|
warnings: wantsWarningGate ? true : flags.warnings,
|
|
65057
64678
|
scoreOnly: flags.score === true,
|
|
65058
|
-
noScore:
|
|
64679
|
+
noScore: flags.score === false || flags.telemetry === false ? true : void 0,
|
|
65059
64680
|
isCi: isCiEnvironment(),
|
|
65060
64681
|
silent: Boolean(flags.json),
|
|
65061
64682
|
concurrency: resolveParallelFlag(flags.parallel),
|
|
65062
64683
|
maxDurationMs: resolveMaxDurationFlag(flags.maxDuration),
|
|
65063
|
-
categoryFilters: resolveCliCategories(flags.category)
|
|
65064
|
-
includedTags: isDesignScan ? new Set(["design"]) : void 0,
|
|
65065
|
-
includeTagDefaults: isDesignScan ? true : void 0,
|
|
65066
|
-
scoreDisabledMessage: isDesignScan ? "Design scans do not affect the React health score." : void 0
|
|
64684
|
+
categoryFilters: resolveCliCategories(flags.category)
|
|
65067
64685
|
};
|
|
65068
64686
|
};
|
|
65069
64687
|
//#endregion
|
|
@@ -65481,7 +65099,7 @@ const maybeMigrateLegacyConfig = async (requestedDirectory, { isQuiet, isStaged
|
|
|
65481
65099
|
if (!(!isQuiet && !isStaged && process.stdout.isTTY === true && !isCiOrCodingAgentEnvironment())) return;
|
|
65482
65100
|
await runProjectMigrations(requestedDirectory);
|
|
65483
65101
|
};
|
|
65484
|
-
const inspectAction = async (directory, flags
|
|
65102
|
+
const inspectAction = async (directory, flags) => {
|
|
65485
65103
|
const isScoreOnly = Boolean(flags.score);
|
|
65486
65104
|
const isJsonMode = Boolean(flags.json);
|
|
65487
65105
|
const isQuiet = isScoreOnly || isJsonMode;
|
|
@@ -65495,7 +65113,7 @@ const inspectAction = async (directory, flags, invocationCommand = "inspect") =>
|
|
|
65495
65113
|
});
|
|
65496
65114
|
if (flags.jsonOut) recordCount(METRIC.jsonOutUsed, 1);
|
|
65497
65115
|
}
|
|
65498
|
-
recordCount(METRIC.cliInvoked, 1, { command:
|
|
65116
|
+
recordCount(METRIC.cliInvoked, 1, { command: "inspect" });
|
|
65499
65117
|
try {
|
|
65500
65118
|
validateModeFlags(flags);
|
|
65501
65119
|
if (flags.staged) setJsonReportMode("staged");
|
|
@@ -65807,13 +65425,6 @@ const inspectAction = async (directory, flags, invocationCommand = "inspect") =>
|
|
|
65807
65425
|
}
|
|
65808
65426
|
};
|
|
65809
65427
|
//#endregion
|
|
65810
|
-
//#region src/cli/commands/design.ts
|
|
65811
|
-
const designAction = async (directory, flags) => inspectAction(directory, {
|
|
65812
|
-
...flags,
|
|
65813
|
-
design: true,
|
|
65814
|
-
lint: flags.lint ?? true
|
|
65815
|
-
}, "design");
|
|
65816
|
-
//#endregion
|
|
65817
65428
|
//#region src/cli/commands/install.ts
|
|
65818
65429
|
const installAction = async (options, command) => {
|
|
65819
65430
|
recordCount(METRIC.cliInvoked, 1, { command: "install" });
|
|
@@ -66650,7 +66261,6 @@ const INSTALL_FLAG_SPEC = {
|
|
|
66650
66261
|
shortOptionsWithRequiredValues: new Set(["-c"])
|
|
66651
66262
|
};
|
|
66652
66263
|
const COMMAND_FLAG_SPECS = new Map([
|
|
66653
|
-
["design", ROOT_FLAG_SPEC],
|
|
66654
66264
|
["install", INSTALL_FLAG_SPEC],
|
|
66655
66265
|
["setup", INSTALL_FLAG_SPEC],
|
|
66656
66266
|
["version", {
|
|
@@ -66807,7 +66417,6 @@ ${formatExampleLines([
|
|
|
66807
66417
|
["react-doctor --scope changed --base main", "scan only new issues vs. main"],
|
|
66808
66418
|
["react-doctor --project modules/a,modules/b", "score each module separately (names or paths)"],
|
|
66809
66419
|
["react-doctor --staged", "scan staged files (pre-commit hook)"],
|
|
66810
|
-
["react-doctor design", "run the focused UI design audit"],
|
|
66811
66420
|
["react-doctor --category Security", "show only one diagnostic category"],
|
|
66812
66421
|
["react-doctor --blocking warning", "fail CI on warnings too (default: error)"],
|
|
66813
66422
|
["react-doctor --json > report.json", "write a machine-readable report"],
|
|
@@ -66841,20 +66450,6 @@ ${highlighter.dim("Managing CI:")}
|
|
|
66841
66450
|
${highlighter.dim("Learn more:")}
|
|
66842
66451
|
${highlighter.info(CANONICAL_GITHUB_URL)}
|
|
66843
66452
|
`;
|
|
66844
|
-
const renderDesignHelpEpilog = () => `
|
|
66845
|
-
${highlighter.dim("Examples:")}
|
|
66846
|
-
${formatExampleLines([
|
|
66847
|
-
["react-doctor design", "audit UI design in the current project"],
|
|
66848
|
-
["react-doctor design ./apps/web", "audit one application"],
|
|
66849
|
-
["react-doctor design --verbose", "show every design finding"],
|
|
66850
|
-
["react-doctor design --json", "write a design-only JSON report"]
|
|
66851
|
-
])}
|
|
66852
|
-
|
|
66853
|
-
${highlighter.dim("Scope:")}
|
|
66854
|
-
Runs only rules tagged ${highlighter.info("design")}, including focused rules that stay opt-in during a general health scan.
|
|
66855
|
-
Dead-code, supply-chain, external lint-config, custom-plugin, and health-score passes are skipped.
|
|
66856
|
-
Standard scan flags such as ${highlighter.info("--scope")}, ${highlighter.info("--project")}, ${highlighter.info("--verbose")}, and ${highlighter.info("--json")} still work.
|
|
66857
|
-
`;
|
|
66858
66453
|
const renderCiHelpEpilog = () => `
|
|
66859
66454
|
${highlighter.dim("Examples:")}
|
|
66860
66455
|
${formatExampleLines([
|
|
@@ -66876,7 +66471,6 @@ ${highlighter.dim("Learn more:")}
|
|
|
66876
66471
|
const collectCategoryOption = (value, previousValues) => [...previousValues ?? [], value];
|
|
66877
66472
|
const program = new Command().name("react-doctor").description("Diagnose React codebase health").version(VERSION, "-v, --version", "display the version number").argument("[directory]", "project directory to scan", ".").option("--lint", "enable linting").option("--no-lint", "skip linting").option("--dead-code", "enable dead-code analysis (default)").option("--no-dead-code", "skip dead-code analysis (unused files / exports / dependencies, circular imports)").option("--supply-chain", "enable the dependency supply-chain scan (default)").option("--no-supply-chain", "skip the dependency supply-chain scan (Socket.dev dependency health checks)").option("--verbose", "show every rule and per-file details (default shows top 3 rules)").option("--debug", "force a Sentry trace and print its id at the end (paste it into a bug report)").option("--output-dir <dir>", "directory for the full diagnostics dump (default: a temp folder)").option("--score", "output only the score").option("--json", "output a single structured JSON report (suppresses other output)").option("--json-compact", "with --json, emit compact JSON (no indentation)").option("--json-out <path>", "with --json, write the report to a file instead of stdout").option("-y, --yes", "skip prompts, scan all workspace projects").option("--no-parallel", "lint serially with one worker (default: parallel across CPU cores; set the worker count with REACT_DOCTOR_PARALLEL)").option("--project <name>", "select projects: workspace names or directory paths (comma-separated for multiple); overrides the `projects` config field").option("--scope <value>", "how much supported JS/TS source to scan/report: full (default), files, changed (only new issues vs base), or lines (issues whose source spans touch changed lines)").option("--base <ref>", "base git ref for files/changed/lines scope (auto-detected when omitted)").option("--include-untracked", "with --scope files/changed/lines, also scan ordinary untracked files (respects .gitignore)").addOption(new Option("--diff [base]", "[deprecated] alias for --scope changed (pass `false` to force a full scan)").hideHelp()).addOption(new Option("--changed-files-from <file>", "scan source files listed in a newline-delimited changed-files file").hideHelp()).option("--no-score", "skip the score API, the share URL, and crash reporting").addOption(new Option("--category <category>", "only show diagnostics in a category (repeatable; e.g. Security)").argParser(collectCategoryOption)).option("--no-telemetry", "alias for --no-score (skip the score API, share URL, and crash reporting)").option("--staged", "scan only staged (git index) files for pre-commit hooks").option("--max-duration <seconds>", "scan time budget for the whole run, shared across workspace projects: past it, remaining lint batches and dead-code are skipped and partial results are reported (skipped files are listed in the JSON report)").option("--blocking <level>", "severity that fails CI: error (default), warning, or none (advisory)").addOption(new Option("--fail-on <level>", "[deprecated] alias for --blocking <level>").hideHelp()).option("--no-respect-inline-disables", "audit mode: neutralize inline lint suppressions before scanning").option("--warnings", "show warning-severity diagnostics (default)").option("--no-warnings", "hide warning-severity diagnostics (errors only)").option("--color", "force colored output").option("--no-color", "disable colored output (also honors NO_COLOR)").addHelpText("after", renderRootHelpEpilog);
|
|
66878
66473
|
program.action(inspectAction);
|
|
66879
|
-
program.command("design [directory]").description("Run only the focused UI design diagnostics").addHelpText("after", renderDesignHelpEpilog).action((directory, _options, command) => designAction(directory ?? ".", command.optsWithGlobals()));
|
|
66880
66474
|
program.command("why <location>").description("Explain why a rule fired (or why a suppression didn't apply) at a file:line").option("--project <name>", "select projects: workspace names or directory paths (comma-separated for multiple)").option("-c, --cwd <cwd>", "working directory", process.cwd()).option("--color", "force colored output").option("--no-color", "disable colored output (also honors NO_COLOR)").action((location, options) => whyAction(location, options));
|
|
66881
66475
|
program.command("install").alias("setup").description("Install the react-doctor skill into your coding agents and optional git hook").option("-y, --yes", "skip prompts, install for all detected agents").option("--dry-run", "show what would be installed without writing files").option("--agent-hooks", "install native non-blocking agent hooks for Claude Code and Cursor").option("-c, --cwd <cwd>", "working directory", process.cwd()).option("--color", "force colored output").option("--no-color", "disable colored output (also honors NO_COLOR)").addHelpText("after", renderInstallHelpEpilog).action(installAction);
|
|
66882
66476
|
const providerOption = ["--provider <name>", "ci provider: github-actions or gitlab-ci (auto-detected by default)"];
|
|
@@ -66925,4 +66519,4 @@ Promise.resolve().then(() => assertNoRemovedFlags(process.argv)).then(() => prog
|
|
|
66925
66519
|
export {};
|
|
66926
66520
|
|
|
66927
66521
|
//# sourceMappingURL=cli.js.map
|
|
66928
|
-
//# debugId=
|
|
66522
|
+
//# debugId=c5ad9312-01de-535b-a900-0d45e296a4fa
|