@astrale-os/adapter-cloudflare 0.2.1 → 0.3.0
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.d.ts +2 -1
- package/dist/build.d.ts.map +1 -1
- package/dist/build.js +1 -1
- package/dist/build.js.map +1 -1
- package/dist/client.d.ts +14 -13
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +25 -18
- package/dist/client.js.map +1 -1
- package/dist/cloudflare.d.ts +4 -1
- package/dist/cloudflare.d.ts.map +1 -1
- package/dist/cloudflare.js +40 -18
- package/dist/cloudflare.js.map +1 -1
- package/dist/codegen/worker.d.ts +3 -3
- package/dist/codegen/worker.d.ts.map +1 -1
- package/dist/codegen/worker.js +19 -8
- package/dist/codegen/worker.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/params.d.ts +3 -0
- package/dist/params.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/build.ts +2 -1
- package/src/client.ts +43 -18
- package/src/cloudflare.ts +41 -14
- package/src/codegen/worker.ts +19 -8
- package/src/index.ts +2 -2
- package/src/params.ts +4 -0
- package/template/CLAUDE.md +24 -0
- package/template/README.md +24 -15
- package/template/astrale.config.ts +4 -4
- package/template/client/README.md +9 -9
- package/template/client/__tests__/app.test.tsx +58 -19
- package/template/client/__tests__/harness.ts +16 -0
- package/template/client/__tests__/kernel.test.ts +23 -3
- package/template/client/src/shell/use-async.ts +4 -1
- package/template/client/src/status/components/StatusCard.tsx +115 -5
- package/template/client/src/status/hooks/useCheckable.query.ts +48 -40
- package/template/client/src/status/index.ts +2 -2
- package/template/client/src/status/status.api.ts +18 -1
- package/template/client/src/status/status.mappers.ts +89 -6
- package/template/client/src/status/status.types.ts +17 -2
- package/template/client/src/styles.css +235 -14
- package/template/client/src/views/status.tsx +1 -1
- package/template/core/monitor/index.ts +2 -2
- package/template/core/monitor/node.ts +12 -6
- package/template/domain.ts +6 -4
- package/template/functions/index.ts +31 -7
- package/template/package.json +2 -2
- package/template/pnpm-lock.yaml +2780 -0
- package/template/runtime/index.ts +8 -17
- package/template/runtime/monitoring/index.ts +8 -0
- package/template/runtime/{monitor → monitoring/monitor}/check.ts +3 -3
- package/template/runtime/{monitor → monitoring/monitor}/index.ts +3 -2
- package/template/runtime/{monitor → monitoring/monitor}/seed.ts +19 -10
- package/template/runtime/{monitor → monitoring/monitor}/watch.ts +5 -5
- package/template/runtime/{status-page → monitoring/page}/add.ts +2 -2
- package/template/runtime/{status-page → monitoring/page}/check.ts +2 -2
- package/template/runtime/{status-page → monitoring/page}/create.ts +3 -3
- package/template/runtime/monitoring/page/index.ts +9 -0
- package/template/schema/monitor.ts +6 -8
- package/template/views/index.ts +1 -1
- package/template/.agents/skills/astrale-cli/SKILL.md +0 -458
- package/template/.agents/skills/astrale-domain/SKILL.md +0 -372
- package/template/runtime/status-page/index.ts +0 -8
package/dist/build.d.ts
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* build on so the codegen/bundling/dev logic lives in exactly one place.
|
|
11
11
|
*/
|
|
12
12
|
export { logTo, prepare } from './cloudflare';
|
|
13
|
-
export { buildClient, CLIENT_DIST_DIR } from './client';
|
|
13
|
+
export { buildClient, CLIENT_DIST_DIR, resolveClientDir } from './client';
|
|
14
|
+
export type { ClientConfig } from './client';
|
|
14
15
|
export { runWranglerBundle, runWranglerDev } from './wrangler-cli';
|
|
15
16
|
//# sourceMappingURL=build.d.ts.map
|
package/dist/build.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../src/build.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAC7C,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../src/build.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAC7C,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AACzE,YAAY,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAC5C,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA"}
|
package/dist/build.js
CHANGED
|
@@ -10,6 +10,6 @@
|
|
|
10
10
|
* build on so the codegen/bundling/dev logic lives in exactly one place.
|
|
11
11
|
*/
|
|
12
12
|
export { logTo, prepare } from './cloudflare';
|
|
13
|
-
export { buildClient, CLIENT_DIST_DIR } from './client';
|
|
13
|
+
export { buildClient, CLIENT_DIST_DIR, resolveClientDir } from './client';
|
|
14
14
|
export { runWranglerBundle, runWranglerDev } from './wrangler-cli';
|
|
15
15
|
//# sourceMappingURL=build.js.map
|
package/dist/build.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.js","sourceRoot":"","sources":["../src/build.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAC7C,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"build.js","sourceRoot":"","sources":["../src/build.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAC7C,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAEzE,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA"}
|
package/dist/client.d.ts
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
* project root. This is a contract: the domain's Vite config MUST emit here
|
|
9
|
-
* (`build.outDir`), and the wrangler `assets.directory` binding + the managed
|
|
10
|
-
* deploy's asset reader both look here. Dot-prefixed so the build output sorts
|
|
11
|
-
* out of the way with the other generated dirs (`.astrale`) instead of
|
|
12
|
-
* polluting the middle of the project listing.
|
|
13
|
-
*/
|
|
1
|
+
/** Client SPA build helpers. The source dir is adapter env config, not domain config. */
|
|
2
|
+
import type { DomainInfo } from '@astrale-os/sdk';
|
|
3
|
+
export type ClientConfig = {
|
|
4
|
+
/** Vite project directory, relative to the domain project root unless absolute. */
|
|
5
|
+
dir: string;
|
|
6
|
+
};
|
|
7
|
+
/** Built client output, relative to the project root. The Vite config must emit here. */
|
|
14
8
|
export declare const CLIENT_DIST_DIR = ".dist";
|
|
9
|
+
export declare function resolveClientDir(args: {
|
|
10
|
+
adapterName: string;
|
|
11
|
+
env: string;
|
|
12
|
+
projectDir: string;
|
|
13
|
+
client?: ClientConfig;
|
|
14
|
+
domain: DomainInfo;
|
|
15
|
+
}): string | undefined;
|
|
15
16
|
export declare function buildClient(clientDir: string, projectDir: string, onLog?: (line: string) => void): Promise<void>;
|
|
16
17
|
//# sourceMappingURL=client.d.ts.map
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,yFAAyF;AAEzF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAMjD,MAAM,MAAM,YAAY,GAAG;IACzB,mFAAmF;IACnF,GAAG,EAAE,MAAM,CAAA;CACZ,CAAA;AAED,yFAAyF;AACzF,eAAO,MAAM,eAAe,UAAU,CAAA;AAEtC,wBAAgB,gBAAgB,CAAC,IAAI,EAAE;IACrC,WAAW,EAAE,MAAM,CAAA;IACnB,GAAG,EAAE,MAAM,CAAA;IACX,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,CAAC,EAAE,YAAY,CAAA;IACrB,MAAM,EAAE,UAAU,CAAA;CACnB,GAAG,MAAM,GAAG,SAAS,CAoBrB;AAMD,wBAAsB,WAAW,CAC/B,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAC7B,OAAO,CAAC,IAAI,CAAC,CAef"}
|
package/dist/client.js
CHANGED
|
@@ -1,31 +1,38 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Build the optional client SPA (the Views' UI). Best-effort: if the project
|
|
3
|
-
* has no `client/` or no resolvable Vite, we skip — the RPC surface and inline
|
|
4
|
-
* Views still work without a built SPA.
|
|
5
|
-
*/
|
|
1
|
+
/** Client SPA build helpers. The source dir is adapter env config, not domain config. */
|
|
6
2
|
import { spawn } from 'node:child_process';
|
|
7
3
|
import { existsSync } from 'node:fs';
|
|
8
|
-
import { join } from 'node:path';
|
|
9
|
-
/**
|
|
10
|
-
* Where the adapter expects the built client SPA to land, relative to the
|
|
11
|
-
* project root. This is a contract: the domain's Vite config MUST emit here
|
|
12
|
-
* (`build.outDir`), and the wrangler `assets.directory` binding + the managed
|
|
13
|
-
* deploy's asset reader both look here. Dot-prefixed so the build output sorts
|
|
14
|
-
* out of the way with the other generated dirs (`.astrale`) instead of
|
|
15
|
-
* polluting the middle of the project listing.
|
|
16
|
-
*/
|
|
4
|
+
import { isAbsolute, join } from 'node:path';
|
|
5
|
+
/** Built client output, relative to the project root. The Vite config must emit here. */
|
|
17
6
|
export const CLIENT_DIST_DIR = '.dist';
|
|
7
|
+
export function resolveClientDir(args) {
|
|
8
|
+
const { adapterName, projectDir, client, domain } = args;
|
|
9
|
+
for (const view of domain.mountedViews) {
|
|
10
|
+
if (!isUiMount(view.mount)) {
|
|
11
|
+
throw new Error(`${adapterName} adapter: mounted view "${view.slug}" uses mount "${view.mount}", ` +
|
|
12
|
+
'but adapter-managed client assets currently serve only /ui routes.');
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
if (domain.mountedViews.length > 0 && !client) {
|
|
16
|
+
const mounts = domain.mountedViews.map((v) => `${v.slug}:${v.mount}`).join(', ');
|
|
17
|
+
throw new Error(`${adapterName} adapter: ${domain.origin} declares mounted view(s) (${mounts}) ` +
|
|
18
|
+
`but env "${args.env}" has no \`client: { dir: ... }\` config. ` +
|
|
19
|
+
'Add `client` to the selected adapter env in astrale.config.ts.');
|
|
20
|
+
}
|
|
21
|
+
if (!client)
|
|
22
|
+
return undefined;
|
|
23
|
+
return isAbsolute(client.dir) ? client.dir : join(projectDir, client.dir);
|
|
24
|
+
}
|
|
25
|
+
function isUiMount(mount) {
|
|
26
|
+
return mount === '/ui' || mount.startsWith('/ui/');
|
|
27
|
+
}
|
|
18
28
|
export async function buildClient(clientDir, projectDir, onLog) {
|
|
19
29
|
const viteBin = [
|
|
20
30
|
join(clientDir, 'node_modules', '.bin', 'vite'),
|
|
21
31
|
join(projectDir, 'node_modules', '.bin', 'vite'),
|
|
22
32
|
].find((p) => existsSync(p));
|
|
23
33
|
if (!viteBin) {
|
|
24
|
-
// The project has a client/ but its deps aren't installed — wrangler would
|
|
25
|
-
// otherwise fail cryptically on the missing built-assets dir. Fail
|
|
26
|
-
// loud with the fix (the client is a workspace package — one install covers it).
|
|
27
34
|
throw new Error(`client build: vite not found in ${clientDir}. Run \`pnpm install\` at the project root ` +
|
|
28
|
-
`first
|
|
35
|
+
`first.`);
|
|
29
36
|
}
|
|
30
37
|
const { code, out } = await runCapture(viteBin, ['build'], clientDir, onLog);
|
|
31
38
|
if (code !== 0) {
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,yFAAyF;AAIzF,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAO5C,yFAAyF;AACzF,MAAM,CAAC,MAAM,eAAe,GAAG,OAAO,CAAA;AAEtC,MAAM,UAAU,gBAAgB,CAAC,IAMhC;IACC,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;IACxD,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,YAAY,EAAE,CAAC;QACvC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YAC3B,MAAM,IAAI,KAAK,CACb,GAAG,WAAW,2BAA2B,IAAI,CAAC,IAAI,iBAAiB,IAAI,CAAC,KAAK,KAAK;gBAChF,oEAAoE,CACvE,CAAA;QACH,CAAC;IACH,CAAC;IACD,IAAI,MAAM,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;QAC9C,MAAM,MAAM,GAAG,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAChF,MAAM,IAAI,KAAK,CACb,GAAG,WAAW,aAAa,MAAM,CAAC,MAAM,8BAA8B,MAAM,IAAI;YAC9E,YAAY,IAAI,CAAC,GAAG,4CAA4C;YAChE,gEAAgE,CACnE,CAAA;IACH,CAAC;IACD,IAAI,CAAC,MAAM;QAAE,OAAO,SAAS,CAAA;IAC7B,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E,GAAG,EAAE,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,CAAA;QAC1E,IAAI,GAAG,GAAG,EAAE,CAAA;QACZ,MAAM,MAAM,GAAG,CAAC,GAAW,EAAE,EAAE;YAC7B,MAAM,IAAI,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAA;YAC3B,GAAG,IAAI,IAAI,CAAA;YACX,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;gBAAE,IAAI,IAAI,CAAC,IAAI,EAAE;oBAAE,KAAK,EAAE,CAAC,IAAI,CAAC,CAAA;QACrE,CAAC,CAAA;QACD,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;QAChC,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;QAChC,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,IAAI,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAA;QAC7D,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;IAC3B,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
package/dist/cloudflare.d.ts
CHANGED
|
@@ -11,7 +11,10 @@
|
|
|
11
11
|
import type { DeployCtx, DomainAdapter, WatchCtx } from '@astrale-os/sdk';
|
|
12
12
|
import type { CloudflareParams } from './params';
|
|
13
13
|
export declare function cloudflare(envs: Record<string, CloudflareParams>): DomainAdapter<CloudflareParams>;
|
|
14
|
-
export declare function prepare(params: CloudflareParams, ctx: WatchCtx | DeployCtx, mode: 'dev' | 'deploy'
|
|
14
|
+
export declare function prepare(params: CloudflareParams, ctx: WatchCtx | DeployCtx, mode: 'dev' | 'deploy', clientAssets?: {
|
|
15
|
+
servesClient: boolean;
|
|
16
|
+
bundleAssets: boolean;
|
|
17
|
+
}): Promise<{
|
|
15
18
|
configPath: string;
|
|
16
19
|
fallbackConfigPath?: string;
|
|
17
20
|
port: number;
|
package/dist/cloudflare.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloudflare.d.ts","sourceRoot":"","sources":["../src/cloudflare.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAMzE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAUhD,wBAAgB,UAAU,CACxB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,GACrC,aAAa,CAAC,gBAAgB,CAAC,
|
|
1
|
+
{"version":3,"file":"cloudflare.d.ts","sourceRoot":"","sources":["../src/cloudflare.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAMzE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAUhD,wBAAgB,UAAU,CACxB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,GACrC,aAAa,CAAC,gBAAgB,CAAC,CA+EjC;AAiBD,wBAAsB,OAAO,CAC3B,MAAM,EAAE,gBAAgB,EACxB,GAAG,EAAE,QAAQ,GAAG,SAAS,EACzB,IAAI,EAAE,KAAK,GAAG,QAAQ,EACtB,YAAY,GAAE;IAAE,YAAY,EAAE,OAAO,CAAC;IAAC,YAAY,EAAE,OAAO,CAAA;CAG3D,GACA,OAAO,CAAC;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC,CAgGhG;AA8CD,wBAAgB,UAAU,CAAC,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAsB3E;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,EAAE,EAAE,gBAAgB,CAAC,QAAQ,CAAC,GAC7B;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CASzF;AAED,wBAAgB,KAAK,IAAI,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAE9C"}
|
package/dist/cloudflare.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
import { defineAdapter } from '@astrale-os/sdk';
|
|
12
12
|
import { mkdir, rename, writeFile } from 'node:fs/promises';
|
|
13
13
|
import { join } from 'node:path';
|
|
14
|
-
import { buildClient } from './client';
|
|
14
|
+
import { buildClient, resolveClientDir } from './client';
|
|
15
15
|
import { ensureIdentity } from './codegen/identity';
|
|
16
16
|
import { generateWorkerEntry } from './codegen/worker';
|
|
17
17
|
import { generateWranglerConfig } from './codegen/wrangler';
|
|
@@ -22,9 +22,13 @@ export function cloudflare(envs) {
|
|
|
22
22
|
name: 'cloudflare',
|
|
23
23
|
envs,
|
|
24
24
|
async watch(params, ctx) {
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
const clientDir = resolveCloudflareClientDir(params, ctx);
|
|
26
|
+
const { configPath, port } = await prepare(params, ctx, 'dev', {
|
|
27
|
+
servesClient: Boolean(clientDir),
|
|
28
|
+
bundleAssets: Boolean(clientDir),
|
|
29
|
+
});
|
|
30
|
+
if (clientDir)
|
|
31
|
+
await buildClient(clientDir, ctx.projectDir, logTo());
|
|
28
32
|
const handle = await runWranglerDev({
|
|
29
33
|
projectDir: ctx.projectDir,
|
|
30
34
|
configPath,
|
|
@@ -44,14 +48,22 @@ export function cloudflare(envs) {
|
|
|
44
48
|
// them itself, so a `astrale.config.ts` edit lands without a restart.
|
|
45
49
|
// Mirrors `watch`'s prep exactly (codegen + client build), minus the spawn.
|
|
46
50
|
async regenerate(params, ctx) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
51
|
+
const clientDir = resolveCloudflareClientDir(params, ctx);
|
|
52
|
+
await prepare(params, ctx, 'dev', {
|
|
53
|
+
servesClient: Boolean(clientDir),
|
|
54
|
+
bundleAssets: Boolean(clientDir),
|
|
55
|
+
});
|
|
56
|
+
if (clientDir)
|
|
57
|
+
await buildClient(clientDir, ctx.projectDir, logTo());
|
|
50
58
|
},
|
|
51
59
|
async deploy(params, ctx) {
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
60
|
+
const clientDir = resolveCloudflareClientDir(params, ctx);
|
|
61
|
+
const { configPath, fallbackConfigPath, workerName: name, } = await prepare(params, ctx, 'deploy', {
|
|
62
|
+
servesClient: Boolean(clientDir),
|
|
63
|
+
bundleAssets: Boolean(clientDir),
|
|
64
|
+
});
|
|
65
|
+
if (clientDir)
|
|
66
|
+
await buildClient(clientDir, ctx.projectDir, logTo());
|
|
55
67
|
const { url } = await runWranglerDeploy({
|
|
56
68
|
projectDir: ctx.projectDir,
|
|
57
69
|
configPath,
|
|
@@ -80,8 +92,20 @@ export function cloudflare(envs) {
|
|
|
80
92
|
},
|
|
81
93
|
});
|
|
82
94
|
}
|
|
95
|
+
function resolveCloudflareClientDir(params, ctx) {
|
|
96
|
+
return resolveClientDir({
|
|
97
|
+
adapterName: 'cloudflare',
|
|
98
|
+
env: ctx.env,
|
|
99
|
+
projectDir: ctx.projectDir,
|
|
100
|
+
domain: ctx.domain,
|
|
101
|
+
...(params.client ? { client: params.client } : {}),
|
|
102
|
+
});
|
|
103
|
+
}
|
|
83
104
|
// ── codegen orchestration ──────────────────────────────────────────────────
|
|
84
|
-
export async function prepare(params, ctx, mode
|
|
105
|
+
export async function prepare(params, ctx, mode, clientAssets = {
|
|
106
|
+
servesClient: false,
|
|
107
|
+
bundleAssets: false,
|
|
108
|
+
}) {
|
|
85
109
|
const astraleDir = join(ctx.projectDir, '.astrale');
|
|
86
110
|
await mkdir(astraleDir, { recursive: true });
|
|
87
111
|
await ensureIdentity(astraleDir, ctx.domain.origin);
|
|
@@ -90,13 +114,11 @@ export async function prepare(params, ctx, mode) {
|
|
|
90
114
|
// worker reach other instances' hosts internally, so a cross-instance JWKS
|
|
91
115
|
// fetch doesn't 522. Resolved once, fed to BOTH codegens below.
|
|
92
116
|
const router = resolveRouter(params.router);
|
|
93
|
-
// Two distinct client signals: the WORKER's `/ui` hook
|
|
94
|
-
//
|
|
95
|
-
//
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
const servesClient = ctx.domain.hasClient;
|
|
99
|
-
const bundleAssets = Boolean(ctx.clientDir);
|
|
117
|
+
// Two distinct client signals: the WORKER's `/ui` hook and Wrangler's local
|
|
118
|
+
// assets binding. Direct Cloudflare deploys use both; managed deploys ship
|
|
119
|
+
// assets separately but still need the worker hook.
|
|
120
|
+
const servesClient = clientAssets.servesClient;
|
|
121
|
+
const bundleAssets = clientAssets.bundleAssets;
|
|
100
122
|
await writeFileAtomic(join(astraleDir, 'worker.gen.ts'),
|
|
101
123
|
// Everything else — schema/methods/deps/views/functions/requires/postInstall —
|
|
102
124
|
// rides the `...domain` spread the generated entry imports from `../domain`;
|
package/dist/cloudflare.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloudflare.js","sourceRoot":"","sources":["../src/cloudflare.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAIhC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU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U,CAAC,IAAI,MAAM,CAAC,UAAU,CAAC,MAAM,GAAG,EAAE,EAAE,CAAC;YAC7E,MAAM,IAAI,KAAK,CACb,+CAA+C,MAAM,CAAC,UAAU,yBAAyB;gBACvF,yFAAyF;gBACzF,kCAAkC,CACrC,CAAA;QACH,CAAC;QACD,OAAO,MAAM,CAAC,UAAU,CAAA;IAC1B,CAAC;IACD,gFAAgF;IAChF,gFAAgF;IAChF,gCAAgC;IAChC,OAAO,MAAM;SACV,WAAW,EAAE;SACb,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC;SAC3B,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC;SACZ,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAA;AAC5B,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAC3B,EAA8B;IAE9B,IAAI,EAAE,KAAK,KAAK;QAAE,OAAO,SAAS,CAAA;IAClC,MAAM,GAAG,GAAG,EAAE,IAAI,EAAE,CAAA;IACpB,OAAO;QACL,OAAO,EAAE,GAAG,CAAC,OAAO,IAAI,QAAQ;QAChC,OAAO,EAAE,GAAG,CAAC,OAAO,IAAI,cAAc;QACtC,UAAU,EAAE,GAAG,CAAC,UAAU,IAAI,aAAa;QAC3C,SAAS,EAAE,GAAG,CAAC,SAAS,IAAI,CAAC;KAC9B,CAAA;AACH,CAAC;AAED,MAAM,UAAU,KAAK;IACnB,OAAO,CAAC,IAAY,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,YAAY,IAAI,WAAW,CAAC,CAAA;AAC5E,CAAC"}
|
package/dist/codegen/worker.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* The dev wires the domain ONCE in a worker-safe `domain.ts`
|
|
5
5
|
* (`export const domain = defineDomain({ schema, methods, deps, views,
|
|
6
|
-
* functions
|
|
6
|
+
* functions })`) and binds it to an adapter in `astrale.config.ts`
|
|
7
7
|
* (`deploy(domain, cloudflare({ … }))`). This generates the
|
|
8
8
|
* `export default { fetch }` plumbing the adapter owns by importing that single
|
|
9
9
|
* `domain` and SPREADING it into `domainWorkerEntry` — so the author's folder
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
*
|
|
14
14
|
* Everything the entry needs — schema/methods/deps/views/functions/requires/
|
|
15
15
|
* postInstall — rides on the spread; the only build-time signal left is whether
|
|
16
|
-
*
|
|
17
|
-
* and its import. Key properties:
|
|
16
|
+
* this adapter env serves a client SPA (`hasClient`), which gates the `/ui`
|
|
17
|
+
* asset hook and its import. Key properties:
|
|
18
18
|
*
|
|
19
19
|
* • Per-request `url` = the live serving origin (`scheme://host`). It is passed
|
|
20
20
|
* only to `createRemoteServer({ url })`; the SDK stamps every
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../../src/codegen/worker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,OAAO,CAAA;IAClB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAA;CACpE;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,oBAAoB,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../../src/codegen/worker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,OAAO,CAAA;IAClB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAA;CACpE;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,oBAAoB,GAAG,MAAM,CAwFtE"}
|
package/dist/codegen/worker.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* The dev wires the domain ONCE in a worker-safe `domain.ts`
|
|
5
5
|
* (`export const domain = defineDomain({ schema, methods, deps, views,
|
|
6
|
-
* functions
|
|
6
|
+
* functions })`) and binds it to an adapter in `astrale.config.ts`
|
|
7
7
|
* (`deploy(domain, cloudflare({ … }))`). This generates the
|
|
8
8
|
* `export default { fetch }` plumbing the adapter owns by importing that single
|
|
9
9
|
* `domain` and SPREADING it into `domainWorkerEntry` — so the author's folder
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
*
|
|
14
14
|
* Everything the entry needs — schema/methods/deps/views/functions/requires/
|
|
15
15
|
* postInstall — rides on the spread; the only build-time signal left is whether
|
|
16
|
-
*
|
|
17
|
-
* and its import. Key properties:
|
|
16
|
+
* this adapter env serves a client SPA (`hasClient`), which gates the `/ui`
|
|
17
|
+
* asset hook and its import. Key properties:
|
|
18
18
|
*
|
|
19
19
|
* • Per-request `url` = the live serving origin (`scheme://host`). It is passed
|
|
20
20
|
* only to `createRemoteServer({ url })`; the SDK stamps every
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
*/
|
|
34
34
|
export function generateWorkerEntry(opts) {
|
|
35
35
|
// The asset-serving hook is a library helper (`assets`), not inlined string
|
|
36
|
-
// logic — imported only when
|
|
36
|
+
// logic — imported only when this adapter env serves client assets.
|
|
37
37
|
const serverImport = opts.hasClient
|
|
38
38
|
? `import { assets, domainWorkerEntry } from '@astrale-os/sdk/server'`
|
|
39
39
|
: `import { domainWorkerEntry } from '@astrale-os/sdk/server'`;
|
|
@@ -48,7 +48,11 @@ export function generateWorkerEntry(opts) {
|
|
|
48
48
|
// routeSubrequest), wired only when the adapter's `router` is set.
|
|
49
49
|
const routerEnvField = router
|
|
50
50
|
? `
|
|
51
|
-
${router.binding}?: { fetch(request: Request): Promise<Response> }
|
|
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> } }`
|
|
52
56
|
: '';
|
|
53
57
|
const routerHelper = router
|
|
54
58
|
? `
|
|
@@ -63,9 +67,16 @@ function isInstanceHost(host) {
|
|
|
63
67
|
: '';
|
|
64
68
|
const routerHook = router
|
|
65
69
|
? `
|
|
66
|
-
// Divert
|
|
67
|
-
// Worker→Worker public fetch). No-op when
|
|
68
|
-
routeSubrequest: (url, env) =>
|
|
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
|
+
},`
|
|
69
80
|
: '';
|
|
70
81
|
return `// AUTO-GENERATED by @astrale-os/adapter-cloudflare — do not edit.
|
|
71
82
|
// Regenerated on every \`astrale-domain dev|deploy\`. Edit your domain.ts (the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker.js","sourceRoot":"","sources":["../../src/codegen/worker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgC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flare } from '@astrale-os/adapter-cloudflare'
|
|
6
6
|
*
|
|
7
7
|
* adapter: cloudflare({
|
|
8
|
-
* dev: { secrets: '.env.dev' },
|
|
9
|
-
* prod: { route: 'crm.acme.dev', secrets: '.env.prod' },
|
|
8
|
+
* dev: { client: { dir: 'client' }, secrets: '.env.dev' },
|
|
9
|
+
* prod: { client: { dir: 'client' }, route: 'crm.acme.dev', secrets: '.env.prod' },
|
|
10
10
|
* })
|
|
11
11
|
*
|
|
12
12
|
* `dev` runs `wrangler dev` locally; an env with no `route` ships to
|
package/dist/index.js
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* import { cloudflare } from '@astrale-os/adapter-cloudflare'
|
|
6
6
|
*
|
|
7
7
|
* adapter: cloudflare({
|
|
8
|
-
* dev: { secrets: '.env.dev' },
|
|
9
|
-
* prod: { route: 'crm.acme.dev', secrets: '.env.prod' },
|
|
8
|
+
* dev: { client: { dir: 'client' }, secrets: '.env.dev' },
|
|
9
|
+
* prod: { client: { dir: 'client' }, route: 'crm.acme.dev', secrets: '.env.prod' },
|
|
10
10
|
* })
|
|
11
11
|
*
|
|
12
12
|
* `dev` runs `wrangler dev` locally; an env with no `route` ships to
|
package/dist/params.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ClientConfig } from './client';
|
|
1
2
|
/**
|
|
2
3
|
* `CloudflareParams` — the provider-typed config for the Cloudflare adapter.
|
|
3
4
|
*
|
|
@@ -11,6 +12,8 @@
|
|
|
11
12
|
* • remote (custom) — `deploy()` with `route`; URL = https://<route>
|
|
12
13
|
*/
|
|
13
14
|
export interface CloudflareParams {
|
|
15
|
+
/** Frontend assets to build and serve for this env's mounted `/ui` views. */
|
|
16
|
+
client?: ClientConfig;
|
|
14
17
|
/**
|
|
15
18
|
* Custom route / hostname for a routed deploy, e.g. `'crm.acme.dev'`. Omit to
|
|
16
19
|
* deploy to `*.workers.dev`. Ignored by local `wrangler dev` (URL is
|
package/dist/params.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"params.d.ts","sourceRoot":"","sources":["../src/params.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,6EAA6E;IAC7E,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,yEAAyE;IACzE,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,2EAA2E;IAC3E,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,8DAA8D;IAC9D,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC7B;;;;;;;;;;;;;;;;;OAiBG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAClC;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,MAAM,CAAC,EACH,KAAK,GACL;QACE,mEAAmE;QACnE,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,iEAAiE;QACjE,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,wEAAwE;QACxE,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,sGAAsG;QACtG,SAAS,CAAC,EAAE,MAAM,CAAA;KACnB,CAAA;CACN"}
|
|
1
|
+
{"version":3,"file":"params.d.ts","sourceRoot":"","sources":["../src/params.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAE5C;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,gBAAgB;IAC/B,6EAA6E;IAC7E,MAAM,CAAC,EAAE,YAAY,CAAA;IACrB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,6EAA6E;IAC7E,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,yEAAyE;IACzE,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,2EAA2E;IAC3E,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,8DAA8D;IAC9D,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC7B;;;;;;;;;;;;;;;;;OAiBG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAClC;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,MAAM,CAAC,EACH,KAAK,GACL;QACE,mEAAmE;QACnE,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,iEAAiE;QACjE,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,wEAAwE;QACxE,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,sGAAsG;QACtG,SAAS,CAAC,EAAE,MAAM,CAAA;KACnB,CAAA;CACN"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astrale-os/adapter-cloudflare",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Deploy an Astrale domain as a standalone Cloudflare Worker",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"adapter",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"jose": "^6.1.3",
|
|
35
|
-
"@astrale-os/sdk": "^0.
|
|
35
|
+
"@astrale-os/sdk": "^0.2.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@astrale-os/ox": ">=0.1.0 <1.0.0",
|
package/src/build.ts
CHANGED
|
@@ -11,5 +11,6 @@
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
export { logTo, prepare } from './cloudflare'
|
|
14
|
-
export { buildClient, CLIENT_DIST_DIR } from './client'
|
|
14
|
+
export { buildClient, CLIENT_DIST_DIR, resolveClientDir } from './client'
|
|
15
|
+
export type { ClientConfig } from './client'
|
|
15
16
|
export { runWranglerBundle, runWranglerDev } from './wrangler-cli'
|
package/src/client.ts
CHANGED
|
@@ -1,23 +1,51 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* Views still work without a built SPA.
|
|
5
|
-
*/
|
|
1
|
+
/** Client SPA build helpers. The source dir is adapter env config, not domain config. */
|
|
2
|
+
|
|
3
|
+
import type { DomainInfo } from '@astrale-os/sdk'
|
|
6
4
|
|
|
7
5
|
import { spawn } from 'node:child_process'
|
|
8
6
|
import { existsSync } from 'node:fs'
|
|
9
|
-
import { join } from 'node:path'
|
|
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
|
+
}
|
|
10
13
|
|
|
11
|
-
/**
|
|
12
|
-
* Where the adapter expects the built client SPA to land, relative to the
|
|
13
|
-
* project root. This is a contract: the domain's Vite config MUST emit here
|
|
14
|
-
* (`build.outDir`), and the wrangler `assets.directory` binding + the managed
|
|
15
|
-
* deploy's asset reader both look here. Dot-prefixed so the build output sorts
|
|
16
|
-
* out of the way with the other generated dirs (`.astrale`) instead of
|
|
17
|
-
* polluting the middle of the project listing.
|
|
18
|
-
*/
|
|
14
|
+
/** Built client output, relative to the project root. The Vite config must emit here. */
|
|
19
15
|
export const CLIENT_DIST_DIR = '.dist'
|
|
20
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
|
+
|
|
21
49
|
export async function buildClient(
|
|
22
50
|
clientDir: string,
|
|
23
51
|
projectDir: string,
|
|
@@ -28,12 +56,9 @@ export async function buildClient(
|
|
|
28
56
|
join(projectDir, 'node_modules', '.bin', 'vite'),
|
|
29
57
|
].find((p) => existsSync(p))
|
|
30
58
|
if (!viteBin) {
|
|
31
|
-
// The project has a client/ but its deps aren't installed — wrangler would
|
|
32
|
-
// otherwise fail cryptically on the missing built-assets dir. Fail
|
|
33
|
-
// loud with the fix (the client is a workspace package — one install covers it).
|
|
34
59
|
throw new Error(
|
|
35
60
|
`client build: vite not found in ${clientDir}. Run \`pnpm install\` at the project root ` +
|
|
36
|
-
`first
|
|
61
|
+
`first.`,
|
|
37
62
|
)
|
|
38
63
|
}
|
|
39
64
|
const { code, out } = await runCapture(viteBin, ['build'], clientDir, onLog)
|