summaryrefslogtreecommitdiff
path: root/pkgs/build-support/node
AgeCommit message (Collapse)Author
23 hourstreewide: set meta.license on hooksSigmanificient
2 daysfetchPnpmDeps: fix reproducibility of pnpm v11 store index (#522703)Sefa Eyeoglu
3 daysfetchPnpmDeps: fix reproducibility of pnpm v11 store indexMaciej Krüger
The pnpm v11 store uses a SQLite database (index.db) whose binary format is non-deterministic across platforms (version-valid-for number, etc). This caused hash mismatches when building the same pnpmDeps on different machines despite identical logical content. Fix by dumping the SQLite database to a text SQL file during the fetch phase and reconstructing it during the build phase. This ensures the stored representation is fully deterministic. Assisted-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: Gergő Gutyina <gutyina.gergo.2@gmail.com>
5 dayspnpmConfigHook: add instructions for ERR_PNPM_LOCKFILE_CONFIG_MISMATCHSefa Eyeoglu
See https://github.com/NixOS/nixpkgs/pull/505103#issuecomment-4496933583 Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
6 daysMerge master into staging-nextnixpkgs-ci[bot]
7 daysfetchPnpmDeps: fix pnpm 11 environment configurationSefa Eyeoglu
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
12 daysMerge master into staging-nextnixpkgs-ci[bot]
13 daysfetchPnpmDeps: deprecate fetcherVersion = 2, schedule removal for 26.11 ↵Gergő Gutyina
(#518360)
14 daysMerge remote-tracking branch 'origin/master' into staging-nextK900
2026-05-11pnpm_11: init at 11.1.0Sefa Eyeoglu
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2026-05-11fetchPnpmDeps,pnpmConfigHook: add support for pnpm 11Sefa Eyeoglu
pnpm 11 does not support configuring some options through its new global config format. As a workaround, we can define these environment variables instead. This also adds support for the new pmOnFail option in pnpm 11 that replaces managePackageManagerVersions. Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2026-05-11fetchPnpmDeps: use writableTmpDirAsHomeHookSefa Eyeoglu
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2026-05-11pnpm-fixup-state-db: init at 1.0.0Sefa Eyeoglu
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2026-05-11fetchPnpmDeps: deprecate fetcherVersion = 2Aliaksandr
Extend the existing v1 deprecation warning to also fire for `fetcherVersion = 2`, since callers should migrate directly to `fetcherVersion = 3`. Both pre-v3 versions now share a single `lib.warnIf` keyed on `fetcherVersion < 3` and produce a message parameterised by the offending version. Consolidate the manual's version-history entries: the per-item **Deprecated** and **Recommended** labels are replaced by a single sentence above the list noting that v3 is recommended and v1/v2 are scheduled for removal. Add a release note mirroring the existing v1 entry.
2026-04-27Merge staging-next into stagingnixpkgs-ci[bot]
2026-04-26fetchPnpmDeps: don't fail on empty lockfileSam Pointon
If the lockfile is empty, no files will be put in the output directory. In this case, the find invocations produce an empty list of results. xargs' default behaviour is to always invoke its command at least once; if its input is empty, then its command will not be passed any filenames. This produces an invocation like `chmod 555`. chmod, however, fails in this case, expecting an operand. So we need to tell xargs not to invoke its command at all in the case of empty input.
2026-04-26Merge staging-next into stagingnixpkgs-ci[bot]
2026-04-26fetchPnpmDeps: deprecate fetcherVersion = 1, schedule removal for 26.11Aliaksandr
fetcherVersion = 1 was kept around for backwards compatibility while callers migrated to 2/3. Emit a `lib.warnIf` warning pointing at the affected pname whenever v1 is used. After 26.11 ships, a follow-up PR should drop 1 from `supportedFetcherVersions` and clean up the dead v1 code paths in default.nix, pnpm-config-hook.sh and serve.nix. Also rewrite the manual section to recommend fetcherVersion = 3 for new packages and mark v1 as deprecated/scheduled-for-removal in the version history. Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2026-04-26Merge staging-next into stagingnixpkgs-ci[bot]
2026-04-26yarn2nix: remove more mentions of itDoron Behar
2026-04-25npmBuildHook: fix logging of the build commandBjørn Forsman
The command `npm run` is wrongly logged as `npm build`. Fix it. Also, the build script can be overridden, so log what is actually used: npm run $npmBuildScript [...]
2026-04-17Merge master into staging-nextnixpkgs-ci[bot]
2026-04-17treewide: fix mentions for nodejs.python (#505334)Antoine du Hamel
2026-04-08Merge master into staging-nextnixpkgs-ci[bot]
2026-04-08importNpmLock: handle commit in resolved git url (#501077)adisbladis
2026-04-08import-npm-lock: fix build with structuredAttrsK900
2026-04-05treewide: fix typo of NPM → npm (#506286)@mjones
2026-04-03treewide: fix typo of NPM → npm·𐑑𐑴𐑕𐑑𐑩𐑤
2026-04-01build-support/node: prepare for structuredAttrs (#487974)Jo
2026-03-31treewide: fix mentions for nodejs.pythonAntoine du Hamel
2026-03-25Merge staging-next into stagingnixpkgs-ci[bot]
2026-03-25pnpmConfigHook: disable version management before any execution of pnpm commandsccicnce113424
This would prevent hanging when pnpm tries to download the version set in package.json.
2026-03-22build-support/node/import-npm-lock: use printf instead of echoStefan Frijters
This is a shell builtin and is safer when dealing with large inputs: it avoids possible 'argument list too long' errors.
2026-03-22build-support/node/import-npm-lock: use structuredAttrs instead of ↵Philip Taron
passAsFile (#498929)
2026-03-18importNpmLock: handle commit in resolved git urlWinter M
npm's locking process resolves Git dependencies to a given commit, separated by a `#`. Before this change, any encounter of these URLs would cause `fetchGit` to fail, as they're not valid repo URLs.
2026-03-18Merge master into staging-nextnixpkgs-ci[bot]
2026-03-17linkNodeModulesHook: replace symlinks atomicallyLinus Heckemann
Up to now, existing symlinks were replaced by removing the existing link and then creating a new one. This left a window where the link did not exist, which would break cases where the hook was running concurrently with other things using node_modules. In my case, I would run multiple webpack builds at once like: nix develop -c webpack build --mode production nix develop -c webpack build --mode development If one of the shells was ready faster than the other, webpack would start running, then the second would run the linkNodeModules hook, and the earlier webpack build would run into missing files as the second linkNodeModules hook removed symlinks to replace them. This change mitigates this race condition in two ways: - Not replacing the symlink if it already points to the right target (this also avoids superfluous filesystem writes) - Replacing the symlink atomically, using a rename, otherwise. The symlink was replaced atomically prior to db7050bb887b72530d4c65a71af33cb49f710fab as well, but the name of the temporary symlink was always the same, which led to a similar race condition. This change reintroduces the atomic replacement, but adds the PID to the temporary filename in order to avoid conflicting with other instances of the hook running concurrently.
2026-03-15Merge master into staging-nextnixpkgs-ci[bot]
2026-03-14pnpm-config-hook: propagate writableTmpDirAsHomeHookSefa Eyeoglu
This should bring this in line with other packages in nixpkgs. Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2026-03-12build-support/node/import-npm-lock: use structuredAttrs instead of passAsFileStefan Frijters
2026-03-05build-support/node/build-npm-package: fix npm-config-hook.sh for structuredAttrsStefan Frijters
Do not rely on npmDeps being exported.
2026-02-25Merge staging-next into stagingnixpkgs-ci[bot]
2026-02-25linkNodeModulesHook: respect NODE_PATH (#493427)Doron Behar
2026-02-23linkNodeModulesHook: respect NODE_PATHLinus Heckemann
2026-02-16Merge staging-next into stagingnixpkgs-ci[bot]
2026-02-16Merge master into staging-nextnixpkgs-ci[bot]
2026-02-16build-support/node/fetch-yarn-deps: move env variables into env (#487962)Philip Taron
2026-02-16prefetch-npm-deps: warn about unresolved lockfile deps (#479805)Doron Behar
2026-02-16prefetch-npm-deps: warn about unresolved lockfile depsDoron Behar
Upstream projects' `package-lock.json` file might include many deps with no resolved line in them, as described here: https://github.com/npm/cli/issues/6301 This can cause dependencies to be missing after generating a hash for `.npmDeps`. If such dependencies are encountered, it's nice to print them and warn the user that an upstream patch might be needed. Co-Authored-By: Jörg Thalheim <joerg@thalheim.io>
2026-02-16treewide: replace `lib.trivial.version` with `lib.trivial.release`jopejoe1