react-doctor 0.5.5 → 0.5.6-dev.8908f98

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 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]="06a2a696-2f0a-515a-8c24-d1a9b9898c6e")}catch(e){}}();
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]="fd7e91f8-8458-50a2-99d9-a1ea8f8bfaff")}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
- for (const file of collectSecurityScanFiles(rootDirectory)) for (const { entry, scan } of enabledScanRules) for (const finding of scan(file)) {
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;
@@ -42773,6 +42784,8 @@ const resolveConcreteVersion = (spec) => {
42773
42784
  const trimmed = spec.trim();
42774
42785
  if (trimmed.length === 0) return null;
42775
42786
  if (trimmed.includes(":")) return null;
42787
+ const range = import_semver.validRange(trimmed);
42788
+ if (range === null || range === "*") return null;
42776
42789
  return import_semver.minVersion(trimmed)?.version ?? null;
42777
42790
  };
42778
42791
  const locateDependencyKey = (packageJsonText, section, name) => {
@@ -43159,8 +43172,10 @@ const runInspect = (input, hooks = {}) => gen(function* () {
43159
43172
  const lintFailureState = yield* get$2(lintFailure);
43160
43173
  yield* afterLint(lintFailureState.didFail);
43161
43174
  if (lintFailureState.didFail) yield* scanProgress.fail(formatLintFailText(lintFailureState.reasonTag, process.version));
43175
+ const totalFileCount = lastReportedTotalFileCount || (lintIncludePaths?.length ?? project.sourceFileCount);
43176
+ const scannedFilesLabel = `${totalFileCount} ${totalFileCount === 1 ? "file" : "files"}`;
43162
43177
  const shouldRunDeadCode = input.runDeadCode && !isDiffMode && (showWarnings || deadCodeMaySurfaceWhenWarningsHidden(resolvedConfig.config));
43163
- const deadCodeCollected = lintFailureState.didFail || !shouldRunDeadCode ? [] : yield* scanProgress.update("Analyzing dead code...").pipe(andThen(runCollect(applyPerElementPipeline(deadCodeService.run({
43178
+ const deadCodeCollected = lintFailureState.didFail || !shouldRunDeadCode ? [] : yield* scanProgress.update(`Scanned ${scannedFilesLabel}, analyzing dead code...`).pipe(andThen(runCollect(applyPerElementPipeline(deadCodeService.run({
43164
43179
  rootDirectory: scanDirectory,
43165
43180
  userConfig: resolvedConfig.config
43166
43181
  }).pipe(catchTag("ReactDoctorError", (error) => unwrap(gen(function* () {
@@ -43173,10 +43188,9 @@ const runInspect = (input, hooks = {}) => gen(function* () {
43173
43188
  const deadCodeFailureState = yield* get$2(deadCodeFailure);
43174
43189
  const scanElapsedMilliseconds = Date.now() - scanStartTime;
43175
43190
  const scanElapsedSeconds = (scanElapsedMilliseconds / 1e3).toFixed(1);
43176
- const totalFileCount = lastReportedTotalFileCount || (lintIncludePaths?.length ?? project.sourceFileCount);
43177
43191
  if (!lintFailureState.didFail) if (deadCodeFailureState.didFail) yield* scanProgress.fail(DEAD_CODE_FAIL_TEXT);
43178
43192
  else if (input.suppressScanSummary) yield* scanProgress.stop();
43179
- else yield* scanProgress.succeed(`Scanned ${totalFileCount} ${totalFileCount === 1 ? "file" : "files"} in ${scanElapsedSeconds}s${workerCountSuffix}`);
43193
+ else yield* scanProgress.succeed(`Scanned ${scannedFilesLabel} in ${scanElapsedSeconds}s${workerCountSuffix}`);
43180
43194
  yield* reporterService.finalize;
43181
43195
  const finalDiagnostics = [
43182
43196
  ...envCollected,
@@ -43958,7 +43972,7 @@ const makeNoopConsole = () => ({
43958
43972
  });
43959
43973
  //#endregion
43960
43974
  //#region src/cli/utils/version.ts
43961
- const VERSION = "0.5.5";
43975
+ const VERSION = "0.5.6-dev.8908f98";
43962
43976
  //#endregion
43963
43977
  //#region src/cli/utils/json-mode.ts
43964
43978
  let context = null;
@@ -44316,13 +44330,13 @@ const isDevVersion = (version) => version === "0.0.0" || version.includes("-");
44316
44330
  * uploads source-map artifacts under, so stack frames symbolicate. Honors the
44317
44331
  * standard `SENTRY_RELEASE` override.
44318
44332
  */
44319
- const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.5.5`;
44333
+ const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.5.6-dev.8908f98`;
44320
44334
  /**
44321
44335
  * Deployment environment shown in Sentry's environment filter. Defaults to
44322
44336
  * `production` for tagged releases and `development` for dev/unbuilt versions,
44323
44337
  * overridable via the standard `SENTRY_ENVIRONMENT` env var.
44324
44338
  */
44325
- const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.5.5") ? "development" : "production");
44339
+ const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.5.6-dev.8908f98") ? "development" : "production");
44326
44340
  /**
44327
44341
  * Performance-tracing sample rate in `[0, 1]`. Reads `SENTRY_TRACES_SAMPLE_RATE`
44328
44342
  * (set to `0` to disable tracing) and falls back to
@@ -53934,4 +53948,4 @@ Promise.resolve().then(() => assertNoRemovedFlags(process.argv)).then(() => prog
53934
53948
  export {};
53935
53949
 
53936
53950
  //# sourceMappingURL=cli.js.map
53937
- //# debugId=06a2a696-2f0a-515a-8c24-d1a9b9898c6e
53951
+ //# debugId=fd7e91f8-8458-50a2-99d9-a1ea8f8bfaff
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]="547655b4-95a2-5599-be6e-d30cf62327d7")}catch(e){}}();
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]="f55d58c3-c6f3-598b-bd99-d0abe85fd35e")}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
- for (const file of collectSecurityScanFiles(rootDirectory)) for (const { entry, scan } of enabledScanRules) for (const finding of scan(file)) {
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;
@@ -39537,6 +39548,8 @@ const resolveConcreteVersion = (spec) => {
39537
39548
  const trimmed = spec.trim();
39538
39549
  if (trimmed.length === 0) return null;
39539
39550
  if (trimmed.includes(":")) return null;
39551
+ const range = import_semver.validRange(trimmed);
39552
+ if (range === null || range === "*") return null;
39540
39553
  return import_semver.minVersion(trimmed)?.version ?? null;
39541
39554
  };
39542
39555
  const locateDependencyKey = (packageJsonText, section, name) => {
@@ -39923,8 +39936,10 @@ const runInspect = (input, hooks = {}) => gen(function* () {
39923
39936
  const lintFailureState = yield* get$2(lintFailure);
39924
39937
  yield* afterLint(lintFailureState.didFail);
39925
39938
  if (lintFailureState.didFail) yield* scanProgress.fail(formatLintFailText(lintFailureState.reasonTag, process.version));
39939
+ const totalFileCount = lastReportedTotalFileCount || (lintIncludePaths?.length ?? project.sourceFileCount);
39940
+ const scannedFilesLabel = `${totalFileCount} ${totalFileCount === 1 ? "file" : "files"}`;
39926
39941
  const shouldRunDeadCode = input.runDeadCode && !isDiffMode && (showWarnings || deadCodeMaySurfaceWhenWarningsHidden(resolvedConfig.config));
39927
- const deadCodeCollected = lintFailureState.didFail || !shouldRunDeadCode ? [] : yield* scanProgress.update("Analyzing dead code...").pipe(andThen(runCollect(applyPerElementPipeline(deadCodeService.run({
39942
+ const deadCodeCollected = lintFailureState.didFail || !shouldRunDeadCode ? [] : yield* scanProgress.update(`Scanned ${scannedFilesLabel}, analyzing dead code...`).pipe(andThen(runCollect(applyPerElementPipeline(deadCodeService.run({
39928
39943
  rootDirectory: scanDirectory,
39929
39944
  userConfig: resolvedConfig.config
39930
39945
  }).pipe(catchTag("ReactDoctorError", (error) => unwrap(gen(function* () {
@@ -39937,10 +39952,9 @@ const runInspect = (input, hooks = {}) => gen(function* () {
39937
39952
  const deadCodeFailureState = yield* get$2(deadCodeFailure);
39938
39953
  const scanElapsedMilliseconds = Date.now() - scanStartTime;
39939
39954
  const scanElapsedSeconds = (scanElapsedMilliseconds / 1e3).toFixed(1);
39940
- const totalFileCount = lastReportedTotalFileCount || (lintIncludePaths?.length ?? project.sourceFileCount);
39941
39955
  if (!lintFailureState.didFail) if (deadCodeFailureState.didFail) yield* scanProgress.fail(DEAD_CODE_FAIL_TEXT);
39942
39956
  else if (input.suppressScanSummary) yield* scanProgress.stop();
39943
- else yield* scanProgress.succeed(`Scanned ${totalFileCount} ${totalFileCount === 1 ? "file" : "files"} in ${scanElapsedSeconds}s${workerCountSuffix}`);
39957
+ else yield* scanProgress.succeed(`Scanned ${scannedFilesLabel} in ${scanElapsedSeconds}s${workerCountSuffix}`);
39944
39958
  yield* reporterService.finalize;
39945
39959
  const finalDiagnostics = [
39946
39960
  ...envCollected,
@@ -40559,4 +40573,4 @@ const toJsonReport = (result, options) => buildJsonReport({
40559
40573
  export { AmbiguousProjectError, NoReactDependencyError, NotADirectoryError, PackageJsonNotFoundError, ProjectNotFoundError, ReactDoctorError, buildJsonReport, buildJsonReportError, clearCaches, defineConfig, diagnose, filterSourceFiles, getDiffInfo, isProjectDiscoveryError, isReactDoctorError, summarizeDiagnostics, toJsonReport };
40560
40574
 
40561
40575
  //# sourceMappingURL=index.js.map
40562
- //# debugId=547655b4-95a2-5599-be6e-d30cf62327d7
40576
+ //# debugId=f55d58c3-c6f3-598b-bd99-d0abe85fd35e
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
- for (const file of collectSecurityScanFiles(rootDirectory)) for (const { entry, scan } of enabledScanRules) for (const finding of scan(file)) {
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;
@@ -39523,6 +39534,8 @@ const resolveConcreteVersion = (spec) => {
39523
39534
  const trimmed = spec.trim();
39524
39535
  if (trimmed.length === 0) return null;
39525
39536
  if (trimmed.includes(":")) return null;
39537
+ const range = import_semver.validRange(trimmed);
39538
+ if (range === null || range === "*") return null;
39526
39539
  return import_semver.minVersion(trimmed)?.version ?? null;
39527
39540
  };
39528
39541
  const locateDependencyKey = (packageJsonText, section, name) => {
@@ -39909,8 +39922,10 @@ const runInspect = (input, hooks = {}) => gen(function* () {
39909
39922
  const lintFailureState = yield* get$2(lintFailure);
39910
39923
  yield* afterLint(lintFailureState.didFail);
39911
39924
  if (lintFailureState.didFail) yield* scanProgress.fail(formatLintFailText(lintFailureState.reasonTag, process.version));
39925
+ const totalFileCount = lastReportedTotalFileCount || (lintIncludePaths?.length ?? project.sourceFileCount);
39926
+ const scannedFilesLabel = `${totalFileCount} ${totalFileCount === 1 ? "file" : "files"}`;
39912
39927
  const shouldRunDeadCode = input.runDeadCode && !isDiffMode && (showWarnings || deadCodeMaySurfaceWhenWarningsHidden(resolvedConfig.config));
39913
- const deadCodeCollected = lintFailureState.didFail || !shouldRunDeadCode ? [] : yield* scanProgress.update("Analyzing dead code...").pipe(andThen(runCollect(applyPerElementPipeline(deadCodeService.run({
39928
+ const deadCodeCollected = lintFailureState.didFail || !shouldRunDeadCode ? [] : yield* scanProgress.update(`Scanned ${scannedFilesLabel}, analyzing dead code...`).pipe(andThen(runCollect(applyPerElementPipeline(deadCodeService.run({
39914
39929
  rootDirectory: scanDirectory,
39915
39930
  userConfig: resolvedConfig.config
39916
39931
  }).pipe(catchTag("ReactDoctorError", (error) => unwrap(gen(function* () {
@@ -39923,10 +39938,9 @@ const runInspect = (input, hooks = {}) => gen(function* () {
39923
39938
  const deadCodeFailureState = yield* get$2(deadCodeFailure);
39924
39939
  const scanElapsedMilliseconds = Date.now() - scanStartTime;
39925
39940
  const scanElapsedSeconds = (scanElapsedMilliseconds / 1e3).toFixed(1);
39926
- const totalFileCount = lastReportedTotalFileCount || (lintIncludePaths?.length ?? project.sourceFileCount);
39927
39941
  if (!lintFailureState.didFail) if (deadCodeFailureState.didFail) yield* scanProgress.fail(DEAD_CODE_FAIL_TEXT);
39928
39942
  else if (input.suppressScanSummary) yield* scanProgress.stop();
39929
- else yield* scanProgress.succeed(`Scanned ${totalFileCount} ${totalFileCount === 1 ? "file" : "files"} in ${scanElapsedSeconds}s${workerCountSuffix}`);
39943
+ else yield* scanProgress.succeed(`Scanned ${scannedFilesLabel} in ${scanElapsedSeconds}s${workerCountSuffix}`);
39930
39944
  yield* reporterService.finalize;
39931
39945
  const finalDiagnostics = [
39932
39946
  ...envCollected,
@@ -40297,7 +40311,7 @@ const computeConfigFingerprint = (projectDirectory, version) => {
40297
40311
  /** Display name used in client-facing messages and progress titles. */
40298
40312
  const SERVER_DISPLAY_NAME = "React Doctor";
40299
40313
  /** Server version reported in `serverInfo`; injected at build, `dev` from source. */
40300
- const SERVER_VERSION = "0.5.5";
40314
+ const SERVER_VERSION = "0.5.6";
40301
40315
  /** `Diagnostic.source` shown next to every published diagnostic. */
40302
40316
  const DIAGNOSTIC_SOURCE = "react-doctor";
40303
40317
  /**
@@ -42344,5 +42358,5 @@ const startLanguageServer = () => {
42344
42358
  };
42345
42359
  //#endregion
42346
42360
  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]="98cc6fbf-9034-527e-835c-0b5664ef94b5")}catch(e){}}();
42348
- //# debugId=98cc6fbf-9034-527e-835c-0b5664ef94b5
42361
+ !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]="8882c2be-9063-5954-a6a3-fc287e8c715f")}catch(e){}}();
42362
+ //# debugId=8882c2be-9063-5954-a6a3-fc287e8c715f
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-doctor",
3
- "version": "0.5.5",
3
+ "version": "0.5.6-dev.8908f98",
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.5"
67
+ "oxlint-plugin-react-doctor": "0.5.6-dev.8908f98"
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/api": "0.5.5",
76
- "@react-doctor/core": "0.5.5",
77
- "@react-doctor/language-server": "0.5.5"
75
+ "@react-doctor/api": "0.5.6",
76
+ "@react-doctor/language-server": "0.5.6",
77
+ "@react-doctor/core": "0.5.6"
78
78
  },
79
79
  "engines": {
80
80
  "node": "^20.19.0 || >=22.13.0"