@yalehwang/archguard 0.1.31 → 0.1.32

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 (298) hide show
  1. package/README.md +106 -19
  2. package/assets/grammars/benchmarks.md +101 -0
  3. package/assets/grammars/checksums.json +8 -0
  4. package/{node_modules/tree-sitter/LICENSE → assets/grammars/licenses/tree-sitter-cpp.LICENSE} +2 -2
  5. package/{node_modules/node-gyp-build/LICENSE → assets/grammars/licenses/tree-sitter-go.LICENSE} +5 -5
  6. package/assets/grammars/licenses/tree-sitter-java.LICENSE +21 -0
  7. package/assets/grammars/licenses/tree-sitter-kotlin.LICENSE +21 -0
  8. package/assets/grammars/licenses/tree-sitter-python.LICENSE +21 -0
  9. package/assets/grammars/licenses/tree-sitter.LICENSE +21 -0
  10. package/assets/grammars/provenance.json +66 -0
  11. package/assets/grammars/tree-sitter-cpp.wasm +0 -0
  12. package/assets/grammars/tree-sitter-go.wasm +0 -0
  13. package/assets/grammars/tree-sitter-java.wasm +0 -0
  14. package/assets/grammars/tree-sitter-kotlin.wasm +0 -0
  15. package/assets/grammars/tree-sitter-python.wasm +0 -0
  16. package/assets/grammars/tree-sitter.wasm +0 -0
  17. package/dist/analysis/fitness/rule-types.d.ts +1 -33
  18. package/dist/analysis/fitness/rule-types.d.ts.map +1 -1
  19. package/dist/cli/analyze/run-analysis.d.ts +4 -0
  20. package/dist/cli/analyze/run-analysis.d.ts.map +1 -1
  21. package/dist/cli/analyze/run-analysis.js +63 -43
  22. package/dist/cli/analyze/run-analysis.js.map +1 -1
  23. package/dist/cli/cache/cache-manager.js +1 -1
  24. package/dist/cli/cache/cache-manager.js.map +1 -1
  25. package/dist/cli/mcp/analyze-tool.d.ts +2 -0
  26. package/dist/cli/mcp/analyze-tool.d.ts.map +1 -1
  27. package/dist/cli/mcp/analyze-tool.js +5 -0
  28. package/dist/cli/mcp/analyze-tool.js.map +1 -1
  29. package/dist/cli/mcp/mcp-server.d.ts +7 -2
  30. package/dist/cli/mcp/mcp-server.d.ts.map +1 -1
  31. package/dist/cli/mcp/mcp-server.js +37 -3
  32. package/dist/cli/mcp/mcp-server.js.map +1 -1
  33. package/dist/cli/processors/arch-json-provider-types.d.ts +5 -0
  34. package/dist/cli/processors/arch-json-provider-types.d.ts.map +1 -1
  35. package/dist/cli/processors/arch-json-provider.d.ts +5 -0
  36. package/dist/cli/processors/arch-json-provider.d.ts.map +1 -1
  37. package/dist/cli/processors/arch-json-provider.js +104 -55
  38. package/dist/cli/processors/arch-json-provider.js.map +1 -1
  39. package/dist/cli/processors/arch-json-utils.d.ts.map +1 -1
  40. package/dist/cli/processors/arch-json-utils.js +12 -3
  41. package/dist/cli/processors/arch-json-utils.js.map +1 -1
  42. package/dist/cli/processors/diagram-processor.d.ts +4 -0
  43. package/dist/cli/processors/diagram-processor.d.ts.map +1 -1
  44. package/dist/cli/processors/diagram-processor.js +2 -0
  45. package/dist/cli/processors/diagram-processor.js.map +1 -1
  46. package/dist/cli/processors/worker-pool-factory.d.ts +3 -0
  47. package/dist/cli/processors/worker-pool-factory.d.ts.map +1 -1
  48. package/dist/cli/processors/worker-pool-factory.js +9 -0
  49. package/dist/cli/processors/worker-pool-factory.js.map +1 -1
  50. package/dist/mermaid/generator.d.ts.map +1 -1
  51. package/dist/mermaid/generator.js +19 -1
  52. package/dist/mermaid/generator.js.map +1 -1
  53. package/dist/mermaid/renderer.d.ts.map +1 -1
  54. package/dist/mermaid/renderer.js +1 -1
  55. package/dist/mermaid/renderer.js.map +1 -1
  56. package/dist/mermaid/test-coverage-renderer.d.ts.map +1 -1
  57. package/dist/mermaid/test-coverage-renderer.js +18 -12
  58. package/dist/mermaid/test-coverage-renderer.js.map +1 -1
  59. package/dist/parser/archjson-aggregator.js +1 -1
  60. package/dist/parser/archjson-aggregator.js.map +1 -1
  61. package/dist/parser/parallel-parser.d.ts +10 -0
  62. package/dist/parser/parallel-parser.d.ts.map +1 -1
  63. package/dist/parser/parallel-parser.js +76 -35
  64. package/dist/parser/parallel-parser.js.map +1 -1
  65. package/dist/parser/parse-worker-pool.d.ts +59 -0
  66. package/dist/parser/parse-worker-pool.d.ts.map +1 -0
  67. package/dist/parser/parse-worker-pool.js +170 -0
  68. package/dist/parser/parse-worker-pool.js.map +1 -0
  69. package/dist/parser/parse-worker.d.ts +2 -0
  70. package/dist/parser/parse-worker.d.ts.map +1 -0
  71. package/dist/parser/parse-worker.js +71 -0
  72. package/dist/parser/parse-worker.js.map +1 -0
  73. package/dist/parser/process-parse-worker-pools.d.ts +18 -0
  74. package/dist/parser/process-parse-worker-pools.d.ts.map +1 -0
  75. package/dist/parser/process-parse-worker-pools.js +31 -0
  76. package/dist/parser/process-parse-worker-pools.js.map +1 -0
  77. package/dist/plugins/cpp/builders/class-builder.d.ts +2 -2
  78. package/dist/plugins/cpp/builders/class-builder.d.ts.map +1 -1
  79. package/dist/plugins/cpp/builders/class-builder.js.map +1 -1
  80. package/dist/plugins/cpp/index.d.ts +4 -1
  81. package/dist/plugins/cpp/index.d.ts.map +1 -1
  82. package/dist/plugins/cpp/index.js +11 -2
  83. package/dist/plugins/cpp/index.js.map +1 -1
  84. package/dist/plugins/cpp/tree-sitter-bridge.d.ts +3 -2
  85. package/dist/plugins/cpp/tree-sitter-bridge.d.ts.map +1 -1
  86. package/dist/plugins/cpp/tree-sitter-bridge.js +17 -15
  87. package/dist/plugins/cpp/tree-sitter-bridge.js.map +1 -1
  88. package/dist/plugins/golang/builders/function-builder.d.ts +4 -4
  89. package/dist/plugins/golang/builders/function-builder.d.ts.map +1 -1
  90. package/dist/plugins/golang/builders/function-builder.js.map +1 -1
  91. package/dist/plugins/golang/builders/goroutine-builder.d.ts +2 -2
  92. package/dist/plugins/golang/builders/goroutine-builder.d.ts.map +1 -1
  93. package/dist/plugins/golang/builders/goroutine-builder.js.map +1 -1
  94. package/dist/plugins/golang/builders/interface-builder.d.ts +4 -4
  95. package/dist/plugins/golang/builders/interface-builder.d.ts.map +1 -1
  96. package/dist/plugins/golang/builders/interface-builder.js.map +1 -1
  97. package/dist/plugins/golang/builders/node-utils.d.ts +3 -3
  98. package/dist/plugins/golang/builders/node-utils.d.ts.map +1 -1
  99. package/dist/plugins/golang/builders/node-utils.js.map +1 -1
  100. package/dist/plugins/golang/builders/struct-builder.d.ts +2 -2
  101. package/dist/plugins/golang/builders/struct-builder.d.ts.map +1 -1
  102. package/dist/plugins/golang/builders/struct-builder.js.map +1 -1
  103. package/dist/plugins/golang/go-parse-coordinator.d.ts +10 -2
  104. package/dist/plugins/golang/go-parse-coordinator.d.ts.map +1 -1
  105. package/dist/plugins/golang/go-parse-coordinator.js +44 -6
  106. package/dist/plugins/golang/go-parse-coordinator.js.map +1 -1
  107. package/dist/plugins/golang/gopls-client.d.ts +31 -2
  108. package/dist/plugins/golang/gopls-client.d.ts.map +1 -1
  109. package/dist/plugins/golang/gopls-client.js +230 -32
  110. package/dist/plugins/golang/gopls-client.js.map +1 -1
  111. package/dist/plugins/golang/gopls-interface-resolver.d.ts +14 -1
  112. package/dist/plugins/golang/gopls-interface-resolver.d.ts.map +1 -1
  113. package/dist/plugins/golang/gopls-interface-resolver.js +42 -11
  114. package/dist/plugins/golang/gopls-interface-resolver.js.map +1 -1
  115. package/dist/plugins/golang/index.d.ts +3 -1
  116. package/dist/plugins/golang/index.d.ts.map +1 -1
  117. package/dist/plugins/golang/index.js +17 -3
  118. package/dist/plugins/golang/index.js.map +1 -1
  119. package/dist/plugins/golang/interface-matcher.d.ts.map +1 -1
  120. package/dist/plugins/golang/interface-matcher.js +32 -30
  121. package/dist/plugins/golang/interface-matcher.js.map +1 -1
  122. package/dist/plugins/golang/tree-sitter-bridge.d.ts +3 -2
  123. package/dist/plugins/golang/tree-sitter-bridge.d.ts.map +1 -1
  124. package/dist/plugins/golang/tree-sitter-bridge.js +25 -23
  125. package/dist/plugins/golang/tree-sitter-bridge.js.map +1 -1
  126. package/dist/plugins/java/index.d.ts +4 -0
  127. package/dist/plugins/java/index.d.ts.map +1 -1
  128. package/dist/plugins/java/index.js +12 -1
  129. package/dist/plugins/java/index.js.map +1 -1
  130. package/dist/plugins/java/tree-sitter-bridge.d.ts +3 -2
  131. package/dist/plugins/java/tree-sitter-bridge.d.ts.map +1 -1
  132. package/dist/plugins/java/tree-sitter-bridge.js +33 -31
  133. package/dist/plugins/java/tree-sitter-bridge.js.map +1 -1
  134. package/dist/plugins/kotlin/builders/class-builder.d.ts +2 -1
  135. package/dist/plugins/kotlin/builders/class-builder.d.ts.map +1 -1
  136. package/dist/plugins/kotlin/builders/class-builder.js.map +1 -1
  137. package/dist/plugins/kotlin/builders/function-builder.d.ts +2 -1
  138. package/dist/plugins/kotlin/builders/function-builder.d.ts.map +1 -1
  139. package/dist/plugins/kotlin/builders/function-builder.js.map +1 -1
  140. package/dist/plugins/kotlin/index.d.ts +4 -1
  141. package/dist/plugins/kotlin/index.d.ts.map +1 -1
  142. package/dist/plugins/kotlin/index.js +12 -4
  143. package/dist/plugins/kotlin/index.js.map +1 -1
  144. package/dist/plugins/kotlin/tree-sitter-bridge.d.ts +3 -3
  145. package/dist/plugins/kotlin/tree-sitter-bridge.d.ts.map +1 -1
  146. package/dist/plugins/kotlin/tree-sitter-bridge.js +6 -7
  147. package/dist/plugins/kotlin/tree-sitter-bridge.js.map +1 -1
  148. package/dist/plugins/python/index.d.ts +4 -0
  149. package/dist/plugins/python/index.d.ts.map +1 -1
  150. package/dist/plugins/python/index.js +12 -1
  151. package/dist/plugins/python/index.js.map +1 -1
  152. package/dist/plugins/python/tree-sitter-bridge.d.ts +3 -2
  153. package/dist/plugins/python/tree-sitter-bridge.d.ts.map +1 -1
  154. package/dist/plugins/python/tree-sitter-bridge.js +50 -48
  155. package/dist/plugins/python/tree-sitter-bridge.js.map +1 -1
  156. package/dist/plugins/shared/native-parser-backend.d.ts +33 -0
  157. package/dist/plugins/shared/native-parser-backend.d.ts.map +1 -0
  158. package/dist/plugins/shared/native-parser-backend.js +84 -0
  159. package/dist/plugins/shared/native-parser-backend.js.map +1 -0
  160. package/dist/plugins/shared/parser-backend.d.ts +13 -0
  161. package/dist/plugins/shared/parser-backend.d.ts.map +1 -0
  162. package/dist/plugins/shared/parser-backend.js +38 -0
  163. package/dist/plugins/shared/parser-backend.js.map +1 -0
  164. package/dist/plugins/shared/parser-runtime.d.ts +32 -0
  165. package/dist/plugins/shared/parser-runtime.d.ts.map +1 -0
  166. package/dist/plugins/shared/parser-runtime.js +152 -0
  167. package/dist/plugins/shared/parser-runtime.js.map +1 -0
  168. package/dist/plugins/shared/plugin-factory.d.ts +5 -0
  169. package/dist/plugins/shared/plugin-factory.d.ts.map +1 -0
  170. package/dist/plugins/shared/plugin-factory.js +27 -0
  171. package/dist/plugins/shared/plugin-factory.js.map +1 -0
  172. package/dist/plugins/shared/syntax-tree.d.ts +32 -0
  173. package/dist/plugins/shared/syntax-tree.d.ts.map +1 -0
  174. package/dist/plugins/shared/syntax-tree.js +2 -0
  175. package/dist/plugins/shared/syntax-tree.js.map +1 -0
  176. package/dist/plugins/shared/wasm-parser-backend.d.ts +18 -0
  177. package/dist/plugins/shared/wasm-parser-backend.d.ts.map +1 -0
  178. package/dist/plugins/shared/wasm-parser-backend.js +118 -0
  179. package/dist/plugins/shared/wasm-parser-backend.js.map +1 -0
  180. package/dist/plugins/typescript/builders/module-graph-builder.d.ts.map +1 -1
  181. package/dist/plugins/typescript/builders/module-graph-builder.js +2 -1
  182. package/dist/plugins/typescript/builders/module-graph-builder.js.map +1 -1
  183. package/dist/types/config-global.d.ts +7 -1
  184. package/dist/types/config-global.d.ts.map +1 -1
  185. package/dist/types/config.d.ts +1 -0
  186. package/dist/types/config.d.ts.map +1 -1
  187. package/dist/types/config.js +1 -0
  188. package/dist/types/config.js.map +1 -1
  189. package/dist/types/fitness-rules.d.ts +34 -0
  190. package/dist/types/fitness-rules.d.ts.map +1 -0
  191. package/dist/types/fitness-rules.js +2 -0
  192. package/dist/types/fitness-rules.js.map +1 -0
  193. package/dist/types/parser-runtime.d.ts +4 -0
  194. package/dist/types/parser-runtime.d.ts.map +1 -0
  195. package/dist/types/parser-runtime.js +5 -0
  196. package/dist/types/parser-runtime.js.map +1 -0
  197. package/package.json +29 -16
  198. package/node_modules/node-addon-api/LICENSE.md +0 -9
  199. package/node_modules/node-addon-api/README.md +0 -95
  200. package/node_modules/node-addon-api/common.gypi +0 -21
  201. package/node_modules/node-addon-api/except.gypi +0 -25
  202. package/node_modules/node-addon-api/index.js +0 -14
  203. package/node_modules/node-addon-api/napi-inl.deprecated.h +0 -186
  204. package/node_modules/node-addon-api/napi-inl.h +0 -7033
  205. package/node_modules/node-addon-api/napi.h +0 -3309
  206. package/node_modules/node-addon-api/node_addon_api.gyp +0 -42
  207. package/node_modules/node-addon-api/node_api.gyp +0 -9
  208. package/node_modules/node-addon-api/noexcept.gypi +0 -26
  209. package/node_modules/node-addon-api/nothing.c +0 -0
  210. package/node_modules/node-addon-api/package-support.json +0 -21
  211. package/node_modules/node-addon-api/package.json +0 -480
  212. package/node_modules/node-addon-api/tools/README.md +0 -73
  213. package/node_modules/node-addon-api/tools/check-napi.js +0 -99
  214. package/node_modules/node-addon-api/tools/clang-format.js +0 -71
  215. package/node_modules/node-addon-api/tools/conversion.js +0 -301
  216. package/node_modules/node-gyp-build/README.md +0 -58
  217. package/node_modules/node-gyp-build/SECURITY.md +0 -5
  218. package/node_modules/node-gyp-build/bin.js +0 -84
  219. package/node_modules/node-gyp-build/build-test.js +0 -19
  220. package/node_modules/node-gyp-build/index.js +0 -6
  221. package/node_modules/node-gyp-build/node-gyp-build.js +0 -207
  222. package/node_modules/node-gyp-build/optional.js +0 -7
  223. package/node_modules/node-gyp-build/package.json +0 -43
  224. package/node_modules/tree-sitter/README.md +0 -128
  225. package/node_modules/tree-sitter/binding.gyp +0 -80
  226. package/node_modules/tree-sitter/index.js +0 -916
  227. package/node_modules/tree-sitter/package.json +0 -76
  228. package/node_modules/tree-sitter/prebuilds/linux-x64/node.napi.glibc.node +0 -0
  229. package/node_modules/tree-sitter/src/addon_data.h +0 -47
  230. package/node_modules/tree-sitter/src/binding.cc +0 -35
  231. package/node_modules/tree-sitter/src/conversions.cc +0 -140
  232. package/node_modules/tree-sitter/src/conversions.h +0 -22
  233. package/node_modules/tree-sitter/src/language.cc +0 -106
  234. package/node_modules/tree-sitter/src/language.h +0 -17
  235. package/node_modules/tree-sitter/src/logger.cc +0 -70
  236. package/node_modules/tree-sitter/src/logger.h +0 -19
  237. package/node_modules/tree-sitter/src/lookaheaditerator.cc +0 -122
  238. package/node_modules/tree-sitter/src/lookaheaditerator.h +0 -33
  239. package/node_modules/tree-sitter/src/node.cc +0 -1088
  240. package/node_modules/tree-sitter/src/node.h +0 -30
  241. package/node_modules/tree-sitter/src/parser.cc +0 -306
  242. package/node_modules/tree-sitter/src/parser.h +0 -35
  243. package/node_modules/tree-sitter/src/query.cc +0 -397
  244. package/node_modules/tree-sitter/src/query.h +0 -40
  245. package/node_modules/tree-sitter/src/tree.cc +0 -316
  246. package/node_modules/tree-sitter/src/tree.h +0 -45
  247. package/node_modules/tree-sitter/src/tree_cursor.cc +0 -213
  248. package/node_modules/tree-sitter/src/tree_cursor.h +0 -52
  249. package/node_modules/tree-sitter/tree-sitter.d.ts +0 -1042
  250. package/node_modules/tree-sitter/vendor/tree-sitter/lib/include/tree_sitter/api.h +0 -1478
  251. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/alloc.c +0 -48
  252. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/alloc.h +0 -41
  253. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/array.h +0 -291
  254. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/atomic.h +0 -68
  255. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/clock.h +0 -146
  256. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/error_costs.h +0 -11
  257. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/get_changed_ranges.c +0 -523
  258. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/get_changed_ranges.h +0 -36
  259. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/host.h +0 -21
  260. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/language.c +0 -293
  261. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/language.h +0 -293
  262. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/length.h +0 -52
  263. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/lexer.c +0 -483
  264. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/lexer.h +0 -54
  265. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/lib.c +0 -12
  266. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/node.c +0 -875
  267. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/parser.c +0 -2293
  268. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/parser.h +0 -286
  269. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/point.h +0 -48
  270. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/portable/endian.h +0 -239
  271. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/query.c +0 -4350
  272. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/reduce_action.h +0 -34
  273. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/reusable_node.h +0 -95
  274. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/stack.c +0 -911
  275. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/stack.h +0 -133
  276. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/subtree.c +0 -1034
  277. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/subtree.h +0 -399
  278. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/tree.c +0 -170
  279. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/tree.h +0 -31
  280. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/tree_cursor.c +0 -717
  281. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/tree_cursor.h +0 -48
  282. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/ts_assert.h +0 -11
  283. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/ICU_SHA +0 -1
  284. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/LICENSE +0 -414
  285. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/README.md +0 -29
  286. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/ptypes.h +0 -1
  287. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/umachine.h +0 -448
  288. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/urename.h +0 -1
  289. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/utf.h +0 -1
  290. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/utf16.h +0 -733
  291. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/utf8.h +0 -881
  292. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode.h +0 -75
  293. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm/stdlib-symbols.txt +0 -24
  294. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm/stdlib.c +0 -113
  295. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm/wasm-stdlib.h +0 -1314
  296. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm_store.c +0 -1935
  297. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm_store.h +0 -31
  298. package/scripts/postinstall-tree-sitter.mjs +0 -28
@@ -1,42 +0,0 @@
1
- {
2
- 'targets': [
3
- {
4
- 'target_name': 'node_addon_api',
5
- 'type': 'none',
6
- 'sources': [ 'napi.h', 'napi-inl.h' ],
7
- 'direct_dependent_settings': {
8
- 'include_dirs': [ '.' ],
9
- 'includes': ['noexcept.gypi'],
10
- }
11
- },
12
- {
13
- 'target_name': 'node_addon_api_except',
14
- 'type': 'none',
15
- 'sources': [ 'napi.h', 'napi-inl.h' ],
16
- 'direct_dependent_settings': {
17
- 'include_dirs': [ '.' ],
18
- 'includes': ['except.gypi'],
19
- }
20
- },
21
- {
22
- 'target_name': 'node_addon_api_except_all',
23
- 'type': 'none',
24
- 'sources': [ 'napi.h', 'napi-inl.h' ],
25
- 'direct_dependent_settings': {
26
- 'include_dirs': [ '.' ],
27
- 'includes': ['except.gypi'],
28
- 'defines': [ 'NODE_ADDON_API_CPP_EXCEPTIONS_ALL' ]
29
- }
30
- },
31
- {
32
- 'target_name': 'node_addon_api_maybe',
33
- 'type': 'none',
34
- 'sources': [ 'napi.h', 'napi-inl.h' ],
35
- 'direct_dependent_settings': {
36
- 'include_dirs': [ '.' ],
37
- 'includes': ['noexcept.gypi'],
38
- 'defines': ['NODE_ADDON_API_ENABLE_MAYBE']
39
- }
40
- },
41
- ]
42
- }
@@ -1,9 +0,0 @@
1
- {
2
- 'targets': [
3
- {
4
- 'target_name': 'nothing',
5
- 'type': 'static_library',
6
- 'sources': [ 'nothing.c' ]
7
- }
8
- ]
9
- }
@@ -1,26 +0,0 @@
1
- {
2
- 'defines': [ 'NODE_ADDON_API_DISABLE_CPP_EXCEPTIONS' ],
3
- 'cflags': [ '-fno-exceptions' ],
4
- 'cflags_cc': [ '-fno-exceptions' ],
5
- 'conditions': [
6
- ["OS=='win'", {
7
- # _HAS_EXCEPTIONS is already defined and set to 0 in common.gypi
8
- #"defines": [
9
- # "_HAS_EXCEPTIONS=0"
10
- #],
11
- "msvs_settings": {
12
- "VCCLCompilerTool": {
13
- 'ExceptionHandling': 0,
14
- 'EnablePREfast': 'true',
15
- },
16
- },
17
- }],
18
- ["OS=='mac'", {
19
- 'xcode_settings': {
20
- 'CLANG_CXX_LIBRARY': 'libc++',
21
- 'MACOSX_DEPLOYMENT_TARGET': '10.7',
22
- 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO',
23
- },
24
- }],
25
- ],
26
- }
File without changes
@@ -1,21 +0,0 @@
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
- }
@@ -1,480 +0,0 @@
1
- {
2
- "bugs": {
3
- "url": "https://github.com/nodejs/node-addon-api/issues"
4
- },
5
- "contributors": [
6
- {
7
- "name": "Abhishek Kumar Singh",
8
- "url": "https://github.com/abhi11210646"
9
- },
10
- {
11
- "name": "Alba Mendez",
12
- "url": "https://github.com/jmendeth"
13
- },
14
- {
15
- "name": "Alexander Floh",
16
- "url": "https://github.com/alexanderfloh"
17
- },
18
- {
19
- "name": "Ammar Faizi",
20
- "url": "https://github.com/ammarfaizi2"
21
- },
22
- {
23
- "name": "András Timár, Dr",
24
- "url": "https://github.com/timarandras"
25
- },
26
- {
27
- "name": "Andrew Petersen",
28
- "url": "https://github.com/kirbysayshi"
29
- },
30
- {
31
- "name": "Anisha Rohra",
32
- "url": "https://github.com/anisha-rohra"
33
- },
34
- {
35
- "name": "Anna Henningsen",
36
- "url": "https://github.com/addaleax"
37
- },
38
- {
39
- "name": "Arnaud Botella",
40
- "url": "https://github.com/BotellaA"
41
- },
42
- {
43
- "name": "Arunesh Chandra",
44
- "url": "https://github.com/aruneshchandra"
45
- },
46
- {
47
- "name": "Azlan Mukhtar",
48
- "url": "https://github.com/azlan"
49
- },
50
- {
51
- "name": "Ben Berman",
52
- "url": "https://github.com/rivertam"
53
- },
54
- {
55
- "name": "Benjamin Byholm",
56
- "url": "https://github.com/kkoopa"
57
- },
58
- {
59
- "name": "Bill Gallafent",
60
- "url": "https://github.com/gallafent"
61
- },
62
- {
63
- "name": "blagoev",
64
- "url": "https://github.com/blagoev"
65
- },
66
- {
67
- "name": "Bruce A. MacNaughton",
68
- "url": "https://github.com/bmacnaughton"
69
- },
70
- {
71
- "name": "Cory Mickelson",
72
- "url": "https://github.com/corymickelson"
73
- },
74
- {
75
- "name": "Daniel Bevenius",
76
- "url": "https://github.com/danbev"
77
- },
78
- {
79
- "name": "Dante Calderón",
80
- "url": "https://github.com/dantehemerson"
81
- },
82
- {
83
- "name": "Darshan Sen",
84
- "url": "https://github.com/RaisinTen"
85
- },
86
- {
87
- "name": "David Halls",
88
- "url": "https://github.com/davedoesdev"
89
- },
90
- {
91
- "name": "Deepak Rajamohan",
92
- "url": "https://github.com/deepakrkris"
93
- },
94
- {
95
- "name": "Dmitry Ashkadov",
96
- "url": "https://github.com/dmitryash"
97
- },
98
- {
99
- "name": "Dongjin Na",
100
- "url": "https://github.com/nadongguri"
101
- },
102
- {
103
- "name": "Doni Rubiagatra",
104
- "url": "https://github.com/rubiagatra"
105
- },
106
- {
107
- "name": "Eric Bickle",
108
- "url": "https://github.com/ebickle"
109
- },
110
- {
111
- "name": "extremeheat",
112
- "url": "https://github.com/extremeheat"
113
- },
114
- {
115
- "name": "Feng Yu",
116
- "url": "https://github.com/F3n67u"
117
- },
118
- {
119
- "name": "Ferdinand Holzer",
120
- "url": "https://github.com/fholzer"
121
- },
122
- {
123
- "name": "Gabriel Schulhof",
124
- "url": "https://github.com/gabrielschulhof"
125
- },
126
- {
127
- "name": "Guenter Sandner",
128
- "url": "https://github.com/gms1"
129
- },
130
- {
131
- "name": "Gus Caplan",
132
- "url": "https://github.com/devsnek"
133
- },
134
- {
135
- "name": "Helio Frota",
136
- "url": "https://github.com/helio-frota"
137
- },
138
- {
139
- "name": "Hitesh Kanwathirtha",
140
- "url": "https://github.com/digitalinfinity"
141
- },
142
- {
143
- "name": "ikokostya",
144
- "url": "https://github.com/ikokostya"
145
- },
146
- {
147
- "name": "Jack Xia",
148
- "url": "https://github.com/JckXia"
149
- },
150
- {
151
- "name": "Jake Barnes",
152
- "url": "https://github.com/DuBistKomisch"
153
- },
154
- {
155
- "name": "Jake Yoon",
156
- "url": "https://github.com/yjaeseok"
157
- },
158
- {
159
- "name": "Jason Ginchereau",
160
- "url": "https://github.com/jasongin"
161
- },
162
- {
163
- "name": "Jenny",
164
- "url": "https://github.com/egg-bread"
165
- },
166
- {
167
- "name": "Jeroen Janssen",
168
- "url": "https://github.com/japj"
169
- },
170
- {
171
- "name": "Jim Schlight",
172
- "url": "https://github.com/jschlight"
173
- },
174
- {
175
- "name": "Jinho Bang",
176
- "url": "https://github.com/romandev"
177
- },
178
- {
179
- "name": "José Expósito",
180
- "url": "https://github.com/JoseExposito"
181
- },
182
- {
183
- "name": "joshgarde",
184
- "url": "https://github.com/joshgarde"
185
- },
186
- {
187
- "name": "Julian Mesa",
188
- "url": "https://github.com/julianmesa-gitkraken"
189
- },
190
- {
191
- "name": "Kasumi Hanazuki",
192
- "url": "https://github.com/hanazuki"
193
- },
194
- {
195
- "name": "Kelvin",
196
- "url": "https://github.com/kelvinhammond"
197
- },
198
- {
199
- "name": "Kevin Eady",
200
- "url": "https://github.com/KevinEady"
201
- },
202
- {
203
- "name": "Kévin VOYER",
204
- "url": "https://github.com/kecsou"
205
- },
206
- {
207
- "name": "kidneysolo",
208
- "url": "https://github.com/kidneysolo"
209
- },
210
- {
211
- "name": "Koki Nishihara",
212
- "url": "https://github.com/Nishikoh"
213
- },
214
- {
215
- "name": "Konstantin Tarkus",
216
- "url": "https://github.com/koistya"
217
- },
218
- {
219
- "name": "Kyle Farnung",
220
- "url": "https://github.com/kfarnung"
221
- },
222
- {
223
- "name": "Kyle Kovacs",
224
- "url": "https://github.com/nullromo"
225
- },
226
- {
227
- "name": "legendecas",
228
- "url": "https://github.com/legendecas"
229
- },
230
- {
231
- "name": "LongYinan",
232
- "url": "https://github.com/Brooooooklyn"
233
- },
234
- {
235
- "name": "Lovell Fuller",
236
- "url": "https://github.com/lovell"
237
- },
238
- {
239
- "name": "Luciano Martorella",
240
- "url": "https://github.com/lmartorella"
241
- },
242
- {
243
- "name": "mastergberry",
244
- "url": "https://github.com/mastergberry"
245
- },
246
- {
247
- "name": "Mathias Küsel",
248
- "url": "https://github.com/mathiask88"
249
- },
250
- {
251
- "name": "Mathias Stearn",
252
- "url": "https://github.com/RedBeard0531"
253
- },
254
- {
255
- "name": "Matteo Collina",
256
- "url": "https://github.com/mcollina"
257
- },
258
- {
259
- "name": "Michael Dawson",
260
- "url": "https://github.com/mhdawson"
261
- },
262
- {
263
- "name": "Michael Price",
264
- "url": "https://github.com/mikepricedev"
265
- },
266
- {
267
- "name": "Michele Campus",
268
- "url": "https://github.com/kYroL01"
269
- },
270
- {
271
- "name": "Mikhail Cheshkov",
272
- "url": "https://github.com/mcheshkov"
273
- },
274
- {
275
- "name": "nempoBu4",
276
- "url": "https://github.com/nempoBu4"
277
- },
278
- {
279
- "name": "Nicola Del Gobbo",
280
- "url": "https://github.com/NickNaso"
281
- },
282
- {
283
- "name": "Nick Soggin",
284
- "url": "https://github.com/iSkore"
285
- },
286
- {
287
- "name": "Nikolai Vavilov",
288
- "url": "https://github.com/seishun"
289
- },
290
- {
291
- "name": "Nurbol Alpysbayev",
292
- "url": "https://github.com/anurbol"
293
- },
294
- {
295
- "name": "pacop",
296
- "url": "https://github.com/pacop"
297
- },
298
- {
299
- "name": "Peter Šándor",
300
- "url": "https://github.com/petersandor"
301
- },
302
- {
303
- "name": "Philipp Renoth",
304
- "url": "https://github.com/DaAitch"
305
- },
306
- {
307
- "name": "rgerd",
308
- "url": "https://github.com/rgerd"
309
- },
310
- {
311
- "name": "Richard Lau",
312
- "url": "https://github.com/richardlau"
313
- },
314
- {
315
- "name": "Rolf Timmermans",
316
- "url": "https://github.com/rolftimmermans"
317
- },
318
- {
319
- "name": "Ross Weir",
320
- "url": "https://github.com/ross-weir"
321
- },
322
- {
323
- "name": "Ryuichi Okumura",
324
- "url": "https://github.com/okuryu"
325
- },
326
- {
327
- "name": "Saint Gabriel",
328
- "url": "https://github.com/chineduG"
329
- },
330
- {
331
- "name": "Sampson Gao",
332
- "url": "https://github.com/sampsongao"
333
- },
334
- {
335
- "name": "Sam Roberts",
336
- "url": "https://github.com/sam-github"
337
- },
338
- {
339
- "name": "strager",
340
- "url": "https://github.com/strager"
341
- },
342
- {
343
- "name": "Taylor Woll",
344
- "url": "https://github.com/boingoing"
345
- },
346
- {
347
- "name": "Thomas Gentilhomme",
348
- "url": "https://github.com/fraxken"
349
- },
350
- {
351
- "name": "Tim Rach",
352
- "url": "https://github.com/timrach"
353
- },
354
- {
355
- "name": "Tobias Nießen",
356
- "url": "https://github.com/tniessen"
357
- },
358
- {
359
- "name": "todoroff",
360
- "url": "https://github.com/todoroff"
361
- },
362
- {
363
- "name": "Toyo Li",
364
- "url": "https://github.com/toyobayashi"
365
- },
366
- {
367
- "name": "Tux3",
368
- "url": "https://github.com/tux3"
369
- },
370
- {
371
- "name": "Vlad Velmisov",
372
- "url": "https://github.com/Velmisov"
373
- },
374
- {
375
- "name": "Vladimir Morozov",
376
- "url": "https://github.com/vmoroz"
377
- },
378
- {
379
- "name": "WenheLI",
380
- "url": "https://github.com/WenheLI"
381
- },
382
- {
383
- "name": "Xuguang Mei",
384
- "url": "https://github.com/meixg"
385
- },
386
- {
387
- "name": "Yohei Kishimoto",
388
- "url": "https://github.com/morokosi"
389
- },
390
- {
391
- "name": "Yulong Wang",
392
- "url": "https://github.com/fs-eire"
393
- },
394
- {
395
- "name": "Ziqiu Zhao",
396
- "url": "https://github.com/ZzqiZQute"
397
- },
398
- {
399
- "name": "Feng Yu",
400
- "url": "https://github.com/F3n67u"
401
- },
402
- {
403
- "name": "wanlu wang",
404
- "url": "https://github.com/wanlu"
405
- },
406
- {
407
- "name": "Caleb Hearon",
408
- "url": "https://github.com/chearon"
409
- },
410
- {
411
- "name": "Marx",
412
- "url": "https://github.com/MarxJiao"
413
- },
414
- {
415
- "name": "Ömer AKGÜL",
416
- "url": "https://github.com/tuhalf"
417
- }
418
- ],
419
- "description": "Node.js API (Node-API)",
420
- "devDependencies": {
421
- "benchmark": "^2.1.4",
422
- "bindings": "^1.5.0",
423
- "clang-format": "^1.4.0",
424
- "eslint": "^9.13.0",
425
- "fs-extra": "^11.1.1",
426
- "neostandard": "^0.12.0",
427
- "pre-commit": "^1.2.2",
428
- "semver": "^7.6.0"
429
- },
430
- "directories": {},
431
- "gypfile": false,
432
- "homepage": "https://github.com/nodejs/node-addon-api",
433
- "keywords": [
434
- "n-api",
435
- "napi",
436
- "addon",
437
- "native",
438
- "bindings",
439
- "c",
440
- "c++",
441
- "nan",
442
- "node-addon-api"
443
- ],
444
- "license": "MIT",
445
- "main": "index.js",
446
- "name": "node-addon-api",
447
- "readme": "README.md",
448
- "repository": {
449
- "type": "git",
450
- "url": "git://github.com/nodejs/node-addon-api.git"
451
- },
452
- "files": [
453
- "*.{c,h,gyp,gypi}",
454
- "package-support.json",
455
- "tools/"
456
- ],
457
- "scripts": {
458
- "prebenchmark": "node-gyp rebuild -C benchmark",
459
- "benchmark": "node benchmark",
460
- "create-coverage": "npm test --coverage",
461
- "report-coverage-html": "rm -rf coverage-html && mkdir coverage-html && gcovr -e test --merge-mode-functions merge-use-line-max --html-nested ./coverage-html/index.html test",
462
- "report-coverage-xml": "rm -rf coverage-xml && mkdir coverage-xml && gcovr -e test --merge-mode-functions merge-use-line-max --xml -o ./coverage-xml/coverage-cxx.xml test",
463
- "pretest": "node-gyp rebuild -C test",
464
- "test": "node test",
465
- "test:debug": "node-gyp rebuild -C test --debug && NODE_API_BUILD_CONFIG=Debug node ./test/index.js",
466
- "predev": "node-gyp rebuild -C test --debug",
467
- "dev": "node test",
468
- "predev:incremental": "node-gyp configure build -C test --debug",
469
- "dev:incremental": "node test",
470
- "doc": "doxygen doc/Doxyfile",
471
- "lint": "eslint && node tools/clang-format",
472
- "lint:fix": "eslint --fix && node tools/clang-format --fix"
473
- },
474
- "pre-commit": "lint",
475
- "version": "8.5.0",
476
- "support": true,
477
- "engines": {
478
- "node": "^18 || ^20 || >= 21"
479
- }
480
- }
@@ -1,73 +0,0 @@
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
8
-
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.
10
-
11
- ### How To Use
12
-
13
- To run the conversion script, first make sure you have the latest `node-addon-api` in your `node_modules` directory.
14
- ```
15
- npm install node-addon-api
16
- ```
17
-
18
- Then run the script passing your project directory
19
- ```
20
- node ./node_modules/node-addon-api/tools/conversion.js ./
21
- ```
22
-
23
- After finish, recompile and debug things that are missed by the script.
24
-
25
-
26
- ### Quick Fixes
27
- Here is the list of things that can be fixed easily.
28
- 1. Change your methods' return value to void if it doesn't return value to JavaScript.
29
- 2. Use `.` to access attribute or to invoke member function in Napi::Object instead of `->`.
30
- 3. `Napi::New(env, value);` to `Napi::[Type]::New(env, value);
31
-
32
-
33
- ### Major Reconstructions
34
- The implementation of `Napi::ObjectWrap` is significantly different from NAN's. `Napi::ObjectWrap` takes a pointer to the wrapped object and creates a reference to the wrapped object inside ObjectWrap constructor. `Napi::ObjectWrap` also associates wrapped object's instance methods to Javascript module instead of static methods like NAN.
35
-
36
- So if you use Nan::ObjectWrap in your module, you will need to execute the following steps.
37
-
38
- 1. Convert your [ClassName]::New function to a constructor function that takes a `Napi::CallbackInfo`. Declare it as
39
- ```
40
- [ClassName](const Napi::CallbackInfo& info);
41
- ```
42
- and define it as
43
- ```
44
- [ClassName]::[ClassName](const Napi::CallbackInfo& info) : Napi::ObjectWrap<[ClassName]>(info){
45
- ...
46
- }
47
- ```
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.
49
-
50
- 2. Move your original constructor code into the new constructor. Delete your original constructor.
51
- 3. In your class initialization function, associate native methods in the following way.
52
- ```
53
- Napi::FunctionReference constructor;
54
-
55
- void [ClassName]::Init(Napi::Env env, Napi::Object exports, Napi::Object module) {
56
- Napi::HandleScope scope(env);
57
- Napi::Function ctor = DefineClass(env, "Canvas", {
58
- InstanceMethod<&[ClassName]::Func1>("Func1"),
59
- InstanceMethod<&[ClassName]::Func2>("Func2"),
60
- InstanceAccessor<&[ClassName]::ValueGetter>("Value"),
61
- StaticMethod<&[ClassName]::StaticMethod>("MethodName"),
62
- InstanceValue("Value", Napi::[Type]::New(env, value)),
63
- });
64
-
65
- constructor = Napi::Persistent(ctor);
66
- constructor .SuppressDestruct();
67
- exports.Set("[ClassName]", ctor);
68
- }
69
- ```
70
- 4. In function where you need to Unwrap the ObjectWrap in NAN like `[ClassName]* native = Nan::ObjectWrap::Unwrap<[ClassName]>(info.This());`, use `this` pointer directly as the unwrapped object as each ObjectWrap instance is associated with a unique object instance.
71
-
72
-
73
- If you still find issues after following this guide, please leave us an issue describing your problem and we will try to resolve it.