node-addon-api 2.0.2 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.clang-format +111 -0
- package/.github/workflows/ci.yml +55 -0
- package/.github/workflows/linter.yml +24 -0
- package/.github/workflows/stale.yml +18 -0
- package/.travis.yml +1 -5
- package/CHANGELOG.md +237 -23
- package/README.md +101 -31
- package/appveyor.yml +3 -14
- package/benchmark/README.md +47 -0
- package/benchmark/binding.gyp +25 -0
- package/benchmark/function_args.cc +217 -0
- package/benchmark/function_args.js +60 -0
- package/benchmark/index.js +34 -0
- package/benchmark/property_descriptor.cc +91 -0
- package/benchmark/property_descriptor.js +37 -0
- package/common.gypi +21 -0
- package/doc/addon.md +157 -0
- package/doc/array.md +81 -0
- package/doc/array_buffer.md +20 -0
- package/doc/async_context.md +1 -1
- package/doc/async_worker.md +34 -5
- package/doc/{async_progress_worker.md → async_worker_variants.md} +236 -23
- package/doc/bigint.md +7 -2
- package/doc/boolean.md +5 -1
- package/doc/buffer.md +4 -0
- package/doc/checker-tool.md +1 -1
- package/doc/class_property_descriptor.md +3 -3
- package/doc/creating_a_release.md +6 -6
- package/doc/dataview.md +4 -0
- package/doc/date.md +2 -2
- package/doc/env.md +69 -0
- package/doc/error.md +5 -0
- package/doc/escapable_handle_scope.md +1 -1
- package/doc/external.md +4 -0
- package/doc/function.md +111 -3
- package/doc/function_reference.md +1 -1
- package/doc/handle_scope.md +1 -1
- package/doc/hierarchy.md +91 -0
- package/doc/instance_wrap.md +408 -0
- package/doc/name.md +29 -0
- package/doc/number.md +1 -1
- package/doc/object.md +44 -1
- package/doc/object_lifetime_management.md +2 -2
- package/doc/object_reference.md +1 -1
- package/doc/object_wrap.md +220 -216
- package/doc/prebuild_tools.md +2 -2
- package/doc/promises.md +5 -0
- package/doc/property_descriptor.md +67 -12
- package/doc/setup.md +1 -2
- package/doc/string.md +5 -1
- package/doc/symbol.md +5 -1
- package/doc/threadsafe.md +121 -0
- package/doc/threadsafe_function.md +16 -46
- package/doc/typed_array.md +4 -0
- package/doc/typed_array_of.md +4 -0
- package/doc/typed_threadsafe_function.md +307 -0
- package/doc/value.md +166 -104
- package/doc/version_management.md +2 -2
- package/except.gypi +16 -0
- package/index.js +7 -41
- package/napi-inl.h +1685 -464
- package/napi.h +606 -141
- package/node_api.gyp +9 -0
- package/noexcept.gypi +16 -0
- package/{src/nothing.c → nothing.c} +0 -0
- package/package-support.json +21 -0
- package/package.json +106 -2
- package/tools/README.md +12 -6
- package/tools/clang-format.js +47 -0
- package/tools/conversion.js +4 -8
- package/doc/Doxyfile +0 -2450
- package/doc/basic_types.md +0 -423
- package/doc/working_with_javascript_values.md +0 -14
- package/external-napi/node_api.h +0 -7
- package/src/node_api.cc +0 -3655
- package/src/node_api.gyp +0 -21
- package/src/node_api.h +0 -588
- package/src/node_api_types.h +0 -115
- package/src/node_internals.cc +0 -142
- package/src/node_internals.h +0 -157
- package/src/util-inl.h +0 -38
- package/src/util.h +0 -7
package/node_api.gyp
ADDED
package/noexcept.gypi
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
'defines': [ 'NAPI_DISABLE_CPP_EXCEPTIONS' ],
|
|
3
|
+
'cflags': [ '-fno-exceptions' ],
|
|
4
|
+
'cflags_cc': [ '-fno-exceptions' ],
|
|
5
|
+
'msvs_settings': {
|
|
6
|
+
'VCCLCompilerTool': {
|
|
7
|
+
'ExceptionHandling': 0,
|
|
8
|
+
'EnablePREfast': 'true',
|
|
9
|
+
},
|
|
10
|
+
},
|
|
11
|
+
'xcode_settings': {
|
|
12
|
+
'CLANG_CXX_LIBRARY': 'libc++',
|
|
13
|
+
'MACOSX_DEPLOYMENT_TARGET': '10.7',
|
|
14
|
+
'GCC_ENABLE_CPP_EXCEPTIONS': 'NO',
|
|
15
|
+
},
|
|
16
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"versions": [
|
|
3
|
+
{
|
|
4
|
+
"version": "*",
|
|
5
|
+
"target": {
|
|
6
|
+
"node": "active"
|
|
7
|
+
},
|
|
8
|
+
"response": {
|
|
9
|
+
"type": "time-permitting",
|
|
10
|
+
"paid": false,
|
|
11
|
+
"contact": {
|
|
12
|
+
"name": "node-addon-api team",
|
|
13
|
+
"url": "https://github.com/nodejs/node-addon-api/issues"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"backing": [ { "project": "https://github.com/nodejs" },
|
|
17
|
+
{ "foundation": "https://openjsf.org/" }
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
}
|
package/package.json
CHANGED
|
@@ -11,6 +11,10 @@
|
|
|
11
11
|
"name": "Alba Mendez",
|
|
12
12
|
"url": "https://github.com/jmendeth"
|
|
13
13
|
},
|
|
14
|
+
{
|
|
15
|
+
"name": "András Timár, Dr",
|
|
16
|
+
"url": "https://github.com/timarandras"
|
|
17
|
+
},
|
|
14
18
|
{
|
|
15
19
|
"name": "Andrew Petersen",
|
|
16
20
|
"url": "https://github.com/kirbysayshi"
|
|
@@ -31,6 +35,10 @@
|
|
|
31
35
|
"name": "Arunesh Chandra",
|
|
32
36
|
"url": "https://github.com/aruneshchandra"
|
|
33
37
|
},
|
|
38
|
+
{
|
|
39
|
+
"name": "Azlan Mukhtar",
|
|
40
|
+
"url": "https://github.com/azlan"
|
|
41
|
+
},
|
|
34
42
|
{
|
|
35
43
|
"name": "Ben Berman",
|
|
36
44
|
"url": "https://github.com/rivertam"
|
|
@@ -43,6 +51,10 @@
|
|
|
43
51
|
"name": "Bill Gallafent",
|
|
44
52
|
"url": "https://github.com/gallafent"
|
|
45
53
|
},
|
|
54
|
+
{
|
|
55
|
+
"name": "blagoev",
|
|
56
|
+
"url": "https://github.com/blagoev"
|
|
57
|
+
},
|
|
46
58
|
{
|
|
47
59
|
"name": "Bruce A. MacNaughton",
|
|
48
60
|
"url": "https://github.com/bmacnaughton"
|
|
@@ -51,14 +63,30 @@
|
|
|
51
63
|
"name": "Cory Mickelson",
|
|
52
64
|
"url": "https://github.com/corymickelson"
|
|
53
65
|
},
|
|
66
|
+
{
|
|
67
|
+
"name": "Daniel Bevenius",
|
|
68
|
+
"url": "https://github.com/danbev"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"name": "Darshan Sen",
|
|
72
|
+
"url": "https://github.com/RaisinTen"
|
|
73
|
+
},
|
|
54
74
|
{
|
|
55
75
|
"name": "David Halls",
|
|
56
76
|
"url": "https://github.com/davedoesdev"
|
|
57
77
|
},
|
|
78
|
+
{
|
|
79
|
+
"name": "Dmitry Ashkadov",
|
|
80
|
+
"url": "https://github.com/dmitryash"
|
|
81
|
+
},
|
|
58
82
|
{
|
|
59
83
|
"name": "Dongjin Na",
|
|
60
84
|
"url": "https://github.com/nadongguri"
|
|
61
85
|
},
|
|
86
|
+
{
|
|
87
|
+
"name": "Ferdinand Holzer",
|
|
88
|
+
"url": "https://github.com/fholzer"
|
|
89
|
+
},
|
|
62
90
|
{
|
|
63
91
|
"name": "Eric Bickle",
|
|
64
92
|
"url": "https://github.com/ebickle"
|
|
@@ -67,14 +95,26 @@
|
|
|
67
95
|
"name": "Gabriel Schulhof",
|
|
68
96
|
"url": "https://github.com/gabrielschulhof"
|
|
69
97
|
},
|
|
98
|
+
{
|
|
99
|
+
"name": "Guenter Sandner",
|
|
100
|
+
"url": "https://github.com/gms1"
|
|
101
|
+
},
|
|
70
102
|
{
|
|
71
103
|
"name": "Gus Caplan",
|
|
72
104
|
"url": "https://github.com/devsnek"
|
|
73
105
|
},
|
|
106
|
+
{
|
|
107
|
+
"name": "Helio Frota",
|
|
108
|
+
"url": "https://github.com/helio-frota"
|
|
109
|
+
},
|
|
74
110
|
{
|
|
75
111
|
"name": "Hitesh Kanwathirtha",
|
|
76
112
|
"url": "https://github.com/digitalinfinity"
|
|
77
113
|
},
|
|
114
|
+
{
|
|
115
|
+
"name": "ikokostya",
|
|
116
|
+
"url": "https://github.com/ikokostya"
|
|
117
|
+
},
|
|
78
118
|
{
|
|
79
119
|
"name": "Jake Barnes",
|
|
80
120
|
"url": "https://github.com/DuBistKomisch"
|
|
@@ -87,6 +127,10 @@
|
|
|
87
127
|
"name": "Jason Ginchereau",
|
|
88
128
|
"url": "https://github.com/jasongin"
|
|
89
129
|
},
|
|
130
|
+
{
|
|
131
|
+
"name": "Jeroen Janssen",
|
|
132
|
+
"url": "https://github.com/japj"
|
|
133
|
+
},
|
|
90
134
|
{
|
|
91
135
|
"name": "Jim Schlight",
|
|
92
136
|
"url": "https://github.com/jschlight"
|
|
@@ -99,10 +143,26 @@
|
|
|
99
143
|
"name": "joshgarde",
|
|
100
144
|
"url": "https://github.com/joshgarde"
|
|
101
145
|
},
|
|
146
|
+
{
|
|
147
|
+
"name": "Kasumi Hanazuki",
|
|
148
|
+
"url": "https://github.com/hanazuki"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"name": "Kelvin",
|
|
152
|
+
"url": "https://github.com/kelvinhammond"
|
|
153
|
+
},
|
|
102
154
|
{
|
|
103
155
|
"name": "Kevin Eady",
|
|
104
156
|
"url": "https://github.com/KevinEady"
|
|
105
157
|
},
|
|
158
|
+
{
|
|
159
|
+
"name": "kidneysolo",
|
|
160
|
+
"url": "https://github.com/kidneysolo"
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"name": "Koki Nishihara",
|
|
164
|
+
"url": "https://github.com/Nishikoh"
|
|
165
|
+
},
|
|
106
166
|
{
|
|
107
167
|
"name": "Konstantin Tarkus",
|
|
108
168
|
"url": "https://github.com/koistya"
|
|
@@ -115,10 +175,18 @@
|
|
|
115
175
|
"name": "legendecas",
|
|
116
176
|
"url": "https://github.com/legendecas"
|
|
117
177
|
},
|
|
178
|
+
{
|
|
179
|
+
"name": "Lovell Fuller",
|
|
180
|
+
"url": "https://github.com/lovell"
|
|
181
|
+
},
|
|
118
182
|
{
|
|
119
183
|
"name": "Luciano Martorella",
|
|
120
184
|
"url": "https://github.com/lmartorella"
|
|
121
185
|
},
|
|
186
|
+
{
|
|
187
|
+
"name": "mastergberry",
|
|
188
|
+
"url": "https://github.com/mastergberry"
|
|
189
|
+
},
|
|
122
190
|
{
|
|
123
191
|
"name": "Mathias Küsel",
|
|
124
192
|
"url": "https://github.com/mathiask88"
|
|
@@ -143,6 +211,10 @@
|
|
|
143
211
|
"name": "Mikhail Cheshkov",
|
|
144
212
|
"url": "https://github.com/mcheshkov"
|
|
145
213
|
},
|
|
214
|
+
{
|
|
215
|
+
"name": "nempoBu4",
|
|
216
|
+
"url": "https://github.com/nempoBu4"
|
|
217
|
+
},
|
|
146
218
|
{
|
|
147
219
|
"name": "Nicola Del Gobbo",
|
|
148
220
|
"url": "https://github.com/NickNaso"
|
|
@@ -151,10 +223,18 @@
|
|
|
151
223
|
"name": "Nick Soggin",
|
|
152
224
|
"url": "https://github.com/iSkore"
|
|
153
225
|
},
|
|
226
|
+
{
|
|
227
|
+
"name": "Nikolai Vavilov",
|
|
228
|
+
"url": "https://github.com/seishun"
|
|
229
|
+
},
|
|
154
230
|
{
|
|
155
231
|
"name": "Nurbol Alpysbayev",
|
|
156
232
|
"url": "https://github.com/anurbol"
|
|
157
233
|
},
|
|
234
|
+
{
|
|
235
|
+
"name": "pacop",
|
|
236
|
+
"url": "https://github.com/pacop"
|
|
237
|
+
},
|
|
158
238
|
{
|
|
159
239
|
"name": "Philipp Renoth",
|
|
160
240
|
"url": "https://github.com/DaAitch"
|
|
@@ -199,17 +279,35 @@
|
|
|
199
279
|
"name": "Tux3",
|
|
200
280
|
"url": "https://github.com/tux3"
|
|
201
281
|
},
|
|
282
|
+
{
|
|
283
|
+
"name": "Vlad Velmisov",
|
|
284
|
+
"url": "https://github.com/Velmisov"
|
|
285
|
+
},
|
|
202
286
|
{
|
|
203
287
|
"name": "Yohei Kishimoto",
|
|
204
288
|
"url": "https://github.com/morokosi"
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
"name": "Yulong Wang",
|
|
292
|
+
"url": "https://github.com/fs-eire"
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
"name": "Ziqiu Zhao",
|
|
296
|
+
"url": "https://github.com/ZzqiZQute"
|
|
205
297
|
}
|
|
206
298
|
],
|
|
207
299
|
"dependencies": {},
|
|
208
300
|
"description": "Node.js API (N-API)",
|
|
209
301
|
"devDependencies": {
|
|
302
|
+
"benchmark": "^2.1.4",
|
|
303
|
+
"bindings": "^1.5.0",
|
|
304
|
+
"clang-format": "^1.4.0",
|
|
305
|
+
"fs-extra": "^9.0.1",
|
|
306
|
+
"pre-commit": "^1.2.2",
|
|
210
307
|
"safe-buffer": "^5.1.1"
|
|
211
308
|
},
|
|
212
309
|
"directories": {},
|
|
310
|
+
"gypfile": false,
|
|
213
311
|
"homepage": "https://github.com/nodejs/node-addon-api",
|
|
214
312
|
"keywords": [
|
|
215
313
|
"n-api",
|
|
@@ -232,13 +330,19 @@
|
|
|
232
330
|
"url": "git://github.com/nodejs/node-addon-api.git"
|
|
233
331
|
},
|
|
234
332
|
"scripts": {
|
|
333
|
+
"prebenchmark": "node-gyp rebuild -C benchmark",
|
|
334
|
+
"benchmark": "node benchmark",
|
|
235
335
|
"pretest": "node-gyp rebuild -C test",
|
|
236
336
|
"test": "node test",
|
|
237
337
|
"predev": "node-gyp rebuild -C test --debug",
|
|
238
338
|
"dev": "node test",
|
|
239
339
|
"predev:incremental": "node-gyp configure build -C test --debug",
|
|
240
340
|
"dev:incremental": "node test",
|
|
241
|
-
"doc": "doxygen doc/Doxyfile"
|
|
341
|
+
"doc": "doxygen doc/Doxyfile",
|
|
342
|
+
"lint": "node tools/clang-format.js",
|
|
343
|
+
"lint:fix": "git-clang-format '*.h', '*.cc'"
|
|
242
344
|
},
|
|
243
|
-
"
|
|
345
|
+
"pre-commit": "lint",
|
|
346
|
+
"version": "3.1.0",
|
|
347
|
+
"support": true
|
|
244
348
|
}
|
package/tools/README.md
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Tools
|
|
2
|
+
|
|
3
|
+
## clang-format
|
|
4
|
+
|
|
5
|
+
The clang-format checking tools is designed to check changed lines of code compared to given git-refs.
|
|
6
|
+
|
|
7
|
+
## Migration Script
|
|
2
8
|
|
|
3
9
|
The migration tool is designed to reduce repetitive work in the migration process. However, the script is not aiming to convert every thing for you. There are usually some small fixes and major reconstruction required.
|
|
4
10
|
|
|
@@ -42,17 +48,17 @@ and define it as
|
|
|
42
48
|
This way, the `Napi::ObjectWrap` constructor will be invoked after the object has been instantiated and `Napi::ObjectWrap` can use the `this` pointer to create a reference to the wrapped object.
|
|
43
49
|
|
|
44
50
|
2. Move your original constructor code into the new constructor. Delete your original constructor.
|
|
45
|
-
3. In your class initialization function, associate native methods in the following way.
|
|
51
|
+
3. In your class initialization function, associate native methods in the following way.
|
|
46
52
|
```
|
|
47
53
|
Napi::FunctionReference constructor;
|
|
48
54
|
|
|
49
55
|
void [ClassName]::Init(Napi::Env env, Napi::Object exports, Napi::Object module) {
|
|
50
56
|
Napi::HandleScope scope(env);
|
|
51
57
|
Napi::Function ctor = DefineClass(env, "Canvas", {
|
|
52
|
-
InstanceMethod
|
|
53
|
-
InstanceMethod
|
|
54
|
-
InstanceAccessor
|
|
55
|
-
StaticMethod
|
|
58
|
+
InstanceMethod<&[ClassName]::Func1>("Func1"),
|
|
59
|
+
InstanceMethod<&[ClassName]::Func2>("Func2"),
|
|
60
|
+
InstanceAccessor<&[ClassName]::ValueGetter>("Value"),
|
|
61
|
+
StaticMethod<&[ClassName]::StaticMethod>("MethodName"),
|
|
56
62
|
InstanceValue("Value", Napi::[Type]::New(env, value)),
|
|
57
63
|
});
|
|
58
64
|
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const spawn = require('child_process').spawnSync;
|
|
4
|
+
const path = require('path');
|
|
5
|
+
|
|
6
|
+
const filesToCheck = ['*.h', '*.cc'];
|
|
7
|
+
const CLANG_FORMAT_START = process.env.CLANG_FORMAT_START || 'master';
|
|
8
|
+
|
|
9
|
+
function main(args) {
|
|
10
|
+
let clangFormatPath = path.dirname(require.resolve('clang-format'));
|
|
11
|
+
const options = ['--binary=node_modules/.bin/clang-format', '--style=file'];
|
|
12
|
+
|
|
13
|
+
const gitClangFormatPath = path.join(clangFormatPath,
|
|
14
|
+
'bin/git-clang-format');
|
|
15
|
+
const result = spawn('python', [
|
|
16
|
+
gitClangFormatPath,
|
|
17
|
+
...options,
|
|
18
|
+
'--diff',
|
|
19
|
+
CLANG_FORMAT_START,
|
|
20
|
+
'HEAD',
|
|
21
|
+
...filesToCheck
|
|
22
|
+
], { encoding: 'utf-8' });
|
|
23
|
+
|
|
24
|
+
if (result.error) {
|
|
25
|
+
console.error('Error running git-clang-format:', result.error);
|
|
26
|
+
return 2;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const clangFormatOutput = result.stdout.trim();
|
|
30
|
+
if (clangFormatOutput !== '' &&
|
|
31
|
+
clangFormatOutput !== ('no modified files to format') &&
|
|
32
|
+
clangFormatOutput !== ('clang-format did not modify any files')) {
|
|
33
|
+
console.error(clangFormatOutput);
|
|
34
|
+
const fixCmd = '"npm run lint:fix"';
|
|
35
|
+
console.error(`
|
|
36
|
+
ERROR: please run ${fixCmd} to format changes in your commit
|
|
37
|
+
Note that when running the command locally, please keep your local
|
|
38
|
+
master branch and working branch up to date with nodejs/node-addon-api
|
|
39
|
+
to exclude un-related complains.
|
|
40
|
+
Or you can run "env CLANG_FORMAT_START=upstream/master ${fixCmd}".`);
|
|
41
|
+
return 1;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (require.main === module) {
|
|
46
|
+
process.exitCode = main(process.argv.slice(2));
|
|
47
|
+
}
|
package/tools/conversion.js
CHANGED
|
@@ -22,10 +22,8 @@ if (disable != "--disable" && dir != "--disable") {
|
|
|
22
22
|
[ /[ ]*"nan": *"[^"]+"(,|)[\n\r]/g, '' ]
|
|
23
23
|
],
|
|
24
24
|
'binding.gyp': [
|
|
25
|
-
[ /([ ]*)'include_dirs': \[/g, '$1\'include_dirs\': [\n$1 \'
|
|
26
|
-
[ /([ ]*)"include_dirs": \[/g, '$1"include_dirs": [\n$1 "
|
|
27
|
-
[ /([ ]*)'dependencies': \[/g, '$1\'dependencies\': [\n$1 \'<!(node -p "require(\\\'node-addon-api\\\').gyp")\','],
|
|
28
|
-
[ /([ ]*)"dependencies": \[/g, '$1"dependencies": [\n$1 "<!(node -p \'require(\\\"node-addon-api\\\").gyp\')",'],
|
|
25
|
+
[ /([ ]*)'include_dirs': \[/g, '$1\'include_dirs\': [\n$1 \'<!(node -p "require(\\\'node-addon-api\\\').include_dir")\',' ],
|
|
26
|
+
[ /([ ]*)"include_dirs": \[/g, '$1"include_dirs": [\n$1 "<!(node -p \\"require(\'node-addon-api\').include_dir\\")",' ],
|
|
29
27
|
[ /[ ]*("|')<!\(node -e ("|'|\\"|\\')require\(("|'|\\"|\\')nan("|'|\\"|\\')\)("|'|\\"|\\')\)("|')(,|)[\r\n]/g, '' ],
|
|
30
28
|
[ /([ ]*)("|')target_name("|'): ("|')(.+?)("|'),/g, '$1$2target_name$2: $4$5$6,\n $2cflags!$2: [ $2-fno-exceptions$2 ],\n $2cflags_cc!$2: [ $2-fno-exceptions$2 ],\n $2xcode_settings$2: { $2GCC_ENABLE_CPP_EXCEPTIONS$2: $2YES$2,\n $2CLANG_CXX_LIBRARY$2: $2libc++$2,\n $2MACOSX_DEPLOYMENT_TARGET$2: $210.7$2,\n },\n $2msvs_settings$2: {\n $2VCCLCompilerTool$2: { $2ExceptionHandling$2: 1 },\n },' ],
|
|
31
29
|
]
|
|
@@ -37,10 +35,8 @@ if (disable != "--disable" && dir != "--disable") {
|
|
|
37
35
|
[ /[ ]*"nan": *"[^"]+"(,|)[\n\r]/g, '' ]
|
|
38
36
|
],
|
|
39
37
|
'binding.gyp': [
|
|
40
|
-
[ /([ ]*)'include_dirs': \[/g, '$1\'include_dirs\': [\n$1 \'
|
|
41
|
-
[ /([ ]*)"include_dirs": \[/g, '$1"include_dirs": [\n$1 "
|
|
42
|
-
[ /([ ]*)'dependencies': \[/g, '$1\'dependencies\': [\n$1 \'<!(node -p "require(\\\'node-addon-api\\\').gyp")\','],
|
|
43
|
-
[ /([ ]*)"dependencies": \[/g, '$1"dependencies": [\n$1 "<!(node -p \'require(\\\"node-addon-api\\\").gyp\')",'],
|
|
38
|
+
[ /([ ]*)'include_dirs': \[/g, '$1\'include_dirs\': [\n$1 \'<!(node -p "require(\\\'node-addon-api\\\').include_dir")\',' ],
|
|
39
|
+
[ /([ ]*)"include_dirs": \[/g, '$1"include_dirs": [\n$1 "<!(node -p \'require(\\\"node-addon-api\\\").include_dir\')",' ],
|
|
44
40
|
[ /[ ]*("|')<!\(node -e ("|'|\\"|\\')require\(("|'|\\"|\\')nan("|'|\\"|\\')\)("|'|\\"|\\')\)("|')(,|)[\r\n]/g, '' ],
|
|
45
41
|
[ /([ ]*)("|')target_name("|'): ("|')(.+?)("|'),/g, '$1$2target_name$2: $4$5$6,\n $2cflags!$2: [ $2-fno-exceptions$2 ],\n $2cflags_cc!$2: [ $2-fno-exceptions$2 ],\n $2defines$2: [ $2NAPI_DISABLE_CPP_EXCEPTIONS$2 ],\n $2conditions$2: [\n [\'OS==\"win\"\', { $2defines$2: [ $2_HAS_EXCEPTIONS=1$2 ] }]\n ]' ],
|
|
46
42
|
]
|