Repository navigation
chore: modernize toolchain to vite-plus + turbo and prune dead code - #436
Merged
Merged
Conversation
Adopts the react-grab toolchain stack (Vite+ for lint/fmt/check, turbo
for pipeline orchestration, pnpm 10, fallow for dead-code analysis) and
removes 22 verified-dead files plus 8 unused dependencies that fallow
surfaced.
Toolchain:
- pnpm 10 with overrides redirecting vite -> @voidzero-dev/vite-plus-core
and vitest -> @voidzero-dev/vite-plus-test, plus onlyBuiltDependencies
- turbo orchestrates build/dev/test/typecheck with proper ^build deps
- vite-plus replaces oxlint/postcss-cli at the root via vite.config.ts
- fallow wired in as `pnpm deadcode` with .fallowrc.jsonc declaring
manifest entries, esbuild-read worker, postcss config, and vitest tests
as roots
- packages/vite-plugin-react-scan migrated from raw tsc to `vp pack`
(tsdown) with proper ESM/CJS + .d.ts output
Cruft removed:
- scripts/ (workspace.mjs, version-warning.mjs, bump-version.js,
build-worker.ts) -> turbo + changesets handle this now
- bin/ (serve-scan.sh, generate-certs.sh) -> never wired up
- BROWSER_EXTENSION_GUIDE.md (duplicate of packages/extension/README.md)
- test-results/, .oxlintrc.json (root + website)
Dead source files (fallow-verified):
- packages/scan/src: worker-shim.ts, types.d.ts, monitoring/,
web/views/settings/, web/views/inspector/{properties.tsx,
timeline/index.tsx, logging.ts}, web/components/{slider,
sticky-section}, web/hooks/use-merged-refs.ts, web/utils/geiger.ts,
3 babel helpers in react-component-name/babel/
- packages/website: app/react-scan.ts, components/{cli, code, counter,
footer, test-data-types, todo-demo}.tsx
Dead deps removed (fallow-confirmed):
- scan: @babel/generator, estree-walker, @types/node (dup),
react-router, react-router-dom
- vite-plugin-react-scan: @babel/plugin-transform-react-jsx,
@babel/preset-typescript
- extension: bestzip
- website: postcss-load-config added (was unlisted)
- Kept react-doctor + react-grab per request; ignored via fallow config
Docs:
- AGENTS.md rewritten with react-grab structure and a tailored
Preact + @preact/signals section
- CONTRIBUTING.md updated to reference Vite+/oxlint/oxfmt instead of the
stale Biome mention
Incidental fixes for the new tsconfig:
- Added `import type { JSX } from 'preact'` in copy-to-clipboard and
collapsed-event so bare JSX.Element types resolve under bundler
resolution
- Removed dead cheerio.Element annotation in vite-plugin-react-scan
- packages/vite-plugin-react-scan/tsconfig now extends the root with
module: ESNext / moduleResolution: bundler
- Added *.css?inline ambient declaration in extension's vite-env.d.ts
Punted to follow-up PRs (visible via `pnpm deadcode`):
- 95 unused exports + 10 unused type exports
- 4 duplicate exports
- 20 circular dependencies
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
P0 — runtime breakages: - Restore @babel/preset-typescript + @babel/plugin-transform-react-jsx as runtime dependencies of vite-plugin-react-scan; they are loaded by string name inside @babel/core's transformAsync call. Add to fallow's ignoreDependencies so the static analyzer stops flagging them. - Switch packages/vite-plugin-react-scan vp pack config to fixedExtension: false so ESM output is dist/index.js (matches the package.json `module`/`exports.import.default` paths). Without this, ESM consumers would hit ERR_MODULE_NOT_FOUND. P1 — broken dev workflows: - Fix `pnpm test` for scan: switch script to `vp test run` (the vitest pnpm override target has no `bin`), drop the vite-tsconfig-paths plugin import from vite.config.mts (Vite+ has built-in tsconfig path resolution), and add a `test:watch` script. All 161 tests pass. - Fix `pack:bump` for scan: rename scripts/bump-version.js to .mjs (the file uses ESM syntax and scan/package.json is CJS by default), wire __dirname through fileURLToPath, and update the script reference. P2 — fragile hoisting: - Add `autoprefixer` to kitchen-sink/devDependencies so it doesn't rely on transitive hoisting from packages/scan. Verified: pnpm typecheck (4/4), pnpm build (4/4), pnpm test in scan (161/161), pnpm deadcode (0 unused files / 0 unused deps).
- pack:bump: Bugbot caught that swapping `nr pack` -> `pnpm pack` lost the build step (pnpm pack is the built-in tarball command, not the script). Use `pnpm run pack` to invoke the script chain (npm version patch && pnpm build && npm pack). - CI workflows: drop the hardcoded pnpm 9.x version (conflicted with packageManager: pnpm@10.24.0 declared in root package.json), let pnpm/action-setup read it from packageManager. Also bump Node from 18/20 -> 22 to match engines.node.
commit: |
Drop the fallow dead-code analyzer wiring per request: - Delete .fallowrc.jsonc - Remove `deadcode` / `deadcode:fix` scripts and the fallow devDep - Drop the .fallow/ cache entry from .gitignore - Remove fallow references from AGENTS.md and CONTRIBUTING.md
After overriding `vite` -> `@voidzero-dev/vite-plus-core` (which has no `bin`), packages calling `vite build` / `vite dev` directly fail to resolve a binary on a clean install. Switch the extension and kitchen-sink scripts to `vp build` / `vp dev` to match the react-grab pattern. vp loads the existing vite.config.ts files transparently (rolldown-vite under the hood, vite-plugin-web-extension still works). Verified end-to-end on a clean install: - pnpm install --frozen-lockfile ✓ - pnpm build (4/4 packages) ✓ - pnpm typecheck (4/4) ✓ - pnpm test (161/161 in scan) ✓ - pnpm --filter @react-scan/kitchen-sink build ✓ (produces dist/) - pnpm --filter @react-scan/extension build ✓ (produces dist/manifest.json + chunks)
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1021d77. Configure here.
- Restore @react-scan/vite-plugin-react-scan version 0.2.4 (accidentally downgraded to 0.2.3 when I rewrote package.json) and bump react-scan peer back to >=0.5.4. Catches Bugbot's "Package version accidentally downgraded" Medium finding. - Drop the duplicate `pnpm.overrides` block from root package.json. pnpm-workspace.yaml already declares vite/vitest overrides with proper version pins (@^0.1.12) and is the canonical location in pnpm 9+. Catches Bugbot's "Duplicate overrides with inconsistent version constraints" Low finding. Verified the override still resolves - packages/extension/node_modules/vite still aliases to @voidzero-dev/vite-plus-core 0.1.20. Other Bugbot comments are stale/already-fixed: - "Removed babel deps" (High) - the deps were restored in cfd08fb. - "Build step lost in pack:bump" (Medium) - fixed in e645345.
Vercel deploys the website with rootDirectory=packages/website and runs `pnpm build` directly inside it (turbo's filter graph doesn't apply). The presync step needs ../scan/dist/auto.global.js to exist, so we have to build scan first within the website's own build script. Restores the original prefix: pnpm --filter react-scan build && pnpm presync && next build
Vercel still pins old projects to pnpm 9.x by default. pnpm 9 reads overrides only from package.json (not pnpm-workspace.yaml), so dropping the duplicate caused ERR_PNPM_LOCKFILE_CONFIG_MISMATCH on Vercel. Restore the package.json `pnpm.overrides` block alongside the pnpm-workspace.yaml block (matching react-grab's pattern), with the same versioned spec `@^0.1.12` so they don't drift. Reverts part of the Bugbot Low-severity finding (#3) — the duplicate is intentional backwards-compat, not a footgun.
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Adopts the react-grab toolchain stack (Vite+ for lint/fmt/check, turbo for pipeline orchestration, pnpm 10, fallow for dead-code analysis) and removes 22 verified-dead files plus 8 unused dependencies that fallow surfaced. Tooling-only — zero changes to React Scan's public API or runtime behavior.
Toolchain
Cruft removed
Dead source files (fallow-verified)
`packages/scan/src`: `worker-shim.ts`, `types.d.ts`, `monitoring/`, `web/views/settings/`, `web/views/inspector/{properties.tsx, timeline/index.tsx, logging.ts}`, `web/components/{slider, sticky-section}`, `web/hooks/use-merged-refs.ts`, `web/utils/geiger.ts`, 3 babel helpers in `react-component-name/babel/`.
`packages/website`: `app/react-scan.ts`, `components/{cli, code, counter, footer, test-data-types, todo-demo}.tsx`.
Dead dependencies (fallow-confirmed)
`react-doctor` and `react-grab` kept by request and added to `.fallowrc.jsonc` `ignoreDependencies` so they no longer appear in reports.
Docs
Incidental code fixes
Required by the new tsconfig (`module: ESNext` + `moduleResolution: bundler`):
Out of scope (follow-up PRs)
Surfaced by `pnpm deadcode` so they're trackable from now on:
Test plan
Note
Medium Risk
Moderate risk because it rewires the build/lint/test toolchain (turbo/Vite+), bumps CI Node versions, and removes a large set of files; failures would surface as packaging/CI or missing-code regressions rather than runtime API changes.
Overview
Modernizes the repo toolchain by switching root and package scripts to
turbo-orchestrated workflows andvite-pluscommands (vp lint/fmt/check/test/pack), and standardizes on Node.js 22 + pnpm 10 (includingpnpm.onlyBuiltDependenciesand Vite/Vitest overrides).Updates CI workflows accordingly (Node 22, pnpm setup/cache) and adjusts package build configs/types (e.g.,
vite-plugin-react-scannow ships dual ESM/CJS viavp packand explicitexports;scan/extension add missing ambient/type imports).Prunes a large set of verified-dead scripts/docs/components/utilities across
packages/scanandpackages/website, removes legacy lint configs, and cleans up repo ignores (adds.turbo/, removes cert ignore entries).Reviewed by Cursor Bugbot for commit 255968c. Bugbot is set up for automated code reviews on this repo. Configure here.