rip-lang 3.16.2 → 3.17.0-wip.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/README.md +1 -1
- package/docs/AGENTS.md +19 -9
- package/docs/RIP-APP.md +5 -5
- package/docs/RIP-SCHEMA.md +3 -3
- package/docs/dist/rip.js +1600 -612
- package/docs/dist/rip.min.js +282 -262
- package/docs/dist/rip.min.js.br +0 -0
- package/docs/extensions/vscode/print/index.html +2 -1
- package/docs/extensions/vscode/print/print-1.0.14.vsix +0 -0
- package/docs/extensions/vscode/print/print-1.0.15.vsix +0 -0
- package/docs/extensions/vscode/print/print-latest.vsix +0 -0
- package/docs/extensions/vscode/rip/index.html +3 -1
- package/docs/extensions/vscode/rip/rip-latest.vsix +0 -0
- package/docs/extensions/vscode/rip/vscode-rip-0.7.0.vsix +0 -0
- package/docs/extensions/vscode/rip/vscode-rip-0.7.1.vsix +0 -0
- package/package.json +14 -3
- package/src/AGENTS.md +1 -1
- package/src/browser.js +47 -39
- package/src/compiler.js +427 -21
- package/src/components.js +208 -55
- package/src/dts.js +46 -24
- package/src/error.js +18 -0
- package/src/grammar/solar.rip +75 -2
- package/src/lexer.js +33 -4
- package/src/params.js +41 -0
- package/src/parser.js +199 -171
- package/src/schema/schema.js +2 -2
- package/src/sourcemaps.js +104 -1
- package/src/typecheck.js +344 -209
- package/src/types.js +463 -2
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
</p>
|
|
10
10
|
|
|
11
11
|
<p align="center">
|
|
12
|
-
<a href="https://github.com/shreeve/rip-lang/commits/main"><img src="https://img.shields.io/badge/version-3.
|
|
12
|
+
<a href="https://github.com/shreeve/rip-lang/commits/main"><img src="https://img.shields.io/badge/version-3.17.0-wip.1-blue.svg" alt="Version"></a>
|
|
13
13
|
<a href="#zero-dependencies"><img src="https://img.shields.io/badge/dependencies-ZERO-brightgreen.svg" alt="Dependencies"></a>
|
|
14
14
|
<a href="#"><img src="https://img.shields.io/badge/tests-1%2C436%2F1%2C436-brightgreen.svg" alt="Tests"></a>
|
|
15
15
|
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-green.svg" alt="License"></a>
|
package/docs/AGENTS.md
CHANGED
|
@@ -11,15 +11,25 @@ All `<script type="text/rip">` tags, inline or external, compile and run togethe
|
|
|
11
11
|
|
|
12
12
|
## Runtime Script Attributes
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
|
17
|
-
|
|
|
18
|
-
| `data-
|
|
19
|
-
| `data-
|
|
20
|
-
| `data-
|
|
21
|
-
| `data-
|
|
22
|
-
|
|
14
|
+
**Value attributes** — the value is the payload:
|
|
15
|
+
|
|
16
|
+
| Attribute | Values | Default | Purpose |
|
|
17
|
+
| ------------- | ------------------------------- | ------- | -------------------------------- |
|
|
18
|
+
| `data-src` | URL list (`.rip`=file, else bundle); any/cross-origin URL | empty → inline | sources to fetch; absent = inline-only; `data-src="/app"` = server app bundle |
|
|
19
|
+
| `data-mount` | component name | — | component to mount |
|
|
20
|
+
| `data-target` | CSS selector | `body` | mount target |
|
|
21
|
+
| `data-state` | JSON | `{}` | stash seed |
|
|
22
|
+
|
|
23
|
+
**Control attributes** — all parsed by one uniform rule (below):
|
|
24
|
+
|
|
25
|
+
| Attribute | Values | Default | Purpose |
|
|
26
|
+
| ----------------- | -------------------------------------- | ------- | -------------------------------- |
|
|
27
|
+
| `data-router` | `true` `false` `hash` `history` `auto` | `auto` | routing; `auto` infers from bundle |
|
|
28
|
+
| `data-reload` | `true` `false` `auto` | `auto` | SSE reload; `auto` infers from bundle |
|
|
29
|
+
| `data-persist` | `true` `false` `session` `local` | `false` | stash persistence (`true`=`session`) |
|
|
30
|
+
| `data-debug` | `true` `false` | `true` | source maps / diagnostics |
|
|
31
|
+
|
|
32
|
+
**Uniform rule** (`flag()` in `browser.js`): absent → default · bare/`true`/`on`/`yes`/`1` → true · `false`/`off`/`no`/`0` → false · a listed enum token → that token · else console error + default. Trimmed, case-insensitive.
|
|
23
33
|
|
|
24
34
|
## Component Mounting
|
|
25
35
|
|
package/docs/RIP-APP.md
CHANGED
|
@@ -120,7 +120,6 @@ static server (or open straight from disk):
|
|
|
120
120
|
<body>
|
|
121
121
|
<script defer
|
|
122
122
|
src="https://shreeve.github.io/rip-lang/dist/rip.min.js"
|
|
123
|
-
data-src=""
|
|
124
123
|
data-mount="App"></script>
|
|
125
124
|
<script type="text/rip">
|
|
126
125
|
App = component
|
|
@@ -144,10 +143,11 @@ What each attribute does:
|
|
|
144
143
|
- `src=...` — the framework bundle (compiler + reactive runtime +
|
|
145
144
|
Rip App). Use the GitHub Pages CDN URL above, or self-host a copy
|
|
146
145
|
of `dist/rip.min.js`.
|
|
147
|
-
- `data-src
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
146
|
+
- no `data-src` — this page is **inline-only**: nothing is fetched, and
|
|
147
|
+
the `<script type="text/rip">` block above is the source. That's the
|
|
148
|
+
default. A server-backed app opts in to its bundle explicitly with
|
|
149
|
+
`data-src="/app"` (the `@rip-lang/server` auto-bundle endpoint) — or
|
|
150
|
+
any URL, including a `.rip` file list or a cross-origin bundle.
|
|
151
151
|
- `data-mount="App"` — name of the top-level component to mount.
|
|
152
152
|
Mounted onto `<body>` by default; pass `data-target="#app"` (or
|
|
153
153
|
any selector) to mount somewhere else.
|
package/docs/RIP-SCHEMA.md
CHANGED
|
@@ -663,7 +663,7 @@ Patient = schema :model
|
|
|
663
663
|
phone? ~:phone # "8016542000" → "(801) 654-2000"
|
|
664
664
|
state? ~:state # "ut" → "UT"
|
|
665
665
|
dob? ~:date # normalized "YYYY-MM-DD" string
|
|
666
|
-
amount? ~:money # "$1,234.50" →
|
|
666
|
+
amount? ~:money # "$1,234.50" → 123450 (dollars in → integer cents)
|
|
667
667
|
kids? ~:ids # "3, 1, 2, 2" → [1, 2, 3]
|
|
668
668
|
```
|
|
669
669
|
|
|
@@ -680,7 +680,7 @@ Patient = schema :model
|
|
|
680
680
|
coercer that isn't registered at parse time is a **config error**
|
|
681
681
|
(fail loud), not a validation failure.
|
|
682
682
|
- Output types: the shipped names carry static output types for shadow
|
|
683
|
-
TS and DDL (`~:id` → `number`/INTEGER, `~:money` → `number
|
|
683
|
+
TS and DDL (`~:id` → `number`/INTEGER, `~:money` → `number`/INTEGER (cents),
|
|
684
684
|
`~:ids` → `number[]`, `~:ssn` → `string`, …). Custom-registered
|
|
685
685
|
names type as `any` — use an explicit transform when you need a
|
|
686
686
|
precise static type.
|
|
@@ -2602,7 +2602,7 @@ Patient = schema :model
|
|
|
2602
2602
|
phone? ~:phone # "8016542000" → "(801) 654-2000"
|
|
2603
2603
|
state? ~:state # "ut" → "UT"
|
|
2604
2604
|
dob? ~:date # normalized "YYYY-MM-DD"
|
|
2605
|
-
amount? ~:money # "$1,234.50" →
|
|
2605
|
+
amount? ~:money # "$1,234.50" → 123450 (dollars in → integer cents)
|
|
2606
2606
|
```
|
|
2607
2607
|
|
|
2608
2608
|
Custom validators registered with `registerValidator` (from
|