Skip to content

refactor: explicit lockfile priority, derived PM type, changelog#2

Merged
arzafran merged 1 commit into
mainfrom
chore/nuclear-review-cleanup
Jun 3, 2026
Merged

refactor: explicit lockfile priority, derived PM type, changelog#2
arzafran merged 1 commit into
mainfrom
chore/nuclear-review-cleanup

Conversation

@arzafran
Copy link
Copy Markdown
Member

@arzafran arzafran commented Jun 3, 2026

What this does

Follow-up polish from a whole-codebase review. Two small internal cleanups that make the detection code read more directly, plus a CHANGELOG. No behavior change — the 13 existing tests cover detection, Corepack, priority, and the npm arg transform, and all still pass.

Summary

  • LOCKFILES is now an ordered tuple array, not an object. Detection priority was correct before (JS preserves string-key order) but encoded implicitly; the array makes "order = priority" explicit and self-documenting.
  • Single source of truth for package-manager names. The PackageManager union and the runtime Set were duplicated; now there's one const PACKAGE_MANAGERS tuple, the type is derived from it, and an isPackageManager type guard replaces a name as PackageManager cast.
  • Adds CHANGELOG.md documenting the 0.1.3 release (the fixes shipped in PR fix: correct package-manager detection and harden the CLI #1).

Test Plan

  • bun run typecheck — clean
  • bun run lint — clean
  • bun run test — 13/13 pass
  • bun run build — succeeds
  • Manual: detection from src/ still resolves bun via the root lockfile

Replaces the LOCKFILES object (priority encoded implicitly via JS key
order) with an ordered tuple array, and collapses the package-manager
union + runtime set into a single const source of truth with a type
guard, removing a cast. Behavior-preserving — all 13 tests still pass.

Adds CHANGELOG.md documenting the 0.1.3 release.
@arzafran arzafran merged commit cf179ba into main Jun 3, 2026
3 checks passed
@arzafran arzafran deleted the chore/nuclear-review-cleanup branch June 3, 2026 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant