0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-01-06 22:10:10 -05:00
The web framework for content-driven websites. ️ Star to support our work!
Find a file
Ben Holmes d10f91815e
Actions middleware ()
* add manual middleware config option with getMiddlewareContext()

* refactor requestInfo to action object

* set action error response status from render context

* update automatic middleware to plain POST handler

* fix missing Locals type

* test: add separate POST and cookie forwarding tests

* remove actions.middleware flag

* add docs on actionResultAlreadySet

* test: use Astro.rewrite instead of middleware next(). TODO: fix next()

* fix type errors from rebase

* test: remove middleware handler

* test: use cookie forwarding for 'lots of fields'

* refactor: _isPrerendered -> ctx.isPrerendered

* expose getOriginPathname as middleware utility

* add support for handling RPC action results from middleware

* test: RPC security middleware

* refactor POST route handler to use getMiddlewareContext()

* remove unused actionRedirect flag

* changeset

* test: add expectedd rewrite failure for Ema to debug

* fix e2e test

* nit: form -> from

Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>

* rename getMiddlewareContext -> getActionContext

* rename form-action -> form

* move /_actions/ route pattern to const

* move type defs to user-accessible ActionMiddlewareContext type

* export action middleware context type

* strip omitted fields for Action API Context

* add satisfies to type for good measure

* move getOriginPathname to shared ctx.originPathname

* remove `next()` rewrite because it isn't supported

* fix empty forms raising a 415

* fix missing async on cookie example

* nit: ctx -> context

* fix json parse error when content length is 0

* refactor body parsing to function

* edit: migration -> updating your HTML form actions

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

* update changeset to match docs v5 guide

* add absolute urls to changeset links

---------

Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2024-11-08 17:03:57 -05:00
.changeset Actions middleware () 2024-11-08 17:03:57 -05:00
.devcontainer chore(deps): update mcr.microsoft.com/devcontainers/javascript-node docker tag to v1 () 2024-04-30 11:57:42 +08:00
.github Merge branch 'main' into next 2024-11-06 23:17:39 +08:00
.gitpod chore: removed adapters cleanup () 2023-10-10 19:36:35 +05:30
.vscode Merge output: hybrid and output: static () 2024-09-07 01:07:09 +02:00
benchmark Merge branch 'main' into next 2024-11-06 23:17:39 +08:00
examples [ci] release (beta) () 2024-11-06 23:47:57 +08:00
packages Actions middleware () 2024-11-08 17:03:57 -05:00
scripts Merge branch 'main' into next 2024-11-06 23:17:39 +08:00
.editorconfig chore: upgrade biome and renovate () 2024-04-26 07:20:59 +01:00
.git-blame-ignore-revs chore: add formatting commit to blame ignore () 2024-08-08 12:14:37 +02:00
.gitignore Use real filesystem for unit testing () 2024-10-15 15:34:42 +08:00
.gitpod.yml chore: removed adapters cleanup () 2023-10-10 19:36:35 +05:30
.npmrc Remove resolve package and refactor db & studio exports () 2024-06-26 11:19:16 +02:00
.nvmrc Fix test runner issues by upgrading nodejs version to 18.17.1 () 2024-04-04 15:08:25 +08:00
.prettierignore chore: use Biome to format JS files () 2024-04-17 09:37:22 +01:00
biome.jsonc fix(deps): update all non-major dependencies () 2024-11-06 21:47:42 +08:00
CONTRIBUTING.md Merge branch 'main' into next 2024-10-15 16:19:58 +08:00
eslint.config.js chore: move lint rules to Biome () 2024-10-08 10:12:40 +01:00
LICENSE Implement new a11y audits for the Dev Toolbar app () 2023-12-04 11:16:27 -06:00
package.json Merge branch 'main' into next 2024-11-06 23:17:39 +08:00
pnpm-lock.yaml [ci] release (beta) () 2024-11-06 23:47:57 +08:00
pnpm-workspace.yaml Use real filesystem for unit testing () 2024-10-15 15:34:42 +08:00
prettier.config.js update formatter config () 2024-08-08 12:12:50 +02:00
README.md chore: update CI badge () 2024-10-22 13:26:06 +01:00
SECURITY.md Update security flow to report on GitHub () 2024-03-08 09:58:29 +00:00
SECURITY_CONTACTS Update SECURITY_CONTACTS 2024-03-04 09:36:29 -08:00
STYLE_GUIDE.md Move from yarn to pnpm () 2022-03-08 15:46:11 -06:00
tsconfig.base.json feat(assets): Delete original assets unused outside of the optimization pipeline () 2023-11-08 10:23:23 +01:00
tsconfig.eslint.json feat: use typescript-eslint@v6's reworked configs () 2023-07-03 20:59:43 +08:00
tsconfig.json chore: add empty tsconfig to prevent TypeScript from crawling () 2022-09-30 16:02:39 -05:00
turbo.json Upgrade to turbo v2 () 2024-08-15 11:41:21 +08:00

Build the web you want


Astro is a website build tool for the modern web —
powerful developer experience meets lightweight output.

main next License npm version

Install

The recommended way to install the latest version of Astro is by running the command below:

npm create astro@latest

You can also install Astro manually by running this command instead:

npm install --save-dev astro

Looking for help? Start with our Getting Started guide.

Looking for quick examples? Open a starter project right in your browser.

Documentation

Visit our official documentation.

Support

Having trouble? Get help in the official Astro Discord.

Contributing

New contributors welcome! Check out our Contributors Guide for help getting started.

Join us on Discord to meet other maintainers. We'll help you get your first contribution in no time!

Directory

Package Release Notes
astro astro version
create-astro create-astro version
@astrojs/react @astrojs/react version
@astrojs/preact @astrojs/preact version
@astrojs/solid-js @astrojs/solid version
@astrojs/svelte @astrojs/svelte version
@astrojs/vue @astrojs/vue version
@astrojs/lit @astrojs/lit version
@astrojs/node @astrojs/node version
@astrojs/vercel @astrojs/vercel version
@astrojs/cloudflare @astrojs/cloudflare version
@astrojs/partytown @astrojs/partytown version
@astrojs/sitemap @astrojs/sitemap version
@astrojs/tailwind @astrojs/tailwind version
@astrojs/alpinejs @astrojs/alpinejs version
@astrojs/mdx @astrojs/mdx version
@astrojs/db @astrojs/db version
@astrojs/rss @astrojs/rss version
@astrojs/netlify @astrojs/netlify version

CII Best Practices

Several official projects are maintained outside of this repo:

Project Repository
@astrojs/compiler withastro/compiler
Astro Language Tools withastro/language-tools

Sponsors

Astro is free, open source software made possible by these wonderful sponsors.

❤️ Sponsor Astro! ❤️

Astro's sponsors.