Commit Graph

44 Commits

Author SHA1 Message Date
Sandro Jäckel
f4e18f55ef fetch-npm-deps: be less noisy
Before every package in node_modules was printed. Lets be a bit more
quiet and drop that.
2024-08-09 15:08:33 -04:00
Lily Foster
c678743f80 treewide: remove lilyinstarlight 2024-07-02 03:17:01 +02:00
Lily Foster
ddb94deafa prefetch-npm-deps: switch to data-encoding 2024-04-22 23:14:15 +10:00
Lily Foster
c588edaf25 prefetch-npm-deps: remove runtime dependency on nix 2024-04-22 23:14:15 +10:00
stuebinm
ff1a94e523 treewide: add meta.mainProgram to packages with a single binary
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-19 03:14:51 +01:00
Lily Foster
63fabdebd0
Merge pull request #267912 from reinismu/fetch-npm-deps-fix-bug
prefetch-npm-deps: add support for npm alias schema in version spec
2023-12-05 14:39:04 -05:00
Reinis Muiznieks
02dd7c7bb3 prefetch-npm-deps: add support for npm alias schema in version spec 2023-11-29 13:14:59 +02:00
Lily Foster
09081aa859
fetchNpmDeps: add test case where empty default lockfile packages is needed 2023-11-23 20:52:00 -05:00
Lily Foster
77571a847f
prefetch-npm-deps: use default value when lockfile has no deps 2023-11-23 20:51:59 -05:00
Lily Foster
daec4bf734
prefetch-npm-deps: instrument some logging 2023-11-23 20:51:58 -05:00
Lily Foster
81ed58b0fe
prefetch-npm-deps: make cargo happy 2023-11-23 20:51:22 -05:00
Lily Foster
ba656ad84e
prefetch-npm-deps: bump deps 2023-11-23 20:51:14 -05:00
Lily Foster
05dc145e80
fetchNpmDeps: add forceEmptyCache option 2023-11-22 15:18:39 -05:00
Lily Foster
ec51a56dfc
prefetch-npm-deps: detect and error out when generating an empty cache 2023-11-22 15:18:16 -05:00
Lily Foster
554e2412e0
prefetch-npm-deps: read url bodies within the retry loop 2023-10-10 19:40:43 -04:00
Lily Foster
a6df5a7719
prefetch-npm-deps: bump deps 2023-10-09 11:37:16 -04:00
Lily Foster
7f76ac6e09
fetchNpmDeps: pass NIX_NPM_TOKENS as an impure env var 2023-09-11 16:50:17 -04:00
Lily Foster
e271266179
prefetch-npm-deps: add support for NIX_NPM_TOKENS env var 2023-09-11 16:49:36 -04:00
Lily Foster
785ed11d0a
prefetch-npm-deps: fix error typo and unnecessary name qualifier 2023-08-09 19:13:26 -04:00
Lily Foster
fb9252fa48
prefetch-npm-deps: use exponential backoff 2023-07-04 14:47:13 -04:00
Lily Foster
ba7a869a9a
prefetch-npm-deps: add env_logger 2023-06-29 09:51:37 -04:00
Lily Foster
d2897e463d
prefetch-npm-deps: use isahc instead of ureq 2023-06-29 09:46:35 -04:00
Lily Foster
aa2f51f0d2
prefetch-npm-deps: update deps and base64 usage 2023-06-29 09:46:35 -04:00
Lily Foster
9af0383296
prefetch-npm-deps: support NIX_BUILD_CORES 2023-06-29 09:46:33 -04:00
Lily Foster
33898b9ad7
Merge pull request #238452 from XYenon/master
prefetch-npm-deps: add retry
2023-06-28 14:01:57 -04:00
XYenon
4915de2600 prefetch-npm-deps: add retry 2023-06-29 00:20:25 +08:00
Winter
c9abff9027 buildNpmPackage: add lilyinstarlight as maintainer/code owner
This is long overdue, Lily has done more than me for Node.js in Nixpkgs
by this point.
2023-06-27 14:59:40 -04:00
Winter
ac35d7ea86
prefetch-npm-deps: look up hashes from cache when fixing up lockfiles 2023-04-30 10:29:46 -04:00
Winter
7efebca89c
prefetch-npm-deps: fix reproducibility
v1 lockfiles can contain multiple references to the same version of a
package, and these references can contain different `integrity` values,
such as one having SHA-1 and SHA-512, while another just has SHA-512.

Given that HashMap iteration order isn't defined, this causes
reproducibility issues, as a different integrity value could be chosen
each time.

Thanks to @lilyinstarlight for discovering this issue originally, as well
as the idea for the sorting-based implementation.
2023-04-28 18:09:39 -04:00
Winter
faa3de1bf5
prefetch-npm-deps: fix clippy lint 2023-04-06 11:32:47 -04:00
Winter
e1d64c1941
prefetch-npm-deps: throw better error when unsupported git service is used
See https://github.com/NixOS/nixpkgs/pull/206476#discussion_r1058689383.
2023-04-06 11:32:47 -04:00
Winter
7e247e6fec
prefetch-npm-deps: download dev deps for git deps with install scripts
Git dependencies with install scripts are built isolated from the main
package, so their development dependencies are required.

To take advantage of this, #206477 is needed.
2023-04-06 11:32:39 -04:00
Winter
3e68a27822
prefetch-npm-deps: refactor
This splits prefetch-npm-deps into multiple files, as well as making a
few small changes along the way, such as going from a `HashMap` to a `Vec`
as the container for packages, to deduplicate them more efficently.
2023-04-06 11:32:23 -04:00
Yureka
20539ac23d prefetch-npm-deps: add nix to PATH
Fixes "No such file or directory" error when running prefetch-npm-deps
in its default mode (print hashes, for update scripts etc),
in an environment that doesn't have a `nix` binary (for `nix hash`).
2023-02-20 01:20:56 -05:00
Sandro
84477691f7 fetchNpmDeps: allow package-json.lock symlinks, update hint 2022-11-25 15:47:05 -05:00
Lily Foster
b023946d2b prefetch-npm-deps: fix hash stability
GNU tar will apparently silently include mtime of files if --mtime is
passed with an unrecognized date format. This led to hash instability
from those mtimes and this fixes it to force all mtimes to epoch
timestamp 0.
2022-11-23 20:52:08 -05:00
Winter
009a234bdd prefetch-npm-deps: repack hosted git deps
Previously, we stored the tarballs from the hosted Git providers directly in the cache. However, as we've seen with `fetchFromGitHub` etc, these files may change subtly.

Given this, this commit repacks the dependencies before storing them in the cache.
2022-11-21 15:00:08 -05:00
Winter
091d039b12 prefetch-npm-deps: deduplicate dependencies when parsing lockfile
A `package-lock.json` file can contain multiple instances of the same dependency, which caused unnecessary downloads and duplicate index entries in the generated cache.
2022-11-21 15:00:08 -05:00
Winter
b117b359db prefetch-npm-deps: move tests to separate file 2022-11-21 15:00:08 -05:00
Winter
c6903a01e7 prefetch-npm-deps: add etherpad-lite v1.8.18 as a test 2022-11-21 15:00:08 -05:00
Winter
03a7739d75 prefetch-npm-deps: skip bundled dependencies in v1 lockfiles 2022-11-21 15:00:08 -05:00
Winter
276982bd5e prefetch-npm-deps: add support for hosted git shorthands 2022-11-21 15:00:08 -05:00
Winter
cc5756b171 prefetch-npm-deps: add support for link dependencies in v2 lockfiles 2022-11-21 15:00:08 -05:00
Winter
16722903aa buildNpmPackage: init 2022-11-09 10:35:59 -05:00