@astrojs/cloudflare 12.2.4 → 12.3.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.
@@ -1,6 +1,8 @@
1
+ import { env as globalEnv } from "cloudflare:workers";
1
2
  import { App } from "astro/app";
2
3
  import { setGetEnv } from "astro/env/setup";
3
4
  import { createGetEnv } from "../utils/env.js";
5
+ setGetEnv(createGetEnv(globalEnv));
4
6
  function createExports(manifest) {
5
7
  const app = new App(manifest);
6
8
  const fetch = async (request, env, context) => {
@@ -44,7 +46,6 @@ function createExports(manifest) {
44
46
  }
45
47
  }
46
48
  };
47
- setGetEnv(createGetEnv(env));
48
49
  const response = await app.render(request, { routeData, locals });
49
50
  if (app.setCookieHeaders) {
50
51
  for (const setCookieHeader of app.setCookieHeaders(response)) {
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { createReadStream } from "node:fs";
2
- import { appendFile, rename, stat } from "node:fs/promises";
2
+ import { appendFile, stat } from "node:fs/promises";
3
3
  import { createInterface } from "node:readline/promises";
4
4
  import {
5
5
  appendForwardSlash,
@@ -179,18 +179,6 @@ function createIntegration(args) {
179
179
  },
180
180
  "astro:build:done": async ({ pages, dir, logger, assets }) => {
181
181
  await cloudflareModulePlugin.afterBuildCompleted(_config);
182
- const PLATFORM_FILES = ["_headers", "_redirects", "_routes.json"];
183
- if (_config.base !== "/") {
184
- for (const file of PLATFORM_FILES) {
185
- try {
186
- await rename(new URL(file, _config.build.client), new URL(file, _config.outDir));
187
- } catch (_e) {
188
- logger.error(
189
- `There was an error moving ${file} to the root of the output directory.`
190
- );
191
- }
192
- }
193
- }
194
182
  let redirectsExists = false;
195
183
  try {
196
184
  const redirectsStat = await stat(new URL("./_redirects", _config.outDir));
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.2.4",
4
+ "version": "12.3.0",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
7
7
  "author": "withastro",
@@ -29,16 +29,16 @@
29
29
  "dist"
30
30
  ],
31
31
  "dependencies": {
32
- "@cloudflare/workers-types": "^4.20250303.0",
32
+ "@cloudflare/workers-types": "^4.20250317.0",
33
33
  "esbuild": "^0.25.0",
34
34
  "estree-walker": "^3.0.3",
35
35
  "magic-string": "^0.30.17",
36
- "miniflare": "^3.20250214.2",
36
+ "miniflare": "^4.20250317.0",
37
37
  "tinyglobby": "^0.2.12",
38
- "vite": "^6.2.0",
39
- "wrangler": "^3.112.0",
40
- "@astrojs/underscore-redirects": "0.6.0",
41
- "@astrojs/internal-helpers": "0.6.1"
38
+ "vite": "^6.2.1",
39
+ "wrangler": "^4.2.0",
40
+ "@astrojs/internal-helpers": "0.6.1",
41
+ "@astrojs/underscore-redirects": "0.6.0"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "astro": "^5.0.0"
@@ -46,9 +46,9 @@
46
46
  "devDependencies": {
47
47
  "cheerio": "1.0.0",
48
48
  "execa": "^8.0.1",
49
- "rollup": "^4.34.9",
49
+ "rollup": "^4.35.0",
50
50
  "strip-ansi": "^7.1.0",
51
- "astro": "5.4.3",
51
+ "astro": "5.5.4",
52
52
  "astro-scripts": "0.0.14"
53
53
  },
54
54
  "publishConfig": {