← Blog
The Nub Team

Nub 0.11.3

Nub resolves dependency ranges the way npm does, and runs the pnpm version the lockfile records under a package manager range.

Nub 0.11.3 resolves dependency ranges the way npm does, and runs the pnpm version that pnpm-lock.yaml records under a devEngines range.

Nub is an all-in-one toolkit for Node.js written in Rust. The nub command is flag-for-flag compatible with node, while adding full support for TypeScript, JSX, tsconfig.json, .env loading, and modern Web and ECMAScript APIs. It also includes a fast script runner (nub run), package runner (nubx), Node version manager (nub node), and pnpm-compatible package manager.

Dependency ranges

A range with <= over a partial version now resolves to the version npm and pnpm install (#1144). Nub read <=6 as <=6.0.0-0, so it installed the newest 5.x:

Rangenpm and pnpm0.11.20.11.3
semver@<=66.3.25.7.36.3.2
semver@<=6.26.2.06.1.36.2.0
typescript@<=4.94.9.54.8.44.9.5
react@<=1717.0.216.14.017.0.2

What it covers:

  • Every range Nub reads. Dependencies, nub add, overrides and npm: aliases all resolve the same way.
  • Unsatisfiable sets. In >=17 <=16 || 15.7.0, the first set matches nothing, so the range installs react 15.7.0. It installed 19.3.1.

pnpm version ranges

A devEngines.packageManager range now runs the pnpm version that pnpm-lock.yaml records, while the range allows it (#1143). It re-resolved the newest pnpm in range on every run.

The nub pm which command names that source:

» resolved from pnpm-lock.yaml within devEngines.packageManager (pnpm@11.20.0)

What changed, for pnpm 11.1.3 and later:

  • Downloads. A cold download is checked against the integrity the lockfile records, and a warm cache needs no network.
  • Updates. Under a range you wrote, nub pm update records the new version in pnpm-lock.yaml and removes packageManager. It wrote packageManager beside the range, and pnpm 11 warned on every command.
  • Range syntax. Package-manager ranges are read as npm reads them, so 11.20.0 - 11.29.0 and ^11.20.0 || ^12.0.0 resolve.

Upgrading from 0.11.2

One pin written by 0.11.2 needs a command after upgrading.

  • A 0.11.2 pin with no lockfile warns on pnpm 11.8 and later. After nub pm use pnpm@11.x in a project with no pnpm-lock.yaml, 0.11.2 put the hash on packageManager alone, and pnpm 11.8+ prints Cannot use both "packageManager" and "devEngines.packageManager" on every command. Run the same nub pm use command again with 0.11.3 to rewrite the pin (#1141).

The full release notes list every change in this release.

Get started

View repo