gofront 0.0.9 → 1.0.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/README.md +6 -6
- package/package.json +7 -4
- package/src/codegen/expressions.js +520 -1717
- package/src/codegen/index.js +576 -0
- package/src/codegen/runtime.js +151 -0
- package/src/codegen/statements.js +305 -296
- package/src/codegen/stdlib/builder.js +36 -0
- package/src/codegen/stdlib/bytes.js +62 -0
- package/src/codegen/stdlib/errors.js +17 -0
- package/src/codegen/stdlib/fmt.js +101 -0
- package/src/codegen/stdlib/gom.js +152 -0
- package/src/codegen/stdlib/html.js +17 -0
- package/src/codegen/stdlib/index.js +95 -0
- package/src/codegen/stdlib/io.js +33 -0
- package/src/codegen/stdlib/maps.js +42 -0
- package/src/codegen/stdlib/math.js +53 -0
- package/src/codegen/stdlib/os.js +10 -0
- package/src/codegen/stdlib/path.js +31 -0
- package/src/codegen/stdlib/rand.js +24 -0
- package/src/codegen/stdlib/regexp.js +51 -0
- package/src/codegen/stdlib/slices.js +48 -0
- package/src/codegen/stdlib/sort.js +28 -0
- package/src/codegen/stdlib/strconv.js +30 -0
- package/src/codegen/stdlib/strings.js +83 -0
- package/src/codegen/stdlib/time.js +54 -0
- package/src/codegen/stdlib/unicode.js +22 -0
- package/src/codegen/stdlib/utf8.js +23 -0
- package/src/codegen/templ.js +281 -0
- package/src/compiler.js +80 -74
- package/src/dts-parser.js +355 -371
- package/src/index.js +13 -49
- package/src/lexer.js +186 -272
- package/src/minifier.js +305 -318
- package/src/parser/expressions.js +51 -34
- package/src/{parser.js → parser/index.js} +4 -4
- package/src/parser/statements.js +24 -34
- package/src/parser/types.js +31 -29
- package/src/templ-parser.js +2 -2
- package/src/tokens.js +109 -0
- package/src/typechecker/assignability.js +258 -0
- package/src/typechecker/expressions.js +559 -549
- package/src/typechecker/index.js +555 -0
- package/src/typechecker/resolve.js +421 -0
- package/src/typechecker/statements.js +267 -280
- package/src/typechecker/stdlib/core.js +592 -0
- package/src/typechecker/stdlib/extended.js +332 -0
- package/src/typechecker/stdlib.js +9 -1060
- package/src/typechecker/termination.js +83 -0
- package/src/codegen.js +0 -882
- package/src/typechecker.js +0 -1299
package/README.md
CHANGED
|
@@ -108,9 +108,9 @@ operation on it is silently permitted, preventing cascading errors.
|
|
|
108
108
|
Walks the typed AST and emits clean, readable JavaScript. No intermediate representation
|
|
109
109
|
— the codegen writes directly to an output buffer with indentation tracking.
|
|
110
110
|
|
|
111
|
-
Runtime helpers (`__len`, `__append`, `__s`, `__sprintf`, `
|
|
112
|
-
`__errorIs`, `__timeFmt`, `__timeParse`, `__pathClean`) are tree-shaken: only
|
|
113
|
-
when actually used. Optional inline source maps are supported via VLQ-encoded mappings.
|
|
111
|
+
Runtime helpers (`__len`, `__append`, `__s`, `__sprintf`, `__equal`, `__cmul`, `__cdiv`,
|
|
112
|
+
`__error`, `__errorIs`, `__timeFmt`, `__timeParse`, `__pathClean`) are tree-shaken: only
|
|
113
|
+
emitted when actually used. Optional inline source maps are supported via VLQ-encoded mappings.
|
|
114
114
|
|
|
115
115
|
---
|
|
116
116
|
|
|
@@ -634,12 +634,12 @@ Design documents for planned features are organised by release under `docs/v*/`
|
|
|
634
634
|
## Tests
|
|
635
635
|
|
|
636
636
|
```sh
|
|
637
|
-
npm run test:unit # unit tests only (~
|
|
637
|
+
npm run test:unit # unit tests only (~1118 tests, no browser required)
|
|
638
638
|
npm run test:e2e # E2E tests (Playwright, headless Chromium)
|
|
639
|
-
npm test
|
|
639
|
+
npm run test:all # both
|
|
640
640
|
```
|
|
641
641
|
|
|
642
|
-
**Unit tests** (~
|
|
642
|
+
**Unit tests** (~1118) cover language features, type errors, edge cases, DOM (jsdom),
|
|
643
643
|
external `.d.ts`, npm resolver, multi-file compilation, embedded structs, string
|
|
644
644
|
formatting, map iteration order, integer overflow semantics, unused variable detection,
|
|
645
645
|
unused import detection, semantic difference verification, stdlib shim packages, generics,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gofront",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"author": "Luuk van Venrooij",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -35,16 +35,19 @@
|
|
|
35
35
|
"build:reactive": "node src/index.js example/reactive/src -o example/reactive/app.js",
|
|
36
36
|
"build:gom": "node src/index.js example/gom/src -o example/gom/app.js",
|
|
37
37
|
"build:templ": "node src/index.js example/templ/src -o example/templ/app.js",
|
|
38
|
-
"
|
|
38
|
+
"build:all": "npm run build:simple && npm run build:reactive && npm run build:gom && npm run build:templ",
|
|
39
|
+
"test:all": "npm run test:unit && npm run test:e2e",
|
|
39
40
|
"test:unit": "node test/unit/run.js",
|
|
40
|
-
"test:
|
|
41
|
+
"test:coverage": "c8 --include='src/**' --reporter=text --reporter=lcov node test/unit/run.js",
|
|
42
|
+
"test:e2e": "npm run build:all && playwright test",
|
|
41
43
|
"format": "biome format --write .",
|
|
42
|
-
"check": "biome check . && node src/index.js example/simple/src --check && node src/index.js example/reactive/src --check && node src/index.js example/gom/src --check && node src/index.js example/templ/src --check",
|
|
44
|
+
"check": "biome check . && sentrux check && sentrux gate && node src/index.js example/simple/src --check && node src/index.js example/reactive/src --check && node src/index.js example/gom/src --check && node src/index.js example/templ/src --check",
|
|
43
45
|
"prepare": "husky"
|
|
44
46
|
},
|
|
45
47
|
"devDependencies": {
|
|
46
48
|
"@biomejs/biome": "^2.4.12",
|
|
47
49
|
"@playwright/test": "^1.59.1",
|
|
50
|
+
"c8": "^11.0.0",
|
|
48
51
|
"husky": "^9.1.7",
|
|
49
52
|
"jsdom": "^29.0.2",
|
|
50
53
|
"serve": "^14.2.6"
|