@ruvyxa/adapter-cloudflare 1.0.18 → 1.0.19
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/index.d.ts +7 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -11
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -7,10 +7,13 @@ export interface CloudflareAdapterOptions {
|
|
|
7
7
|
workerEntry?: string;
|
|
8
8
|
/**
|
|
9
9
|
* Also emit a `wrangler.jsonc` at the project root pointing at the
|
|
10
|
-
* generated Worker script and static assets
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
10
|
+
* generated Worker script and static assets. An existing project
|
|
11
|
+
* `wrangler.jsonc` is never overwritten.
|
|
12
|
+
*
|
|
13
|
+
* Off by default: the deploy directory already contains a self-sufficient
|
|
14
|
+
* config, so `wrangler deploy -c .ruvyxa/deploy/cloudflare/wrangler.jsonc`
|
|
15
|
+
* works with no file at the project root.
|
|
16
|
+
* @default false
|
|
14
17
|
*/
|
|
15
18
|
projectConfig?: boolean;
|
|
16
19
|
/**
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAgD,MAAM,cAAc,CAAA;AAGzF;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,0EAA0E;IAC1E,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAgD,MAAM,cAAc,CAAA;AAGzF;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,0EAA0E;IAC1E,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;;;;;;OASG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B;AAqCD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,wBAA6B,GAAG,OAAO,CA8FjF;eAEc,iBAAiB"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { clientBuildOutput, validateBuildContext } from '@ruvyxa/core';
|
|
1
|
+
import { clientBuildOutput, projectRelativeOutDir, validateBuildContext } from '@ruvyxa/core';
|
|
2
2
|
/**
|
|
3
3
|
* Worker fetch handler source code.
|
|
4
4
|
*
|
|
@@ -65,6 +65,9 @@ export function cloudflareAdapter(options = {}) {
|
|
|
65
65
|
build(ctx) {
|
|
66
66
|
validateBuildContext(ctx, 'cloudflareAdapter');
|
|
67
67
|
const compatDate = options.compatibilityDate ?? new Date().toISOString().slice(0, 10);
|
|
68
|
+
// Config files are committed or read on other machines; never embed the
|
|
69
|
+
// absolute build-machine outDir in them.
|
|
70
|
+
const relativeOutDir = projectRelativeOutDir(ctx);
|
|
68
71
|
const wranglerConfig = JSON.stringify({
|
|
69
72
|
name: 'ruvyxa-app',
|
|
70
73
|
main: './worker/index.mjs',
|
|
@@ -73,9 +76,9 @@ export function cloudflareAdapter(options = {}) {
|
|
|
73
76
|
}, null, 2);
|
|
74
77
|
const projectWranglerConfig = JSON.stringify({
|
|
75
78
|
name: 'ruvyxa-app',
|
|
76
|
-
main: `${
|
|
79
|
+
main: `${relativeOutDir}/deploy/cloudflare/worker/index.mjs`,
|
|
77
80
|
compatibility_date: compatDate,
|
|
78
|
-
assets: { directory: `${
|
|
81
|
+
assets: { directory: `${relativeOutDir}/deploy/cloudflare/assets` },
|
|
79
82
|
}, null, 2);
|
|
80
83
|
return {
|
|
81
84
|
name: 'cloudflare',
|
|
@@ -86,8 +89,11 @@ export function cloudflareAdapter(options = {}) {
|
|
|
86
89
|
...clientBuildOutput(ctx),
|
|
87
90
|
configFiles: ['wrangler.jsonc'],
|
|
88
91
|
artifacts: [
|
|
89
|
-
// Static assets served by Cloudflare's asset binding
|
|
90
|
-
|
|
92
|
+
// Static assets served by Cloudflare's asset binding. `optional`:
|
|
93
|
+
// an API-only or all-SSR app has no prerendered pages; the Worker
|
|
94
|
+
// still serves every route, so the missing prerender directory must
|
|
95
|
+
// not fail the build.
|
|
96
|
+
{ kind: 'static-site', path: 'deploy/cloudflare/assets', optional: true },
|
|
91
97
|
// Worker function bundle (SSR/API handler)
|
|
92
98
|
{
|
|
93
99
|
kind: 'function',
|
|
@@ -102,14 +108,14 @@ export function cloudflareAdapter(options = {}) {
|
|
|
102
108
|
},
|
|
103
109
|
{
|
|
104
110
|
// Workers static assets read _headers from the asset directory;
|
|
105
|
-
// hashed client bundles are
|
|
111
|
+
// hashed client bundles live under /__ruvyxa/client/ and are
|
|
112
|
+
// immutable.
|
|
106
113
|
kind: 'file',
|
|
107
114
|
path: 'deploy/cloudflare/assets/_headers',
|
|
108
|
-
contents: '/client/*\n Cache-Control: public, max-age=31536000, immutable\n',
|
|
115
|
+
contents: '/__ruvyxa/client/*\n Cache-Control: public, max-age=31536000, immutable\n',
|
|
109
116
|
},
|
|
110
|
-
...(options.projectConfig ===
|
|
111
|
-
? [
|
|
112
|
-
: [
|
|
117
|
+
...(options.projectConfig === true
|
|
118
|
+
? [
|
|
113
119
|
{
|
|
114
120
|
kind: 'file',
|
|
115
121
|
path: 'wrangler.jsonc',
|
|
@@ -117,7 +123,8 @@ export function cloudflareAdapter(options = {}) {
|
|
|
117
123
|
skipIfExists: true,
|
|
118
124
|
contents: projectWranglerConfig + '\n',
|
|
119
125
|
},
|
|
120
|
-
]
|
|
126
|
+
]
|
|
127
|
+
: []),
|
|
121
128
|
],
|
|
122
129
|
};
|
|
123
130
|
},
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AA0B7F;;;;;;;;;GASG;AACH,SAAS,mBAAmB;IAC1B,OAAO;;;;;;;;;;;;;;;;;;;;;CAqBR,CAAA;AACD,CAAC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAAO,GAA6B,EAAE;IACtE,IAAI,OAAO,CAAC,WAAW,KAAK,SAAS,IAAI,OAAO,OAAO,CAAC,WAAW,KAAK,QAAQ,EAAE,CAAC;QACjF,MAAM,IAAI,KAAK,CACb,oEAAoE,OAAO,OAAO,CAAC,WAAW,EAAE,CACjG,CAAA;IACH,CAAC;IAED,IAAI,OAAO,CAAC,WAAW,KAAK,SAAS,IAAI,OAAO,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QAC3E,MAAM,IAAI,KAAK,CAAC,wEAAwE,CAAC,CAAA;IAC3F,CAAC;IAED,OAAO;QACL,IAAI,EAAE,YAAY;QAClB,MAAM,EAAE,MAAM;QACd,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC;QACtC,KAAK,CAAC,GAAiB;YACrB,oBAAoB,CAAC,GAAG,EAAE,mBAAmB,CAAC,CAAA;YAE9C,MAAM,UAAU,GAAG,OAAO,CAAC,iBAAiB,IAAI,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;YACrF,wEAAwE;YACxE,yCAAyC;YACzC,MAAM,cAAc,GAAG,qBAAqB,CAAC,GAAG,CAAC,CAAA;YAEjD,MAAM,c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AI,EAAE,mCAAmC;wBACzC,QAAQ,EAAE,4EAA4E;qBACvF;oBACD,GAAG,CAAC,OAAO,CAAC,aAAa,KAAK,IAAI;wBAChC,CAAC,CAAC;4BACE;gCACE,IAAI,EAAE,MAAM;gCACZ,IAAI,EAAE,gBAAgB;gCACtB,KAAK,EAAE,SAAS;gCAChB,YAAY,EAAE,IAAI;gCAClB,QAAQ,EAAE,qBAAqB,GAAG,IAAI;6BACb;yBAC5B;wBACH,CAAC,CAAC,EAAE,CAAC;iBACR;aACF,CAAA;QACH,CAAC;KACF,CAAA;AACH,CAAC;AAED,eAAe,iBAAiB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ruvyxa/adapter-cloudflare",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.19",
|
|
4
4
|
"description": "Shape Ruvyxa builds for Cloudflare edge targets with typed worker and asset output metadata.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@ruvyxa/core": "^1.0.
|
|
41
|
+
"@ruvyxa/core": "^1.0.19"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"build": "tsc -p tsconfig.json",
|