mirror of
https://github.com/jakejarvis/stanza.git
synced 2026-10-16 07:25:43 -04:00
- Add `apps/cli/src/lib/npm-version.ts` with `resolveRange(name, range)` and `resolveRanges(deps)` — fetches the abbreviated packument from the npm registry (or `STANZA_NPM_REGISTRY`), picks the `semver.maxSatisfying` version, and re-attaches the original modifier (e.g. `^1.6.11` → `^1.8.3`); non-`^`/`~` ranges, workspace specs, and tags are left verbatim without hitting the network; results are cached per package name for the process lifetime so a multi-module `init` fetches each package at most once - Wire `resolveRanges` into `applyModule` in `codemod-runner.ts` — both `dependencies` and `devDependencies` are re-pinned before being written to `package.json`; dry-run skips the network entirely since nothing is written - Add `STANZA_NO_NPM_LOOKUP=1` env var to bypass lookups and fall back to verbatim ranges (network errors also fall back per-entry); set it in `commands.test.ts` `beforeEach` to keep integration tests hermetic - Add `npm-version.test.ts` covering caret/tilde bumping, pass-through of other range shapes, `STANZA_NO_NPM_LOOKUP` bypass, network error fallback, non-ok response fallback, nothing-satisfies fallback, per-package caching, and scoped name URL encoding - Document the new behavior and env vars in `skills/stanza-cli/SKILL.md` under a new "Dependency Versions" section