@astrojs/cloudflare 12.0.0-beta.1 → 12.0.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.
|
@@ -26,7 +26,9 @@ const service = {
|
|
|
26
26
|
// If it's not an imported image, nor is it allowed using the current domains or remote patterns, we'll just return the original URL
|
|
27
27
|
return options.src;
|
|
28
28
|
}
|
|
29
|
-
const imageEndpoint = joinPaths(
|
|
29
|
+
const imageEndpoint = joinPaths(
|
|
30
|
+
// @ts-expect-error Can't recognise import.meta.env
|
|
31
|
+
import.meta.env.BASE_URL, '/cdn-cgi/image', resizingParams.join(','), imageSource);
|
|
30
32
|
return imageEndpoint;
|
|
31
33
|
},
|
|
32
34
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AstroIntegration } from 'astro';
|
|
2
|
+
import { type GetPlatformProxyOptions } from 'wrangler';
|
|
2
3
|
export type { Runtime } from './entrypoints/server.js';
|
|
3
4
|
export type Options = {
|
|
4
5
|
/** Options for handling images. */
|
|
@@ -30,17 +31,9 @@ export type Options = {
|
|
|
30
31
|
/**
|
|
31
32
|
* Proxy configuration for the platform.
|
|
32
33
|
*/
|
|
33
|
-
platformProxy?: {
|
|
34
|
+
platformProxy?: GetPlatformProxyOptions & {
|
|
34
35
|
/** Toggle the proxy. Default `undefined`, which equals to `true`. */
|
|
35
36
|
enabled?: boolean;
|
|
36
|
-
/** Path to the configuration file. Default `wrangler.toml`. */
|
|
37
|
-
configPath?: string;
|
|
38
|
-
/** Enable experimental support for JSON configuration. Default `false`. */
|
|
39
|
-
experimentalJsonConfig?: boolean;
|
|
40
|
-
/** Configuration persistence settings. Default '.wrangler/state/v3' */
|
|
41
|
-
persist?: boolean | {
|
|
42
|
-
path: string;
|
|
43
|
-
};
|
|
44
37
|
};
|
|
45
38
|
/**
|
|
46
39
|
* Allow bundling cloudflare worker specific file types as importable modules. Defaults to true.
|
package/dist/index.js
CHANGED
|
@@ -24,13 +24,6 @@ function setProcessEnv(config, env) {
|
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
function createPlatformProxy(platformProxy) {
|
|
28
|
-
return getPlatformProxy({
|
|
29
|
-
configPath: platformProxy?.configPath,
|
|
30
|
-
experimentalJsonConfig: platformProxy?.experimentalJsonConfig ?? false,
|
|
31
|
-
persist: platformProxy?.persist ?? true,
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
27
|
export default function createIntegration(args) {
|
|
35
28
|
let _config;
|
|
36
29
|
const cloudflareModulePlugin = cloudflareModuleLoader(args?.cloudflareModules ?? true);
|
|
@@ -97,7 +90,7 @@ export default function createIntegration(args) {
|
|
|
97
90
|
},
|
|
98
91
|
'astro:server:setup': async ({ server }) => {
|
|
99
92
|
if ((args?.platformProxy?.enabled ?? true) === true) {
|
|
100
|
-
const platformProxy = await
|
|
93
|
+
const platformProxy = await getPlatformProxy(args?.platformProxy);
|
|
101
94
|
setProcessEnv(_config, platformProxy.env);
|
|
102
95
|
const clientLocalsSymbol = Symbol.for('astro.locals');
|
|
103
96
|
server.middlewares.use(async function middleware(req, res, next) {
|
|
@@ -12,6 +12,10 @@ export declare function setImageConfig(service: string, config: AstroConfig['ima
|
|
|
12
12
|
hostname?: string | undefined;
|
|
13
13
|
pathname?: string | undefined;
|
|
14
14
|
}[];
|
|
15
|
+
experimentalLayout?: "fixed" | "none" | "responsive" | "full-width" | undefined;
|
|
16
|
+
experimentalObjectFit?: string | undefined;
|
|
17
|
+
experimentalObjectPosition?: string | undefined;
|
|
18
|
+
experimentalBreakpoints?: number[] | undefined;
|
|
15
19
|
} | {
|
|
16
20
|
service: import("astro").ImageServiceConfig<Record<string, any>>;
|
|
17
21
|
endpoint: {
|
|
@@ -24,4 +28,8 @@ export declare function setImageConfig(service: string, config: AstroConfig['ima
|
|
|
24
28
|
hostname?: string | undefined;
|
|
25
29
|
pathname?: string | undefined;
|
|
26
30
|
}[];
|
|
31
|
+
experimentalLayout?: "fixed" | "none" | "responsive" | "full-width" | undefined;
|
|
32
|
+
experimentalObjectFit?: string | undefined;
|
|
33
|
+
experimentalObjectPosition?: string | undefined;
|
|
34
|
+
experimentalBreakpoints?: number[] | undefined;
|
|
27
35
|
};
|
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": "12.0.0
|
|
4
|
+
"version": "12.0.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"author": "withastro",
|
|
@@ -31,26 +31,26 @@
|
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@astrojs/internal-helpers": "0.4.1",
|
|
33
33
|
"@astrojs/underscore-redirects": "^0.4.0-alpha.0",
|
|
34
|
-
"@cloudflare/workers-types": "^4.
|
|
34
|
+
"@cloudflare/workers-types": "^4.20241112.0",
|
|
35
35
|
"@inox-tools/astro-when": "^0.2.4",
|
|
36
36
|
"esbuild": "^0.24.0",
|
|
37
37
|
"estree-walker": "^3.0.3",
|
|
38
|
-
"magic-string": "^0.30.
|
|
39
|
-
"miniflare": "^3.
|
|
38
|
+
"magic-string": "^0.30.14",
|
|
39
|
+
"miniflare": "^3.20241106.1",
|
|
40
40
|
"tiny-glob": "^0.2.9",
|
|
41
|
-
"wrangler": "^3.
|
|
41
|
+
"wrangler": "^3.91.0"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"astro": "^5.0.0
|
|
44
|
+
"astro": "^5.0.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"astro": "^5.0.0-alpha.
|
|
47
|
+
"astro": "^5.0.0-alpha.15",
|
|
48
48
|
"cheerio": "1.0.0",
|
|
49
49
|
"execa": "^8.0.1",
|
|
50
50
|
"fast-glob": "^3.3.2",
|
|
51
|
-
"rollup": "^4.
|
|
51
|
+
"rollup": "^4.27.4",
|
|
52
52
|
"strip-ansi": "^7.1.0",
|
|
53
|
-
"vite": "6.0.
|
|
53
|
+
"vite": "6.0.1",
|
|
54
54
|
"@astrojs/test-utils": "0.0.1",
|
|
55
55
|
"astro-scripts": "0.0.14"
|
|
56
56
|
},
|