typenative 0.1.0 → 0.1.1
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/.github/workflows/ci.yml +29 -0
- package/.github/workflows/npm-publish-github-packages.yml +2 -2
- package/CHANGELOG.md +43 -0
- package/CONTRIBUTION.md +130 -0
- package/README.md +251 -213
- package/bin/index.js +1 -1
- package/bin/transpiler.js +2437 -121
- package/conformance.md +651 -0
- package/package.json +9 -61
- package/TODO.md +0 -38
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "typenative",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Build native applications using Typescript.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -11,61 +11,10 @@
|
|
|
11
11
|
"build": "tsc",
|
|
12
12
|
"watch": "tsc --watch",
|
|
13
13
|
"build:native": "node scripts/build-native.mjs",
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"test2": "node ./bin/cli.js --source test/test2.spec.ts --script",
|
|
19
|
-
"test3": "node ./bin/cli.js --source test/test3.spec.ts --script",
|
|
20
|
-
"test3_node": "tsc test/test3.spec.ts && node test/test3.spec.js && rimraf test/test3.spec.js",
|
|
21
|
-
"test4": "node ./bin/cli.js --source test/test4.spec.ts --script",
|
|
22
|
-
"test5": "node ./bin/cli.js --source test/test5.spec.ts --script",
|
|
23
|
-
"test6": "node ./bin/cli.js --source test/test6.spec.ts --script",
|
|
24
|
-
"test7": "node ./bin/cli.js --source test/test7.spec.ts --script",
|
|
25
|
-
"test8": "node ./bin/cli.js --source test/test8.spec.ts --script",
|
|
26
|
-
"test9": "node ./bin/cli.js --source test/test9.spec.ts --script",
|
|
27
|
-
"test10": "node ./bin/cli.js --source test/test10.spec.ts --script",
|
|
28
|
-
"test11": "node ./bin/cli.js --source test/test11.spec.ts --script",
|
|
29
|
-
"test12": "node ./bin/cli.js --source test/test12.spec.ts --script",
|
|
30
|
-
"test13": "node ./bin/cli.js --source test/test13.spec.ts --script",
|
|
31
|
-
"test14": "node ./bin/cli.js --source test/test14.spec.ts --script",
|
|
32
|
-
"test15": "node ./bin/cli.js --source test/test15.spec.ts --script",
|
|
33
|
-
"test16": "node ./bin/cli.js --source test/test16.spec.ts --script",
|
|
34
|
-
"test17": "node ./bin/cli.js --source test/test17.spec.ts --script",
|
|
35
|
-
"test18": "node ./bin/cli.js --source test/test18.spec.ts --script",
|
|
36
|
-
"test19": "node ./bin/cli.js --source test/test19.spec.ts --script",
|
|
37
|
-
"test20": "node ./bin/cli.js --source test/test20.spec.ts --script",
|
|
38
|
-
"test21": "node ./bin/cli.js --source test/test21.spec.ts --script",
|
|
39
|
-
"test22": "node ./bin/cli.js --source test/test22.spec.ts --script",
|
|
40
|
-
"test23": "node ./bin/cli.js --source test/test23.spec.ts --script",
|
|
41
|
-
"test24": "node ./bin/cli.js --source test/test24.spec.ts --script",
|
|
42
|
-
"test25": "node ./bin/cli.js --source test/test25.spec.ts --script",
|
|
43
|
-
"test25_export": "node ./bin/cli.js --source test/test25-export.spec.ts --script",
|
|
44
|
-
"test26": "node ./bin/cli.js --source test/test26.spec.ts --script",
|
|
45
|
-
"test27": "node ./bin/cli.js --source test/test27.spec.ts --script",
|
|
46
|
-
"test28": "node ./bin/cli.js --source test/test28.spec.ts --script",
|
|
47
|
-
"test29": "node ./bin/cli.js --source test/test29.spec.ts --script",
|
|
48
|
-
"test30": "node ./bin/cli.js --source test/test30.spec.ts --script",
|
|
49
|
-
"test31": "node ./bin/cli.js --source test/test31.spec.ts --script",
|
|
50
|
-
"test32": "node ./bin/cli.js --source test/test32.spec.ts --script",
|
|
51
|
-
"test33": "node ./bin/cli.js --source test/test33.spec.ts --script",
|
|
52
|
-
"test34": "node ./bin/cli.js --source test/test34.spec.ts --script",
|
|
53
|
-
"test35": "node ./bin/cli.js --source test/test35.spec.ts --script",
|
|
54
|
-
"test36": "node ./bin/cli.js --source test/test36.spec.ts --script",
|
|
55
|
-
"test37": "node ./bin/cli.js --source test/test37.spec.ts --script",
|
|
56
|
-
"test38": "node ./bin/cli.js --source test/test38.spec.ts --script",
|
|
57
|
-
"test39": "node ./bin/cli.js --source test/test39.spec.ts --script",
|
|
58
|
-
"test40": "node ./bin/cli.js --source test/test40.spec.ts --script",
|
|
59
|
-
"test41": "node ./bin/cli.js --source test/test41.spec.ts --script",
|
|
60
|
-
"test42": "node ./bin/cli.js --source test/test42.spec.ts --script",
|
|
61
|
-
"test43": "node ./bin/cli.js --source test/test43.spec.ts --script",
|
|
62
|
-
"test44": "node ./bin/cli.js --source test/test44.spec.ts --script",
|
|
63
|
-
"test45": "node ./bin/cli.js --source test/test45.spec.ts --script",
|
|
64
|
-
"test46": "node ./bin/cli.js --source test/test46.spec.ts --script",
|
|
65
|
-
"test47": "node ./bin/cli.js --source test/test47.spec.ts --script",
|
|
66
|
-
"test48": "node ./bin/cli.js --source test/test48.spec.ts --script",
|
|
67
|
-
"test49": "node ./bin/cli.js --source test/test49.spec.ts --script",
|
|
68
|
-
"test50": "node ./bin/cli.js --source test/test50.spec.ts --script"
|
|
14
|
+
"conformance": "node scripts/conformance.mjs",
|
|
15
|
+
"conformance:parallel": "node scripts/conformance-parallel.mjs",
|
|
16
|
+
"test": "npm run conformance",
|
|
17
|
+
"release": "npm publish"
|
|
69
18
|
},
|
|
70
19
|
"repository": {
|
|
71
20
|
"type": "git",
|
|
@@ -78,13 +27,12 @@
|
|
|
78
27
|
},
|
|
79
28
|
"homepage": "https://github.com/danisss9/typenative#readme",
|
|
80
29
|
"devDependencies": {
|
|
81
|
-
"@types/inquirer": "^9.0.
|
|
82
|
-
"@types/node": "^
|
|
83
|
-
"execa": "^9.6.1",
|
|
30
|
+
"@types/inquirer": "^9.0.10",
|
|
31
|
+
"@types/node": "^24.19.2",
|
|
84
32
|
"rimraf": "^6.1.3"
|
|
85
33
|
},
|
|
86
34
|
"dependencies": {
|
|
87
|
-
"inquirer": "^
|
|
88
|
-
"typescript": "^
|
|
35
|
+
"inquirer": "^14.2.3",
|
|
36
|
+
"typescript": "^6.0.3"
|
|
89
37
|
}
|
|
90
38
|
}
|
package/TODO.md
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
# Self-Hosting Roadmap
|
|
2
|
-
|
|
3
|
-
Goal: TypeNative transpiles itself into a native Go binary (1.0 milestone).
|
|
4
|
-
|
|
5
|
-
## Done
|
|
6
|
-
- [x] node:fs mappings (read/write/append/exists/mkdir/readdir/copy/rm) via Go helpers
|
|
7
|
-
- [x] node:url (fileURLToPath/pathToFileURL), node:os (platform/homedir/tmpdir)
|
|
8
|
-
- [x] node:child_process (spawnSync-shaped sync API, stdio-inherit runs)
|
|
9
|
-
- [x] node:readline sync `question` (stdin prompts in native binaries)
|
|
10
|
-
- [x] Go helper-function registry emitted into the main output file
|
|
11
|
-
- [x] Per-file import scoping (imports registered after function-body visits)
|
|
12
|
-
- [x] Unbraced if/else-if/else statements, `%`/`%=` → math.Mod
|
|
13
|
-
- [x] nanoid/fs-extra/execa removed from src; inquirer isolated in Node-only cli.ts
|
|
14
|
-
- [x] Transpilable core: src/index.ts (run/createProject), src/prompt.ts, src/main.ts (self-host entry)
|
|
15
|
-
|
|
16
|
-
## Done (phase 3a/3b)
|
|
17
|
-
- [x] tsparser/ Go tool: parses TS via buke/typescript-go-internal (no JS runtime),
|
|
18
|
-
emits normalized JSON AST (kind + TS-spec field names)
|
|
19
|
-
- [x] src/parse-node.ts: Node adapter (typescript npm pkg → same JSON shape)
|
|
20
|
-
- [x] Verified byte-identical AST signatures across all 32 test specs AND all
|
|
21
|
-
compiler sources (incl. transpiler.ts, 521k-char signature)
|
|
22
|
-
|
|
23
|
-
- [x] ts shim converted to plain isX() functions + string kind literals
|
|
24
|
-
(object-literal shim was itself untranspilable)
|
|
25
|
-
- [x] Phase 3c: transpiler.ts no longer imports `typescript` — consumes the JSON AST
|
|
26
|
-
via an injected parse function (ts shim keeps predicate call sites); operator
|
|
27
|
-
tokens, process.env, stdin-exec mappings added; verified identical Go output
|
|
28
|
-
via npm parser and Go-parser paths on all 33 test specs
|
|
29
|
-
- [x] Phase 4: src/main.ts (incl. transpiler.ts) compiles to a native binary;
|
|
30
|
-
`any` values use a small Go runtime (TnGet/TnSet/TnAs/...) instead of guessed types
|
|
31
|
-
- [x] Phase 5: stage-1/stage-2 bootstrap — the native compiler passes all test specs
|
|
32
|
-
and reproduces its own Go source identically (fixpoint)
|
|
33
|
-
|
|
34
|
-
## Next
|
|
35
|
-
- [ ] CI self-hosting job (stage 1 → stage 2 → compare); README/CHANGELOG updates
|
|
36
|
-
- [ ] Stateful RegExp /g (`lastIndex`, `while ((m = re.exec(s)))` loops)
|
|
37
|
-
- [ ] import.meta.url lowering
|
|
38
|
-
- [ ] Gradually type the AST in transpiler.ts (fewer dynamic lookups, faster binary)
|