From 180d0c813e6d8eb31c10a026637e84472d669908 Mon Sep 17 00:00:00 2001 From: John French Date: Thu, 17 Jan 2019 09:02:23 +0900 Subject: [PATCH] build: new build targets for debug purposes In this project, we can use the following command to test examples. $ npm test It might be very inefficient, especially, if the number of files increases. So, this patch introduces new build targets for debugging purpose as follows: $ npm run-script dev # Build with --debug option $ npm run-script dev:incremental # Incremental dev build This idea comes from @DaAitch. PR-URL: https://github.com/nodejs/node-addon-api/pull/186 Reviewed-By: Gabriel Schulhof Reviewed-By: NickNaso Reviewed-By: Michael Dawson --- README.md | 14 ++++++++++++++ package.json | 4 ++++ 2 files changed, 18 insertions(+) diff --git a/README.md b/README.md index a38309f..1116cae 100644 --- a/README.md +++ b/README.md @@ -141,6 +141,20 @@ npm install npm test --disable-deprecated ``` +### **Debug** + +To run the **node-addon-api** tests with `--debug` option: + +``` +npm run-script dev +``` + +If you want faster build, you might use the following option: + +``` +npm run-script dev:incremental +``` + Take a look and get inspired by our **[test suite](https://github.com/nodejs/node-addon-api/tree/master/test)** diff --git a/package.json b/package.json index 2adc03e..028b72b 100644 --- a/package.json +++ b/package.json @@ -56,6 +56,10 @@ "scripts": { "pretest": "node-gyp rebuild -C test", "test": "node test", + "predev": "node-gyp rebuild -C test --debug", + "dev": "node test", + "predev:incremental": "node-gyp configure build -C test --debug", + "dev:incremental": "node test", "doc": "doxygen doc/Doxyfile" }, "version": "1.6.2"