react-doctor 0.7.1-dev.160f84c → 0.7.1-dev.64452aa

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]="68e9635d-7a10-5469-afd5-edb7df5973ae")}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]="57f4381b-7060-58c6-88a4-95b4c97d3b74")}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";
@@ -41807,7 +41807,7 @@ var Git = class Git extends Service()("react-doctor/Git") {
41807
41807
  })),
41808
41808
  showStagedContent: (directory, relativePath, options) => runCommand({
41809
41809
  command: "git",
41810
- args: ["show", `:${relativePath}`],
41810
+ args: ["show", `:./${relativePath}`],
41811
41811
  directory,
41812
41812
  maxStdoutBytes: options?.maxBufferBytes
41813
41813
  }).pipe(map$3((result) => result.status === 0 ? result.stdout : null)),
@@ -45924,7 +45924,7 @@ const makeNoopConsole = () => ({
45924
45924
  });
45925
45925
  //#endregion
45926
45926
  //#region src/cli/utils/version.ts
45927
- const VERSION = "0.7.1-dev.160f84c";
45927
+ const VERSION = "0.7.1-dev.64452aa";
45928
45928
  //#endregion
45929
45929
  //#region src/cli/utils/json-mode.ts
45930
45930
  let context = null;
@@ -46293,13 +46293,13 @@ const isDevVersion = (version) => version === "0.0.0" || version.includes("-");
46293
46293
  * uploads source-map artifacts under, so stack frames symbolicate. Honors the
46294
46294
  * standard `SENTRY_RELEASE` override.
46295
46295
  */
46296
- const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.7.1-dev.160f84c`;
46296
+ const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.7.1-dev.64452aa`;
46297
46297
  /**
46298
46298
  * Deployment environment shown in Sentry's environment filter. Defaults to
46299
46299
  * `production` for tagged releases and `development` for dev/unbuilt versions,
46300
46300
  * overridable via the standard `SENTRY_ENVIRONMENT` env var.
46301
46301
  */
46302
- const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.7.1-dev.160f84c") ? "development" : "production");
46302
+ const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.7.1-dev.64452aa") ? "development" : "production");
46303
46303
  /**
46304
46304
  * Performance-tracing sample rate in `[0, 1]`. Reads `SENTRY_TRACES_SAMPLE_RATE`
46305
46305
  * (set to `0` to disable tracing) and falls back to
@@ -58499,21 +58499,22 @@ const resolveDotenvFingerprint = (projectDirectory) => {
58499
58499
  return [];
58500
58500
  }
58501
58501
  };
58502
- const hasHiddenTrackedFileState = (projectDirectory) => {
58502
+ const isGitIdentityTrustworthy = (projectDirectory) => {
58503
58503
  const output = runGit(projectDirectory, ["ls-files", "-v"]);
58504
- if (output === null) return true;
58505
- return output.split("\n").some((line) => line.length > 0 && line[0] !== "H");
58504
+ if (output === null) return false;
58505
+ const entryLines = output.split("\n").filter((line) => line.length > 0);
58506
+ return entryLines.length > 0 && entryLines.every((line) => line[0] === "H");
58506
58507
  };
58507
58508
  const resolveCacheFilePath = (projectDirectory) => path.join(resolveReactDoctorCacheDir(projectDirectory), SCAN_RESULT_CACHE_FILENAME);
58508
58509
  const readPersistedCache = (cacheFilePath) => {
58509
58510
  try {
58510
58511
  const parsed = JSON.parse(fs.readFileSync(cacheFilePath, "utf8"));
58511
- if (!isRecord(parsed) || parsed.version !== 3) return {
58512
- version: 3,
58512
+ if (!isRecord(parsed) || parsed.version !== 4) return {
58513
+ version: 4,
58513
58514
  entries: []
58514
58515
  };
58515
58516
  if (!Array.isArray(parsed.entries)) return {
58516
- version: 3,
58517
+ version: 4,
58517
58518
  entries: []
58518
58519
  };
58519
58520
  const entries = [];
@@ -58523,12 +58524,12 @@ const readPersistedCache = (cacheFilePath) => {
58523
58524
  entries.push(entry);
58524
58525
  }
58525
58526
  return {
58526
- version: 3,
58527
+ version: 4,
58527
58528
  entries
58528
58529
  };
58529
58530
  } catch {
58530
58531
  return {
58531
- version: 3,
58532
+ version: 4,
58532
58533
  entries: []
58533
58534
  };
58534
58535
  }
@@ -58560,6 +58561,7 @@ const resolveProjectIdentity = (projectDirectory) => {
58560
58561
  return path.resolve(projectDirectory);
58561
58562
  }
58562
58563
  };
58564
+ const resolveManifestContentHash = (projectDirectory) => hashFileContents(getPackageJsonPath(projectDirectory));
58563
58565
  const fileFingerprint = (filePath) => {
58564
58566
  try {
58565
58567
  const stat = fs.statSync(filePath);
@@ -58582,14 +58584,14 @@ const resolveToolchainFingerprint = (nodeBinaryPath) => {
58582
58584
  };
58583
58585
  const buildScanResultCacheKey = (input) => {
58584
58586
  if (isCacheGloballyDisabled()) return null;
58585
- if (hasHiddenTrackedFileState(input.projectDirectory)) return null;
58587
+ if (!isGitIdentityTrustworthy(input.projectDirectory)) return null;
58586
58588
  const worktreeFingerprint = buildWorktreeFingerprint(input.projectDirectory);
58587
58589
  if (worktreeFingerprint === null) return null;
58588
58590
  const headSha = readHeadSha(input.projectDirectory);
58589
58591
  if (headSha === null) return null;
58590
58592
  if (stringifyStableJson(input.userConfig) === null) return null;
58591
58593
  const cacheKeyJson = stringifyStableJson({
58592
- schemaVersion: 3,
58594
+ schemaVersion: 4,
58593
58595
  projectIdentity: resolveProjectIdentity(input.projectDirectory),
58594
58596
  headSha,
58595
58597
  worktreeFingerprint,
@@ -58629,17 +58631,24 @@ const createScanResultCache = (projectDirectory) => {
58629
58631
  for (const entry of persistedCache.entries) entries.set(entry.key, entry);
58630
58632
  const persist = () => {
58631
58633
  writePersistedCache(cacheFilePath, {
58632
- version: 3,
58634
+ version: 4,
58633
58635
  entries: [...entries.values()].sort((firstEntry, secondEntry) => secondEntry.createdAtMs - firstEntry.createdAtMs).slice(0, 20)
58634
58636
  });
58635
58637
  };
58636
58638
  return {
58637
- lookup: (key) => entries.get(key)?.payload ?? null,
58639
+ lookup: (key) => {
58640
+ const payload = entries.get(key)?.payload;
58641
+ if (payload === void 0) return null;
58642
+ return resolveProjectIdentity(payload.directory) === resolveProjectIdentity(projectDirectory) && (payload.manifestContentHash ?? null) === resolveManifestContentHash(projectDirectory) ? payload : null;
58643
+ },
58638
58644
  store: (key, payload) => {
58639
58645
  entries.set(key, {
58640
58646
  key,
58641
58647
  createdAtMs: Date.now(),
58642
- payload
58648
+ payload: {
58649
+ ...payload,
58650
+ manifestContentHash: resolveManifestContentHash(projectDirectory)
58651
+ }
58643
58652
  });
58644
58653
  persist();
58645
58654
  }
@@ -64454,4 +64463,4 @@ Promise.resolve().then(() => assertNoRemovedFlags(process.argv)).then(() => prog
64454
64463
  export {};
64455
64464
 
64456
64465
  //# sourceMappingURL=cli.js.map
64457
- //# debugId=68e9635d-7a10-5469-afd5-edb7df5973ae
64466
+ //# debugId=57f4381b-7060-58c6-88a4-95b4c97d3b74
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]="7cb857ba-6f0a-57d9-91f3-3c286472121d")}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]="f1919957-a013-5ded-b0ed-3d2e8469d0e2")}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";
@@ -38564,7 +38564,7 @@ var Git = class Git extends Service()("react-doctor/Git") {
38564
38564
  })),
38565
38565
  showStagedContent: (directory, relativePath, options) => runCommand({
38566
38566
  command: "git",
38567
- args: ["show", `:${relativePath}`],
38567
+ args: ["show", `:./${relativePath}`],
38568
38568
  directory,
38569
38569
  maxStdoutBytes: options?.maxBufferBytes
38570
38570
  }).pipe(map$3((result) => result.status === 0 ? result.stdout : null)),
@@ -42441,4 +42441,4 @@ const toJsonReport = (result, options) => buildJsonReport({
42441
42441
  export { AmbiguousProjectError, NoReactDependencyError, NotADirectoryError, PackageJsonNotFoundError, ProjectNotFoundError, ReactDoctorError, buildJsonReport, buildJsonReportError, clearCaches, defineConfig, diagnose, filterSourceFiles, getDiffInfo, hasReactRuntime, isProjectDiscoveryError, isReactDoctorError, summarizeDiagnostics, toJsonReport };
42442
42442
 
42443
42443
  //# sourceMappingURL=index.js.map
42444
- //# debugId=7cb857ba-6f0a-57d9-91f3-3c286472121d
42444
+ //# debugId=f1919957-a013-5ded-b0ed-3d2e8469d0e2
package/dist/lsp.js CHANGED
@@ -38549,7 +38549,7 @@ var Git = class Git extends Service()("react-doctor/Git") {
38549
38549
  })),
38550
38550
  showStagedContent: (directory, relativePath, options) => runCommand({
38551
38551
  command: "git",
38552
- args: ["show", `:${relativePath}`],
38552
+ args: ["show", `:./${relativePath}`],
38553
38553
  directory,
38554
38554
  maxStdoutBytes: options?.maxBufferBytes
38555
38555
  }).pipe(map$3((result) => result.status === 0 ? result.stdout : null)),
@@ -44160,5 +44160,5 @@ const startLanguageServer = () => {
44160
44160
  };
44161
44161
  //#endregion
44162
44162
  export { startLanguageServer };
44163
- !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]="027c66d6-b30a-59de-ad83-58f5ad304c94")}catch(e){}}();
44164
- //# debugId=027c66d6-b30a-59de-ad83-58f5ad304c94
44163
+ !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]="0cab34bf-65ac-5994-9a93-41f1b5670387")}catch(e){}}();
44164
+ //# debugId=0cab34bf-65ac-5994-9a93-41f1b5670387
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-doctor",
3
- "version": "0.7.1-dev.160f84c",
3
+ "version": "0.7.1-dev.64452aa",
4
4
  "description": "Your agent writes bad React. This catches it",
5
5
  "keywords": [
6
6
  "accessibility",
@@ -66,7 +66,7 @@
66
66
  "vscode-uri": "^3.1.0",
67
67
  "yaml": "^2.9.0",
68
68
  "deslop-js": "0.7.1",
69
- "oxlint-plugin-react-doctor": "0.7.1-dev.160f84c"
69
+ "oxlint-plugin-react-doctor": "0.7.1-dev.64452aa"
70
70
  },
71
71
  "devDependencies": {
72
72
  "@types/babel__code-frame": "^7.27.0",