Skip to content

Commit 93ede08

Browse files
committed
Migrate from Deno Deploy to Cloudflare Workers
1 parent d135d8a commit 93ede08

11 files changed

Lines changed: 424 additions & 56 deletions

File tree

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,8 @@ dist
107107
.vercel
108108

109109
# Astro build output
110-
.astro
110+
.astro
111+
112+
# Cloudflare wrangler
113+
worker-configuration.d.ts
114+
.wrangler

.vscode/settings.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@
33
"eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact"],
44
"editor.codeActionsOnSave": {
55
"source.fixAll.eslint": "explicit"
6-
},
7-
"deno.enable": true
6+
}
87
}

astro.config.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,30 @@
11
// https://astro.build/config
2+
import cloudflare from "@astrojs/cloudflare";
23
import vue from "@astrojs/vue";
3-
import deno from "@deno/astro-adapter";
44
import tailwindcss from "@tailwindcss/vite";
55
import { defineConfig } from "astro/config";
66
import compress from "astro-compressor";
77

88
// https://astro.build/config
99
export default defineConfig({
1010
site: "https://views.igorkowalczyk.dev",
11+
1112
redirects: {
1213
"/github": "https://github.com/igorkowalczyk/views",
1314
"/docs": "https://github.com/IgorKowalczyk/github-views?tab=readme-ov-file#-basic-usage",
1415
},
15-
output: "server",
16-
adapter: deno(),
16+
1717
integrations: [vue(), compress()],
18+
1819
vite: {
1920
plugins: [tailwindcss()],
2021
},
22+
23+
output: "server",
24+
adapter: cloudflare({
25+
platformProxy: {
26+
enabled: true,
27+
configPath: "./wrangler.jsonc",
28+
},
29+
}),
2130
});

deno.json

Lines changed: 0 additions & 8 deletions
This file was deleted.

package.json

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
"scripts": {
77
"dev": "astro dev",
88
"build": "astro build",
9-
"preview": "deno run --allow-net --allow-read --allow-env --unstable-bare-node-builtins --unstable-kv ./dist/server/entry.mjs",
9+
"preview": "astro preview",
10+
"preview:cloudflare": "pnpm dlx wrangler pages dev ./dist",
11+
"wrangler:types": "pnpm dlx wrangler types",
1012
"format": "prettier . --write --ignore-unknown --cache --plugin=prettier-plugin-astro",
1113
"format:check": "prettier . --check --cache",
1214
"lint": "eslint .",
@@ -21,8 +23,6 @@
2123
"github",
2224
"profile",
2325
"astro",
24-
"deno",
25-
"deno-kv",
2626
"views-counter",
2727
"counter"
2828
],
@@ -33,18 +33,16 @@
3333
},
3434
"homepage": "https://views.igorkowalczyk.dev/",
3535
"dependencies": {
36+
"@astrojs/cloudflare": "12.3.0",
3637
"@astrojs/vue": "5.0.7",
37-
"@deno/astro-adapter": "0.3.0",
3838
"@tailwindcss/vite": "4.0.14",
39-
"@types/canvas-confetti": "1.9.0",
4039
"@vueuse/core": "13.0.0",
4140
"astro": "5.5.3",
4241
"astro-compressor": "1.0.0",
4342
"badgen": "3.2.3",
4443
"canvas-confetti": "1.9.3",
4544
"class-variance-authority": "0.7.1",
4645
"clsx": "2.1.1",
47-
"eslint-plugin-vue": "10.0.0",
4846
"lucide-vue-next": "0.483.0",
4947
"tailwind-merge": "3.0.2",
5048
"tailwindcss": "4.0.14",
@@ -55,16 +53,20 @@
5553
"@igorkowalczyk/prettier-config": "3.0.7",
5654
"@tailwindcss/forms": "0.5.10",
5755
"eslint": "9.22.0",
56+
"eslint-plugin-astro": "^1.3.1",
57+
"eslint-plugin-vue": "10.0.0",
5858
"prettier": "3.5.3",
5959
"prettier-plugin-astro": "0.14.1",
6060
"prettier-plugin-tailwindcss": "0.6.11",
61-
"typescript": "5.8.2"
61+
"typescript": "5.8.2",
62+
"@types/canvas-confetti": "1.9.0"
6263
},
6364
"packageManager": "pnpm@10.6.4",
6465
"pnpm": {
6566
"onlyBuiltDependencies": [
6667
"esbuild",
67-
"sharp"
68+
"sharp",
69+
"workerd"
6870
]
6971
}
7072
}

0 commit comments

Comments
 (0)