Skip to content

v0.2.0 — e18e integration + migrate command

Choose a tag to compare

@FlorianBruniaux FlorianBruniaux released this 20 Apr 12:09
· 38 commits to main since this release

What's new in v0.2.0

dep-scope migrate — LLM-ready migration prompts

New command that generates structured markdown prompts for Claude Code, Cursor, or any LLM to remove a dependency and replace its usages with native alternatives.

# Preview what would be targeted
dep-scope migrate --dry-run

# Generate prompts for everything migratable
dep-scope migrate

# Target one package
dep-scope migrate lodash

# Pipe directly into Claude Code
claude -p "$(cat .dep-scope/migrate-lodash.md)"

Each generated prompt includes: exact file locations, per-symbol native replacement code, ES-target-aware suggestions (polyfill fallbacks for older targets), step-by-step instructions, verification checklist, and rollback instructions.

Hand-crafted templates:

  • lodash / lodash-es — 12 symbols: debounce, throttle, cloneDeep, isEqual, merge, omit, pick, uniq, flatten, get, groupBy, isEmpty + catch-all
  • moment — 11 symbols: format, fromNow, add, subtract, isBefore, isAfter, diff, parse, startOf, endOf + default
  • axios — 8 symbols: get, post, put, patch, delete, create, interceptors + default

Any other package in the native-alternatives database gets a generic prompt automatically.

New flags:

  • --dry-run — preview candidates without writing files
  • Complexity labels per package: trivial / easy / medium / complex
  • CONSOLIDATE pair deduplication — avoids contradictory prompts (e.g. uuid↔nanoid)

e18e integration — 195 packages with native alternatives

169 packages from the e18e/module-replacements project are now recognized as RECODE_NATIVE candidates. No runtime dependency added — data is embedded statically at build time.

Before: 15 packages with known alternatives
After: 195 packages with known alternatives

Covered packages include: has-flag, left-pad, array-includes, object-assign, is-windows, is-ci, is-even, uniq, arrify, filter-obj, concat-map, global, inherits, and the full array.prototype.* / string.prototype.* / object.* / string.prototype.* families.

Any import from these packages now shows the native replacement in dep-scope scan output and generates a migration prompt with dep-scope migrate.


srcPaths auto-detection

When configured source paths don't exist on disk, all commands now fall back to scanning common directories automatically:

src → lib → app → pages → components → hooks → server

A warning is printed when auto-detection is used. All commands benefit: scan, analyze, duplicates, report, migrate.

For best results, set explicit paths in .depscoperc.json:

{
  "srcPaths": ["src", "app", "pages", "components", "lib", "hooks"]
}

TypeScript target detection

resolveTsConfig() now follows extends chains transitively (up to 5 levels, cycle-safe), including npm package extends like @tsconfig/node18. Used to generate ES-target-aware migration suggestions.

Bug fixed: TSConfig resolver returned ES3 on Next.js projects using glob patterns in compilerOptions.paths (e.g. "@/*": ["./src/*"]). The old regex comment stripper matched /* inside JSON string values. Replaced with a proper string-aware JSONC parser.


Other changes

  • Knip is now auto-detected when installed — no --with-knip flag needed
  • Path aliases (@/, ~/, tsconfig paths) automatically filtered from analysis
  • Detailed symbol locations in analyze output (file:line)
  • --check-duplicates flag — duplicate detection is now opt-in
  • 120+ wellKnownPatterns added (bundlers, linting, CSS tooling, testing)
  • 354 tests (up from 294)

Migration from v0.1.0

No breaking changes. All existing commands work as before.

New commands:

dep-scope migrate         # new
dep-scope migrate lodash  # new

New flags on existing commands:

dep-scope scan --check-duplicates  # was always-on, now opt-in