Skip to content

Navigation Menu

Sign in
Sign up

Is there a reason to use nub.lock file? #488

Answered by LJAYi
cemremengu asked this question in Q&A
Discussion options

As the title says, is there any reason or advantage of preferring nub.lock file over npm/pnpm lock files?

You must be logged in to vote

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, uses nub.lock.
  • Under Nub identity, Nub reads neutral configuration rather than pnpm-specific configuration such as .pnpmfile.cjs or pnpm-workspace.yaml.

So the benefit is not a different dependency graph format. It is an unambiguous package-manager ident...

Replies: 2 comments 1 reply

Comment options

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.

You must be logged in to vote
0 replies
Comment options

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, uses nub.lock.
  • Under Nub identity, Nub reads neutral configuration rather than pnpm-specific configuration such as .pnpmfile.cjs or pnpm-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.

You must be logged in to vote
1 reply
Comment options

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.

Answer selected by cemremengu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /