@astrale-os/adapter-cloudflare 0.5.0-beta.183 → 0.5.0-beta.184
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/closure.d.ts +4 -1
- package/dist/build/closure.js +7 -1
- package/dist/build/worker/codegen/entry.d.ts +0 -1
- package/dist/build/worker/codegen/entry.js +4 -4
- package/dist/build/worker/codegen/service.js +3 -2
- package/dist/build/worker/execution.prepare.js +0 -1
- package/dist/worker/front.d.ts +1 -0
- package/package.json +2 -2
package/dist/build/closure.d.ts
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Prove emitted Worker reachability excludes authoring tooling, compilation, and broad Core Schema
|
|
3
|
+
* owners.
|
|
4
|
+
*/
|
|
2
5
|
export declare function assertRuntimeClosure(metafilePath: string): Promise<void>;
|
package/dist/build/closure.js
CHANGED
|
@@ -8,8 +8,14 @@ const FORBIDDEN_RUNTIME_INPUTS = [
|
|
|
8
8
|
'/core/domain/',
|
|
9
9
|
'/kernel-core/schema/index.',
|
|
10
10
|
'/core/schema/index.',
|
|
11
|
+
// SDK authoring tooling (CLI, lint, packaging) and the scaffold generator.
|
|
12
|
+
'/@astrale-os/sdk/dist/tooling/',
|
|
13
|
+
'/create-astrale-domain/',
|
|
11
14
|
];
|
|
12
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* Prove emitted Worker reachability excludes authoring tooling, compilation, and broad Core Schema
|
|
17
|
+
* owners.
|
|
18
|
+
*/
|
|
13
19
|
export async function assertRuntimeClosure(metafilePath) {
|
|
14
20
|
const metafile = await readWranglerMetafile(metafilePath);
|
|
15
21
|
const forbidden = Object.keys(metafile.inputs).filter((input) => {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { BuildMaterial } from '@astrale-os/sdk/deployment/build';
|
|
2
2
|
export interface ExecutionEntryOptions {
|
|
3
|
-
readonly workerSpecifier?: string;
|
|
4
3
|
readonly frontSpecifier?: string;
|
|
5
4
|
readonly frontend?: BuildMaterial['frontend'];
|
|
6
5
|
readonly frontendRevision?: string;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/** Generate the isolate-startup entry that realizes the heavy Service on first request. */
|
|
2
2
|
export function generateExecutionEntry(serviceSpecifier, options = {}) {
|
|
3
|
-
const workerSpecifier = options.workerSpecifier ?? '@astrale-os/adapter-cloudflare/worker';
|
|
4
3
|
const frontSpecifier = options.frontSpecifier ?? '@astrale-os/adapter-cloudflare/worker/front';
|
|
5
4
|
const configuration = [
|
|
6
5
|
options.frontend === undefined
|
|
@@ -13,12 +12,13 @@ export function generateExecutionEntry(serviceSpecifier, options = {}) {
|
|
|
13
12
|
? ''
|
|
14
13
|
: ` frontendAddressed: ${JSON.stringify(options.frontendAddressed)},\n`,
|
|
15
14
|
].join('');
|
|
15
|
+
// Keep adapter types on the resolved value import: consumers may only depend on adapter-astrale.
|
|
16
|
+
// esbuild subtracts value-import paths from its minifier histogram, but not standalone type
|
|
17
|
+
// imports, so an absolute type-only path would make bundle bytes depend on the checkout.
|
|
16
18
|
return `// AUTO-GENERATED by @astrale-os/adapter-cloudflare — do not edit.
|
|
17
19
|
import type { BuildMaterial } from '@astrale-os/sdk/deployment/build'
|
|
18
|
-
import type { CloudflareWorker } from ${JSON.stringify(workerSpecifier)}
|
|
19
|
-
import type { CloudflareAdapterBindings } from ${JSON.stringify(frontSpecifier)}
|
|
20
20
|
|
|
21
|
-
import { cloudflareFrontDoor } from ${JSON.stringify(frontSpecifier)}
|
|
21
|
+
import { cloudflareFrontDoor, type CloudflareAdapterBindings, type CloudflareWorker } from ${JSON.stringify(frontSpecifier)}
|
|
22
22
|
|
|
23
23
|
type WorkerEnv = CloudflareEnv & CloudflareAdapterBindings
|
|
24
24
|
|
|
@@ -19,12 +19,13 @@ const RESTATE_SPECIFIER = ${JSON.stringify(options.restateSpecifier ?? './restat
|
|
|
19
19
|
const frontend = generated.material.frontend === undefined
|
|
20
20
|
? ''
|
|
21
21
|
: ` frontend: ${JSON.stringify(generated.material.frontend)} as const satisfies NonNullable<BuildMaterial['frontend']>,\n`;
|
|
22
|
+
// Keep adapter types on the resolved value import. A standalone absolute type import leaks
|
|
23
|
+
// checkout characters into esbuild's minifier histogram, making identical Services differ.
|
|
22
24
|
return `// AUTO-GENERATED by @astrale-os/adapter-cloudflare — do not edit.
|
|
23
25
|
// Domain origin: ${options.origin}
|
|
24
26
|
import type { BuildMaterial, GeneratedBuildMaterial } from '@astrale-os/sdk/deployment/build'
|
|
25
|
-
import type { CloudflareAdapterBindings } from ${JSON.stringify(workerSpecifier)}
|
|
26
27
|
|
|
27
|
-
import { generatedCloudflareWorkerEntry } from ${JSON.stringify(workerSpecifier)}
|
|
28
|
+
import { generatedCloudflareWorkerEntry, type CloudflareAdapterBindings } from ${JSON.stringify(workerSpecifier)}
|
|
28
29
|
import { decodeSigningIdentity, deploymentSettings, runtimeBindings } from ${JSON.stringify(workerSpecifier)}
|
|
29
30
|
|
|
30
31
|
${durableImports}
|
|
@@ -81,7 +81,6 @@ export async function prepareExecution(input) {
|
|
|
81
81
|
const sourcePath = join(input.directory, 'worker.gen.ts');
|
|
82
82
|
const frontend = generatedMaterial(input.context.build).material.frontend;
|
|
83
83
|
await writeFile(sourcePath, generateExecutionEntry('./service.mjs', {
|
|
84
|
-
workerSpecifier,
|
|
85
84
|
frontSpecifier: frontModuleSpecifier(),
|
|
86
85
|
...(frontend === undefined ? {} : { frontend }),
|
|
87
86
|
...(input.frontendRevision === undefined ? {} : { frontendRevision: input.frontendRevision }),
|
package/dist/worker/front.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astrale-os/adapter-cloudflare",
|
|
3
|
-
"version": "0.5.0-beta.
|
|
3
|
+
"version": "0.5.0-beta.184",
|
|
4
4
|
"description": "Deploy an Astrale Domain through Cloudflare Workers",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"adapter",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"registry": "https://registry.npmjs.org/"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@astrale-os/sdk": "0.6.0-beta.
|
|
64
|
+
"@astrale-os/sdk": "0.6.0-beta.29",
|
|
65
65
|
"@noble/hashes": "2.3.0",
|
|
66
66
|
"@restatedev/restate-sdk-cloudflare-workers": "1.17.0",
|
|
67
67
|
"hono": "^4.6.20",
|