Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move cloudflare #13150

Merged
merged 516 commits into from
Feb 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
516 commits
Select commit Hold shift + click to select a range
b5dce64
[ci] release (rc) (#8215)
astrobot-houston Aug 25, 2023
0e288ac
[ci] release (rc) (#8233)
astrobot-houston Aug 25, 2023
6b03a0c
refactor: use new Astro internals (#8254)
ematipico Aug 28, 2023
bb3a6fe
[ci] release (rc) (#8238)
astrobot-houston Aug 28, 2023
a8ea70a
[ci] release (rc) (#8256)
astrobot-houston Aug 29, 2023
a5210f4
[ci] release (rc) (#8267)
astrobot-houston Aug 29, 2023
260f1e7
[ci] release (rc) (#8272)
astrobot-houston Aug 29, 2023
3a668ba
[ci] release (#8279)
astrobot-houston Aug 30, 2023
c90e28d
[ci] release (#8285)
astrobot-houston Aug 30, 2023
560f41e
3.0.1 release
matthewp Aug 30, 2023
92ca99c
Revert "[ci] release (#8285)" (#8290)
matthewp Aug 30, 2023
f1e029e
[ci] release (#8288)
astrobot-houston Aug 30, 2023
b711239
[ci] release (#8296)
astrobot-houston Aug 30, 2023
51f56f4
[ci] release (#8304)
astrobot-houston Aug 30, 2023
003d4bf
[ci] release (#8326)
astrobot-houston Aug 31, 2023
087d564
[ci] release (#8330)
astrobot-houston Aug 31, 2023
8b3a739
[ci] release (#8335)
astrobot-houston Sep 1, 2023
88e2154
Uppercase endpoint examples in adapter READMEs (#8346)
delucis Sep 1, 2023
ddc78f5
[ci] release (#8356)
astrobot-houston Sep 1, 2023
8dd7b02
[ci] release (#8372)
astrobot-houston Sep 4, 2023
956de97
Skip cloudflare CLI tests if fail to start (#8417)
bluwy Sep 5, 2023
43756b4
[docs] Typo fix in Cloudflare README (#8429)
sarah11918 Sep 6, 2023
0eed84f
[ci] release (#8415)
astrobot-houston Sep 6, 2023
e09089a
[ci] release (#8439)
astrobot-houston Sep 6, 2023
b95fd11
[ci] release (#8442)
astrobot-houston Sep 8, 2023
cd4cc6b
[ci] release (#8465)
astrobot-houston Sep 8, 2023
772da93
feat(@astrojs/cloudflare): add runtime support to `astro dev` (#8426)
alexanderniebuhr Sep 11, 2023
4912c1d
[ci] format
lilnasy Sep 11, 2023
a75d2e7
[ci] release (#8501)
astrobot-houston Sep 12, 2023
0ae9482
config: migrate us to moduleResolution: 'node16' (#8519)
Princesseuh Sep 13, 2023
03faa21
[ci] release (#8540)
astrobot-houston Sep 14, 2023
5cfe9ca
feat(@astro/cloudflare): improve DX for runtime typing (#8560)
alexanderniebuhr Sep 18, 2023
a63406c
[ci] format
ematipico Sep 18, 2023
a4738de
[ci] release (#8590)
astrobot-houston Sep 19, 2023
5463e28
fix(@astrojs/cloudflare): support for nodejs_compat (#8595)
alexanderniebuhr Sep 19, 2023
c028bb9
[ci] format
ematipico Sep 19, 2023
8d73779
[ci] release (#8597)
astrobot-houston Sep 21, 2023
1383a5c
feat(@astrojs/cloudflare): Add support for wasm module imports (#8542)
adrianlyjak Sep 22, 2023
bf31162
[ci] format
ematipico Sep 22, 2023
7d791c7
fix(cloudflare): added config for _routes.json generation (#8459)
schummar Sep 24, 2023
8132da4
[ci] release (#8635)
astrobot-houston Sep 25, 2023
eb7f31f
[ci] release (#8663)
astrobot-houston Sep 25, 2023
49eaa33
Match the .well-known directory when generating routes.json (#7776)
aditsachde Sep 27, 2023
b814003
update all the readme's for expressive code (#8691)
ElianCodes Sep 28, 2023
081f25b
chore(cloudflare): refactor structure, optimize patterns (#8654)
alexanderniebuhr Sep 28, 2023
75b9dd2
[ci] format
alexanderniebuhr Sep 28, 2023
2ec78b5
[ci] release (#8671)
astrobot-houston Sep 28, 2023
443515d
Revert "[ci] release (#8671)" (#8696)
matthewp Sep 28, 2023
eb5c3e2
[ci] release (#8695)
astrobot-houston Sep 28, 2023
c7dc4f8
fix(cloudflare): sneaky docs (#8694)
alexanderniebuhr Sep 28, 2023
0164ede
fix(cloudflare): target es2022 instead of es2020 to fix esbuild incom…
dario-piotrowicz Sep 28, 2023
396bc89
fix(cloudflare): broken link in docs (#8709)
alexanderniebuhr Sep 30, 2023
5ad6d15
[ci] release (#8699)
astrobot-houston Oct 2, 2023
0f69ced
feat(cloudflare): add local mockings for CF bindings (#8655)
alexanderniebuhr Oct 2, 2023
8937fec
[ci] format
alexanderniebuhr Oct 2, 2023
d24423e
[ci] release (#8722)
astrobot-houston Oct 2, 2023
d048f2d
feat: add provenance to packages (#8737)
ematipico Oct 3, 2023
997876e
[ci] release (#8738)
astrobot-houston Oct 5, 2023
2fbd5b9
fix(cloudflare): support for 'cloudflare:*' imports (#8766)
jadbox Oct 9, 2023
2f174ec
[ci] format
alexanderniebuhr Oct 9, 2023
8dd1d4d
fix(cloudflare): esbuild settings for cloudflare (#8788)
alexanderniebuhr Oct 10, 2023
3961bc2
[ci] release (#8768)
astrobot-houston Oct 10, 2023
5cdb6d2
fix(cloudflare): runtime types for Cloudflare caches (#8782)
helloimalastair Oct 10, 2023
ef2005e
[ci] format
alexanderniebuhr Oct 10, 2023
1270749
port https://github.com/withastro/docs/pull/4980 (#8799)
alexanderniebuhr Oct 11, 2023
f60dff5
[ci] release (#8796)
astrobot-houston Oct 12, 2023
2c5fc57
chore(cloudflare): migrate from withastro/astro to withastro/adapters
alexanderniebuhr Oct 16, 2023
5ce6ac0
chore(cloudflare): fixup migration issues
alexanderniebuhr Oct 13, 2023
9f32998
[ci] format
alexanderniebuhr Oct 16, 2023
f382b1b
fix(cloudflare): failing test
alexanderniebuhr Oct 16, 2023
3afdfae
fix(cloudflare): missing import
alexanderniebuhr Oct 16, 2023
13d2e16
fix(cloudflare): relative fixture test imports
alexanderniebuhr Oct 16, 2023
87bd14b
fix(cloudflare): relative fixture test imports
alexanderniebuhr Oct 16, 2023
ebc9f87
fix(cloudflare): missing var definition
alexanderniebuhr Oct 16, 2023
3766bdc
fix: docs smoke test
alexanderniebuhr Oct 16, 2023
b981e3c
chore: update repo urls (#15)
alexanderniebuhr Oct 16, 2023
b5e7ff0
[ci] release (#16)
github-actions[bot] Oct 16, 2023
ee1bf50
revert: "[ci] release (#16)" (#17)
alexanderniebuhr Oct 16, 2023
c5ec20b
[ci] release (#18)
github-actions[bot] Oct 16, 2023
5fd22a9
Revert "[ci] release (#18)" (#21)
alexanderniebuhr Oct 16, 2023
a64ae13
[ci] release (#20)
github-actions[bot] Oct 16, 2023
9094a86
feat(cloudflare): add runtime persistence directory option (#23)
alexanderniebuhr Oct 19, 2023
508e3a9
[ci] release (#27)
github-actions[bot] Oct 19, 2023
228ba00
fix(cloudflare): missing persistence config for `cache` (#28)
alexanderniebuhr Oct 19, 2023
9edbd46
fix(cloudflare): adapter breaks if no args passed (#30)
alexanderniebuhr Oct 19, 2023
0bdec42
[ci] release (#29)
github-actions[bot] Oct 19, 2023
d944d29
fix(cloudflare): astro asset image service (#33)
alexanderniebuhr Oct 24, 2023
a73c527
[ci] release (#40)
github-actions[bot] Oct 26, 2023
7c05e42
fix(astro): build regression (#46)
alexanderniebuhr Oct 27, 2023
3f12f58
[ci] release (#47)
github-actions[bot] Oct 27, 2023
f84d8fa
chore: update deps (#51)
alexanderniebuhr Nov 2, 2023
9ec82a6
[ci] release (#52)
github-actions[bot] Nov 3, 2023
17ce457
feat(cloudflare): `imageService` adapter config (#34)
alexanderniebuhr Nov 13, 2023
30e9df0
[ci] release (#62)
github-actions[bot] Nov 13, 2023
b290b1e
fix(cloudflare): adapter returning an empty 404 page (#66)
ToxiWoxi Nov 16, 2023
a0d5d49
[ci] format
alexanderniebuhr Nov 16, 2023
c74d815
fix(cloudflare): routing strategy doesn't support on-demand 404 (#69)
alexanderniebuhr Nov 16, 2023
b323236
[ci] release (#70)
github-actions[bot] Nov 16, 2023
46a6efd
chore: update `astro` peerDependency version range (#71)
alexanderniebuhr Nov 21, 2023
02d2a91
chore: use biome to sort imports (#77)
ematipico Nov 30, 2023
235b379
feat(cloudflare): new local runtime logic (#61)
alexanderniebuhr Nov 30, 2023
c3255e8
[ci] format
alexanderniebuhr Nov 30, 2023
39e288a
chore(cloudflare): use astro's vite version for plugin type (#82)
lilnasy Dec 4, 2023
beafad3
chore: format with Biome (#79)
ematipico Dec 4, 2023
f3a4995
chore: remove `type EndpointOutput` (#83)
vasfvitor Dec 5, 2023
720e3e7
chore(cloudflare): remove deprecated `build.split` option (#86)
alexanderniebuhr Dec 5, 2023
68273a5
chore: update to Astro v4 (#87)
alexanderniebuhr Dec 5, 2023
9a47143
fix(cloudflare): fix wasm plugin (#89)
alexanderniebuhr Dec 5, 2023
f3460ff
[ci] release (#73)
github-actions[bot] Dec 5, 2023
23b2896
revert "[ci] release" (#94)
alexanderniebuhr Dec 5, 2023
9161cb9
[ci] release (#93)
github-actions[bot] Dec 5, 2023
51e8c84
chore: use Biome as linter (#111)
ematipico Dec 21, 2023
fba3ba0
[ci] format
ematipico Dec 21, 2023
817afe1
Update Cloudflare README.md (#108)
sarah11918 Dec 21, 2023
e0b452c
[ci] release (#113)
github-actions[bot] Dec 28, 2023
bc32a29
chore: update Miniflare's version to avoid CVE-2023-7078 (#122)
maddsua Jan 5, 2024
7bad0dc
chore: revert #122 due to wrong package version (#124)
alexanderniebuhr Jan 5, 2024
d2f695b
chore: update Miniflare's version to avoid CVE-2023-7078 (#125)
alexanderniebuhr Jan 5, 2024
c586f83
[ci] release (#123)
github-actions[bot] Jan 5, 2024
12fd2e1
feat(cloudflare): image optimization during build-time (#58)
alexanderniebuhr Jan 9, 2024
462df24
[ci] format
alexanderniebuhr Jan 9, 2024
e12b9c3
[ci] release (#128)
github-actions[bot] Jan 9, 2024
d15200c
updates to adapter internals (#130)
asdfjkalsdfla Jan 16, 2024
34175c7
chore: updates astro versions (#132)
alexanderniebuhr Jan 19, 2024
582ef5c
fix(cloudflare): duplicate patterns in `_routes.json` (#137)
alexanderniebuhr Jan 23, 2024
b1d1fd0
[ci] release (#131)
github-actions[bot] Jan 23, 2024
e2be90c
chore(cloudflare): use Node.js for testing (#150)
xMohamd Feb 11, 2024
b255839
[ci] format
alexanderniebuhr Feb 11, 2024
f48036b
fix(netlify): consider main fields when bundling (#160)
lilnasy Feb 12, 2024
abb7d3a
fix(cloudflare): error if cacheDir already existed (#168)
alexanderniebuhr Feb 17, 2024
1d06f71
[ci] release (#169)
github-actions[bot] Feb 17, 2024
6990203
fix(cloudflare): _routes.json deduplication (#171)
alexanderniebuhr Feb 27, 2024
6196fc0
[ci] release (#174)
github-actions[bot] Feb 27, 2024
b8cdd6e
feat(cloudflare): add service bindings (#179)
F0rce Mar 5, 2024
9a6a7dd
[ci] release (#181)
github-actions[bot] Mar 5, 2024
95f88e5
chore: update biome to the latest (#183)
ematipico Mar 13, 2024
a2d19b9
chore(cloudflare): add deprecated tags (#192)
alexanderniebuhr Mar 22, 2024
3e48758
[ci] release (#201)
github-actions[bot] Mar 22, 2024
a5ef475
fix(cloudflare): fix typo in .dev.vars log message (#204)
dario-piotrowicz Mar 27, 2024
08f6167
[ci] release (#205)
github-actions[bot] Mar 27, 2024
8ef3050
feat(cloudflare): major refactor for v10 (#159)
alexanderniebuhr Mar 28, 2024
5cd80b0
[ci] release (#206)
github-actions[bot] Mar 28, 2024
2031f63
fix(cloudflare): using vue breaks builds (#210)
alexanderniebuhr Mar 29, 2024
fc292ec
fix(cloudflare): using solid with client directive breaks build (#212)
alexanderniebuhr Mar 29, 2024
ce06156
[ci] release (#215)
github-actions[bot] Mar 29, 2024
f34e5a1
fix(cloudflare): routes generation logic (#217)
alexanderniebuhr Apr 1, 2024
15a24c0
[ci] release (#219)
github-actions[bot] Apr 1, 2024
a9153c0
chore(cloudflare): minor test improvements (#223)
Fryuni Apr 6, 2024
0345b97
fix(cloudflare): align runtime api (#225)
alexanderniebuhr Apr 8, 2024
8e4761c
[ci] release (#230)
github-actions[bot] Apr 8, 2024
b14f609
feat(cloudflare): add imageService 'custom' (#229)
FlorianFlatscher Apr 10, 2024
c39dc34
[ci] release (#234)
github-actions[bot] Apr 10, 2024
12e922d
feat(cloudflare): remove unnecessary code from the server output (#222)
Fryuni Apr 18, 2024
f8ee85b
[ci] release (#236)
github-actions[bot] Apr 18, 2024
044c30b
fix(cloudflare): dynamic-imports-analyzer regexp to ast (#238)
alexanderniebuhr Apr 22, 2024
a454074
[ci] release (#240)
github-actions[bot] Apr 22, 2024
f182ce8
fix(cloudflare): removes log (#241)
alexanderniebuhr Apr 22, 2024
2a3c29d
[ci] release (#242)
github-actions[bot] Apr 22, 2024
f13fdcd
fix(cloudflare): ignore client build during cleanup (#243)
alexanderniebuhr Apr 23, 2024
775b977
[ci] release (#246)
github-actions[bot] Apr 23, 2024
e8d0d9c
fix(cloudflare): routes.json order (#247)
alexanderniebuhr Apr 24, 2024
6216ead
[ci] release (#248)
github-actions[bot] Apr 24, 2024
e7297d2
fix(cloudflare): "shared" wasm module imports (#249)
adrianlyjak May 3, 2024
78a8b71
[ci] release (#253)
github-actions[bot] May 3, 2024
1b65a11
fix(cloudflare): node_modules on prerender pages only (#226)
alexanderniebuhr May 11, 2024
47a8419
[ci] release (#260)
github-actions[bot] May 11, 2024
025f184
feat(cloudflare): support `txt` and `bin`(#251)
adrianlyjak Jun 7, 2024
5ed6895
[ci] release (#277)
github-actions[bot] Jun 7, 2024
41f1321
feat(netlify): support astro:env (#275)
florian-lefebvre Jun 10, 2024
976a24c
feat(cloudflare): support astro:env (#258)
alexanderniebuhr Jun 10, 2024
27b7dc5
[ci] release (#280)
github-actions[bot] Jun 10, 2024
b8e390d
fix: backward compatibility Astro <= 4.9 (#282)
alexanderniebuhr Jun 16, 2024
74c590e
[ci] release (#284)
github-actions[bot] Jun 17, 2024
7d5108e
feat(cloudflare): remove experimental support for astro:env (#292)
florian-lefebvre Jun 20, 2024
ecc6fc0
[ci] release (#295)
github-actions[bot] Jun 20, 2024
73dda5c
feat(cloudflare): major v11 (#290)
alexanderniebuhr Jun 22, 2024
21e346d
[ci] release (#297)
github-actions[bot] Jun 22, 2024
f86fdaf
fix(cloudflare): wrangler.toml error (#302)
alexanderniebuhr Jun 25, 2024
a1853f3
[ci] release (#303)
github-actions[bot] Jun 25, 2024
a5d9215
chore(deps): update all non-major dependencies (#298)
renovate[bot] Jul 1, 2024
d6aa05b
fix(cloudflare): env vars in middleware for prerendering (#340)
alexanderniebuhr Aug 3, 2024
1de54b9
[ci] release (#329)
github-actions[bot] Aug 3, 2024
a8a6a55
fix(cloudflare): env vars in middleware & prerendering (#341)
alexanderniebuhr Aug 3, 2024
543beda
fix(cloudflare): add proxy /_image endpoint (#335)
alexanderniebuhr Aug 3, 2024
0883291
[ci] release (#342)
github-actions[bot] Aug 3, 2024
1f2bf14
fix(cloudflare): Fixes peer dependency conflict (#344)
Fryuni Aug 4, 2024
d7efab6
[ci] release (#345)
github-actions[bot] Aug 4, 2024
58729a9
Upgrade to eslint v9 (#356)
bluwy Aug 20, 2024
7a3871f
chore(deps): update all non-major dependencies (#318)
renovate[bot] Aug 22, 2024
00275c7
fix(deps): update dependency @astrojs/solid-js to v4 (#364)
renovate[bot] Aug 26, 2024
8fea4ab
fix(deps): update all non-major dependencies (#363)
renovate[bot] Aug 26, 2024
1f4593c
chore: next to use astro v5
alexanderniebuhr Aug 29, 2024
057ecae
chore: fixes
alexanderniebuhr Aug 29, 2024
9f13d15
chore: fix type errors
alexanderniebuhr Aug 29, 2024
0f37c71
chore: fixes
alexanderniebuhr Aug 29, 2024
1f75199
Merge `vercel` and `node` into main #366
alexanderniebuhr Aug 29, 2024
dafa193
Merge `vercel` and `node` into next #367
alexanderniebuhr Aug 29, 2024
8d4c527
fix: build errors
alexanderniebuhr Aug 29, 2024
da5d51f
chore(deps): update all non-major dependencies (#370)
renovate[bot] Sep 2, 2024
8fdce87
chore(deps): update all non-major dependencies (#382)
renovate[bot] Sep 9, 2024
c4d2f17
feat: remove hybrid (#375)
Princesseuh Sep 11, 2024
c6b76a1
feat: update adapters supported features to account for new shape for…
Princesseuh Sep 13, 2024
1a44755
Adapter related changes for IntegrationData (#377)
alexanderniebuhr Sep 16, 2024
c31ddd6
Merge branch 'main' into next
alexanderniebuhr Sep 17, 2024
4113024
[ci] format
alexanderniebuhr Sep 17, 2024
4f0a575
Added windows support for static file path splitting (#387)
veitbjarsch Sep 17, 2024
421c79c
[ci] release (beta) (#368)
github-actions[bot] Sep 17, 2024
ea98902
chore(deps): update all non-major dependencies (#393)
renovate[bot] Sep 18, 2024
90771cd
[ci] release (#396)
github-actions[bot] Sep 18, 2024
09b6b3f
Reduce amount of rules in routes json file (#394)
veitbjarsch Sep 23, 2024
584f0bc
[ci] release (#403)
github-actions[bot] Sep 23, 2024
6ffa1fc
fix(deps): update all non-major dependencies (#402)
renovate[bot] Sep 23, 2024
6a28fd1
fix(deps): update all non-major dependencies (#408)
renovate[bot] Oct 1, 2024
f5f9f98
Merge branch 'main' into next
bluwy Oct 1, 2024
50a79c6
chore(deps): update all non-major dependencies (#416)
renovate[bot] Oct 8, 2024
6ebcb9b
feat: improve _routes.json generation (#423)
schummar Oct 21, 2024
87bb539
chore(deps): update all non-major dependencies (#420)
renovate[bot] Oct 23, 2024
3c741ab
chore: externalize `cloudflare:sockets` imports (#409)
alexanderniebuhr Oct 27, 2024
3be750e
[ci] release (#425)
github-actions[bot] Oct 27, 2024
de43590
chore(deps): update all non-major dependencies (#428)
renovate[bot] Oct 31, 2024
d62c52b
Merge branch 'main' into next
bluwy Oct 31, 2024
06ba2f3
Update esbuild to v0.24.0
bluwy Oct 31, 2024
5e6725c
Fix build and types issue
bluwy Oct 31, 2024
3ea6271
[ci] release (beta) (#400)
github-actions[bot] Oct 31, 2024
7f15d97
fix(deps): update all non-major dependencies (#431)
renovate[bot] Nov 27, 2024
5a71b60
chore: update Astro peer dep for adapters (#449)
ematipico Nov 28, 2024
dab05d9
Merge branch 'main' into next
ematipico Nov 28, 2024
e71f3ae
chore: fix build
ematipico Nov 28, 2024
afec670
skip cloudflare test
ematipico Nov 28, 2024
4a48d06
Merge pull request #451 from withastro/next
ematipico Nov 28, 2024
992c3f2
[ci] release (#448)
github-actions[bot] Dec 3, 2024
f1aa1b2
test: use Astro v5 and update cloudflare assertions (#460)
ematipico Dec 3, 2024
641a19e
Fix cloudflare ssr conditions setup (#465)
bluwy Dec 5, 2024
6a7812b
[ci] release (#466)
github-actions[bot] Dec 5, 2024
2df7d0e
fix(deps): update dependency @inox-tools/astro-when to v1 (#468)
renovate[bot] Dec 5, 2024
decacaa
fix(deps): update dependency @astrojs/solid-js to v5 (#467)
renovate[bot] Dec 5, 2024
9e5c617
Add support for `wrangler.jsonc` (#455)
meyer Dec 6, 2024
b6abc14
fix: cloudflare resolve conditions (#476)
bluwy Dec 13, 2024
625f876
[ci] release (#473)
github-actions[bot] Dec 13, 2024
e3d7b3e
feat(cloudflare,netlify): stabilize astro:env secrets support (#496)
florian-lefebvre Jan 7, 2025
a761945
fix(deps): update all non-major dependencies (#457)
renovate[bot] Jan 7, 2025
03f15c4
chore: update adapters to better support astro v5 (#454)
alexanderniebuhr Jan 7, 2025
0888511
feat: upgrade underscore-redirects (#501)
florian-lefebvre Jan 13, 2025
0de93dc
[ci] release (#497)
github-actions[bot] Jan 13, 2025
fe35831
fix(deps): update all non-major dependencies (#503)
renovate[bot] Jan 14, 2025
e7f8194
Remove internal vue handling in cloudflare integration (#506)
bluwy Jan 17, 2025
95ccbb3
[ci] release (#507)
github-actions[bot] Jan 22, 2025
a7776b8
Merge branch 'main' of ../../temp/adapters into move-cloudflare
ematipico Feb 7, 2025
9b8042a
chore: move cloudflare adapter to core monorepo
ematipico Feb 7, 2025
0063ecb
chore: fix linting issues
ematipico Feb 7, 2025
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 packages/integrations/cloudflare/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Astro cloudflare directory mode creates a function directory
functions
.mf
.wrangler
.astro
1,709 changes: 1,709 additions & 0 deletions packages/integrations/cloudflare/CHANGELOG.md

Large diffs are not rendered by default.

37 changes: 36 additions & 1 deletion packages/integrations/cloudflare/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,38 @@
# @astrojs/cloudflare

The Cloudflare adapter package has moved. Please see [the new repository for the Cloudflare adapter](https://github.com/withastro/adapters/tree/main/packages/cloudflare).
An SSR adapter for use with Cloudflare Pages Functions targets. Write your code in Astro/Javascript and deploy to Cloudflare Pages.

## Documentation

Read the [`@astrojs/cloudflare` docs][docs]

## Support

- Get help in the [Astro Discord][discord]. Post questions in our `#support` forum, or visit our dedicated `#dev` channel to discuss current development and more!

- Check our [Astro Integration Documentation][astro-integration] for more on integrations.

- Submit bug reports and feature requests as [GitHub issues][issues].

## Contributing

This package is maintained by Astro's Core team. You're welcome to submit an issue or PR! These links will help you get started:

- [Contributor Manual][contributing]
- [Code of Conduct][coc]
- [Community Guide][community]

## License

MIT

Copyright (c) 2023–present [Astro][astro]

[astro]: https://astro.build/
[docs]: https://docs.astro.build/en/guides/integrations-guide/cloudflare/
[contributing]: https://github.com/withastro/astro/blob/main/CONTRIBUTING.md
[coc]: https://github.com/withastro/.github/blob/main/CODE_OF_CONDUCT.md
[community]: https://github.com/withastro/.github/blob/main/COMMUNITY_GUIDE.md
[discord]: https://astro.build/chat/
[issues]: https://github.com/withastro/adapter/issues
[astro-integration]: https://docs.astro.build/en/guides/integrations-guide/
62 changes: 58 additions & 4 deletions packages/integrations/cloudflare/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,62 @@
{
"name": "@astrojs/cloudflare",
"version": "0.0.0",
"private": true,
"description": "Deploy your site to Cloudflare Workers/Pages",
"version": "12.2.1",
"type": "module",
"keywords": [],
"dont_remove": "This is a placeholder for the sake of the docs smoke test"
"types": "./dist/index.d.ts",
"author": "withastro",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/withastro/adapters.git",
"directory": "packages/cloudflare"
},
"keywords": [
"withastro",
"astro-adapter"
],
"bugs": "https://github.com/withastro/adapters/issues",
"homepage": "https://docs.astro.build/en/guides/integrations-guide/cloudflare/",
"exports": {
".": "./dist/index.js",
"./entrypoints/server.js": "./dist/entrypoints/server.js",
"./entrypoints/middleware.js": "./dist/entrypoints/middleware.js",
"./image-service": "./dist/entrypoints/image-service.js",
"./image-endpoint": "./dist/entrypoints/image-endpoint.js",
"./package.json": "./package.json"
},
"files": [
"dist"
],
"scripts": {
"build": "astro-scripts build \"src/**/*.ts\" && tsc",
"test": "astro-scripts test \"test/**/*.test.js\""
},
"dependencies": {
"@astrojs/internal-helpers": "0.4.2",
"@astrojs/underscore-redirects": "^0.6.0",
"@cloudflare/workers-types": "^4.20250109.0",
"esbuild": "^0.24.0",
"estree-walker": "^3.0.3",
"magic-string": "^0.30.17",
"miniflare": "^3.20241230.1",
"tiny-glob": "^0.2.9",
"vite": "^6.0.7",
"wrangler": "^3.101.0"
},
"peerDependencies": {
"astro": "^5.0.0"
},
"devDependencies": {
"astro": "workspace:*",
"astro-scripts": "workspace:*",
"cheerio": "1.0.0",
"execa": "^8.0.1",
"fast-glob": "^3.3.3",
"rollup": "^4.30.1",
"strip-ansi": "^7.1.0"
},
"publishConfig": {
"provenance": true
}
}
15 changes: 15 additions & 0 deletions packages/integrations/cloudflare/src/entrypoints/image-endpoint.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import type { APIRoute } from 'astro';

export const prerender = false;

export const GET: APIRoute = (ctx) => {
const href = ctx.url.searchParams.get('href');
if (!href) {
return new Response("Missing 'href' query parameter", {
status: 400,
statusText: "Missing 'href' query parameter",
});
}

return fetch(new URL(href, ctx.url.origin));
};
39 changes: 39 additions & 0 deletions packages/integrations/cloudflare/src/entrypoints/image-service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import type { ExternalImageService } from 'astro';

import { joinPaths } from '@astrojs/internal-helpers/path';
import { baseService } from 'astro/assets';
import { isESMImportedImage, isRemoteAllowed } from '../utils/assets.js';

const service: ExternalImageService = {
...baseService,
getURL: (options, imageConfig) => {
const resizingParams = [];
if (options.width) resizingParams.push(`width=${options.width}`);
if (options.height) resizingParams.push(`height=${options.height}`);
if (options.quality) resizingParams.push(`quality=${options.quality}`);
if (options.fit) resizingParams.push(`fit=${options.fit}`);
if (options.format) resizingParams.push(`format=${options.format}`);

let imageSource = '';
if (isESMImportedImage(options.src)) {
imageSource = options.src.src;
} else if (isRemoteAllowed(options.src, imageConfig)) {
imageSource = options.src;
} else {
// 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
return options.src;
}

const imageEndpoint = joinPaths(
// @ts-expect-error Can't recognise import.meta.env
import.meta.env.BASE_URL,
'/cdn-cgi/image',
resizingParams.join(','),
imageSource,
);

return imageEndpoint;
},
};

export default service;
12 changes: 12 additions & 0 deletions packages/integrations/cloudflare/src/entrypoints/middleware.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import type { MiddlewareHandler } from 'astro';

export const onRequest: MiddlewareHandler = (context, next) => {
if (context.isPrerendered) {
// @ts-expect-error
context.locals.runtime ??= {
env: process.env,
};
}

return next();
};
96 changes: 96 additions & 0 deletions packages/integrations/cloudflare/src/entrypoints/server.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
import type {
CacheStorage as CLOUDFLARE_CACHESTORAGE,
Request as CLOUDFLARE_REQUEST,
ExecutionContext,
} from '@cloudflare/workers-types';
import type { SSRManifest } from 'astro';
import { App } from 'astro/app';
import { setGetEnv } from 'astro/env/setup';
import { createGetEnv } from '../utils/env.js';

type Env = {
[key: string]: unknown;
ASSETS: { fetch: (req: Request | string) => Promise<Response> };
ASTRO_STUDIO_APP_TOKEN?: string;
};

export interface Runtime<T extends object = object> {
runtime: {
env: Env & T;
cf: CLOUDFLARE_REQUEST['cf'];
caches: CLOUDFLARE_CACHESTORAGE;
ctx: ExecutionContext;
};
}

export function createExports(manifest: SSRManifest) {
const app = new App(manifest);

const fetch = async (
request: Request & CLOUDFLARE_REQUEST,
env: Env,
context: ExecutionContext,
) => {
const { pathname } = new URL(request.url);

// static assets fallback, in case default _routes.json is not used
if (manifest.assets.has(pathname)) {
return env.ASSETS.fetch(request.url.replace(/\.html$/, ''));
}

const routeData = app.match(request);
if (!routeData) {
// https://developers.cloudflare.com/pages/functions/api-reference/#envassetsfetch
const asset = await env.ASSETS.fetch(
request.url.replace(/index.html$/, '').replace(/\.html$/, ''),
);
if (asset.status !== 404) {
return asset;
}
}

Reflect.set(
request,
Symbol.for('astro.clientAddress'),
request.headers.get('cf-connecting-ip'),
);

process.env.ASTRO_STUDIO_APP_TOKEN ??= (() => {
if (typeof env.ASTRO_STUDIO_APP_TOKEN === 'string') {
return env.ASTRO_STUDIO_APP_TOKEN;
}
})();

const locals: Runtime = {
runtime: {
env: env,
cf: request.cf,
caches: caches as unknown as CLOUDFLARE_CACHESTORAGE,
ctx: {
waitUntil: (promise: Promise<any>) => context.waitUntil(promise),
// Currently not available: https://developers.cloudflare.com/pages/platform/known-issues/#pages-functions
passThroughOnException: () => {
throw new Error(
'`passThroughOnException` is currently not available in Cloudflare Pages. See https://developers.cloudflare.com/pages/platform/known-issues/#pages-functions.',
);
},
props: {},
},
},
};

setGetEnv(createGetEnv(env));

const response = await app.render(request, { routeData, locals });

if (app.setCookieHeaders) {
for (const setCookieHeader of app.setCookieHeaders(response)) {
response.headers.append('Set-Cookie', setCookieHeader);
}
}

return response;
};

return { default: { fetch } };
}
Loading
Loading