@astrale-os/adapter-cloudflare 0.5.0-beta.13 → 0.5.0-beta.131
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 +1515 -0
- package/README.md +46 -2
- package/dist/adapter.d.ts +14 -0
- package/dist/adapter.js +82 -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/build/codegen/merge.d.ts +0 -1
- package/dist/build/codegen/merge.js +0 -1
- package/dist/build/codegen/wrangler.d.ts +12 -3
- package/dist/build/codegen/wrangler.js +26 -18
- 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 +90 -0
- package/dist/build/frontend/files.d.ts +9 -0
- package/dist/build/frontend/files.js +33 -0
- package/dist/build/frontend/readiness.d.ts +10 -0
- package/dist/build/frontend/readiness.js +21 -0
- package/dist/build/frontend/revision.d.ts +5 -0
- package/dist/build/frontend/revision.js +14 -0
- package/dist/build/frontend/vite.d.ts +8 -0
- package/dist/build/frontend/vite.js +32 -0
- package/dist/build/frontend/vite.process.d.ts +7 -0
- package/dist/build/frontend/vite.process.js +65 -0
- package/dist/build/frontend/vite.runner.d.ts +1 -0
- package/dist/build/frontend/vite.runner.js +120 -0
- package/dist/build/index.d.ts +9 -16
- package/dist/build/index.js +8 -16
- 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 +19 -0
- package/dist/build/worker/codegen/service.js +53 -0
- package/dist/build/worker/execution.prepare.d.ts +19 -0
- package/dist/build/worker/execution.prepare.js +115 -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 -45
- package/dist/cloudflare.js +1 -202
- package/dist/deploy/deploy.d.ts +17 -0
- package/dist/deploy/deploy.js +221 -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/deploy/readiness.d.ts +5 -0
- package/dist/deploy/readiness.js +18 -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 +10 -9
- package/dist/index.js +10 -9
- package/dist/params.d.ts +40 -36
- 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 +48 -0
- package/dist/worker/entry.js +157 -0
- package/dist/worker/fetch.d.ts +0 -1
- package/dist/worker/fetch.js +0 -1
- package/dist/worker/frontend.d.ts +4 -0
- package/dist/worker/frontend.js +46 -0
- package/dist/worker/identity.d.ts +7 -0
- package/dist/worker/identity.js +23 -0
- package/dist/worker/index.d.ts +2 -61
- package/dist/worker/index.js +2 -218
- package/dist/wrangler/bundle.d.ts +10 -0
- package/dist/wrangler/bundle.js +28 -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 +15 -0
- package/dist/wrangler/process.js +102 -0
- package/dist/wrangler/rollout.d.ts +27 -0
- package/dist/wrangler/rollout.js +75 -0
- package/dist/wrangler/secrets.d.ts +2 -0
- package/dist/wrangler/secrets.js +24 -0
- package/dist/wrangler/status.d.ts +18 -0
- package/dist/wrangler/status.js +75 -0
- package/dist/wrangler/triggers.d.ts +5 -0
- package/dist/wrangler/triggers.js +12 -0
- package/dist/wrangler/type-generation.d.ts +6 -0
- package/dist/wrangler/type-generation.js +19 -0
- package/dist/wrangler/versions.d.ts +13 -0
- package/dist/wrangler/versions.js +38 -0
- package/package.json +34 -19
- package/template/astrale.config.ts +30 -31
- package/dist/build/codegen/identity.d.ts +0 -10
- package/dist/build/codegen/identity.d.ts.map +0 -1
- package/dist/build/codegen/identity.js +0 -32
- package/dist/build/codegen/identity.js.map +0 -1
- package/dist/build/codegen/merge.d.ts.map +0 -1
- package/dist/build/codegen/merge.js.map +0 -1
- package/dist/build/codegen/worker.d.ts +0 -12
- package/dist/build/codegen/worker.d.ts.map +0 -1
- package/dist/build/codegen/worker.js +0 -40
- package/dist/build/codegen/worker.js.map +0 -1
- package/dist/build/codegen/wrangler.d.ts.map +0 -1
- package/dist/build/codegen/wrangler.js.map +0 -1
- package/dist/build/frontend.d.ts +0 -27
- package/dist/build/frontend.d.ts.map +0 -1
- package/dist/build/frontend.js +0 -252
- package/dist/build/frontend.js.map +0 -1
- package/dist/build/index.d.ts.map +0 -1
- package/dist/build/index.js.map +0 -1
- package/dist/build/parse-output.d.ts +0 -27
- package/dist/build/parse-output.d.ts.map +0 -1
- package/dist/build/parse-output.js +0 -58
- package/dist/build/parse-output.js.map +0 -1
- package/dist/build/prepare.d.ts +0 -18
- package/dist/build/prepare.d.ts.map +0 -1
- package/dist/build/prepare.js +0 -138
- package/dist/build/prepare.js.map +0 -1
- package/dist/build/worker.d.ts +0 -15
- package/dist/build/worker.d.ts.map +0 -1
- package/dist/build/worker.js +0 -21
- package/dist/build/worker.js.map +0 -1
- package/dist/build/wrangler-cli.d.ts +0 -88
- package/dist/build/wrangler-cli.d.ts.map +0 -1
- package/dist/build/wrangler-cli.js +0 -283
- package/dist/build/wrangler-cli.js.map +0 -1
- package/dist/cloudflare.d.ts.map +0 -1
- package/dist/cloudflare.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/worker/fetch.d.ts.map +0 -1
- package/dist/worker/fetch.js.map +0 -1
- package/dist/worker/index.d.ts.map +0 -1
- package/dist/worker/index.js.map +0 -1
- package/src/build/codegen/identity.ts +0 -40
- package/src/build/codegen/merge.ts +0 -92
- package/src/build/codegen/worker.ts +0 -53
- package/src/build/codegen/wrangler.ts +0 -128
- package/src/build/frontend.ts +0 -298
- package/src/build/index.ts +0 -29
- package/src/build/parse-output.ts +0 -60
- package/src/build/prepare.ts +0 -189
- package/src/build/worker.ts +0 -37
- package/src/build/wrangler-cli.ts +0 -372
- package/src/cloudflare.ts +0 -275
- package/src/index.ts +0 -21
- package/src/params.ts +0 -92
- package/src/worker/fetch.ts +0 -46
- package/src/worker/index.ts +0 -332
- package/src/worker/tsconfig.json +0 -10
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface WranglerDeploymentStatus {
|
|
2
|
+
readonly deployment: string;
|
|
3
|
+
readonly versions: readonly {
|
|
4
|
+
readonly version: string;
|
|
5
|
+
readonly percentage: number;
|
|
6
|
+
}[];
|
|
7
|
+
}
|
|
8
|
+
interface StatusArgs {
|
|
9
|
+
readonly projectDir: string;
|
|
10
|
+
readonly configPath: string;
|
|
11
|
+
readonly workerName: string;
|
|
12
|
+
readonly signal?: AbortSignal;
|
|
13
|
+
}
|
|
14
|
+
export declare function runWranglerDeploymentStatus(args: StatusArgs): Promise<WranglerDeploymentStatus>;
|
|
15
|
+
/** Only the exact provider missing-Worker response admits first deployment. */
|
|
16
|
+
export declare function observeWranglerDeployment(args: StatusArgs): Promise<WranglerDeploymentStatus | undefined>;
|
|
17
|
+
export declare function admitWranglerDeploymentStatus(output: string): WranglerDeploymentStatus;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { stripVTControlCharacters } from 'node:util';
|
|
2
|
+
import { runCapture, wranglerCommand } from './process.js';
|
|
3
|
+
export async function runWranglerDeploymentStatus(args) {
|
|
4
|
+
const status = await observeWranglerDeployment(args);
|
|
5
|
+
if (status === undefined)
|
|
6
|
+
throw new Error('Cloudflare Worker does not exist.');
|
|
7
|
+
return status;
|
|
8
|
+
}
|
|
9
|
+
/** Only the exact provider missing-Worker response admits first deployment. */
|
|
10
|
+
export async function observeWranglerDeployment(args) {
|
|
11
|
+
const { cmd, prefix } = wranglerCommand(args.projectDir);
|
|
12
|
+
const result = await runCapture(cmd, [
|
|
13
|
+
...prefix,
|
|
14
|
+
'deployments',
|
|
15
|
+
'status',
|
|
16
|
+
'--config',
|
|
17
|
+
args.configPath,
|
|
18
|
+
'--name',
|
|
19
|
+
args.workerName,
|
|
20
|
+
'--json',
|
|
21
|
+
], args.projectDir, undefined, args.signal);
|
|
22
|
+
if (result.code !== 0) {
|
|
23
|
+
const diagnostic = stripVTControlCharacters(result.out);
|
|
24
|
+
const request = `/workers/scripts/${args.workerName}/deployments) failed.`;
|
|
25
|
+
const position = diagnostic.indexOf(request);
|
|
26
|
+
if (position !== -1 &&
|
|
27
|
+
/^\s*This Worker does not exist on your account\. \[code: 10007\](?:\s|$)/u.test(diagnostic.slice(position + request.length)))
|
|
28
|
+
return undefined;
|
|
29
|
+
throw new Error(`wrangler deployments status failed (code ${result.code}):\n${result.out.slice(-2000)}`);
|
|
30
|
+
}
|
|
31
|
+
return admitWranglerDeploymentStatus(result.stdout);
|
|
32
|
+
}
|
|
33
|
+
export function admitWranglerDeploymentStatus(output) {
|
|
34
|
+
let decoded;
|
|
35
|
+
try {
|
|
36
|
+
decoded = JSON.parse(output);
|
|
37
|
+
}
|
|
38
|
+
catch (cause) {
|
|
39
|
+
throw new TypeError('wrangler deployments status returned invalid JSON.', { cause });
|
|
40
|
+
}
|
|
41
|
+
if (decoded === null || typeof decoded !== 'object' || Array.isArray(decoded))
|
|
42
|
+
invalidStatus();
|
|
43
|
+
const deployment = Reflect.get(decoded, 'id');
|
|
44
|
+
const traffic = Reflect.get(decoded, 'versions');
|
|
45
|
+
if (typeof deployment !== 'string' ||
|
|
46
|
+
deployment.length === 0 ||
|
|
47
|
+
!Array.isArray(traffic) ||
|
|
48
|
+
traffic.length === 0 ||
|
|
49
|
+
traffic.length > 2) {
|
|
50
|
+
invalidStatus();
|
|
51
|
+
}
|
|
52
|
+
const versions = traffic.map((entry) => {
|
|
53
|
+
if (entry === null || typeof entry !== 'object' || Array.isArray(entry))
|
|
54
|
+
invalidStatus();
|
|
55
|
+
const version = Reflect.get(entry, 'version_id');
|
|
56
|
+
const percentage = Reflect.get(entry, 'percentage');
|
|
57
|
+
if (typeof version !== 'string' ||
|
|
58
|
+
version.length === 0 ||
|
|
59
|
+
typeof percentage !== 'number' ||
|
|
60
|
+
!Number.isFinite(percentage) ||
|
|
61
|
+
percentage < 0 ||
|
|
62
|
+
percentage > 100) {
|
|
63
|
+
invalidStatus();
|
|
64
|
+
}
|
|
65
|
+
return Object.freeze({ version, percentage });
|
|
66
|
+
});
|
|
67
|
+
if (new Set(versions.map(({ version }) => version)).size !== versions.length ||
|
|
68
|
+
versions.reduce((total, { percentage }) => total + percentage, 0) !== 100) {
|
|
69
|
+
invalidStatus();
|
|
70
|
+
}
|
|
71
|
+
return Object.freeze({ deployment, versions: Object.freeze(versions) });
|
|
72
|
+
}
|
|
73
|
+
function invalidStatus() {
|
|
74
|
+
throw new TypeError('wrangler deployments status returned invalid deployment evidence.');
|
|
75
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { DeployArgs } from './deploy.js';
|
|
2
|
+
/** Wrangler owns account selection, stable addressing, and non-versioned trigger reconciliation. */
|
|
3
|
+
export declare function deployWranglerTriggers(args: DeployArgs & {
|
|
4
|
+
readonly projectDir: string;
|
|
5
|
+
}): Promise<string | undefined>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { parseDeployUrl } from '../deploy/output.js';
|
|
2
|
+
import { runCapture, wranglerCommand } from './process.js';
|
|
3
|
+
import { secretRedactor } from './secrets.js';
|
|
4
|
+
/** Wrangler owns account selection, stable addressing, and non-versioned trigger reconciliation. */
|
|
5
|
+
export async function deployWranglerTriggers(args) {
|
|
6
|
+
const { cmd, prefix } = wranglerCommand(args.projectDir);
|
|
7
|
+
const result = await runCapture(cmd, [...prefix, 'triggers', 'deploy', '--config', args.configPath], args.projectDir, args.onLog, args.signal, secretRedactor(args.secrets ?? {}));
|
|
8
|
+
if (result.code !== 0) {
|
|
9
|
+
throw new Error(`wrangler triggers deploy failed (code ${result.code}):\n${result.out.slice(-2000)}`);
|
|
10
|
+
}
|
|
11
|
+
return parseDeployUrl(result.out, args.route);
|
|
12
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { dirname, join } from 'node:path';
|
|
2
|
+
import { runCapture, wranglerCommand } from './process.js';
|
|
3
|
+
export async function runWranglerTypes(args) {
|
|
4
|
+
const { cmd, prefix } = wranglerCommand(args.projectDir);
|
|
5
|
+
const outputPath = join(dirname(args.configPath), 'worker-configuration.d.ts');
|
|
6
|
+
const { code, out } = await runCapture(cmd, [
|
|
7
|
+
...prefix,
|
|
8
|
+
'types',
|
|
9
|
+
outputPath,
|
|
10
|
+
'--env-interface',
|
|
11
|
+
'CloudflareEnv',
|
|
12
|
+
'--config',
|
|
13
|
+
args.configPath,
|
|
14
|
+
], args.projectDir, args.onLog, args.signal);
|
|
15
|
+
if (code !== 0) {
|
|
16
|
+
throw new Error(`wrangler types failed (code ${code}):\n${out.slice(-2000)}`);
|
|
17
|
+
}
|
|
18
|
+
return outputPath;
|
|
19
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type DeployArgs } from './deploy.js';
|
|
2
|
+
export declare function uploadWranglerVersion(args: DeployArgs & {
|
|
3
|
+
readonly projectDir: string;
|
|
4
|
+
}): Promise<string>;
|
|
5
|
+
export declare function deployWranglerVersions(args: {
|
|
6
|
+
readonly projectDir: string;
|
|
7
|
+
readonly configPath: string;
|
|
8
|
+
readonly versions: readonly {
|
|
9
|
+
readonly version: string;
|
|
10
|
+
readonly percentage: number;
|
|
11
|
+
}[];
|
|
12
|
+
readonly signal?: AbortSignal;
|
|
13
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { parseDeployVersionId } from '../deploy/output.js';
|
|
2
|
+
import { WranglerDeployError } from './deploy.js';
|
|
3
|
+
import { runCapture, wranglerCommand } from './process.js';
|
|
4
|
+
import { secretRedactor, withSecretsFile } from './secrets.js';
|
|
5
|
+
import { runWranglerTypes } from './type-generation.js';
|
|
6
|
+
export async function uploadWranglerVersion(args) {
|
|
7
|
+
await runWranglerTypes(args);
|
|
8
|
+
const { cmd, prefix } = wranglerCommand(args.projectDir);
|
|
9
|
+
const secrets = args.secrets ?? {};
|
|
10
|
+
const result = await withSecretsFile(secrets, (path) => runCapture(cmd, [
|
|
11
|
+
...prefix,
|
|
12
|
+
'versions',
|
|
13
|
+
'upload',
|
|
14
|
+
'--config',
|
|
15
|
+
args.configPath,
|
|
16
|
+
...(path === undefined ? [] : ['--secrets-file', path]),
|
|
17
|
+
], args.projectDir, args.onLog, args.signal, secretRedactor(secrets)));
|
|
18
|
+
const deploymentVersion = parseDeployVersionId(result.out);
|
|
19
|
+
if (result.code !== 0 || deploymentVersion === undefined) {
|
|
20
|
+
throw new WranglerDeployError(`wrangler versions upload failed to establish candidate evidence (code ${result.code}):\n${result.out.slice(-2000)}`, deploymentVersion === undefined ? undefined : { deploymentVersion });
|
|
21
|
+
}
|
|
22
|
+
return deploymentVersion;
|
|
23
|
+
}
|
|
24
|
+
export async function deployWranglerVersions(args) {
|
|
25
|
+
const { cmd, prefix } = wranglerCommand(args.projectDir);
|
|
26
|
+
const result = await runCapture(cmd, [
|
|
27
|
+
...prefix,
|
|
28
|
+
'versions',
|
|
29
|
+
'deploy',
|
|
30
|
+
...args.versions.map(({ version, percentage }) => `${version}@${percentage}`),
|
|
31
|
+
'--config',
|
|
32
|
+
args.configPath,
|
|
33
|
+
'--yes',
|
|
34
|
+
], args.projectDir, undefined, args.signal);
|
|
35
|
+
if (result.code !== 0) {
|
|
36
|
+
throw new Error(`wrangler versions deploy failed (code ${result.code}):\n${result.out.slice(-2000)}`);
|
|
37
|
+
}
|
|
38
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astrale-os/adapter-cloudflare",
|
|
3
|
-
"version": "0.5.0-beta.
|
|
4
|
-
"description": "Deploy an Astrale
|
|
3
|
+
"version": "0.5.0-beta.131",
|
|
4
|
+
"description": "Deploy an Astrale application through Cloudflare Workers",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"adapter",
|
|
7
7
|
"astrale",
|
|
@@ -11,16 +11,21 @@
|
|
|
11
11
|
],
|
|
12
12
|
"license": "Apache-2.0",
|
|
13
13
|
"author": "Astrale",
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/astrale-os/sdk.git"
|
|
17
|
+
},
|
|
14
18
|
"files": [
|
|
15
19
|
"dist",
|
|
16
|
-
"
|
|
20
|
+
"!dist/**/*.map",
|
|
17
21
|
"template",
|
|
18
|
-
"!template
|
|
19
|
-
"!template
|
|
22
|
+
"!template/**/node_modules",
|
|
23
|
+
"!template/**/node_modules/**",
|
|
24
|
+
"!template/**/pnpm-lock.yaml"
|
|
20
25
|
],
|
|
21
26
|
"type": "module",
|
|
22
|
-
"main": "./
|
|
23
|
-
"types": "./
|
|
27
|
+
"main": "./dist/index.js",
|
|
28
|
+
"types": "./dist/index.d.ts",
|
|
24
29
|
"exports": {
|
|
25
30
|
".": {
|
|
26
31
|
"types": "./dist/index.d.ts",
|
|
@@ -30,38 +35,48 @@
|
|
|
30
35
|
"types": "./dist/build/index.d.ts",
|
|
31
36
|
"import": "./dist/build/index.js"
|
|
32
37
|
},
|
|
38
|
+
"./identity": {
|
|
39
|
+
"types": "./dist/identity/index.d.ts",
|
|
40
|
+
"import": "./dist/identity/index.js"
|
|
41
|
+
},
|
|
33
42
|
"./worker": {
|
|
34
43
|
"types": "./dist/worker/index.d.ts",
|
|
35
44
|
"import": "./dist/worker/index.js"
|
|
36
45
|
},
|
|
46
|
+
"./release": {
|
|
47
|
+
"types": "./dist/release/index.d.ts",
|
|
48
|
+
"import": "./dist/release/index.js"
|
|
49
|
+
},
|
|
37
50
|
"./package.json": "./package.json"
|
|
38
51
|
},
|
|
52
|
+
"publishConfig": {
|
|
53
|
+
"registry": "https://registry.npmjs.org/"
|
|
54
|
+
},
|
|
39
55
|
"dependencies": {
|
|
40
|
-
"@astrale-os/
|
|
41
|
-
"@
|
|
56
|
+
"@astrale-os/sdk": "0.5.0-beta.128",
|
|
57
|
+
"@noble/hashes": "2.3.0",
|
|
42
58
|
"hono": "^4.6.20",
|
|
43
59
|
"jose": "^6.1.3",
|
|
44
|
-
"
|
|
60
|
+
"wrangler": "4.123.0"
|
|
45
61
|
},
|
|
46
62
|
"devDependencies": {
|
|
47
|
-
"@astrale-os/ox": "
|
|
63
|
+
"@astrale-os/ox": "0.1.3",
|
|
48
64
|
"@types/node": "^22.0.0",
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"wrangler": "4.121.0"
|
|
65
|
+
"oxfmt": "0.63.0",
|
|
66
|
+
"oxlint": "1.78.0",
|
|
67
|
+
"typescript": "7.0.2",
|
|
68
|
+
"vitest": "^4.1.10",
|
|
69
|
+
"zod": "4.4.3"
|
|
55
70
|
},
|
|
56
71
|
"engines": {
|
|
57
72
|
"node": ">=22"
|
|
58
73
|
},
|
|
59
74
|
"scripts": {
|
|
60
|
-
"typecheck": "
|
|
75
|
+
"typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.test.json && tsc --noEmit -p __tests__/tsconfig.types.json",
|
|
61
76
|
"test": "vitest run",
|
|
62
77
|
"lint": "oxlint --disable-nested-config .",
|
|
63
78
|
"format": "pnpm exec oxfmt --write .",
|
|
64
79
|
"format:check": "pnpm exec oxfmt --check .",
|
|
65
|
-
"build": "rm -rf dist &&
|
|
80
|
+
"build": "rm -rf dist && tsc && node ../scripts/verify-no-source-maps.mjs dist"
|
|
66
81
|
}
|
|
67
82
|
}
|
|
@@ -1,37 +1,36 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* adapter for the `astrale-domain` CLI. This is a NODE-only module: it imports
|
|
4
|
-
* the adapter (wrangler + filesystem). The generated worker never imports this
|
|
5
|
-
* file — it imports `implementation.ts` directly — so the adapter stays out of the bundle.
|
|
2
|
+
* One Project definition, with explicit software-factory Environments.
|
|
6
3
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* astrale domain install <url> --direct # mount the dev URL on an instance
|
|
11
|
-
* pnpm prod # deploy to your Cloudflare account
|
|
4
|
+
* `pnpm dev` watches and deploys the development Environment remotely. These
|
|
5
|
+
* Environments are deploy-only; add `installation: { instance: '...' }` when a
|
|
6
|
+
* deployed Release should also be reconciled onto an Astrale Kernel.
|
|
12
7
|
*/
|
|
13
8
|
import { cloudflare } from '@astrale-os/adapter-cloudflare'
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
9
|
+
import { defineProject } from '@astrale-os/sdk/project'
|
|
10
|
+
import { dataset, tests } from '@astrale-os/sdk/testing'
|
|
11
|
+
|
|
12
|
+
import { application } from './application.js'
|
|
13
|
+
|
|
14
|
+
export default defineProject({
|
|
15
|
+
application,
|
|
16
|
+
|
|
17
|
+
environments: {
|
|
18
|
+
development: {
|
|
19
|
+
deployment: cloudflare({
|
|
20
|
+
secrets: '.env.dev',
|
|
21
|
+
signingIdentity: '.astrale/identity.json',
|
|
22
|
+
}),
|
|
23
|
+
},
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
production: {
|
|
26
|
+
deployment: cloudflare({
|
|
27
|
+
route: 'astrale-domain.example.dev',
|
|
28
|
+
signingIdentity: '.astrale/identity.json',
|
|
29
|
+
}),
|
|
30
|
+
},
|
|
31
|
+
},
|
|
26
32
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
dev: { secrets: '.env.dev' },
|
|
32
|
-
// Custom-domain prod. Drop `route` to ship to *.workers.dev instead.
|
|
33
|
-
prod: { route: 'astrale-domain.example.dev', secrets: '.env.prod' },
|
|
34
|
-
// Author secrets ship via `secrets: '.env.prod'` on any env. Extra bindings
|
|
35
|
-
// (KV, R2, D1, queues, …) ride a `wrangler` block on any env (deep-merged).
|
|
36
|
-
}),
|
|
37
|
-
)
|
|
33
|
+
// Test resources belong to the Project. CI selects an Environment and named
|
|
34
|
+
// suite when a test execution needs a live deployment.
|
|
35
|
+
tests: tests({ datasets: [dataset('./tests/datasets/demo.ts')] }),
|
|
36
|
+
})
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Ensure the domain has a stable Ed25519 signing identity at
|
|
3
|
-
* `.astrale/identity.ts`. Generated ONCE (first `dev`/`deploy` or by the
|
|
4
|
-
* scaffolder) and never regenerated — the private key IS the domain's identity,
|
|
5
|
-
* so rotating it would orphan every instance that installed the old key. The
|
|
6
|
-
* file is gitignored; for real production this key should graduate to a managed
|
|
7
|
-
* secret.
|
|
8
|
-
*/
|
|
9
|
-
export declare function ensureIdentity(astraleDir: string, origin: string): Promise<void>;
|
|
10
|
-
//# sourceMappingURL=identity.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../../src/build/codegen/identity.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAOH,wBAAsB,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAyBtF"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Ensure the domain has a stable Ed25519 signing identity at
|
|
3
|
-
* `.astrale/identity.ts`. Generated ONCE (first `dev`/`deploy` or by the
|
|
4
|
-
* scaffolder) and never regenerated — the private key IS the domain's identity,
|
|
5
|
-
* so rotating it would orphan every instance that installed the old key. The
|
|
6
|
-
* file is gitignored; for real production this key should graduate to a managed
|
|
7
|
-
* secret.
|
|
8
|
-
*/
|
|
9
|
-
import { exportJWK, generateKeyPair } from 'jose';
|
|
10
|
-
import { existsSync } from 'node:fs';
|
|
11
|
-
import { mkdir, writeFile } from 'node:fs/promises';
|
|
12
|
-
import { join } from 'node:path';
|
|
13
|
-
export async function ensureIdentity(astraleDir, origin) {
|
|
14
|
-
const file = join(astraleDir, 'identity.ts');
|
|
15
|
-
if (existsSync(file))
|
|
16
|
-
return;
|
|
17
|
-
const { privateKey } = await generateKeyPair('EdDSA', { extractable: true });
|
|
18
|
-
const jwk = (await exportJWK(privateKey));
|
|
19
|
-
jwk.alg = 'EdDSA';
|
|
20
|
-
jwk.kid = `${origin}-key`;
|
|
21
|
-
await mkdir(astraleDir, { recursive: true });
|
|
22
|
-
await writeFile(file, `// AUTO-GENERATED stable signing identity for "${origin}" — do not edit, do not commit.\n` +
|
|
23
|
-
`export const PRIVATE_JWK = ${JSON.stringify(jwk, null, 2)} as const\n`);
|
|
24
|
-
// Loud on purpose: the file is gitignored, so a fresh clone / CI runner
|
|
25
|
-
// silently mints a NEW key — and a redeploy with a new key breaks JWKS
|
|
26
|
-
// verification on every instance that installed the old one, with no hint
|
|
27
|
-
// why. Make the lifecycle visible the one time it happens.
|
|
28
|
-
process.stderr.write(`\x1b[33m!\x1b[0m new signing identity generated at .astrale/identity.ts (kid ${String(jwk.kid)}).\n` +
|
|
29
|
-
` This key IS "${origin}"'s identity: back it up (or move it to a managed secret) —\n` +
|
|
30
|
-
` deploying from another machine without it re-keys the domain and breaks existing installs.\n`);
|
|
31
|
-
}
|
|
32
|
-
//# sourceMappingURL=identity.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"identity.js","sourceRoot":"","sources":["../../../src/build/codegen/identity.ts"],"names":[],"mappings":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C,MAAM,CAAC;QACP,OAAO,OAAO,MAAM,CAAC,IAAI,CAAC,EAAE,CAAA;IAC9B,CAAC;AACH,CAAC;AAED,SAAS,aAAa,CAAC,CAAU;IAC/B,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;AACjE,CAAC;AAED,SAAS,WAAW,CAAC,CAAU;IAC7B,OAAO,CAAC,KAAK,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,OAAO,CAAC,KAAK,UAAU,CAAC,CAAA;AACzE,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/** Codegen for the Cloudflare module entry owned by the adapter. */
|
|
2
|
-
export interface WorkerCodegenOptions {
|
|
3
|
-
readonly origin: string;
|
|
4
|
-
/** Optional same-zone routing service selected by the adapter environment. */
|
|
5
|
-
readonly router?: {
|
|
6
|
-
readonly binding: string;
|
|
7
|
-
readonly hostSuffix: string;
|
|
8
|
-
readonly minLabels: number;
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
export declare function generateWorkerEntry(options: WorkerCodegenOptions): string;
|
|
12
|
-
//# sourceMappingURL=worker.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../../../src/build/codegen/worker.ts"],"names":[],"mappings":"AAAA,oEAAoE;AAEpE,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,8EAA8E;IAC9E,QAAQ,CAAC,MAAM,CAAC,EAAE;QAChB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;QACxB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;QAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;KAC3B,CAAA;CACF;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,oBAAoB,GAAG,MAAM,CAwCzE"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/** Codegen for the Cloudflare module entry owned by the adapter. */
|
|
2
|
-
export function generateWorkerEntry(options) {
|
|
3
|
-
const router = options.router;
|
|
4
|
-
const routerPredicate = router === undefined
|
|
5
|
-
? ''
|
|
6
|
-
: `
|
|
7
|
-
function isInstanceHost(host: string): boolean {
|
|
8
|
-
return host.endsWith('${router.hostSuffix}') && host.split('.').length >= ${router.minLabels}
|
|
9
|
-
}
|
|
10
|
-
`;
|
|
11
|
-
const routeSubrequest = router === undefined
|
|
12
|
-
? ''
|
|
13
|
-
: `
|
|
14
|
-
routeSubrequest: (url, env) => {
|
|
15
|
-
const labels = url.hostname.split('.')
|
|
16
|
-
if (env.DISPATCHER && labels[1] === 'svc') return env.DISPATCHER.get(labels[0]!)
|
|
17
|
-
if (env.${router.binding} && isInstanceHost(url.hostname)) return env.${router.binding}
|
|
18
|
-
return null
|
|
19
|
-
},`;
|
|
20
|
-
return `// AUTO-GENERATED by @astrale-os/adapter-cloudflare — do not edit.
|
|
21
|
-
// Regenerated by every Astrale Domain build, dev, and deploy operation.
|
|
22
|
-
// Domain origin: ${options.origin}
|
|
23
|
-
import type { CloudflareAdapterBindings } from '@astrale-os/adapter-cloudflare/worker'
|
|
24
|
-
import type { ApplicationEnvironment } from '../implementation.js'
|
|
25
|
-
|
|
26
|
-
import { cloudflareWorkerEntry } from '@astrale-os/adapter-cloudflare/worker'
|
|
27
|
-
import { domain } from '../implementation.js'
|
|
28
|
-
import { PRIVATE_JWK } from './identity.js'
|
|
29
|
-
|
|
30
|
-
type WorkerEnv = CloudflareEnv & ApplicationEnvironment & CloudflareAdapterBindings
|
|
31
|
-
${routerPredicate}
|
|
32
|
-
export default cloudflareWorkerEntry<WorkerEnv>()({
|
|
33
|
-
definition: domain,
|
|
34
|
-
privateKey: PRIVATE_JWK,
|
|
35
|
-
resolveUrl: (env, requestOrigin) => env.WORKER_URL ?? requestOrigin,
|
|
36
|
-
selfBinding: (env) => env.SELF,${routeSubrequest}
|
|
37
|
-
})
|
|
38
|
-
`;
|
|
39
|
-
}
|
|
40
|
-
//# sourceMappingURL=worker.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"worker.js","sourceRoot":"","sources":["../../../src/build/codegen/worker.ts"],"names":[],"mappings":"AAAA,oEAAoE;AAYpE,MAAM,UAAU,mBAAmB,CAAC,OAA6B;IAC/D,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAA;IAC7B,MAAM,eAAe,GACnB,MAAM,KAAK,SAAS;QAClB,CAAC,CAAC,EAAE;QACJ,CAAC,CAAC;;0BAEkB,MAAM,CAAC,UAAU,mCAAmC,MAAM,CAAC,SAAS;;CAE7F,CAAA;IACC,MAAM,eAAe,GACnB,MAAM,KAAK,SAAS;QAClB,CAAC,CAAC,EAAE;QACJ,CAAC,CAAC;;;;cAIM,MAAM,CAAC,OAAO,gDAAgD,MAAM,CAAC,OAAO;;KAErF,CAAA;IAEH,OAAO;;oBAEW,OAAO,CAAC,MAAM;;;;;;;;;EAShC,eAAe;;;;;mCAKkB,eAAe;;CAEjD,CAAA;AACD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"wrangler.d.ts","sourceRoot":"","sources":["../../../src/build/codegen/wrangler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,MAAM,CAAA;IAClB,sEAAsE;IACtE,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,0EAA0E;IAC1E,QAAQ,CAAC,EAAE;QACT,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;QAC1B,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAA;QAClC,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAA;KACtB,CAAA;IACD,0CAA0C;IAC1C,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAA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ACN,QAAQ;IACR,QAAQ;IACR,oBAAoB;IACpB,kBAAkB;CACnB,CAAA;AAED;;;;GAIG;AACH,SAAS,eAAe,CACtB,IAA6B,EAC7B,IAA6B;IAE7B,MAAM,UAAU,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,IAAI,CAAC,CAAA;IAC9D,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CACb,qDAAqD,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI;YAC5E,gEAAgE;YAChE,mDAAmD,CACtD,CAAA;IACH,CAAC;IACD,OAAO,eAAe,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;AACpC,CAAC"}
|
package/dist/build/frontend.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { CompiledFrontendArtifact, DomainDefinition } from '@astrale-os/sdk';
|
|
2
|
-
export declare const FRONTEND_STAGE_DIR = ".astrale/frontend";
|
|
3
|
-
export interface ViteBuildInput {
|
|
4
|
-
readonly projectDir: string;
|
|
5
|
-
readonly output: string;
|
|
6
|
-
readonly config?: string;
|
|
7
|
-
readonly onLog?: (line: string) => void;
|
|
8
|
-
}
|
|
9
|
-
export type ViteBuild = (input: ViteBuildInput) => Promise<void>;
|
|
10
|
-
/** Materialize one Domain-owned frontend recipe into an immutable adapter artifact. */
|
|
11
|
-
export declare function buildFrontend(input: {
|
|
12
|
-
readonly definition: DomainDefinition;
|
|
13
|
-
readonly projectDir: string;
|
|
14
|
-
readonly onLog?: (line: string) => void;
|
|
15
|
-
readonly buildVite?: ViteBuild;
|
|
16
|
-
}): Promise<CompiledFrontendArtifact | undefined>;
|
|
17
|
-
export interface FrontendDevHandle {
|
|
18
|
-
readonly url: string;
|
|
19
|
-
stop(): Promise<void>;
|
|
20
|
-
}
|
|
21
|
-
/** Start the Domain project's own Vite server; the Worker remains the browser-facing origin. */
|
|
22
|
-
export declare function startFrontendDev(input: {
|
|
23
|
-
readonly definition: DomainDefinition;
|
|
24
|
-
readonly projectDir: string;
|
|
25
|
-
readonly onLog?: (line: string) => void;
|
|
26
|
-
}): Promise<FrontendDevHandle | undefined>;
|
|
27
|
-
//# sourceMappingURL=frontend.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"frontend.d.ts","sourceRoot":"","sources":["../../src/build/frontend.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,gBAAgB,EAAgB,MAAM,iBAAiB,CAAA;AAU/F,eAAO,MAAM,kBAAkB,sBAAsB,CAAA;AAKrD,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;CACxC;AAED,MAAM,MAAM,SAAS,GAAG,CAAC,KAAK,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;AAEhE,uFAAuF;AACvF,wBAAsB,aAAa,CAAC,KAAK,EAAE;IACzC,QAAQ,CAAC,UAAU,EAAE,gBAAgB,CAAA;IACrC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IACvC,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,CAAA;CAC/B,GAAG,OAAO,CAAC,wBAAwB,GAAG,SAAS,CAAC,CAgBhD;AAoCD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CACtB;AAED,gGAAgG;AAChG,wB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