Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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 unused re-export from info helper function
Comment thread
alexanderniebuhr marked this conversation as resolved.
Outdated
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
---

Updates `astro add cloudflare` to alway use the todays day as `compatibility_date` in the wrangler config, adapting to deprecation due to [upstream changes](https://github.com/cloudflare/workers-sdk/pull/13051)
Comment thread
alexanderniebuhr marked this conversation as resolved.
Outdated

Previously, when generating a compatibility date for new projects, the date was resolved by loading the locally packages. This approach was unreliable in some package manager environments. The logic now simply uses today's date instead, which is always correct and works reliably across all environments, this should always reliably work since now workerd supports dates up to 7 days in the future.
Comment thread
alexanderniebuhr marked this conversation as resolved.
Outdated
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