@astrojs/cloudflare 6.6.2 → 7.0.0-beta.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/index.js +25 -6
- package/dist/server.advanced.d.ts +1 -1
- package/dist/server.directory.d.ts +1 -1
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -9,11 +9,31 @@ function getAdapter(isModeDirectory) {
|
|
|
9
9
|
return isModeDirectory ? {
|
|
10
10
|
name: "@astrojs/cloudflare",
|
|
11
11
|
serverEntrypoint: "@astrojs/cloudflare/server.directory.js",
|
|
12
|
-
exports: ["onRequest", "manifest"]
|
|
12
|
+
exports: ["onRequest", "manifest"],
|
|
13
|
+
supportedAstroFeatures: {
|
|
14
|
+
hybridOutput: "stable",
|
|
15
|
+
staticOutput: "unsupported",
|
|
16
|
+
serverOutput: "stable",
|
|
17
|
+
assets: {
|
|
18
|
+
supportKind: "unsupported",
|
|
19
|
+
isSharpCompatible: false,
|
|
20
|
+
isSquooshCompatible: false
|
|
21
|
+
}
|
|
22
|
+
}
|
|
13
23
|
} : {
|
|
14
24
|
name: "@astrojs/cloudflare",
|
|
15
25
|
serverEntrypoint: "@astrojs/cloudflare/server.advanced.js",
|
|
16
|
-
exports: ["default"]
|
|
26
|
+
exports: ["default"],
|
|
27
|
+
supportedAstroFeatures: {
|
|
28
|
+
hybridOutput: "stable",
|
|
29
|
+
staticOutput: "unsupported",
|
|
30
|
+
serverOutput: "stable",
|
|
31
|
+
assets: {
|
|
32
|
+
supportKind: "stable",
|
|
33
|
+
isSharpCompatible: false,
|
|
34
|
+
isSquooshCompatible: false
|
|
35
|
+
}
|
|
36
|
+
}
|
|
17
37
|
};
|
|
18
38
|
}
|
|
19
39
|
const SHIM = `globalThis.process = {
|
|
@@ -24,7 +44,7 @@ const SERVER_BUILD_FOLDER = "/$server_build/";
|
|
|
24
44
|
function createIntegration(args) {
|
|
25
45
|
let _config;
|
|
26
46
|
let _buildConfig;
|
|
27
|
-
const isModeDirectory =
|
|
47
|
+
const isModeDirectory = args?.mode === "directory";
|
|
28
48
|
let _entryPoints = /* @__PURE__ */ new Map();
|
|
29
49
|
return {
|
|
30
50
|
name: "@astrojs/cloudflare",
|
|
@@ -78,7 +98,6 @@ function createIntegration(args) {
|
|
|
78
98
|
_entryPoints = entryPoints;
|
|
79
99
|
},
|
|
80
100
|
"astro:build:done": async ({ pages, routes, dir }) => {
|
|
81
|
-
var _a, _b, _c, _d;
|
|
82
101
|
const functionsUrl = new URL("functions/", _config.root);
|
|
83
102
|
if (isModeDirectory) {
|
|
84
103
|
await fs.promises.mkdir(functionsUrl, { recursive: true });
|
|
@@ -97,7 +116,7 @@ function createIntegration(args) {
|
|
|
97
116
|
allowOverwrite: true,
|
|
98
117
|
format: "esm",
|
|
99
118
|
bundle: true,
|
|
100
|
-
minify:
|
|
119
|
+
minify: _config.vite?.build?.minify !== false,
|
|
101
120
|
banner: {
|
|
102
121
|
js: SHIM
|
|
103
122
|
},
|
|
@@ -143,7 +162,7 @@ function createIntegration(args) {
|
|
|
143
162
|
allowOverwrite: true,
|
|
144
163
|
format: "esm",
|
|
145
164
|
bundle: true,
|
|
146
|
-
minify:
|
|
165
|
+
minify: _config.vite?.build?.minify !== false,
|
|
147
166
|
banner: {
|
|
148
167
|
js: SHIM
|
|
149
168
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Request as CFRequest, EventContext } from '@cloudflare/workers-types';
|
|
2
2
|
import type { SSRManifest } from 'astro';
|
|
3
3
|
export declare function createExports(manifest: SSRManifest): {
|
|
4
4
|
onRequest: ({ request, next, ...runtimeEnv }: {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astrojs/cloudflare",
|
|
3
3
|
"description": "Deploy your site to Cloudflare Workers/Pages",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "7.0.0-beta.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"author": "withastro",
|
|
@@ -32,20 +32,20 @@
|
|
|
32
32
|
"runtime.d.ts"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@astrojs/underscore-redirects": "^0.2.0",
|
|
36
35
|
"@cloudflare/workers-types": "^4.20230518.0",
|
|
37
|
-
"esbuild": "^0.
|
|
38
|
-
"tiny-glob": "^0.2.9"
|
|
36
|
+
"esbuild": "^0.18.16",
|
|
37
|
+
"tiny-glob": "^0.2.9",
|
|
38
|
+
"@astrojs/underscore-redirects": "0.3.0-beta.0"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"astro": "^
|
|
41
|
+
"astro": "^3.0.0-beta.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"chai": "^4.3.7",
|
|
45
45
|
"cheerio": "1.0.0-rc.12",
|
|
46
46
|
"mocha": "^9.2.2",
|
|
47
47
|
"wrangler": "^2.0.23",
|
|
48
|
-
"astro": "
|
|
48
|
+
"astro": "3.0.0-beta.0",
|
|
49
49
|
"astro-scripts": "0.0.14"
|
|
50
50
|
},
|
|
51
51
|
"scripts": {
|