Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/sweet-feet-happen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/cloudflare': patch
---

Removes an unused function re-export from the `/info` package path
7 changes: 7 additions & 0 deletions .changeset/tame-hairs-scream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'astro': patch
---

Uses today’s date for Cloudflare `compatibility_date` in `astro add cloudflare`

When creating new projects, `astro add cloudflare` now sets `compatibility_date` to the current date. Previously, this date was resolved from locally installed packages, which could be unreliable in some package manager environments. Using today’s date is simpler and more reliable across environments, and is supported by [`workerd`](https://github.com/cloudflare/workers-sdk/pull/13051).
14 changes: 1 addition & 13 deletions packages/astro/src/cli/add/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import fsMod, { existsSync, promises as fs } from 'node:fs';
import { createRequire } from 'node:module';
import path from 'node:path';
import { fileURLToPath, pathToFileURL } from 'node:url';
import * as clack from '@clack/prompts';
Expand Down Expand Up @@ -217,18 +216,7 @@ export async function add(names: string[], { flags }: AddOptions) {

if (await askToContinue({ flags, logger })) {
const data = await getPackageJson();
let compatibilityDate: string;
try {
const require = createRequire(root);
const { getLocalWorkerdCompatibilityDate } = await import(
require.resolve('@astrojs/cloudflare/info')
);
({ date: compatibilityDate } = getLocalWorkerdCompatibilityDate({
projectPath: rootPath,
}));
} catch {
compatibilityDate = new Date().toISOString().slice(0, 10);
}
let compatibilityDate = new Date().toISOString().slice(0, 10);

await fs.writeFile(
wranglerConfigURL,
Expand Down
1 change: 0 additions & 1 deletion packages/integrations/cloudflare/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"homepage": "https://docs.astro.build/en/guides/integrations-guide/cloudflare/",
"exports": {
".": "./dist/index.js",
"./info": "./dist/info.js",
"./entrypoints/server": "./dist/entrypoints/server.js",
"./entrypoints/preview": "./dist/entrypoints/preview.js",
"./entrypoints/server.js": "./dist/entrypoints/server.js",
Expand Down
5 changes: 0 additions & 5 deletions packages/integrations/cloudflare/src/info.ts

This file was deleted.

Loading