pantry/projects/npmjs.com/package.yml

48 lines
1.1 KiB
YAML
Raw Normal View History

2022-10-27 05:41:27 +03:00
distributable:
url: https://github.com/npm/cli/archive/refs/tags/v{{ version }}.tar.gz
strip-components: 1
versions:
2023-04-16 09:15:35 +03:00
github: npm/cli/tags
2022-10-27 05:41:27 +03:00
provides:
- bin/npm
- bin/npx
dependencies:
# 20.3.x causes a error on linux+aarch64 (technically docker)
# sh: 1: tldr: Text file busy
# https://github.com/nodejs/node/issues/48444
nodejs.org: '>=14<20.3'
2022-10-27 05:41:27 +03:00
build:
dependencies:
crates.io/semverator: '*'
script:
- |
if semverator satisfies '^8,>=9.4.2' {{ version }}; then
ARGS="--install-links"
fi
- node . install --global --prefix={{prefix}} $ARGS
# configures npm to install to ~/.local
- mv props/npmrc {{prefix}}/lib/node_modules/npm
2023-04-22 17:13:45 +03:00
# our shim fixes a bug where npx doesnt work if ~/.local/lib doesnt exist
- run: |
2023-04-22 17:13:45 +03:00
rm npx
mv $SRCROOT/props/npx-shim npx
working-directory:
2023-04-22 17:13:45 +03:00
${{prefix}}/bin
2023-04-22 17:13:45 +03:00
test:
# doing first to test our shim works as expected
- npx -qy tldr ls
- npm install --global cowsay
# verify install location is as we configure it
- $HOME/.local/bin/cowsay xyz.tea.hi