|
| 1 | +# Remove JS Fallback Shim Plan |
| 2 | + |
| 3 | +This plan removes `@lzehrung/codegraph-js-fallback` as a published compatibility package. The package no longer provides parser recovery, is not a runtime dependency of the root package, and only preserves an old import path with throwing stubs. |
| 4 | + |
| 5 | +Do not remove internal reduced-mode behavior. Codegraph should continue to degrade to graph-only and regex-backed recovery when the native backend is unavailable. |
| 6 | + |
| 7 | +## Current State |
| 8 | + |
| 9 | +Observed package facts: |
| 10 | + |
| 11 | +- `@lzehrung/codegraph` does not depend on `@lzehrung/codegraph-js-fallback`. |
| 12 | +- The root package does not export `./js-fallback`. |
| 13 | +- `packages/codegraph-js-fallback` ships only `js-fallback.cjs`, `js-fallback.d.ts`, and no grammar dependencies. |
| 14 | +- `src/jsFallback.ts` is still used internally for type-compatible parser stubs and unavailable-error detection. |
| 15 | +- Release tooling still treats `js-fallback` as a third publishable package. |
| 16 | + |
| 17 | +Decision: |
| 18 | + |
| 19 | +- Remove the standalone compatibility package. |
| 20 | +- Keep internal `src/jsFallback.ts` for now unless the implementation pass proves every internal type/use can be deleted safely. |
| 21 | +- Keep reduced-mode regex recovery and native fallback reporting intact. |
| 22 | + |
| 23 | +## Phase 1: Package Boundary Cleanup |
| 24 | + |
| 25 | +Implementation checklist: |
| 26 | + |
| 27 | +- [ ] Delete `packages/codegraph-js-fallback/`. |
| 28 | +- [ ] Remove package-specific release metadata for `js-fallback` from `scripts/release-lib.mjs`. |
| 29 | +- [ ] Remove `js-fallback` version planning, manifest normalization, package selection, and publish handling from `scripts/release.mjs`. |
| 30 | +- [ ] Remove `js-fallback` from `.github/workflows/release.yml` publish commands and release notes. |
| 31 | +- [ ] Remove package-specific checks from `tests/package-metadata.test.ts`. |
| 32 | +- [ ] Confirm root `package.json` workspaces remain correct after deleting the package. |
| 33 | + |
| 34 | +Acceptance: |
| 35 | + |
| 36 | +- Release package selection accepts only `root`, `native`, `@lzehrung/codegraph`, and `@lzehrung/codegraph-native`. |
| 37 | +- No publish path references `@lzehrung/codegraph-js-fallback`. |
| 38 | +- No workspace package remains under `packages/codegraph-js-fallback`. |
| 39 | + |
| 40 | +## Phase 2: Internal Shim Review |
| 41 | + |
| 42 | +Implementation checklist: |
| 43 | + |
| 44 | +- [ ] Audit every import from `src/jsFallback.ts`. |
| 45 | +- [ ] Keep `JsSyntaxTree`, `JsSyntaxNode`, and related structural types only if native query/result adapters still need them. |
| 46 | +- [ ] Rename internal-only concepts if useful so `jsFallback` does not imply an external parser backend. |
| 47 | +- [ ] Preserve `isJsFallbackUnavailableError()` behavior if build/index fallback diagnostics still depend on it. |
| 48 | +- [ ] Do not reintroduce any JS Tree-sitter grammar dependency. |
| 49 | + |
| 50 | +Acceptance: |
| 51 | + |
| 52 | +- Internal names no longer suggest users can install a parser fallback package. |
| 53 | +- Native-unavailable behavior still reports reduced mode, not a missing package instruction. |
| 54 | +- TypeScript build proves no stale external shim imports remain. |
| 55 | + |
| 56 | +## Phase 3: Documentation Cleanup |
| 57 | + |
| 58 | +Implementation checklist: |
| 59 | + |
| 60 | +- [ ] Remove `@lzehrung/codegraph-js-fallback` from `README.md` install/release guidance. |
| 61 | +- [ ] Remove fallback shim package role from `docs/installation.md`. |
| 62 | +- [ ] Remove fallback shim release guidance from `PUBLISHING.md`. |
| 63 | +- [ ] Remove fallback shim mention from `codegraph-skill/codegraph/SKILL.md`. |
| 64 | +- [ ] Update any release examples that mention `--package js-fallback`. |
| 65 | +- [ ] Keep reduced-mode documentation explicit: without native, Codegraph has graph-only and regex recovery, not parser recovery. |
| 66 | + |
| 67 | +Acceptance: |
| 68 | + |
| 69 | +- User-facing docs list only root and native packages. |
| 70 | +- Docs do not imply installing another package can restore non-native Tree-sitter parsing. |
| 71 | +- Skill guidance matches current CLI/package surface. |
| 72 | + |
| 73 | +## Phase 4: Test Updates |
| 74 | + |
| 75 | +Implementation checklist: |
| 76 | + |
| 77 | +- [ ] Replace package metadata tests that assert shim properties with tests asserting the shim package is absent. |
| 78 | +- [ ] Update release-script tests to cover the two-package release model. |
| 79 | +- [ ] Keep native fallback contract tests focused on reduced mode and native package absence. |
| 80 | +- [ ] Add a regression test that release commands reject `--package js-fallback` with a clear unknown-selector error. |
| 81 | + |
| 82 | +Acceptance: |
| 83 | + |
| 84 | +- Tests prove `js-fallback` is not publishable. |
| 85 | +- Tests prove root/native release flow still works. |
| 86 | +- Tests prove reduced-mode fallback still works without the deleted package. |
| 87 | + |
| 88 | +## Phase 5: Validation |
| 89 | + |
| 90 | +Run focused checks during implementation: |
| 91 | + |
| 92 | +- [ ] `npx vitest run tests/package-metadata.test.ts tests/release-script.test.ts tests/native-fallback-contract.test.ts tests/native-fallback-reporting.test.ts` |
| 93 | +- [ ] `npx vitest run tests/js-fallback-loader.test.ts` if the file still exists; otherwise delete or replace it with reduced-mode coverage. |
| 94 | +- [ ] `npm run check` |
| 95 | + |
| 96 | +Manual verification: |
| 97 | + |
| 98 | +- [ ] `node ./dist/cli.js doctor` reports native status without mentioning a JS fallback package. |
| 99 | +- [ ] `node ./dist/cli.js orient --root . --budget small --json` still works with native available. |
| 100 | + |
| 101 | +## Risks and Non-Goals |
| 102 | + |
| 103 | +Risks: |
| 104 | + |
| 105 | +- Existing external consumers importing `@lzehrung/codegraph-js-fallback` will break after removal. |
| 106 | +- Release automation has several references to all publishable packages; partial cleanup can leave CI publishing stale package notes or invalid selectors. |
| 107 | + |
| 108 | +Non-goals: |
| 109 | + |
| 110 | +- Do not remove reduced-mode regex recovery. |
| 111 | +- Do not add a new JS parser fallback. |
| 112 | +- Do not change native package loading or native target publication except where release package enumeration currently includes `js-fallback`. |
0 commit comments