2021-04-15 04:04:24 +00:00
|
|
|
#!/usr/bin/env nix-shell
|
|
|
|
#! nix-shell -i bash -p nodePackages.node2nix
|
|
|
|
|
2022-09-26 22:01:27 +00:00
|
|
|
tag="v0.1.1"
|
|
|
|
u="https://gitlab.com/mx-puppet/discord/mx-puppet-discord/-/raw/$tag"
|
|
|
|
# Download package.json and patch in @discordjs/opus optional dependency
|
|
|
|
curl $u/package.json |
|
|
|
|
sed 's|"typescript": *"\^\?3\.[^"]*"|"typescript": "^4.8.3"|' | # TODO: remove when newer typescript version pinned
|
|
|
|
sed 's|\("dependencies": *{\)|\1\n"@discordjs/opus": "^0.8.0",|' >package.json
|
2021-04-15 04:04:24 +00:00
|
|
|
|
|
|
|
node2nix \
|
2022-01-29 22:52:29 +00:00
|
|
|
--nodejs-14 \
|
2021-04-15 04:04:24 +00:00
|
|
|
--node-env ../../development/node-packages/node-env.nix \
|
|
|
|
--input package.json \
|
2022-09-26 22:01:27 +00:00
|
|
|
--strip-optional-dependencies \
|
2021-04-15 04:04:24 +00:00
|
|
|
--output node-packages.nix \
|
2022-09-26 22:01:27 +00:00
|
|
|
--composition node-composition.nix \
|
|
|
|
--registry https://registry.npmjs.org \
|
|
|
|
--registry https://gitlab.com/api/v4/packages/npm \
|
|
|
|
--registry-scope '@mx-puppet'
|
2021-04-15 04:04:24 +00:00
|
|
|
|
|
|
|
sed -i 's|<nixpkgs>|../../..|' node-composition.nix
|
|
|
|
|
2022-09-26 22:01:27 +00:00
|
|
|
rm -f package.json
|