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
nubcommand is flag-for-flag compatible withnode, while adding full support for TypeScript, JSX,tsconfig.json,.envloading, and modern Web and ECMAScript APIs. It also includes a fast script runner (nub run), package runner (nubx), Node version manager (nub node), andpnpm-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:
| Range | npm and pnpm | 0.11.2 | 0.11.3 |
|---|---|---|---|
semver@<=6 | 6.3.2 | 5.7.3 | 6.3.2 |
semver@<=6.2 | 6.2.0 | 6.1.3 | 6.2.0 |
typescript@<=4.9 | 4.9.5 | 4.8.4 | 4.9.5 |
react@<=17 | 17.0.2 | 16.14.0 | 17.0.2 |
What it covers:
- Every range Nub reads. Dependencies,
nub add,overridesandnpm: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 updaterecords the new version inpnpm-lock.yamland removespackageManager. It wrotepackageManagerbeside 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.0and^11.20.0 || ^12.0.0resolve.
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.xin a project with nopnpm-lock.yaml, 0.11.2 put the hash onpackageManageralone, and pnpm 11.8+ printsCannot use both "packageManager" and "devEngines.packageManager"on every command. Run the samenub pm usecommand again with 0.11.3 to rewrite the pin (#1141).
The full release notes list every change in this release.