@flux-lang/cli 0.1.4 → 0.1.6-canary.3b5e668e0
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 +43 -4
- package/dist/bin/flux.js +1205 -223
- package/dist/ui-routing.js +5 -0
- package/dist/version.js +1 -1
- package/dist/view/runViewer.js +101 -53
- package/package.json +8 -3
package/README.md
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
# @flux-lang/cli
|
|
2
2
|
|
|
3
|
-
Command-line tools for the **Flux**
|
|
3
|
+
Command-line tools for the **Flux** evolving document language.
|
|
4
4
|
|
|
5
5
|
This package provides the `flux` binary, built on top of `@flux-lang/core`, with:
|
|
6
6
|
|
|
7
7
|
- `flux parse` – parse Flux source files and print their IR as JSON.
|
|
8
8
|
- `flux check` – parse + run basic static checks (grids, neighbors, timers).
|
|
9
|
+
- `flux render` – render a Flux document to canonical Render IR.
|
|
10
|
+
- `flux tick` – advance time and render updated IR.
|
|
11
|
+
- `flux step` – advance docsteps and render updated IR.
|
|
9
12
|
|
|
10
|
-
Flux is a small, declarative language for **
|
|
13
|
+
Flux is a small, declarative language for **deterministically evolving documents**. See the main repo for the full IR and language spec.
|
|
11
14
|
|
|
12
15
|
---
|
|
13
16
|
|
|
@@ -118,6 +121,41 @@ This emits one JSON line per input file:
|
|
|
118
121
|
|
|
119
122
|
---
|
|
120
123
|
|
|
124
|
+
### `flux render`
|
|
125
|
+
|
|
126
|
+
Render a `.flux` file to the canonical Render IR JSON:
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
flux render --format ir --seed 123 --time 10 --docstep 2 example.flux
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Key options:
|
|
133
|
+
|
|
134
|
+
* `--format ir` – output the Render IR (required, only format today).
|
|
135
|
+
* `--seed N` – deterministic RNG seed (default: `0`).
|
|
136
|
+
* `--time T` – render time in seconds (default: `0`).
|
|
137
|
+
* `--docstep D` – render docstep index (default: `0`).
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
### `flux tick`
|
|
142
|
+
|
|
143
|
+
Advance time and render updated IR:
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
flux tick --seconds 5 example.flux
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
### `flux step`
|
|
152
|
+
|
|
153
|
+
Advance docsteps and render updated IR:
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
flux step --n 3 example.flux
|
|
157
|
+
```
|
|
158
|
+
|
|
121
159
|
## Using with npm scripts / CI
|
|
122
160
|
|
|
123
161
|
Example `package.json` snippets:
|
|
@@ -145,7 +183,8 @@ and treat a non-zero exit code as a failure.
|
|
|
145
183
|
|
|
146
184
|
`@flux-lang/cli` is a thin wrapper around `@flux-lang/core`:
|
|
147
185
|
|
|
148
|
-
* `flux parse` calls `parseDocument` and prints the `FluxDocument` IR.
|
|
186
|
+
* `flux parse` calls `parseDocument` and prints the `FluxDocument` AST IR.
|
|
187
|
+
* `flux render` uses `renderDocument` and prints the `RenderDocument` IR.
|
|
149
188
|
* `flux check` uses both the parser and `checkDocument` to validate documents.
|
|
150
189
|
|
|
151
190
|
If you want to embed Flux directly in a tool or runtime, prefer `@flux-lang/core`. If you want to wire Flux into scripts, CI, or quick local checks, use `@flux-lang/cli`.
|
|
@@ -154,4 +193,4 @@ If you want to embed Flux directly in a tool or runtime, prefer `@flux-lang/core
|
|
|
154
193
|
|
|
155
194
|
## License
|
|
156
195
|
|
|
157
|
-
MIT – see the LICENSE file in the repo root.
|
|
196
|
+
MIT – see the LICENSE file in the repo root.
|