@astrale-os/adapter-cloudflare 0.4.10 → 0.5.0-beta.100
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 +1193 -0
- package/README.md +29 -0
- package/dist/adapter.d.ts +15 -0
- package/dist/adapter.js +76 -0
- package/dist/build/artifact.d.ts +7 -0
- package/dist/build/artifact.js +165 -0
- package/dist/build/bundle/admit.d.ts +1 -0
- package/dist/build/bundle/admit.js +9 -0
- package/dist/build/closure.d.ts +2 -0
- package/dist/build/closure.js +22 -0
- package/dist/build/codegen/execution.d.ts +3 -0
- package/dist/build/codegen/execution.js +2 -0
- package/dist/{codegen → build/codegen}/merge.d.ts +0 -1
- package/dist/{codegen → build/codegen}/merge.js +0 -1
- package/dist/{codegen → build/codegen}/wrangler.d.ts +19 -4
- package/dist/{codegen → build/codegen}/wrangler.js +49 -13
- package/dist/build/configuration/addressing.d.ts +2 -0
- package/dist/build/configuration/addressing.js +11 -0
- package/dist/build/configuration/invocation-timeout.d.ts +2 -0
- package/dist/build/configuration/invocation-timeout.js +9 -0
- package/dist/build/configuration/request-limit.d.ts +2 -0
- package/dist/build/configuration/request-limit.js +9 -0
- package/dist/build/configuration/router.d.ts +7 -0
- package/dist/build/configuration/router.js +11 -0
- package/dist/build/configuration/worker-name.d.ts +2 -0
- package/dist/build/configuration/worker-name.js +18 -0
- package/dist/build/configuration.d.ts +5 -0
- package/dist/build/configuration.js +5 -0
- package/dist/build/direct.d.ts +4 -0
- package/dist/build/direct.js +93 -0
- package/dist/build/frontend/files.d.ts +7 -0
- package/dist/build/frontend/files.js +60 -0
- package/dist/build/frontend/routes.d.ts +2 -0
- package/dist/build/frontend/routes.js +11 -0
- package/dist/build/index.d.ts +8 -0
- package/dist/build/index.js +7 -0
- package/dist/build/materialize.d.ts +4 -0
- package/dist/build/materialize.js +10 -0
- package/dist/build/metafile.d.ts +5 -0
- package/dist/build/metafile.js +14 -0
- package/dist/build/qualification.d.ts +5 -0
- package/dist/build/qualification.js +7 -0
- package/dist/build/roots.d.ts +2 -0
- package/dist/build/roots.js +34 -0
- package/dist/build/worker/artifact.d.ts +40 -0
- package/dist/build/worker/artifact.js +1 -0
- package/dist/build/worker/artifact.load.d.ts +3 -0
- package/dist/build/worker/artifact.load.js +308 -0
- package/dist/build/worker/artifact.manifest.d.ts +48 -0
- package/dist/build/worker/artifact.manifest.js +87 -0
- package/dist/build/worker/artifact.paths.d.ts +4 -0
- package/dist/build/worker/artifact.paths.js +25 -0
- package/dist/build/worker/codegen/entry.d.ts +2 -0
- package/dist/build/worker/codegen/entry.js +28 -0
- package/dist/build/worker/codegen/service.d.ts +18 -0
- package/dist/build/worker/codegen/service.js +53 -0
- package/dist/build/worker/execution.prepare.d.ts +18 -0
- package/dist/build/worker/execution.prepare.js +112 -0
- package/dist/build/worker/index.d.ts +2 -0
- package/dist/build/worker/index.js +1 -0
- package/dist/build/worker/modules.d.ts +11 -0
- package/dist/build/worker/modules.js +26 -0
- package/dist/build/worker/runtime.d.ts +10 -0
- package/dist/build/worker/runtime.js +35 -0
- package/dist/build/worker/specifier.d.ts +1 -0
- package/dist/build/worker/specifier.js +5 -0
- package/dist/cloudflare.d.ts +1 -37
- package/dist/cloudflare.js +1 -271
- package/dist/deploy/deploy.d.ts +16 -0
- package/dist/deploy/deploy.js +204 -0
- package/dist/deploy/index.d.ts +1 -0
- package/dist/deploy/index.js +1 -0
- package/dist/deploy/output.d.ts +2 -0
- package/dist/deploy/output.js +10 -0
- package/dist/development/develop.d.ts +15 -0
- package/dist/development/develop.js +270 -0
- package/dist/development/frontend.d.ts +11 -0
- package/dist/development/frontend.js +109 -0
- package/dist/development/host.d.ts +2 -0
- package/dist/development/host.js +46 -0
- package/dist/development/port.d.ts +1 -0
- package/dist/development/port.js +12 -0
- package/dist/development/readiness.d.ts +14 -0
- package/dist/development/readiness.js +71 -0
- package/dist/development/resolved-fetch.d.ts +17 -0
- package/dist/development/resolved-fetch.js +80 -0
- package/dist/development/worker-output.d.ts +2 -0
- package/dist/development/worker-output.js +25 -0
- package/dist/development/worker.d.ts +17 -0
- package/dist/development/worker.js +147 -0
- package/dist/identity/binding.d.ts +2 -0
- package/dist/identity/binding.js +2 -0
- package/dist/identity/index.d.ts +3 -0
- package/dist/identity/index.js +3 -0
- package/dist/identity/material.d.ts +7 -0
- package/dist/identity/material.js +42 -0
- package/dist/identity/secret.d.ts +3 -0
- package/dist/identity/secret.js +7 -0
- package/dist/identity/source.d.ts +26 -0
- package/dist/identity/source.js +127 -0
- package/dist/index.d.ts +8 -8
- package/dist/index.js +7 -7
- package/dist/params.d.ts +50 -23
- package/dist/params.js +0 -1
- package/dist/release/deployment.d.ts +44 -0
- package/dist/release/deployment.js +141 -0
- package/dist/release/index.d.ts +2 -0
- package/dist/release/index.js +2 -0
- package/dist/release/staged-worker-name.d.ts +3 -0
- package/dist/release/staged-worker-name.js +10 -0
- package/dist/worker/entry.d.ts +44 -0
- package/dist/worker/entry.js +184 -0
- package/dist/worker/fetch.d.ts +11 -0
- package/dist/worker/fetch.js +31 -0
- package/dist/worker/identity.d.ts +7 -0
- package/dist/worker/identity.js +23 -0
- package/dist/worker/index.d.ts +2 -0
- package/dist/worker/index.js +2 -0
- package/dist/wrangler/bundle.d.ts +10 -0
- package/dist/wrangler/bundle.js +27 -0
- package/dist/wrangler/deploy.d.ts +24 -0
- package/dist/wrangler/deploy.js +44 -0
- package/dist/wrangler/index.d.ts +5 -0
- package/dist/wrangler/index.js +5 -0
- package/dist/wrangler/process.d.ts +17 -0
- package/dist/wrangler/process.js +115 -0
- package/dist/wrangler/secrets.d.ts +6 -0
- package/dist/wrangler/secrets.js +58 -0
- package/dist/wrangler/status.d.ts +14 -0
- package/dist/wrangler/status.js +56 -0
- package/dist/wrangler/type-generation.d.ts +6 -0
- package/dist/wrangler/type-generation.js +19 -0
- package/package.json +41 -18
- package/template/astrale.config.ts +26 -18
- package/dist/assets-pack.d.ts +0 -8
- package/dist/assets-pack.d.ts.map +0 -1
- package/dist/assets-pack.js +0 -30
- package/dist/assets-pack.js.map +0 -1
- package/dist/build.d.ts +0 -16
- package/dist/build.d.ts.map +0 -1
- package/dist/build.js +0 -15
- package/dist/build.js.map +0 -1
- package/dist/client.d.ts +0 -17
- package/dist/client.d.ts.map +0 -1
- package/dist/client.js +0 -59
- package/dist/client.js.map +0 -1
- package/dist/cloudflare.d.ts.map +0 -1
- package/dist/cloudflare.js.map +0 -1
- package/dist/codegen/identity.d.ts +0 -10
- package/dist/codegen/identity.d.ts.map +0 -1
- package/dist/codegen/identity.js +0 -32
- package/dist/codegen/identity.js.map +0 -1
- package/dist/codegen/merge.d.ts.map +0 -1
- package/dist/codegen/merge.js.map +0 -1
- package/dist/codegen/worker.d.ts +0 -51
- package/dist/codegen/worker.d.ts.map +0 -1
- package/dist/codegen/worker.js +0 -120
- package/dist/codegen/worker.js.map +0 -1
- package/dist/codegen/wrangler.d.ts.map +0 -1
- package/dist/codegen/wrangler.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/params.d.ts.map +0 -1
- package/dist/params.js.map +0 -1
- package/dist/parse-output.d.ts +0 -25
- package/dist/parse-output.d.ts.map +0 -1
- package/dist/parse-output.js +0 -53
- package/dist/parse-output.js.map +0 -1
- package/dist/wrangler-cli.d.ts +0 -78
- package/dist/wrangler-cli.d.ts.map +0 -1
- package/dist/wrangler-cli.js +0 -251
- package/dist/wrangler-cli.js.map +0 -1
- package/src/assets-pack.ts +0 -32
- package/src/build.ts +0 -16
- package/src/client.ts +0 -89
- package/src/cloudflare.ts +0 -321
- package/src/codegen/identity.ts +0 -40
- package/src/codegen/merge.ts +0 -92
- package/src/codegen/worker.ts +0 -136
- package/src/codegen/wrangler.ts +0 -105
- package/src/index.ts +0 -21
- package/src/params.ts +0 -96
- package/src/parse-output.ts +0 -54
- package/src/wrangler-cli.ts +0 -324
- package/template/.env.example +0 -9
- package/template/.gitignore.template +0 -16
- package/template/CLAUDE.md +0 -13
- package/template/README.md +0 -47
- package/template/client/.gitignore.template +0 -4
- package/template/client/__tests__/app.test.tsx +0 -15
- package/template/client/components.json +0 -25
- package/template/client/index.html +0 -12
- package/template/client/package.json +0 -35
- package/template/client/src/app.tsx +0 -52
- package/template/client/src/components/ui/cn.ts +0 -6
- package/template/client/src/main.tsx +0 -9
- package/template/client/src/styles.css +0 -78
- package/template/client/tsconfig.json +0 -26
- package/template/client/vite.config.ts +0 -22
- package/template/client/vitest.config.ts +0 -13
- package/template/core/README.md +0 -7
- package/template/deps.ts +0 -9
- package/template/domain.ts +0 -11
- package/template/env.ts +0 -8
- package/template/icons.ts +0 -4
- package/template/integrations/README.md +0 -7
- package/template/oxlint.config.ts +0 -1
- package/template/package.json +0 -58
- package/template/pnpm-workspace.yaml +0 -31
- package/template/runtime/index.ts +0 -8
- package/template/schema/index.ts +0 -10
- package/template/simulation/README.md +0 -12
- package/template/tsconfig.json +0 -28
- package/template/vitest.config.ts +0 -7
package/template/README.md
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
# Astrale domain
|
|
2
|
-
|
|
3
|
-
A minimal Astrale domain scaffold. It builds, runs, and deploys before you add any domain concepts.
|
|
4
|
-
|
|
5
|
-
```bash
|
|
6
|
-
pnpm install
|
|
7
|
-
pnpm dev
|
|
8
|
-
pnpm typecheck
|
|
9
|
-
pnpm test
|
|
10
|
-
pnpm prod
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
Load the `astrale-domain` skill before authoring the domain:
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
npx skills add astrale-os/cli -g
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## Shape
|
|
20
|
-
|
|
21
|
-
```text
|
|
22
|
-
schema/ vocabulary, split by bounded context
|
|
23
|
-
runtime/ method implementations, split by bounded context and one file per method
|
|
24
|
-
core/ pure deterministic logic, paths, defaults, and domain errors
|
|
25
|
-
integrations/ external-system ports and adapters
|
|
26
|
-
simulation/ samples and business scenarios
|
|
27
|
-
client/ React views built on @astrale-os/shell-react
|
|
28
|
-
icons.ts shared SVG wrapper; named icons stay with their context
|
|
29
|
-
env.ts worker bindings and secrets
|
|
30
|
-
deps.ts env-to-runtime dependency composition
|
|
31
|
-
domain.ts worker-safe domain assembly
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
Keep `schema/index.ts` and `runtime/index.ts` as composition roots. Put standalone functions in the
|
|
35
|
-
bounded context that owns them, then wire them from `domain.ts`; do not create a generic functions
|
|
36
|
-
junk drawer. The same rule applies to views and client code.
|
|
37
|
-
|
|
38
|
-
Cross-layer imports use the package's `#` aliases (`#schema`, `#runtime`, `#deps`, `#core/*`,
|
|
39
|
-
`#integrations/*`, `#functions/*`, `#simulation/*`, and `#views`). Keep relative imports for nearby
|
|
40
|
-
files inside the same bounded context.
|
|
41
|
-
|
|
42
|
-
The client includes Tailwind CSS v4 and an empty shadcn `radix-nova` setup. Add only the components a
|
|
43
|
-
real view needs with `pnpm exec shadcn add <component>`; component source stays in the project and can
|
|
44
|
-
be adapted to the domain's visual language.
|
|
45
|
-
|
|
46
|
-
The adapter generates worker plumbing under `.astrale/`. Do not edit it. The signing identity in
|
|
47
|
-
`.astrale/identity.ts` is gitignored; back it up before deploying from more than one machine.
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { cleanup, render, screen } from '@testing-library/react'
|
|
2
|
-
import { afterEach, describe, expect, it } from 'vitest'
|
|
3
|
-
|
|
4
|
-
import { App } from '@/app'
|
|
5
|
-
|
|
6
|
-
afterEach(cleanup)
|
|
7
|
-
|
|
8
|
-
describe('domain client', () => {
|
|
9
|
-
it('renders a standalone preview outside the Astrale shell', () => {
|
|
10
|
-
render(<App />)
|
|
11
|
-
|
|
12
|
-
expect(screen.getByText('Domain client')).toBeTruthy()
|
|
13
|
-
expect(screen.getByRole('heading', { name: 'Ready to build.' })).toBeTruthy()
|
|
14
|
-
})
|
|
15
|
-
})
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://ui.shadcn.com/schema.json",
|
|
3
|
-
"style": "radix-nova",
|
|
4
|
-
"rsc": false,
|
|
5
|
-
"tsx": true,
|
|
6
|
-
"tailwind": {
|
|
7
|
-
"config": "",
|
|
8
|
-
"css": "src/styles.css",
|
|
9
|
-
"baseColor": "neutral",
|
|
10
|
-
"cssVariables": true,
|
|
11
|
-
"prefix": ""
|
|
12
|
-
},
|
|
13
|
-
"iconLibrary": "lucide",
|
|
14
|
-
"rtl": false,
|
|
15
|
-
"aliases": {
|
|
16
|
-
"components": "@/components",
|
|
17
|
-
"utils": "@/components/ui/cn",
|
|
18
|
-
"ui": "@/components/ui",
|
|
19
|
-
"lib": "@/lib",
|
|
20
|
-
"hooks": "@/hooks"
|
|
21
|
-
},
|
|
22
|
-
"menuColor": "default",
|
|
23
|
-
"menuAccent": "subtle",
|
|
24
|
-
"registries": {}
|
|
25
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8" />
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
-
<title>Domain view</title>
|
|
7
|
-
</head>
|
|
8
|
-
<body>
|
|
9
|
-
<div id="root"></div>
|
|
10
|
-
<script type="module" src="/src/main.tsx"></script>
|
|
11
|
-
</body>
|
|
12
|
-
</html>
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "astrale-domain-client",
|
|
3
|
-
"version": "0.1.0",
|
|
4
|
-
"private": true,
|
|
5
|
-
"type": "module",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"build": "vite build",
|
|
8
|
-
"dev": "vite build --watch",
|
|
9
|
-
"dev:hmr": "vite",
|
|
10
|
-
"typecheck": "tsgo --noEmit",
|
|
11
|
-
"test": "vitest run"
|
|
12
|
-
},
|
|
13
|
-
"dependencies": {
|
|
14
|
-
"@astrale-os/shell-react": ">=0.2.5 <1.0.0",
|
|
15
|
-
"@fontsource-variable/instrument-sans": "^5.2.8",
|
|
16
|
-
"@fontsource/ibm-plex-mono": "^5.2.7",
|
|
17
|
-
"clsx": "^2.1.1",
|
|
18
|
-
"react": "^19.2.0",
|
|
19
|
-
"react-dom": "^19.2.0",
|
|
20
|
-
"shadcn": "^4.13.0",
|
|
21
|
-
"tailwind-merge": "^3.6.0",
|
|
22
|
-
"tw-animate-css": "^1.4.0"
|
|
23
|
-
},
|
|
24
|
-
"devDependencies": {
|
|
25
|
-
"@tailwindcss/vite": "^4.3.2",
|
|
26
|
-
"@testing-library/react": "^16.3.0",
|
|
27
|
-
"@types/react": "^19.2.0",
|
|
28
|
-
"@types/react-dom": "^19.2.0",
|
|
29
|
-
"@vitejs/plugin-react": "^5.0.4",
|
|
30
|
-
"happy-dom": "^20.0.0",
|
|
31
|
-
"tailwindcss": "^4.3.2",
|
|
32
|
-
"vite": "^7.1.7",
|
|
33
|
-
"vitest": "^3.2.4"
|
|
34
|
-
}
|
|
35
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { ShellProvider, useTargetNode, type ShellConfig } from '@astrale-os/shell-react'
|
|
2
|
-
|
|
3
|
-
const SHELL_CONFIG: ShellConfig = { mode: 'sandboxed', initTimeoutMs: 8_000 }
|
|
4
|
-
|
|
5
|
-
export function App() {
|
|
6
|
-
if (typeof window === 'undefined' || window.parent === window) return <Preview />
|
|
7
|
-
return (
|
|
8
|
-
<ShellProvider config={SHELL_CONFIG} fallback={<Loading />}>
|
|
9
|
-
<DomainView />
|
|
10
|
-
</ShellProvider>
|
|
11
|
-
)
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
function DomainView() {
|
|
15
|
-
const target = useTargetNode()
|
|
16
|
-
|
|
17
|
-
return (
|
|
18
|
-
<main className="mx-auto flex min-h-screen w-full max-w-5xl flex-col justify-center gap-5 px-6 py-20">
|
|
19
|
-
<p className="font-mono text-xs font-semibold tracking-[0.16em] text-primary uppercase">
|
|
20
|
-
Domain view
|
|
21
|
-
</p>
|
|
22
|
-
<h1 className="max-w-3xl text-5xl leading-[0.95] font-semibold tracking-[-0.055em] md:text-7xl">
|
|
23
|
-
{target.pending ? 'Loading target…' : 'Ready to build.'}
|
|
24
|
-
</h1>
|
|
25
|
-
<p className="max-w-xl text-base text-muted-foreground">
|
|
26
|
-
Replace this component with the view for your first bounded context.
|
|
27
|
-
</p>
|
|
28
|
-
</main>
|
|
29
|
-
)
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
function Preview() {
|
|
33
|
-
return (
|
|
34
|
-
<main className="mx-auto flex min-h-screen w-full max-w-5xl flex-col justify-center gap-5 px-6 py-20">
|
|
35
|
-
<p className="font-mono text-xs font-semibold tracking-[0.16em] text-primary uppercase">
|
|
36
|
-
Domain client
|
|
37
|
-
</p>
|
|
38
|
-
<h1 className="max-w-3xl text-5xl leading-[0.95] font-semibold tracking-[-0.055em] md:text-7xl">
|
|
39
|
-
Ready to build.
|
|
40
|
-
</h1>
|
|
41
|
-
<p className="max-w-xl text-base text-muted-foreground">
|
|
42
|
-
Views run inside the Astrale shell. Start with a bounded context, then add its view.
|
|
43
|
-
</p>
|
|
44
|
-
</main>
|
|
45
|
-
)
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function Loading() {
|
|
49
|
-
return (
|
|
50
|
-
<main className="grid min-h-screen place-items-center text-muted-foreground">Connecting…</main>
|
|
51
|
-
)
|
|
52
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { createRoot } from 'react-dom/client'
|
|
2
|
-
|
|
3
|
-
import './styles.css'
|
|
4
|
-
import { App } from '@/app'
|
|
5
|
-
|
|
6
|
-
const root = document.getElementById('root')
|
|
7
|
-
if (!root) throw new Error('astrale view client: #root missing from index.html')
|
|
8
|
-
|
|
9
|
-
createRoot(root).render(<App />)
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
@import 'tailwindcss';
|
|
2
|
-
@import 'tw-animate-css';
|
|
3
|
-
@import 'shadcn/tailwind.css';
|
|
4
|
-
@import '@fontsource-variable/instrument-sans';
|
|
5
|
-
@import '@fontsource/ibm-plex-mono/400.css';
|
|
6
|
-
|
|
7
|
-
@custom-variant dark (&:is(.dark *));
|
|
8
|
-
|
|
9
|
-
:root {
|
|
10
|
-
color-scheme: dark;
|
|
11
|
-
--background: oklch(0.145 0.008 65);
|
|
12
|
-
--foreground: oklch(0.93 0.012 78);
|
|
13
|
-
--card: oklch(0.18 0.009 65);
|
|
14
|
-
--card-foreground: var(--foreground);
|
|
15
|
-
--popover: oklch(0.19 0.009 65);
|
|
16
|
-
--popover-foreground: var(--foreground);
|
|
17
|
-
--primary: oklch(0.76 0.12 75);
|
|
18
|
-
--primary-foreground: oklch(0.17 0.01 65);
|
|
19
|
-
--secondary: oklch(0.23 0.01 65);
|
|
20
|
-
--secondary-foreground: var(--foreground);
|
|
21
|
-
--muted: oklch(0.22 0.008 65);
|
|
22
|
-
--muted-foreground: oklch(0.66 0.012 75);
|
|
23
|
-
--accent: oklch(0.25 0.012 65);
|
|
24
|
-
--accent-foreground: var(--foreground);
|
|
25
|
-
--destructive: oklch(0.65 0.18 25);
|
|
26
|
-
--border: oklch(0.285 0.01 65);
|
|
27
|
-
--input: oklch(0.29 0.01 65);
|
|
28
|
-
--ring: var(--primary);
|
|
29
|
-
--radius: 0.625rem;
|
|
30
|
-
--font-sans: 'Instrument Sans Variable', sans-serif;
|
|
31
|
-
--font-mono: 'IBM Plex Mono', monospace;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
@theme inline {
|
|
35
|
-
--font-sans: var(--font-sans);
|
|
36
|
-
--font-mono: var(--font-mono);
|
|
37
|
-
--color-ring: var(--ring);
|
|
38
|
-
--color-input: var(--input);
|
|
39
|
-
--color-border: var(--border);
|
|
40
|
-
--color-destructive: var(--destructive);
|
|
41
|
-
--color-accent-foreground: var(--accent-foreground);
|
|
42
|
-
--color-accent: var(--accent);
|
|
43
|
-
--color-muted-foreground: var(--muted-foreground);
|
|
44
|
-
--color-muted: var(--muted);
|
|
45
|
-
--color-secondary-foreground: var(--secondary-foreground);
|
|
46
|
-
--color-secondary: var(--secondary);
|
|
47
|
-
--color-primary-foreground: var(--primary-foreground);
|
|
48
|
-
--color-primary: var(--primary);
|
|
49
|
-
--color-popover-foreground: var(--popover-foreground);
|
|
50
|
-
--color-popover: var(--popover);
|
|
51
|
-
--color-card-foreground: var(--card-foreground);
|
|
52
|
-
--color-card: var(--card);
|
|
53
|
-
--color-foreground: var(--foreground);
|
|
54
|
-
--color-background: var(--background);
|
|
55
|
-
--radius-sm: calc(var(--radius) - 4px);
|
|
56
|
-
--radius-md: calc(var(--radius) - 2px);
|
|
57
|
-
--radius-lg: var(--radius);
|
|
58
|
-
--radius-xl: calc(var(--radius) + 4px);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
@layer base {
|
|
62
|
-
* {
|
|
63
|
-
@apply border-border outline-ring/50;
|
|
64
|
-
}
|
|
65
|
-
html,
|
|
66
|
-
body,
|
|
67
|
-
#root {
|
|
68
|
-
min-height: 100%;
|
|
69
|
-
}
|
|
70
|
-
body {
|
|
71
|
-
@apply bg-background text-foreground font-sans antialiased;
|
|
72
|
-
margin: 0;
|
|
73
|
-
}
|
|
74
|
-
code,
|
|
75
|
-
kbd {
|
|
76
|
-
@apply font-mono;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2022",
|
|
4
|
-
"module": "ESNext",
|
|
5
|
-
"moduleResolution": "bundler",
|
|
6
|
-
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
|
7
|
-
"jsx": "react-jsx",
|
|
8
|
-
"types": ["vite/client", "vitest/globals"],
|
|
9
|
-
"strict": true,
|
|
10
|
-
"noEmit": true,
|
|
11
|
-
"skipLibCheck": true,
|
|
12
|
-
"isolatedModules": true,
|
|
13
|
-
"resolveJsonModule": true,
|
|
14
|
-
"verbatimModuleSyntax": true,
|
|
15
|
-
"paths": { "@/*": ["./src/*"] }
|
|
16
|
-
},
|
|
17
|
-
"include": [
|
|
18
|
-
"src/**/*.ts",
|
|
19
|
-
"src/**/*.tsx",
|
|
20
|
-
"__tests__/**/*.ts",
|
|
21
|
-
"__tests__/**/*.tsx",
|
|
22
|
-
"vite.config.ts",
|
|
23
|
-
"vitest.config.ts"
|
|
24
|
-
],
|
|
25
|
-
"exclude": ["node_modules", "../.dist"]
|
|
26
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import tailwindcss from '@tailwindcss/vite'
|
|
2
|
-
import viteReact from '@vitejs/plugin-react'
|
|
3
|
-
import { fileURLToPath } from 'node:url'
|
|
4
|
-
import { defineConfig } from 'vite'
|
|
5
|
-
|
|
6
|
-
export default defineConfig({
|
|
7
|
-
base: '/ui/',
|
|
8
|
-
plugins: [viteReact(), tailwindcss()],
|
|
9
|
-
resolve: { alias: { '@': fileURLToPath(new URL('./src', import.meta.url)) } },
|
|
10
|
-
build: {
|
|
11
|
-
outDir: '../.dist',
|
|
12
|
-
emptyOutDir: true,
|
|
13
|
-
sourcemap: false,
|
|
14
|
-
},
|
|
15
|
-
// `pnpm dev:hmr` — set `VIEW_DEV_URL=http://127.0.0.1:5173` in the worker's
|
|
16
|
-
// `.dev.vars` to proxy `/ui/*` here and get React HMR.
|
|
17
|
-
server: {
|
|
18
|
-
host: '127.0.0.1',
|
|
19
|
-
port: 5173,
|
|
20
|
-
cors: true,
|
|
21
|
-
},
|
|
22
|
-
})
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import viteReact from '@vitejs/plugin-react'
|
|
2
|
-
import { fileURLToPath } from 'node:url'
|
|
3
|
-
import { defineConfig } from 'vitest/config'
|
|
4
|
-
|
|
5
|
-
export default defineConfig({
|
|
6
|
-
plugins: [viteReact()],
|
|
7
|
-
resolve: { alias: { '@': fileURLToPath(new URL('./src', import.meta.url)) } },
|
|
8
|
-
test: {
|
|
9
|
-
environment: 'happy-dom',
|
|
10
|
-
globals: true,
|
|
11
|
-
include: ['__tests__/**/*.test.{ts,tsx}', 'src/**/*.test.{ts,tsx}'],
|
|
12
|
-
},
|
|
13
|
-
})
|
package/template/core/README.md
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
# Core
|
|
2
|
-
|
|
3
|
-
Pure, deterministic domain logic only. Organize it by bounded context and keep kernel calls, network
|
|
4
|
-
I/O, clocks, randomness, and environment access in `runtime/` or `integrations/`.
|
|
5
|
-
|
|
6
|
-
Paths, domain errors, defaults, validation, and projections belong with the bounded context that owns
|
|
7
|
-
them. Delete this file after adding the first context.
|
package/template/deps.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Env } from '#env'
|
|
2
|
-
|
|
3
|
-
/** Typed dependencies available to runtime methods, functions, and views. */
|
|
4
|
-
export interface Deps extends Env {}
|
|
5
|
-
|
|
6
|
-
/** Build long-lived ports and adapters here when the first integration is added. */
|
|
7
|
-
export function deps(env: Env): Deps {
|
|
8
|
-
return env
|
|
9
|
-
}
|
package/template/domain.ts
DELETED
package/template/env.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/** Cloudflare bindings and secrets available to the domain worker. */
|
|
2
|
-
export interface Env {
|
|
3
|
-
WORKER_URL?: string
|
|
4
|
-
ASSETS?: { fetch(request: Request): Promise<Response> }
|
|
5
|
-
SELF?: { fetch(request: Request): Promise<Response> }
|
|
6
|
-
VIEW_DEV_URL?: string
|
|
7
|
-
[key: string]: unknown
|
|
8
|
-
}
|
package/template/icons.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/** Wrap raw SVG paths for a schema class icon. Keep each named icon with its bounded context. */
|
|
2
|
-
export function icon(paths: string): string {
|
|
3
|
-
return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round">${paths}</svg>`
|
|
4
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
# Integrations
|
|
2
|
-
|
|
3
|
-
External-system ports and adapters live here, grouped by the system they integrate with. Runtime code
|
|
4
|
-
depends on narrow ports; adapters own network I/O and vendor SDKs. Simulation fakes belong under
|
|
5
|
-
`simulation/`, not beside production adapters.
|
|
6
|
-
|
|
7
|
-
Delete this file after adding the first integration.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from '@astrale-os/sdk/linter/oxlint-config'
|
package/template/package.json
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "astrale-domain",
|
|
3
|
-
"version": "0.1.0",
|
|
4
|
-
"private": true,
|
|
5
|
-
"workspaces": [
|
|
6
|
-
"client"
|
|
7
|
-
],
|
|
8
|
-
"type": "module",
|
|
9
|
-
"imports": {
|
|
10
|
-
"#core/*": "./core/*.ts",
|
|
11
|
-
"#deps": "./deps.ts",
|
|
12
|
-
"#env": "./env.ts",
|
|
13
|
-
"#functions": "./functions/index.ts",
|
|
14
|
-
"#functions/*": "./functions/*.ts",
|
|
15
|
-
"#integrations/*": "./integrations/*.ts",
|
|
16
|
-
"#runtime": "./runtime/index.ts",
|
|
17
|
-
"#runtime/*": "./runtime/*.ts",
|
|
18
|
-
"#schema": "./schema/index.ts",
|
|
19
|
-
"#simulation/*": "./simulation/*.ts",
|
|
20
|
-
"#views": "./views/index.ts"
|
|
21
|
-
},
|
|
22
|
-
"scripts": {
|
|
23
|
-
"dev": "astrale-domain dev",
|
|
24
|
-
"prod": "astrale-domain prod",
|
|
25
|
-
"deploy": "astrale-domain deploy",
|
|
26
|
-
"build": "astrale-domain build",
|
|
27
|
-
"lint": "astrale-domain lint",
|
|
28
|
-
"lint:fix": "astrale-domain lint --fix",
|
|
29
|
-
"typecheck": "tsgo --noEmit",
|
|
30
|
-
"test": "vitest run --config vitest.config.ts --passWithNoTests"
|
|
31
|
-
},
|
|
32
|
-
"dependencies": {
|
|
33
|
-
"@astrale-os/adapter-cloudflare": ">=0.4.4 <1.0.0",
|
|
34
|
-
"@astrale-os/kernel-core": ">=0.7.5 <1.0.0",
|
|
35
|
-
"@astrale-os/kernel-dsl": ">=0.1.4 <1.0.0",
|
|
36
|
-
"@astrale-os/sdk": ">=0.4.9 <1.0.0",
|
|
37
|
-
"@hono/node-server": "^1.19.0",
|
|
38
|
-
"zod": "^4.3.6"
|
|
39
|
-
},
|
|
40
|
-
"devDependencies": {
|
|
41
|
-
"@astrale-os/ox": ">=0.1.3 <1.0.0",
|
|
42
|
-
"@types/node": "^22.0.0",
|
|
43
|
-
"@typescript/native-preview": "latest",
|
|
44
|
-
"oxlint": ">=1.72.0 <2.0.0",
|
|
45
|
-
"typescript": "~6.0.1-rc",
|
|
46
|
-
"vitest": "^3.2.4",
|
|
47
|
-
"wrangler": ">=4.106.0 <5.0.0"
|
|
48
|
-
},
|
|
49
|
-
"engines": {
|
|
50
|
-
"node": ">=22.13"
|
|
51
|
-
},
|
|
52
|
-
"packageManager": "pnpm@11.13.1",
|
|
53
|
-
"trustedDependencies": [
|
|
54
|
-
"esbuild",
|
|
55
|
-
"sharp",
|
|
56
|
-
"workerd"
|
|
57
|
-
]
|
|
58
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
# The client SPA (served under /ui/*) is a workspace package, so a single
|
|
2
|
-
# `pnpm install` at the project root installs both the domain and the client.
|
|
3
|
-
packages:
|
|
4
|
-
- 'client'
|
|
5
|
-
|
|
6
|
-
# pnpm blocks dependency build scripts by default; these need their postinstall
|
|
7
|
-
# to run (workerd is wrangler's runtime — without it `pnpm dev`/`pnpm prod`
|
|
8
|
-
# fail). Internal guarded preinstalls are explicitly denied because they are
|
|
9
|
-
# no-ops outside the umbrella workspace.
|
|
10
|
-
allowBuilds:
|
|
11
|
-
esbuild: true
|
|
12
|
-
sharp: true
|
|
13
|
-
workerd: true
|
|
14
|
-
# Explicit `false` for the @astrale-os no-op preinstalls — without these,
|
|
15
|
-
# `pnpm add` of a new version re-prompts and writes placeholder entries here.
|
|
16
|
-
'@astrale-os/kernel-api': false
|
|
17
|
-
'@astrale-os/kernel-client': false
|
|
18
|
-
'@astrale-os/kernel-core': false
|
|
19
|
-
'@astrale-os/kernel-dsl': false
|
|
20
|
-
'@astrale-os/kernel-server': false
|
|
21
|
-
'@astrale-os/sdk': false
|
|
22
|
-
'@astrale-os/shell': false
|
|
23
|
-
'@astrale-os/shell-react': false
|
|
24
|
-
# Optional native msgpack acceleration; the JS fallback is the portable
|
|
25
|
-
# scaffold baseline and does not require executing a transitive build script.
|
|
26
|
-
msgpackr-extract: false
|
|
27
|
-
|
|
28
|
-
# Keep pnpm 11's one-day default non-strict and never install implicitly before
|
|
29
|
-
# `pnpm run` or `pnpm exec`.
|
|
30
|
-
minimumReleaseAgeStrict: false
|
|
31
|
-
verifyDepsBeforeRun: false
|
package/template/schema/index.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { defineSchema, KernelSchema } from '@astrale-os/kernel-core'
|
|
2
|
-
import { compileDomain, type Domain } from '@astrale-os/kernel-core/domain'
|
|
3
|
-
|
|
4
|
-
export const schema = defineSchema('astrale-domain.example.dev', {
|
|
5
|
-
interfaces: {},
|
|
6
|
-
classes: {},
|
|
7
|
-
imports: [KernelSchema],
|
|
8
|
-
})
|
|
9
|
-
|
|
10
|
-
export const D: Domain<typeof schema> = compileDomain(schema)
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
# Simulation
|
|
2
|
-
|
|
3
|
-
Keep domain-level samples and real business scenarios here, organized by bounded context:
|
|
4
|
-
|
|
5
|
-
```text
|
|
6
|
-
simulation/
|
|
7
|
-
samples/<context>/
|
|
8
|
-
scenarios/<business-flow>.test.ts
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
Use Vitest for scenarios. Prefer the real schema, handlers, and kernel test harness; fake only external
|
|
12
|
-
systems. Demo data must never leak into core data or install hooks.
|
package/template/tsconfig.json
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2022",
|
|
4
|
-
"module": "ESNext",
|
|
5
|
-
"moduleResolution": "bundler",
|
|
6
|
-
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
|
7
|
-
"types": ["node"],
|
|
8
|
-
"strict": true,
|
|
9
|
-
"noEmit": true,
|
|
10
|
-
"skipLibCheck": true,
|
|
11
|
-
"verbatimModuleSyntax": true,
|
|
12
|
-
"esModuleInterop": true,
|
|
13
|
-
"resolveJsonModule": true
|
|
14
|
-
},
|
|
15
|
-
"include": [
|
|
16
|
-
"schema",
|
|
17
|
-
"core",
|
|
18
|
-
"integrations",
|
|
19
|
-
"runtime",
|
|
20
|
-
"deps.ts",
|
|
21
|
-
"env.ts",
|
|
22
|
-
"domain.ts",
|
|
23
|
-
"icons.ts",
|
|
24
|
-
"astrale.config.ts",
|
|
25
|
-
"vitest.config.ts"
|
|
26
|
-
],
|
|
27
|
-
"exclude": ["node_modules", ".astrale", ".dist"]
|
|
28
|
-
}
|