Skip to content

discussion: rainix-managed npm deps via buildNpmPackage #119

@thedavidmeister

Description

@thedavidmeister

Discussion

Long-term: have rainix expose a buildNpmPackage builder that takes a consumer's package.json + package-lock.json + an npmDepsHash and produces a nix-managed node_modules tree. Devshells, CI, and the pre-commit hooks all read from the same nix-built tree instead of from a separately-managed npm install output.

Why

Cost

  • Consumers must commit an npmDepsHash and re-pin it whenever package-lock.json changes.
  • Native modules (esbuild, sharp, anything node-gyp) often need --ignore-scripts plus a post-install rebuild step. Per-consumer wrinkles likely on first setup.
  • Documentation + a worked example (cyclofinance/cyclo.site or a fixture under test/fixture) needed before downstream uptake.

Out of scope for now

This is a tracking issue for future work. The immediate prettier-skew bug is solved by the much cheaper option in #117 / #118 (rainix-curated prettier bundle as the hook BIN). This issue is for the broader "nix owns all npm deps" direction.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions