trebol 0.1.0 → 0.1.2
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 +18 -3
- package/dist/cli.js +13790 -11417
- package/dist/fonts/OFL.txt +93 -0
- package/dist/fonts/inter-cyrillic-ext.woff2 +0 -0
- package/dist/fonts/inter-cyrillic.woff2 +0 -0
- package/dist/fonts/inter-greek-ext.woff2 +0 -0
- package/dist/fonts/inter-greek.woff2 +0 -0
- package/dist/fonts/inter-latin-ext.woff2 +0 -0
- package/dist/fonts/inter-latin.woff2 +0 -0
- package/dist/fonts/inter-vietnamese.woff2 +0 -0
- package/dist/lib/core/access.d.ts +10 -0
- package/dist/lib/core/access.js +210 -0
- package/dist/lib/core/base.d.ts +4 -0
- package/dist/lib/core/base.js +50 -0
- package/dist/lib/core/bitset.d.ts +9 -0
- package/dist/lib/core/bitset.js +75 -0
- package/dist/lib/core/boot.d.ts +18 -0
- package/dist/lib/core/boot.js +73 -0
- package/dist/lib/core/compare.d.ts +9 -0
- package/dist/lib/core/compare.js +156 -0
- package/dist/lib/core/ctx.d.ts +36 -0
- package/dist/lib/core/ctx.js +251 -0
- package/dist/lib/core/dec.d.ts +28 -0
- package/dist/lib/core/dec.js +158 -0
- package/dist/lib/core/errors.d.ts +15 -0
- package/dist/lib/core/errors.js +44 -0
- package/dist/lib/core/escapes.d.ts +14 -0
- package/dist/lib/core/escapes.js +80 -0
- package/dist/lib/core/eval.d.ts +220 -0
- package/dist/lib/core/eval.js +666 -0
- package/dist/lib/core/func.d.ts +68 -0
- package/dist/lib/core/func.js +129 -0
- package/dist/lib/core/hash.d.ts +5 -0
- package/dist/lib/core/hash.js +155 -0
- package/dist/lib/core/index.d.ts +18 -0
- package/dist/lib/core/index.js +20 -0
- package/dist/lib/core/int64.d.ts +22 -0
- package/dist/lib/core/int64.js +113 -0
- package/dist/lib/core/kinds.d.ts +67 -0
- package/dist/lib/core/kinds.js +134 -0
- package/dist/lib/core/lexer.d.ts +13 -0
- package/dist/lib/core/lexer.js +702 -0
- package/dist/lib/core/mezz.d.ts +1 -0
- package/dist/lib/core/mezz.js +360 -0
- package/dist/lib/core/mold.d.ts +20 -0
- package/dist/lib/core/mold.js +434 -0
- package/dist/lib/core/natives/control.d.ts +1 -0
- package/dist/lib/core/natives/control.js +374 -0
- package/dist/lib/core/natives/csv.d.ts +15 -0
- package/dist/lib/core/natives/csv.js +315 -0
- package/dist/lib/core/natives/data.d.ts +11 -0
- package/dist/lib/core/natives/data.js +367 -0
- package/dist/lib/core/natives/define.d.ts +17 -0
- package/dist/lib/core/natives/define.js +47 -0
- package/dist/lib/core/natives/encode.d.ts +3 -0
- package/dist/lib/core/natives/encode.js +187 -0
- package/dist/lib/core/natives/json.d.ts +5 -0
- package/dist/lib/core/natives/json.js +273 -0
- package/dist/lib/core/natives/math.d.ts +3 -0
- package/dist/lib/core/natives/math.js +500 -0
- package/dist/lib/core/natives/parse.d.ts +1 -0
- package/dist/lib/core/natives/parse.js +600 -0
- package/dist/lib/core/natives/series.d.ts +4 -0
- package/dist/lib/core/natives/series.js +519 -0
- package/dist/lib/core/natives/text.d.ts +1 -0
- package/dist/lib/core/natives/text.js +487 -0
- package/dist/lib/core/natives/xml.d.ts +9 -0
- package/dist/lib/core/natives/xml.js +242 -0
- package/dist/lib/core/series.d.ts +26 -0
- package/dist/lib/core/series.js +73 -0
- package/dist/lib/core/symbols.d.ts +9 -0
- package/dist/lib/core/symbols.js +44 -0
- package/dist/lib/core/values.d.ts +206 -0
- package/dist/lib/core/values.js +223 -0
- package/dist/lib/host/browser.d.ts +4 -0
- package/dist/lib/host/browser.js +4974 -0
- package/dist/lib/host/chart.d.ts +26 -0
- package/dist/lib/host/chart.js +158 -0
- package/dist/lib/host/compress.d.ts +1 -0
- package/dist/lib/host/compress.js +37 -0
- package/dist/lib/host/devlog.d.ts +11 -0
- package/dist/lib/host/devlog.js +13 -0
- package/dist/lib/host/devtools.d.ts +23 -0
- package/dist/lib/host/devtools.js +626 -0
- package/dist/lib/host/draw.d.ts +31 -0
- package/dist/lib/host/draw.js +348 -0
- package/dist/lib/host/fonts/OFL.txt +93 -0
- package/dist/lib/host/fonts/inter-cyrillic-ext.woff2 +0 -0
- package/dist/lib/host/fonts/inter-cyrillic.woff2 +0 -0
- package/dist/lib/host/fonts/inter-greek-ext.woff2 +0 -0
- package/dist/lib/host/fonts/inter-greek.woff2 +0 -0
- package/dist/lib/host/fonts/inter-latin-ext.woff2 +0 -0
- package/dist/lib/host/fonts/inter-latin.woff2 +0 -0
- package/dist/lib/host/fonts/inter-vietnamese.woff2 +0 -0
- package/dist/lib/host/fonts.d.ts +11 -0
- package/dist/lib/host/fonts.js +29 -0
- package/dist/lib/host/icons.d.ts +3 -0
- package/dist/lib/host/icons.js +97 -0
- package/dist/lib/host/index.d.ts +40 -0
- package/dist/lib/host/index.js +192 -0
- package/dist/lib/host/js.d.ts +5 -0
- package/dist/lib/host/js.js +130 -0
- package/dist/lib/host/locale.d.ts +40 -0
- package/dist/lib/host/locale.js +241 -0
- package/dist/lib/host/markdown.d.ts +30 -0
- package/dist/lib/host/markdown.js +161 -0
- package/dist/lib/host/modules.d.ts +14 -0
- package/dist/lib/host/modules.js +300 -0
- package/dist/lib/host/natives.d.ts +6 -0
- package/dist/lib/host/natives.js +98 -0
- package/dist/lib/host/net.d.ts +12 -0
- package/dist/lib/host/net.js +549 -0
- package/dist/lib/host/orbit.d.ts +121 -0
- package/dist/lib/host/orbit.js +374 -0
- package/dist/lib/host/page.d.ts +9 -0
- package/dist/lib/host/page.js +55 -0
- package/dist/lib/host/rows.d.ts +29 -0
- package/dist/lib/host/rows.js +109 -0
- package/dist/lib/host/scheduler.d.ts +51 -0
- package/dist/lib/host/scheduler.js +197 -0
- package/dist/lib/host/theme.d.ts +58 -0
- package/dist/lib/host/theme.js +1667 -0
- package/dist/lib/ui/i18n.trb +117 -0
- package/dist/lib/ui/test.trb +565 -0
- package/dist/lib/ui/ui.trb +1678 -0
- package/dist/trebol.js +1427 -138
- package/editors/vscode/README.md +15 -0
- package/editors/vscode/language-configuration.json +28 -0
- package/editors/vscode/package.json +42 -0
- package/editors/vscode/syntaxes/trebol.tmLanguage.json +237 -0
- package/package.json +23 -7
- package/src/core/boot.ts +1 -1
- package/src/core/func.ts +4 -0
- package/src/core/natives/control.ts +1 -1
- package/src/core/natives/series.ts +9 -1
- package/src/core/natives/text.ts +2 -0
- package/src/host/browser.ts +1235 -83
- package/src/host/devlog.ts +16 -0
- package/src/host/devtools.ts +641 -0
- package/src/host/fonts/OFL.txt +93 -0
- package/src/host/fonts/inter-cyrillic-ext.woff2 +0 -0
- package/src/host/fonts/inter-cyrillic.woff2 +0 -0
- package/src/host/fonts/inter-greek-ext.woff2 +0 -0
- package/src/host/fonts/inter-greek.woff2 +0 -0
- package/src/host/fonts/inter-latin-ext.woff2 +0 -0
- package/src/host/fonts/inter-latin.woff2 +0 -0
- package/src/host/fonts/inter-vietnamese.woff2 +0 -0
- package/src/host/fonts.ts +39 -0
- package/src/host/index.ts +5 -3
- package/src/host/js.ts +127 -0
- package/src/host/markdown.ts +9 -0
- package/src/host/modules.ts +41 -2
- package/src/host/net.ts +9 -1
- package/src/host/orbit.ts +432 -0
- package/src/host/rows.ts +30 -0
- package/src/host/scheduler.ts +62 -36
- package/src/host/theme.ts +270 -6
- package/src/ui/i18n.trb +10 -0
- package/src/ui/test.trb +565 -0
- package/src/ui/ui.trb +564 -90
package/README.md
CHANGED
|
@@ -31,8 +31,8 @@ like any other value.
|
|
|
31
31
|
- **Tasks that never block**: `fetch`, `wait` and the rest pause only the task that asked, anywhere, even in
|
|
32
32
|
the middle of a `parse`. HTTP, WebSocket and server-sent events are built in.
|
|
33
33
|
- **The UI dialect**: forms with validation, tables, lists, dialogs, toasts, tabs, menus, trees, screens with
|
|
34
|
-
their own links, languages, drawings with Red's draw dialect,
|
|
35
|
-
from a theme of a few parameters. No CSS.
|
|
34
|
+
their own links, languages, drawings with Red's draw dialect, charts, images behind the screen, photos,
|
|
35
|
+
video and sound, in nine looks and five skins, all from a theme of a few parameters. No CSS.
|
|
36
36
|
- **A console** like Rebol's, and a development server that reloads on save.
|
|
37
37
|
|
|
38
38
|
## Getting started
|
|
@@ -51,8 +51,17 @@ page on save, install it with Node.js 22.18 or later:
|
|
|
51
51
|
npm install trebol
|
|
52
52
|
npx trebol # the console: >> 1 + 2 * 3 == 9
|
|
53
53
|
npx trebol dev my-app # serves the folder my-app, with its app.trb, at http://localhost:5173/
|
|
54
|
+
npx trebol check my-app/app.trb # the mistakes in its views, without running it
|
|
55
|
+
npx trebol test my-app # its screen tests (app.test.trb), without a browser
|
|
56
|
+
npx trebol build my-app # my-app/build/index.html: the app in one page, for any web server
|
|
54
57
|
```
|
|
55
58
|
|
|
59
|
+
`node_modules/trebol/editors/vscode` is an extension that colors `.trb` files in Visual Studio Code: copy it
|
|
60
|
+
into `~/.vscode/extensions/trebol` and restart VS Code.
|
|
61
|
+
|
|
62
|
+
A JavaScript program can run Trebol too, through `trebol/host` and `trebol/core`; see
|
|
63
|
+
[using Trebol from JavaScript](https://acasadom.github.io/trebol/guides/architecture.html#using-trebol-from-javascript).
|
|
64
|
+
|
|
56
65
|
## Working on Trebol
|
|
57
66
|
|
|
58
67
|
There is no build step while working on Trebol: Node runs the TypeScript directly.
|
|
@@ -63,8 +72,12 @@ npm run check # type check and every test
|
|
|
63
72
|
npm run trb # the console
|
|
64
73
|
npm run dev # the examples, at http://localhost:5173/examples/signup/
|
|
65
74
|
npm run build # dist/trebol.js and dist/cli.js, what the npm package runs
|
|
75
|
+
npm run grammar # the editor grammar, editors/vscode/syntaxes/trebol.tmLanguage.json
|
|
66
76
|
```
|
|
67
77
|
|
|
78
|
+
A release is a tag: `npm version minor` (or `patch`) and `git push --follow-tags`. The `release` workflow checks
|
|
79
|
+
the tagged commit and stages it on npm, where a maintainer approves it with `npm stage approve`.
|
|
80
|
+
|
|
68
81
|
## Documentation
|
|
69
82
|
|
|
70
83
|
The documentation is at <https://acasadom.github.io/trebol/>. It has two tutorials,
|
|
@@ -85,6 +98,7 @@ Rebol; and guides to how Trebol is built.
|
|
|
85
98
|
| `examples` | sample apps: `signup`, `clients`, `gallery`, `live`, `designer` |
|
|
86
99
|
| `docs` | the documentation site |
|
|
87
100
|
| `tools` | the `trebol` command, the console, the documentation builders |
|
|
101
|
+
| `editors` | the Visual Studio Code extension and its TextMate grammar |
|
|
88
102
|
|
|
89
103
|
## Thanks
|
|
90
104
|
|
|
@@ -94,4 +108,5 @@ Inter typeface. The first page of the documentation says what each of them gave.
|
|
|
94
108
|
|
|
95
109
|
## License
|
|
96
110
|
|
|
97
|
-
Apache License 2.0. See [LICENSE](LICENSE).
|
|
111
|
+
Apache License 2.0. See [LICENSE](LICENSE). The Inter font in `src/host/fonts` is under the SIL Open Font
|
|
112
|
+
License 1.1 ([its text](src/host/fonts/OFL.txt)).
|