Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use the bundled node-gyp in apm/npm/pnpm #42

Merged
merged 2 commits into from
Jun 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bin/apm
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ done

binDir=`pwd -P`

# Force npm to use its builtin node-gyp
unset npm_config_node_gyp
# set the path to the node-gyp fallback
export npm_config_node_gyp="$SCRIPT_DIR"/../node_modules/node-gyp/bin/node-gyp.js

cliPath="$binDir/../lib/cli.js"
if [[ $(uname -r) == *-Microsoft ]]; then
Expand Down
5 changes: 3 additions & 2 deletions bin/apm.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ if not defined apm_git_path (
if defined apm_git_path set "Path=!apm_git_path!;!PATH!"
)

:: Force npm to use its builtin node-gyp
set npm_config_node_gyp=
:: set the path to the node-gyp fallback
set npm_config_node_gyp="%~dp0\\..\\node_modules\\node-gyp\\bin\\node-gyp.js"
set "npm_config_node_gyp=%npm_config_node_gyp:\=/%"

if exist "%~dp0\node.exe" (
"%~dp0\node.exe" "%~dp0/../lib/cli.js" %*
Expand Down
4 changes: 2 additions & 2 deletions bin/npm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
export PATH="$SCRIPT_DIR:$PATH"

# Force npm to use its builtin node-gyp
unset npm_config_node_gyp
# set the path to the node-gyp fallback
export npm_config_node_gyp="$SCRIPT_DIR"/../node_modules/node-gyp/bin/node-gyp.js

"$SCRIPT_DIR"/../node_modules/.bin/npm $@
5 changes: 3 additions & 2 deletions bin/npm.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ setlocal EnableDelayedExpansion

set "PATH=%~dp0;%PATH%"

:: Force npm to use its builtin node-gyp
set npm_config_node_gyp=
:: set the path to the node-gyp fallback
set npm_config_node_gyp="%~dp0\\..\\node_modules\\node-gyp\\bin\\node-gyp.js"
set "npm_config_node_gyp=%npm_config_node_gyp:\=/%"

"%~dp0\..\node_modules\.bin\npm.cmd" %*
4 changes: 2 additions & 2 deletions bin/pnpm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
export PATH="$SCRIPT_DIR:$PATH"

# Force npm to use its builtin node-gyp
unset npm_config_node_gyp
# set the path to the node-gyp fallback
export npm_config_node_gyp="$SCRIPT_DIR"/../node_modules/node-gyp/bin/node-gyp.js

"$SCRIPT_DIR"/../node_modules/.bin/pnpm $@
5 changes: 3 additions & 2 deletions bin/pnpm.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ setlocal EnableDelayedExpansion

set "PATH=%~dp0;%PATH%"

:: Force npm to use its builtin node-gyp
set npm_config_node_gyp=
:: set the path to the node-gyp fallback
set npm_config_node_gyp="%~dp0\\..\\node_modules\\node-gyp\\bin\\node-gyp.js"
set "npm_config_node_gyp=%npm_config_node_gyp:\=/%"

"%~dp0\..\node_modules\.bin\pnpm.cmd" %*
11 changes: 8 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"scripts": {
"build": "npm run clean.lib && npm run tsc",
"build.test": "npm run get.fixtures && shx rm -rf ./dist-spec/ && shx cp -r spec dist-spec && babel ./dist-spec --out-dir ./dist-spec",
"build.test": "npm run get.fixtures && shx rm -rf ./dist-spec/ ./native-module/build && shx cp -r spec dist-spec && babel ./dist-spec --out-dir ./dist-spec",
"check-version": "node script/check-version.js",
"clean.bin": "shx rm -rf bin/node_darwin_x64 bin/node.exe bin/node",
"clean.lib": "shx rm -rf lib/",
Expand Down Expand Up @@ -42,8 +42,10 @@
"keytar": "^7.7.0",
"mv": "2.1.1",
"ncp": "~2.0.0",
"node-gyp": "^9.0.0",
"npm": "^7.24.2",
"open": "7.4.2",
"pnpm": "^6.32.23",
"q": "~1.5.1",
"read": "~1.0.7",
"request": "^2.88.2",
Expand Down Expand Up @@ -87,10 +89,13 @@
"gitly": "^2.1.2",
"jasmine-focused": ">=1.0.7 <2.0",
"node-downloader-helper": "^2.0.0",
"node-gyp": "^9.0.0",
"pnpm": "^6.32.23",
"prettier": "^2.7.1",
"prettier-config-atomic": "^3.0.10",
"shx": "^0.3.3"
},
"pnpm": {
"overrides": {
"node-gyp": "^9.0.0"
}
}
}
Loading