Commit Graph

42 Commits

Author SHA1 Message Date
Doron Behar
796699f22b
fetch-yarn-deps: handle packages that are locally linked (#342186) 2024-09-29 22:59:39 +03:00
Mathieu Rene
2462edca10 fetch-yarn-deps: handle packages that are locally linked 2024-09-29 14:14:45 -04:00
lelgenio
c499cb1399 yarnInstallHook: fix temporary directory location
Currently the directory is being created in $src/yarnInstallHook.XXXXXX
Giving the directory a readable name is not particularly useful
2024-09-17 16:01:33 -03:00
Doron Behar
d77ecc757a
fetchYarnDeps: fix by deduplicating requests (#336784) 2024-09-10 18:17:48 +00:00
Fea
207072fca3 fetchYarnDeps: fix by deduplicating requests 2024-09-09 23:39:44 +02:00
lelgenio
7783e118af yarnInstallHook: init 2024-09-04 11:15:47 -03:00
seth
278e1bfb89
yarnConfigHook: apply as a postConfigure hook
This follows in this example of npmConfigHook and allows for using this
hook alongside others that may override configurePhase
2024-08-28 23:30:55 -04:00
Adam Joseph
9cac7a7475 fetch-yarn-deps: improve diagnostic messages
When the hash of an url being fetched does not match the expected value, this
commit will cause fetch-yarn-deps to include the url in the error message to
assist debugging.
2024-07-25 11:37:44 +02:00
Adam Joseph
84a75e9488 fetchYarnDeps: fix broken fetching logic for github releases
When a dependency references a github *release* URL, that dependency must be
fetched using https rather than git, since github does not require that
release tarballs have any relationship whatsoever to the git history.

This commit causes them to be fetched using https, not git.

A test case (which fails prior to this commit, and passes afterwards) is included.
2024-07-25 11:37:39 +02:00
Doron Behar
2400268a38 fetch-yarn-deps: handle yarn.lock deps without a resolved url 2024-07-10 09:39:10 +03:00
Doron Behar
ee7cfec5aa doc/javascript: document yarn{Config,Build}Hook 2024-07-10 09:39:03 +03:00
Doron Behar
296556a320 yarnBuildHook: init 2024-07-10 09:39:02 +03:00
Doron Behar
a84f3ca3d8 yarnConfigHook: init 2024-07-10 09:39:02 +03:00
Doron Behar
1151b39c24 fetch-yarn-deps: format with nixfmt (RFC166) 2024-07-10 09:39:01 +03:00
Atemu
882cf18005 fetch-yarn-deps: reference files to be copied directly
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-14 17:53:18 +02:00
Infinidoge
efff2acc5b
fetchYarnDeps: properly accept src argument 2024-06-14 11:18:10 -04:00
Sandro Jäckel
6181939cdf
fixup-yarn-lock: split out from prefetch-yarn-deps, cleanup installing
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-04-17 11:35:22 -04:00
Lily Foster
25596bd419
Merge pull request #257337 from lorenzleutgeb/yarn-file
prefetch-yarn-deps: Fix handling of scoped packages
2023-11-26 16:49:33 -05:00
Sandro Jäckel
f16843cb31
fetch-yarn-deps: fix missing cert when fetching packages
Found while updating element-web
2023-11-22 21:25:36 +01:00
Lorenz Leutgeb
29cf6a0422 prefetch-yarn-deps: Fix access to .resolved
... and simplify `prefetchYarnDeps`
2023-11-22 18:03:48 +01:00
Lorenz Leutgeb
3843224a55 prefetch-yarn-deps: Fix parsing of scoped packages 2023-11-22 18:03:06 +01:00
Lily Foster
ab99231a36
prefetch-yarn-deps: add cacert to provide certificates during fetches
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-21 16:24:57 -05:00
Lily Foster
d02eb2d0e5
prefetch-yarn-deps: re-add git hash for fixup 2023-11-15 21:02:52 -05:00
Dan Buch
14f76a96e8
fetch-yarn-deps: warn on undefined expected hash
instead of rejecting, given that the expected hash may not be known/provided.
2023-09-27 00:17:40 +00:00
nicoo
fab52fca51 treewide: sha512 → hash 2023-09-22 18:37:42 +02:00
MicroBlock
c2b8bf7f4e
feat: implement redirect for fetch-yarn-deps
This would fix NixOS/nixpkgs#245415
2023-07-26 15:13:37 +08:00
Lily Foster
249efd2271
Merge pull request #223457 from lilyinstarlight/fix/fetch-yarn-deps-pulsar
fetchYarnDeps: account for more yarn.lock spec edge cases
2023-07-16 20:24:16 -04:00
Lily Foster
86f94c3e45
prefetch-yarn-deps: add tests passthru 2023-06-29 11:11:41 -04:00
Lily Foster
5c32e0ba7c
prefetch-yarn-deps: add --fixup-lockfile flag to fixup a yarn.lock (#214062)
The flag iterates through the lockfile entries, rewrites `resolved` URLs
to those that will be in the cache (like `fixup_yarn_lock` from
yarn2nix), removes `integrity` for git deps whose hash won't match the
reproducible repacking that the fetcher does, writes the amended
lockfile, and exits.
2023-06-27 20:27:33 +02:00
Lily Foster
a777753eb2
fetchYarnDeps: add more git url tests 2023-03-27 19:40:08 -04:00
Lily Foster
88375f1b74
fetchYarnDeps: fix test hashes 2023-03-27 19:40:08 -04:00
Lily Foster
e7cd275cd8
fetchYarnDeps: account for more yarn.lock spec edge cases
* Ignore relative `file:` paths.
* Support github codeload URLs with `refs/tags/tag` in addition to just `tag`.
* Support https://github.com/owner/repo/archive/ref.tar.gz URLs for git download.
2023-03-27 19:40:05 -04:00
Yureka
aa3dc6440e
fetchYarnDeps: support passing src attribute (#193047) 2022-10-02 22:41:31 +02:00
Chuang Zhu
e3e091672f
fetchYarnDeps: support hash in pkg.integrity (#177255) 2022-06-15 20:13:41 +02:00
Robert Hensing
c071530ca5 testers.invalidateFetcherByDrvHash: Move from top-level 2022-05-05 12:08:50 +02:00
Yureka
c420487e0b fetchYarnDeps: support more url types 2021-12-30 11:13:25 +01:00
Yureka
842a0d94cb fetchYarnDeps: use fakeSha256 if no hash is given 2021-10-29 02:43:42 +09:00
Yureka
1565ab9717 prefetch-yarn-deps: ignore file: dependencies 2021-10-29 02:43:42 +09:00
Yureka
6c99b3d0b7 prefetch-yarn-deps: support git:// dependencies 2021-10-29 02:43:42 +09:00
Yuka
49a5b293b9
prefetch-yarn-deps: add nix dependency (#142664)
fixes "Error: spawn nix-hash ENOENT"
2021-10-23 19:13:34 +02:00
Yureka
84e02be598 fetchYarnDeps, mkYarnModules: verify the FOD hash is up-to-date 2021-10-20 11:39:16 +02:00
Yureka
d6e0195ccd prefetch-yarn-deps, fetchYarnDeps: init 2021-10-20 11:39:16 +02:00