8000 add support for buildNpmPackage by Kranzes · Pull Request #809 · nix-community/nix-init · GitHub
[go: up one dir, main page]

Skip to content

add support for buildNpmPackage - #809

Merged
figsoda merged 4 commits into
nix-community:mainfrom
Kranzes:build-npm-package
Jul 6, 2026
Merged

figsoda merged 4 commits into
nix-community:mainfrom
Kranzes:build-npm-package

Conversation

@Kranzes
@Kranzes Kranzes commented Jun 4, 2026
Copy link
Copy Markdown
Member

closes: #77

@eveeifyeve eveeifyeve left a comment •
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and It works! I would consider adding a deps thing like rust has (But I will do that in a follow up). Since stuff like sharp requires the binary version to be added.

@eveeifyeve
eveeifyeve commented Jun 30, 2026 •
Copy link
Copy Markdown
Member

@figsoda Could you please test this and give us a approval if you think it's good? Because it works on my end and I have a branch WIP that adds the other improvements.

@figsoda
figsoda commented Jun 30, 2026
Copy link
Copy Markdown
Member

a quick skim looks good, i will do a more thorough review this weekend

figsoda added 3 commits July 5, 2026 21:12
`npm_lacks_build_script` -> `npm_has_build_script`

`serde_json::from_reader` -> `serde_json::from_str`: [1]

[1]: https://docs.rs/serde_json/1.0.150/serde_json/fn.from_reader.html
> Note that counter to intuition, this function is usually slower than
> reading a file completely into memory and then applying `from_str` or
> `from_slice` on it.
@figsoda figsoda left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

side note: fetchNpmDeps support would be nice, but it would be quite a bit of duplicate code like CargoVendor with the current way things are laid out (1200 line function in main.rs), which I want to change in the future

@eveeifyeve
eveeifyeve commented Jul 6, 2026 •
Copy link
Copy Markdown
Member

@figsoda should the buildNpmPackage support not only just npm for the hash? Because I am sure there was cases where stuff like pnpm & yarn hashes are used.

@figsoda
figsoda commented Jul 6, 2026
Copy link
Copy Markdown
Member

@eveeifyeve don't want to block this pr for this, but yes if you mean the pnpm and yarn hooks (usually with stdenv.mkDerivation)

@figsoda
figsoda merged commit c8455a0 into nix-community:main Jul 6, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feature request: support buildNpmPackage

3 participants

0