typenative 0.1.3 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (505) hide show
  1. package/.gitattributes +1 -0
  2. package/.github/workflows/ci.yml +39 -2
  3. package/.github/workflows/npm-publish-github-packages.yml +7 -2
  4. package/CHANGELOG.md +293 -0
  5. package/CONTRIBUTION.md +8 -6
  6. package/README.md +15 -11
  7. package/bin/cli.js +7 -1
  8. package/bin/go/bridge.js +919 -0
  9. package/bin/go/convert.js +238 -0
  10. package/bin/go/metadata.js +211 -0
  11. package/bin/go/overrides.js +68 -0
  12. package/bin/go/stdlib.generated.js +175 -0
  13. package/bin/index.js +337 -239
  14. package/bin/main.js +9 -2
  15. package/bin/node/assert.js +344 -0
  16. package/bin/node/async_hooks.js +273 -0
  17. package/bin/node/buffer.js +765 -0
  18. package/bin/node/child_process.js +600 -0
  19. package/bin/node/cluster.js +1002 -0
  20. package/bin/node/console.js +121 -0
  21. package/bin/node/core.js +111 -0
  22. package/bin/node/crypto.js +414 -0
  23. package/bin/node/crypto_keys.js +2685 -0
  24. package/bin/node/dgram.js +388 -0
  25. package/bin/node/diagnostics_channel.js +534 -0
  26. package/bin/node/dns.js +635 -0
  27. package/bin/node/events.js +743 -0
  28. package/bin/node/fetch.js +737 -0
  29. package/bin/node/fs.js +998 -0
  30. package/bin/node/http.js +1500 -0
  31. package/bin/node/http2.js +688 -0
  32. package/bin/node/net.js +1143 -0
  33. package/bin/node/os.js +257 -0
  34. package/bin/node/path.js +758 -0
  35. package/bin/node/process.js +316 -0
  36. package/bin/node/punycode.js +195 -0
  37. package/bin/node/querystring.js +143 -0
  38. package/bin/node/readline.js +299 -0
  39. package/bin/node/registry.js +161 -0
  40. package/bin/node/sqlite.js +1142 -0
  41. package/bin/node/stream.js +1221 -0
  42. package/bin/node/stream_web.js +2259 -0
  43. package/bin/node/string_decoder.js +101 -0
  44. package/bin/node/system_extra.js +714 -0
  45. package/bin/node/test.js +1068 -0
  46. package/bin/node/timers.js +263 -0
  47. package/bin/node/tls.js +719 -0
  48. package/bin/node/url.js +861 -0
  49. package/bin/node/util.js +1311 -0
  50. package/bin/node/util_extra.js +599 -0
  51. package/bin/node/worker_threads.js +745 -0
  52. package/bin/node/zlib.js +263 -0
  53. package/bin/parse-native.js +10 -0
  54. package/bin/parse-node.js +10 -0
  55. package/bin/transpiler.js +2824 -588
  56. package/bin/typecheck-node.js +78 -0
  57. package/bin/version.js +2 -0
  58. package/conformance.md +708 -241
  59. package/govendor/github.com/ncruces/go-sqlite3/LICENSE +21 -0
  60. package/govendor/github.com/ncruces/go-sqlite3/README.md +121 -0
  61. package/govendor/github.com/ncruces/go-sqlite3/backup.go +132 -0
  62. package/govendor/github.com/ncruces/go-sqlite3/blob.go +266 -0
  63. package/govendor/github.com/ncruces/go-sqlite3/config.go +397 -0
  64. package/govendor/github.com/ncruces/go-sqlite3/conn.go +540 -0
  65. package/govendor/github.com/ncruces/go-sqlite3/conn_127.go +93 -0
  66. package/govendor/github.com/ncruces/go-sqlite3/const.go +436 -0
  67. package/govendor/github.com/ncruces/go-sqlite3/context.go +222 -0
  68. package/govendor/github.com/ncruces/go-sqlite3/error.go +182 -0
  69. package/govendor/github.com/ncruces/go-sqlite3/ext.go +153 -0
  70. package/govendor/github.com/ncruces/go-sqlite3/func.go +309 -0
  71. package/govendor/github.com/ncruces/go-sqlite3/go.mod +3 -0
  72. package/govendor/github.com/ncruces/go-sqlite3/internal/dotlk/dotlk.go +29 -0
  73. package/govendor/github.com/ncruces/go-sqlite3/internal/dotlk/dotlk_other.go +13 -0
  74. package/govendor/github.com/ncruces/go-sqlite3/internal/dotlk/dotlk_unix.go +57 -0
  75. package/govendor/github.com/ncruces/go-sqlite3/internal/errutil/error.go +41 -0
  76. package/govendor/github.com/ncruces/go-sqlite3/internal/sqlite3_wrap/alloc.go +128 -0
  77. package/govendor/github.com/ncruces/go-sqlite3/internal/sqlite3_wrap/const.go +122 -0
  78. package/govendor/github.com/ncruces/go-sqlite3/internal/sqlite3_wrap/error.go +77 -0
  79. package/govendor/github.com/ncruces/go-sqlite3/internal/sqlite3_wrap/mem.go +116 -0
  80. package/govendor/github.com/ncruces/go-sqlite3/internal/sqlite3_wrap/mem_other.go +34 -0
  81. package/govendor/github.com/ncruces/go-sqlite3/internal/sqlite3_wrap/mem_unix.go +87 -0
  82. package/govendor/github.com/ncruces/go-sqlite3/internal/sqlite3_wrap/mem_windows.go +149 -0
  83. package/govendor/github.com/ncruces/go-sqlite3/internal/sqlite3_wrap/mmap_unix.go +80 -0
  84. package/govendor/github.com/ncruces/go-sqlite3/internal/sqlite3_wrap/mmap_windows.go +129 -0
  85. package/govendor/github.com/ncruces/go-sqlite3/internal/sqlite3_wrap/sys_windows.go +60 -0
  86. package/govendor/github.com/ncruces/go-sqlite3/internal/sqlite3_wrap/wrap.go +82 -0
  87. package/govendor/github.com/ncruces/go-sqlite3/internal/sqlite3_wrap/wrap_sys.go +113 -0
  88. package/govendor/github.com/ncruces/go-sqlite3/internal/sqlite3_wrap/wrap_vfs.go +181 -0
  89. package/govendor/github.com/ncruces/go-sqlite3/internal/testenv/env.go +55 -0
  90. package/govendor/github.com/ncruces/go-sqlite3/internal/util/json.go +54 -0
  91. package/govendor/github.com/ncruces/go-sqlite3/internal/util/json_v2.go +54 -0
  92. package/govendor/github.com/ncruces/go-sqlite3/internal/util/math.go +29 -0
  93. package/govendor/github.com/ncruces/go-sqlite3/internal/util/page.go +5 -0
  94. package/govendor/github.com/ncruces/go-sqlite3/internal/util/parse.go +142 -0
  95. package/govendor/github.com/ncruces/go-sqlite3/internal/util/pointer.go +3 -0
  96. package/govendor/github.com/ncruces/go-sqlite3/internal/util/reflect.go +10 -0
  97. package/govendor/github.com/ncruces/go-sqlite3/json.go +100 -0
  98. package/govendor/github.com/ncruces/go-sqlite3/json_v2.go +116 -0
  99. package/govendor/github.com/ncruces/go-sqlite3/pointer.go +13 -0
  100. package/govendor/github.com/ncruces/go-sqlite3/quote.go +140 -0
  101. package/govendor/github.com/ncruces/go-sqlite3/stmt.go +692 -0
  102. package/govendor/github.com/ncruces/go-sqlite3/time.go +360 -0
  103. package/govendor/github.com/ncruces/go-sqlite3/txn.go +374 -0
  104. package/govendor/github.com/ncruces/go-sqlite3/value.go +212 -0
  105. package/govendor/github.com/ncruces/go-sqlite3/vfs/README.md +133 -0
  106. package/govendor/github.com/ncruces/go-sqlite3/vfs/api.go +239 -0
  107. package/govendor/github.com/ncruces/go-sqlite3/vfs/cksm.go +143 -0
  108. package/govendor/github.com/ncruces/go-sqlite3/vfs/const.go +256 -0
  109. package/govendor/github.com/ncruces/go-sqlite3/vfs/file.go +260 -0
  110. package/govendor/github.com/ncruces/go-sqlite3/vfs/filename.go +187 -0
  111. package/govendor/github.com/ncruces/go-sqlite3/vfs/lock.go +128 -0
  112. package/govendor/github.com/ncruces/go-sqlite3/vfs/lock_other.go +23 -0
  113. package/govendor/github.com/ncruces/go-sqlite3/vfs/map.go +63 -0
  114. package/govendor/github.com/ncruces/go-sqlite3/vfs/map_other.go +13 -0
  115. package/govendor/github.com/ncruces/go-sqlite3/vfs/os_bsd.go +110 -0
  116. package/govendor/github.com/ncruces/go-sqlite3/vfs/os_darwin.go +131 -0
  117. package/govendor/github.com/ncruces/go-sqlite3/vfs/os_dotlk.go +140 -0
  118. package/govendor/github.com/ncruces/go-sqlite3/vfs/os_f2fs_linux.go +56 -0
  119. package/govendor/github.com/ncruces/go-sqlite3/vfs/os_linux.go +117 -0
  120. package/govendor/github.com/ncruces/go-sqlite3/vfs/os_ofd.go +59 -0
  121. package/govendor/github.com/ncruces/go-sqlite3/vfs/os_std.go +50 -0
  122. package/govendor/github.com/ncruces/go-sqlite3/vfs/os_std_alloc.go +19 -0
  123. package/govendor/github.com/ncruces/go-sqlite3/vfs/os_std_atomic.go +9 -0
  124. package/govendor/github.com/ncruces/go-sqlite3/vfs/os_std_rw.go +13 -0
  125. package/govendor/github.com/ncruces/go-sqlite3/vfs/os_std_sync.go +9 -0
  126. package/govendor/github.com/ncruces/go-sqlite3/vfs/os_std_temp.go +16 -0
  127. package/govendor/github.com/ncruces/go-sqlite3/vfs/os_unix.go +108 -0
  128. package/govendor/github.com/ncruces/go-sqlite3/vfs/os_windows.go +180 -0
  129. package/govendor/github.com/ncruces/go-sqlite3/vfs/registry.go +48 -0
  130. package/govendor/github.com/ncruces/go-sqlite3/vfs/shm.go +26 -0
  131. package/govendor/github.com/ncruces/go-sqlite3/vfs/shm_bsd.go +258 -0
  132. package/govendor/github.com/ncruces/go-sqlite3/vfs/shm_copy.go +90 -0
  133. package/govendor/github.com/ncruces/go-sqlite3/vfs/shm_dotlk.go +168 -0
  134. package/govendor/github.com/ncruces/go-sqlite3/vfs/shm_memlk.go +52 -0
  135. package/govendor/github.com/ncruces/go-sqlite3/vfs/shm_ofd.go +185 -0
  136. package/govendor/github.com/ncruces/go-sqlite3/vfs/shm_other.go +21 -0
  137. package/govendor/github.com/ncruces/go-sqlite3/vfs/shm_windows.go +124 -0
  138. package/govendor/github.com/ncruces/go-sqlite3/vfs/vfs.go +455 -0
  139. package/govendor/github.com/ncruces/go-sqlite3/vtab.go +677 -0
  140. package/govendor/github.com/ncruces/go-sqlite3/wrap.go +48 -0
  141. package/govendor/github.com/ncruces/go-sqlite3-wasm/v6/LICENSE +18 -0
  142. package/govendor/github.com/ncruces/go-sqlite3-wasm/v6/README.md +11 -0
  143. package/govendor/github.com/ncruces/go-sqlite3-wasm/v6/go.mod +3 -0
  144. package/govendor/github.com/ncruces/go-sqlite3-wasm/v6/libc.go +215 -0
  145. package/govendor/github.com/ncruces/go-sqlite3-wasm/v6/sqlite3.dat +0 -0
  146. package/govendor/github.com/ncruces/go-sqlite3-wasm/v6/sqlite3.go +157903 -0
  147. package/govendor/github.com/ncruces/go-sqlite3-wasm/v6/tools.sh +38 -0
  148. package/govendor/github.com/ncruces/julianday/LICENSE +21 -0
  149. package/govendor/github.com/ncruces/julianday/README.md +9 -0
  150. package/govendor/github.com/ncruces/julianday/go.mod +3 -0
  151. package/govendor/github.com/ncruces/julianday/julianday.go +124 -0
  152. package/govendor/golang.org/x/sys/LICENSE +27 -0
  153. package/govendor/golang.org/x/sys/PATENTS +22 -0
  154. package/govendor/golang.org/x/sys/go.mod +3 -0
  155. package/govendor/golang.org/x/sys/unix/README.md +184 -0
  156. package/govendor/golang.org/x/sys/unix/affinity_linux.go +189 -0
  157. package/govendor/golang.org/x/sys/unix/aliases.go +13 -0
  158. package/govendor/golang.org/x/sys/unix/asm_aix_ppc64.s +17 -0
  159. package/govendor/golang.org/x/sys/unix/asm_bsd_386.s +27 -0
  160. package/govendor/golang.org/x/sys/unix/asm_bsd_amd64.s +27 -0
  161. package/govendor/golang.org/x/sys/unix/asm_bsd_arm.s +27 -0
  162. package/govendor/golang.org/x/sys/unix/asm_bsd_arm64.s +27 -0
  163. package/govendor/golang.org/x/sys/unix/asm_bsd_ppc64.s +29 -0
  164. package/govendor/golang.org/x/sys/unix/asm_bsd_riscv64.s +27 -0
  165. package/govendor/golang.org/x/sys/unix/asm_linux_386.s +65 -0
  166. package/govendor/golang.org/x/sys/unix/asm_linux_amd64.s +57 -0
  167. package/govendor/golang.org/x/sys/unix/asm_linux_arm.s +56 -0
  168. package/govendor/golang.org/x/sys/unix/asm_linux_arm64.s +50 -0
  169. package/govendor/golang.org/x/sys/unix/asm_linux_loong64.s +51 -0
  170. package/govendor/golang.org/x/sys/unix/asm_linux_mips64x.s +54 -0
  171. package/govendor/golang.org/x/sys/unix/asm_linux_mipsx.s +52 -0
  172. package/govendor/golang.org/x/sys/unix/asm_linux_ppc64x.s +42 -0
  173. package/govendor/golang.org/x/sys/unix/asm_linux_riscv64.s +47 -0
  174. package/govendor/golang.org/x/sys/unix/asm_linux_s390x.s +54 -0
  175. package/govendor/golang.org/x/sys/unix/asm_openbsd_mips64.s +29 -0
  176. package/govendor/golang.org/x/sys/unix/asm_solaris_amd64.s +17 -0
  177. package/govendor/golang.org/x/sys/unix/asm_zos_s390x.s +382 -0
  178. package/govendor/golang.org/x/sys/unix/auxv.go +36 -0
  179. package/govendor/golang.org/x/sys/unix/auxv_unsupported.go +13 -0
  180. package/govendor/golang.org/x/sys/unix/bluetooth_linux.go +36 -0
  181. package/govendor/golang.org/x/sys/unix/bpxsvc_zos.go +657 -0
  182. package/govendor/golang.org/x/sys/unix/bpxsvc_zos.s +192 -0
  183. package/govendor/golang.org/x/sys/unix/cap_freebsd.go +195 -0
  184. package/govendor/golang.org/x/sys/unix/constants.go +13 -0
  185. package/govendor/golang.org/x/sys/unix/dev_aix_ppc.go +26 -0
  186. package/govendor/golang.org/x/sys/unix/dev_aix_ppc64.go +28 -0
  187. package/govendor/golang.org/x/sys/unix/dev_darwin.go +24 -0
  188. package/govendor/golang.org/x/sys/unix/dev_dragonfly.go +30 -0
  189. package/govendor/golang.org/x/sys/unix/dev_freebsd.go +30 -0
  190. package/govendor/golang.org/x/sys/unix/dev_linux.go +42 -0
  191. package/govendor/golang.org/x/sys/unix/dev_netbsd.go +29 -0
  192. package/govendor/golang.org/x/sys/unix/dev_openbsd.go +29 -0
  193. package/govendor/golang.org/x/sys/unix/dev_zos.go +28 -0
  194. package/govendor/golang.org/x/sys/unix/dirent.go +102 -0
  195. package/govendor/golang.org/x/sys/unix/endian_big.go +9 -0
  196. package/govendor/golang.org/x/sys/unix/endian_little.go +9 -0
  197. package/govendor/golang.org/x/sys/unix/env_unix.go +31 -0
  198. package/govendor/golang.org/x/sys/unix/fcntl.go +36 -0
  199. package/govendor/golang.org/x/sys/unix/fcntl_darwin.go +24 -0
  200. package/govendor/golang.org/x/sys/unix/fcntl_linux_32bit.go +13 -0
  201. package/govendor/golang.org/x/sys/unix/fdset.go +27 -0
  202. package/govendor/golang.org/x/sys/unix/gccgo.go +59 -0
  203. package/govendor/golang.org/x/sys/unix/gccgo_c.c +44 -0
  204. package/govendor/golang.org/x/sys/unix/gccgo_linux_amd64.go +20 -0
  205. package/govendor/golang.org/x/sys/unix/ifreq_linux.go +145 -0
  206. package/govendor/golang.org/x/sys/unix/ioctl_linux.go +341 -0
  207. package/govendor/golang.org/x/sys/unix/ioctl_signed.go +74 -0
  208. package/govendor/golang.org/x/sys/unix/ioctl_unsigned.go +74 -0
  209. package/govendor/golang.org/x/sys/unix/ioctl_zos.go +71 -0
  210. package/govendor/golang.org/x/sys/unix/mkall.sh +250 -0
  211. package/govendor/golang.org/x/sys/unix/mkerrors.sh +807 -0
  212. package/govendor/golang.org/x/sys/unix/mmap_nomremap.go +13 -0
  213. package/govendor/golang.org/x/sys/unix/mremap.go +57 -0
  214. package/govendor/golang.org/x/sys/unix/pagesize_unix.go +15 -0
  215. package/govendor/golang.org/x/sys/unix/pledge_openbsd.go +111 -0
  216. package/govendor/golang.org/x/sys/unix/ptrace_darwin.go +11 -0
  217. package/govendor/golang.org/x/sys/unix/ptrace_ios.go +11 -0
  218. package/govendor/golang.org/x/sys/unix/race.go +30 -0
  219. package/govendor/golang.org/x/sys/unix/race0.go +25 -0
  220. package/govendor/golang.org/x/sys/unix/readdirent_getdents.go +12 -0
  221. package/govendor/golang.org/x/sys/unix/readdirent_getdirentries.go +19 -0
  222. package/govendor/golang.org/x/sys/unix/readv_unix.go +103 -0
  223. package/govendor/golang.org/x/sys/unix/sockcmsg_dragonfly.go +16 -0
  224. package/govendor/golang.org/x/sys/unix/sockcmsg_linux.go +85 -0
  225. package/govendor/golang.org/x/sys/unix/sockcmsg_unix.go +106 -0
  226. package/govendor/golang.org/x/sys/unix/sockcmsg_unix_other.go +46 -0
  227. package/govendor/golang.org/x/sys/unix/sockcmsg_zos.go +58 -0
  228. package/govendor/golang.org/x/sys/unix/symaddr_zos_s390x.s +75 -0
  229. package/govendor/golang.org/x/sys/unix/syscall.go +86 -0
  230. package/govendor/golang.org/x/sys/unix/syscall_aix.go +582 -0
  231. package/govendor/golang.org/x/sys/unix/syscall_aix_ppc.go +52 -0
  232. package/govendor/golang.org/x/sys/unix/syscall_aix_ppc64.go +83 -0
  233. package/govendor/golang.org/x/sys/unix/syscall_bsd.go +609 -0
  234. package/govendor/golang.org/x/sys/unix/syscall_darwin.go +711 -0
  235. package/govendor/golang.org/x/sys/unix/syscall_darwin_amd64.go +50 -0
  236. package/govendor/golang.org/x/sys/unix/syscall_darwin_arm64.go +50 -0
  237. package/govendor/golang.org/x/sys/unix/syscall_darwin_libSystem.go +26 -0
  238. package/govendor/golang.org/x/sys/unix/syscall_dragonfly.go +359 -0
  239. package/govendor/golang.org/x/sys/unix/syscall_dragonfly_amd64.go +56 -0
  240. package/govendor/golang.org/x/sys/unix/syscall_freebsd.go +455 -0
  241. package/govendor/golang.org/x/sys/unix/syscall_freebsd_386.go +64 -0
  242. package/govendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go +64 -0
  243. package/govendor/golang.org/x/sys/unix/syscall_freebsd_arm.go +60 -0
  244. package/govendor/golang.org/x/sys/unix/syscall_freebsd_arm64.go +60 -0
  245. package/govendor/golang.org/x/sys/unix/syscall_freebsd_riscv64.go +60 -0
  246. package/govendor/golang.org/x/sys/unix/syscall_hurd.go +30 -0
  247. package/govendor/golang.org/x/sys/unix/syscall_hurd_386.go +28 -0
  248. package/govendor/golang.org/x/sys/unix/syscall_illumos.go +78 -0
  249. package/govendor/golang.org/x/sys/unix/syscall_linux.go +2574 -0
  250. package/govendor/golang.org/x/sys/unix/syscall_linux_386.go +313 -0
  251. package/govendor/golang.org/x/sys/unix/syscall_linux_alarm.go +12 -0
  252. package/govendor/golang.org/x/sys/unix/syscall_linux_amd64.go +144 -0
  253. package/govendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go +12 -0
  254. package/govendor/golang.org/x/sys/unix/syscall_linux_arm.go +218 -0
  255. package/govendor/golang.org/x/sys/unix/syscall_linux_arm64.go +188 -0
  256. package/govendor/golang.org/x/sys/unix/syscall_linux_gc.go +14 -0
  257. package/govendor/golang.org/x/sys/unix/syscall_linux_gc_386.go +16 -0
  258. package/govendor/golang.org/x/sys/unix/syscall_linux_gc_arm.go +13 -0
  259. package/govendor/golang.org/x/sys/unix/syscall_linux_gccgo_386.go +30 -0
  260. package/govendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go +20 -0
  261. package/govendor/golang.org/x/sys/unix/syscall_linux_loong64.go +220 -0
  262. package/govendor/golang.org/x/sys/unix/syscall_linux_mips64x.go +187 -0
  263. package/govendor/golang.org/x/sys/unix/syscall_linux_mipsx.go +173 -0
  264. package/govendor/golang.org/x/sys/unix/syscall_linux_ppc.go +203 -0
  265. package/govendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go +114 -0
  266. package/govendor/golang.org/x/sys/unix/syscall_linux_riscv64.go +193 -0
  267. package/govendor/golang.org/x/sys/unix/syscall_linux_s390x.go +295 -0
  268. package/govendor/golang.org/x/sys/unix/syscall_linux_sparc64.go +111 -0
  269. package/govendor/golang.org/x/sys/unix/syscall_netbsd.go +388 -0
  270. package/govendor/golang.org/x/sys/unix/syscall_netbsd_386.go +37 -0
  271. package/govendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go +37 -0
  272. package/govendor/golang.org/x/sys/unix/syscall_netbsd_arm.go +37 -0
  273. package/govendor/golang.org/x/sys/unix/syscall_netbsd_arm64.go +37 -0
  274. package/govendor/golang.org/x/sys/unix/syscall_openbsd.go +346 -0
  275. package/govendor/golang.org/x/sys/unix/syscall_openbsd_386.go +41 -0
  276. package/govendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go +41 -0
  277. package/govendor/golang.org/x/sys/unix/syscall_openbsd_arm.go +41 -0
  278. package/govendor/golang.org/x/sys/unix/syscall_openbsd_arm64.go +41 -0
  279. package/govendor/golang.org/x/sys/unix/syscall_openbsd_libc.go +26 -0
  280. package/govendor/golang.org/x/sys/unix/syscall_openbsd_mips64.go +39 -0
  281. package/govendor/golang.org/x/sys/unix/syscall_openbsd_ppc64.go +41 -0
  282. package/govendor/golang.org/x/sys/unix/syscall_openbsd_riscv64.go +41 -0
  283. package/govendor/golang.org/x/sys/unix/syscall_solaris.go +1183 -0
  284. package/govendor/golang.org/x/sys/unix/syscall_solaris_amd64.go +27 -0
  285. package/govendor/golang.org/x/sys/unix/syscall_unix.go +619 -0
  286. package/govendor/golang.org/x/sys/unix/syscall_unix_gc.go +14 -0
  287. package/govendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go +22 -0
  288. package/govendor/golang.org/x/sys/unix/syscall_zos_s390x.go +3213 -0
  289. package/govendor/golang.org/x/sys/unix/sysvshm_linux.go +20 -0
  290. package/govendor/golang.org/x/sys/unix/sysvshm_unix.go +51 -0
  291. package/govendor/golang.org/x/sys/unix/sysvshm_unix_other.go +13 -0
  292. package/govendor/golang.org/x/sys/unix/timestruct.go +76 -0
  293. package/govendor/golang.org/x/sys/unix/unveil_openbsd.go +51 -0
  294. package/govendor/golang.org/x/sys/unix/vgetrandom_linux.go +13 -0
  295. package/govendor/golang.org/x/sys/unix/vgetrandom_unsupported.go +11 -0
  296. package/govendor/golang.org/x/sys/unix/xattr_bsd.go +280 -0
  297. package/govendor/golang.org/x/sys/unix/zerrors_aix_ppc.go +1384 -0
  298. package/govendor/golang.org/x/sys/unix/zerrors_aix_ppc64.go +1385 -0
  299. package/govendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go +1922 -0
  300. package/govendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go +1922 -0
  301. package/govendor/golang.org/x/sys/unix/zerrors_dragonfly_amd64.go +1737 -0
  302. package/govendor/golang.org/x/sys/unix/zerrors_freebsd_386.go +2042 -0
  303. package/govendor/golang.org/x/sys/unix/zerrors_freebsd_amd64.go +2039 -0
  304. package/govendor/golang.org/x/sys/unix/zerrors_freebsd_arm.go +2033 -0
  305. package/govendor/golang.org/x/sys/unix/zerrors_freebsd_arm64.go +2033 -0
  306. package/govendor/golang.org/x/sys/unix/zerrors_freebsd_riscv64.go +2147 -0
  307. package/govendor/golang.org/x/sys/unix/zerrors_linux.go +4209 -0
  308. package/govendor/golang.org/x/sys/unix/zerrors_linux_386.go +882 -0
  309. package/govendor/golang.org/x/sys/unix/zerrors_linux_amd64.go +882 -0
  310. package/govendor/golang.org/x/sys/unix/zerrors_linux_arm.go +887 -0
  311. package/govendor/golang.org/x/sys/unix/zerrors_linux_arm64.go +884 -0
  312. package/govendor/golang.org/x/sys/unix/zerrors_linux_loong64.go +874 -0
  313. package/govendor/golang.org/x/sys/unix/zerrors_linux_mips.go +888 -0
  314. package/govendor/golang.org/x/sys/unix/zerrors_linux_mips64.go +888 -0
  315. package/govendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go +888 -0
  316. package/govendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go +888 -0
  317. package/govendor/golang.org/x/sys/unix/zerrors_linux_ppc.go +940 -0
  318. package/govendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go +944 -0
  319. package/govendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go +944 -0
  320. package/govendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go +884 -0
  321. package/govendor/golang.org/x/sys/unix/zerrors_linux_s390x.go +943 -0
  322. package/govendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go +992 -0
  323. package/govendor/golang.org/x/sys/unix/zerrors_netbsd_386.go +1779 -0
  324. package/govendor/golang.org/x/sys/unix/zerrors_netbsd_amd64.go +1769 -0
  325. package/govendor/golang.org/x/sys/unix/zerrors_netbsd_arm.go +1758 -0
  326. package/govendor/golang.org/x/sys/unix/zerrors_netbsd_arm64.go +1769 -0
  327. package/govendor/golang.org/x/sys/unix/zerrors_openbsd_386.go +1905 -0
  328. package/govendor/golang.org/x/sys/unix/zerrors_openbsd_amd64.go +1905 -0
  329. package/govendor/golang.org/x/sys/unix/zerrors_openbsd_arm.go +1905 -0
  330. package/govendor/golang.org/x/sys/unix/zerrors_openbsd_arm64.go +1905 -0
  331. package/govendor/golang.org/x/sys/unix/zerrors_openbsd_mips64.go +1905 -0
  332. package/govendor/golang.org/x/sys/unix/zerrors_openbsd_ppc64.go +1904 -0
  333. package/govendor/golang.org/x/sys/unix/zerrors_openbsd_riscv64.go +1903 -0
  334. package/govendor/golang.org/x/sys/unix/zerrors_solaris_amd64.go +1556 -0
  335. package/govendor/golang.org/x/sys/unix/zerrors_zos_s390x.go +990 -0
  336. package/govendor/golang.org/x/sys/unix/zptrace_armnn_linux.go +40 -0
  337. package/govendor/golang.org/x/sys/unix/zptrace_linux_arm64.go +17 -0
  338. package/govendor/golang.org/x/sys/unix/zptrace_mipsnn_linux.go +49 -0
  339. package/govendor/golang.org/x/sys/unix/zptrace_mipsnnle_linux.go +49 -0
  340. package/govendor/golang.org/x/sys/unix/zptrace_x86_linux.go +79 -0
  341. package/govendor/golang.org/x/sys/unix/zsymaddr_zos_s390x.s +364 -0
  342. package/govendor/golang.org/x/sys/unix/zsyscall_aix_ppc.go +1461 -0
  343. package/govendor/golang.org/x/sys/unix/zsyscall_aix_ppc64.go +1420 -0
  344. package/govendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gc.go +1188 -0
  345. package/govendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gccgo.go +1069 -0
  346. package/govendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go +2728 -0
  347. package/govendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s +799 -0
  348. package/govendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go +2728 -0
  349. package/govendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s +799 -0
  350. package/govendor/golang.org/x/sys/unix/zsyscall_dragonfly_amd64.go +1666 -0
  351. package/govendor/golang.org/x/sys/unix/zsyscall_freebsd_386.go +1886 -0
  352. package/govendor/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go +1886 -0
  353. package/govendor/golang.org/x/sys/unix/zsyscall_freebsd_arm.go +1886 -0
  354. package/govendor/golang.org/x/sys/unix/zsyscall_freebsd_arm64.go +1886 -0
  355. package/govendor/golang.org/x/sys/unix/zsyscall_freebsd_riscv64.go +1886 -0
  356. package/govendor/golang.org/x/sys/unix/zsyscall_illumos_amd64.go +101 -0
  357. package/govendor/golang.org/x/sys/unix/zsyscall_linux.go +2267 -0
  358. package/govendor/golang.org/x/sys/unix/zsyscall_linux_386.go +469 -0
  359. package/govendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go +636 -0
  360. package/govendor/golang.org/x/sys/unix/zsyscall_linux_arm.go +584 -0
  361. package/govendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go +535 -0
  362. package/govendor/golang.org/x/sys/unix/zsyscall_linux_loong64.go +469 -0
  363. package/govendor/golang.org/x/sys/unix/zsyscall_linux_mips.go +636 -0
  364. package/govendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go +630 -0
  365. package/govendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go +619 -0
  366. package/govendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go +636 -0
  367. package/govendor/golang.org/x/sys/unix/zsyscall_linux_ppc.go +641 -0
  368. package/govendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go +687 -0
  369. package/govendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go +687 -0
  370. package/govendor/golang.org/x/sys/unix/zsyscall_linux_riscv64.go +531 -0
  371. package/govendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go +478 -0
  372. package/govendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go +631 -0
  373. package/govendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go +1848 -0
  374. package/govendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go +1848 -0
  375. package/govendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go +1848 -0
  376. package/govendor/golang.org/x/sys/unix/zsyscall_netbsd_arm64.go +1848 -0
  377. package/govendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go +2407 -0
  378. package/govendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s +719 -0
  379. package/govendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go +2407 -0
  380. package/govendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s +719 -0
  381. package/govendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go +2407 -0
  382. package/govendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s +719 -0
  383. package/govendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go +2407 -0
  384. package/govendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s +719 -0
  385. package/govendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go +2407 -0
  386. package/govendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s +719 -0
  387. package/govendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go +2407 -0
  388. package/govendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s +862 -0
  389. package/govendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go +2407 -0
  390. package/govendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s +719 -0
  391. package/govendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go +2217 -0
  392. package/govendor/golang.org/x/sys/unix/zsyscall_zos_s390x.go +3458 -0
  393. package/govendor/golang.org/x/sys/unix/zsysctl_openbsd_386.go +280 -0
  394. package/govendor/golang.org/x/sys/unix/zsysctl_openbsd_amd64.go +280 -0
  395. package/govendor/golang.org/x/sys/unix/zsysctl_openbsd_arm.go +280 -0
  396. package/govendor/golang.org/x/sys/unix/zsysctl_openbsd_arm64.go +280 -0
  397. package/govendor/golang.org/x/sys/unix/zsysctl_openbsd_mips64.go +280 -0
  398. package/govendor/golang.org/x/sys/unix/zsysctl_openbsd_ppc64.go +280 -0
  399. package/govendor/golang.org/x/sys/unix/zsysctl_openbsd_riscv64.go +281 -0
  400. package/govendor/golang.org/x/sys/unix/zsysnum_darwin_amd64.go +439 -0
  401. package/govendor/golang.org/x/sys/unix/zsysnum_darwin_arm64.go +437 -0
  402. package/govendor/golang.org/x/sys/unix/zsysnum_dragonfly_amd64.go +316 -0
  403. package/govendor/golang.org/x/sys/unix/zsysnum_freebsd_386.go +393 -0
  404. package/govendor/golang.org/x/sys/unix/zsysnum_freebsd_amd64.go +393 -0
  405. package/govendor/golang.org/x/sys/unix/zsysnum_freebsd_arm.go +393 -0
  406. package/govendor/golang.org/x/sys/unix/zsysnum_freebsd_arm64.go +393 -0
  407. package/govendor/golang.org/x/sys/unix/zsysnum_freebsd_riscv64.go +393 -0
  408. package/govendor/golang.org/x/sys/unix/zsysnum_linux_386.go +470 -0
  409. package/govendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go +394 -0
  410. package/govendor/golang.org/x/sys/unix/zsysnum_linux_arm.go +434 -0
  411. package/govendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go +337 -0
  412. package/govendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go +334 -0
  413. package/govendor/golang.org/x/sys/unix/zsysnum_linux_mips.go +454 -0
  414. package/govendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go +384 -0
  415. package/govendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go +384 -0
  416. package/govendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go +454 -0
  417. package/govendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go +461 -0
  418. package/govendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go +433 -0
  419. package/govendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go +433 -0
  420. package/govendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go +338 -0
  421. package/govendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go +399 -0
  422. package/govendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go +413 -0
  423. package/govendor/golang.org/x/sys/unix/zsysnum_netbsd_386.go +274 -0
  424. package/govendor/golang.org/x/sys/unix/zsysnum_netbsd_amd64.go +274 -0
  425. package/govendor/golang.org/x/sys/unix/zsysnum_netbsd_arm.go +274 -0
  426. package/govendor/golang.org/x/sys/unix/zsysnum_netbsd_arm64.go +274 -0
  427. package/govendor/golang.org/x/sys/unix/zsysnum_openbsd_386.go +219 -0
  428. package/govendor/golang.org/x/sys/unix/zsysnum_openbsd_amd64.go +219 -0
  429. package/govendor/golang.org/x/sys/unix/zsysnum_openbsd_arm.go +219 -0
  430. package/govendor/golang.org/x/sys/unix/zsysnum_openbsd_arm64.go +218 -0
  431. package/govendor/golang.org/x/sys/unix/zsysnum_openbsd_mips64.go +221 -0
  432. package/govendor/golang.org/x/sys/unix/zsysnum_openbsd_ppc64.go +217 -0
  433. package/govendor/golang.org/x/sys/unix/zsysnum_openbsd_riscv64.go +218 -0
  434. package/govendor/golang.org/x/sys/unix/zsysnum_zos_s390x.go +2852 -0
  435. package/govendor/golang.org/x/sys/unix/ztypes_aix_ppc.go +353 -0
  436. package/govendor/golang.org/x/sys/unix/ztypes_aix_ppc64.go +357 -0
  437. package/govendor/golang.org/x/sys/unix/ztypes_darwin_amd64.go +878 -0
  438. package/govendor/golang.org/x/sys/unix/ztypes_darwin_arm64.go +878 -0
  439. package/govendor/golang.org/x/sys/unix/ztypes_dragonfly_amd64.go +473 -0
  440. package/govendor/golang.org/x/sys/unix/ztypes_freebsd_386.go +651 -0
  441. package/govendor/golang.org/x/sys/unix/ztypes_freebsd_amd64.go +656 -0
  442. package/govendor/golang.org/x/sys/unix/ztypes_freebsd_arm.go +642 -0
  443. package/govendor/golang.org/x/sys/unix/ztypes_freebsd_arm64.go +636 -0
  444. package/govendor/golang.org/x/sys/unix/ztypes_freebsd_riscv64.go +638 -0
  445. package/govendor/golang.org/x/sys/unix/ztypes_linux.go +6547 -0
  446. package/govendor/golang.org/x/sys/unix/ztypes_linux_386.go +747 -0
  447. package/govendor/golang.org/x/sys/unix/ztypes_linux_amd64.go +761 -0
  448. package/govendor/golang.org/x/sys/unix/ztypes_linux_arm.go +741 -0
  449. package/govendor/golang.org/x/sys/unix/ztypes_linux_arm64.go +740 -0
  450. package/govendor/golang.org/x/sys/unix/ztypes_linux_loong64.go +741 -0
  451. package/govendor/golang.org/x/sys/unix/ztypes_linux_mips.go +746 -0
  452. package/govendor/golang.org/x/sys/unix/ztypes_linux_mips64.go +743 -0
  453. package/govendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go +743 -0
  454. package/govendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go +746 -0
  455. package/govendor/golang.org/x/sys/unix/ztypes_linux_ppc.go +754 -0
  456. package/govendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go +749 -0
  457. package/govendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go +749 -0
  458. package/govendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go +828 -0
  459. package/govendor/golang.org/x/sys/unix/ztypes_linux_s390x.go +763 -0
  460. package/govendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go +744 -0
  461. package/govendor/golang.org/x/sys/unix/ztypes_netbsd_386.go +585 -0
  462. package/govendor/golang.org/x/sys/unix/ztypes_netbsd_amd64.go +593 -0
  463. package/govendor/golang.org/x/sys/unix/ztypes_netbsd_arm.go +590 -0
  464. package/govendor/golang.org/x/sys/unix/ztypes_netbsd_arm64.go +593 -0
  465. package/govendor/golang.org/x/sys/unix/ztypes_openbsd_386.go +568 -0
  466. package/govendor/golang.org/x/sys/unix/ztypes_openbsd_amd64.go +568 -0
  467. package/govendor/golang.org/x/sys/unix/ztypes_openbsd_arm.go +575 -0
  468. package/govendor/golang.org/x/sys/unix/ztypes_openbsd_arm64.go +568 -0
  469. package/govendor/golang.org/x/sys/unix/ztypes_openbsd_mips64.go +568 -0
  470. package/govendor/golang.org/x/sys/unix/ztypes_openbsd_ppc64.go +570 -0
  471. package/govendor/golang.org/x/sys/unix/ztypes_openbsd_riscv64.go +570 -0
  472. package/govendor/golang.org/x/sys/unix/ztypes_solaris_amd64.go +516 -0
  473. package/govendor/golang.org/x/sys/unix/ztypes_zos_s390x.go +552 -0
  474. package/govendor/golang.org/x/sys/windows/aliases.go +13 -0
  475. package/govendor/golang.org/x/sys/windows/dll_windows.go +380 -0
  476. package/govendor/golang.org/x/sys/windows/env_windows.go +57 -0
  477. package/govendor/golang.org/x/sys/windows/eventlog.go +20 -0
  478. package/govendor/golang.org/x/sys/windows/exec_windows.go +248 -0
  479. package/govendor/golang.org/x/sys/windows/memory_windows.go +48 -0
  480. package/govendor/golang.org/x/sys/windows/mkerrors.bash +70 -0
  481. package/govendor/golang.org/x/sys/windows/mkknownfolderids.bash +27 -0
  482. package/govendor/golang.org/x/sys/windows/mksyscall.go +9 -0
  483. package/govendor/golang.org/x/sys/windows/race.go +30 -0
  484. package/govendor/golang.org/x/sys/windows/race0.go +25 -0
  485. package/govendor/golang.org/x/sys/windows/security_windows.go +1537 -0
  486. package/govendor/golang.org/x/sys/windows/service.go +257 -0
  487. package/govendor/golang.org/x/sys/windows/setupapi_windows.go +1425 -0
  488. package/govendor/golang.org/x/sys/windows/str.go +22 -0
  489. package/govendor/golang.org/x/sys/windows/syscall.go +104 -0
  490. package/govendor/golang.org/x/sys/windows/syscall_windows.go +1952 -0
  491. package/govendor/golang.org/x/sys/windows/types_windows.go +4058 -0
  492. package/govendor/golang.org/x/sys/windows/types_windows_386.go +35 -0
  493. package/govendor/golang.org/x/sys/windows/types_windows_amd64.go +34 -0
  494. package/govendor/golang.org/x/sys/windows/types_windows_arm.go +35 -0
  495. package/govendor/golang.org/x/sys/windows/types_windows_arm64.go +34 -0
  496. package/govendor/golang.org/x/sys/windows/zerrors_windows.go +9468 -0
  497. package/govendor/golang.org/x/sys/windows/zknownfolderids_windows.go +149 -0
  498. package/govendor/golang.org/x/sys/windows/zsyscall_windows.go +4828 -0
  499. package/govendor/manifest.txt +7 -0
  500. package/package.json +7 -1
  501. package/tsparser/check.go +157 -0
  502. package/tsparser/main.go +30 -1
  503. package/types/typenative-go.d.ts +15159 -5
  504. package/types/typenative-npm.d.ts +2640 -34
  505. package/types/typenative.d.ts +651 -8
package/.gitattributes ADDED
@@ -0,0 +1 @@
1
+ govendor/** linguist-vendored
@@ -5,7 +5,39 @@ on:
5
5
  pull_request:
6
6
 
7
7
  jobs:
8
+ # Every probe through the Node CLI, on each OS a generated binary can target
8
9
  conformance:
10
+ strategy:
11
+ fail-fast: false
12
+ matrix:
13
+ os: [ubuntu-latest, windows-latest, macos-latest]
14
+ runs-on: ${{ matrix.os }}
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+
18
+ - uses: actions/setup-node@v4
19
+ with:
20
+ node-version: 24
21
+ cache: npm
22
+
23
+ - uses: actions/setup-go@v5
24
+ with:
25
+ go-version: '1.26'
26
+ cache-dependency-path: tsparser/go.sum
27
+
28
+ - run: npm ci
29
+
30
+ - run: npm run build
31
+
32
+ - run: npm ci
33
+ working-directory: conformance
34
+
35
+ - run: npm run check:go-types
36
+
37
+ - run: npm run conformance:parallel
38
+
39
+ # The self-hosted compiler: same probes, and it must reproduce its own Go
40
+ native:
9
41
  runs-on: ubuntu-latest
10
42
  steps:
11
43
  - uses: actions/checkout@v4
@@ -17,7 +49,8 @@ jobs:
17
49
 
18
50
  - uses: actions/setup-go@v5
19
51
  with:
20
- go-version: '1.23'
52
+ go-version: '1.26'
53
+ cache-dependency-path: tsparser/go.sum
21
54
 
22
55
  - run: npm ci
23
56
 
@@ -26,4 +59,8 @@ jobs:
26
59
  - run: npm ci
27
60
  working-directory: conformance
28
61
 
29
- - run: npm run conformance
62
+ - run: npm run build:native
63
+
64
+ - run: npm run bootstrap:check
65
+
66
+ - run: node scripts/conformance-parallel.mjs --native
@@ -27,11 +27,13 @@ jobs:
27
27
  node-version: 24
28
28
  - uses: actions/setup-go@v5
29
29
  with:
30
- go-version: '1.23'
30
+ go-version: '1.26'
31
31
  - run: npm ci
32
+ # Test what gets published: bin/ rebuilt from src/, not the committed copy
33
+ - run: npm run build
32
34
  - run: npm ci
33
35
  working-directory: conformance
34
- - run: npm run conformance
36
+ - run: npm run conformance:parallel
35
37
 
36
38
  release:
37
39
  needs: test
@@ -78,6 +80,9 @@ jobs:
78
80
 
79
81
  - run: npm ci
80
82
 
83
+ # Publish bin/ built from this commit (prebuild also stamps the tag's version)
84
+ - run: npm run build
85
+
81
86
  # Authenticates via OIDC (id-token: write) — no NODE_AUTH_TOKEN needed.
82
87
  # Provenance is included automatically; the flag is kept for explicitness.
83
88
  - run: npm publish --provenance --access public
package/CHANGELOG.md CHANGED
@@ -5,6 +5,299 @@ All notable changes to TypeNative will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [Unreleased]
9
+
10
+ ## [0.3.0] - 2026-10-18
11
+
12
+ Errors now point at your TypeScript. Programs are type-checked before they're transpiled, code
13
+ TypeNative can't compile stops the build with its position, and Go build errors and panics
14
+ report `.ts` lines. CI runs the suite on Linux, Windows and macOS, and all 398 probes pass on
15
+ Windows (four failed there before), through both the Node CLI and the self-hosted compiler.
16
+
17
+ ### Added
18
+
19
+ - **Type-checking**: the CLI type-checks the entry file and its imports before transpiling,
20
+ using the nearest `tsconfig.json` (or `lib: []` plus the bundled `typenative` declarations),
21
+ and stops on errors (`main.ts:4:7: error TS2322: …`); `--no-typecheck` skips it. The
22
+ self-hosted compiler runs the same check on typescript-go (`tsparser --check`)
23
+ - **Line directives**: generated Go carries `/*line file.ts:line:col*/` directives, so
24
+ `go build` errors and panic stack traces report TypeScript files and lines; runtime helpers
25
+ keep their own `dist/code.go` positions. Both parsers emit `line` / `column` on AST nodes
26
+ - `TranspileResult.diagnostics`, and `fileName` / `goFile` / `goos` transpile options
27
+ - `npm run bootstrap:check`: the self-hosted compiler must emit byte-identical Go for
28
+ `src/main.ts` to the Node CLI's; `conformance-parallel.mjs --native`
29
+ - CI on Ubuntu, Windows and macOS, `check:go-types` in CI, and a self-hosted compiler job
30
+ (bootstrap fixpoint + the suite through it)
31
+
32
+ ### Changed
33
+
34
+ - Unsupported syntax and unsupported `node:` modules are errors with a position
35
+ (`main.ts:2:1: error: Unsupported syntax: WithStatement`) instead of warnings followed by
36
+ broken Go; `;` and `debugger` statements compile to nothing
37
+ - Generated Go is deterministic: temp and renamed identifiers come from a generator seeded per
38
+ transpilation instead of `Math.random`, so the same source always gives the same Go
39
+ - Code typed into `--script`'s prompt is saved as `dist/script.ts` (type-checked, and named in
40
+ errors)
41
+ - Scaffolded `tsconfig.json` sets `skipLibCheck`
42
+ - `node:sqlite` `function()` / `aggregate()` callbacks are typed `(...args: any[])`: arguments
43
+ convert to the types the callback declares
44
+ - The release workflow builds `bin/` before testing and publishing; `conformance-parallel.mjs`
45
+ sizes its worker pool to the machine
46
+ - Probes that depend on the OS (`lib-node-dns-resolver`, `lib-node-util-parse-args`) hold on
47
+ Windows, and the conformance probes type-check (`conformance/tsconfig.json` sets
48
+ `skipLibCheck`)
49
+
50
+ ### Fixed
51
+
52
+ - Windows: `os.totalmem()` / `os.freemem()` / `os.uptime()` read the OS (they returned the
53
+ process's own memory, `0` and `0`); `performance.now()` keeps increasing between calls, so
54
+ marks taken in a row keep their order (Go's Windows clock repeats readings)
55
+
56
+ ## [0.2.0] - 2026-10-18
57
+
58
+ The Go standard-library bridge (`go:*` imports) goes from 73 to 154 probed packages, with 16
59
+ left typed-only and 6 excluded. Most of the new coverage came with bridge fixes found by the
60
+ probes: callbacks, generics, tuples, struct fields and constants now behave the way the
61
+ generated types say they do.
62
+
63
+ ### Added
64
+
65
+ - **Go probes**: compress (flate, zlib, lzw, bzip2), archive/tar, encoding (json, base32,
66
+ ascii85, asn1), mime/quotedprintable, unicode/utf16, hash (adler32, crc64, maphash), crypto
67
+ (sha3, hkdf, pbkdf2, des, rc4, fips140, ecdh, ecdsa, elliptic, mlkem, mlkemtest, x509, pkix,
68
+ tls metadata, dsa, hpke), fmt, path, io/fs, io/ioutil, maps, iter, unique, weak, structs,
69
+ image (color, palette, draw, gif, jpeg), go/* (parser, ast, scanner, printer, constant,
70
+ build, build/constraint, doc, doc/comment, types, importer), html/template,
71
+ text/template/parse, regexp/syntax, reflect, net (loopback TCP, textproto, cookiejar,
72
+ httputil, httptrace, pprof, cgi), runtime (metrics, pprof, trace), time/tzdata, os/user,
73
+ debug/buildinfo, math/big, testing (testing, fstest, iotest, quick), database/sql (+driver),
74
+ syscall
75
+ - **Go generics**: type args are inferred recursively from the arguments and through constraint
76
+ core types (`Map ~map[K]V`); callback params of generic functions and methods on generic
77
+ receivers (`unique.Handle[T].Value`) are concrete
78
+ - **Go callbacks**: TS closures passed to Go (params or struct fields) get the exact Go
79
+ signature — int params read as numbers, block bodies work, returns convert to the result type
80
+ - `for (const [k, v] of seq2)` over `iter.Seq2`; destructuring multi-value Go calls types each
81
+ element; printf-style calls pass numbers to `%d %x %o %b %c %U` as `int64`
82
+ - `String.indexOf(search, fromIndex)`
83
+ - `npm run check:go-types` type-checks the `go:*` probes against `types/typenative-go.d.ts`
84
+ - **Node networking**: `node:net` (TCP / Unix servers and sockets as duplex streams, Node's
85
+ `ECONNREFUSED`-style errors, `isIP`), `node:dns` (+ `dns/promises`), `node:http` /
86
+ `node:https` (servers on `net/http`, `request` / `get`, `STATUS_CODES`, `METHODS`),
87
+ `node:tls` (Node's certificate checks and error codes, `getPeerCertificate`), `node:dgram`,
88
+ and the global `fetch` with `Headers` / `Request` / `Response`
89
+ - **`node:async_hooks`**: `AsyncLocalStorage` and `AsyncResource`; the event loop carries an
90
+ async context through timers, `nextTick`, microtasks, promise callbacks, awaits, fs / dns
91
+ callbacks, streams and servers
92
+ - **`node:test`**: `test` / `describe` / `it` with hooks, subtests, skip / todo, timeouts and
93
+ `mock.fn`; Node's TAP (or, on a terminal, spec) report and exit code
94
+ - **`node:worker_threads`**: workers re-run the program as child processes linked over
95
+ loopback TCP (structured-clone messages, `workerData`, `terminate`, errors), plus
96
+ `MessageChannel` / `MessagePort` / `BroadcastChannel`; globals `__filename` / `__dirname`
97
+ - `new Promise((resolve) => setTimeout(resolve, ms))`: `resolve` / `reject` can be passed as
98
+ values
99
+ - **`node:stream/web`**: `ReadableStream` / `WritableStream` / `TransformStream` with readers,
100
+ writers, controllers, queuing strategies, `tee` / `pipeTo` / `pipeThrough` and `for await`;
101
+ `TextEncoderStream` / `TextDecoderStream`, `CompressionStream` / `DecompressionStream` (also
102
+ globals); `Readable.toWeb` / `fromWeb` & co. and `stream.compose`
103
+ - `Blob` / `File` (`node:buffer` and globals) and `FormData`; fetch streams bodies
104
+ (`response.body`, `ReadableStream` uploads), sends Blob / FormData bodies and reads
105
+ `blob()` / `formData()`
106
+ - `TextDecoder#decode(bytes, { stream: true })`
107
+ - **`node:crypto`**: `scrypt` / `scryptSync`; callback forms of `pbkdf2`, `hkdf`,
108
+ `randomBytes`, `randomFill`; `KeyObject` with `createPrivateKey` / `createPublicKey` /
109
+ `createSecretKey` and PEM / DER / JWK import and export; `generateKeyPair(Sync)` (RSA, EC,
110
+ Ed25519, X25519) and `generateKey(Sync)`; `sign` / `verify`, `createSign` / `createVerify`
111
+ (PKCS#1 v1.5, PSS, ECDSA DER / P1363, Ed25519); `publicEncrypt` & co.; ECDH and classic
112
+ Diffie-Hellman (MODP groups); `generatePrime` / `checkPrime`; `X509Certificate`; and
113
+ `crypto.subtle` (digest, keys, sign / verify, AES-GCM / CBC / CTR, RSA-OAEP, PBKDF2 / HKDF /
114
+ ECDH / X25519 derivation, wrap / unwrap)
115
+ - **`child_process.fork`** with an IPC channel (`send` / `'message'` / `disconnect`;
116
+ `process.send` / `process.on('message')` in the child) and **`node:cluster`**: workers share
117
+ listening ports through the primary, which relays connections round-robin; cluster and worker
118
+ events, `disconnect`, `setupPrimary`
119
+ - **`node:http2`** on `net/http`'s HTTP/2: h2c and TLS servers with the `'stream'` API
120
+ (`respond`, `respondWithFile`) and the compatibility `(req, res)` API; `connect()` client
121
+ sessions whose `request()` streams emit `'response'` with `:status`
122
+ - `path.matchesGlob`; Buffer `read/writeBig(U)Int64LE/BE`, `swap16/32/64`, `buffer.isUtf8` /
123
+ `isAscii` / `transcode`; `util.parseArgs`, `getSystemErrorName` / `Message` / `Map`,
124
+ `MIMEType`, `parseEnv`, `aborted`, `debuglog`, `toUSVString`; `process.loadEnvFile`
125
+ - `process.on('uncaughtException' | 'uncaughtExceptionMonitor' | 'unhandledRejection' |
126
+ 'beforeExit')`, `process.cpuUsage` / `resourceUsage` / `availableMemory`; `os.totalmem` /
127
+ `freemem` / `uptime` / `loadavg` / `release` / `version`; timer handles with `ref` / `unref` /
128
+ `hasRef` / `refresh` / `close`; `PerformanceObserver`, `performance.timerify` /
129
+ `eventLoopUtilization`, `createHistogram`, `monitorEventLoopDelay`; `events.errorMonitor`,
130
+ `captureRejections`, static `getMaxListeners` / `setMaxListeners`, `addAbortListener`
131
+ - zlib callback forms (`gzip(buf, [options], cb)` & co.) and `util.promisify` of them;
132
+ `readline.cursorTo` / `moveCursor` / `clearLine` / `clearScreenDown`;
133
+ `diagnostics_channel.tracingChannel` (`traceSync` / `tracePromise` / `traceCallback`) and
134
+ `channel.bindStore` / `runStores`; `net.BlockList` / `SocketAddress`; `dns.Resolver` (own
135
+ servers, `timeout`, `cancel`), `setServers`, `lookupService`; `tls.checkServerIdentity` (and
136
+ the `connect` option); HTTP `'upgrade'` / `'connect'` on servers and clients; node:test
137
+ `t.assert` and `mock.timers`; `console.table`
138
+ - `new Error(message, { cause })` / `err.cause`; fetch refuses the Fetch standard's bad ports;
139
+ `net.Stream` and the `autoSelectFamily` defaults
140
+ - **`node:sqlite`**: `DatabaseSync` / `StatementSync` (`run` / `get` / `all` / `iterate`, named
141
+ and bare parameters, `readBigInts`, `returnArrays`, `columns()`, `expandedSQL`), `function()`,
142
+ `aggregate()` (window functions), `setAuthorizer`, `limits`, `createTagStore()`, `backup()`,
143
+ and Node 24's error codes and messages. SQLite comes from github.com/ncruces/go-sqlite3 (Wasm
144
+ translated to Go: no cgo), vendored in `govendor/` by `npm run vendor:go` so builds need no
145
+ network. `loadExtension`, sessions and `serialize` are not available
146
+ - conformance.md gives each unsupported Node module (`vm`, `repl`, `inspector`, …) its own section
147
+
148
+ ### Fixed
149
+
150
+ - **Go types**: void functions were typed as returning `GoError`; params now accept what the
151
+ bridge converts (`number[]` for `[]byte`, one-char strings for `byte`/`rune`, `null` for
152
+ nil-able types, an array for variadics, an optional trailing `error`); pointers to basics are
153
+ `GoRef<T>`; typed constants keep their named type; aliases resolve (`os.FileMode`); named
154
+ slice/map types keep their methods (`net.IP`); `iter.Seq` is iterable; unimportable
155
+ `*/internal` packages are dropped and `runtime/cgo` is excluded
156
+ - **Go bridge**: path-qualified types (`net/http.Cookie`) are localized and imported; unused
157
+ type-only imports are dropped and `import 'go:pkg'` emits `import _`; field reads/writes
158
+ convert numbers on any receiver; `null` comparisons on nil-able Go values are real nil checks;
159
+ `===` with typed constants coerces; `ref<T>().value` dereferences; `json.Unmarshal` fills a
160
+ `Record` ref
161
+ - `npm run gen:go` runs from the repo root again
162
+ - The self-hosted compiler (`npm run build:native`) builds again; the `src/go/*` modules are
163
+ transpilable by TypeNative
164
+ - Object literals whose keys aren't identifiers (`{ 'Content-Type': … }`) compile (as records)
165
+ - `const { a, b } = f()` evaluates `f()` once
166
+ - `await` inside async arrow callbacks no longer blocks the event loop (every `await` goes
167
+ through `TnAwait`)
168
+ - `JSON.parse` assigned to an interface type converts into its struct (it was `nil`); typed
169
+ callback parameters accept decoded JSON-like values
170
+ - `for await` over a stream that errors throws the error (it ended the loop silently)
171
+ - `const { value, done } = obj` on Node class instances types the bindings (and reads
172
+ accessors); `x as File` asserts dynamic values to Node classes
173
+ - `Response#clone()` of a network body no longer blocks the event loop (both copies stream it)
174
+ - The self-hosted compiler no longer crashes on `const [a, b] = call()`
175
+ - A detached top-level async call with arguments (`run(a, b);`) passes them (they were dropped)
176
+ - A function that only returns `undefined` compiles (its result type was `nil`)
177
+ - `gunzip` of data without a gzip header fails with `incorrect header check`, as in Node
178
+ - Error properties declared by both `NodeJS.ErrnoException` and `AssertionError` no longer hide
179
+ each other (`(e.cause as Error).message` typed the cause as unknown)
180
+ - Negative bigint literals and `-x` on bigints; hex / octal / binary bigint literals;
181
+ `p.then(() => …)` on a `Promise<void>`; `JSON.stringify` of records keeps their keys (it
182
+ printed the map's internals); `String(x)` / template literals use a Node class's `toString()`
183
+ - Top-level variables named like an imported Go package (`rsa`, `pem`, `encoding`, `http`, …) are
184
+ renamed instead of clashing with it; `bigint.toString(radix)`; `ArrayBuffer` annotations and
185
+ `byteLength` on Buffers
186
+ - Object literals with `$` in a key (`{ $id: 1 }`) compile (as records); `rows as Row[]` on an
187
+ array of dynamic values converts each element; records held in dynamic values read their keys
188
+ (`row.name`, `row['name']`, `Object.keys(row)`, `row as Row`); `bytes[i]` on a dynamic
189
+ `Uint8Array`; `x === 1n` when `x` is `number | bigint`
190
+ - `arr.reduce(…)` has a result type (functions returning it compiled without a return value); a
191
+ typed arrow parameter is no longer mistaken for an earlier variable of the same name
192
+ - `(c) => (body += c)` arrow bodies; `console.log(x?.y)` prints optional strings / numbers
193
+ without quotes; the self-hosted compiler no longer crashes on `console.log` arguments of
194
+ unknown type
195
+
196
+ ## [0.1.3] - 2026-10-15
197
+
198
+ Decorators and JSX arrive alongside a broad language-surface expansion (`using`, `new.target`,
199
+ `for await`, namespaces, dynamic `import()`), and `types/typenative.d.ts` grows into a complete
200
+ lib replacement. The conformance suite grows to 241 probes — including its first `.tsx` probe —
201
+ and passes fully through the dev CLI.
202
+
203
+ ### Added
204
+
205
+ - **Language**: `using` declarations — `[Symbol.dispose]()` runs when the enclosing block or
206
+ function exits, in reverse declaration order; `new.target` (constructors pass the target class
207
+ name through `super()` chains); `for await...of`; the `arguments` object; namespaces; computed
208
+ and heterogeneous enums; callable/construct signatures (`type F = { (): void }` — a class passed
209
+ as a value is its constructor); ambient declarations (`declare const` / `declare function` /
210
+ `declare module`); string, numeric and boolean literal types (single literals, unions,
211
+ literal-union `Record` keys)
212
+ - **Decorators**: standard method and class decorators — decorator factories (`@tag('x')`),
213
+ stacked decorators, static methods — applied where the class is defined; `this` in the wrapper
214
+ is the decorated method's receiver; `f.call` / `f.apply`
215
+ - **JSX**: `.tsx` files render JSX to HTML strings — text is escaped, void tags self-close
216
+ (`<br/>`), components are called with their props, `className` maps to `class`, boolean
217
+ attribute shorthand (`disabled`) and fragments flatten; both parsers take a tsx flag and
218
+ `.tsx` imports resolve
219
+ - **Modules**: re-exports (`export { x } from './y'`), side-effect imports (`import './x'`),
220
+ dynamic `import()` (async), `import x = require('y')`; top-level statements of imported
221
+ modules execute through a generated `init()`
222
+ - **Typing**: rest-parameter function types `(...args: T[]) => R` become variadic Go func types
223
+ - **Library**: `String.normalize` — backed by `golang.org/x/text/unicode/norm`, vendored from
224
+ GOROOT's vendor tree via a `replace` in `dist/go.mod`, so builds need no network; object
225
+ literals of method-bearing interfaces; `new Set([...spread])`
226
+ - **Type definitions**: `types/typenative.d.ts` expands by ~500 lines — `Generator`/`AsyncGenerator`
227
+ and the `Iterable`/`AsyncIterable` families, `Disposable`, `Awaited`, `TemplateStringsArray`,
228
+ `ArrayLike`, real mapped types for `Partial`/`Required`/`Readonly`/`Pick`/`Omit`/`Record`,
229
+ `RegExpExecArray`, constructor interfaces (`Array`/`String`/`Number`) and the `JSX` namespace
230
+ - **Project config**: `types/tsconfig.json` — a standalone `lib: []` project for the
231
+ lib-replacement d.ts, so editors don't load es5 libs alongside it (TS6200, duplicate identifiers)
232
+
233
+ ### Changed
234
+
235
+ - The conformance runner picks up `.tsx` probes; scaffolds pin `typenative ^0.1.3`; `dist/`
236
+ cleanup also removes stale `go.mod`/`go.sum`
237
+ - Both parsers emit `declarationKind` (`var`/`let`/`const`/`using`/`await using`) on variable
238
+ declaration lists; tsparser takes `--tsx` and emits `JsxText`
239
+ - README rewritten: requirements, quick start, CLI reference, and expanded language/stdlib tables
240
+
241
+ ## [0.1.2] - 2026-10-13
242
+
243
+ The type system and standard library catch up with the conformance matrix: generics gain
244
+ constraints, defaults and generic interfaces; utility types, `keyof`/`typeof`, intersections,
245
+ conditional types and mapped types lower to Go; Promise, timer, Object, collection and math
246
+ built-ins round out. The conformance suite grows to 219 probes (including 15 for rows that
247
+ already worked — `console.error`/`warn`, `Map`/`Set.clear`, `node:url`, `process.cwd`, `split`
248
+ with a RegExp, access modifiers, `const enum`, `import type`, indexed access types, literal
249
+ types, hex/octal/binary literals, `override`, template literal types, `var`) and passes fully
250
+ through the dev CLI; the stage-1/stage-2 bootstrap fixpoint holds.
251
+
252
+ ### Added
253
+
254
+ - **Generics**: constraints (`T extends U`), defaults (`T = U`), generic interfaces, class
255
+ expressions, index signatures, `keyof` and mapped types
256
+ - **Type operators**: `keyof T`, `typeof x`, `readonly T[]`, intersections `A & B` (merged into
257
+ one struct), conditional types (`T extends U ? X : Y`) with `infer`, `void`/`never`/`object`,
258
+ the `void` operator, `satisfies`
259
+ - **Utility types**: `Partial`, `Required`, `Readonly`, `Pick`, `Omit`, `NonNullable` (lowered to
260
+ the base type)
261
+ - **Language**: async generators (`async function*` driven by `for await`), labeled tuple
262
+ elements with optional and rest members (`[x: number, y?: string, ...rest: number[]]`),
263
+ overload signatures, `this: T` parameters, `asserts x is T`, optional call `f?.()` (checks the
264
+ function value; the result is nullable), comma-separated declarators/updates in `for` headers
265
+ (`for (let i = 0, j = 10; …; i++, j--)` via Go's parallel forms), import renaming
266
+ (`import { a as b }`), `static { … }` blocks → `func init()`, self-referencing arrow functions
267
+ (`const f = (…) => … f(…) …`)
268
+ - **Promises & timers**: `Promise.prototype.reject`/`catch`/`finally`, combinators
269
+ `race`/`allSettled`/`any`, `Promise.resolve`; `setTimeout` returns a handle that `clearTimeout`
270
+ stops; `setInterval`; `queueMicrotask`
271
+ - **Objects**: `Object.hasOwn`, `Object.defineProperty`, `Object.fromEntries`, integrity methods
272
+ (`freeze`/`seal`/`preventExtensions`)
273
+ - **Collections**: `WeakMap`/`WeakSet`; ES2024 `Set` operations (`union`, `intersection`,
274
+ `difference`, `isSubsetOf`, …); array `concat` (flattens one level), `copyWithin`, `toSpliced`,
275
+ `toSorted`, `toReversed`, `with`, `reduceRight`; `any` receivers accept the newer array methods
276
+ through array-only method casts
277
+ - **Strings, numbers, regex**: `String.raw`, `toPrecision`, `String()`/`Boolean()` with JS
278
+ formatting and truthiness; regex `y`/`u` flags and `.source`/`.flags`
279
+ - **Globals**: `globalThis`, `structuredClone`, `isFinite`, `encodeURIComponent`/
280
+ `decodeURIComponent`; `Math` constants (`PI`, `E`, `SQRT2`, …) and `hypot`/`cbrt`/`expm1`/
281
+ `log1p`/hyperbolics/inverse trig/`atan2`
282
+ - **Date**: `getUTC*` getters and `Date.UTC`
283
+ - **Semantics**: functions stored in `Record`s are called as values — `rec.fn(args)` lowers to
284
+ `rec.Get("fn")(args)` (previously dispatched as a built-in method, so `handlers.sort(x)` ran an
285
+ array sort); names that are also JS `Map` methods stay Map methods unless the receiver is typed
286
+ as a `Record`; dynamic `obj[key] = v` writes; mixed array literals (`[['a', 1]]`) become
287
+ `[]interface{}`
288
+
289
+ ### Changed
290
+
291
+ - tsparser emits the raw text of template literals
292
+
293
+ ### Fixed
294
+
295
+ - `JSON.stringify` no longer HTML-escapes `<`, `>`, `&` in the reflection path (`json.Marshal`
296
+ produced `\u003c`); stage 1 and stage 2 of the bootstrap generate identical Go again
297
+ - `Date.toISOString` printed the month twice (`2006-01-01` instead of `2006-01-02`)
298
+ - `??` passed to a nullable parameter is boxed; object literals nested in dynamic objects stay
299
+ dynamic; shorthand properties (`{ x }`) read narrowed variables correctly
300
+
8
301
  ## [0.1.1] - 2026-10-10
9
302
 
10
303
  The conformance suite is fully green: all 147 probes pass (up from 95/147), through both the dev
package/CONTRIBUTION.md CHANGED
@@ -44,7 +44,7 @@ Probe conventions:
44
44
 
45
45
  - Self-contained — no imports except the module under test, no external files.
46
46
  - Exercise the feature with `console.log` **and** verify with `assert(condition, 'message')`.
47
- - A passing probe transpiles, compiles with `go build`, runs, and exits `0`. Anything else is a failure.
47
+ - A passing probe type-checks (against `conformance/tsconfig.json`), transpiles, compiles with `go build`, runs, and exits `0`. Anything else is a failure.
48
48
 
49
49
  ```ts
50
50
  // conformance/lib-map.ts
@@ -66,14 +66,15 @@ The `.d.ts` files are the type-checking contract for user code. If your feature
66
66
 
67
67
  - `types/typenative.d.ts` — core JS subset (`Array`, `Map`, `Set`, `JSON`, `Math`, `RegExp`, …).
68
68
  - `types/typenative-npm.d.ts` — `node:*` shims (`fs`, `path`, `os`, `child_process`, …).
69
- - `types/typenative-go.d.ts` — `go:*` bridges (`fmt`, `strings`, `strconv`).
69
+ - `types/typenative-go.d.ts` — `go:*` bridges. Generated from the Go standard library by `npm run gen:go` (`scripts/gostd`), which also rewrites the Go table in conformance.md; never edit it by hand. `npm run check:go-types` type-checks the `lib-go-*` probes against it.
70
70
 
71
71
  No signature → user code won't type-check → the feature doesn't exist.
72
72
 
73
73
  ### 3. Implement in `src/transpiler.ts`
74
74
 
75
75
  - Match on `node.kind === 'Xxx'` strings (never the `typescript` enum) so the same code consumes Node- and Go-produced ASTs.
76
- - Emit a warning, not a crash, for anything still unsupported: `console.warn('[TypeNative] Unsupported syntax: …')`.
76
+ - Report anything still unsupported with `reportError(node, 'Unsupported …')`, not a crash or a guess: it becomes a `file.ts:line:col: error:` diagnostic and the CLI stops before `go build`.
77
+ - New statement-like output goes through `withLineMarker(node, code)` (statement lists already do), so Go errors and stack traces point at the `.ts` line.
77
78
  - Keep the transpiler free of Node-only dependencies (see below).
78
79
 
79
80
  ### 4. Document in `conformance.md`
@@ -85,7 +86,7 @@ Add or flip the matrix row and link your probe. Keep ✅/❌ honest — known ga
85
86
  This is the one rule that breaks the build if ignored: **`src/index.ts`, `src/transpiler.ts`, `src/main.ts`, `src/prompt.ts`, and `src/parse-native.ts` must transpile with TypeNative itself.** That means:
86
87
 
87
88
  - ❌ No `inquirer`, no async Node-only APIs, no unmapped modules in those files.
88
- - ✅ Node-only code lives in `src/cli.ts` (prompts) and `src/parse-node.ts` (`typescript` package) and is injected at the boundary — e.g. `run({ ..., parse: parseAstJson })`.
89
+ - ✅ Node-only code lives in `src/cli.ts` (prompts), `src/parse-node.ts` and `src/typecheck-node.ts` (`typescript` package) and is injected at the boundary — e.g. `run({ ..., parse: parseAstJson, typeCheck })`. The self-hosted binary injects `tsparser`-backed versions (`src/parse-native.ts`).
89
90
  - ✅ Prompts in transpilable code go through `src/prompt.ts` (`node:readline` → Go helper).
90
91
 
91
92
  If you need a new capability in transpilable code, add the mapping (transpiler + `types/` shim) first, then use it.
@@ -109,10 +110,11 @@ If you touched anything transpilable, also verify self-hosting:
109
110
 
110
111
  ```sh
111
112
  npm run build:native # builds native/tsparser + native/typenative
112
- node scripts/conformance.mjs --native # full suite through your new binary
113
+ npm run bootstrap:check # native/typenative must emit the same Go for src/main.ts
114
+ node scripts/conformance-parallel.mjs --native # full suite through your new binary
113
115
  ```
114
116
 
115
- CI ([`.github/workflows/ci.yml`](.github/workflows/ci.yml)) runs `npm ci` → `npm run build` → `npm run conformance` on Ubuntu (Node 24 + Go). Match it locally before pushing.
117
+ CI ([`.github/workflows/ci.yml`](.github/workflows/ci.yml)) runs `npm run build`, `npm run check:go-types` and `npm run conformance:parallel` on Ubuntu, Windows and macOS (Node 24 + Go 1.26), plus a Linux job that builds the native compiler, runs `npm run bootstrap:check` and the suite through it. Probes that depend on the OS should hold on all three (branch on `process.platform` where Node itself differs).
116
118
 
117
119
  ## Pull requests
118
120
 
package/README.md CHANGED
@@ -122,8 +122,11 @@ Scaffolded `tsconfig.json` targets the TypeNative type surface:
122
122
  | `--output <path>` | build | Where to copy the compiled binary. If omitted with `--script`, the temp binary in `dist/` is executed and kept there. |
123
123
  | `--script` | run | Build to `dist/native(.exe)` and execute immediately with inherited stdio. Combine with `--source`, or omit `--source` to type code into the prompt. |
124
124
  | `--new` | scaffold | Create a new project directory (`main.ts`, `package.json`, `tsconfig.json`, `README.md`, `.gitignore`). |
125
+ | `--no-typecheck` | build / script | Skip the type-check that runs before transpiling. |
125
126
 
126
- Exit codes from `--script` are the exit code of your program. A non-zero `go build` prints `go build failed:` plus the compiler output and exits `1`.
127
+ Exit codes from `--script` are the exit code of your program. Before anything is built, the entry file and its imports are type-checked with the nearest `tsconfig.json` (or TypeNative's defaults: `lib: []` plus the `typenative` declarations); type errors print as `main.ts:4:7: error TS2322: …` and exit `1`. TypeScript TypeNative can't compile yet is an error too (`main.ts:2:1: error: Unsupported syntax: WithStatement`), not a guess. A non-zero `go build` prints `go build failed:` plus the compiler output and exits `1`.
128
+
129
+ Errors point at your TypeScript, not the generated Go: `dist/code.go` carries Go line directives, so `go build` errors and panic stack traces report `.ts` files and lines (`main.ts:12`).
127
130
 
128
131
  ## Writing TypeNative-compatible TypeScript
129
132
 
@@ -154,7 +157,7 @@ TypeNative supports a growing subset of TypeScript, not the whole language. The
154
157
  | `JSON` | `parse` / `stringify` |
155
158
  | `RegExp` | Literals + `new RegExp()`, `test()`, `exec()` with named groups (`.groups`), flags `i`/`m`/`s`/`g`/`y`/`u`, stateful `lastIndex` for `/g` loops, `source`/`flags`/`global`/... properties. Backreferences, lookahead and lookbehind run on a small backtracking engine (RE2 does not support them) |
156
159
  | Globals | `setTimeout`/`clearTimeout`, `setInterval`/`clearInterval`, `queueMicrotask`, `structuredClone`, `globalThis`, `encodeURIComponent`/`decodeURIComponent`, `isNaN`/`isFinite`, `NaN`/`Infinity` |
157
- | `process` | `argv` (→ `os.Args`), `platform` (→ Node-style names), `env`, `cwd`, `exit` |
160
+ | `process` | `argv`, `platform` (→ Node-style names), `env`, `cwd`, `exit`, `exitCode`, `hrtime`, `stdout`/`stderr`/`stdin`, `on('exit')`, … (see [node:process](conformance.md#nodeprocess)) |
158
161
 
159
162
  **Node built-ins (import with the `node:` prefix, mapped to Go helpers):**
160
163
 
@@ -169,7 +172,7 @@ fs.readFileSync('file.txt', 'utf-8');
169
172
  childProcess.spawnSync('go', ['version'], { encoding: 'utf-8' });
170
173
  ```
171
174
 
172
- Supported: `node:path` (`join`, `dirname`, `basename`, `extname`, `resolve`), `node:fs` (`read`/`write`/`append`/`exists`/`mkdir`/`readdir`/`copy`/`rm`/`unlink`), `node:url` (`fileURLToPath`, `pathToFileURL`), `node:os` (`platform`, `homedir`, `tmpdir`), `node:child_process` (sync `exec`, `execSync`, and `spawnSync` shaped like Node's `{ stdout, stderr, status }`; pass `{ stdio: 'inherit' }` to run with the parent's stdio or `{ input }` to pipe stdin). `node:readline.question()` exists as a TypeNative sync extension for self-hosted prompts.
175
+ Supported: `path`, `fs` (sync, callbacks, `fs/promises`, streams), `os`, `process`, `buffer`, `url` (`URL`, `URLSearchParams`), `util`, `assert`, `crypto` (hashes, ciphers, keys, signatures, `X509Certificate`, `crypto.subtle`), `zlib`, `events`, `stream` (+ `stream/web`: `ReadableStream` & co.), `readline`, `child_process` (with `fork` / IPC), `cluster`, `timers`, `perf_hooks`, `querystring`, `string_decoder`, networking (`net`, `dns`, `http`, `https`, `http2`, `tls`, `dgram`, global `fetch` with `Blob` / `FormData`), `async_hooks` (`AsyncLocalStorage`), `diagnostics_channel` (with `tracingChannel`), `test` (the `node:test` runner, with `mock.timers`), `worker_threads` (workers as child processes) and `sqlite` (`DatabaseSync` on a bundled pure-Go SQLite: no cgo, no network at build time) and more, with Node's signatures (import as `node:x` or `x`). Callbacks, timers and I/O run on one event loop, as in Node. `node:readline.question()` exists as a TypeNative sync extension for self-hosted prompts. Per-API status: [conformance.md](conformance.md#node-builtins-node).
173
176
 
174
177
  **Direct Go access (import with the `go:` prefix):**
175
178
 
@@ -180,7 +183,7 @@ import { ToUpper } from 'go:strings';
180
183
  Println(Sprintf('hi %s', ToUpper('bob')));
181
184
  ```
182
185
 
183
- Any Go package can be imported this way (`import { X } from 'go:pkg'` → `pkg.X`); the typed subset declared for typechecking is `go:fmt` (`Println`, `Sprintf`), `go:strings` (`ToUpper`, `ToLower`), `go:strconv` (`FormatBool`).
186
+ Any Go package can be imported this way (`import { X } from 'go:pkg'` → `pkg.X` with numeric conversion and throw-on-error results). The full standard library is declared for typechecking (`npm run gen:go`), with 154 packages probed — see [conformance.md](conformance.md#go-bridges-gostar).
184
187
 
185
188
  **npm packages:**
186
189
 
@@ -235,18 +238,19 @@ console.log(`count=${c.count} seen=${seen.get('a')}`);
235
238
  ## How it works
236
239
 
237
240
  ```text
238
- main.ts --(parse)--> normalized JSON AST --(transpileToNative)--> dist/code.go --(go build)--> dist/native(.exe) --run/copy--> your binary
241
+ main.ts --(type-check)--(parse)--> normalized JSON AST --(transpileToNative)--> dist/code.go --(go build)--> dist/native(.exe) --run/copy--> your binary
239
242
  ```
240
243
 
241
- - **Parse:** Node CLI uses the `typescript` npm package (`src/parse-node.ts`); the self-hosted binary spawns the Go `tsparser` tool (`src/parse-native.ts`). Both emit the same `{ kind: "Xxx", ... }` JSON shape so one transpiler consumes either.
242
- - **Transpile:** `transpileToNative(code, { parse, readFile })` in `src/transpiler.ts` lowers the AST to Go, resolving relative and npm imports into additional Go files (`TranspileResult { main, files }`).
243
- - **Build:** `run()` in `src/index.ts` writes `dist/code.go` (+ one Go file per module), cleans stale `dist/*.go`, shells out to `go build -o dist/native(.exe)`, then either executes it (`--script`, stdio inherited) or copies it to `--output`.
244
+ - **Type-check:** Node CLI builds a program with the `typescript` package (`src/typecheck-node.ts`); the self-hosted binary runs `tsparser --check`, the same check on typescript-go (`tsparser/check.go`).
245
+ - **Parse:** Node CLI uses the `typescript` npm package (`src/parse-node.ts`); the self-hosted binary spawns the Go `tsparser` tool (`src/parse-native.ts`). Both emit the same `{ kind: "Xxx", line, column, ... }` JSON shape so one transpiler consumes either.
246
+ - **Transpile:** `transpileToNative(code, { parse, readFile })` in `src/transpiler.ts` lowers the AST to Go, resolving relative and npm imports into additional Go files (`TranspileResult { main, files, diagnostics }`). Generated statements carry `/*line file.ts:line:col*/` directives; `diagnostics` lists source the transpiler can't compile.
247
+ - **Build:** `run()` in `src/index.ts` writes `dist/code.go` (+ one Go file per module), cleans stale `dist/*.go`, shells out to `go build -o dist/native(.exe)`, then either executes it (`--script`, stdio inherited) or copies it to `--output`. Third-party Go modules a program needs (`node:sqlite`'s driver, shipped in `govendor/`; `golang.org/x/text`, copied from GOROOT) are copied under `dist/tnvendor` and wired in with `replace` directives in `dist/go.mod`, so builds stay offline.
244
248
 
245
249
  ## Testing and conformance
246
250
 
247
- `npm test` is `npm run conformance`: every `conformance/*.ts` probe is transpiled, built with `go`, executed, and must exit `0`. Results print per category (`syntax` / `semantics` / `lib`) plus a total pass rate; any failure exits non-zero and lists the first diagnostic line (`*.go:line`, `panic:`, `Unsupported syntax`, `Error`).
251
+ `npm test` is `npm run conformance`: every `conformance/*.ts` probe is type-checked, transpiled, built with `go`, executed, and must exit `0` (`npm run conformance:parallel` runs them concurrently). Results print per category (`syntax` / `semantics` / `lib`) plus a total pass rate; any failure exits non-zero and lists the first diagnostic line (`*.go:line`, `panic:`, `Unsupported syntax`, `Error`).
248
252
 
249
- CI (`.github/workflows/ci.yml`) runs `npm ci`, `npm run build`, and `npm run conformance` on Ubuntu with Node 24 and Go. Releases are cut from `TypeNative_*` tags via trusted publishing.
253
+ CI (`.github/workflows/ci.yml`) runs `npm run build`, `npm run check:go-types` and the conformance suite on Ubuntu, Windows and macOS with Node 24 and Go 1.26, and a Linux job that builds the self-hosted compiler, checks the bootstrap fixpoint (`npm run bootstrap:check`) and runs the suite through it. Releases are cut from `TypeNative_*` tags via trusted publishing, from a fresh `npm run build`.
250
254
 
251
255
  When adding a feature: add a probe, link it from [conformance.md](conformance.md), and keep the ✅/❌ matrix honest — gaps are documented, not hidden.
252
256
 
@@ -260,7 +264,7 @@ npm run build:native # builds native/tsparser + native/typenative side by side
260
264
  native/typenative --source app.ts --script
261
265
  ```
262
266
 
263
- `TYPENATIVE_TSPARSER` overrides parser discovery if you move the binaries apart. Verify parity with `node scripts/conformance.mjs --native`.
267
+ `TYPENATIVE_TSPARSER` overrides parser discovery if you move the binaries apart. Verify parity with `node scripts/conformance.mjs --native`, and that the binary reproduces its own Go with `npm run bootstrap:check`.
264
268
 
265
269
  ## License
266
270
 
package/bin/cli.js CHANGED
@@ -2,11 +2,14 @@
2
2
  // Node CLI entry point (npm `bin`). Interactive prompts use inquirer here;
3
3
  // the actual compiler logic lives in the transpilable src/index.ts.
4
4
  import inquirer from 'inquirer';
5
+ import { fileURLToPath } from 'node:url';
5
6
  import { run, createProject } from './index.js';
6
7
  import { parseAstJson } from './parse-node.js';
8
+ import { typeCheckNode } from './typecheck-node.js';
7
9
  (async function main() {
8
10
  const scriptMode = process.argv.findIndex((a) => a === '--script') > -1;
9
11
  const newCommand = process.argv.findIndex((a) => a === '--new') > -1;
12
+ const noTypeCheck = process.argv.includes('--no-typecheck');
10
13
  const sourceIndex = process.argv.findIndex((a) => a === '--source');
11
14
  const source = sourceIndex > -1 ? process.argv[sourceIndex + 1] : null;
12
15
  const outputIndex = process.argv.findIndex((a) => a === '--output');
@@ -52,11 +55,14 @@ import { parseAstJson } from './parse-node.js';
52
55
  return;
53
56
  }
54
57
  const sourcePath = answers.tsCode ? null : (source ?? answers.path ?? null);
58
+ const typesDir = fileURLToPath(new URL('../types', import.meta.url));
55
59
  run({
56
60
  source: sourcePath,
57
61
  output: output ?? answers.output ?? null,
58
62
  scriptMode,
59
63
  tsCode: answers.tsCode ?? null,
60
- parse: parseAstJson
64
+ parse: parseAstJson,
65
+ typeCheck: noTypeCheck ? null : (fileName) => typeCheckNode(fileName, typesDir),
66
+ vendorDir: fileURLToPath(new URL('../govendor', import.meta.url))
61
67
  });
62
68
  })();