mirror of
https://github.com/Mic92/nix-update.git
synced 2024-10-26 11:10:10 +03:00
Merge pull request #68 from yu-re-ka/feature/yarn-hash
support for updating yarn FOD hash
This commit is contained in:
commit
8e3c8afa5e
@ -17,6 +17,7 @@ designed to work with nixpkgs but also other package sets.
|
|||||||
- update buildRustPackage's cargoHash/cargoSha256 and cargoSetupHook's cargoDeps
|
- update buildRustPackage's cargoHash/cargoSha256 and cargoSetupHook's cargoDeps
|
||||||
- update buildGoModule's vendorHash/vendorSha256
|
- update buildGoModule's vendorHash/vendorSha256
|
||||||
- update buildNpmPackage's npmDepsHash and npmConfigHook's npmDeps
|
- update buildNpmPackage's npmDepsHash and npmConfigHook's npmDeps
|
||||||
|
- update fetchYarnDeps offlineCache output hash
|
||||||
- update flake outputs (see `--flake`)
|
- update flake outputs (see `--flake`)
|
||||||
- build and run the resulting package (see `--build`,
|
- build and run the resulting package (see `--build`,
|
||||||
`--run` or `--shell`
|
`--run` or `--shell`
|
||||||
|
@ -53,6 +53,7 @@ class Package:
|
|||||||
go_modules_old: str | None
|
go_modules_old: str | None
|
||||||
cargo_deps: str | None
|
cargo_deps: str | None
|
||||||
npm_deps: str | None
|
npm_deps: str | None
|
||||||
|
yarn_deps: str | None
|
||||||
tests: list[str]
|
tests: list[str]
|
||||||
has_update_script: bool
|
has_update_script: bool
|
||||||
|
|
||||||
@ -157,6 +158,7 @@ in {{
|
|||||||
else
|
else
|
||||||
null;
|
null;
|
||||||
npm_deps = pkg.npmDeps.outputHash or null;
|
npm_deps = pkg.npmDeps.outputHash or null;
|
||||||
|
yarn_deps = pkg.offlineCache.outputHash or null;
|
||||||
tests = builtins.attrNames (pkg.passthru.tests or {{}});
|
tests = builtins.attrNames (pkg.passthru.tests or {{}});
|
||||||
has_update_script = {has_update_script};
|
has_update_script = {has_update_script};
|
||||||
src_homepage = pkg.src.meta.homepage or null;
|
src_homepage = pkg.src.meta.homepage or null;
|
||||||
|
@ -257,6 +257,11 @@ def update_npm_deps_hash(opts: Options, filename: str, current_hash: str) -> Non
|
|||||||
replace_hash(filename, current_hash, target_hash)
|
replace_hash(filename, current_hash, target_hash)
|
||||||
|
|
||||||
|
|
||||||
|
def update_yarn_deps_hash(opts: Options, filename: str, current_hash: str) -> None:
|
||||||
|
target_hash = nix_prefetch(opts, "offlineCache")
|
||||||
|
replace_hash(filename, current_hash, target_hash)
|
||||||
|
|
||||||
|
|
||||||
def update_version(
|
def update_version(
|
||||||
package: Package, version: str, preference: VersionPreference, version_regex: str
|
package: Package, version: str, preference: VersionPreference, version_regex: str
|
||||||
) -> bool:
|
) -> bool:
|
||||||
@ -362,4 +367,7 @@ def update(opts: Options) -> Package:
|
|||||||
if package.npm_deps:
|
if package.npm_deps:
|
||||||
update_npm_deps_hash(opts, package.filename, package.npm_deps)
|
update_npm_deps_hash(opts, package.filename, package.npm_deps)
|
||||||
|
|
||||||
|
if package.yarn_deps:
|
||||||
|
update_yarn_deps_hash(opts, package.filename, package.yarn_deps)
|
||||||
|
|
||||||
return package
|
return package
|
||||||
|
Loading…
Reference in New Issue
Block a user