-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cloudflare): added config for _routes.json generation (#8459)
* added config for _routes.json generation * added changeset * renamed test file * updated comments * Apply suggestions from code review Co-authored-by: Sarah Rainsberger <[email protected]> * worked on tests * worked on docs * worked on docs * worked on tests * updated pnpm-lock.yaml * worked on tests * moved the _worker.js in cloudflareSpecialFiles statement --------- Co-authored-by: Sarah Rainsberger <[email protected]> Co-authored-by: Alexander Niebuhr <[email protected]>
- Loading branch information
1 parent
4c4ad9d
commit 2365c12
Showing
20 changed files
with
377 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@astrojs/cloudflare': minor | ||
--- | ||
|
||
Adds three new config options for `_routes.json` generation: `routes.strategy`, `routes.include`, and `routes.exclude`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 1 addition & 3 deletions
4
...test/fixtures/routesJson/astro.config.mjs → ...est/fixtures/routes-json/astro.config.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
import { defineConfig } from 'astro/config'; | ||
import cloudflare from '@astrojs/cloudflare'; | ||
|
||
export default defineConfig({ | ||
adapter: cloudflare({ mode: 'directory' }), | ||
// adapter will be set dynamically by the test | ||
output: 'hybrid', | ||
redirects: { | ||
'/a/redirect': '/', | ||
}, | ||
srcDir: process.env.SRC | ||
}); |
File renamed without changes.
1 change: 1 addition & 0 deletions
1
packages/integrations/cloudflare/test/fixtures/routes-json/public/_redirects
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/redirectme / 302 |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions
5
packages/integrations/cloudflare/test/fixtures/routes-json/src/mixed/pages/a/[...rest].astro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
export const prerender=false; | ||
--- | ||
|
||
ok |
5 changes: 5 additions & 0 deletions
5
packages/integrations/cloudflare/test/fixtures/routes-json/src/mixed/pages/a/[id].astro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
export const prerender=false; | ||
--- | ||
|
||
ok |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.