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.
- package/.gitattributes +1 -0
- package/.github/workflows/ci.yml +39 -2
- package/.github/workflows/npm-publish-github-packages.yml +7 -2
- package/CHANGELOG.md +293 -0
- package/CONTRIBUTION.md +8 -6
- package/README.md +15 -11
- package/bin/cli.js +7 -1
- package/bin/go/bridge.js +919 -0
- package/bin/go/convert.js +238 -0
- package/bin/go/metadata.js +211 -0
- package/bin/go/overrides.js +68 -0
- package/bin/go/stdlib.generated.js +175 -0
- package/bin/index.js +337 -239
- package/bin/main.js +9 -2
- package/bin/node/assert.js +344 -0
- package/bin/node/async_hooks.js +273 -0
- package/bin/node/buffer.js +765 -0
- package/bin/node/child_process.js +600 -0
- package/bin/node/cluster.js +1002 -0
- package/bin/node/console.js +121 -0
- package/bin/node/core.js +111 -0
- package/bin/node/crypto.js +414 -0
- package/bin/node/crypto_keys.js +2685 -0
- package/bin/node/dgram.js +388 -0
- package/bin/node/diagnostics_channel.js +534 -0
- package/bin/node/dns.js +635 -0
- package/bin/node/events.js +743 -0
- package/bin/node/fetch.js +737 -0
- package/bin/node/fs.js +998 -0
- package/bin/node/http.js +1500 -0
- package/bin/node/http2.js +688 -0
- package/bin/node/net.js +1143 -0
- package/bin/node/os.js +257 -0
- package/bin/node/path.js +758 -0
- package/bin/node/process.js +316 -0
- package/bin/node/punycode.js +195 -0
- package/bin/node/querystring.js +143 -0
- package/bin/node/readline.js +299 -0
- package/bin/node/registry.js +161 -0
- package/bin/node/sqlite.js +1142 -0
- package/bin/node/stream.js +1221 -0
- package/bin/node/stream_web.js +2259 -0
- package/bin/node/string_decoder.js +101 -0
- package/bin/node/system_extra.js +714 -0
- package/bin/node/test.js +1068 -0
- package/bin/node/timers.js +263 -0
- package/bin/node/tls.js +719 -0
- package/bin/node/url.js +861 -0
- package/bin/node/util.js +1311 -0
- package/bin/node/util_extra.js +599 -0
- package/bin/node/worker_threads.js +745 -0
- package/bin/node/zlib.js +263 -0
- package/bin/parse-native.js +10 -0
- package/bin/parse-node.js +10 -0
- package/bin/transpiler.js +2824 -588
- package/bin/typecheck-node.js +78 -0
- package/bin/version.js +2 -0
- package/conformance.md +708 -241
- package/govendor/github.com/ncruces/go-sqlite3/LICENSE +21 -0
- package/govendor/github.com/ncruces/go-sqlite3/README.md +121 -0
- package/govendor/github.com/ncruces/go-sqlite3/backup.go +132 -0
- package/govendor/github.com/ncruces/go-sqlite3/blob.go +266 -0
- package/govendor/github.com/ncruces/go-sqlite3/config.go +397 -0
- package/govendor/github.com/ncruces/go-sqlite3/conn.go +540 -0
- package/govendor/github.com/ncruces/go-sqlite3/conn_127.go +93 -0
- package/govendor/github.com/ncruces/go-sqlite3/const.go +436 -0
- package/govendor/github.com/ncruces/go-sqlite3/context.go +222 -0
- package/govendor/github.com/ncruces/go-sqlite3/error.go +182 -0
- package/govendor/github.com/ncruces/go-sqlite3/ext.go +153 -0
- package/govendor/github.com/ncruces/go-sqlite3/func.go +309 -0
- package/govendor/github.com/ncruces/go-sqlite3/go.mod +3 -0
- package/govendor/github.com/ncruces/go-sqlite3/internal/dotlk/dotlk.go +29 -0
- package/govendor/github.com/ncruces/go-sqlite3/internal/dotlk/dotlk_other.go +13 -0
- package/govendor/github.com/ncruces/go-sqlite3/internal/dotlk/dotlk_unix.go +57 -0
- package/govendor/github.com/ncruces/go-sqlite3/internal/errutil/error.go +41 -0
- package/govendor/github.com/ncruces/go-sqlite3/internal/sqlite3_wrap/alloc.go +128 -0
- package/govendor/github.com/ncruces/go-sqlite3/internal/sqlite3_wrap/const.go +122 -0
- package/govendor/github.com/ncruces/go-sqlite3/internal/sqlite3_wrap/error.go +77 -0
- package/govendor/github.com/ncruces/go-sqlite3/internal/sqlite3_wrap/mem.go +116 -0
- package/govendor/github.com/ncruces/go-sqlite3/internal/sqlite3_wrap/mem_other.go +34 -0
- package/govendor/github.com/ncruces/go-sqlite3/internal/sqlite3_wrap/mem_unix.go +87 -0
- package/govendor/github.com/ncruces/go-sqlite3/internal/sqlite3_wrap/mem_windows.go +149 -0
- package/govendor/github.com/ncruces/go-sqlite3/internal/sqlite3_wrap/mmap_unix.go +80 -0
- package/govendor/github.com/ncruces/go-sqlite3/internal/sqlite3_wrap/mmap_windows.go +129 -0
- package/govendor/github.com/ncruces/go-sqlite3/internal/sqlite3_wrap/sys_windows.go +60 -0
- package/govendor/github.com/ncruces/go-sqlite3/internal/sqlite3_wrap/wrap.go +82 -0
- package/govendor/github.com/ncruces/go-sqlite3/internal/sqlite3_wrap/wrap_sys.go +113 -0
- package/govendor/github.com/ncruces/go-sqlite3/internal/sqlite3_wrap/wrap_vfs.go +181 -0
- package/govendor/github.com/ncruces/go-sqlite3/internal/testenv/env.go +55 -0
- package/govendor/github.com/ncruces/go-sqlite3/internal/util/json.go +54 -0
- package/govendor/github.com/ncruces/go-sqlite3/internal/util/json_v2.go +54 -0
- package/govendor/github.com/ncruces/go-sqlite3/internal/util/math.go +29 -0
- package/govendor/github.com/ncruces/go-sqlite3/internal/util/page.go +5 -0
- package/govendor/github.com/ncruces/go-sqlite3/internal/util/parse.go +142 -0
- package/govendor/github.com/ncruces/go-sqlite3/internal/util/pointer.go +3 -0
- package/govendor/github.com/ncruces/go-sqlite3/internal/util/reflect.go +10 -0
- package/govendor/github.com/ncruces/go-sqlite3/json.go +100 -0
- package/govendor/github.com/ncruces/go-sqlite3/json_v2.go +116 -0
- package/govendor/github.com/ncruces/go-sqlite3/pointer.go +13 -0
- package/govendor/github.com/ncruces/go-sqlite3/quote.go +140 -0
- package/govendor/github.com/ncruces/go-sqlite3/stmt.go +692 -0
- package/govendor/github.com/ncruces/go-sqlite3/time.go +360 -0
- package/govendor/github.com/ncruces/go-sqlite3/txn.go +374 -0
- package/govendor/github.com/ncruces/go-sqlite3/value.go +212 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/README.md +133 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/api.go +239 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/cksm.go +143 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/const.go +256 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/file.go +260 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/filename.go +187 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/lock.go +128 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/lock_other.go +23 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/map.go +63 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/map_other.go +13 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/os_bsd.go +110 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/os_darwin.go +131 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/os_dotlk.go +140 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/os_f2fs_linux.go +56 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/os_linux.go +117 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/os_ofd.go +59 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/os_std.go +50 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/os_std_alloc.go +19 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/os_std_atomic.go +9 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/os_std_rw.go +13 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/os_std_sync.go +9 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/os_std_temp.go +16 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/os_unix.go +108 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/os_windows.go +180 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/registry.go +48 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/shm.go +26 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/shm_bsd.go +258 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/shm_copy.go +90 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/shm_dotlk.go +168 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/shm_memlk.go +52 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/shm_ofd.go +185 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/shm_other.go +21 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/shm_windows.go +124 -0
- package/govendor/github.com/ncruces/go-sqlite3/vfs/vfs.go +455 -0
- package/govendor/github.com/ncruces/go-sqlite3/vtab.go +677 -0
- package/govendor/github.com/ncruces/go-sqlite3/wrap.go +48 -0
- package/govendor/github.com/ncruces/go-sqlite3-wasm/v6/LICENSE +18 -0
- package/govendor/github.com/ncruces/go-sqlite3-wasm/v6/README.md +11 -0
- package/govendor/github.com/ncruces/go-sqlite3-wasm/v6/go.mod +3 -0
- package/govendor/github.com/ncruces/go-sqlite3-wasm/v6/libc.go +215 -0
- package/govendor/github.com/ncruces/go-sqlite3-wasm/v6/sqlite3.dat +0 -0
- package/govendor/github.com/ncruces/go-sqlite3-wasm/v6/sqlite3.go +157903 -0
- package/govendor/github.com/ncruces/go-sqlite3-wasm/v6/tools.sh +38 -0
- package/govendor/github.com/ncruces/julianday/LICENSE +21 -0
- package/govendor/github.com/ncruces/julianday/README.md +9 -0
- package/govendor/github.com/ncruces/julianday/go.mod +3 -0
- package/govendor/github.com/ncruces/julianday/julianday.go +124 -0
- package/govendor/golang.org/x/sys/LICENSE +27 -0
- package/govendor/golang.org/x/sys/PATENTS +22 -0
- package/govendor/golang.org/x/sys/go.mod +3 -0
- package/govendor/golang.org/x/sys/unix/README.md +184 -0
- package/govendor/golang.org/x/sys/unix/affinity_linux.go +189 -0
- package/govendor/golang.org/x/sys/unix/aliases.go +13 -0
- package/govendor/golang.org/x/sys/unix/asm_aix_ppc64.s +17 -0
- package/govendor/golang.org/x/sys/unix/asm_bsd_386.s +27 -0
- package/govendor/golang.org/x/sys/unix/asm_bsd_amd64.s +27 -0
- package/govendor/golang.org/x/sys/unix/asm_bsd_arm.s +27 -0
- package/govendor/golang.org/x/sys/unix/asm_bsd_arm64.s +27 -0
- package/govendor/golang.org/x/sys/unix/asm_bsd_ppc64.s +29 -0
- package/govendor/golang.org/x/sys/unix/asm_bsd_riscv64.s +27 -0
- package/govendor/golang.org/x/sys/unix/asm_linux_386.s +65 -0
- package/govendor/golang.org/x/sys/unix/asm_linux_amd64.s +57 -0
- package/govendor/golang.org/x/sys/unix/asm_linux_arm.s +56 -0
- package/govendor/golang.org/x/sys/unix/asm_linux_arm64.s +50 -0
- package/govendor/golang.org/x/sys/unix/asm_linux_loong64.s +51 -0
- package/govendor/golang.org/x/sys/unix/asm_linux_mips64x.s +54 -0
- package/govendor/golang.org/x/sys/unix/asm_linux_mipsx.s +52 -0
- package/govendor/golang.org/x/sys/unix/asm_linux_ppc64x.s +42 -0
- package/govendor/golang.org/x/sys/unix/asm_linux_riscv64.s +47 -0
- package/govendor/golang.org/x/sys/unix/asm_linux_s390x.s +54 -0
- package/govendor/golang.org/x/sys/unix/asm_openbsd_mips64.s +29 -0
- package/govendor/golang.org/x/sys/unix/asm_solaris_amd64.s +17 -0
- package/govendor/golang.org/x/sys/unix/asm_zos_s390x.s +382 -0
- package/govendor/golang.org/x/sys/unix/auxv.go +36 -0
- package/govendor/golang.org/x/sys/unix/auxv_unsupported.go +13 -0
- package/govendor/golang.org/x/sys/unix/bluetooth_linux.go +36 -0
- package/govendor/golang.org/x/sys/unix/bpxsvc_zos.go +657 -0
- package/govendor/golang.org/x/sys/unix/bpxsvc_zos.s +192 -0
- package/govendor/golang.org/x/sys/unix/cap_freebsd.go +195 -0
- package/govendor/golang.org/x/sys/unix/constants.go +13 -0
- package/govendor/golang.org/x/sys/unix/dev_aix_ppc.go +26 -0
- package/govendor/golang.org/x/sys/unix/dev_aix_ppc64.go +28 -0
- package/govendor/golang.org/x/sys/unix/dev_darwin.go +24 -0
- package/govendor/golang.org/x/sys/unix/dev_dragonfly.go +30 -0
- package/govendor/golang.org/x/sys/unix/dev_freebsd.go +30 -0
- package/govendor/golang.org/x/sys/unix/dev_linux.go +42 -0
- package/govendor/golang.org/x/sys/unix/dev_netbsd.go +29 -0
- package/govendor/golang.org/x/sys/unix/dev_openbsd.go +29 -0
- package/govendor/golang.org/x/sys/unix/dev_zos.go +28 -0
- package/govendor/golang.org/x/sys/unix/dirent.go +102 -0
- package/govendor/golang.org/x/sys/unix/endian_big.go +9 -0
- package/govendor/golang.org/x/sys/unix/endian_little.go +9 -0
- package/govendor/golang.org/x/sys/unix/env_unix.go +31 -0
- package/govendor/golang.org/x/sys/unix/fcntl.go +36 -0
- package/govendor/golang.org/x/sys/unix/fcntl_darwin.go +24 -0
- package/govendor/golang.org/x/sys/unix/fcntl_linux_32bit.go +13 -0
- package/govendor/golang.org/x/sys/unix/fdset.go +27 -0
- package/govendor/golang.org/x/sys/unix/gccgo.go +59 -0
- package/govendor/golang.org/x/sys/unix/gccgo_c.c +44 -0
- package/govendor/golang.org/x/sys/unix/gccgo_linux_amd64.go +20 -0
- package/govendor/golang.org/x/sys/unix/ifreq_linux.go +145 -0
- package/govendor/golang.org/x/sys/unix/ioctl_linux.go +341 -0
- package/govendor/golang.org/x/sys/unix/ioctl_signed.go +74 -0
- package/govendor/golang.org/x/sys/unix/ioctl_unsigned.go +74 -0
- package/govendor/golang.org/x/sys/unix/ioctl_zos.go +71 -0
- package/govendor/golang.org/x/sys/unix/mkall.sh +250 -0
- package/govendor/golang.org/x/sys/unix/mkerrors.sh +807 -0
- package/govendor/golang.org/x/sys/unix/mmap_nomremap.go +13 -0
- package/govendor/golang.org/x/sys/unix/mremap.go +57 -0
- package/govendor/golang.org/x/sys/unix/pagesize_unix.go +15 -0
- package/govendor/golang.org/x/sys/unix/pledge_openbsd.go +111 -0
- package/govendor/golang.org/x/sys/unix/ptrace_darwin.go +11 -0
- package/govendor/golang.org/x/sys/unix/ptrace_ios.go +11 -0
- package/govendor/golang.org/x/sys/unix/race.go +30 -0
- package/govendor/golang.org/x/sys/unix/race0.go +25 -0
- package/govendor/golang.org/x/sys/unix/readdirent_getdents.go +12 -0
- package/govendor/golang.org/x/sys/unix/readdirent_getdirentries.go +19 -0
- package/govendor/golang.org/x/sys/unix/readv_unix.go +103 -0
- package/govendor/golang.org/x/sys/unix/sockcmsg_dragonfly.go +16 -0
- package/govendor/golang.org/x/sys/unix/sockcmsg_linux.go +85 -0
- package/govendor/golang.org/x/sys/unix/sockcmsg_unix.go +106 -0
- package/govendor/golang.org/x/sys/unix/sockcmsg_unix_other.go +46 -0
- package/govendor/golang.org/x/sys/unix/sockcmsg_zos.go +58 -0
- package/govendor/golang.org/x/sys/unix/symaddr_zos_s390x.s +75 -0
- package/govendor/golang.org/x/sys/unix/syscall.go +86 -0
- package/govendor/golang.org/x/sys/unix/syscall_aix.go +582 -0
- package/govendor/golang.org/x/sys/unix/syscall_aix_ppc.go +52 -0
- package/govendor/golang.org/x/sys/unix/syscall_aix_ppc64.go +83 -0
- package/govendor/golang.org/x/sys/unix/syscall_bsd.go +609 -0
- package/govendor/golang.org/x/sys/unix/syscall_darwin.go +711 -0
- package/govendor/golang.org/x/sys/unix/syscall_darwin_amd64.go +50 -0
- package/govendor/golang.org/x/sys/unix/syscall_darwin_arm64.go +50 -0
- package/govendor/golang.org/x/sys/unix/syscall_darwin_libSystem.go +26 -0
- package/govendor/golang.org/x/sys/unix/syscall_dragonfly.go +359 -0
- package/govendor/golang.org/x/sys/unix/syscall_dragonfly_amd64.go +56 -0
- package/govendor/golang.org/x/sys/unix/syscall_freebsd.go +455 -0
- package/govendor/golang.org/x/sys/unix/syscall_freebsd_386.go +64 -0
- package/govendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go +64 -0
- package/govendor/golang.org/x/sys/unix/syscall_freebsd_arm.go +60 -0
- package/govendor/golang.org/x/sys/unix/syscall_freebsd_arm64.go +60 -0
- package/govendor/golang.org/x/sys/unix/syscall_freebsd_riscv64.go +60 -0
- package/govendor/golang.org/x/sys/unix/syscall_hurd.go +30 -0
- package/govendor/golang.org/x/sys/unix/syscall_hurd_386.go +28 -0
- package/govendor/golang.org/x/sys/unix/syscall_illumos.go +78 -0
- package/govendor/golang.org/x/sys/unix/syscall_linux.go +2574 -0
- package/govendor/golang.org/x/sys/unix/syscall_linux_386.go +313 -0
- package/govendor/golang.org/x/sys/unix/syscall_linux_alarm.go +12 -0
- package/govendor/golang.org/x/sys/unix/syscall_linux_amd64.go +144 -0
- package/govendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go +12 -0
- package/govendor/golang.org/x/sys/unix/syscall_linux_arm.go +218 -0
- package/govendor/golang.org/x/sys/unix/syscall_linux_arm64.go +188 -0
- package/govendor/golang.org/x/sys/unix/syscall_linux_gc.go +14 -0
- package/govendor/golang.org/x/sys/unix/syscall_linux_gc_386.go +16 -0
- package/govendor/golang.org/x/sys/unix/syscall_linux_gc_arm.go +13 -0
- package/govendor/golang.org/x/sys/unix/syscall_linux_gccgo_386.go +30 -0
- package/govendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go +20 -0
- package/govendor/golang.org/x/sys/unix/syscall_linux_loong64.go +220 -0
- package/govendor/golang.org/x/sys/unix/syscall_linux_mips64x.go +187 -0
- package/govendor/golang.org/x/sys/unix/syscall_linux_mipsx.go +173 -0
- package/govendor/golang.org/x/sys/unix/syscall_linux_ppc.go +203 -0
- package/govendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go +114 -0
- package/govendor/golang.org/x/sys/unix/syscall_linux_riscv64.go +193 -0
- package/govendor/golang.org/x/sys/unix/syscall_linux_s390x.go +295 -0
- package/govendor/golang.org/x/sys/unix/syscall_linux_sparc64.go +111 -0
- package/govendor/golang.org/x/sys/unix/syscall_netbsd.go +388 -0
- package/govendor/golang.org/x/sys/unix/syscall_netbsd_386.go +37 -0
- package/govendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go +37 -0
- package/govendor/golang.org/x/sys/unix/syscall_netbsd_arm.go +37 -0
- package/govendor/golang.org/x/sys/unix/syscall_netbsd_arm64.go +37 -0
- package/govendor/golang.org/x/sys/unix/syscall_openbsd.go +346 -0
- package/govendor/golang.org/x/sys/unix/syscall_openbsd_386.go +41 -0
- package/govendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go +41 -0
- package/govendor/golang.org/x/sys/unix/syscall_openbsd_arm.go +41 -0
- package/govendor/golang.org/x/sys/unix/syscall_openbsd_arm64.go +41 -0
- package/govendor/golang.org/x/sys/unix/syscall_openbsd_libc.go +26 -0
- package/govendor/golang.org/x/sys/unix/syscall_openbsd_mips64.go +39 -0
- package/govendor/golang.org/x/sys/unix/syscall_openbsd_ppc64.go +41 -0
- package/govendor/golang.org/x/sys/unix/syscall_openbsd_riscv64.go +41 -0
- package/govendor/golang.org/x/sys/unix/syscall_solaris.go +1183 -0
- package/govendor/golang.org/x/sys/unix/syscall_solaris_amd64.go +27 -0
- package/govendor/golang.org/x/sys/unix/syscall_unix.go +619 -0
- package/govendor/golang.org/x/sys/unix/syscall_unix_gc.go +14 -0
- package/govendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go +22 -0
- package/govendor/golang.org/x/sys/unix/syscall_zos_s390x.go +3213 -0
- package/govendor/golang.org/x/sys/unix/sysvshm_linux.go +20 -0
- package/govendor/golang.org/x/sys/unix/sysvshm_unix.go +51 -0
- package/govendor/golang.org/x/sys/unix/sysvshm_unix_other.go +13 -0
- package/govendor/golang.org/x/sys/unix/timestruct.go +76 -0
- package/govendor/golang.org/x/sys/unix/unveil_openbsd.go +51 -0
- package/govendor/golang.org/x/sys/unix/vgetrandom_linux.go +13 -0
- package/govendor/golang.org/x/sys/unix/vgetrandom_unsupported.go +11 -0
- package/govendor/golang.org/x/sys/unix/xattr_bsd.go +280 -0
- package/govendor/golang.org/x/sys/unix/zerrors_aix_ppc.go +1384 -0
- package/govendor/golang.org/x/sys/unix/zerrors_aix_ppc64.go +1385 -0
- package/govendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go +1922 -0
- package/govendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go +1922 -0
- package/govendor/golang.org/x/sys/unix/zerrors_dragonfly_amd64.go +1737 -0
- package/govendor/golang.org/x/sys/unix/zerrors_freebsd_386.go +2042 -0
- package/govendor/golang.org/x/sys/unix/zerrors_freebsd_amd64.go +2039 -0
- package/govendor/golang.org/x/sys/unix/zerrors_freebsd_arm.go +2033 -0
- package/govendor/golang.org/x/sys/unix/zerrors_freebsd_arm64.go +2033 -0
- package/govendor/golang.org/x/sys/unix/zerrors_freebsd_riscv64.go +2147 -0
- package/govendor/golang.org/x/sys/unix/zerrors_linux.go +4209 -0
- package/govendor/golang.org/x/sys/unix/zerrors_linux_386.go +882 -0
- package/govendor/golang.org/x/sys/unix/zerrors_linux_amd64.go +882 -0
- package/govendor/golang.org/x/sys/unix/zerrors_linux_arm.go +887 -0
- package/govendor/golang.org/x/sys/unix/zerrors_linux_arm64.go +884 -0
- package/govendor/golang.org/x/sys/unix/zerrors_linux_loong64.go +874 -0
- package/govendor/golang.org/x/sys/unix/zerrors_linux_mips.go +888 -0
- package/govendor/golang.org/x/sys/unix/zerrors_linux_mips64.go +888 -0
- package/govendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go +888 -0
- package/govendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go +888 -0
- package/govendor/golang.org/x/sys/unix/zerrors_linux_ppc.go +940 -0
- package/govendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go +944 -0
- package/govendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go +944 -0
- package/govendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go +884 -0
- package/govendor/golang.org/x/sys/unix/zerrors_linux_s390x.go +943 -0
- package/govendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go +992 -0
- package/govendor/golang.org/x/sys/unix/zerrors_netbsd_386.go +1779 -0
- package/govendor/golang.org/x/sys/unix/zerrors_netbsd_amd64.go +1769 -0
- package/govendor/golang.org/x/sys/unix/zerrors_netbsd_arm.go +1758 -0
- package/govendor/golang.org/x/sys/unix/zerrors_netbsd_arm64.go +1769 -0
- package/govendor/golang.org/x/sys/unix/zerrors_openbsd_386.go +1905 -0
- package/govendor/golang.org/x/sys/unix/zerrors_openbsd_amd64.go +1905 -0
- package/govendor/golang.org/x/sys/unix/zerrors_openbsd_arm.go +1905 -0
- package/govendor/golang.org/x/sys/unix/zerrors_openbsd_arm64.go +1905 -0
- package/govendor/golang.org/x/sys/unix/zerrors_openbsd_mips64.go +1905 -0
- package/govendor/golang.org/x/sys/unix/zerrors_openbsd_ppc64.go +1904 -0
- package/govendor/golang.org/x/sys/unix/zerrors_openbsd_riscv64.go +1903 -0
- package/govendor/golang.org/x/sys/unix/zerrors_solaris_amd64.go +1556 -0
- package/govendor/golang.org/x/sys/unix/zerrors_zos_s390x.go +990 -0
- package/govendor/golang.org/x/sys/unix/zptrace_armnn_linux.go +40 -0
- package/govendor/golang.org/x/sys/unix/zptrace_linux_arm64.go +17 -0
- package/govendor/golang.org/x/sys/unix/zptrace_mipsnn_linux.go +49 -0
- package/govendor/golang.org/x/sys/unix/zptrace_mipsnnle_linux.go +49 -0
- package/govendor/golang.org/x/sys/unix/zptrace_x86_linux.go +79 -0
- package/govendor/golang.org/x/sys/unix/zsymaddr_zos_s390x.s +364 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_aix_ppc.go +1461 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_aix_ppc64.go +1420 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gc.go +1188 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gccgo.go +1069 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go +2728 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s +799 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go +2728 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s +799 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_dragonfly_amd64.go +1666 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_freebsd_386.go +1886 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go +1886 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_freebsd_arm.go +1886 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_freebsd_arm64.go +1886 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_freebsd_riscv64.go +1886 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_illumos_amd64.go +101 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_linux.go +2267 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_linux_386.go +469 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go +636 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_linux_arm.go +584 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go +535 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_linux_loong64.go +469 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_linux_mips.go +636 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go +630 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go +619 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go +636 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_linux_ppc.go +641 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go +687 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go +687 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_linux_riscv64.go +531 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go +478 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go +631 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go +1848 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go +1848 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go +1848 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_netbsd_arm64.go +1848 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go +2407 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s +719 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go +2407 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s +719 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go +2407 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s +719 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go +2407 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s +719 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go +2407 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s +719 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go +2407 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s +862 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go +2407 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s +719 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go +2217 -0
- package/govendor/golang.org/x/sys/unix/zsyscall_zos_s390x.go +3458 -0
- package/govendor/golang.org/x/sys/unix/zsysctl_openbsd_386.go +280 -0
- package/govendor/golang.org/x/sys/unix/zsysctl_openbsd_amd64.go +280 -0
- package/govendor/golang.org/x/sys/unix/zsysctl_openbsd_arm.go +280 -0
- package/govendor/golang.org/x/sys/unix/zsysctl_openbsd_arm64.go +280 -0
- package/govendor/golang.org/x/sys/unix/zsysctl_openbsd_mips64.go +280 -0
- package/govendor/golang.org/x/sys/unix/zsysctl_openbsd_ppc64.go +280 -0
- package/govendor/golang.org/x/sys/unix/zsysctl_openbsd_riscv64.go +281 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_darwin_amd64.go +439 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_darwin_arm64.go +437 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_dragonfly_amd64.go +316 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_freebsd_386.go +393 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_freebsd_amd64.go +393 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_freebsd_arm.go +393 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_freebsd_arm64.go +393 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_freebsd_riscv64.go +393 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_linux_386.go +470 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go +394 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_linux_arm.go +434 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go +337 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go +334 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_linux_mips.go +454 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go +384 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go +384 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go +454 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go +461 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go +433 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go +433 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go +338 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go +399 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go +413 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_netbsd_386.go +274 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_netbsd_amd64.go +274 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_netbsd_arm.go +274 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_netbsd_arm64.go +274 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_openbsd_386.go +219 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_openbsd_amd64.go +219 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_openbsd_arm.go +219 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_openbsd_arm64.go +218 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_openbsd_mips64.go +221 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_openbsd_ppc64.go +217 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_openbsd_riscv64.go +218 -0
- package/govendor/golang.org/x/sys/unix/zsysnum_zos_s390x.go +2852 -0
- package/govendor/golang.org/x/sys/unix/ztypes_aix_ppc.go +353 -0
- package/govendor/golang.org/x/sys/unix/ztypes_aix_ppc64.go +357 -0
- package/govendor/golang.org/x/sys/unix/ztypes_darwin_amd64.go +878 -0
- package/govendor/golang.org/x/sys/unix/ztypes_darwin_arm64.go +878 -0
- package/govendor/golang.org/x/sys/unix/ztypes_dragonfly_amd64.go +473 -0
- package/govendor/golang.org/x/sys/unix/ztypes_freebsd_386.go +651 -0
- package/govendor/golang.org/x/sys/unix/ztypes_freebsd_amd64.go +656 -0
- package/govendor/golang.org/x/sys/unix/ztypes_freebsd_arm.go +642 -0
- package/govendor/golang.org/x/sys/unix/ztypes_freebsd_arm64.go +636 -0
- package/govendor/golang.org/x/sys/unix/ztypes_freebsd_riscv64.go +638 -0
- package/govendor/golang.org/x/sys/unix/ztypes_linux.go +6547 -0
- package/govendor/golang.org/x/sys/unix/ztypes_linux_386.go +747 -0
- package/govendor/golang.org/x/sys/unix/ztypes_linux_amd64.go +761 -0
- package/govendor/golang.org/x/sys/unix/ztypes_linux_arm.go +741 -0
- package/govendor/golang.org/x/sys/unix/ztypes_linux_arm64.go +740 -0
- package/govendor/golang.org/x/sys/unix/ztypes_linux_loong64.go +741 -0
- package/govendor/golang.org/x/sys/unix/ztypes_linux_mips.go +746 -0
- package/govendor/golang.org/x/sys/unix/ztypes_linux_mips64.go +743 -0
- package/govendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go +743 -0
- package/govendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go +746 -0
- package/govendor/golang.org/x/sys/unix/ztypes_linux_ppc.go +754 -0
- package/govendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go +749 -0
- package/govendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go +749 -0
- package/govendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go +828 -0
- package/govendor/golang.org/x/sys/unix/ztypes_linux_s390x.go +763 -0
- package/govendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go +744 -0
- package/govendor/golang.org/x/sys/unix/ztypes_netbsd_386.go +585 -0
- package/govendor/golang.org/x/sys/unix/ztypes_netbsd_amd64.go +593 -0
- package/govendor/golang.org/x/sys/unix/ztypes_netbsd_arm.go +590 -0
- package/govendor/golang.org/x/sys/unix/ztypes_netbsd_arm64.go +593 -0
- package/govendor/golang.org/x/sys/unix/ztypes_openbsd_386.go +568 -0
- package/govendor/golang.org/x/sys/unix/ztypes_openbsd_amd64.go +568 -0
- package/govendor/golang.org/x/sys/unix/ztypes_openbsd_arm.go +575 -0
- package/govendor/golang.org/x/sys/unix/ztypes_openbsd_arm64.go +568 -0
- package/govendor/golang.org/x/sys/unix/ztypes_openbsd_mips64.go +568 -0
- package/govendor/golang.org/x/sys/unix/ztypes_openbsd_ppc64.go +570 -0
- package/govendor/golang.org/x/sys/unix/ztypes_openbsd_riscv64.go +570 -0
- package/govendor/golang.org/x/sys/unix/ztypes_solaris_amd64.go +516 -0
- package/govendor/golang.org/x/sys/unix/ztypes_zos_s390x.go +552 -0
- package/govendor/golang.org/x/sys/windows/aliases.go +13 -0
- package/govendor/golang.org/x/sys/windows/dll_windows.go +380 -0
- package/govendor/golang.org/x/sys/windows/env_windows.go +57 -0
- package/govendor/golang.org/x/sys/windows/eventlog.go +20 -0
- package/govendor/golang.org/x/sys/windows/exec_windows.go +248 -0
- package/govendor/golang.org/x/sys/windows/memory_windows.go +48 -0
- package/govendor/golang.org/x/sys/windows/mkerrors.bash +70 -0
- package/govendor/golang.org/x/sys/windows/mkknownfolderids.bash +27 -0
- package/govendor/golang.org/x/sys/windows/mksyscall.go +9 -0
- package/govendor/golang.org/x/sys/windows/race.go +30 -0
- package/govendor/golang.org/x/sys/windows/race0.go +25 -0
- package/govendor/golang.org/x/sys/windows/security_windows.go +1537 -0
- package/govendor/golang.org/x/sys/windows/service.go +257 -0
- package/govendor/golang.org/x/sys/windows/setupapi_windows.go +1425 -0
- package/govendor/golang.org/x/sys/windows/str.go +22 -0
- package/govendor/golang.org/x/sys/windows/syscall.go +104 -0
- package/govendor/golang.org/x/sys/windows/syscall_windows.go +1952 -0
- package/govendor/golang.org/x/sys/windows/types_windows.go +4058 -0
- package/govendor/golang.org/x/sys/windows/types_windows_386.go +35 -0
- package/govendor/golang.org/x/sys/windows/types_windows_amd64.go +34 -0
- package/govendor/golang.org/x/sys/windows/types_windows_arm.go +35 -0
- package/govendor/golang.org/x/sys/windows/types_windows_arm64.go +34 -0
- package/govendor/golang.org/x/sys/windows/zerrors_windows.go +9468 -0
- package/govendor/golang.org/x/sys/windows/zknownfolderids_windows.go +149 -0
- package/govendor/golang.org/x/sys/windows/zsyscall_windows.go +4828 -0
- package/govendor/manifest.txt +7 -0
- package/package.json +7 -1
- package/tsparser/check.go +157 -0
- package/tsparser/main.go +30 -1
- package/types/typenative-go.d.ts +15159 -5
- package/types/typenative-npm.d.ts +2640 -34
- package/types/typenative.d.ts +651 -8
package/.gitattributes
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
govendor/** linguist-vendored
|
package/.github/workflows/ci.yml
CHANGED
|
@@ -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.
|
|
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
|
|
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.
|
|
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
|
|
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
|
-
-
|
|
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/
|
|
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
|
-
|
|
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
|
|
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
|
|
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: `
|
|
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`)
|
|
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
|
-
- **
|
|
242
|
-
- **
|
|
243
|
-
- **
|
|
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
|
|
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
|
|
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
|
})();
|