Skip to content

Support PNPM - #4

Open
vsumner wants to merge 37 commits into
tobi:mainfrom
vsumner:codex/feat-pnpm
Open

Support PNPM#4
vsumner wants to merge 37 commits into
tobi:mainfrom
vsumner:codex/feat-pnpm

Conversation

@vsumner

@vsumner vsumner commented Feb 21, 2026

Copy link
Copy Markdown

Summary

This PR introduces the Node workflow in onix (pnpm import → generate → build → hydrate), and includes the core safeguards needed for real monorepos.

What This Adds

  • Node packageset import from pnpm-lock.yaml (workspace-aware).
  • Node derivation generation and project wiring for nodeModules.
  • Node build/hydrate path for creating and materializing node_modules from Nix store artifacts.
  • Warm-cache hydrate fast-path:
    • skips nix-build when identity is unchanged and target node_modules exists.
  • Early link: workspace validation in generate:
    • fails fast with actionable diagnostics for unresolved required paths.
  • Strict pnpm version policy with explicit override:
    • default remains strict.
    • onix import --allow-pnpm-patch-drift allows only same-major exact patch drift.
  • Direct lockfile path support for standard pnpm lockfile names (pnpm-lock.yaml / pnpm-lock.yml).
  • Documentation updates in README.md and AGENTS.md.

Why

  • Establishes the intended two-layer onix model for Node:
    • global reusable artifact identity in the Nix store.
    • project-scoped composition via hydrate.
  • Moves failures earlier (generate/import) instead of during long builds.
  • Makes warm developer loops fast and predictable.

Validation

  • Focused Node suites pass:
    • test/generate_node_test.rb
    • test/hydrate_node_test.rb
    • test/build_node_test.rb
    • test/pnpm_importer_test.rb
  • Full test suite passes (rake test).
  • onix check passes.
  • Real-repo pilot validated on:
    • vercel/turborepo
    • vercel/swr
  • Warm hydrate fast-path confirmed (node_modules unchanged) with sub-second timings.

Notes

  • Ruby workflows are unchanged.

vsumner and others added 7 commits February 20, 2026 14:46
- Fall back to pnpmPackage.fetchDeps when pkgs.fetchPnpmDeps is missing
  (World's nixpkgs exposes fetchDeps on the pnpm package, not top-level)
- Allow engines.pnpm range when packageManager provides exact version
  (admin-web has "pnpm": "^10" in engines + "pnpm@10.17.0" in packageManager)
- Set engine-strict=false in prefetch and build (nixpkgs node may lag
  behind engines.node constraint)
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