react-doctor 0.5.5 → 0.5.6-dev.03301fc
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/dist/cli.js +26 -14
- package/dist/index.d.ts +4 -3
- package/dist/index.js +23 -11
- package/dist/lsp.js +24 -12
- package/package.json +5 -5
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]="bb93aaad-ea85-5f1d-b2db-584f48671f66")}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";
|
|
@@ -39740,13 +39740,24 @@ const checkSecurityScan = (rootDirectory, options = {}) => {
|
|
|
39740
39740
|
if (!shouldEnableRule(rule.requires, rule.tags, capabilities, ignoredTags, rule.disabledBy)) return [];
|
|
39741
39741
|
return [{
|
|
39742
39742
|
entry,
|
|
39743
|
-
scan
|
|
39743
|
+
scan,
|
|
39744
|
+
committedFilesOnly: rule.committedFilesOnly === true
|
|
39744
39745
|
}];
|
|
39745
39746
|
});
|
|
39746
39747
|
if (enabledScanRules.length === 0) return [];
|
|
39747
39748
|
const diagnostics = [];
|
|
39748
39749
|
const seen = /* @__PURE__ */ new Set();
|
|
39749
|
-
|
|
39750
|
+
const gitIgnoredCache = /* @__PURE__ */ new Map();
|
|
39751
|
+
const isFileGitIgnored = (file) => {
|
|
39752
|
+
let status = gitIgnoredCache.get(file.absolutePath);
|
|
39753
|
+
if (status === void 0) {
|
|
39754
|
+
status = isPathGitIgnored(rootDirectory, file.absolutePath);
|
|
39755
|
+
gitIgnoredCache.set(file.absolutePath, status);
|
|
39756
|
+
}
|
|
39757
|
+
return status === true;
|
|
39758
|
+
};
|
|
39759
|
+
for (const file of collectSecurityScanFiles(rootDirectory)) for (const { entry, scan, committedFilesOnly } of enabledScanRules) for (const finding of scan(file)) {
|
|
39760
|
+
if (committedFilesOnly && isFileGitIgnored(file)) continue;
|
|
39750
39761
|
const diagnostic = buildSecurityScanDiagnostic(finding, entry, file.relativePath);
|
|
39751
39762
|
const key = `${diagnostic.rule}:${diagnostic.filePath}:${diagnostic.line}:${diagnostic.column}:${diagnostic.message}`;
|
|
39752
39763
|
if (seen.has(key)) continue;
|
|
@@ -39975,12 +39986,11 @@ const collectKnipPatterns = (rootDirectory, settingName) => {
|
|
|
39975
39986
|
if (!config) return [];
|
|
39976
39987
|
return [...normalizePatternList(config[settingName]), ...collectKnipWorkspacePatterns(config.workspaces, settingName)];
|
|
39977
39988
|
};
|
|
39978
|
-
const collectDeadCodeIgnorePatterns = (rootDirectory
|
|
39989
|
+
const collectDeadCodeIgnorePatterns = (rootDirectory) => {
|
|
39979
39990
|
const seen = /* @__PURE__ */ new Set();
|
|
39980
39991
|
const sources = [
|
|
39981
39992
|
readIgnoreFile(path.join(rootDirectory, ".gitignore")),
|
|
39982
39993
|
collectIgnorePatterns(rootDirectory),
|
|
39983
|
-
userConfig?.ignore?.files ?? [],
|
|
39984
39994
|
collectKnipPatterns(rootDirectory, "ignore")
|
|
39985
39995
|
];
|
|
39986
39996
|
for (const source of sources) for (const pattern of source) seen.add(pattern);
|
|
@@ -40258,11 +40268,10 @@ const runDeadCodeWorkerWithTimeout = (handle, timeoutMs) => new Promise((resolve
|
|
|
40258
40268
|
});
|
|
40259
40269
|
});
|
|
40260
40270
|
const checkDeadCode = async (options) => {
|
|
40261
|
-
const { userConfig } = options;
|
|
40262
40271
|
const rootDirectory = toCanonicalPath(options.rootDirectory);
|
|
40263
40272
|
if (!NFS.existsSync(Path.join(rootDirectory, "package.json"))) return [];
|
|
40264
40273
|
const entryPatterns = collectDeadCodeEntryPatterns(rootDirectory);
|
|
40265
|
-
const ignorePatterns = collectDeadCodeIgnorePatterns(rootDirectory
|
|
40274
|
+
const ignorePatterns = collectDeadCodeIgnorePatterns(rootDirectory);
|
|
40266
40275
|
const result = parseDeadCodeWorkerResult(await runDeadCodeWorkerWithTimeout((options.createWorker ?? createDeadCodeWorker)({
|
|
40267
40276
|
rootDirectory,
|
|
40268
40277
|
entryPatterns,
|
|
@@ -42773,6 +42782,8 @@ const resolveConcreteVersion = (spec) => {
|
|
|
42773
42782
|
const trimmed = spec.trim();
|
|
42774
42783
|
if (trimmed.length === 0) return null;
|
|
42775
42784
|
if (trimmed.includes(":")) return null;
|
|
42785
|
+
const range = import_semver.validRange(trimmed);
|
|
42786
|
+
if (range === null || range === "*") return null;
|
|
42776
42787
|
return import_semver.minVersion(trimmed)?.version ?? null;
|
|
42777
42788
|
};
|
|
42778
42789
|
const locateDependencyKey = (packageJsonText, section, name) => {
|
|
@@ -43159,8 +43170,10 @@ const runInspect = (input, hooks = {}) => gen(function* () {
|
|
|
43159
43170
|
const lintFailureState = yield* get$2(lintFailure);
|
|
43160
43171
|
yield* afterLint(lintFailureState.didFail);
|
|
43161
43172
|
if (lintFailureState.didFail) yield* scanProgress.fail(formatLintFailText(lintFailureState.reasonTag, process.version));
|
|
43173
|
+
const totalFileCount = lastReportedTotalFileCount || (lintIncludePaths?.length ?? project.sourceFileCount);
|
|
43174
|
+
const scannedFilesLabel = `${totalFileCount} ${totalFileCount === 1 ? "file" : "files"}`;
|
|
43162
43175
|
const shouldRunDeadCode = input.runDeadCode && !isDiffMode && (showWarnings || deadCodeMaySurfaceWhenWarningsHidden(resolvedConfig.config));
|
|
43163
|
-
const deadCodeCollected = lintFailureState.didFail || !shouldRunDeadCode ? [] : yield* scanProgress.update(
|
|
43176
|
+
const deadCodeCollected = lintFailureState.didFail || !shouldRunDeadCode ? [] : yield* scanProgress.update(`Scanned ${scannedFilesLabel}, analyzing dead code...`).pipe(andThen(runCollect(applyPerElementPipeline(deadCodeService.run({
|
|
43164
43177
|
rootDirectory: scanDirectory,
|
|
43165
43178
|
userConfig: resolvedConfig.config
|
|
43166
43179
|
}).pipe(catchTag("ReactDoctorError", (error) => unwrap(gen(function* () {
|
|
@@ -43173,10 +43186,9 @@ const runInspect = (input, hooks = {}) => gen(function* () {
|
|
|
43173
43186
|
const deadCodeFailureState = yield* get$2(deadCodeFailure);
|
|
43174
43187
|
const scanElapsedMilliseconds = Date.now() - scanStartTime;
|
|
43175
43188
|
const scanElapsedSeconds = (scanElapsedMilliseconds / 1e3).toFixed(1);
|
|
43176
|
-
const totalFileCount = lastReportedTotalFileCount || (lintIncludePaths?.length ?? project.sourceFileCount);
|
|
43177
43189
|
if (!lintFailureState.didFail) if (deadCodeFailureState.didFail) yield* scanProgress.fail(DEAD_CODE_FAIL_TEXT);
|
|
43178
43190
|
else if (input.suppressScanSummary) yield* scanProgress.stop();
|
|
43179
|
-
else yield* scanProgress.succeed(`Scanned ${
|
|
43191
|
+
else yield* scanProgress.succeed(`Scanned ${scannedFilesLabel} in ${scanElapsedSeconds}s${workerCountSuffix}`);
|
|
43180
43192
|
yield* reporterService.finalize;
|
|
43181
43193
|
const finalDiagnostics = [
|
|
43182
43194
|
...envCollected,
|
|
@@ -43958,7 +43970,7 @@ const makeNoopConsole = () => ({
|
|
|
43958
43970
|
});
|
|
43959
43971
|
//#endregion
|
|
43960
43972
|
//#region src/cli/utils/version.ts
|
|
43961
|
-
const VERSION = "0.5.
|
|
43973
|
+
const VERSION = "0.5.6-dev.03301fc";
|
|
43962
43974
|
//#endregion
|
|
43963
43975
|
//#region src/cli/utils/json-mode.ts
|
|
43964
43976
|
let context = null;
|
|
@@ -44316,13 +44328,13 @@ const isDevVersion = (version) => version === "0.0.0" || version.includes("-");
|
|
|
44316
44328
|
* uploads source-map artifacts under, so stack frames symbolicate. Honors the
|
|
44317
44329
|
* standard `SENTRY_RELEASE` override.
|
|
44318
44330
|
*/
|
|
44319
|
-
const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.5.
|
|
44331
|
+
const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.5.6-dev.03301fc`;
|
|
44320
44332
|
/**
|
|
44321
44333
|
* Deployment environment shown in Sentry's environment filter. Defaults to
|
|
44322
44334
|
* `production` for tagged releases and `development` for dev/unbuilt versions,
|
|
44323
44335
|
* overridable via the standard `SENTRY_ENVIRONMENT` env var.
|
|
44324
44336
|
*/
|
|
44325
|
-
const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.5.
|
|
44337
|
+
const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.5.6-dev.03301fc") ? "development" : "production");
|
|
44326
44338
|
/**
|
|
44327
44339
|
* Performance-tracing sample rate in `[0, 1]`. Reads `SENTRY_TRACES_SAMPLE_RATE`
|
|
44328
44340
|
* (set to `0` to disable tracing) and falls back to
|
|
@@ -53934,4 +53946,4 @@ Promise.resolve().then(() => assertNoRemovedFlags(process.argv)).then(() => prog
|
|
|
53934
53946
|
export {};
|
|
53935
53947
|
|
|
53936
53948
|
//# sourceMappingURL=cli.js.map
|
|
53937
|
-
//# debugId=
|
|
53949
|
+
//# debugId=bb93aaad-ea85-5f1d-b2db-584f48671f66
|
package/dist/index.d.ts
CHANGED
|
@@ -9280,9 +9280,10 @@ interface ReactDoctorConfig {
|
|
|
9280
9280
|
* list, user-provided names are treated as distinctive and never
|
|
9281
9281
|
* subject to receiver-object disambiguation.
|
|
9282
9282
|
*
|
|
9283
|
-
*
|
|
9284
|
-
*
|
|
9285
|
-
*
|
|
9283
|
+
* Common guard conventions are already recognized automatically
|
|
9284
|
+
* (`requireAdmin`, `ensureSignedIn`, `getCurrentUser`, `hasRole`, …),
|
|
9285
|
+
* so this is only needed for domain-specific guards whose names carry
|
|
9286
|
+
* no auth noun — e.g. a project-local `requireWorkspaceMember`.
|
|
9286
9287
|
*/
|
|
9287
9288
|
serverAuthFunctionNames?: string[];
|
|
9288
9289
|
/**
|
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]="a4394ddc-4e6c-5a18-aeeb-d60322b1c0dd")}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 * as NFS from "node:fs";
|
|
@@ -36520,13 +36520,24 @@ const checkSecurityScan = (rootDirectory, options = {}) => {
|
|
|
36520
36520
|
if (!shouldEnableRule(rule.requires, rule.tags, capabilities, ignoredTags, rule.disabledBy)) return [];
|
|
36521
36521
|
return [{
|
|
36522
36522
|
entry,
|
|
36523
|
-
scan
|
|
36523
|
+
scan,
|
|
36524
|
+
committedFilesOnly: rule.committedFilesOnly === true
|
|
36524
36525
|
}];
|
|
36525
36526
|
});
|
|
36526
36527
|
if (enabledScanRules.length === 0) return [];
|
|
36527
36528
|
const diagnostics = [];
|
|
36528
36529
|
const seen = /* @__PURE__ */ new Set();
|
|
36529
|
-
|
|
36530
|
+
const gitIgnoredCache = /* @__PURE__ */ new Map();
|
|
36531
|
+
const isFileGitIgnored = (file) => {
|
|
36532
|
+
let status = gitIgnoredCache.get(file.absolutePath);
|
|
36533
|
+
if (status === void 0) {
|
|
36534
|
+
status = isPathGitIgnored(rootDirectory, file.absolutePath);
|
|
36535
|
+
gitIgnoredCache.set(file.absolutePath, status);
|
|
36536
|
+
}
|
|
36537
|
+
return status === true;
|
|
36538
|
+
};
|
|
36539
|
+
for (const file of collectSecurityScanFiles(rootDirectory)) for (const { entry, scan, committedFilesOnly } of enabledScanRules) for (const finding of scan(file)) {
|
|
36540
|
+
if (committedFilesOnly && isFileGitIgnored(file)) continue;
|
|
36530
36541
|
const diagnostic = buildSecurityScanDiagnostic(finding, entry, file.relativePath);
|
|
36531
36542
|
const key = `${diagnostic.rule}:${diagnostic.filePath}:${diagnostic.line}:${diagnostic.column}:${diagnostic.message}`;
|
|
36532
36543
|
if (seen.has(key)) continue;
|
|
@@ -36739,12 +36750,11 @@ const collectKnipPatterns = (rootDirectory, settingName) => {
|
|
|
36739
36750
|
if (!config) return [];
|
|
36740
36751
|
return [...normalizePatternList(config[settingName]), ...collectKnipWorkspacePatterns(config.workspaces, settingName)];
|
|
36741
36752
|
};
|
|
36742
|
-
const collectDeadCodeIgnorePatterns = (rootDirectory
|
|
36753
|
+
const collectDeadCodeIgnorePatterns = (rootDirectory) => {
|
|
36743
36754
|
const seen = /* @__PURE__ */ new Set();
|
|
36744
36755
|
const sources = [
|
|
36745
36756
|
readIgnoreFile(path.join(rootDirectory, ".gitignore")),
|
|
36746
36757
|
collectIgnorePatterns(rootDirectory),
|
|
36747
|
-
userConfig?.ignore?.files ?? [],
|
|
36748
36758
|
collectKnipPatterns(rootDirectory, "ignore")
|
|
36749
36759
|
];
|
|
36750
36760
|
for (const source of sources) for (const pattern of source) seen.add(pattern);
|
|
@@ -37022,11 +37032,10 @@ const runDeadCodeWorkerWithTimeout = (handle, timeoutMs) => new Promise((resolve
|
|
|
37022
37032
|
});
|
|
37023
37033
|
});
|
|
37024
37034
|
const checkDeadCode = async (options) => {
|
|
37025
|
-
const { userConfig } = options;
|
|
37026
37035
|
const rootDirectory = toCanonicalPath(options.rootDirectory);
|
|
37027
37036
|
if (!NFS.existsSync(Path.join(rootDirectory, "package.json"))) return [];
|
|
37028
37037
|
const entryPatterns = collectDeadCodeEntryPatterns(rootDirectory);
|
|
37029
|
-
const ignorePatterns = collectDeadCodeIgnorePatterns(rootDirectory
|
|
37038
|
+
const ignorePatterns = collectDeadCodeIgnorePatterns(rootDirectory);
|
|
37030
37039
|
const result = parseDeadCodeWorkerResult(await runDeadCodeWorkerWithTimeout((options.createWorker ?? createDeadCodeWorker)({
|
|
37031
37040
|
rootDirectory,
|
|
37032
37041
|
entryPatterns,
|
|
@@ -39537,6 +39546,8 @@ const resolveConcreteVersion = (spec) => {
|
|
|
39537
39546
|
const trimmed = spec.trim();
|
|
39538
39547
|
if (trimmed.length === 0) return null;
|
|
39539
39548
|
if (trimmed.includes(":")) return null;
|
|
39549
|
+
const range = import_semver.validRange(trimmed);
|
|
39550
|
+
if (range === null || range === "*") return null;
|
|
39540
39551
|
return import_semver.minVersion(trimmed)?.version ?? null;
|
|
39541
39552
|
};
|
|
39542
39553
|
const locateDependencyKey = (packageJsonText, section, name) => {
|
|
@@ -39923,8 +39934,10 @@ const runInspect = (input, hooks = {}) => gen(function* () {
|
|
|
39923
39934
|
const lintFailureState = yield* get$2(lintFailure);
|
|
39924
39935
|
yield* afterLint(lintFailureState.didFail);
|
|
39925
39936
|
if (lintFailureState.didFail) yield* scanProgress.fail(formatLintFailText(lintFailureState.reasonTag, process.version));
|
|
39937
|
+
const totalFileCount = lastReportedTotalFileCount || (lintIncludePaths?.length ?? project.sourceFileCount);
|
|
39938
|
+
const scannedFilesLabel = `${totalFileCount} ${totalFileCount === 1 ? "file" : "files"}`;
|
|
39926
39939
|
const shouldRunDeadCode = input.runDeadCode && !isDiffMode && (showWarnings || deadCodeMaySurfaceWhenWarningsHidden(resolvedConfig.config));
|
|
39927
|
-
const deadCodeCollected = lintFailureState.didFail || !shouldRunDeadCode ? [] : yield* scanProgress.update(
|
|
39940
|
+
const deadCodeCollected = lintFailureState.didFail || !shouldRunDeadCode ? [] : yield* scanProgress.update(`Scanned ${scannedFilesLabel}, analyzing dead code...`).pipe(andThen(runCollect(applyPerElementPipeline(deadCodeService.run({
|
|
39928
39941
|
rootDirectory: scanDirectory,
|
|
39929
39942
|
userConfig: resolvedConfig.config
|
|
39930
39943
|
}).pipe(catchTag("ReactDoctorError", (error) => unwrap(gen(function* () {
|
|
@@ -39937,10 +39950,9 @@ const runInspect = (input, hooks = {}) => gen(function* () {
|
|
|
39937
39950
|
const deadCodeFailureState = yield* get$2(deadCodeFailure);
|
|
39938
39951
|
const scanElapsedMilliseconds = Date.now() - scanStartTime;
|
|
39939
39952
|
const scanElapsedSeconds = (scanElapsedMilliseconds / 1e3).toFixed(1);
|
|
39940
|
-
const totalFileCount = lastReportedTotalFileCount || (lintIncludePaths?.length ?? project.sourceFileCount);
|
|
39941
39953
|
if (!lintFailureState.didFail) if (deadCodeFailureState.didFail) yield* scanProgress.fail(DEAD_CODE_FAIL_TEXT);
|
|
39942
39954
|
else if (input.suppressScanSummary) yield* scanProgress.stop();
|
|
39943
|
-
else yield* scanProgress.succeed(`Scanned ${
|
|
39955
|
+
else yield* scanProgress.succeed(`Scanned ${scannedFilesLabel} in ${scanElapsedSeconds}s${workerCountSuffix}`);
|
|
39944
39956
|
yield* reporterService.finalize;
|
|
39945
39957
|
const finalDiagnostics = [
|
|
39946
39958
|
...envCollected,
|
|
@@ -40559,4 +40571,4 @@ const toJsonReport = (result, options) => buildJsonReport({
|
|
|
40559
40571
|
export { AmbiguousProjectError, NoReactDependencyError, NotADirectoryError, PackageJsonNotFoundError, ProjectNotFoundError, ReactDoctorError, buildJsonReport, buildJsonReportError, clearCaches, defineConfig, diagnose, filterSourceFiles, getDiffInfo, isProjectDiscoveryError, isReactDoctorError, summarizeDiagnostics, toJsonReport };
|
|
40560
40572
|
|
|
40561
40573
|
//# sourceMappingURL=index.js.map
|
|
40562
|
-
//# debugId=
|
|
40574
|
+
//# debugId=a4394ddc-4e6c-5a18-aeeb-d60322b1c0dd
|
package/dist/lsp.js
CHANGED
|
@@ -36506,13 +36506,24 @@ const checkSecurityScan = (rootDirectory, options = {}) => {
|
|
|
36506
36506
|
if (!shouldEnableRule(rule.requires, rule.tags, capabilities, ignoredTags, rule.disabledBy)) return [];
|
|
36507
36507
|
return [{
|
|
36508
36508
|
entry,
|
|
36509
|
-
scan
|
|
36509
|
+
scan,
|
|
36510
|
+
committedFilesOnly: rule.committedFilesOnly === true
|
|
36510
36511
|
}];
|
|
36511
36512
|
});
|
|
36512
36513
|
if (enabledScanRules.length === 0) return [];
|
|
36513
36514
|
const diagnostics = [];
|
|
36514
36515
|
const seen = /* @__PURE__ */ new Set();
|
|
36515
|
-
|
|
36516
|
+
const gitIgnoredCache = /* @__PURE__ */ new Map();
|
|
36517
|
+
const isFileGitIgnored = (file) => {
|
|
36518
|
+
let status = gitIgnoredCache.get(file.absolutePath);
|
|
36519
|
+
if (status === void 0) {
|
|
36520
|
+
status = isPathGitIgnored(rootDirectory, file.absolutePath);
|
|
36521
|
+
gitIgnoredCache.set(file.absolutePath, status);
|
|
36522
|
+
}
|
|
36523
|
+
return status === true;
|
|
36524
|
+
};
|
|
36525
|
+
for (const file of collectSecurityScanFiles(rootDirectory)) for (const { entry, scan, committedFilesOnly } of enabledScanRules) for (const finding of scan(file)) {
|
|
36526
|
+
if (committedFilesOnly && isFileGitIgnored(file)) continue;
|
|
36516
36527
|
const diagnostic = buildSecurityScanDiagnostic(finding, entry, file.relativePath);
|
|
36517
36528
|
const key = `${diagnostic.rule}:${diagnostic.filePath}:${diagnostic.line}:${diagnostic.column}:${diagnostic.message}`;
|
|
36518
36529
|
if (seen.has(key)) continue;
|
|
@@ -36725,12 +36736,11 @@ const collectKnipPatterns = (rootDirectory, settingName) => {
|
|
|
36725
36736
|
if (!config) return [];
|
|
36726
36737
|
return [...normalizePatternList(config[settingName]), ...collectKnipWorkspacePatterns(config.workspaces, settingName)];
|
|
36727
36738
|
};
|
|
36728
|
-
const collectDeadCodeIgnorePatterns = (rootDirectory
|
|
36739
|
+
const collectDeadCodeIgnorePatterns = (rootDirectory) => {
|
|
36729
36740
|
const seen = /* @__PURE__ */ new Set();
|
|
36730
36741
|
const sources = [
|
|
36731
36742
|
readIgnoreFile(path.join(rootDirectory, ".gitignore")),
|
|
36732
36743
|
collectIgnorePatterns(rootDirectory),
|
|
36733
|
-
userConfig?.ignore?.files ?? [],
|
|
36734
36744
|
collectKnipPatterns(rootDirectory, "ignore")
|
|
36735
36745
|
];
|
|
36736
36746
|
for (const source of sources) for (const pattern of source) seen.add(pattern);
|
|
@@ -37008,11 +37018,10 @@ const runDeadCodeWorkerWithTimeout = (handle, timeoutMs) => new Promise((resolve
|
|
|
37008
37018
|
});
|
|
37009
37019
|
});
|
|
37010
37020
|
const checkDeadCode = async (options) => {
|
|
37011
|
-
const { userConfig } = options;
|
|
37012
37021
|
const rootDirectory = toCanonicalPath(options.rootDirectory);
|
|
37013
37022
|
if (!NFS.existsSync(Path.join(rootDirectory, "package.json"))) return [];
|
|
37014
37023
|
const entryPatterns = collectDeadCodeEntryPatterns(rootDirectory);
|
|
37015
|
-
const ignorePatterns = collectDeadCodeIgnorePatterns(rootDirectory
|
|
37024
|
+
const ignorePatterns = collectDeadCodeIgnorePatterns(rootDirectory);
|
|
37016
37025
|
const result = parseDeadCodeWorkerResult(await runDeadCodeWorkerWithTimeout((options.createWorker ?? createDeadCodeWorker)({
|
|
37017
37026
|
rootDirectory,
|
|
37018
37027
|
entryPatterns,
|
|
@@ -39523,6 +39532,8 @@ const resolveConcreteVersion = (spec) => {
|
|
|
39523
39532
|
const trimmed = spec.trim();
|
|
39524
39533
|
if (trimmed.length === 0) return null;
|
|
39525
39534
|
if (trimmed.includes(":")) return null;
|
|
39535
|
+
const range = import_semver.validRange(trimmed);
|
|
39536
|
+
if (range === null || range === "*") return null;
|
|
39526
39537
|
return import_semver.minVersion(trimmed)?.version ?? null;
|
|
39527
39538
|
};
|
|
39528
39539
|
const locateDependencyKey = (packageJsonText, section, name) => {
|
|
@@ -39909,8 +39920,10 @@ const runInspect = (input, hooks = {}) => gen(function* () {
|
|
|
39909
39920
|
const lintFailureState = yield* get$2(lintFailure);
|
|
39910
39921
|
yield* afterLint(lintFailureState.didFail);
|
|
39911
39922
|
if (lintFailureState.didFail) yield* scanProgress.fail(formatLintFailText(lintFailureState.reasonTag, process.version));
|
|
39923
|
+
const totalFileCount = lastReportedTotalFileCount || (lintIncludePaths?.length ?? project.sourceFileCount);
|
|
39924
|
+
const scannedFilesLabel = `${totalFileCount} ${totalFileCount === 1 ? "file" : "files"}`;
|
|
39912
39925
|
const shouldRunDeadCode = input.runDeadCode && !isDiffMode && (showWarnings || deadCodeMaySurfaceWhenWarningsHidden(resolvedConfig.config));
|
|
39913
|
-
const deadCodeCollected = lintFailureState.didFail || !shouldRunDeadCode ? [] : yield* scanProgress.update(
|
|
39926
|
+
const deadCodeCollected = lintFailureState.didFail || !shouldRunDeadCode ? [] : yield* scanProgress.update(`Scanned ${scannedFilesLabel}, analyzing dead code...`).pipe(andThen(runCollect(applyPerElementPipeline(deadCodeService.run({
|
|
39914
39927
|
rootDirectory: scanDirectory,
|
|
39915
39928
|
userConfig: resolvedConfig.config
|
|
39916
39929
|
}).pipe(catchTag("ReactDoctorError", (error) => unwrap(gen(function* () {
|
|
@@ -39923,10 +39936,9 @@ const runInspect = (input, hooks = {}) => gen(function* () {
|
|
|
39923
39936
|
const deadCodeFailureState = yield* get$2(deadCodeFailure);
|
|
39924
39937
|
const scanElapsedMilliseconds = Date.now() - scanStartTime;
|
|
39925
39938
|
const scanElapsedSeconds = (scanElapsedMilliseconds / 1e3).toFixed(1);
|
|
39926
|
-
const totalFileCount = lastReportedTotalFileCount || (lintIncludePaths?.length ?? project.sourceFileCount);
|
|
39927
39939
|
if (!lintFailureState.didFail) if (deadCodeFailureState.didFail) yield* scanProgress.fail(DEAD_CODE_FAIL_TEXT);
|
|
39928
39940
|
else if (input.suppressScanSummary) yield* scanProgress.stop();
|
|
39929
|
-
else yield* scanProgress.succeed(`Scanned ${
|
|
39941
|
+
else yield* scanProgress.succeed(`Scanned ${scannedFilesLabel} in ${scanElapsedSeconds}s${workerCountSuffix}`);
|
|
39930
39942
|
yield* reporterService.finalize;
|
|
39931
39943
|
const finalDiagnostics = [
|
|
39932
39944
|
...envCollected,
|
|
@@ -40297,7 +40309,7 @@ const computeConfigFingerprint = (projectDirectory, version) => {
|
|
|
40297
40309
|
/** Display name used in client-facing messages and progress titles. */
|
|
40298
40310
|
const SERVER_DISPLAY_NAME = "React Doctor";
|
|
40299
40311
|
/** Server version reported in `serverInfo`; injected at build, `dev` from source. */
|
|
40300
|
-
const SERVER_VERSION = "0.5.
|
|
40312
|
+
const SERVER_VERSION = "0.5.6";
|
|
40301
40313
|
/** `Diagnostic.source` shown next to every published diagnostic. */
|
|
40302
40314
|
const DIAGNOSTIC_SOURCE = "react-doctor";
|
|
40303
40315
|
/**
|
|
@@ -42344,5 +42356,5 @@ const startLanguageServer = () => {
|
|
|
42344
42356
|
};
|
|
42345
42357
|
//#endregion
|
|
42346
42358
|
export { startLanguageServer };
|
|
42347
|
-
!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]="
|
|
42348
|
-
//# debugId=
|
|
42359
|
+
!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]="03349093-b1b2-5f21-bad3-7e212e5a7f91")}catch(e){}}();
|
|
42360
|
+
//# debugId=03349093-b1b2-5f21-bad3-7e212e5a7f91
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-doctor",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.6-dev.03301fc",
|
|
4
4
|
"description": "Your agent writes bad React. This catches it",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"accessibility",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"vscode-languageserver": "^9.0.1",
|
|
65
65
|
"vscode-languageserver-textdocument": "^1.0.12",
|
|
66
66
|
"vscode-uri": "^3.1.0",
|
|
67
|
-
"oxlint-plugin-react-doctor": "0.5.
|
|
67
|
+
"oxlint-plugin-react-doctor": "0.5.6-dev.03301fc"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@types/babel__code-frame": "^7.27.0",
|
|
@@ -72,9 +72,9 @@
|
|
|
72
72
|
"@xterm/headless": "^6.0.0",
|
|
73
73
|
"commander": "^14.0.3",
|
|
74
74
|
"ora": "^9.4.0",
|
|
75
|
-
"@react-doctor/
|
|
76
|
-
"@react-doctor/
|
|
77
|
-
"@react-doctor/language-server": "0.5.
|
|
75
|
+
"@react-doctor/core": "0.5.6",
|
|
76
|
+
"@react-doctor/api": "0.5.6",
|
|
77
|
+
"@react-doctor/language-server": "0.5.6"
|
|
78
78
|
},
|
|
79
79
|
"engines": {
|
|
80
80
|
"node": "^20.19.0 || >=22.13.0"
|