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.
Files changed (50) hide show
  1. package/README.md +6 -6
  2. package/package.json +7 -4
  3. package/src/codegen/expressions.js +520 -1717
  4. package/src/codegen/index.js +576 -0
  5. package/src/codegen/runtime.js +151 -0
  6. package/src/codegen/statements.js +305 -296
  7. package/src/codegen/stdlib/builder.js +36 -0
  8. package/src/codegen/stdlib/bytes.js +62 -0
  9. package/src/codegen/stdlib/errors.js +17 -0
  10. package/src/codegen/stdlib/fmt.js +101 -0
  11. package/src/codegen/stdlib/gom.js +152 -0
  12. package/src/codegen/stdlib/html.js +17 -0
  13. package/src/codegen/stdlib/index.js +95 -0
  14. package/src/codegen/stdlib/io.js +33 -0
  15. package/src/codegen/stdlib/maps.js +42 -0
  16. package/src/codegen/stdlib/math.js +53 -0
  17. package/src/codegen/stdlib/os.js +10 -0
  18. package/src/codegen/stdlib/path.js +31 -0
  19. package/src/codegen/stdlib/rand.js +24 -0
  20. package/src/codegen/stdlib/regexp.js +51 -0
  21. package/src/codegen/stdlib/slices.js +48 -0
  22. package/src/codegen/stdlib/sort.js +28 -0
  23. package/src/codegen/stdlib/strconv.js +30 -0
  24. package/src/codegen/stdlib/strings.js +83 -0
  25. package/src/codegen/stdlib/time.js +54 -0
  26. package/src/codegen/stdlib/unicode.js +22 -0
  27. package/src/codegen/stdlib/utf8.js +23 -0
  28. package/src/codegen/templ.js +281 -0
  29. package/src/compiler.js +80 -74
  30. package/src/dts-parser.js +355 -371
  31. package/src/index.js +13 -49
  32. package/src/lexer.js +186 -272
  33. package/src/minifier.js +305 -318
  34. package/src/parser/expressions.js +51 -34
  35. package/src/{parser.js → parser/index.js} +4 -4
  36. package/src/parser/statements.js +24 -34
  37. package/src/parser/types.js +31 -29
  38. package/src/templ-parser.js +2 -2
  39. package/src/tokens.js +109 -0
  40. package/src/typechecker/assignability.js +258 -0
  41. package/src/typechecker/expressions.js +559 -549
  42. package/src/typechecker/index.js +555 -0
  43. package/src/typechecker/resolve.js +421 -0
  44. package/src/typechecker/statements.js +267 -280
  45. package/src/typechecker/stdlib/core.js +592 -0
  46. package/src/typechecker/stdlib/extended.js +332 -0
  47. package/src/typechecker/stdlib.js +9 -1060
  48. package/src/typechecker/termination.js +83 -0
  49. package/src/codegen.js +0 -882
  50. 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`, `__cmul`, `__cdiv`, `__error`,
112
- `__errorIs`, `__timeFmt`, `__timeParse`, `__pathClean`) are tree-shaken: only emitted
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 (~1100 tests, no browser required)
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 # both
639
+ npm run test:all # both
640
640
  ```
641
641
 
642
- **Unit tests** (~1100) cover language features, type errors, edge cases, DOM (jsdom),
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.9",
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
- "test": "npm run test:unit && npm run test:e2e",
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:e2e": "playwright 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"