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:
|
2023-10-11 22:34:57 +03:00
|
|
|
|
nodejs.org: '*'
|
2022-10-27 05:41:27 +03:00
|
|
|
|
|
|
|
|
|
build:
|
2022-11-17 02:01:43 +03:00
|
|
|
|
dependencies:
|
2023-02-04 03:34:11 +03:00
|
|
|
|
crates.io/semverator: '*'
|
2023-04-22 15:41:32 +03:00
|
|
|
|
script:
|
|
|
|
|
- |
|
|
|
|
|
if semverator satisfies '^8,>=9.4.2' {{ version }}; then
|
|
|
|
|
ARGS="--install-links"
|
|
|
|
|
fi
|
|
|
|
|
|
2023-07-06 01:09:15 +03:00
|
|
|
|
# 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'
|
|
|
|
|
|
2023-04-22 15:41:32 +03:00
|
|
|
|
- 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 doesn’t work if ~/.local/lib doesn’t exist
|
2023-04-22 15:41:32 +03:00
|
|
|
|
- run: |
|
2023-04-22 17:13:45 +03:00
|
|
|
|
rm npx
|
|
|
|
|
mv $SRCROOT/props/npx-shim npx
|
2023-04-22 15:41:32 +03:00
|
|
|
|
working-directory:
|
2023-04-22 17:13:45 +03:00
|
|
|
|
${{prefix}}/bin
|
2023-04-08 17:37:00 +03:00
|
|
|
|
|
2023-04-22 17:13:45 +03:00
|
|
|
|
test:
|
2023-06-28 02:54:02 +03:00
|
|
|
|
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
|
2023-04-22 17:13:45 +03:00
|
|
|
|
|
2023-06-28 02:54:02 +03:00
|
|
|
|
- npm install --global cowsay
|
2023-04-22 17:13:45 +03:00
|
|
|
|
|
2023-06-28 02:54:02 +03:00
|
|
|
|
# verify install location is as we configure it
|
|
|
|
|
- $HOME/.local/bin/cowsay xyz.tea.hi
|
2023-04-08 17:37:00 +03:00
|
|
|
|
|