-
Notifications
You must be signed in to change notification settings - Fork 60
Is there a reason to use nub.lock file? #488
As the title says, is there any reason or advantage of preferring nub.lock file over npm/pnpm lock files?
All reactions
Yes, the existing comment is right that nub.lock uses the pnpm v9 lockfile schema byte-for-byte. The filename still carries some useful meaning, though: it tells Nub that the project is Nub-owned.
In practice:
- In an existing npm, pnpm, or Bun project, Nub detects the incumbent package manager and continues reading and writing its native lockfile. It should not introduce
nub.lock. - A fresh Nub project, or one switched with
nub pm use nub, usesnub.lock. - Under Nub identity, Nub reads neutral configuration rather than pnpm-specific configuration such as
.pnpmfile.cjsorpnpm-workspace.yaml.
So the benefit is not a different dependency graph format. It is an unambiguous package-manager ident...
Replies: 2 comments 1 reply
From what I guess from the docs, is nub.lock actually a pnpm-lock.yaml under the hood?
Then that's fine, a simple name change should make migration to and from either one trivial.
Probably better than to init with aube-lock.yaml for new projects.
All reactions
Yes, the existing comment is right that nub.lock uses the pnpm v9 lockfile schema byte-for-byte. The filename still carries some useful meaning, though: it tells Nub that the project is Nub-owned.
In practice:
- In an existing npm, pnpm, or Bun project, Nub detects the incumbent package manager and continues reading and writing its native lockfile. It should not introduce
nub.lock. - A fresh Nub project, or one switched with
nub pm use nub, usesnub.lock. - Under Nub identity, Nub reads neutral configuration rather than pnpm-specific configuration such as
.pnpmfile.cjsorpnpm-workspace.yaml.
So the benefit is not a different dependency graph format. It is an unambiguous package-manager identity while retaining pnpm-v9-compatible lockfile data.
I would use the supported switch commands rather than manually renaming the file:
nub pm use nub # or nub pm use pnpm
That lets Nub align the manifest, lockfile, and relevant configuration together. The current behavior is described in the package-manager documentation.
All reactions
it tells Nub that the project is Nub-owned.
In the meantime, I also realized that this is also useful for LLMs. Otherwise they will just stubbornly reach out of npm, pnpm, bun etc.
All reactions
-
👍 1