@astrale-os/adapter-cloudflare 0.5.0-beta.71 → 0.5.0-beta.72
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 +14 -0
- package/README.md +4 -0
- package/dist/adapter.d.ts +2 -4
- package/dist/adapter.js +5 -106
- package/dist/build/artifact.js +7 -5
- package/dist/build/{frontend-v1.d.ts → frontend/files.d.ts} +0 -9
- package/dist/build/frontend/files.js +60 -0
- package/dist/build/index.d.ts +2 -2
- package/dist/build/index.js +2 -2
- package/dist/build/worker/execution.prepare.js +1 -1
- package/dist/deploy/deploy.d.ts +2 -1
- package/dist/deploy/deploy.js +1 -1
- package/dist/deploy/output.d.ts +2 -0
- package/dist/deploy/output.js +10 -0
- package/dist/development/develop.d.ts +15 -0
- package/dist/development/develop.js +267 -0
- package/dist/development/frontend.d.ts +11 -0
- package/dist/{build/frontend-v1.js → development/frontend.js} +31 -55
- package/dist/development/host.d.ts +2 -0
- package/dist/development/host.js +46 -0
- package/dist/development/port.d.ts +1 -0
- package/dist/development/port.js +12 -0
- package/dist/development/readiness.d.ts +14 -0
- package/dist/development/readiness.js +71 -0
- package/dist/development/resolved-fetch.d.ts +18 -0
- package/dist/development/resolved-fetch.js +78 -0
- package/dist/development/worker-output.d.ts +2 -0
- package/dist/development/worker-output.js +25 -0
- package/dist/{build/wrangler/development.d.ts → development/worker.d.ts} +5 -5
- package/dist/{build/wrangler/development.js → development/worker.js} +24 -13
- package/dist/identity/source.js +37 -8
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/params.d.ts +3 -3
- package/dist/{build/wrangler → wrangler}/bundle.js +0 -2
- package/dist/{build/wrangler → wrangler}/deploy.js +1 -1
- package/dist/wrangler/index.d.ts +5 -0
- package/dist/wrangler/index.js +5 -0
- package/package.json +2 -2
- package/template/astrale.config.ts +6 -6
- package/dist/build/parse-output.d.ts +0 -26
- package/dist/build/parse-output.js +0 -57
- package/dist/build/wrangler-cli.d.ts +0 -6
- package/dist/build/wrangler-cli.js +0 -6
- /package/dist/{build/wrangler → wrangler}/bundle.d.ts +0 -0
- /package/dist/{build/wrangler → wrangler}/deploy.d.ts +0 -0
- /package/dist/{build/wrangler → wrangler}/process.d.ts +0 -0
- /package/dist/{build/wrangler → wrangler}/process.js +0 -0
- /package/dist/{build/wrangler → wrangler}/secrets.d.ts +0 -0
- /package/dist/{build/wrangler → wrangler}/secrets.js +0 -0
- /package/dist/{build/wrangler → wrangler}/status.d.ts +0 -0
- /package/dist/{build/wrangler → wrangler}/status.js +0 -0
- /package/dist/{build/wrangler → wrangler}/type-generation.d.ts +0 -0
- /package/dist/{build/wrangler → wrangler}/type-generation.js +0 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { runWranglerBundle } from './bundle.js';
|
|
2
|
+
export { runWranglerDeploy, WranglerDeployError } from './deploy.js';
|
|
3
|
+
export { wranglerProcessEnv } from './process.js';
|
|
4
|
+
export { admitWranglerDeploymentStatus, runWranglerDeploymentStatus, } from './status.js';
|
|
5
|
+
export { runWranglerTypes } from './type-generation.js';
|
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.72",
|
|
4
4
|
"description": "Deploy an Astrale application through Cloudflare Workers",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"adapter",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"registry": "https://registry.npmjs.org/"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@astrale-os/sdk": "0.5.0-beta.
|
|
52
|
+
"@astrale-os/sdk": "0.5.0-beta.69",
|
|
53
53
|
"@noble/hashes": "2.3.0",
|
|
54
54
|
"hono": "^4.6.20",
|
|
55
55
|
"jose": "^6.1.3",
|
|
@@ -7,9 +7,8 @@
|
|
|
7
7
|
*
|
|
8
8
|
* This variant deploys to YOUR OWN Cloudflare account (the `cloudflare` adapter).
|
|
9
9
|
*
|
|
10
|
-
* pnpm dev
|
|
11
|
-
*
|
|
12
|
-
* pnpm prod # deploy to your Cloudflare account
|
|
10
|
+
* pnpm dev # local Worker + Vite HMR on allocated ports
|
|
11
|
+
* pnpm prod # deploy to your Cloudflare account
|
|
13
12
|
*/
|
|
14
13
|
import { cloudflare } from '@astrale-os/adapter-cloudflare'
|
|
15
14
|
import { deploy, runtime } from '@astrale-os/sdk/deployment'
|
|
@@ -19,8 +18,8 @@ import { deploy, runtime } from '@astrale-os/sdk/deployment'
|
|
|
19
18
|
//
|
|
20
19
|
// import { astrale } from '@astrale-os/adapter-astrale'
|
|
21
20
|
// export default deploy({ application, entrypoint: runtime('./runtime.ts'), adapter: astrale({
|
|
22
|
-
// dev: { secrets: '.env.dev' }, //
|
|
23
|
-
// prod: { instance: '<your-instance-slug>' }, // managed deploy
|
|
21
|
+
// dev: { secrets: '.env.dev' }, // tunnel + install + View
|
|
22
|
+
// prod: { instance: '<your-instance-slug>' }, // managed deploy + install
|
|
24
23
|
// }) })
|
|
25
24
|
|
|
26
25
|
import { application } from './application.js'
|
|
@@ -29,7 +28,8 @@ export default deploy({
|
|
|
29
28
|
application,
|
|
30
29
|
entrypoint: runtime('./runtime.ts'),
|
|
31
30
|
adapter: cloudflare({
|
|
32
|
-
// Local dev:
|
|
31
|
+
// Local dev: allocated Worker/Vite ports, one Worker-facing URL, and HMR.
|
|
32
|
+
// Supply `pnpm dev --host <origin> --port <port>` for ingress you own.
|
|
33
33
|
dev: { secrets: '.env.dev' },
|
|
34
34
|
// Custom-domain prod. Drop `route` to ship to *.workers.dev instead.
|
|
35
35
|
// The scaffold creates this identity once. Retain it in managed secret
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Pure parsers for `wrangler` stdout. Kept separate from the process-spawning in
|
|
3
|
-
* `wrangler-cli.ts` so the brittle bit — scraping wrangler's human output — is
|
|
4
|
-
* unit-testable against captured fixtures without shelling out.
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Local dev URL from `wrangler dev` output, normalized to an origin on the given
|
|
8
|
-
* port. Returns `undefined` when the output hasn't reported readiness yet.
|
|
9
|
-
*
|
|
10
|
-
* The fallback (when no explicit "Ready on" line) only accepts a localhost URL
|
|
11
|
-
* on the EXPECTED port — wrangler may print unrelated localhost URLs (e.g. an
|
|
12
|
-
* inspector/devtools endpoint on a different port) before readiness, and taking
|
|
13
|
-
* one of those would point `astrale domain install <url>` at a dead endpoint.
|
|
14
|
-
*/
|
|
15
|
-
export declare function parseDevReadyUrl(text: string, port: number): string | undefined;
|
|
16
|
-
/**
|
|
17
|
-
* Authoritative public URL from `wrangler deploy` output. A custom-domain
|
|
18
|
-
* `route` wins (the deploy attaches it); otherwise the printed `*.workers.dev`
|
|
19
|
-
* URL. Returns `undefined` when neither is available (caller surfaces the raw
|
|
20
|
-
* output).
|
|
21
|
-
*/
|
|
22
|
-
export declare function parseDeployUrl(text: string, route?: string): string | undefined;
|
|
23
|
-
/** Cloudflare version published by the final Wrangler deploy pass. */
|
|
24
|
-
export declare function parseDeployVersionId(text: string): string | undefined;
|
|
25
|
-
/** Normalize a local dev URL to an origin: `0.0.0.0` → `localhost`, fill the port. */
|
|
26
|
-
export declare function normalizeLocal(url: string, port: number): string;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Pure parsers for `wrangler` stdout. Kept separate from the process-spawning in
|
|
3
|
-
* `wrangler-cli.ts` so the brittle bit — scraping wrangler's human output — is
|
|
4
|
-
* unit-testable against captured fixtures without shelling out.
|
|
5
|
-
*/
|
|
6
|
-
const READY_RE = /(?:Ready on|Listening on|⎔.*?at)\s+(https?:\/\/[^\s]+)/i;
|
|
7
|
-
const WORKERS_DEV_RE = /(https:\/\/[^\s]+\.workers\.dev)/i;
|
|
8
|
-
const VERSION_ID_RE = /(?:Current\s+)?Version ID:\s*([a-z0-9_-]+)/i;
|
|
9
|
-
/**
|
|
10
|
-
* Local dev URL from `wrangler dev` output, normalized to an origin on the given
|
|
11
|
-
* port. Returns `undefined` when the output hasn't reported readiness yet.
|
|
12
|
-
*
|
|
13
|
-
* The fallback (when no explicit "Ready on" line) only accepts a localhost URL
|
|
14
|
-
* on the EXPECTED port — wrangler may print unrelated localhost URLs (e.g. an
|
|
15
|
-
* inspector/devtools endpoint on a different port) before readiness, and taking
|
|
16
|
-
* one of those would point `astrale domain install <url>` at a dead endpoint.
|
|
17
|
-
*/
|
|
18
|
-
export function parseDevReadyUrl(text, port) {
|
|
19
|
-
const ready = READY_RE.exec(text);
|
|
20
|
-
if (ready)
|
|
21
|
-
return normalizeLocal(ready[1], port);
|
|
22
|
-
// `port` is a number, so it's safe to interpolate into the pattern. The
|
|
23
|
-
// negative lookahead stops `:8787` from matching inside `:87870`.
|
|
24
|
-
const localhostOnPort = new RegExp(`(https?://(?:localhost|127\\.0\\.0\\.1):${port})(?![0-9])`, 'i');
|
|
25
|
-
const m = localhostOnPort.exec(text);
|
|
26
|
-
return m ? normalizeLocal(m[1], port) : undefined;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Authoritative public URL from `wrangler deploy` output. A custom-domain
|
|
30
|
-
* `route` wins (the deploy attaches it); otherwise the printed `*.workers.dev`
|
|
31
|
-
* URL. Returns `undefined` when neither is available (caller surfaces the raw
|
|
32
|
-
* output).
|
|
33
|
-
*/
|
|
34
|
-
export function parseDeployUrl(text, route) {
|
|
35
|
-
if (route)
|
|
36
|
-
return `https://${route.replace(/\/.*$/, '')}`;
|
|
37
|
-
const m = WORKERS_DEV_RE.exec(text);
|
|
38
|
-
return m ? m[1] : undefined;
|
|
39
|
-
}
|
|
40
|
-
/** Cloudflare version published by the final Wrangler deploy pass. */
|
|
41
|
-
export function parseDeployVersionId(text) {
|
|
42
|
-
return VERSION_ID_RE.exec(text)?.[1];
|
|
43
|
-
}
|
|
44
|
-
/** Normalize a local dev URL to an origin: `0.0.0.0` → `localhost`, fill the port. */
|
|
45
|
-
export function normalizeLocal(url, port) {
|
|
46
|
-
try {
|
|
47
|
-
const u = new URL(url);
|
|
48
|
-
if (u.hostname === '0.0.0.0')
|
|
49
|
-
u.hostname = 'localhost';
|
|
50
|
-
if (!u.port)
|
|
51
|
-
u.port = String(port);
|
|
52
|
-
return u.origin;
|
|
53
|
-
}
|
|
54
|
-
catch {
|
|
55
|
-
return `http://localhost:${port}`;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { runWranglerBundle } from './wrangler/bundle.js';
|
|
2
|
-
export { runWranglerDeploy, WranglerDeployError, type DeployArgs } from './wrangler/deploy.js';
|
|
3
|
-
export { runWranglerDev, type DevHandle } from './wrangler/development.js';
|
|
4
|
-
export { wranglerProcessEnv } from './wrangler/process.js';
|
|
5
|
-
export { admitWranglerDeploymentStatus, runWranglerDeploymentStatus, type WranglerDeploymentStatus, } from './wrangler/status.js';
|
|
6
|
-
export { runWranglerTypes } from './wrangler/type-generation.js';
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { runWranglerBundle } from './wrangler/bundle.js';
|
|
2
|
-
export { runWranglerDeploy, WranglerDeployError } from './wrangler/deploy.js';
|
|
3
|
-
export { runWranglerDev } from './wrangler/development.js';
|
|
4
|
-
export { wranglerProcessEnv } from './wrangler/process.js';
|
|
5
|
-
export { admitWranglerDeploymentStatus, runWranglerDeploymentStatus, } from './wrangler/status.js';
|
|
6
|
-
export { runWranglerTypes } from './wrangler/type-generation.js';
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|