react-doctor 0.5.5-dev.ea3b827 → 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 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]="e03b6154-4b3f-5b73-9f74-118d3b39e6b0")}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]="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";
@@ -39986,12 +39986,11 @@ const collectKnipPatterns = (rootDirectory, settingName) => {
39986
39986
  if (!config) return [];
39987
39987
  return [...normalizePatternList(config[settingName]), ...collectKnipWorkspacePatterns(config.workspaces, settingName)];
39988
39988
  };
39989
- const collectDeadCodeIgnorePatterns = (rootDirectory, userConfig) => {
39989
+ const collectDeadCodeIgnorePatterns = (rootDirectory) => {
39990
39990
  const seen = /* @__PURE__ */ new Set();
39991
39991
  const sources = [
39992
39992
  readIgnoreFile(path.join(rootDirectory, ".gitignore")),
39993
39993
  collectIgnorePatterns(rootDirectory),
39994
- userConfig?.ignore?.files ?? [],
39995
39994
  collectKnipPatterns(rootDirectory, "ignore")
39996
39995
  ];
39997
39996
  for (const source of sources) for (const pattern of source) seen.add(pattern);
@@ -40269,11 +40268,10 @@ const runDeadCodeWorkerWithTimeout = (handle, timeoutMs) => new Promise((resolve
40269
40268
  });
40270
40269
  });
40271
40270
  const checkDeadCode = async (options) => {
40272
- const { userConfig } = options;
40273
40271
  const rootDirectory = toCanonicalPath(options.rootDirectory);
40274
40272
  if (!NFS.existsSync(Path.join(rootDirectory, "package.json"))) return [];
40275
40273
  const entryPatterns = collectDeadCodeEntryPatterns(rootDirectory);
40276
- const ignorePatterns = collectDeadCodeIgnorePatterns(rootDirectory, userConfig);
40274
+ const ignorePatterns = collectDeadCodeIgnorePatterns(rootDirectory);
40277
40275
  const result = parseDeadCodeWorkerResult(await runDeadCodeWorkerWithTimeout((options.createWorker ?? createDeadCodeWorker)({
40278
40276
  rootDirectory,
40279
40277
  entryPatterns,
@@ -43172,8 +43170,10 @@ const runInspect = (input, hooks = {}) => gen(function* () {
43172
43170
  const lintFailureState = yield* get$2(lintFailure);
43173
43171
  yield* afterLint(lintFailureState.didFail);
43174
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"}`;
43175
43175
  const shouldRunDeadCode = input.runDeadCode && !isDiffMode && (showWarnings || deadCodeMaySurfaceWhenWarningsHidden(resolvedConfig.config));
43176
- const deadCodeCollected = lintFailureState.didFail || !shouldRunDeadCode ? [] : yield* scanProgress.update("Analyzing dead code...").pipe(andThen(runCollect(applyPerElementPipeline(deadCodeService.run({
43176
+ const deadCodeCollected = lintFailureState.didFail || !shouldRunDeadCode ? [] : yield* scanProgress.update(`Scanned ${scannedFilesLabel}, analyzing dead code...`).pipe(andThen(runCollect(applyPerElementPipeline(deadCodeService.run({
43177
43177
  rootDirectory: scanDirectory,
43178
43178
  userConfig: resolvedConfig.config
43179
43179
  }).pipe(catchTag("ReactDoctorError", (error) => unwrap(gen(function* () {
@@ -43186,10 +43186,9 @@ const runInspect = (input, hooks = {}) => gen(function* () {
43186
43186
  const deadCodeFailureState = yield* get$2(deadCodeFailure);
43187
43187
  const scanElapsedMilliseconds = Date.now() - scanStartTime;
43188
43188
  const scanElapsedSeconds = (scanElapsedMilliseconds / 1e3).toFixed(1);
43189
- const totalFileCount = lastReportedTotalFileCount || (lintIncludePaths?.length ?? project.sourceFileCount);
43190
43189
  if (!lintFailureState.didFail) if (deadCodeFailureState.didFail) yield* scanProgress.fail(DEAD_CODE_FAIL_TEXT);
43191
43190
  else if (input.suppressScanSummary) yield* scanProgress.stop();
43192
- else yield* scanProgress.succeed(`Scanned ${totalFileCount} ${totalFileCount === 1 ? "file" : "files"} in ${scanElapsedSeconds}s${workerCountSuffix}`);
43191
+ else yield* scanProgress.succeed(`Scanned ${scannedFilesLabel} in ${scanElapsedSeconds}s${workerCountSuffix}`);
43193
43192
  yield* reporterService.finalize;
43194
43193
  const finalDiagnostics = [
43195
43194
  ...envCollected,
@@ -43971,7 +43970,7 @@ const makeNoopConsole = () => ({
43971
43970
  });
43972
43971
  //#endregion
43973
43972
  //#region src/cli/utils/version.ts
43974
- const VERSION = "0.5.5-dev.ea3b827";
43973
+ const VERSION = "0.5.6-dev.03301fc";
43975
43974
  //#endregion
43976
43975
  //#region src/cli/utils/json-mode.ts
43977
43976
  let context = null;
@@ -44329,13 +44328,13 @@ const isDevVersion = (version) => version === "0.0.0" || version.includes("-");
44329
44328
  * uploads source-map artifacts under, so stack frames symbolicate. Honors the
44330
44329
  * standard `SENTRY_RELEASE` override.
44331
44330
  */
44332
- const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.5.5-dev.ea3b827`;
44331
+ const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.5.6-dev.03301fc`;
44333
44332
  /**
44334
44333
  * Deployment environment shown in Sentry's environment filter. Defaults to
44335
44334
  * `production` for tagged releases and `development` for dev/unbuilt versions,
44336
44335
  * overridable via the standard `SENTRY_ENVIRONMENT` env var.
44337
44336
  */
44338
- const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.5.5-dev.ea3b827") ? "development" : "production");
44337
+ const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.5.6-dev.03301fc") ? "development" : "production");
44339
44338
  /**
44340
44339
  * Performance-tracing sample rate in `[0, 1]`. Reads `SENTRY_TRACES_SAMPLE_RATE`
44341
44340
  * (set to `0` to disable tracing) and falls back to
@@ -53947,4 +53946,4 @@ Promise.resolve().then(() => assertNoRemovedFlags(process.argv)).then(() => prog
53947
53946
  export {};
53948
53947
 
53949
53948
  //# sourceMappingURL=cli.js.map
53950
- //# debugId=e03b6154-4b3f-5b73-9f74-118d3b39e6b0
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
- * Use this to teach react-doctor about custom auth guards in
9284
- * codebases that wrap their auth library — e.g. a project-local
9285
- * `requireWorkspaceMember` or `ensureSignedIn`.
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]="0b246e36-6877-5145-9560-a392af70ee30")}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]="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";
@@ -36750,12 +36750,11 @@ const collectKnipPatterns = (rootDirectory, settingName) => {
36750
36750
  if (!config) return [];
36751
36751
  return [...normalizePatternList(config[settingName]), ...collectKnipWorkspacePatterns(config.workspaces, settingName)];
36752
36752
  };
36753
- const collectDeadCodeIgnorePatterns = (rootDirectory, userConfig) => {
36753
+ const collectDeadCodeIgnorePatterns = (rootDirectory) => {
36754
36754
  const seen = /* @__PURE__ */ new Set();
36755
36755
  const sources = [
36756
36756
  readIgnoreFile(path.join(rootDirectory, ".gitignore")),
36757
36757
  collectIgnorePatterns(rootDirectory),
36758
- userConfig?.ignore?.files ?? [],
36759
36758
  collectKnipPatterns(rootDirectory, "ignore")
36760
36759
  ];
36761
36760
  for (const source of sources) for (const pattern of source) seen.add(pattern);
@@ -37033,11 +37032,10 @@ const runDeadCodeWorkerWithTimeout = (handle, timeoutMs) => new Promise((resolve
37033
37032
  });
37034
37033
  });
37035
37034
  const checkDeadCode = async (options) => {
37036
- const { userConfig } = options;
37037
37035
  const rootDirectory = toCanonicalPath(options.rootDirectory);
37038
37036
  if (!NFS.existsSync(Path.join(rootDirectory, "package.json"))) return [];
37039
37037
  const entryPatterns = collectDeadCodeEntryPatterns(rootDirectory);
37040
- const ignorePatterns = collectDeadCodeIgnorePatterns(rootDirectory, userConfig);
37038
+ const ignorePatterns = collectDeadCodeIgnorePatterns(rootDirectory);
37041
37039
  const result = parseDeadCodeWorkerResult(await runDeadCodeWorkerWithTimeout((options.createWorker ?? createDeadCodeWorker)({
37042
37040
  rootDirectory,
37043
37041
  entryPatterns,
@@ -39936,8 +39934,10 @@ const runInspect = (input, hooks = {}) => gen(function* () {
39936
39934
  const lintFailureState = yield* get$2(lintFailure);
39937
39935
  yield* afterLint(lintFailureState.didFail);
39938
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"}`;
39939
39939
  const shouldRunDeadCode = input.runDeadCode && !isDiffMode && (showWarnings || deadCodeMaySurfaceWhenWarningsHidden(resolvedConfig.config));
39940
- const deadCodeCollected = lintFailureState.didFail || !shouldRunDeadCode ? [] : yield* scanProgress.update("Analyzing dead code...").pipe(andThen(runCollect(applyPerElementPipeline(deadCodeService.run({
39940
+ const deadCodeCollected = lintFailureState.didFail || !shouldRunDeadCode ? [] : yield* scanProgress.update(`Scanned ${scannedFilesLabel}, analyzing dead code...`).pipe(andThen(runCollect(applyPerElementPipeline(deadCodeService.run({
39941
39941
  rootDirectory: scanDirectory,
39942
39942
  userConfig: resolvedConfig.config
39943
39943
  }).pipe(catchTag("ReactDoctorError", (error) => unwrap(gen(function* () {
@@ -39950,10 +39950,9 @@ const runInspect = (input, hooks = {}) => gen(function* () {
39950
39950
  const deadCodeFailureState = yield* get$2(deadCodeFailure);
39951
39951
  const scanElapsedMilliseconds = Date.now() - scanStartTime;
39952
39952
  const scanElapsedSeconds = (scanElapsedMilliseconds / 1e3).toFixed(1);
39953
- const totalFileCount = lastReportedTotalFileCount || (lintIncludePaths?.length ?? project.sourceFileCount);
39954
39953
  if (!lintFailureState.didFail) if (deadCodeFailureState.didFail) yield* scanProgress.fail(DEAD_CODE_FAIL_TEXT);
39955
39954
  else if (input.suppressScanSummary) yield* scanProgress.stop();
39956
- else yield* scanProgress.succeed(`Scanned ${totalFileCount} ${totalFileCount === 1 ? "file" : "files"} in ${scanElapsedSeconds}s${workerCountSuffix}`);
39955
+ else yield* scanProgress.succeed(`Scanned ${scannedFilesLabel} in ${scanElapsedSeconds}s${workerCountSuffix}`);
39957
39956
  yield* reporterService.finalize;
39958
39957
  const finalDiagnostics = [
39959
39958
  ...envCollected,
@@ -40572,4 +40571,4 @@ const toJsonReport = (result, options) => buildJsonReport({
40572
40571
  export { AmbiguousProjectError, NoReactDependencyError, NotADirectoryError, PackageJsonNotFoundError, ProjectNotFoundError, ReactDoctorError, buildJsonReport, buildJsonReportError, clearCaches, defineConfig, diagnose, filterSourceFiles, getDiffInfo, isProjectDiscoveryError, isReactDoctorError, summarizeDiagnostics, toJsonReport };
40573
40572
 
40574
40573
  //# sourceMappingURL=index.js.map
40575
- //# debugId=0b246e36-6877-5145-9560-a392af70ee30
40574
+ //# debugId=a4394ddc-4e6c-5a18-aeeb-d60322b1c0dd
package/dist/lsp.js CHANGED
@@ -36736,12 +36736,11 @@ const collectKnipPatterns = (rootDirectory, settingName) => {
36736
36736
  if (!config) return [];
36737
36737
  return [...normalizePatternList(config[settingName]), ...collectKnipWorkspacePatterns(config.workspaces, settingName)];
36738
36738
  };
36739
- const collectDeadCodeIgnorePatterns = (rootDirectory, userConfig) => {
36739
+ const collectDeadCodeIgnorePatterns = (rootDirectory) => {
36740
36740
  const seen = /* @__PURE__ */ new Set();
36741
36741
  const sources = [
36742
36742
  readIgnoreFile(path.join(rootDirectory, ".gitignore")),
36743
36743
  collectIgnorePatterns(rootDirectory),
36744
- userConfig?.ignore?.files ?? [],
36745
36744
  collectKnipPatterns(rootDirectory, "ignore")
36746
36745
  ];
36747
36746
  for (const source of sources) for (const pattern of source) seen.add(pattern);
@@ -37019,11 +37018,10 @@ const runDeadCodeWorkerWithTimeout = (handle, timeoutMs) => new Promise((resolve
37019
37018
  });
37020
37019
  });
37021
37020
  const checkDeadCode = async (options) => {
37022
- const { userConfig } = options;
37023
37021
  const rootDirectory = toCanonicalPath(options.rootDirectory);
37024
37022
  if (!NFS.existsSync(Path.join(rootDirectory, "package.json"))) return [];
37025
37023
  const entryPatterns = collectDeadCodeEntryPatterns(rootDirectory);
37026
- const ignorePatterns = collectDeadCodeIgnorePatterns(rootDirectory, userConfig);
37024
+ const ignorePatterns = collectDeadCodeIgnorePatterns(rootDirectory);
37027
37025
  const result = parseDeadCodeWorkerResult(await runDeadCodeWorkerWithTimeout((options.createWorker ?? createDeadCodeWorker)({
37028
37026
  rootDirectory,
37029
37027
  entryPatterns,
@@ -39922,8 +39920,10 @@ const runInspect = (input, hooks = {}) => gen(function* () {
39922
39920
  const lintFailureState = yield* get$2(lintFailure);
39923
39921
  yield* afterLint(lintFailureState.didFail);
39924
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"}`;
39925
39925
  const shouldRunDeadCode = input.runDeadCode && !isDiffMode && (showWarnings || deadCodeMaySurfaceWhenWarningsHidden(resolvedConfig.config));
39926
- const deadCodeCollected = lintFailureState.didFail || !shouldRunDeadCode ? [] : yield* scanProgress.update("Analyzing dead code...").pipe(andThen(runCollect(applyPerElementPipeline(deadCodeService.run({
39926
+ const deadCodeCollected = lintFailureState.didFail || !shouldRunDeadCode ? [] : yield* scanProgress.update(`Scanned ${scannedFilesLabel}, analyzing dead code...`).pipe(andThen(runCollect(applyPerElementPipeline(deadCodeService.run({
39927
39927
  rootDirectory: scanDirectory,
39928
39928
  userConfig: resolvedConfig.config
39929
39929
  }).pipe(catchTag("ReactDoctorError", (error) => unwrap(gen(function* () {
@@ -39936,10 +39936,9 @@ const runInspect = (input, hooks = {}) => gen(function* () {
39936
39936
  const deadCodeFailureState = yield* get$2(deadCodeFailure);
39937
39937
  const scanElapsedMilliseconds = Date.now() - scanStartTime;
39938
39938
  const scanElapsedSeconds = (scanElapsedMilliseconds / 1e3).toFixed(1);
39939
- const totalFileCount = lastReportedTotalFileCount || (lintIncludePaths?.length ?? project.sourceFileCount);
39940
39939
  if (!lintFailureState.didFail) if (deadCodeFailureState.didFail) yield* scanProgress.fail(DEAD_CODE_FAIL_TEXT);
39941
39940
  else if (input.suppressScanSummary) yield* scanProgress.stop();
39942
- else yield* scanProgress.succeed(`Scanned ${totalFileCount} ${totalFileCount === 1 ? "file" : "files"} in ${scanElapsedSeconds}s${workerCountSuffix}`);
39941
+ else yield* scanProgress.succeed(`Scanned ${scannedFilesLabel} in ${scanElapsedSeconds}s${workerCountSuffix}`);
39943
39942
  yield* reporterService.finalize;
39944
39943
  const finalDiagnostics = [
39945
39944
  ...envCollected,
@@ -40310,7 +40309,7 @@ const computeConfigFingerprint = (projectDirectory, version) => {
40310
40309
  /** Display name used in client-facing messages and progress titles. */
40311
40310
  const SERVER_DISPLAY_NAME = "React Doctor";
40312
40311
  /** Server version reported in `serverInfo`; injected at build, `dev` from source. */
40313
- const SERVER_VERSION = "0.5.5";
40312
+ const SERVER_VERSION = "0.5.6";
40314
40313
  /** `Diagnostic.source` shown next to every published diagnostic. */
40315
40314
  const DIAGNOSTIC_SOURCE = "react-doctor";
40316
40315
  /**
@@ -42357,5 +42356,5 @@ const startLanguageServer = () => {
42357
42356
  };
42358
42357
  //#endregion
42359
42358
  export { startLanguageServer };
42360
- !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]="6648983d-3832-5f00-93a7-24daacde01bb")}catch(e){}}();
42361
- //# debugId=6648983d-3832-5f00-93a7-24daacde01bb
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.5-dev.ea3b827",
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.5-dev.ea3b827"
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/language-server": "0.5.5",
76
- "@react-doctor/api": "0.5.5",
77
- "@react-doctor/core": "0.5.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"