@astrale-os/adapter-cloudflare 0.4.10 → 0.5.0-beta.2
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/dist/build/codegen/identity.d.ts.map +1 -0
- package/dist/build/codegen/identity.js.map +1 -0
- package/dist/build/codegen/merge.d.ts.map +1 -0
- package/dist/build/codegen/merge.js.map +1 -0
- package/dist/build/codegen/worker.d.ts +12 -0
- package/dist/build/codegen/worker.d.ts.map +1 -0
- package/dist/build/codegen/worker.js +40 -0
- package/dist/build/codegen/worker.js.map +1 -0
- package/dist/{codegen → build/codegen}/wrangler.d.ts +6 -3
- package/dist/build/codegen/wrangler.d.ts.map +1 -0
- package/dist/{codegen → build/codegen}/wrangler.js +29 -10
- package/dist/build/codegen/wrangler.js.map +1 -0
- package/dist/build/frontend.d.ts +26 -0
- package/dist/build/frontend.d.ts.map +1 -0
- package/dist/build/frontend.js +263 -0
- package/dist/build/frontend.js.map +1 -0
- package/dist/{build.js → build/index.d.ts} +5 -4
- package/dist/build/index.d.ts.map +1 -0
- package/dist/{build.d.ts → build/index.js} +5 -5
- package/dist/build/index.js.map +1 -0
- package/dist/{parse-output.d.ts → build/parse-output.d.ts} +2 -0
- package/dist/build/parse-output.d.ts.map +1 -0
- package/dist/{parse-output.js → build/parse-output.js} +5 -0
- package/dist/build/parse-output.js.map +1 -0
- package/dist/build/prepare.d.ts +18 -0
- package/dist/build/prepare.d.ts.map +1 -0
- package/dist/build/prepare.js +117 -0
- package/dist/build/prepare.js.map +1 -0
- package/dist/build/worker.d.ts +15 -0
- package/dist/build/worker.d.ts.map +1 -0
- package/dist/build/worker.js +21 -0
- package/dist/build/worker.js.map +1 -0
- package/dist/{wrangler-cli.d.ts → build/wrangler-cli.d.ts} +8 -0
- package/dist/build/wrangler-cli.d.ts.map +1 -0
- package/dist/{wrangler-cli.js → build/wrangler-cli.js} +28 -4
- package/dist/build/wrangler-cli.js.map +1 -0
- package/dist/cloudflare.d.ts +21 -24
- package/dist/cloudflare.d.ts.map +1 -1
- package/dist/cloudflare.js +125 -191
- package/dist/cloudflare.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/params.d.ts +13 -16
- package/dist/params.d.ts.map +1 -1
- package/dist/worker/index.d.ts +48 -0
- package/dist/worker/index.d.ts.map +1 -0
- package/dist/worker/index.js +186 -0
- package/dist/worker/index.js.map +1 -0
- package/package.json +13 -5
- package/src/build/codegen/worker.ts +53 -0
- package/src/{codegen → build/codegen}/wrangler.ts +34 -12
- package/src/build/frontend.ts +324 -0
- package/src/{build.ts → build/index.ts} +17 -4
- package/src/{parse-output.ts → build/parse-output.ts} +6 -0
- package/src/build/prepare.ts +161 -0
- package/src/build/worker.ts +37 -0
- package/src/{wrangler-cli.ts → build/wrangler-cli.ts} +44 -6
- package/src/cloudflare.ts +153 -223
- package/src/index.ts +4 -4
- package/src/params.ts +13 -17
- package/src/worker/index.ts +276 -0
- package/src/worker/tsconfig.json +10 -0
- package/template/astrale.config.ts +7 -7
- 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.map +0 -1
- 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/codegen/identity.d.ts.map +0 -1
- 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/parse-output.d.ts.map +0 -1
- package/dist/parse-output.js.map +0 -1
- package/dist/wrangler-cli.d.ts.map +0 -1
- package/dist/wrangler-cli.js.map +0 -1
- package/src/assets-pack.ts +0 -32
- package/src/client.ts +0 -89
- package/src/codegen/worker.ts +0 -136
- 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/dist/{codegen → build/codegen}/identity.d.ts +0 -0
- /package/dist/{codegen → build/codegen}/identity.js +0 -0
- /package/dist/{codegen → build/codegen}/merge.d.ts +0 -0
- /package/dist/{codegen → build/codegen}/merge.js +0 -0
- /package/src/{codegen → build/codegen}/identity.ts +0 -0
- /package/src/{codegen → build/codegen}/merge.ts +0 -0
package/dist/codegen/worker.js
DELETED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Codegen for the Cloudflare Worker entry (`.astrale/worker.gen.ts`).
|
|
3
|
-
*
|
|
4
|
-
* The dev wires the domain ONCE in a worker-safe `domain.ts`
|
|
5
|
-
* (`export const domain = defineDomain({ schema, methods, deps, views,
|
|
6
|
-
* functions })`) and binds it to an adapter in `astrale.config.ts`
|
|
7
|
-
* (`deploy(domain, cloudflare({ … }))`). This generates the
|
|
8
|
-
* `export default { fetch }` plumbing the adapter owns by importing that single
|
|
9
|
-
* `domain` and SPREADING it into `domainWorkerEntry` — so the author's folder
|
|
10
|
-
* layout is irrelevant (any internal organization works as long as `domain.ts`
|
|
11
|
-
* re-exports the wired definition) and the node-only deploy adapter, which lives
|
|
12
|
-
* in `astrale.config.ts`, never enters this worker bundle.
|
|
13
|
-
*
|
|
14
|
-
* Everything the entry needs — schema/methods/deps/views/functions/requires/
|
|
15
|
-
* postInstall — rides on the spread; the only build-time signal left is whether
|
|
16
|
-
* this adapter env serves a client SPA (`hasClient`), which gates the `/ui`
|
|
17
|
-
* asset hook and its import. Key properties:
|
|
18
|
-
*
|
|
19
|
-
* • Per-request `url` = the live serving origin (`scheme://host`). It is passed
|
|
20
|
-
* only to `createRemoteServer({ url })`; the SDK stamps every
|
|
21
|
-
* `binding.remoteUrl` from that single value at spec-build time — so deployed
|
|
22
|
-
* Function nodes point back at THIS worker with zero hardcoded URLs.
|
|
23
|
-
* • Self-issued JWKS: a Worker can't fetch its own hostname; the verifier
|
|
24
|
-
* resolves a credential whose `iss` is this worker from the in-memory key,
|
|
25
|
-
* so no self-fetch is attempted (the worker's JWKS is served as a normal
|
|
26
|
-
* route by createRemoteServer).
|
|
27
|
-
* • Self-binding (autobinding): when a handler calls back into its OWN domain
|
|
28
|
-
* (`ctx.kernel.call` / `ctx.fn.kernel().call`), the redirect resolves to
|
|
29
|
-
* this worker's own host — a forbidden same-host subrequest. We route those
|
|
30
|
-
* through the `SELF` service binding instead.
|
|
31
|
-
* • SPA: `/ui/*` is served from the `ASSETS` binding (or proxied to Vite in
|
|
32
|
-
* dev via `VIEW_DEV_URL`).
|
|
33
|
-
*/
|
|
34
|
-
export function generateWorkerEntry(opts) {
|
|
35
|
-
// The asset-serving hook is a library helper (`assets`), not inlined string
|
|
36
|
-
// logic — imported only when this adapter env serves client assets.
|
|
37
|
-
const serverImport = opts.hasClient
|
|
38
|
-
? `import { assets, domainWorkerEntry } from '@astrale-os/sdk/server'`
|
|
39
|
-
: `import { domainWorkerEntry } from '@astrale-os/sdk/server'`;
|
|
40
|
-
const clientHook = opts.hasClient
|
|
41
|
-
? `
|
|
42
|
-
// Client assets under /ui/* — served from the ASSETS binding (or proxied to
|
|
43
|
-
// Vite in dev via VIEW_DEV_URL). The matching/stripping logic lives in the SDK helper.
|
|
44
|
-
before: assets({ binding: (env) => env.ASSETS, devProxy: (env) => env.VIEW_DEV_URL }),`
|
|
45
|
-
: '';
|
|
46
|
-
const router = opts.router;
|
|
47
|
-
// Service binding for instance-host subrequest routing (Env field + helper +
|
|
48
|
-
// routeSubrequest), wired only when the adapter's `router` is set.
|
|
49
|
-
const routerEnvField = router
|
|
50
|
-
? `
|
|
51
|
-
${router.binding}?: { fetch(request: Request): Promise<Response> }
|
|
52
|
-
// Sibling WFP services share one dispatch namespace; this binding reaches them
|
|
53
|
-
// IN-PROCESS (a same-zone public fetch 522s; the instance router doesn't know svc
|
|
54
|
-
// hosts). Injected by the \`services\` domain at deploy; absent → svc routing no-ops.
|
|
55
|
-
DISPATCHER?: { get(name: string): { fetch(request: Request): Promise<Response> } }`
|
|
56
|
-
: '';
|
|
57
|
-
const routerHelper = router
|
|
58
|
-
? `
|
|
59
|
-
// A platform INSTANCE hostname (e.g. <slug>.<region>${router.hostSuffix}) is served
|
|
60
|
-
// by a router Worker on the SAME zone — a direct Worker→Worker public fetch 522s.
|
|
61
|
-
// Route those subrequests (e.g. fetching an instance kernel's JWKS to verify a
|
|
62
|
-
// cross-instance credential) through the ${router.binding} service binding instead.
|
|
63
|
-
function isInstanceHost(host) {
|
|
64
|
-
return host.endsWith('${router.hostSuffix}') && host.split('.').length >= ${router.minLabels}
|
|
65
|
-
}
|
|
66
|
-
`
|
|
67
|
-
: '';
|
|
68
|
-
const routerHook = router
|
|
69
|
-
? `
|
|
70
|
-
// Divert platform subrequests off the same-zone public edge (CF 522s a same-zone
|
|
71
|
-
// Worker→Worker public fetch). No-op when a binding is absent.
|
|
72
|
-
routeSubrequest: (url, env) => {
|
|
73
|
-
const host = url.hostname
|
|
74
|
-
// Sibling WFP service (<script>.svc.<domain>) → in-process via the dispatch namespace.
|
|
75
|
-
if (env.DISPATCHER && host.split('.')[1] === 'svc') return env.DISPATCHER.get(host.split('.')[0])
|
|
76
|
-
// Instance host → router service binding.
|
|
77
|
-
if (env.${router.binding} && isInstanceHost(host)) return env.${router.binding}
|
|
78
|
-
return null
|
|
79
|
-
},`
|
|
80
|
-
: '';
|
|
81
|
-
return `// AUTO-GENERATED by @astrale-os/adapter-cloudflare — do not edit.
|
|
82
|
-
// Regenerated on every \`astrale-domain dev|deploy\`. Edit your domain.ts (the
|
|
83
|
-
// wired \`defineDomain\`) and astrale.config.ts (the \`deploy(domain, …)\`).
|
|
84
|
-
// (origin: ${opts.origin})
|
|
85
|
-
${serverImport}
|
|
86
|
-
|
|
87
|
-
// The worker-safe domain definition — schema/methods/deps/views/functions plus
|
|
88
|
-
// origin/requires/postInstall — wired by the author in domain.ts. Spreading it
|
|
89
|
-
// keeps this entry layout-agnostic; the deploy adapter stays in astrale.config.ts.
|
|
90
|
-
import { domain } from '../domain'
|
|
91
|
-
import { PRIVATE_JWK } from './identity'
|
|
92
|
-
|
|
93
|
-
interface Env {
|
|
94
|
-
WORKER_URL?: string
|
|
95
|
-
ASSETS?: { fetch(request: Request): Promise<Response> }
|
|
96
|
-
SELF?: { fetch(request: Request): Promise<Response> }
|
|
97
|
-
VIEW_DEV_URL?: string${routerEnvField}
|
|
98
|
-
[key: string]: unknown
|
|
99
|
-
}
|
|
100
|
-
${routerHelper}
|
|
101
|
-
// \`domainWorkerEntry\` folds the runtime-domain compile + server build + the
|
|
102
|
-
// shared worker plumbing (JWKS self-resolution, SELF-binding routing, per-URL
|
|
103
|
-
// app cache, canonical iss resolution) into one declaration. \`deps\` (when the
|
|
104
|
-
// domain declares one) rides the spread and runs per cold isolate / serving URL.
|
|
105
|
-
export default domainWorkerEntry<Env>()({
|
|
106
|
-
...domain,
|
|
107
|
-
privateKey: PRIVATE_JWK,
|
|
108
|
-
// The worker's serving URL = its identity (iss). Prefer the adapter-injected
|
|
109
|
-
// WORKER_URL (pins one canonical host for routed deploys, so iss stays stable
|
|
110
|
-
// even when also reachable via *.workers.dev); fall back to the per-request
|
|
111
|
-
// host for dev / workers.dev-only (single-host → it IS the canonical URL).
|
|
112
|
-
// Behind a TLS-terminating proxy (cloudflared tunnel → wrangler dev) the SDK
|
|
113
|
-
// upgrades the fallback origin via X-Forwarded-Proto, so iss = the public
|
|
114
|
-
// https URL, not the raw http one workerd sees.
|
|
115
|
-
resolveUrl: (env, requestOrigin) => env.WORKER_URL ?? requestOrigin,
|
|
116
|
-
selfBinding: (env) => env.SELF,${routerHook}${clientHook}
|
|
117
|
-
})
|
|
118
|
-
`;
|
|
119
|
-
}
|
|
120
|
-
//# sourceMappingURL=worker.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"worker.js","sourceRoot":"","sources":["../../src/codegen/worker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAeH,MAAM,UAAU,mBAAmB,CAAC,IAA0B;IAC5D,4EAA4E;IAC5E,oEAAoE;IACpE,MAAM,YAAY,GAAG,IAAI,CAAC,SAAS;QACjC,CAAC,CAAC,oEAAoE;QACtE,CAAC,CAAC,4DAA4D,CAAA;IAEhE,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS;QAC/B,CAAC,CAAC;;;yFAGmF;QACrF,CAAC,CAAC,EAAE,CAAA;IAEN,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAA;IAC1B,6EAA6E;IAC7E,mEAAmE;IACnE,MAAM,cAAc,GAAG,MAAM;QAC3B,CAAC,CAAC;IACF,MAAM,CAAC,OAAO;;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mappings":"AAAA;;;;GAIG;AAKH;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAW/E;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAI/E;AAED,sFAAsF;AACtF,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAShE"}
|
package/dist/parse-output.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parse-output.js","sourceRoot":"","sources":["../src/parse-output.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,QAAQ,GAAG,yDAAyD,CAAA;AAC1E,MAAM,cAAc,GAAG,mCAAmC,CAAA;AAE1D;;;;;;;;GAQG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAY,EAAE,IAAY;IACzD,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACjC,IAAI,KAAK;QAAE,OAAO,cAAc,CAAC,KAAK,CAAC,CAAC,CAAE,EAAE,IAAI,CAAC,CAAA;IACjD,wEAAwE;IACxE,kEAAkE;IAClE,MAAM,eAAe,GAAG,IAAI,MAAM,CAChC,2CAA2C,IAAI,YAAY,EAC3D,GAAG,CACJ,CAAA;IACD,MAAM,CAAC,GAAG,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACpC,OAAO,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAE,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;AACpD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,IAAY,EAAE,KAAc;IACzD,IAAI,KAAK;QAAE,OAAO,WAAW,KAAK,C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WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAA;IACpE,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,sCAAsC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAA;IACzF,MAAM,SAAS,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAE,CAAA;IAClE,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;AACrC,CAAC"}
|
package/src/assets-pack.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Pack a built client SPA (the `CLIENT_DIST_DIR` build) into the host box's asset-archive
|
|
3
|
-
* format: `gzip(JSON [{ path, contentBase64 }])` — the exact shape
|
|
4
|
-
* `downloadAssets` on the box consumes (kernel/host workerd service layout).
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import { readdirSync, readFileSync, statSync } from 'node:fs'
|
|
8
|
-
import { join, relative } from 'node:path'
|
|
9
|
-
import { gzipSync } from 'node:zlib'
|
|
10
|
-
|
|
11
|
-
type AssetFile = { path: string; contentBase64: string }
|
|
12
|
-
|
|
13
|
-
function walk(dir: string, root: string, out: AssetFile[]): void {
|
|
14
|
-
for (const name of readdirSync(dir)) {
|
|
15
|
-
const full = join(dir, name)
|
|
16
|
-
if (statSync(full).isDirectory()) walk(full, root, out)
|
|
17
|
-
else {
|
|
18
|
-
out.push({
|
|
19
|
-
path: relative(root, full).split('\\').join('/'),
|
|
20
|
-
contentBase64: readFileSync(full).toString('base64'),
|
|
21
|
-
})
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/** Gzip the SPA dir into the box's asset archive. Returns null when empty. */
|
|
27
|
-
export function packAssets(distClientDir: string): Buffer | null {
|
|
28
|
-
const files: AssetFile[] = []
|
|
29
|
-
walk(distClientDir, distClientDir, files)
|
|
30
|
-
if (files.length === 0) return null
|
|
31
|
-
return gzipSync(Buffer.from(JSON.stringify(files)))
|
|
32
|
-
}
|
package/src/client.ts
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
/** Client SPA build helpers. The source dir is adapter env config, not domain config. */
|
|
2
|
-
|
|
3
|
-
import type { DomainInfo } from '@astrale-os/sdk'
|
|
4
|
-
|
|
5
|
-
import { spawn } from 'node:child_process'
|
|
6
|
-
import { existsSync } from 'node:fs'
|
|
7
|
-
import { isAbsolute, join } from 'node:path'
|
|
8
|
-
|
|
9
|
-
export type ClientConfig = {
|
|
10
|
-
/** Vite project directory, relative to the domain project root unless absolute. */
|
|
11
|
-
dir: string
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/** Built client output, relative to the project root. The Vite config must emit here. */
|
|
15
|
-
export const CLIENT_DIST_DIR = '.dist'
|
|
16
|
-
|
|
17
|
-
export function resolveClientDir(args: {
|
|
18
|
-
adapterName: string
|
|
19
|
-
env: string
|
|
20
|
-
projectDir: string
|
|
21
|
-
client?: ClientConfig
|
|
22
|
-
domain: DomainInfo
|
|
23
|
-
}): string | undefined {
|
|
24
|
-
const { adapterName, projectDir, client, domain } = args
|
|
25
|
-
for (const view of domain.mountedViews) {
|
|
26
|
-
if (!isUiMount(view.mount)) {
|
|
27
|
-
throw new Error(
|
|
28
|
-
`${adapterName} adapter: mounted view "${view.slug}" uses mount "${view.mount}", ` +
|
|
29
|
-
'but adapter-managed client assets currently serve only /ui routes.',
|
|
30
|
-
)
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
if (domain.mountedViews.length > 0 && !client) {
|
|
34
|
-
const mounts = domain.mountedViews.map((v) => `${v.slug}:${v.mount}`).join(', ')
|
|
35
|
-
throw new Error(
|
|
36
|
-
`${adapterName} adapter: ${domain.origin} declares mounted view(s) (${mounts}) ` +
|
|
37
|
-
`but env "${args.env}" has no \`client: { dir: ... }\` config. ` +
|
|
38
|
-
'Add `client` to the selected adapter env in astrale.config.ts.',
|
|
39
|
-
)
|
|
40
|
-
}
|
|
41
|
-
if (!client) return undefined
|
|
42
|
-
return isAbsolute(client.dir) ? client.dir : join(projectDir, client.dir)
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function isUiMount(mount: string): boolean {
|
|
46
|
-
return mount === '/ui' || mount.startsWith('/ui/')
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export async function buildClient(
|
|
50
|
-
clientDir: string,
|
|
51
|
-
projectDir: string,
|
|
52
|
-
onLog?: (line: string) => void,
|
|
53
|
-
): Promise<void> {
|
|
54
|
-
const viteBin = [
|
|
55
|
-
join(clientDir, 'node_modules', '.bin', 'vite'),
|
|
56
|
-
join(projectDir, 'node_modules', '.bin', 'vite'),
|
|
57
|
-
].find((p) => existsSync(p))
|
|
58
|
-
if (!viteBin) {
|
|
59
|
-
throw new Error(
|
|
60
|
-
`client build: vite not found in ${clientDir}. Run \`pnpm install\` at the project root ` +
|
|
61
|
-
`first.`,
|
|
62
|
-
)
|
|
63
|
-
}
|
|
64
|
-
const { code, out } = await runCapture(viteBin, ['build'], clientDir, onLog)
|
|
65
|
-
if (code !== 0) {
|
|
66
|
-
throw new Error(`client build failed (code ${code}):\n${out.slice(-1500)}`)
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
function runCapture(
|
|
71
|
-
cmd: string,
|
|
72
|
-
args: string[],
|
|
73
|
-
cwd: string,
|
|
74
|
-
onLog?: (line: string) => void,
|
|
75
|
-
): Promise<{ code: number; out: string }> {
|
|
76
|
-
return new Promise((resolve, reject) => {
|
|
77
|
-
const child = spawn(cmd, args, { cwd, stdio: ['ignore', 'pipe', 'pipe'] })
|
|
78
|
-
let out = ''
|
|
79
|
-
const onData = (buf: Buffer) => {
|
|
80
|
-
const text = buf.toString()
|
|
81
|
-
out += text
|
|
82
|
-
for (const line of text.split('\n')) if (line.trim()) onLog?.(line)
|
|
83
|
-
}
|
|
84
|
-
child.stdout?.on('data', onData)
|
|
85
|
-
child.stderr?.on('data', onData)
|
|
86
|
-
child.on('exit', (code) => resolve({ code: code ?? 1, out }))
|
|
87
|
-
child.on('error', reject)
|
|
88
|
-
})
|
|
89
|
-
}
|
package/src/codegen/worker.ts
DELETED
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Codegen for the Cloudflare Worker entry (`.astrale/worker.gen.ts`).
|
|
3
|
-
*
|
|
4
|
-
* The dev wires the domain ONCE in a worker-safe `domain.ts`
|
|
5
|
-
* (`export const domain = defineDomain({ schema, methods, deps, views,
|
|
6
|
-
* functions })`) and binds it to an adapter in `astrale.config.ts`
|
|
7
|
-
* (`deploy(domain, cloudflare({ … }))`). This generates the
|
|
8
|
-
* `export default { fetch }` plumbing the adapter owns by importing that single
|
|
9
|
-
* `domain` and SPREADING it into `domainWorkerEntry` — so the author's folder
|
|
10
|
-
* layout is irrelevant (any internal organization works as long as `domain.ts`
|
|
11
|
-
* re-exports the wired definition) and the node-only deploy adapter, which lives
|
|
12
|
-
* in `astrale.config.ts`, never enters this worker bundle.
|
|
13
|
-
*
|
|
14
|
-
* Everything the entry needs — schema/methods/deps/views/functions/requires/
|
|
15
|
-
* postInstall — rides on the spread; the only build-time signal left is whether
|
|
16
|
-
* this adapter env serves a client SPA (`hasClient`), which gates the `/ui`
|
|
17
|
-
* asset hook and its import. Key properties:
|
|
18
|
-
*
|
|
19
|
-
* • Per-request `url` = the live serving origin (`scheme://host`). It is passed
|
|
20
|
-
* only to `createRemoteServer({ url })`; the SDK stamps every
|
|
21
|
-
* `binding.remoteUrl` from that single value at spec-build time — so deployed
|
|
22
|
-
* Function nodes point back at THIS worker with zero hardcoded URLs.
|
|
23
|
-
* • Self-issued JWKS: a Worker can't fetch its own hostname; the verifier
|
|
24
|
-
* resolves a credential whose `iss` is this worker from the in-memory key,
|
|
25
|
-
* so no self-fetch is attempted (the worker's JWKS is served as a normal
|
|
26
|
-
* route by createRemoteServer).
|
|
27
|
-
* • Self-binding (autobinding): when a handler calls back into its OWN domain
|
|
28
|
-
* (`ctx.kernel.call` / `ctx.fn.kernel().call`), the redirect resolves to
|
|
29
|
-
* this worker's own host — a forbidden same-host subrequest. We route those
|
|
30
|
-
* through the `SELF` service binding instead.
|
|
31
|
-
* • SPA: `/ui/*` is served from the `ASSETS` binding (or proxied to Vite in
|
|
32
|
-
* dev via `VIEW_DEV_URL`).
|
|
33
|
-
*/
|
|
34
|
-
|
|
35
|
-
export interface WorkerCodegenOptions {
|
|
36
|
-
origin: string
|
|
37
|
-
hasClient: boolean
|
|
38
|
-
/**
|
|
39
|
-
* When set, the worker routes subrequests to platform INSTANCE hostnames
|
|
40
|
-
* through `<binding>` (a service binding to a router Worker) instead of the
|
|
41
|
-
* public edge — a same-zone Worker→Worker public fetch 522s, which otherwise
|
|
42
|
-
* blocks fetching an instance kernel's JWKS to verify a cross-instance
|
|
43
|
-
* credential.
|
|
44
|
-
*/
|
|
45
|
-
router?: { binding: string; hostSuffix: string; minLabels: number }
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export function generateWorkerEntry(opts: WorkerCodegenOptions): string {
|
|
49
|
-
// The asset-serving hook is a library helper (`assets`), not inlined string
|
|
50
|
-
// logic — imported only when this adapter env serves client assets.
|
|
51
|
-
const serverImport = opts.hasClient
|
|
52
|
-
? `import { assets, domainWorkerEntry } from '@astrale-os/sdk/server'`
|
|
53
|
-
: `import { domainWorkerEntry } from '@astrale-os/sdk/server'`
|
|
54
|
-
|
|
55
|
-
const clientHook = opts.hasClient
|
|
56
|
-
? `
|
|
57
|
-
// Client assets under /ui/* — served from the ASSETS binding (or proxied to
|
|
58
|
-
// Vite in dev via VIEW_DEV_URL). The matching/stripping logic lives in the SDK helper.
|
|
59
|
-
before: assets({ binding: (env) => env.ASSETS, devProxy: (env) => env.VIEW_DEV_URL }),`
|
|
60
|
-
: ''
|
|
61
|
-
|
|
62
|
-
const router = opts.router
|
|
63
|
-
// Service binding for instance-host subrequest routing (Env field + helper +
|
|
64
|
-
// routeSubrequest), wired only when the adapter's `router` is set.
|
|
65
|
-
const routerEnvField = router
|
|
66
|
-
? `
|
|
67
|
-
${router.binding}?: { fetch(request: Request): Promise<Response> }
|
|
68
|
-
// Sibling WFP services share one dispatch namespace; this binding reaches them
|
|
69
|
-
// IN-PROCESS (a same-zone public fetch 522s; the instance router doesn't know svc
|
|
70
|
-
// hosts). Injected by the \`services\` domain at deploy; absent → svc routing no-ops.
|
|
71
|
-
DISPATCHER?: { get(name: string): { fetch(request: Request): Promise<Response> } }`
|
|
72
|
-
: ''
|
|
73
|
-
const routerHelper = router
|
|
74
|
-
? `
|
|
75
|
-
// A platform INSTANCE hostname (e.g. <slug>.<region>${router.hostSuffix}) is served
|
|
76
|
-
// by a router Worker on the SAME zone — a direct Worker→Worker public fetch 522s.
|
|
77
|
-
// Route those subrequests (e.g. fetching an instance kernel's JWKS to verify a
|
|
78
|
-
// cross-instance credential) through the ${router.binding} service binding instead.
|
|
79
|
-
function isInstanceHost(host) {
|
|
80
|
-
return host.endsWith('${router.hostSuffix}') && host.split('.').length >= ${router.minLabels}
|
|
81
|
-
}
|
|
82
|
-
`
|
|
83
|
-
: ''
|
|
84
|
-
const routerHook = router
|
|
85
|
-
? `
|
|
86
|
-
// Divert platform subrequests off the same-zone public edge (CF 522s a same-zone
|
|
87
|
-
// Worker→Worker public fetch). No-op when a binding is absent.
|
|
88
|
-
routeSubrequest: (url, env) => {
|
|
89
|
-
const host = url.hostname
|
|
90
|
-
// Sibling WFP service (<script>.svc.<domain>) → in-process via the dispatch namespace.
|
|
91
|
-
if (env.DISPATCHER && host.split('.')[1] === 'svc') return env.DISPATCHER.get(host.split('.')[0])
|
|
92
|
-
// Instance host → router service binding.
|
|
93
|
-
if (env.${router.binding} && isInstanceHost(host)) return env.${router.binding}
|
|
94
|
-
return null
|
|
95
|
-
},`
|
|
96
|
-
: ''
|
|
97
|
-
|
|
98
|
-
return `// AUTO-GENERATED by @astrale-os/adapter-cloudflare — do not edit.
|
|
99
|
-
// Regenerated on every \`astrale-domain dev|deploy\`. Edit your domain.ts (the
|
|
100
|
-
// wired \`defineDomain\`) and astrale.config.ts (the \`deploy(domain, …)\`).
|
|
101
|
-
// (origin: ${opts.origin})
|
|
102
|
-
${serverImport}
|
|
103
|
-
|
|
104
|
-
// The worker-safe domain definition — schema/methods/deps/views/functions plus
|
|
105
|
-
// origin/requires/postInstall — wired by the author in domain.ts. Spreading it
|
|
106
|
-
// keeps this entry layout-agnostic; the deploy adapter stays in astrale.config.ts.
|
|
107
|
-
import { domain } from '../domain'
|
|
108
|
-
import { PRIVATE_JWK } from './identity'
|
|
109
|
-
|
|
110
|
-
interface Env {
|
|
111
|
-
WORKER_URL?: string
|
|
112
|
-
ASSETS?: { fetch(request: Request): Promise<Response> }
|
|
113
|
-
SELF?: { fetch(request: Request): Promise<Response> }
|
|
114
|
-
VIEW_DEV_URL?: string${routerEnvField}
|
|
115
|
-
[key: string]: unknown
|
|
116
|
-
}
|
|
117
|
-
${routerHelper}
|
|
118
|
-
// \`domainWorkerEntry\` folds the runtime-domain compile + server build + the
|
|
119
|
-
// shared worker plumbing (JWKS self-resolution, SELF-binding routing, per-URL
|
|
120
|
-
// app cache, canonical iss resolution) into one declaration. \`deps\` (when the
|
|
121
|
-
// domain declares one) rides the spread and runs per cold isolate / serving URL.
|
|
122
|
-
export default domainWorkerEntry<Env>()({
|
|
123
|
-
...domain,
|
|
124
|
-
privateKey: PRIVATE_JWK,
|
|
125
|
-
// The worker's serving URL = its identity (iss). Prefer the adapter-injected
|
|
126
|
-
// WORKER_URL (pins one canonical host for routed deploys, so iss stays stable
|
|
127
|
-
// even when also reachable via *.workers.dev); fall back to the per-request
|
|
128
|
-
// host for dev / workers.dev-only (single-host → it IS the canonical URL).
|
|
129
|
-
// Behind a TLS-terminating proxy (cloudflared tunnel → wrangler dev) the SDK
|
|
130
|
-
// upgrades the fallback origin via X-Forwarded-Proto, so iss = the public
|
|
131
|
-
// https URL, not the raw http one workerd sees.
|
|
132
|
-
resolveUrl: (env, requestOrigin) => env.WORKER_URL ?? requestOrigin,
|
|
133
|
-
selfBinding: (env) => env.SELF,${routerHook}${clientHook}
|
|
134
|
-
})
|
|
135
|
-
`
|
|
136
|
-
}
|
package/template/.env.example
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
# Secrets for an env live in `.env.<env>` (e.g. .env.dev, .env.prod), pointed at
|
|
2
|
-
# by `secrets:` in astrale.config.ts. The ENTIRE file is treated as secrets:
|
|
3
|
-
# injected into the local runtime in dev, pushed to the Worker secret store in
|
|
4
|
-
# prod. These files are gitignored — copy this to `.env.dev` and fill in.
|
|
5
|
-
#
|
|
6
|
-
# Add one line per secret your handlers read (they arrive as typed fields on
|
|
7
|
-
# `Env` — see `env.ts`). For example:
|
|
8
|
-
#
|
|
9
|
-
# EXAMPLE_API_KEY=sk-...
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
# Deps
|
|
2
|
-
node_modules/
|
|
3
|
-
|
|
4
|
-
# Generated plumbing (worker entry, wrangler config, identity, spec)
|
|
5
|
-
.astrale/
|
|
6
|
-
.domain-studio/.cache/
|
|
7
|
-
|
|
8
|
-
# Worker dev + build artifacts
|
|
9
|
-
.dev.vars
|
|
10
|
-
.wrangler/
|
|
11
|
-
.dist/
|
|
12
|
-
|
|
13
|
-
# Secrets — every .env.<env> is gitignored; .env.example is the only one tracked
|
|
14
|
-
.env
|
|
15
|
-
.env.*
|
|
16
|
-
!.env.example
|
package/template/CLAUDE.md
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
# Astrale domain
|
|
2
|
-
|
|
3
|
-
Load the `astrale-domain` skill before changing schema, runtime, views, integrations, security, or
|
|
4
|
-
simulation code. Install it user-level if needed:
|
|
5
|
-
|
|
6
|
-
```bash
|
|
7
|
-
npx skills add astrale-os/cli -g
|
|
8
|
-
```
|
|
9
|
-
|
|
10
|
-
This scaffold is intentionally empty. Organize schema, runtime, core, simulation, and client code by
|
|
11
|
-
real bounded contexts. Keep I/O out of `core/`, use one explicit file per method or standalone function,
|
|
12
|
-
wrap nondeterministic handler work in `step`, derive graph keys and paths from the compiled schema, and
|
|
13
|
-
batch graph reads or mutations where possible.
|
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
|
-
}
|