koffi 2.12.1 → 2.12.2

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 (188) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/LICENSE.txt +2 -2
  3. package/README.md +8 -8
  4. package/build/koffi/darwin_arm64/koffi.node +0 -0
  5. package/build/koffi/darwin_x64/koffi.node +0 -0
  6. package/build/koffi/freebsd_arm64/koffi.node +0 -0
  7. package/build/koffi/freebsd_ia32/koffi.node +0 -0
  8. package/build/koffi/freebsd_x64/koffi.node +0 -0
  9. package/build/koffi/linux_arm64/koffi.node +0 -0
  10. package/build/koffi/linux_armhf/koffi.node +0 -0
  11. package/build/koffi/linux_ia32/koffi.node +0 -0
  12. package/build/koffi/linux_loong64/koffi.node +0 -0
  13. package/build/koffi/linux_riscv64d/koffi.node +0 -0
  14. package/build/koffi/linux_x64/koffi.node +0 -0
  15. package/build/koffi/musl_arm64/koffi.node +0 -0
  16. package/build/koffi/musl_x64/koffi.node +0 -0
  17. package/build/koffi/openbsd_ia32/koffi.node +0 -0
  18. package/build/koffi/openbsd_x64/koffi.node +0 -0
  19. package/build/koffi/win32_arm64/koffi.exp +0 -0
  20. package/build/koffi/win32_arm64/koffi.node +0 -0
  21. package/build/koffi/win32_ia32/koffi.exp +0 -0
  22. package/build/koffi/win32_ia32/koffi.node +0 -0
  23. package/build/koffi/win32_x64/koffi.exp +0 -0
  24. package/build/koffi/win32_x64/koffi.node +0 -0
  25. package/doc/assets.ini +3 -3
  26. package/doc/develop.sh +4 -3
  27. package/doc/pages/platforms.md +1 -1
  28. package/doc/static/highlight.js +1 -1
  29. package/doc/static/koffi.css +3 -2
  30. package/doc/static/print.css +1 -1
  31. package/doc/templates/code.html +5 -5
  32. package/doc/templates/page.html +4 -4
  33. package/index.d.ts +2 -2
  34. package/index.js +32 -32
  35. package/indirect.js +32 -12
  36. package/package.json +2 -2
  37. package/src/cnoke/LICENSE.txt +2 -2
  38. package/src/cnoke/README.md +2 -0
  39. package/src/cnoke/assets/FindCNoke.cmake +12 -2
  40. package/src/cnoke/assets/win_delay_hook.c +4 -4
  41. package/src/cnoke/cnoke.js +4 -2
  42. package/src/cnoke/package.json +1 -1
  43. package/src/cnoke/src/builder.js +11 -14
  44. package/src/cnoke/src/index.js +2 -2
  45. package/src/cnoke/src/tools.js +34 -2
  46. package/src/core/{libcc/libcc.cc → base/base.cc} +3092 -1674
  47. package/src/core/{libcc/libcc.hh → base/base.hh} +3059 -2432
  48. package/src/core/{libcc → base}/mimetypes.inc +42 -4
  49. package/src/core/{libcc → base}/mimetypes_gen.py +3 -3
  50. package/src/core/unicode/generate.py +124 -0
  51. package/src/core/unicode/xid.cc +52 -0
  52. package/src/core/unicode/xid.hh +29 -0
  53. package/src/core/unicode/xid.inc +465 -0
  54. package/src/koffi/CMakeLists.txt +8 -5
  55. package/src/koffi/cmake/raylib.cmake +6 -2
  56. package/src/koffi/cmake/{sqlite.cmake → sqlite3.cmake} +3 -3
  57. package/src/koffi/examples/electron-forge/forge.config.js +23 -3
  58. package/src/koffi/examples/electron-forge/package.json +18 -16
  59. package/src/koffi/src/abi_arm32.cc +7 -7
  60. package/src/koffi/src/abi_arm32_asm.S +2 -2
  61. package/src/koffi/src/abi_arm64.cc +45 -45
  62. package/src/koffi/src/abi_arm64_asm.S +4 -4
  63. package/src/koffi/src/abi_arm64_asm.asm +2 -2
  64. package/src/koffi/src/abi_loong64_asm.S +2 -2
  65. package/src/koffi/src/abi_riscv64.cc +5 -5
  66. package/src/koffi/src/abi_riscv64_asm.S +2 -2
  67. package/src/koffi/src/abi_x64_sysv.cc +3 -3
  68. package/src/koffi/src/abi_x64_sysv_asm.S +5 -5
  69. package/src/koffi/src/abi_x64_win.cc +3 -3
  70. package/src/koffi/src/abi_x64_win_asm.asm +2 -2
  71. package/src/koffi/src/abi_x86.cc +8 -8
  72. package/src/koffi/src/abi_x86_asm.S +2 -2
  73. package/src/koffi/src/abi_x86_asm.asm +2 -2
  74. package/src/koffi/src/call.cc +12 -12
  75. package/src/koffi/src/call.hh +8 -8
  76. package/src/koffi/src/errno.inc +152 -152
  77. package/src/koffi/src/ffi.cc +45 -39
  78. package/src/koffi/src/ffi.hh +6 -6
  79. package/src/koffi/src/init.js +1 -1
  80. package/src/koffi/src/parser.cc +6 -5
  81. package/src/koffi/src/parser.hh +3 -3
  82. package/src/koffi/src/trampolines/armasm.inc +2 -2
  83. package/src/koffi/src/trampolines/gnu.inc +2 -2
  84. package/src/koffi/src/trampolines/masm32.inc +2 -2
  85. package/src/koffi/src/trampolines/masm64.inc +2 -2
  86. package/src/koffi/src/trampolines/prototypes.inc +2 -2
  87. package/src/koffi/src/util.cc +9 -9
  88. package/src/koffi/src/util.hh +3 -3
  89. package/src/koffi/src/win32.cc +5 -5
  90. package/src/koffi/src/win32.hh +9 -9
  91. package/vendor/node-addon-api/CHANGELOG.md +97 -2
  92. package/vendor/node-addon-api/CONTRIBUTING.md +117 -7
  93. package/vendor/node-addon-api/README.md +25 -249
  94. package/vendor/node-addon-api/common.gypi +1 -0
  95. package/vendor/node-addon-api/doc/README.md +145 -0
  96. package/vendor/node-addon-api/doc/array_buffer.md +15 -15
  97. package/vendor/node-addon-api/doc/basic_env.md +200 -0
  98. package/vendor/node-addon-api/doc/buffer.md +24 -26
  99. package/vendor/node-addon-api/doc/cmake-js.md +19 -0
  100. package/vendor/node-addon-api/doc/{creating_a_release.md → contributing/creating_a_release.md} +16 -4
  101. package/vendor/node-addon-api/doc/env.md +11 -131
  102. package/vendor/node-addon-api/doc/error_handling.md +12 -0
  103. package/vendor/node-addon-api/doc/external.md +13 -4
  104. package/vendor/node-addon-api/doc/finalization.md +153 -0
  105. package/vendor/node-addon-api/doc/memory_management.md +1 -1
  106. package/vendor/node-addon-api/doc/object_wrap.md +19 -3
  107. package/vendor/node-addon-api/doc/promises.md +51 -0
  108. package/vendor/node-addon-api/doc/setup.md +29 -6
  109. package/vendor/node-addon-api/doc/value.md +13 -0
  110. package/vendor/node-addon-api/doc/version_management.md +2 -2
  111. package/vendor/node-addon-api/eslint.config.js +5 -0
  112. package/vendor/node-addon-api/index.js +2 -0
  113. package/vendor/node-addon-api/napi-inl.h +592 -166
  114. package/vendor/node-addon-api/napi.h +167 -59
  115. package/vendor/node-addon-api/node_addon_api.gyp +10 -0
  116. package/vendor/node-addon-api/noexcept.gypi +1 -1
  117. package/vendor/node-addon-api/package.json +10 -13
  118. package/vendor/node-addon-api/release-please-config.json +15 -0
  119. package/vendor/node-addon-api/test/addon_build/tpl/binding.gyp +2 -1
  120. package/vendor/node-addon-api/test/array_buffer.js +1 -1
  121. package/vendor/node-addon-api/test/async_context.js +2 -2
  122. package/vendor/node-addon-api/test/async_progress_queue_worker.js +3 -3
  123. package/vendor/node-addon-api/test/async_progress_worker.js +3 -3
  124. package/vendor/node-addon-api/test/async_worker.cc +15 -13
  125. package/vendor/node-addon-api/test/async_worker.js +5 -5
  126. package/vendor/node-addon-api/test/basic_types/value.cc +6 -0
  127. package/vendor/node-addon-api/test/basic_types/value.js +17 -0
  128. package/vendor/node-addon-api/test/binding.cc +8 -0
  129. package/vendor/node-addon-api/test/binding.gyp +23 -1
  130. package/vendor/node-addon-api/test/buffer.js +1 -2
  131. package/vendor/node-addon-api/test/common/index.js +1 -1
  132. package/vendor/node-addon-api/test/except_all.cc +22 -0
  133. package/vendor/node-addon-api/test/except_all.js +14 -0
  134. package/vendor/node-addon-api/test/exports.js +19 -0
  135. package/vendor/node-addon-api/test/finalizer_order.cc +152 -0
  136. package/vendor/node-addon-api/test/finalizer_order.js +98 -0
  137. package/vendor/node-addon-api/test/function.js +2 -2
  138. package/vendor/node-addon-api/test/function_reference.js +2 -2
  139. package/vendor/node-addon-api/test/globalObject/global_object_delete_property.cc +4 -4
  140. package/vendor/node-addon-api/test/globalObject/global_object_get_property.cc +4 -4
  141. package/vendor/node-addon-api/test/globalObject/global_object_has_own_property.cc +3 -3
  142. package/vendor/node-addon-api/test/globalObject/global_object_set_property.cc +5 -5
  143. package/vendor/node-addon-api/test/name.cc +10 -8
  144. package/vendor/node-addon-api/test/object/delete_property.cc +5 -5
  145. package/vendor/node-addon-api/test/object/get_property.cc +5 -5
  146. package/vendor/node-addon-api/test/object/has_own_property.cc +4 -4
  147. package/vendor/node-addon-api/test/object/has_property.cc +5 -5
  148. package/vendor/node-addon-api/test/object/object.cc +1 -1
  149. package/vendor/node-addon-api/test/object/set_property.cc +5 -5
  150. package/vendor/node-addon-api/test/object/subscript_operator.cc +3 -3
  151. package/vendor/node-addon-api/test/object_reference.cc +18 -18
  152. package/vendor/node-addon-api/test/promise.cc +75 -0
  153. package/vendor/node-addon-api/test/promise.js +23 -0
  154. package/vendor/node-addon-api/test/require_basic_finalizers/index.js +38 -0
  155. package/vendor/node-addon-api/test/require_basic_finalizers/tpl/addon.cc +12 -0
  156. package/vendor/node-addon-api/test/require_basic_finalizers/tpl/binding.gyp +48 -0
  157. package/vendor/node-addon-api/test/require_basic_finalizers/tpl/index.js +3 -0
  158. package/vendor/node-addon-api/test/require_basic_finalizers/tpl/package.json +11 -0
  159. package/vendor/node-addon-api/test/run_script.cc +1 -1
  160. package/vendor/node-addon-api/test/type_taggable.cc +1 -1
  161. package/vendor/node-addon-api/test/type_taggable.js +3 -4
  162. package/vendor/node-addon-api/test/typedarray.cc +28 -24
  163. package/vendor/node-addon-api/tools/conversion.js +1 -1
  164. package/vendor/node-api-headers/CHANGELOG.md +29 -0
  165. package/vendor/node-api-headers/CREATING_A_RELEASE.md +12 -2
  166. package/vendor/node-api-headers/def/js_native_api.def +6 -1
  167. package/vendor/node-api-headers/def/node_api.def +7 -1
  168. package/vendor/node-api-headers/include/js_native_api.h +56 -24
  169. package/vendor/node-api-headers/include/js_native_api_types.h +27 -0
  170. package/vendor/node-api-headers/include/node_api.h +38 -29
  171. package/vendor/node-api-headers/lib/parse-utils.js +92 -0
  172. package/vendor/node-api-headers/package.json +7 -7
  173. package/vendor/node-api-headers/release-please-config.json +12 -0
  174. package/vendor/node-api-headers/scripts/update-headers.js +63 -12
  175. package/vendor/node-api-headers/scripts/write-symbols.js +1 -1
  176. package/vendor/node-api-headers/symbols.js +17 -1
  177. package/vendor/node-api-headers/test/parse-utils.js +21 -0
  178. package/doc/flat/flat.css +0 -27
  179. package/doc/flat/normal.css +0 -429
  180. package/doc/flat/print.css +0 -29
  181. package/doc/flat/reset.css +0 -41
  182. package/doc/flat/small.css +0 -104
  183. package/doc/flat/static.js +0 -161
  184. package/src/core/libcc/brotli.cc +0 -186
  185. package/src/core/libcc/lz4.cc +0 -197
  186. package/src/core/libcc/miniz.cc +0 -353
  187. package/vendor/node-addon-api/tools/eslint-format.js +0 -79
  188. /package/vendor/node-api-headers/{scripts → lib}/clang-utils.js +0 -0
@@ -1,5 +1,102 @@
1
1
  # node-addon-api Changelog
2
2
 
3
+ ## [8.5.0](https://github.com/nodejs/node-addon-api/compare/v8.4.0...v8.5.0) (2025-07-04)
4
+
5
+
6
+ ### Features
7
+
8
+ * add Then and Catch methods to Promise ([#1668](https://github.com/nodejs/node-addon-api/issues/1668)) ([ab3e5fe](https://github.com/nodejs/node-addon-api/commit/ab3e5fe59570cbb5ed7cc9891b3f25fe373f028f))
9
+
10
+ ## [8.4.0](https://github.com/nodejs/node-addon-api/compare/v8.3.1...v8.4.0) (2025-06-11)
11
+
12
+
13
+ ### Features
14
+
15
+ * add sugar method for PropertyLValue ([#1651](https://github.com/nodejs/node-addon-api/issues/1651)) ([#1655](https://github.com/nodejs/node-addon-api/issues/1655)) ([1e57a0a](https://github.com/nodejs/node-addon-api/commit/1e57a0ae82786c320c784ec6b67f357c85733132))
16
+
17
+ ## [8.3.1](https://github.com/nodejs/node-addon-api/compare/v8.3.0...v8.3.1) (2025-02-18)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * add missing `stdexcept` include to test ([#1634](https://github.com/nodejs/node-addon-api/issues/1634)) ([14c1a4f](https://github.com/nodejs/node-addon-api/commit/14c1a4f28278c5b02d0ea910061aad4312bb701e))
23
+ * node-api version 10 support ([#1641](https://github.com/nodejs/node-addon-api/issues/1641)) ([932ad15](https://github.com/nodejs/node-addon-api/commit/932ad1503f7a3402716178a91879b5ab850a61b0))
24
+
25
+ ## [8.3.0](https://github.com/nodejs/node-addon-api/compare/v8.2.2...v8.3.0) (2024-11-29)
26
+
27
+
28
+ ### Features
29
+
30
+ * allow catching all exceptions ([#1593](https://github.com/nodejs/node-addon-api/issues/1593)) ([c679f6f](https://github.com/nodejs/node-addon-api/commit/c679f6f4c9dc6bf9fc0d99cbe5982bd24a5e2c7b))
31
+
32
+ ## [8.2.2](https://github.com/nodejs/node-addon-api/compare/v8.2.1...v8.2.2) (2024-11-07)
33
+
34
+
35
+ ### Bug Fixes
36
+
37
+ * mark external memory and version APIs as basic ([#1597](https://github.com/nodejs/node-addon-api/issues/1597)) ([78da4fa](https://github.com/nodejs/node-addon-api/commit/78da4fa2251af1e4de16efac94d92388f117ae6e))
38
+ * missing napi_delete_reference on ObjectWrap ref ([#1607](https://github.com/nodejs/node-addon-api/issues/1607)) ([98aae33](https://github.com/nodejs/node-addon-api/commit/98aae3343c3af36b4befd6b67c4cb19ba49b8d20))
39
+
40
+ ## [8.2.1](https://github.com/nodejs/node-addon-api/compare/v8.2.0...v8.2.1) (2024-10-09)
41
+
42
+
43
+ ### Bug Fixes
44
+
45
+ * failed type cast checks in Symbol::WellKnown ([#1581](https://github.com/nodejs/node-addon-api/issues/1581)) ([d8523a7](https://github.com/nodejs/node-addon-api/commit/d8523a708030a0a3abb9d7832051c70e2dafac3d))
46
+ * missing node_api_nogc_env definition ([#1585](https://github.com/nodejs/node-addon-api/issues/1585)) ([6ba3891](https://github.com/nodejs/node-addon-api/commit/6ba3891954d8b56215d133e54a86cb621e476b9e))
47
+
48
+ ## [8.2.0](https://github.com/nodejs/node-addon-api/compare/v8.1.0...v8.2.0) (2024-09-19)
49
+
50
+
51
+ ### Features
52
+
53
+ * add support for nogc types via `BasicEnv` ([#1514](https://github.com/nodejs/node-addon-api/issues/1514)) ([b4aeecb](https://github.com/nodejs/node-addon-api/commit/b4aeecb046480eeaaf1c578a140f71ac0e77094f))
54
+ * add support for requiring basic finalizers ([#1568](https://github.com/nodejs/node-addon-api/issues/1568)) ([7bcb826](https://github.com/nodejs/node-addon-api/commit/7bcb826aa4323f450b3c58f9c7fb34243ff13f77))
55
+
56
+
57
+ ### Bug Fixes
58
+
59
+ * call base basic finalizer if none defined ([#1574](https://github.com/nodejs/node-addon-api/issues/1574)) ([294a43f](https://github.com/nodejs/node-addon-api/commit/294a43f8c6a4c79b3295a8f1b83d4782d44cfe74))
60
+
61
+ ## [8.1.0](https://github.com/nodejs/node-addon-api/compare/node-addon-api-v8.0.0...node-addon-api-v8.1.0) (2024-07-05)
62
+
63
+
64
+ ### Features
65
+
66
+ * Expose version property in public API ([#1479](https://github.com/nodejs/node-addon-api/issues/1479)) ([23bb42b](https://github.com/nodejs/node-addon-api/commit/23bb42b5e47630c9082dddbabea555626571926e))
67
+ * improve messages on CheckCast ([#1507](https://github.com/nodejs/node-addon-api/issues/1507)) ([bf49519](https://github.com/nodejs/node-addon-api/commit/bf49519a4ce08ee5320327c9a0199cd89d5b87b3))
68
+
69
+
70
+ ### Bug Fixes
71
+
72
+ * fix compilation for Visual Studio 2022 ([#1492](https://github.com/nodejs/node-addon-api/issues/1492)) ([e011720](https://github.com/nodejs/node-addon-api/commit/e011720010af26ed66638ceac822e5f1c5e43cde))
73
+ * restore ability to run under NAPI_EXPERIMENTAL ([#1409](https://github.com/nodejs/node-addon-api/issues/1409)) ([40bcb09](https://github.com/nodejs/node-addon-api/commit/40bcb09e6b82e7a1164cb3de56cb503d9b5a3d37))
74
+
75
+ ## 2024-03-01 Version 8.0.0, @legendecas
76
+
77
+ ### Notable changes
78
+
79
+ - Support for Node.js v16.x is no longer maintained.
80
+
81
+ ### Commits
82
+
83
+ * \[[`df2147a2b6`](https://github.com/nodejs/node-addon-api/commit/df2147a2b6)] - build(deps): bump github/codeql-action from 3.24.3 to 3.24.5 (dependabot\[bot]) [#1455](https://github.com/nodejs/node-addon-api/pull/1455)
84
+ * \[[`eb4fa9b55a`](https://github.com/nodejs/node-addon-api/commit/eb4fa9b55a)] - build(deps): bump actions/dependency-review-action from 4.1.0 to 4.1.3 (dependabot\[bot]) [#1452](https://github.com/nodejs/node-addon-api/pull/1452)
85
+ * \[[`f85e8146bb`](https://github.com/nodejs/node-addon-api/commit/f85e8146bb)] - build(deps): bump github/codeql-action from 3.23.2 to 3.24.3 (dependabot\[bot]) [#1448](https://github.com/nodejs/node-addon-api/pull/1448)
86
+ * \[[`b84deb0d2f`](https://github.com/nodejs/node-addon-api/commit/b84deb0d2f)] - build(deps): bump actions/dependency-review-action from 4.0.0 to 4.1.0 (dependabot\[bot]) [#1447](https://github.com/nodejs/node-addon-api/pull/1447)
87
+ * \[[`7dcee380cd`](https://github.com/nodejs/node-addon-api/commit/7dcee380cd)] - build(deps): bump actions/setup-node from 4.0.1 to 4.0.2 (dependabot\[bot]) [#1444](https://github.com/nodejs/node-addon-api/pull/1444)
88
+ * \[[`a727b629fe`](https://github.com/nodejs/node-addon-api/commit/a727b629fe)] - build(deps): bump actions/upload-artifact from 4.3.0 to 4.3.1 (dependabot\[bot]) [#1443](https://github.com/nodejs/node-addon-api/pull/1443)
89
+ * \[[`ea712094e3`](https://github.com/nodejs/node-addon-api/commit/ea712094e3)] - build(deps): bump step-security/harden-runner from 2.6.1 to 2.7.0 (dependabot\[bot]) [#1440](https://github.com/nodejs/node-addon-api/pull/1440)
90
+ * \[[`898e5006a5`](https://github.com/nodejs/node-addon-api/commit/898e5006a5)] - build(deps): bump github/codeql-action from 3.23.1 to 3.23.2 (dependabot\[bot]) [#1439](https://github.com/nodejs/node-addon-api/pull/1439)
91
+ * \[[`66e6e0e4b6`](https://github.com/nodejs/node-addon-api/commit/66e6e0e4b6)] - build(deps): bump actions/upload-artifact from 4.0.0 to 4.3.0 (dependabot\[bot]) [#1438](https://github.com/nodejs/node-addon-api/pull/1438)
92
+ * \[[`f1ca4ccd7f`](https://github.com/nodejs/node-addon-api/commit/f1ca4ccd7f)] - build(deps): bump actions/dependency-review-action from 3.1.5 to 4.0.0 (dependabot\[bot]) [#1433](https://github.com/nodejs/node-addon-api/pull/1433)
93
+ * \[[`c58112d52e`](https://github.com/nodejs/node-addon-api/commit/c58112d52e)] - build(deps): bump github/codeql-action from 3.23.0 to 3.23.1 (dependabot\[bot]) [#1430](https://github.com/nodejs/node-addon-api/pull/1430)
94
+ * \[[`f1b9c0bc24`](https://github.com/nodejs/node-addon-api/commit/f1b9c0bc24)] - **chore**: remove v16.x regular CI runs (Chengzhong Wu) [#1437](https://github.com/nodejs/node-addon-api/pull/1437)
95
+ * \[[`c6561d90d6`](https://github.com/nodejs/node-addon-api/commit/c6561d90d6)] - **chore**: reduce dependabot noise (Chengzhong Wu) [#1436](https://github.com/nodejs/node-addon-api/pull/1436)
96
+ * \[[`42931eeba6`](https://github.com/nodejs/node-addon-api/commit/42931eeba6)] - **doc**: reorganize readme (Chengzhong Wu) [#1441](https://github.com/nodejs/node-addon-api/pull/1441)
97
+ * \[[`3b9f3db14e`](https://github.com/nodejs/node-addon-api/commit/3b9f3db14e)] - **doc**: update changelog maker commands (Chengzhong Wu) [#1431](https://github.com/nodejs/node-addon-api/pull/1431)
98
+ * \[[`034c039298`](https://github.com/nodejs/node-addon-api/commit/034c039298)] - **test**: heed npm\_config\_debug (Gabriel Schulhof) [#1445](https://github.com/nodejs/node-addon-api/pull/1445)
99
+
3
100
  ## 2024-01-18 Version 7.1.0, @legendecas
4
101
 
5
102
  ### Notable changes
@@ -1173,5 +1270,3 @@ yet backported in the previous Node.js version.
1173
1270
  * [0a899bf1c5] - doc: update indication of latest version (Michael Dawson) https://github.com/nodejs/node-addon-api/pull/211
1174
1271
  * [17c74e5a5e] - n-api: RangeError in napi_create_dataview() (Jinho Bang) https://github.com/nodejs/node-addon-api/pull/214
1175
1272
  * [4058a29989] - n-api: fix memory leak in napi_async_destroy() (Jinho Bang) https://github.com/nodejs/node-addon-api/pull/213
1176
-
1177
-
@@ -1,22 +1,41 @@
1
+ # Contributing to **node-addon-api**
1
2
 
2
- # Developer's Certificate of Origin 1.1
3
+ * [Code of Conduct](#code-of-conduct)
4
+ * [Developer's Certificate of Origin 1.1](#developers-certificate-of-origin)
5
+ * [Tests](#tests)
6
+ * [Debug](#debug)
7
+ * [Benchmarks](#benchmarks)
8
+ * [node-addon-api Contribution Philosophy](#node-addon-api-contribution-philosophy)
3
9
 
10
+ ## Code of Conduct
11
+
12
+ The Node.js project has a
13
+ [Code of Conduct](https://github.com/nodejs/admin/blob/HEAD/CODE_OF_CONDUCT.md)
14
+ to which all contributors must adhere.
15
+
16
+ See [details on our policy on Code of Conduct](https://github.com/nodejs/node/blob/main/doc/contributing/code-of-conduct.md).
17
+
18
+ <a id="developers-certificate-of-origin"></a>
19
+
20
+ ## Developer's Certificate of Origin 1.1
21
+
22
+ <pre>
4
23
  By making a contribution to this project, I certify that:
5
24
 
6
25
  (a) The contribution was created in whole or in part by me and I
7
- have the right to submit it under the open-source license
26
+ have the right to submit it under the open source license
8
27
  indicated in the file; or
9
28
 
10
29
  (b) The contribution is based upon previous work that, to the best
11
30
  of my knowledge, is covered under an appropriate open source
12
31
  license and I have the right under that license to submit that
13
32
  work with modifications, whether created in whole or in part
14
- by me, under the same open-source license (unless I am
33
+ by me, under the same open source license (unless I am
15
34
  permitted to submit under a different license), as indicated
16
35
  in the file; or
17
36
 
18
37
  (c) The contribution was provided directly to me by some other
19
- person who certified (a), (b), or (c) and I have not modified
38
+ person who certified (a), (b) or (c) and I have not modified
20
39
  it.
21
40
 
22
41
  (d) I understand and agree that this project and the contribution
@@ -24,17 +43,105 @@ By making a contribution to this project, I certify that:
24
43
  personal information I submit with it, including my sign-off) is
25
44
  maintained indefinitely and may be redistributed consistent with
26
45
  this project or the open source license(s) involved.
46
+ </pre>
47
+
48
+
49
+ ## Tests
50
+
51
+ To run the **node-addon-api** tests do:
52
+
53
+ ```
54
+ npm install
55
+ npm test
56
+ ```
57
+
58
+ To avoid testing the deprecated portions of the API run
59
+ ```
60
+ npm install
61
+ npm test --disable-deprecated
62
+ ```
63
+
64
+ To run the tests targeting a specific version of Node-API run
65
+ ```
66
+ npm install
67
+ export NAPI_VERSION=X
68
+ npm test --NAPI_VERSION=X
69
+ ```
70
+
71
+ where X is the version of Node-API you want to target.
72
+
73
+ To run a specific unit test, filter conditions are available
74
+
75
+ **Example:**
76
+ compile and run only tests on objectwrap.cc and objectwrap.js
77
+ ```
78
+ npm run unit --filter=objectwrap
79
+ ```
80
+
81
+ Multiple unit tests cane be selected with wildcards
82
+
83
+ **Example:**
84
+ compile and run all test files ending with "reference" -> function_reference.cc, object_reference.cc, reference.cc
85
+ ```
86
+ npm run unit --filter=*reference
87
+ ```
88
+
89
+ Multiple filter conditions can be joined to broaden the test selection
27
90
 
28
- # **node-addon-api** Contribution Philosophy
91
+ **Example:**
92
+ compile and run all tests under folders threadsafe_function and typed_threadsafe_function and also the objectwrap.cc file
93
+ npm run unit --filter='*function objectwrap'
94
+
95
+ ## Debug
96
+
97
+ To run the **node-addon-api** tests with `--debug` option:
98
+
99
+ ```
100
+ npm run-script dev
101
+ ```
102
+
103
+ If you want a faster build, you might use the following option:
104
+
105
+ ```
106
+ npm run-script dev:incremental
107
+ ```
108
+
109
+ Take a look and get inspired by our **[test suite](https://github.com/nodejs/node-addon-api/tree/HEAD/test)**
110
+
111
+ ## Benchmarks
112
+
113
+ You can run the available benchmarks using the following command:
114
+
115
+ ```
116
+ npm run-script benchmark
117
+ ```
118
+
119
+ See [benchmark/README.md](benchmark/README.md) for more details about running and adding benchmarks.
120
+
121
+ ## **node-addon-api** Contribution Philosophy
29
122
 
30
123
  The **node-addon-api** team loves contributions. There are many ways in which you can
31
124
  contribute to **node-addon-api**:
32
- - Source code fixes
125
+ - [New APIs](#new-apis)
126
+ - [Source code fixes](#source-changes)
33
127
  - Additional tests
34
128
  - Documentation improvements
35
129
  - Joining the Node-API working group and participating in meetings
36
130
 
37
- ## Source changes
131
+ ### New APIs
132
+
133
+ As new APIs are added to Node-API, node-addon-api must be updated to provide
134
+ wrappers for those new APIs. For this reason, node-addon-api provides
135
+ methods that allow callers to obtain the underlying Node-API handles so
136
+ direct calls to Node-API and the use of the objects/methods provided by
137
+ node-addon-api can be used together. For example, in order to be able
138
+ to use an API for which the node-addon-api does not yet provide a wrapper.
139
+
140
+ APIs exposed by node-addon-api are generally used to create and
141
+ manipulate JavaScript values. Concepts and operations generally map
142
+ to ideas specified in the **ECMA262 Language Specification**.
143
+
144
+ ### Source changes
38
145
 
39
146
  **node-addon-api** is meant to be a thin convenience wrapper around Node-API. With this
40
147
  in mind, contributions of any new APIs that wrap around a core Node-API API will
@@ -56,6 +163,7 @@ idioms while writing native addons with **node-addon-api**.
56
163
  where folks can build on top of it.
57
164
 
58
165
  #### Larger Core
166
+
59
167
  This is probably our simplest option in terms of immediate action needed. It
60
168
  would involve landing any open PRs against **node-addon-api**, and continuing to
61
169
  encourage folks to make PRs for utility helpers against the same repository.
@@ -65,6 +173,7 @@ The downside of the approach is the following:
65
173
  - More maintenance burden on the Node-API WG core team.
66
174
 
67
175
  #### Extras Package
176
+
68
177
  This involves us spinning up a new package that contains the utility classes
69
178
  and methods. This has the benefit of having a separate module where helpers
70
179
  make it easier to implement certain patterns and idioms for native addons
@@ -78,6 +187,7 @@ belongs in **node-addon-api** vs **node-addon-api-extras**)
78
187
  - Unclear if the maintenance burden on the Node-API WG is reduced or not
79
188
 
80
189
  #### Ecosystem
190
+
81
191
  This doesn't require a ton of up-front work from the Node-API WG. Instead of
82
192
  accepting utility PRs into **node-addon-api** or creating and maintaining a new
83
193
  module, the WG will encourage the creation of an ecosystem of modules that
@@ -1,266 +1,37 @@
1
- NOTE: The default branch has been renamed!
2
- master is now named main
1
+ # **node-addon-api module**
3
2
 
4
- If you have a local clone, you can update it by running:
3
+ [![codecov](https://codecov.io/gh/nodejs/node-addon-api/branch/main/graph/badge.svg)](https://app.codecov.io/gh/nodejs/node-addon-api/tree/main)
5
4
 
6
- ```shell
7
- git branch -m master main
8
- git fetch origin
9
- git branch -u origin/main main
10
- ```
5
+ [![NPM](https://nodei.co/npm/node-addon-api.png?downloads=true&downloadRank=true)](https://nodei.co/npm/node-addon-api/) [![NPM](https://nodei.co/npm-dl/node-addon-api.png?months=6&height=1)](https://nodei.co/npm/node-addon-api/)
11
6
 
12
- # **node-addon-api module**
13
7
  This module contains **header-only C++ wrapper classes** which simplify
14
8
  the use of the C based [Node-API](https://nodejs.org/dist/latest/docs/api/n-api.html)
15
9
  provided by Node.js when using C++. It provides a C++ object model
16
10
  and exception handling semantics with low overhead.
17
11
 
18
- There are three options for implementing addons: Node-API, nan, or direct
19
- use of internal V8, libuv, and Node.js libraries. Unless there is a need for
20
- direct access to functionality that is not exposed by Node-API as outlined
21
- in [C/C++ addons](https://nodejs.org/dist/latest/docs/api/addons.html)
22
- in Node.js core, use Node-API. Refer to
23
- [C/C++ addons with Node-API](https://nodejs.org/dist/latest/docs/api/n-api.html)
24
- for more information on Node-API.
25
-
26
- Node-API is an ABI stable C interface provided by Node.js for building native
27
- addons. It is independent of the underlying JavaScript runtime (e.g. V8 or ChakraCore)
28
- and is maintained as part of Node.js itself. It is intended to insulate
29
- native addons from changes in the underlying JavaScript engine and allow
30
- modules compiled for one version to run on later versions of Node.js without
31
- recompilation.
32
-
33
- The `node-addon-api` module, which is not part of Node.js, preserves the benefits
34
- of the Node-API as it consists only of inline code that depends only on the stable API
35
- provided by Node-API. As such, modules built against one version of Node.js
36
- using node-addon-api should run without having to be rebuilt with newer versions
37
- of Node.js.
38
-
39
- It is important to remember that *other* Node.js interfaces such as
40
- `libuv` (included in a project via `#include <uv.h>`) are not ABI-stable across
41
- Node.js major versions. Thus, an addon must use Node-API and/or `node-addon-api`
42
- exclusively and build against a version of Node.js that includes an
43
- implementation of Node-API (meaning an active LTS version of Node.js) in
44
- order to benefit from ABI stability across Node.js major versions. Node.js
45
- provides an [ABI stability guide][] containing a detailed explanation of ABI
46
- stability in general, and the Node-API ABI stability guarantee in particular.
47
-
48
- As new APIs are added to Node-API, node-addon-api must be updated to provide
49
- wrappers for those new APIs. For this reason, node-addon-api provides
50
- methods that allow callers to obtain the underlying Node-API handles so
51
- direct calls to Node-API and the use of the objects/methods provided by
52
- node-addon-api can be used together. For example, in order to be able
53
- to use an API for which the node-addon-api does not yet provide a wrapper.
54
-
55
- APIs exposed by node-addon-api are generally used to create and
56
- manipulate JavaScript values. Concepts and operations generally map
57
- to ideas specified in the **ECMA262 Language Specification**.
12
+ - [API References](doc/README.md)
13
+ - [Badges](#badges)
14
+ - [Contributing](#contributing)
15
+ - [License](#license)
58
16
 
59
- The [Node-API Resource](https://nodejs.github.io/node-addon-examples/) offers an
60
- excellent orientation and tips for developers just getting started with Node-API
61
- and node-addon-api.
17
+ ## API References
62
18
 
63
- - **[Setup](#setup)**
64
- - **[API Documentation](#api)**
65
- - **[Examples](#examples)**
66
- - **[Tests](#tests)**
67
- - **[More resource and info about native Addons](#resources)**
68
- - **[Badges](#badges)**
69
- - **[Code of Conduct](CODE_OF_CONDUCT.md)**
70
- - **[Contributors](#contributors)**
71
- - **[License](#license)**
19
+ API references are available in the [doc](doc/README.md) directory.
72
20
 
73
- ## **Current version: 7.1.0**
21
+ <!-- x-release-please-start-version -->
22
+ ## Current version: 8.5.0
23
+ <!-- x-release-please-end -->
74
24
 
75
25
  (See [CHANGELOG.md](CHANGELOG.md) for complete Changelog)
76
26
 
77
- [![NPM](https://nodei.co/npm/node-addon-api.png?downloads=true&downloadRank=true)](https://nodei.co/npm/node-addon-api/) [![NPM](https://nodei.co/npm-dl/node-addon-api.png?months=6&height=1)](https://nodei.co/npm/node-addon-api/)
78
-
79
- <a name="setup"></a>
80
-
81
27
  node-addon-api is based on [Node-API](https://nodejs.org/api/n-api.html) and supports using different Node-API versions.
82
28
  This allows addons built with it to run with Node.js versions which support the targeted Node-API version.
83
29
  **However** the node-addon-api support model is to support only the active LTS Node.js versions. This means that
84
30
  every year there will be a new major which drops support for the Node.js LTS version which has gone out of service.
85
31
 
86
- The oldest Node.js version supported by the current version of node-addon-api is Node.js 16.x.
87
-
88
- ## Setup
89
- - [Installation and usage](doc/setup.md)
90
- - [node-gyp](doc/node-gyp.md)
91
- - [cmake-js](doc/cmake-js.md)
92
- - [Conversion tool](doc/conversion-tool.md)
93
- - [Checker tool](doc/checker-tool.md)
94
- - [Generator](doc/generator.md)
95
- - [Prebuild tools](doc/prebuild_tools.md)
96
-
97
- <a name="api"></a>
98
-
99
- ### **API Documentation**
100
-
101
- The following is the documentation for node-addon-api.
102
-
103
- - [Full Class Hierarchy](doc/hierarchy.md)
104
- - [Addon Structure](doc/addon.md)
105
- - Data Types:
106
- - [Env](doc/env.md)
107
- - [CallbackInfo](doc/callbackinfo.md)
108
- - [Reference](doc/reference.md)
109
- - [Value](doc/value.md)
110
- - [Name](doc/name.md)
111
- - [Symbol](doc/symbol.md)
112
- - [String](doc/string.md)
113
- - [Number](doc/number.md)
114
- - [Date](doc/date.md)
115
- - [BigInt](doc/bigint.md)
116
- - [Boolean](doc/boolean.md)
117
- - [External](doc/external.md)
118
- - [Object](doc/object.md)
119
- - [Array](doc/array.md)
120
- - [ObjectReference](doc/object_reference.md)
121
- - [PropertyDescriptor](doc/property_descriptor.md)
122
- - [Function](doc/function.md)
123
- - [FunctionReference](doc/function_reference.md)
124
- - [ObjectWrap](doc/object_wrap.md)
125
- - [ClassPropertyDescriptor](doc/class_property_descriptor.md)
126
- - [Buffer](doc/buffer.md)
127
- - [ArrayBuffer](doc/array_buffer.md)
128
- - [TypedArray](doc/typed_array.md)
129
- - [TypedArrayOf](doc/typed_array_of.md)
130
- - [DataView](doc/dataview.md)
131
- - [Error Handling](doc/error_handling.md)
132
- - [Error](doc/error.md)
133
- - [TypeError](doc/type_error.md)
134
- - [RangeError](doc/range_error.md)
135
- - [SyntaxError](doc/syntax_error.md)
136
- - [Object Lifetime Management](doc/object_lifetime_management.md)
137
- - [HandleScope](doc/handle_scope.md)
138
- - [EscapableHandleScope](doc/escapable_handle_scope.md)
139
- - [Memory Management](doc/memory_management.md)
140
- - [Async Operations](doc/async_operations.md)
141
- - [AsyncWorker](doc/async_worker.md)
142
- - [AsyncContext](doc/async_context.md)
143
- - [AsyncWorker Variants](doc/async_worker_variants.md)
144
- - [Thread-safe Functions](doc/threadsafe.md)
145
- - [ThreadSafeFunction](doc/threadsafe_function.md)
146
- - [TypedThreadSafeFunction](doc/typed_threadsafe_function.md)
147
- - [Promises](doc/promises.md)
148
- - [Version management](doc/version_management.md)
149
-
150
- <a name="examples"></a>
151
-
152
- ### **Examples**
153
-
154
- Are you new to **node-addon-api**? Take a look at our **[examples](https://github.com/nodejs/node-addon-examples)**
155
-
156
- - **[Hello World](https://github.com/nodejs/node-addon-examples/tree/main/src/1-getting-started/1_hello_world)**
157
- - **[Pass arguments to a function](https://github.com/nodejs/node-addon-examples/tree/main/src/1-getting-started/2_function_arguments/node-addon-api)**
158
- - **[Callbacks](https://github.com/nodejs/node-addon-examples/tree/main/src/1-getting-started/3_callbacks/node-addon-api)**
159
- - **[Object factory](https://github.com/nodejs/node-addon-examples/tree/main/src/1-getting-started/4_object_factory/node-addon-api)**
160
- - **[Function factory](https://github.com/nodejs/node-addon-examples/tree/main/src/1-getting-started/5_function_factory/node-addon-api)**
161
- - **[Wrapping C++ Object](https://github.com/nodejs/node-addon-examples/tree/main/src/1-getting-started/6_object_wrap/node-addon-api)**
162
- - **[Factory of wrapped object](https://github.com/nodejs/node-addon-examples/tree/main/src/1-getting-started/7_factory_wrap/node-addon-api)**
163
- - **[Passing wrapped object around](https://github.com/nodejs/node-addon-examples/tree/main/src/2-js-to-native-conversion/8_passing_wrapped/node-addon-api)**
164
-
165
- <a name="tests"></a>
166
-
167
- ### **Tests**
168
-
169
- To run the **node-addon-api** tests do:
170
-
171
- ```
172
- npm install
173
- npm test
174
- ```
175
-
176
- To avoid testing the deprecated portions of the API run
177
- ```
178
- npm install
179
- npm test --disable-deprecated
180
- ```
181
-
182
- To run the tests targeting a specific version of Node-API run
183
- ```
184
- npm install
185
- export NAPI_VERSION=X
186
- npm test --NAPI_VERSION=X
187
- ```
188
-
189
- where X is the version of Node-API you want to target.
190
-
191
- To run a specific unit test, filter conditions are available
192
-
193
- **Example:**
194
- compile and run only tests on objectwrap.cc and objectwrap.js
195
- ```
196
- npm run unit --filter=objectwrap
197
- ```
32
+ The oldest Node.js version supported by the current version of node-addon-api is Node.js 18.x.
198
33
 
199
- Multiple unit tests cane be selected with wildcards
200
-
201
- **Example:**
202
- compile and run all test files ending with "reference" -> function_reference.cc, object_reference.cc, reference.cc
203
- ```
204
- npm run unit --filter=*reference
205
- ```
206
-
207
- Multiple filter conditions can be joined to broaden the test selection
208
-
209
- **Example:**
210
- compile and run all tests under folders threadsafe_function and typed_threadsafe_function and also the objectwrap.cc file
211
- npm run unit --filter='*function objectwrap'
212
-
213
- ### **Debug**
214
-
215
- To run the **node-addon-api** tests with `--debug` option:
216
-
217
- ```
218
- npm run-script dev
219
- ```
220
-
221
- If you want a faster build, you might use the following option:
222
-
223
- ```
224
- npm run-script dev:incremental
225
- ```
226
-
227
- Take a look and get inspired by our **[test suite](https://github.com/nodejs/node-addon-api/tree/HEAD/test)**
228
-
229
- ### **Benchmarks**
230
-
231
- You can run the available benchmarks using the following command:
232
-
233
- ```
234
- npm run-script benchmark
235
- ```
236
-
237
- See [benchmark/README.md](benchmark/README.md) for more details about running and adding benchmarks.
238
-
239
- <a name="resources"></a>
240
-
241
- ### **More resource and info about native Addons**
242
- - **[C++ Addons](https://nodejs.org/dist/latest/docs/api/addons.html)**
243
- - **[Node-API](https://nodejs.org/dist/latest/docs/api/n-api.html)**
244
- - **[Node-API - Next Generation Node API for Native Modules](https://youtu.be/-Oniup60Afs)**
245
- - **[How We Migrated Realm JavaScript From NAN to Node-API](https://developer.mongodb.com/article/realm-javascript-nan-to-n-api)**
246
-
247
- As node-addon-api's core mission is to expose the plain C Node-API as C++
248
- wrappers, tools that facilitate n-api/node-addon-api providing more
249
- convenient patterns for developing a Node.js add-on with n-api/node-addon-api
250
- can be published to NPM as standalone packages. It is also recommended to tag
251
- such packages with `node-addon-api` to provide more visibility to the community.
252
-
253
- Quick links to NPM searches: [keywords:node-addon-api](https://www.npmjs.com/search?q=keywords%3Anode-addon-api).
254
-
255
- <a name="other-bindings"></a>
256
-
257
- ### **Other bindings**
258
-
259
- - **[napi-rs](https://napi.rs)** - (`Rust`)
260
-
261
- <a name="badges"></a>
262
-
263
- ### **Badges**
34
+ ## Badges
264
35
 
265
36
  The use of badges is recommended to indicate the minimum version of Node-API
266
37
  required for the module. This helps to determine which Node.js major versions are
@@ -279,16 +50,15 @@ available:
279
50
  ![Node-API v9 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v9%20Badge.svg)
280
51
  ![Node-API Experimental Version Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20Experimental%20Version%20Badge.svg)
281
52
 
282
- ## **Contributing**
53
+ ## Contributing
283
54
 
284
55
  We love contributions from the community to **node-addon-api**!
285
56
  See [CONTRIBUTING.md](CONTRIBUTING.md) for more details on our philosophy around extending this module.
286
57
 
287
- <a name="contributors"></a>
288
-
289
58
  ## Team members
290
59
 
291
60
  ### Active
61
+
292
62
  | Name | GitHub Link |
293
63
  | ------------------- | ----------------------------------------------------- |
294
64
  | Anna Henningsen | [addaleax](https://github.com/addaleax) |
@@ -299,7 +69,12 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for more details on our philosophy around
299
69
  | Nicola Del Gobbo | [NickNaso](https://github.com/NickNaso) |
300
70
  | Vladimir Morozov | [vmoroz](https://github.com/vmoroz) |
301
71
 
72
+ <details>
73
+
74
+ <summary>Emeritus</summary>
75
+
302
76
  ### Emeritus
77
+
303
78
  | Name | GitHub Link |
304
79
  | ------------------- | ----------------------------------------------------- |
305
80
  | Arunesh Chandra | [aruneshchandra](https://github.com/aruneshchandra) |
@@ -311,9 +86,10 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for more details on our philosophy around
311
86
  | Sampson Gao | [sampsongao](https://github.com/sampsongao) |
312
87
  | Taylor Woll | [boingoing](https://github.com/boingoing) |
313
88
 
314
- <a name="license"></a>
89
+ </details>
90
+
91
+ ## License
315
92
 
316
93
  Licensed under [MIT](./LICENSE.md)
317
94
 
318
- [ABI stability guide]: https://nodejs.org/en/docs/guides/abi-stability/
319
- [Node-API support matrix]: https://nodejs.org/dist/latest/docs/api/n-api.html#n_api_n_api_version_matrix
95
+ [Node-API support matrix]: https://nodejs.org/dist/latest/docs/api/n-api.html#node-api-version-matrix
@@ -5,6 +5,7 @@
5
5
  },
6
6
  'conditions': [
7
7
  ['NAPI_VERSION!=""', { 'defines': ['NAPI_VERSION=<@(NAPI_VERSION)'] } ],
8
+ ['NAPI_VERSION==2147483647', { 'defines': ['NAPI_EXPERIMENTAL'] } ],
8
9
  ['disable_deprecated=="true"', {
9
10
  'defines': ['NODE_ADDON_API_DISABLE_DEPRECATED']
10
11
  }],