koffi 2.8.9 → 2.8.11

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.
Files changed (50) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/koffi/darwin_arm64/koffi.node +0 -0
  3. package/build/koffi/darwin_x64/koffi.node +0 -0
  4. package/build/koffi/freebsd_arm64/koffi.node +0 -0
  5. package/build/koffi/freebsd_ia32/koffi.node +0 -0
  6. package/build/koffi/freebsd_x64/koffi.node +0 -0
  7. package/build/koffi/linux_arm64/koffi.node +0 -0
  8. package/build/koffi/linux_armhf/koffi.node +0 -0
  9. package/build/koffi/linux_ia32/koffi.node +0 -0
  10. package/build/koffi/linux_riscv64d/koffi.node +0 -0
  11. package/build/koffi/linux_x64/koffi.node +0 -0
  12. package/build/koffi/openbsd_ia32/koffi.node +0 -0
  13. package/build/koffi/openbsd_x64/koffi.node +0 -0
  14. package/build/koffi/win32_arm64/koffi.exp +0 -0
  15. package/build/koffi/win32_arm64/koffi.lib +0 -0
  16. package/build/koffi/win32_arm64/koffi.node +0 -0
  17. package/build/koffi/win32_ia32/koffi.exp +0 -0
  18. package/build/koffi/win32_ia32/koffi.lib +0 -0
  19. package/build/koffi/win32_ia32/koffi.node +0 -0
  20. package/build/koffi/win32_x64/koffi.exp +0 -0
  21. package/build/koffi/win32_x64/koffi.lib +0 -0
  22. package/build/koffi/win32_x64/koffi.node +0 -0
  23. package/index.js +28 -48
  24. package/indirect.js +24 -44
  25. package/package.json +5 -3
  26. package/src/cnoke/assets/FindCNoke.cmake +16 -3
  27. package/src/cnoke/src/builder.js +109 -102
  28. package/src/cnoke/src/tools.js +5 -23
  29. package/src/koffi/CMakeLists.txt +2 -12
  30. package/vendor/node-api-headers/CHANGELOG.md +79 -0
  31. package/vendor/node-api-headers/CODE_OF_CONDUCT.md +4 -0
  32. package/vendor/node-api-headers/CONTRIBUTING.md +32 -0
  33. package/vendor/node-api-headers/CREATING_A_RELEASE.md +58 -0
  34. package/vendor/node-api-headers/LICENSE +21 -0
  35. package/vendor/node-api-headers/README.md +106 -0
  36. package/vendor/node-api-headers/def/js_native_api.def +120 -0
  37. package/vendor/node-api-headers/def/node_api.def +151 -0
  38. package/vendor/node-api-headers/include/js_native_api.h +569 -0
  39. package/vendor/node-api-headers/include/js_native_api_types.h +168 -0
  40. package/vendor/node-api-headers/include/node_api.h +260 -0
  41. package/vendor/node-api-headers/include/node_api_types.h +52 -0
  42. package/vendor/node-api-headers/index.js +17 -0
  43. package/vendor/node-api-headers/package.json +59 -0
  44. package/vendor/node-api-headers/scripts/clang-utils.js +50 -0
  45. package/vendor/node-api-headers/scripts/update-headers.js +189 -0
  46. package/vendor/node-api-headers/scripts/write-symbols.js +154 -0
  47. package/vendor/node-api-headers/scripts/write-win32-def.js +52 -0
  48. package/vendor/node-api-headers/symbols.js +241 -0
  49. package/build/koffi/linux_arm32hf/koffi.node +0 -0
  50. package/build/koffi/linux_riscv64hf64/koffi.node +0 -0
@@ -45,8 +45,9 @@ function Builder(config = {}) {
45
45
  app_dir = app_dir.replace(/\\/g, '/');
46
46
  project_dir = project_dir.replace(/\\/g, '/');
47
47
  if (package_dir == null)
48
- package_dir = project_dir;
49
- package_dir = package_dir.replace(/\\/g, '/');
48
+ package_dir = find_parent_directory(project_dir, 'package.json');
49
+ if (package_dir != null)
50
+ package_dir = package_dir.replace(/\\/g, '/');
50
51
 
51
52
  let runtime_version = config.runtime_version;
52
53
  let arch = config.arch;
@@ -64,27 +65,29 @@ function Builder(config = {}) {
64
65
  if (arch == null)
65
66
  arch = tools.determine_arch();
66
67
 
68
+ let options = null;
69
+
67
70
  let cache_dir = get_cache_directory();
68
71
  let build_dir = config.build_dir;
69
72
  let work_dir = null;
70
73
 
71
74
  if (build_dir == null) {
72
- let pkg = read_package_json();
73
-
74
- if (pkg.cnoke.output != null) {
75
- build_dir = expand_path(pkg.cnoke.output);
75
+ let options = read_cnoke_options();
76
76
 
77
- if (!tools.path_is_absolute(build_dir))
78
- build_dir = package_dir + '/' + build_dir;
77
+ if (options.output != null) {
78
+ build_dir = expand_path(options.output, options.directory);
79
79
  } else {
80
80
  build_dir = project_dir + '/build';
81
81
  }
82
82
  }
83
+ build_dir = build_dir.replace(/\\/g, '/');
83
84
  work_dir = build_dir + `/v${runtime_version}_${arch}`;
84
85
 
85
86
  let cmake_bin = null;
86
87
 
87
88
  this.configure = async function(retry = true) {
89
+ let options = read_cnoke_options();
90
+
88
91
  let args = [project_dir];
89
92
 
90
93
  check_cmake();
@@ -94,63 +97,68 @@ function Builder(config = {}) {
94
97
  console.log(`>> Target: ${process.platform}_${arch}`);
95
98
 
96
99
  // Prepare build directory
97
- fs.mkdirSync(cache_dir, { recursive: true, mode: 0o755 });
98
100
  fs.mkdirSync(build_dir, { recursive: true, mode: 0o755 });
99
101
  fs.mkdirSync(work_dir, { recursive: true, mode: 0o755 });
100
102
 
101
103
  retry &= fs.existsSync(work_dir + '/CMakeCache.txt');
102
104
 
103
- // Download Node headers
104
- {
105
- let basename = `node-v${runtime_version}-headers.tar.gz`;
106
- let urls = [
107
- `https://nodejs.org/dist/v${runtime_version}/${basename}`,
108
- // `https://unofficial-builds.nodejs.org/download/release/v${runtime_version}/${basename}`
109
- ];
110
- let destname = `${cache_dir}/${basename}`;
111
-
112
- if (!fs.existsSync(destname))
113
- await tools.download_http(urls, destname);
105
+ // Download or use Node headers
106
+ if (options.api == null) {
107
+ let destname = `${cache_dir}/node-v${runtime_version}-headers.tar.gz`;
108
+
109
+ if (!fs.existsSync(destname)) {
110
+ fs.mkdirSync(cache_dir, { recursive: true, mode: 0o755 });
111
+
112
+ let url = `https://nodejs.org/dist/v${runtime_version}/node-v${runtime_version}-headers.tar.gz`;
113
+ await tools.download_http(url, destname);
114
+ }
115
+
114
116
  await tools.extract_targz(destname, work_dir + '/headers', 1);
117
+
118
+ args.push(`-DNODE_JS_INCLUDE_DIRS=${work_dir}/headers/include/node`);
119
+ } else {
120
+ console.log(`>> Using local node-api headers`);
121
+ args.push(`-DNODE_JS_INCLUDE_DIRS=${options.api}/include`);
115
122
  }
116
123
 
117
- // Download Node import library (Windows)
118
- if (process.platform === 'win32') {
119
- let dirname;
120
- switch (arch) {
121
- case 'ia32': { dirname = 'win-x86'; } break;
122
- case 'x64': { dirname = 'win-x64'; } break;
123
- case 'arm64': { dirname = 'win-arm64'; } break;
124
+ // Download or create Node import library (Windows)
125
+ if (process.platform == 'win32') {
126
+ if (options.api == null) {
127
+ let dirname;
128
+ switch (arch) {
129
+ case 'ia32': { dirname = 'win-x86'; } break;
130
+ case 'x64': { dirname = 'win-x64'; } break;
131
+ case 'arm64': { dirname = 'win-arm64'; } break;
124
132
 
125
- default: {
126
- throw new Error(`Unsupported architecture '${arch}' for Node on Windows`);
127
- } break;
128
- }
133
+ default: {
134
+ throw new Error(`Unsupported architecture '${arch}' for Node on Windows`);
135
+ } break;
136
+ }
129
137
 
130
- let destname = `${cache_dir}/node_v${runtime_version}_${arch}.lib`;
138
+ let destname = `${cache_dir}/node_v${runtime_version}_${arch}.lib`;
131
139
 
132
- if (!fs.existsSync(destname)) {
133
- let urls = [
134
- `https://nodejs.org/dist/v${runtime_version}/${dirname}/node.lib`,
135
- // `https://unofficial-builds.nodejs.org/download/release/v${runtime_version}/${dirname}/node.lib`
136
- ];
137
- await tools.download_http(urls, destname);
138
- }
140
+ if (!fs.existsSync(destname)) {
141
+ fs.mkdirSync(cache_dir, { recursive: true, mode: 0o755 });
139
142
 
140
- fs.copyFileSync(destname, work_dir + '/node.lib');
143
+ let url = `https://nodejs.org/dist/v${runtime_version}/${dirname}/node.lib`;
144
+ await tools.download_http(url, destname);
145
+ }
146
+
147
+ fs.copyFileSync(destname, work_dir + '/node.lib');
148
+ } else {
149
+ args.push(`-DNODE_JS_LINK_DEF=${options.api}/def/node_api.def`);
150
+ }
141
151
  }
142
152
 
143
153
  args.push(`-DCMAKE_MODULE_PATH=${app_dir}/assets`);
144
154
 
145
- args.push(`-DNODE_JS_INCLUDE_DIRS=${work_dir}/headers/include/node`);
146
-
147
155
  // Set platform flags
148
156
  switch (process.platform) {
149
157
  case 'win32': {
150
158
  fs.copyFileSync(`${app_dir}/assets/win_delay_hook.c`, work_dir + '/win_delay_hook.c');
151
159
 
152
160
  args.push(`-DNODE_JS_SOURCES=${work_dir}/win_delay_hook.c`);
153
- args.push(`-DNODE_JS_LIBRARIES=${work_dir}/node.lib`);
161
+ args.push(`-DNODE_JS_LINK_LIB=${work_dir}/node.lib`);
154
162
 
155
163
  switch (arch) {
156
164
  case 'ia32': {
@@ -256,56 +264,27 @@ function Builder(config = {}) {
256
264
  };
257
265
 
258
266
  async function check_prebuild() {
259
- let pkg = read_package_json();
267
+ let options = read_cnoke_options();
260
268
 
261
- if (pkg.cnoke.prebuild != null) {
269
+ if (options.prebuild != null) {
262
270
  fs.mkdirSync(build_dir, { recursive: true, mode: 0o755 });
263
271
 
264
- let url = expand_path(pkg.cnoke.prebuild);
265
- let basename = path.basename(url);
266
-
267
- try {
268
- let archive_filename = null;
269
-
270
- if (url.startsWith('file:/')) {
271
- if (url.startsWith('file://localhost/')) {
272
- url = url.substr(16);
273
- } else {
274
- let offset = 6;
275
- while (offset < 9 && url[offset] == '/')
276
- offset++;
277
- url = url.substr(offset - 1);
278
- }
272
+ let archive_filename = expand_path(options.prebuild, options.directory);
279
273
 
280
- if (process.platform == 'win32' && url.match(/^\/[a-zA-Z]+:[\\\/]/))
281
- url = url.substr(1);
274
+ if (fs.existsSync(archive_filename)) {
275
+ try {
276
+ console.log('>> Extracting prebuilt binaries...');
277
+ await tools.extract_targz(archive_filename, build_dir, 1);
278
+ } catch (err) {
279
+ console.error('Failed to find prebuilt binary for your platform, building manually');
282
280
  }
283
-
284
- if (url.match(/^[a-z]+:\/\//)) {
285
- archive_filename = build_dir + '/' + basename;
286
- await tools.download_http(url, archive_filename);
287
- } else {
288
- archive_filename = url;
289
-
290
- if (!tools.path_is_absolute(archive_filename))
291
- archive_filename = path.join(package_dir, archive_filename);
292
-
293
- if (!fs.existsSync(archive_filename))
294
- throw new Error('Cannot find local prebuilt archive');
295
- }
296
-
297
- console.log('>> Extracting prebuilt binaries...');
298
- await tools.extract_targz(archive_filename, build_dir, 1);
299
- } catch (err) {
300
- console.error('Failed to find prebuilt binary for your platform, building manually');
281
+ } else {
282
+ console.error('Cannot find local prebuilt archive');
301
283
  }
302
284
  }
303
285
 
304
- if (pkg.cnoke.require != null) {
305
- let require_filename = expand_path(pkg.cnoke.require);
306
-
307
- if (!tools.path_is_absolute(require_filename))
308
- require_filename = path.join(package_dir, require_filename);
286
+ if (options.require != null) {
287
+ let require_filename = expand_path(options.require, options.directory);
309
288
 
310
289
  if (fs.existsSync(require_filename)) {
311
290
  let proc = spawnSync(process.execPath, ['-e', 'require(process.argv[1])', require_filename]);
@@ -403,47 +382,72 @@ function Builder(config = {}) {
403
382
  }
404
383
 
405
384
  function check_compatibility() {
406
- let pkg = read_package_json();
385
+ let options = read_cnoke_options();
407
386
 
408
- if (pkg.cnoke.node != null && tools.cmp_version(runtime_version, pkg.cnoke.node) < 0)
409
- throw new Error(`Project ${pkg.name} requires Node.js >= ${pkg.cnoke.node}`);
387
+ if (options.node != null && tools.cmp_version(runtime_version, options.node) < 0)
388
+ throw new Error(`Project ${options.name} requires Node.js >= ${options.node}`);
410
389
 
411
- if (pkg.cnoke.napi != null) {
390
+ if (options.napi != null) {
412
391
  let major = parseInt(runtime_version, 10);
413
- let required = tools.get_napi_version(pkg.cnoke.napi, major);
392
+ let required = tools.get_napi_version(options.napi, major);
414
393
 
415
394
  if (required == null)
416
- throw new Error(`Project ${pkg.name} does not support the Node ${major}.x branch (old or missing N-API)`);
395
+ throw new Error(`Project ${options.name} does not support the Node ${major}.x branch (old or missing N-API)`);
417
396
  if (tools.cmp_version(runtime_version, required) < 0)
418
- throw new Error(`Project ${pkg.name} requires Node >= ${required} in the Node ${major}.x branch (with N-API >= ${pkg.engines.napi})`);
397
+ throw new Error(`Project ${options.name} requires Node >= ${required} in the Node ${major}.x branch (with N-API >= ${options.napi})`);
419
398
  }
420
399
  }
421
400
 
422
- function read_package_json() {
423
- let pkg = {};
401
+ function read_cnoke_options() {
402
+ if (options != null)
403
+ return options;
404
+
405
+ let directory = project_dir;
406
+ let pkg = null;
407
+ let cnoke = null;
424
408
 
425
409
  if (package_dir != null) {
426
410
  try {
427
411
  let json = fs.readFileSync(package_dir + '/package.json', { encoding: 'utf-8' });
412
+
428
413
  pkg = JSON.parse(json);
414
+ directory = package_dir;
429
415
  } catch (err) {
430
416
  if (err.code != 'ENOENT')
431
417
  throw err;
432
418
  }
433
419
  }
434
420
 
435
- if (pkg.cnoke == null)
436
- pkg.cnoke = {};
421
+ try {
422
+ let json = fs.readFileSync(project_dir + '/CNoke.json', { encoding: 'utf-8' });
423
+
424
+ cnoke = JSON.parse(json);
425
+ directory = project_dir;
426
+ } catch (err) {
427
+ if (err.code != 'ENOENT')
428
+ throw err;
429
+ }
430
+
431
+ if (cnoke == null)
432
+ cnoke = pkg?.cnoke ?? {};
433
+
434
+ options = {
435
+ name: pkg?.name ?? path.basename(project_dir),
436
+ version: pkg?.version ?? null,
437
437
 
438
- return pkg;
438
+ directory: directory,
439
+ ...cnoke
440
+ };
441
+
442
+ return options;
439
443
  }
440
444
 
441
- function expand_path(str) {
442
- let ret = str.replace(/{{ *([a-zA-Z_][a-zA-Z_0-9]*) *}}/g, (match, p1) => {
445
+ function expand_path(str, root_dir) {
446
+ let expanded = str.replace(/{{ *([a-zA-Z_][a-zA-Z_0-9]*) *}}/g, (match, p1) => {
443
447
  switch (p1) {
444
448
  case 'version': {
445
- let pkg = read_package_json();
446
- return pkg.version || '';
449
+ let options = read_cnoke_options();
450
+ return options.version || '';
447
451
  } break;
448
452
  case 'platform': return process.platform;
449
453
  case 'arch': return arch;
@@ -452,7 +456,10 @@ function Builder(config = {}) {
452
456
  }
453
457
  });
454
458
 
455
- return ret;
459
+ if (!tools.path_is_absolute(expanded))
460
+ expanded = path.join(root_dir, expanded);
461
+
462
+ return expanded;
456
463
  }
457
464
  }
458
465
 
@@ -28,22 +28,6 @@ const path = require('path');
28
28
  const zlib = require('zlib');
29
29
 
30
30
  async function download_http(url, dest) {
31
- if (Array.isArray(url)) {
32
- let urls = url;
33
-
34
- for (let url of urls) {
35
- try {
36
- await download_http(url, dest);
37
- return;
38
- } catch (err) {
39
- if (err.code != 404)
40
- throw err;
41
- }
42
- }
43
-
44
- throw new Error('All URLs returned error 404');
45
- }
46
-
47
31
  console.log('>> Downloading ' + url);
48
32
 
49
33
  let [tmp_name, file] = open_temporary_stream(dest);
@@ -255,17 +239,15 @@ function determine_arch() {
255
239
  if (arch == 'riscv32' || arch == 'riscv64') {
256
240
  let buf = read_file_header(process.execPath, 512);
257
241
  let header = decode_elf_header(buf);
258
- let float_abi = (header.e_flags & 0x6) >> 1;
242
+ let float_abi = (header.e_flags & 0x6);
259
243
 
260
244
  switch (float_abi) {
261
- case 0: { arch += 'sf'; } break;
262
- case 1: { arch += 'hf32'; } break;
263
- case 2: { arch += 'hf64'; } break;
264
- case 3: { arch += 'hf128'; } break;
245
+ case 0: {} break;
246
+ case 2: { arch += 'f'; } break;
247
+ case 4: { arch += 'd'; } break;
248
+ case 6: { arch += 'q'; } break;
265
249
  }
266
250
  } else if (arch == 'arm') {
267
- arch = 'arm32';
268
-
269
251
  let buf = read_file_header(process.execPath, 512);
270
252
  let header = decode_elf_header(buf);
271
253
 
@@ -34,7 +34,7 @@ include(CheckCXXCompilerFlag)
34
34
  set(CMAKE_CXX_STANDARD 20)
35
35
  if(MSVC)
36
36
  set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreaded)
37
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:__cplusplus /Zc:preprocessor /W4 /wd4200 /wd4201 /wd4127 /wd4458 /wd4706 /wd4702 /wd4324")
37
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:__cplusplus /Zc:preprocessor /Zc:twoPhase- /W4 /wd4200 /wd4201 /wd4127 /wd4458 /wd4706 /wd4702 /wd4324")
38
38
 
39
39
  # ASM_MASM does not (yet) work on Windows ARM64
40
40
  if(NOT CMAKE_GENERATOR_PLATFORM MATCHES "ARM64")
@@ -50,17 +50,7 @@ endif()
50
50
 
51
51
  # ---- Koffi ----
52
52
 
53
- # Recompute the version string after each commit
54
- if(EXISTS "${CMAKE_SOURCE_DIR}/../../.git/logs/HEAD")
55
- configure_file("${CMAKE_SOURCE_DIR}/../../.git/logs/HEAD" git_logs_HEAD COPYONLY)
56
- endif()
57
- if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/package.json)
58
- file(READ ${CMAKE_CURRENT_SOURCE_DIR}/package.json PKG)
59
- else()
60
- file(READ ${CMAKE_CURRENT_SOURCE_DIR}/../../package.json PKG)
61
- endif()
62
- string(REGEX MATCH "\"version\": \"([^\"]+)\"" XX "${PKG}")
63
- set(KOFFI_VERSION ${CMAKE_MATCH_1})
53
+ set(KOFFI_VERSION 2.8.10)
64
54
 
65
55
  set_source_files_properties(src/ffi.cc PROPERTIES COMPILE_DEFINITIONS VERSION=${KOFFI_VERSION})
66
56
 
@@ -0,0 +1,79 @@
1
+ # node-api-headers Changelog
2
+
3
+ ## 2023-08-05 Version 1.1.0, @NickNaso
4
+
5
+ ### Notable changes
6
+
7
+ - Update headers from nodejs/node tag v20.3.0.
8
+
9
+ ### Commits
10
+
11
+ - \[[`1f5a85dbb0`](https://github.com/nodejs/node-api-headers/commit/1f5a85dbb0)] - Update headers from nodejs/node tag v20.3.0 (#30) (github-actions\[bot])
12
+
13
+ ## 2023-05-18 Version 1.0.1, @NickNaso
14
+
15
+ ### Notable changes
16
+
17
+ - Update headers from nodejs/node tag v20.2.0.
18
+
19
+ ### Commits
20
+
21
+ - \[[`d61451e6a3`](https://github.com/nodejs/node-api-headers/commit/d61451e6a3)] - Update headers from nodejs/node tag v20.2.0 (#27) (github-actions\[bot])
22
+
23
+ ## 2023-04-20 Version 1.0.0, @NickNaso
24
+
25
+ ### Notable changes
26
+
27
+ - Explain package version rationale.
28
+ - Update headers from nodejs/node tag v19.9.0.
29
+
30
+ ### Commits
31
+
32
+ - \[[`130338da33`](https://github.com/nodejs/node-api-headers/commit/130338da33)] - **doc**: explain package version rationale (#26) (Chengzhong Wu)
33
+ - \[[`1a328031da`](https://github.com/nodejs/node-api-headers/commit/1a328031da)] - Update headers from nodejs/node tag v19.9.0 (#24) (github-actions\[bot])
34
+
35
+ ## 2023-04-06 Version 0.0.5, @NickNaso
36
+
37
+ ### Notable changes
38
+
39
+ - Provide def file for windows import lib.
40
+
41
+ ### Commits
42
+
43
+ - \[[`15477c5898`](https://github.com/nodejs/node-api-headers/commit/15477c5898)] - Update headers from nodejs/node tag v19.8.1 (#22) (github-actions\[bot])
44
+ - \[[`d7fa23b60e`](https://github.com/nodejs/node-api-headers/commit/d7fa23b60e)] - Use git status instead of git diff for change calculation (#21) (Kevin Eady)
45
+ - \[[`ea0dc01425`](https://github.com/nodejs/node-api-headers/commit/ea0dc01425)] - **fix**: moved def files on a proper folder. (#19) (Nicola Del Gobbo)
46
+ - \[[`069c3eb6f8`](https://github.com/nodejs/node-api-headers/commit/069c3eb6f8)] - **doc**: how to create a new release. (#18) (Nicola Del Gobbo)
47
+ - \[[`d23c2879c8`](https://github.com/nodejs/node-api-headers/commit/d23c2879c8)] - Provide def file for windows import lib (#17) (Leonid Pospelov)
48
+
49
+ ## 2023-03-17 Version 0.0.4, @NickNaso
50
+
51
+ ### Notable changes
52
+
53
+ - Update headers from nodejs/node tag v19.8.0.
54
+
55
+ ### Commits
56
+
57
+ - \[[`a1f0d41240`](https://github.com/nodejs/node-api-headers/commit/a1f0d41240)] - Merge pull request #14 from nodejs/update-headers/v19.8.0 (Nicola Del Gobbo)
58
+ - \[[`7548267285`](https://github.com/nodejs/node-api-headers/commit/7548267285)] - Update headers from nodejs/node tag v19.8.0 (github-actions\[bot])
59
+
60
+ ## 2023-03-08 Version 0.0.3, @NickNaso
61
+
62
+ ### Notable changes
63
+
64
+ - Add helper scripts for updating headers and symbols.js.
65
+
66
+ ### Commits
67
+
68
+ - \[[`4fdbdd1710`](https://github.com/nodejs/node-api-headers/commit/4fdbdd1710)] - Update headers from nodejs/node tag v19.6.0 (#9) (github-actions\[bot])
69
+ - \[[`ecefbdd00f`](https://github.com/nodejs/node-api-headers/commit/ecefbdd00f)] - Add helper scripts for updating headers and symbols.js (#7) (Kevin Eady)
70
+
71
+ ## 2022-12-29 Version 0.0.2, @NickNaso
72
+
73
+ ### Notable changes
74
+
75
+ - Fixed wrong symblos in v6.
76
+
77
+ ### Commits
78
+
79
+ - \[[`9c0b4ecaa5`](https://github.com/nodejs/node-api-headers/commit/9c0b4ecaa5)] - **fix**: wrong symblos in v6 (#6) (Nicola Del Gobbo)
@@ -0,0 +1,4 @@
1
+ # Code of Conduct
2
+
3
+ The Node.js Code of Conduct, which applies to this project, can be found at
4
+ https://github.com/nodejs/admin/blob/master/CODE_OF_CONDUCT.md.
@@ -0,0 +1,32 @@
1
+ # Developer's Certificate of Origin 1.1
2
+
3
+ By making a contribution to this project, I certify that:
4
+
5
+ * (a) The contribution was created in whole or in part by me and I
6
+ have the right to submit it under the open source license
7
+ indicated in the file; or
8
+
9
+ * (b) The contribution is based upon previous work that, to the best
10
+ of my knowledge, is covered under an appropriate open source
11
+ license and I have the right under that license to submit that
12
+ work with modifications, whether created in whole or in part
13
+ by me, under the same open source license (unless I am
14
+ permitted to submit under a different license), as indicated
15
+ in the file; or
16
+
17
+ * (c) The contribution was provided directly to me by some other
18
+ person who certified (a), (b) or (c) and I have not modified
19
+ it.
20
+
21
+ * (d) I understand and agree that this project and the contribution
22
+ are public and that a record of the contribution (including all
23
+ personal information I submit with it, including my sign-off) is
24
+ maintained indefinitely and may be redistributed consistent with
25
+ this project or the open source license(s) involved.
26
+
27
+ ## Moderation Policy
28
+
29
+ The [Node.js Moderation Policy] applies to this project.
30
+
31
+ [Node.js Moderation Policy]:
32
+ https://github.com/nodejs/admin/blob/master/Moderation-Policy.md
@@ -0,0 +1,58 @@
1
+ # Creating a release
2
+
3
+ Only collaborators in npm for **node-api-headers** can create releases. If you
4
+ want to be able to do releases ask one of the existing collaborators to add
5
+ you. If necessary you can ask the build Working Group who manages the Node.js
6
+ npm user to add you if there are no other active collaborators.
7
+
8
+ ## Prerequisites
9
+
10
+ Before to start creating a new release check if you have installed the following
11
+ tools:
12
+
13
+ * [Changelog maker](https://www.npmjs.com/package/changelog-maker)
14
+
15
+ If not please follow the instruction reported in the tool's documentation to
16
+ install it.
17
+
18
+ ## Publish new release
19
+
20
+ These are the steps to follow to create a new release:
21
+
22
+ * Open an issue in the **node-api-headers** repo documenting the intent to
23
+ create a new release. Give people some time to comment or suggest PRs that
24
+ should land first.
25
+
26
+ * Update the version in **package.json** appropriately.
27
+
28
+ * Update the [README.md][] to show the latest stable version of Node-API.
29
+
30
+ * Generate the changelog for the new version using **changelog maker** tool.
31
+ From the root folder of the repo launch the following command:
32
+
33
+ ```bash
34
+ > changelog-maker --format=markdown
35
+ ```
36
+
37
+ * Use the output generated by **changelog maker** to update the
38
+ [CHANGELOG.md][] following the style used in publishing the previous release.
39
+
40
+ * Add any new contributors to the "contributors" section in the
41
+ **package.json**.
42
+
43
+ * Do a clean checkout of `node-api-headers`.
44
+
45
+ * Login and then run `npm publish`.
46
+
47
+ * Create a release in Github (look at existing releases for an example).
48
+
49
+ * Validate that you can run `npm install node-api-headers` successfully
50
+ and that the correct version is installed.
51
+
52
+ * Comment on the issue opened in the first step that the release has been created
53
+ and close the issue.
54
+
55
+ * Tweet that the release has been created.
56
+
57
+ [README.md]: ./README.md
58
+ [CHANGELOG.md]: ./CHANGELOG.md
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 Node.js
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.