rastack 0.0.64 → 0.0.69
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/CHANGELOG.md +25 -0
- package/README.md +19 -24
- package/admin/httpEngine.ts +5 -6
- package/admin/index.tsx +11 -91
- package/dist/admin.js +14 -22
- package/dist/compile/model.d.ts +1 -1
- package/dist/compile/run.d.ts +2 -2
- package/dist/compile/run.js +2 -2
- package/dist/define/index.d.ts +2 -3
- package/dist/deploy/workflows.js +1 -1
- package/dist/dev/harness.d.ts +19 -27
- package/dist/dev/harness.js +31 -40
- package/dist/dev/native-server.d.ts +29 -0
- package/dist/dev/native-server.js +174 -0
- package/dist/external/envelope.d.ts +1 -1
- package/dist/external/envelope.js +1 -1
- package/dist/external/service.d.ts +2 -2
- package/dist/external/service.js +2 -2
- package/dist/external/types.d.ts +1 -1
- package/dist/external/types.js +1 -1
- package/dist/rastack-admin.d.ts +6 -14
- package/dist/rastack-admin.js +60 -88
- package/dist/rastack-design.d.ts +1 -2
- package/dist/rastack-design.js +1 -2
- package/dist/rastack-dev.d.ts +7 -10
- package/dist/rastack-dev.js +68 -80
- package/dist/rastack.d.ts +1 -1
- package/dist/rastack.js +5 -6
- package/dist/validate/transitions.d.ts +1 -1
- package/dist/validate/transitions.js +1 -1
- package/hooks/query/api.ts +4 -6
- package/package.json +2 -2
- package/provider/index.ts +0 -1
- package/provider/provider.tsx +31 -157
- package/provider/types.ts +29 -77
- package/src/compile/model.ts +1 -1
- package/src/compile/run.ts +2 -2
- package/src/define/index.ts +2 -3
- package/src/deploy/workflows.ts +1 -1
- package/src/dev/harness.ts +30 -43
- package/src/dev/native-server.ts +164 -0
- package/src/external/envelope.ts +1 -1
- package/src/external/service.ts +2 -2
- package/src/external/types.ts +1 -1
- package/src/rastack-admin.ts +66 -107
- package/src/rastack-design.ts +1 -2
- package/src/rastack-dev.ts +79 -91
- package/src/rastack.ts +5 -6
- package/src/validate/transitions.ts +1 -1
- package/dist/rastack-wasm-build.d.ts +0 -19
- package/dist/rastack-wasm-build.js +0 -94
- package/dist/wasm/package.json +0 -4
- package/dist/wasm/rastack_wasm.d.ts +0 -100
- package/dist/wasm/rastack_wasm.js +0 -745
- package/dist/wasm/rastack_wasm_bg.wasm +0 -0
- package/dist/wasm/rastack_wasm_bg.wasm.d.ts +0 -28
- package/provider/wasm.ts +0 -126
- package/scripts/copy-wasm.js +0 -35
- package/src/rastack-wasm-build.ts +0 -113
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.0.69](https://github.com/theserverkid/reactapistack/compare/v0.0.64...v0.0.69) (2026-10-03)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* indent hybrid build rules in openspec/config.yaml ([6fa81ae](https://github.com/theserverkid/reactapistack/commit/6fa81ae1a1c8724a4f4bb54f483619a36940e316))
|
|
11
|
+
|
|
12
|
+
### [0.0.68](https://github.com/theserverkid/reactapistack/compare/v0.0.64...v0.0.68) (2026-09-26)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* indent hybrid build rules in openspec/config.yaml ([6fa81ae](https://github.com/theserverkid/reactapistack/commit/6fa81ae1a1c8724a4f4bb54f483619a36940e316))
|
|
18
|
+
|
|
19
|
+
### [0.0.67](https://github.com/theserverkid/reactapistack/compare/v0.0.64...v0.0.67) (2026-09-26)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Bug Fixes
|
|
23
|
+
|
|
24
|
+
* indent hybrid build rules in openspec/config.yaml ([6fa81ae](https://github.com/theserverkid/reactapistack/commit/6fa81ae1a1c8724a4f4bb54f483619a36940e316))
|
|
25
|
+
|
|
26
|
+
### [0.0.66](https://github.com/theserverkid/reactapistack/compare/v0.0.64...v0.0.66) (2026-09-26)
|
|
27
|
+
|
|
28
|
+
### [0.0.65](https://github.com/theserverkid/reactapistack/compare/v0.0.64...v0.0.65) (2026-09-02)
|
|
29
|
+
|
|
5
30
|
### [0.0.64](https://github.com/theserverkid/reactapistack/compare/v0.0.63...v0.0.64) (2026-07-20)
|
|
6
31
|
|
|
7
32
|
|
package/README.md
CHANGED
|
@@ -82,8 +82,8 @@ export const Terminal = resource("airports", "terminal", {
|
|
|
82
82
|
|
|
83
83
|
```bash
|
|
84
84
|
# No compile step to run — it happens in-process. Author your resources, then:
|
|
85
|
-
rastack dev # compiles
|
|
86
|
-
rastack admin # Django-admin-style
|
|
85
|
+
rastack dev # compiles, starts native rastack-server, proxies /api
|
|
86
|
+
rastack admin # Django-admin-style console served by that same binary
|
|
87
87
|
```
|
|
88
88
|
|
|
89
89
|
```tsx
|
|
@@ -101,8 +101,8 @@ straight from the field types — see
|
|
|
101
101
|
resolve your types against the compiled manifest at runtime — see
|
|
102
102
|
[docs/typed-hooks.md](docs/typed-hooks.md). Resources can declare **state
|
|
103
103
|
transitions** (`scheduled → boarding → departed`), compiled into the manifest
|
|
104
|
-
and enforced on every write
|
|
105
|
-
the
|
|
104
|
+
and enforced on every write by the native handler — an illegal jump is a 400
|
|
105
|
+
from the form, the importer, and `rastack-server` (laptop and Lambda).
|
|
106
106
|
|
|
107
107
|
## Ship it — one command per stage
|
|
108
108
|
|
|
@@ -127,32 +127,27 @@ is fixed and CI only ships code: `rastack ci deploy` builds and runs
|
|
|
127
127
|
is just `run: rastack ci deploy` (`rastack ci --plan deploy` prints every step).
|
|
128
128
|
Full guide: **[docs/serverless-deploy.md](docs/serverless-deploy.md)**.
|
|
129
129
|
|
|
130
|
-
##
|
|
130
|
+
## The UI is in the browser. The API is native Rust.
|
|
131
131
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
132
|
+
A browser cannot execute `rastack-server`. `rastack dev` starts that binary
|
|
133
|
+
and proxies `/api` to it. The page renders your app. The request logic
|
|
134
|
+
(`rastack-api-core`), the Iceberg warehouse, and access control run in the
|
|
135
|
+
native process — the same binary Lambda runs (`provided.al2023`,
|
|
136
|
+
`cargo lambda build --arm64 --features lambda`). There is no in-browser engine:
|
|
137
|
+
no `RastackApi`, no warehouse seeded into the page, no IndexedDB copy of the
|
|
138
|
+
database. The warehouse is the server's directory under `data/warehouse`.
|
|
136
139
|
|
|
137
140
|
```tsx
|
|
138
|
-
// Local
|
|
139
|
-
<RAStackProvider mode="local" manifest={schema}
|
|
141
|
+
// Local: this origin. rastack dev proxies /api to native rastack-server.
|
|
142
|
+
<RAStackProvider mode="local" manifest={schema}>
|
|
140
143
|
<App />
|
|
141
144
|
</RAStackProvider>
|
|
142
145
|
|
|
143
|
-
// Production: the same
|
|
146
|
+
// Production: the same hooks, over HTTP, to Lambda.
|
|
144
147
|
<RAStackProvider mode="remote" baseURL="https://api.example.com">…</RAStackProvider>
|
|
145
|
-
|
|
146
|
-
// Client-only, reading and writing S3 directly.
|
|
147
|
-
<RAStackProvider mode="s3" manifest={schema} warehouseBaseUrl="https://bucket.s3.amazonaws.com/warehouse/">…</RAStackProvider>
|
|
148
148
|
```
|
|
149
149
|
|
|
150
|
-
|
|
151
|
-
validation, DRF-shaped lists) that Lambda runs — and, because Arrow/Parquet
|
|
152
|
-
compile to WebAssembly, the browser reads and writes the **same Parquet Iceberg
|
|
153
|
-
files** the server does. The local database is just a committed directory of
|
|
154
|
-
those files under `data/`. Full guide:
|
|
155
|
-
**[docs/local-wasm-dev.md](docs/local-wasm-dev.md)**.
|
|
150
|
+
Full guide: **[docs/local-wasm-dev.md](docs/local-wasm-dev.md)**.
|
|
156
151
|
|
|
157
152
|
## Why "on top of object storage"?
|
|
158
153
|
|
|
@@ -177,9 +172,9 @@ That gives you:
|
|
|
177
172
|
`useData` / `useForm`, and state transitions as typesafe backend functions.
|
|
178
173
|
- **[docs/architecture.md](docs/architecture.md)** — the full serverless,
|
|
179
174
|
object-storage architecture and how the three surfaces compose.
|
|
180
|
-
- **[docs/local-wasm-dev.md](docs/local-wasm-dev.md)** —
|
|
181
|
-
|
|
182
|
-
- **[engine/](engine/)** — the Rust engine: `core/` (manifest, Iceberg storage, request brain) and `serve/` (axum API, server binary
|
|
175
|
+
- **[docs/local-wasm-dev.md](docs/local-wasm-dev.md)** — local dev: native
|
|
176
|
+
`rastack-server`, UI in the browser.
|
|
177
|
+
- **[engine/](engine/)** — the Rust engine: `core/` (manifest, Iceberg storage, request brain) and `serve/` (axum API, native server binary).
|
|
183
178
|
- **[examples/serverless/](examples/serverless/)** — Lambda + S3 + IaC.
|
|
184
179
|
- **[CLAUDE.md](CLAUDE.md)** — codebase guide for contributors.
|
|
185
180
|
- **Building with an LLM?** The documentation site is mirrored as plain Markdown
|
package/admin/httpEngine.ts
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* An HTTP-backed `RastackEngine` — the same `handle(method, path, query, body)`
|
|
3
|
-
* seam
|
|
4
|
-
*
|
|
5
|
-
* over WebAssembly in `rastack dev` (`client.engine`), or over the real Rust
|
|
6
|
-
* API + Iceberg store in `rastack admin` (this adapter) — the components,
|
|
7
|
-
* hooks and adapters above it never learn which.
|
|
3
|
+
* seam, implemented over `fetch` against the native `rastack-server`. The
|
|
4
|
+
* browser renders the console. The engine is that process.
|
|
8
5
|
*/
|
|
9
6
|
|
|
10
7
|
import type { RastackEngine } from "../provider/types";
|
|
@@ -44,7 +41,9 @@ export function createHttpEngine(baseUrl = ""): RastackEngine {
|
|
|
44
41
|
}
|
|
45
42
|
|
|
46
43
|
const unavailable = (op: string) => async (): Promise<never> => {
|
|
47
|
-
throw new Error(
|
|
44
|
+
throw new Error(
|
|
45
|
+
`${op} is not available in the browser. The native rastack-server process owns the warehouse.`,
|
|
46
|
+
);
|
|
48
47
|
};
|
|
49
48
|
|
|
50
49
|
return {
|
package/admin/index.tsx
CHANGED
|
@@ -1,22 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Entry point for the admin bundle (`dist/admin.js`).
|
|
3
|
-
* *same* build, chosen by a `window.__RASTACK_ADMIN__` config the host page
|
|
4
|
-
* injects (defaulting to local):
|
|
2
|
+
* Entry point for the admin bundle (`dist/admin.js`).
|
|
5
3
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* Either way it fetches the compiled schema, themes everything with
|
|
12
|
-
* `<ThemeProvider>` and the design tokens, and renders the manifest-driven
|
|
13
|
-
* `<AdminApp>` — which never learns which engine it got.
|
|
4
|
+
* The native `rastack-server admin` process serves this bundle and injects
|
|
5
|
+
* `window.__RASTACK_ADMIN__` with `mode: "remote"`. The console calls `/api`
|
|
6
|
+
* on that same origin through `createHttpEngine`. The engine is the native
|
|
7
|
+
* process. This bundle does not load a module into the page.
|
|
14
8
|
*/
|
|
15
9
|
|
|
16
10
|
import React, { useEffect, useMemo, useState } from "react";
|
|
17
11
|
import { createRoot } from "react-dom/client";
|
|
18
|
-
import { RAStackProvider, useRastackClient } from "../provider";
|
|
19
|
-
import type { RastackWasmModule } from "../provider/types";
|
|
20
12
|
import { ThemeProvider } from "../theme";
|
|
21
13
|
import { defineTheme } from "../tokens";
|
|
22
14
|
import { AdminApp } from "./AdminApp";
|
|
@@ -26,62 +18,23 @@ import { BootScreen } from "./ui/BootScreen";
|
|
|
26
18
|
|
|
27
19
|
interface AdminConfig {
|
|
28
20
|
mode: "local" | "remote";
|
|
29
|
-
/**
|
|
21
|
+
/** Base URL the `/api/...` paths are joined onto (default same origin). */
|
|
30
22
|
apiBase?: string;
|
|
31
23
|
/** Where to fetch the compiled `schema.rastack.json`. */
|
|
32
24
|
schemaUrl?: string;
|
|
33
|
-
/** Local: base URL of the committed Iceberg warehouse to seed from. */
|
|
34
|
-
warehouseBaseUrl?: string;
|
|
35
25
|
}
|
|
36
26
|
|
|
37
27
|
const cfg: AdminConfig =
|
|
38
28
|
(typeof window !== "undefined" && (window as any).__RASTACK_ADMIN__) || {
|
|
39
|
-
mode: "
|
|
29
|
+
mode: "remote",
|
|
40
30
|
schemaUrl: "/schema.rastack.json",
|
|
41
|
-
warehouseBaseUrl: "/data/warehouse/",
|
|
42
31
|
};
|
|
43
32
|
|
|
44
33
|
// The framework's own design system paints the whole console.
|
|
45
34
|
const theme = defineTheme({ brand: "#4F6BFF", radius: "rounded" });
|
|
46
35
|
|
|
47
|
-
/** Load the WASM engine from the URL `rastack dev` serves it at (`/wasm/…`). */
|
|
48
|
-
const loadEngine = async (): Promise<RastackWasmModule> => {
|
|
49
|
-
const runtimeImport = new Function("s", "return import(s)") as (
|
|
50
|
-
s: string,
|
|
51
|
-
) => Promise<any>;
|
|
52
|
-
const mod: RastackWasmModule = await runtimeImport("/wasm/rastack_wasm.js");
|
|
53
|
-
const init = mod.default || mod.init;
|
|
54
|
-
if (typeof init === "function") await init();
|
|
55
|
-
return mod;
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
/** Local (WASM) admin: wait for the provider's engine, then render. */
|
|
59
|
-
function LocalAdmin({ resources }: { resources: AdminResource[] }): React.JSX.Element {
|
|
60
|
-
const client = useRastackClient();
|
|
61
|
-
if (client.status === "error")
|
|
62
|
-
return (
|
|
63
|
-
<BootScreen
|
|
64
|
-
error
|
|
65
|
-
label="The WASM engine failed to start — check the console."
|
|
66
|
-
/>
|
|
67
|
-
);
|
|
68
|
-
if (!client.engine || client.status !== "ready")
|
|
69
|
-
return (
|
|
70
|
-
<BootScreen
|
|
71
|
-
label={
|
|
72
|
-
client.status === "seeding"
|
|
73
|
-
? "Seeding the local warehouse…"
|
|
74
|
-
: "Starting the WASM engine…"
|
|
75
|
-
}
|
|
76
|
-
/>
|
|
77
|
-
);
|
|
78
|
-
return <AdminApp engine={client.engine} resources={resources} />;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
36
|
function Boot(): React.JSX.Element {
|
|
82
37
|
const [resources, setResources] = useState<AdminResource[] | null>(null);
|
|
83
|
-
const [manifest, setManifest] = useState<object | null>(null);
|
|
84
|
-
const [openapi, setOpenapi] = useState<object | undefined>();
|
|
85
38
|
const [error, setError] = useState<string>();
|
|
86
39
|
const httpEngine = useMemo(() => createHttpEngine(cfg.apiBase ?? ""), []);
|
|
87
40
|
|
|
@@ -91,16 +44,7 @@ function Boot(): React.JSX.Element {
|
|
|
91
44
|
const res = await fetch(schemaUrl);
|
|
92
45
|
if (!res.ok) throw new Error(`${schemaUrl} (${res.status})`);
|
|
93
46
|
const doc = await res.json();
|
|
94
|
-
setManifest(doc);
|
|
95
47
|
setResources(parseManifest(doc));
|
|
96
|
-
if (cfg.mode === "local") {
|
|
97
|
-
try {
|
|
98
|
-
const o = await fetch("/openapi.json");
|
|
99
|
-
if (o.ok) setOpenapi(await o.json());
|
|
100
|
-
} catch {
|
|
101
|
-
/* openapi is optional */
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
48
|
})().catch((e) => setError(String(e)));
|
|
105
49
|
}, []);
|
|
106
50
|
|
|
@@ -110,41 +54,17 @@ function Boot(): React.JSX.Element {
|
|
|
110
54
|
<BootScreen error label={`Failed to load the schema: ${error}`} />
|
|
111
55
|
</ThemeProvider>
|
|
112
56
|
);
|
|
113
|
-
if (!resources
|
|
57
|
+
if (!resources)
|
|
114
58
|
return (
|
|
115
59
|
<ThemeProvider tokens={theme}>
|
|
116
60
|
<BootScreen label="Loading the schema…" />
|
|
117
61
|
</ThemeProvider>
|
|
118
62
|
);
|
|
119
63
|
|
|
120
|
-
if (cfg.mode === "remote") {
|
|
121
|
-
return (
|
|
122
|
-
<ThemeProvider tokens={theme}>
|
|
123
|
-
<AdminApp engine={httpEngine} resources={resources} />
|
|
124
|
-
</ThemeProvider>
|
|
125
|
-
);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
64
|
return (
|
|
129
|
-
<
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
openapi={openapi}
|
|
133
|
-
loadEngine={loadEngine}
|
|
134
|
-
warehouseBaseUrl={cfg.warehouseBaseUrl ?? "/data/warehouse/"}
|
|
135
|
-
// In local mode the WASM warehouse *is* the database — there is no server
|
|
136
|
-
// behind it. So edits (creates/updates/deletes) MUST persist to IndexedDB;
|
|
137
|
-
// otherwise every reload re-seeds from the committed `/data/warehouse/`
|
|
138
|
-
// and silently resurrects deleted rows. The Iceberg file cache (`cache`,
|
|
139
|
-
// on by default) still makes those reloads fast — it caches the immutable
|
|
140
|
-
// Parquet used for the *first* seed; the persisted warehouse blob, once it
|
|
141
|
-
// exists, wins over re-seeding and carries the user's edits forward.
|
|
142
|
-
persist={true}
|
|
143
|
-
>
|
|
144
|
-
<ThemeProvider tokens={theme}>
|
|
145
|
-
<LocalAdmin resources={resources} />
|
|
146
|
-
</ThemeProvider>
|
|
147
|
-
</RAStackProvider>
|
|
65
|
+
<ThemeProvider tokens={theme}>
|
|
66
|
+
<AdminApp engine={httpEngine} resources={resources} />
|
|
67
|
+
</ThemeProvider>
|
|
148
68
|
);
|
|
149
69
|
}
|
|
150
70
|
|