Commit graph

58 commits

Author SHA1 Message Date
Felix Rieseberg
f2d38f10c0 fix: Handle nullish coalescing operator 2024-10-07 11:27:39 -04:00
Luke Karrys
4e493d4fb2
chore: misc testing fixes (#2930)
* chore: misc test fixes

* Sort test runs by os first

* Use cross-env for test env var

* Try sorting matrix params

* Make FAST_TEST the default and rename to FULL_TEST

* Separate helper functions to not need to export test obj in files
2023-10-28 14:13:10 -07:00
Luke Karrys
355622f4aa feat: convert all internal functions to async/await
BREAKING CHANGE: All internal functions have been coverted to return
promises and no longer accept callbacks. This is not a breaking change
for users but may be breaking to consumers of `node-gyp` if you are
requiring internal functions directly.
2023-10-28 08:59:57 -07:00
Luke Karrys
192eec2aca
Sync deps and engines with npm (#2770)
* feat!: update `engines.node` to `^14.17.0 || ^16.13.0 || >=18.0.0`

* deps: nopt@^7.0.0

* feat: replace npmlog with proc-log

* deps: standard@17.0.0 and fix linting errors

* deps: which@3.0.0
- this also promiisifies the build command

* deps: glob@8.0.3

* feat: drop rimraf dependency

* fix: use fs/promises in favor of fs.promises
2023-06-20 15:44:18 +02:00
Bartosz Sosnowski
6356117b08
doc, bin: stop suggesting opening node-gyp issues
A lot of new issues in node-gyp are related to outdated node-gyp or
broken modules. This removes the suggestion to open a new issue in the
node-gyp, instead suggesting the user should open the issue in the
module issue tracker. It also makes the issue template more explicit
about providing the logs.

PR-URL: https://github.com/nodejs/node-gyp/pull/2096
Reviewed-By: Christian Clauss <cclauss@me.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
2020-05-13 11:30:18 +10:00
Rod Vagg
ab2a4cc209
src: update to standard@14
PR-URL: https://github.com/nodejs/node-gyp/pull/1899
Reviewed-By: João Reis <reis@janeasystems.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2019-10-02 13:57:30 +10:00
Rod Vagg
e40c99e283
src: implement standard.js linting
In addition:

* moved module.exports to the bottom
* no single-line if statements
* no if statements without a {
* const for requires
* array declarations get spaces inside [ ]
* 'use strict' in all .js files

PR-URL: https://github.com/nodejs/node-gyp/pull/1794
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: João Reis <reis@janeasystems.com>
2019-07-06 14:36:37 +10:00
João Reis
43031fadcb
python: clean-up detection
Try everything until Python is found.

PR-URL: https://github.com/nodejs/node-gyp/pull/1582
Reviewed-By: Rod Vagg <rod@vagg.org>
2019-04-24 10:29:00 +10:00
Refael Ackermann
49ab79d221
python: more informative error
PR-URL: https://github.com/nodejs/node-gyp/pull/1269
Refs: https://github.com/nodejs/node-gyp/pull/1582
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: João Reis <reis@janeasystems.com>
2019-04-24 10:29:00 +10:00
Selwyn
8a83972743
bin: follow XDG OS conventions for storing data
PR-URL: https://github.com/nodejs/node-gyp/pull/1570
Fixes: https://github.com/nodejs/node-gyp/pull/175
Fixes: https://github.com/nodejs/node-gyp/pull/1124
Reviewed-By: Refael Ackermann <refack@gmail.com>
2019-04-24 10:29:00 +10:00
Selwyn
8098ebdeb4
deps: replace osenv dependency with native os
Breaking change: needs Node.js version 6 or higher

https://github.com/nodejs/node-gyp/pull/1570
Reviewed-By: Refael Ackermann <refack@gmail.com>
2019-04-24 10:29:00 +10:00
Jon Moss
a5b7410497
Add ESLint no-unused-vars rule
- Uses `.eslintrc.yaml` for configuration
- `npm run lint` is part of `npm test`

PR-URL: https://github.com/nodejs/node-gyp/pull/1497
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: João Reis <reis@janeasystems.com>
2019-04-24 10:27:29 +10:00
Jon Moss
9e46872ea3
bin,lib: remove extra comments/lines/spaces
- Removes "module dependencies" comments and things that, IMHO, don't add
too much value. Happy to add back if helps some people when reading
through `node-gyp`.
- DRY up `lib/process-release.js`.
- Removes a bunch of extra blank lines, as well as random spaces.

PR-URL: https://github.com/nodejs/node-gyp/pull/1508
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2019-04-24 10:27:29 +10:00
Ben Noordhuis
9c8d275526 Add --devdir flag.
Overrides the location where node-gyp will look for (and download to)
the node.js SDK.

For harmonization with the --nodedir flag, `osenv.home()` is now used
instead of `process.env.HOME || process.env.USERPROFILE`.

`osenv.home()` defaults to the built-in `os.homedir()` when available
and falls back to sane defaults based on the platform.

`%USERPROFILE%` is now preferred on Windows and `%HOME%` is ignored;
similarly, UNIX systems ignore `$USERPROFILE` from now on.  Neither
behavior made much sense, IMO.

Fixes: https://github.com/nodejs/node-gyp/issues/21
PR-URL: https://github.com/nodejs/node-gyp/pull/916
Reviewed-By: Rod Vagg <rod@vagg.org>
2016-10-07 10:34:53 +02:00
Ben Noordhuis
0fbc387b35 Update repository URLs.
The project was moved from https://github.com/TooTallNate/node-gyp to
https://github.com/nodejs/node-gyp.  Update a handful of links that
still pointed to the old location.

PR-URL: https://github.com/nodejs/node-gyp/pull/715
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2015-09-06 06:41:01 +02:00
bobrik
c9c1836ee9 update notice 2013-07-02 21:07:09 +04:00
Nathan Rajlich
6d8d7b1d32 make node-gyp -v and node-gyp --version work as expected 2012-07-31 10:44:26 -07:00
Nathan Rajlich
4b9097a5d3 bin: better args handling for chained commands
Now this works:

 $ node-gyp rm 0.8.0 rm 0.8.2 rm 0.8.3
2012-07-16 16:14:05 -07:00
Nathan Rajlich
b53a6068b4 bin: some better error output 2012-07-16 15:25:26 -07:00
Nathan Rajlich
334cdb0ea8 bin: ensure the "exit" and "uncaughtException" handlers get registered 2012-07-16 10:57:10 -07:00
Nathan Rajlich
ed22024af6 bin: unify issue message logic
DRY
2012-07-16 10:55:38 -07:00
Nathan Rajlich
b776286946 bin: log the "cli", process.platform and process.arch
better debugging for GitHub issues
2012-07-09 22:37:43 -07:00
Nathan Rajlich
022b48714e match npm's output for the done "ok" log message 2012-06-25 12:40:00 -07:00
Nathan Rajlich
ebd780b3b9 better chdir() fail log 2012-06-06 20:59:14 -07:00
Nathan Rajlich
633e62362e make aliased commands act more like their counterpart 2012-06-06 18:24:11 -07:00
Nathan Rajlich
47de81f963 initial take at using 'npmlog' for logging
* adds a '--loglevel' switch to node-gyp which accepts the same values as npm
 * now the '--verbose' flag is simply an alias to '--loglevel=verbose'
 * this simplifies the code a bit, since any logging logic is now removed
 * more log levels! it's mostly verbose() and info() being used
   * still need to go back and move some of logging calls to a better level
2012-06-06 18:01:08 -07:00
Nathan Rajlich
3b58a0b346 start of fixing the "ls" printout 2012-04-10 10:55:10 -07:00
Nathan Rajlich
f014cec5a8 Support multiple commands that execute serially.
Fixes #30.
2012-04-08 17:07:17 -07:00
Nathan Rajlich
b40ecaba78 Add a "-C/--directory" switch.
Fixes #50.
2012-04-08 16:16:50 -07:00
Nathan Rajlich
fb18a81a32 Add "warn" log setting 2012-04-08 16:15:47 -07:00
Nathan Rajlich
35232a14c2 bin: require the package directly; utilize the package.json 2012-03-24 19:42:17 -07:00
Nathan Rajlich
848b638e0c Rewrite gyp.spawn() to use customFds by default. 2012-02-26 01:10:28 -08:00
Nathan Rajlich
1edd36ff96 Add quick 'uncaughtException' handler.
This logic all needs to be consolidated into an 'errorHandler.js' file at some point...
2012-02-12 13:49:31 -08:00
Nathan Rajlich
1cc3b12794 Print the whole stack trace on an Error from the command. 2012-02-12 13:48:40 -08:00
Nathan Rajlich
4146f3f13d Print verbose stuff to stderr, main stuff to stdout. 2012-02-11 17:16:58 -08:00
Nathan Rajlich
4ecfd1427e Don't look up the 'current' in the 'list' command.
Part of #20.
2012-02-11 12:52:48 -08:00
Nathan Rajlich
211681edb6 Print a message when no node development files are installed on 'list'. 2012-02-05 00:56:55 -08:00
Nathan Rajlich
a4bf77df7b Use the unicode Bullet char for the 'list' command. 2012-02-05 00:12:41 -08:00
Nathan Rajlich
34cb2d9931 Remove the 'log' event. I'd rather have customized formatters using callback return values. 2012-02-05 00:06:15 -08:00
Nathan Rajlich
ad80cfe124 Start on specialized command reporting in the binary.
This moves the output away from the JS API.
2012-02-04 22:31:37 -08:00
Nathan Rajlich
78ecbd7ec9 Log all given arguments returned. 2012-02-04 21:53:16 -08:00
Nathan Rajlich
da7cbea71f console.log() any return value when given inside the bin. 2012-02-04 21:50:32 -08:00
Nathan Rajlich
66883b9997 Add check for unsupported commands. 2012-02-04 20:35:06 -08:00
Nathan Rajlich
1efe4b00a9 Clean up logging in the bin. 2012-02-04 20:08:11 -08:00
Nathan Rajlich
7af6f688f3 Handle the 'log' event in the bin file. 2012-02-04 19:58:00 -08:00
Nathan Rajlich
59b14eb041 Link to the issue tracker 2012-02-04 19:23:03 -08:00
Nathan Rajlich
bfce4074b3 ... 2012-02-04 13:17:23 -08:00
Nathan Rajlich
fa14232a03 Add a check to make sure all commands invoke their callback. 2012-02-04 12:56:57 -08:00
Nathan Rajlich
09516bb762 Error reporting. 2012-02-03 18:05:14 -08:00
Nathan Rajlich
f34908ab6e Copy npm with it's beginning and result messages. 2012-02-03 15:45:14 -08:00