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 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.16.1-blue.svg" alt="Version"></a>
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
- | Attribute | Purpose |
15
- | -------------- | --------------------------------------------------------- |
16
- | `data-src` | whitespace-separated source URLs or bundle URLs |
17
- | `data-mount` | component to mount after compilation |
18
- | `data-target` | CSS selector for mount target |
19
- | `data-state` | JSON stash seed |
20
- | `data-router` | enables history mode or `"hash"` routing |
21
- | `data-persist` | persists stash in session storage or `"local"` storage |
22
- | `data-reload` | connects to `/watch`; CSS changes can refresh styles only |
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=""` — **explicitly empty**. Without this, the runtime
148
- defaults to `GET /app` (the auto-bundle endpoint provided by
149
- `@rip-lang/server`'s `serve` middleware). When you're not running
150
- a Rip server, the empty string suppresses that fetch.
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.
@@ -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" → 1234.5
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" → 1234.5
2605
+ amount? ~:money # "$1,234.50" → 123450 (dollars in → integer cents)
2606
2606
  ```
2607
2607
 
2608
2608
  Custom validators registered with `registerValidator` (from