Commit Graph

14 Commits

Author SHA1 Message Date
Aiden Bai 8c2f03aea9 feat: make React cleanup first-class (#1624)
* feat: make React cleanup first-class

* refactor: remove editor integrations

* fix: harden React cleanup analysis

* fix: detect default export duplication roots

* fix: unwrap typed duplication roots

* feat: add opt-in project analysis rules

* fix: canonicalize project analysis paths

* fix: harden project analysis precision

* fix: recognize cross-platform project entries

* fix: eliminate project analysis false positives

* fix: harden project analysis reachability

* fix: canonicalize project analysis inputs

* fix: resolve project analysis review findings

* fix: eliminate residual project analysis false positives

* fix: ignore commented registry previews

* fix: eliminate project analysis false positives

* fix: normalize project analysis paths across platforms

* fix: normalize Nextra theme path identity

* test: canonicalize convention fixture paths

* fix: preserve project analysis provenance

* fix: harden project analysis precision

* fix: honor project analysis boundaries

* fix: recognize conditional config plugins

* fix: recognize executable project references

* fix: recognize Stencil tool contracts

* fix: recognize nested tool references

* fix: recognize project setup contracts

* fix: recognize generated and local package consumers

* fix: recognize static template package references

* fix: recognize nested package runtime contracts

* fix: close project analysis parser gaps

* fix: parse project conventions structurally

* refactor: replace structural scanners with parsers

* fix: recognize functional Next CSS config

* fix: close remaining project analysis gaps

* fix: apply tag filters to project analysis

* fix: preserve embedded source positions

* fix: validate static config helper bindings

* fix: bound runtime directory discovery

* fix: close final dependency analysis gaps

* fix: preserve declaration dependency references

* chore: refresh generated rule metadata

* fix: make project analysis portable and bounded

* test: stabilize cleanup scaling guard

* refactor: parse project syntax with oxc

* fix: normalize native filesystem paths

* fix: separate path identity from report paths

* fix: match project files by filesystem identity

* fix: match build glob files by package identity

* fix: use native path keys for file identity

* fix: canonicalize Windows file identities

* fix: canonicalize package ownership paths

* test: inspect Windows path identities

* test: trace Windows package ownership

* fix: keep Windows path identities consistent

* fix: classify test contracts by normalized path

* fix: scope test contracts by canonical package path

* fix: keep test package graphs conservative

* test: keep React complexity advisory
2026-08-13 16:26:08 -07:00
Aiden Bai a2b460d4ae test: stabilize CI timing guards (#1645) 2026-08-13 05:38:07 -07:00
Aiden Bai c50e3bdbe3 fix(core): keep react detection React-specific 2026-08-13 05:02:35 +00:00
Aiden Bai acdcb236b9 fix(core): report supported library projects 2026-08-13 04:36:17 +00:00
Aiden Bai 51e198db8b perf: reuse source inventories across project scans (#1617)
* perf: reuse source inventories across project scans

* chore: upgrade Oxc toolchain

* fix: fall back for empty shared inventories
2026-08-09 01:42:22 -07:00
cursor[bot] 0eb5293c1d Fix API lint opt-out and deslop traversal cleanup (#1085)
Co-authored-by: Aiden Bai <aidenybai@users.noreply.github.com>
2026-07-08 18:57:17 -07:00
devin-ai-integration[bot] 6b21b70d1a feat(core): surface reactDetected so a gated-off scan can't pass for clean (#1062)
Co-authored-by: Aiden Bai <aiden.bai05@gmail.com>
2026-07-04 01:42:13 -07:00
devin-ai-integration[bot] d48e7f1695 feat: per-module scoring via diagnose({ projects }), CLI --project paths, and config projects (#771)
Co-authored-by: Aiden Bai <aiden.bai05@gmail.com>
Co-authored-by: Rayhan Noufal Arayilakath <me@rayhanadev.com>
2026-06-11 21:55:48 -07:00
Aiden Bai cbdff6203d feat(cli): "Add to CI" handoff option + default CI setup in install (#658)
Co-authored-by: Aiden Bai <aiden.bai05@gmail.com>
Co-authored-by: Nisarg Patel <awesomenisarg@gmail.com>
2026-06-04 04:15:05 -07:00
Aiden Bai 07b8a6c3e0 fix: cross-platform spawn errors (#498, #501) and add Windows/macOS CI (#502) 2026-05-26 18:19:41 -07:00
Aiden Bai e332310146 refactor(api): rename diagnoseModules → diagnoseProjects, clean up API shape
- Single object arg (`DiagnoseProjectsInput`) instead of two positional args
- "Projects" vocabulary matching the rest of the codebase
- Per-project scan options (`deadCode`, `lint`, etc.) flat on the entry
  instead of nested in `config.deadCode`
- `config` on a project entry means `ReactDoctorConfig` directly
- Discriminated union `ProjectResult` (`ok: true | false`) instead of
  separate `modules` + `errors` arrays
2026-05-26 16:23:04 -07:00
Aiden Bai a7b72e19a1 feat(api): add diagnoseModules() for native per-module scoring (#499) 2026-05-26 16:13:03 -07:00
Cursor Agent f5e10af405 test: move fixtures/ + 7 fixture-dependent core tests to core/tests
Completes P4 of the cleanup plan.

The fixtures/ directory (basic-react, monorepo-with-root-react,
nextjs-app, pnpm-catalog-workspace, ..., 14 project shapes + the
.oxlintignore stub) move to packages/core/tests/fixtures/, its
canonical home — project-shape fixtures are core's territory under
AGENTS.md, and the previous packages/react-doctor/tests/fixtures/
location forced packages/api/tests/diagnose.test.ts to reach
across packages with '../../react-doctor/tests/fixtures'.

Seven more core-internal tests move to packages/core/tests/:

- discover-project.test.ts (1092 lines — biggest remaining
  architectural-drift test file)
- find-monorepo-root.test.ts
- read-ignore-file.test.ts
- can-oxlint-extend-config.test.ts
- check-dead-code.test.ts
- merge-and-filter-diagnostics.test.ts (inlined the 5-line writeFile
  + buildDiagnostic helpers from regressions/_helpers.ts to avoid
  coupling core tests to the regressions harness)

Consumers that stay in react-doctor/tests/ (CLI / end-to-end /
regression-style tests) update their FIXTURES_DIRECTORY constant
to point at the new core/tests/fixtures location:

- packages/api/tests/diagnose.test.ts
- packages/react-doctor/tests/inspect.test.ts
- packages/react-doctor/tests/inspect-surface-filter.test.ts (this
  tests the CLI inspect() wrapper, not the core orchestrator, so
  it stays in react-doctor/tests/)
- packages/react-doctor/tests/namespace-hooks.test.ts
- packages/react-doctor/tests/regressions/rn-package-scoping.test.ts
- packages/react-doctor/tests/run-oxlint/_helpers.ts

After this final batch:
- 21 core-internal test files have moved from react-doctor/tests/
  to packages/core/tests/ (was 14 in the previous batches).
- Core has 346 tests across 35 files (was 247 / 29).
- react-doctor has 1317 tests across 103 files.
- Total tests unchanged (1670).

Co-authored-by: Aiden Bai <aidenybai@users.noreply.github.com>
2026-05-25 12:27:01 +00:00
Aiden Bai a3539c9afb feat(api): new @react-doctor/api package — diagnose() backed by runInspect (#414)
Standing up packages/api/ as the home of the programmatic public
API. Moves diagnose() into it as a thin Effect.runPromise shell
around #412's runInspect orchestrator, with tagged-error translation
back to legacy thrown classes (NoReactDependencyError /
ProjectNotFoundError / AmbiguousProjectError) for backwards compat.

inspect() stays in react-doctor/src/ for now (CLI rendering coupled
in). PR 6 (cli package) moves it.

## Files

- packages/api/ (private workspace package)
  - src/diagnose.ts: pre-resolves rootDir redirect + resolveDiagnoseTarget,
    then runInspect, translates tagged failures, returns DiagnoseResult.
  - src/index.ts: re-exports diagnose + public types + legacy errors.
  - tests/diagnose.test.ts: 4 tests — happy path, NoReactDependency,
    ProjectNotFound, elapsedMilliseconds positive.
- packages/react-doctor/src/index.ts: deletes ~120-line local diagnose,
  re-exports from @react-doctor/api.
- packages/core/src/run-inspect.ts: rejects projects without React via
  tagged NoReactDependency (used to happen in the legacy diagnose).

## Validation

- pnpm typecheck (12/12)
- pnpm test — 123 files / 1485 pass / 3 skipped
- pnpm lint, format:check, build, smoke:json-report — all green

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-22 16:42:52 -07:00