Skip to content

Commit

Permalink
fix: node gyp scripts (#60)
Browse files Browse the repository at this point in the history
* fix: node gyp scripts

* fix: gyp scripts
  • Loading branch information
elrrrrrrr authored Nov 14, 2023
1 parent 824c496 commit 9c24bbb
Show file tree
Hide file tree
Showing 9 changed files with 63 additions and 4 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ bindings/*/index.node
.idea
packages/cli/test/fixtures/project-scripts/apps/a/1
packages/downloader/test/nginx.conf
package-lock.json

# napi-rs generate wrong type ignore for tmp
packages/binding/index.d.ts
Expand Down
47 changes: 47 additions & 0 deletions integration/fixtures/gyp/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions integration/fixtures/gyp/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"repository": "git@github.com:cnpm/rapid.git",
"dependencies": {
"fsevents": "^1.2.13"
}
}
2 changes: 1 addition & 1 deletion integration/index.2.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ describe('test/index.v2.test.js', () => {
it('should auto clean when reinstall', async () => {
cwd = path.join(__dirname, './fixtures/esbuild');


await coffee
.fork(rapid, [
'install',
Expand Down Expand Up @@ -203,4 +202,5 @@ describe('test/index.v2.test.js', () => {
const res = await execa.command('mount', { stdio: 'pipe' });
assert(res.stdout.indexOf('integration/fixtures/esbuild/node_modules') === res.stdout.lastIndexOf('integration/fixtures/esbuild/node_modules'));
});

});
2 changes: 2 additions & 0 deletions packages/cli/lib/node-gyp-bin/node-gyp
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env sh
node "`dirname "$0"`/node-gyp.js" "$@"
1 change: 1 addition & 0 deletions packages/cli/lib/node-gyp-bin/node-gyp.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node "%~dp0\node-gyp.js" %*
3 changes: 3 additions & 0 deletions packages/cli/lib/node-gyp-bin/node-gyp.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
'use strict';

return require('node-gyp/bin/node-gyp.js');
2 changes: 1 addition & 1 deletion packages/cli/lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ exports.runScript = async (pkgDir, script, options) => {
// ignore error
}
env.PATH = [
path.join(__dirname, '../node-gyp-bin'),
path.join(__dirname, './node-gyp-bin'),
path.join(options.cwd, 'node_modules', '.bin'),
path.join(pkgDir, 'node_modules', '.bin'),
process.env.PATH,
Expand Down
3 changes: 2 additions & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
"semver": "^7.3.8",
"urllib": "^3.16.1",
"yargs": "^17.7.2",
"yargs-parser": "^9.0.2"
"yargs-parser": "^9.0.2",
"node-gyp": "^9.0.0"
},
"homepage": "https://github.com/cnpm/rapid",
"repository": {
Expand Down

0 comments on commit 9c24bbb

Please sign in to comment.