pantry/projects/npmjs.com/package.yml
2023-11-22 07:05:52 -05:00

67 lines
1.5 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

distributable:
url: https://github.com/npm/cli/archive/refs/tags/v{{ version }}.tar.gz
strip-components: 1
versions:
github: npm/cli/tags
provides:
- bin/npm
- bin/npx
dependencies:
nodejs.org: '*'
build:
dependencies:
crates.io/semverator: '*'
script:
- |
if semverator satisfies '^8,>=9.4.2' {{ version }}; then
ARGS="--install-links"
fi
# 9.8.0 removed the references to these modules.
- run: |
for MOD in ../workspaces/*; do
b=$(basename $MOD)
if test "${b#lib}" = "$b"; then
ln -s ../$MOD @npmcli/$b
else
ln -s $MOD .
fi
done
working-directory: node_modules
if: '>=9.8.0'
- node . install --global --prefix={{prefix}} $ARGS
# configures npm to install to ~/.local
- mv props/npmrc {{prefix}}/lib/node_modules/npm
# our shim fixes a bug where npx doesnt work if ~/.local/lib doesnt exist
- run: |
rm npx
mv $SRCROOT/props/npx-shim npx
working-directory:
${{prefix}}/bin
test:
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
# This is a FIXME, but it should be reasonably harmless.
linux/aarch64:
nodejs.org: '<20.3'
script:
# 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