about summary refs log tree commit diff
path: root/pkgs/build-support/node
AgeCommit message (Collapse)AuthorFilesLines
2024-06-14fetch-yarn-deps: reference files to be copied directlyAtemu1-2/+4
This would cause any drv to be rebuilt when any part of the default.nix changes. What we actually care about is the two JS files though, so simply reference them directly. Co-authored-by: Infinidoge <infinidoge@inx.moe>
2024-06-14fetchYarnDeps: properly accept src argumentInfinidoge1-1/+1
2024-04-22prefetch-npm-deps: switch to data-encodingLily Foster4-17/+16
2024-04-22prefetch-npm-deps: remove runtime dependency on nixLily Foster7-201/+355
2024-04-17fixup-yarn-lock: split out from prefetch-yarn-deps, cleanup installingSandro Jäckel1-12/+32
To reduce dependencies (mainly nix-prefetch-git and through that git, git-lfs) when we just need to fixup a lock file, eg when building electron. This also tries to avoid needless rebuilds when eg. golang is updated. Also this cleans up and combined the build/installPhase of both tools to be a lot simpler.
2024-03-19treewide: add meta.mainProgram to packages with a single binarystuebinm1-0/+1
The nixpkgs-unstable channel's programs.sqlite was used to identify packages producing exactly one binary, and these automatically added to their package definitions wherever possible.
2024-03-14npmHooks.npmInstallHook: ignore bundle deps when calculating files to installLily Foster1-1/+1
This assumes that downstream users of `buildNpmPackage` would rather our own built `node_modules` be copied to the output rather than only the `bundleDependencies` specified in the `package.json` file. Having the latter behavior seems unexpected and unintuitive, and would not work as installing from an `npm pack` is intended to (since doing that would not do a `rebuild` step on those dependencies and it would skip reifying a full dependency tree).
2024-03-05importNpmLock: initadisbladis5-3/+283
This is an alternative to `fetchNpmDeps` that is notably different in that it uses metadata from `package.json` & `package-lock.json` instead of specifying a fixed-output hash. Notable features: - IFD free. - Only fetches a node dependency once. No massive FODs. - Support for URL, Git and path dependencies. - Uses most of the existing `npmHooks` `importNpmLock` can be used _only_ in the cases where we need to check in a `package-lock.json` in the tree. Currently this means that we have 13 packages that would be candidates to use this function, though I expect most usage to be in private repositories. This is upstreaming the builder portion of https://github.com/adisbladis/buildNodeModules into nixpkgs (different naming but the code is the same). I will archive this repository and consider nixpkgs the new upstream once it's been merged. For more explanations and rationale see https://discourse.nixos.org/t/buildnodemodules-the-dumbest-node-to-nix-packaging-tool-yet/35733 Example usage: ``` nix stdenv.mkDerivation { pname = "my-nodejs-app"; version = "0.1.0"; src = ./.; nativeBuildInputs = [ importNpmLock.hooks.npmConfigHook nodejs nodejs.passthru.python # for node-gyp npmHooks.npmBuildHook npmHooks.npmInstallHook ]; npmDeps = buildNodeModules.fetchNodeModules { npmRoot = ./.; }; } ```
2023-12-24npmHooks.npmInstallHook: ignore rather than error for missing bin/man keys ↵Lily Foster1-0/+2
in package.json
2023-12-05npmHooks.npmInstallHook: only overwrite npm cache for `npm pack` rather than ↵Lily Foster1-4/+2
for entire hook
2023-12-05Merge pull request #267912 from reinismu/fetch-npm-deps-fix-bugLily Foster2-25/+66
prefetch-npm-deps: add support for npm alias schema in version spec
2023-12-03Merge pull request #269078 from ↵Janik6-81/+98
lilyinstarlight/fix/prefetch-npm-deps-more-bad-lockfiles
2023-11-29prefetch-npm-deps: add support for npm alias schema in version specReinis Muiznieks2-25/+66
2023-11-26Merge pull request #257337 from lorenzleutgeb/yarn-fileLily Foster3-14/+25
prefetch-yarn-deps: Fix handling of scoped packages
2023-11-23fetchNpmDeps: add test case where empty default lockfile packages is neededLily Foster1-0/+12
2023-11-23prefetch-npm-deps: use default value when lockfile has no depsLily Foster1-12/+9
2023-11-23prefetch-npm-deps: instrument some loggingLily Foster1-0/+5
2023-11-23prefetch-npm-deps: make cargo happyLily Foster2-4/+6
2023-11-23prefetch-npm-deps: bump depsLily Foster2-65/+66
2023-11-23Merge pull request #266296 from yayayayaka/element-1.11.48Nick Cao1-0/+1
element-{web,desktop}: 1.11.47 -> 1.11.50
2023-11-23Merge pull request #243458 from ↵Janik5-7/+52
lilyinstarlight/fix/prefetch-npm-deps-error-when-no-cached-deps
2023-11-22fetch-yarn-deps: fix missing cert when fetching packagesSandro Jäckel1-0/+1
Found while updating element-web
2023-11-22buildNpmPackage: add forceEmptyCache optionLily Foster1-1/+4
2023-11-22fetchNpmDeps: add forceEmptyCache optionLily Foster1-3/+19
2023-11-22prefetch-npm-deps: detect and error out when generating an empty cacheLily Foster3-3/+29
2023-11-22prefetch-yarn-deps: Fix access to `.resolved`Lorenz Leutgeb1-11/+2
... and simplify `prefetchYarnDeps`
2023-11-22prefetch-yarn-deps: Fix parsing of scoped packagesLorenz Leutgeb3-3/+23
2023-11-21prefetch-yarn-deps: add cacert to provide certificates during fetchesLily Foster1-1/+1
Ideally fetch-yarn-deps could do like some other fetchers and support using SSL_CERT_FILE if it exists and also only verify integrity on FOD hash unless using an empty/test hash. But this should keep at least the same semantics as before the recent Node.js change to stop using the built-in certificate store in favor of the system one (which does not exist by default in the build sandbox).
2023-11-17buildNpmPackages: add missing deependenciesmidchildan1-2/+10
2023-11-16Merge pull request #267778 from ↵Felix Bühler1-0/+2
lilyinstarlight/fix/yay-more-fixup-yarn-lock-stuff prefetch-yarn-deps: re-add git hash for fixup
2023-11-16buildNpmPackage: allow passing npmDepshappysalada1-6/+5
2023-11-15prefetch-yarn-deps: re-add git hash for fixupLily Foster1-0/+2
2023-11-13Merge pull request #254420 from lilyinstarlight/fix/npm-pack-pls-😭Janik1-1/+1
npmHooks.npmInstallHook: avoid script output in npm pack command
2023-11-09buildNpmPackage: make nodejs overridable (#265171)Yt1-1/+2
* buildNpmPackage: allow nodejs to be passed as argument * Update doc/languages-frameworks/javascript.section.md Co-authored-by: Lily Foster <lily@lily.flowers> --------- Co-authored-by: Lily Foster <lily@lily.flowers>
2023-10-12Merge pull request #260011 from ↵Weijia Wang4-214/+172
lilyinstarlight/fix/prefetch-npm-deps-network-error-recovery prefetch-npm-deps: read url bodies within the retry loop
2023-10-10prefetch-npm-deps: read url bodies within the retry loopLily Foster2-20/+22
2023-10-09prefetch-npm-deps: bump depsLily Foster2-194/+150
2023-10-08Merge pull request #258384 from doronbehar/buildNpmPackage-makeWrapperArgsDoron Behar1-1/+11
buildNpmPackage: support makeWrapperArgs
2023-10-07Merge pull request #255984 from SuperSandro2000/patch-1Lily Foster1-1/+10
build-npm-package: give a hint when npm prune fails
2023-10-07buildNpmPackage: give a hint when npm prune failsSandro1-1/+10
Co-authored-by: Lily Foster <lily@lily.flowers>
2023-10-07buildNpmPackage: support makeWrapperArgsDoron Behar1-1/+11
2023-09-27fetch-yarn-deps: warn on undefined expected hashDan Buch1-1/+3
instead of rejecting, given that the expected hash may not be known/provided.
2023-09-22treewide: sha512 → hashnicoo1-1/+1
2023-09-12Merge pull request #251066 from lilyinstarlight/feature/prefetch-npm-deps-tokensRick van Schijndel4-4/+19
prefetch-npm-deps: add support for NIX_NPM_TOKENS env var
2023-09-11fetchNpmDeps: pass NIX_NPM_TOKENS as an impure env varLily Foster1-1/+3
2023-09-11prefetch-npm-deps: add support for NIX_NPM_TOKENS env varLily Foster1-0/+13
2023-09-10npmHooks.npmInstallHook: avoid script output in npm pack commandLily Foster1-1/+1
2023-09-09npmHooks: use adjacent packages, not buildPackagessternenseemann2-9/+23
Hooks are essentially implemented as special shell packages that run on their respective host platform. When they are used, they appear as nativeBuildInputs (as they need to be executed as part of the build of a package using them) so are taken from buildPackages relative to the derivation using them. Since the override in buildNpmPackage nullifies splicing, we take npmHooks from buildPackages manually. Fixes pkgsCross.ghcjs.buildPackages.emscripten and thus pkgsCross.ghcjs.haskellPackages.ghc.
2023-08-19buildNpmPackage: use installManPageRobert Schütz2-3/+5
2023-08-18buildNpmPackage: symlink manpages to the correct output directoryPierre Bourdon1-0/+7