0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-23 21:53:55 -05:00
The web framework for content-driven websites. ️ Star to support our work!
Find a file
Ben Holmes c0c509b6bf
Actions experimental release (#10858)
* feat: port astro-actions poc

* feat: basic blog example

* feat: basic validationError class

* feat: standard error types and safe() wrapper

* refactor: move enhanceProps to astro:actions

* fix: throw internal server errors

* chore: refine enhance: true error message

* fix: remove FormData fallback from route

* refactor: clarify what enhance: true allows

* feat: progressively enhanced comments

* chore: changeset

* refactor: enhance -> acceptFormData

* wip: migrate actions to core

* feat: working actions demo from astro core!

* chore: changeset

* chore: delete old changeset

* fix: Function type lint

* refactor: expose defineAction from `astro:actions`

* fix: add null check to experimental

* fix: export `types/actions.d.ts`

* feat: more robust form data parsing

* feat: support formData from rpc call

* feat: remove acceptFormData flag requirement

* feat: add actions.d.ts type reference on startup

* refactor: actionNameProps -> getNameProps

* fix: actions type import

* chore: expose zod from `astro:actions`

* fix: zod export path

* feat: add explicit `accept` property

* Use zod package instead of relative path outside of src

* feat: clean up error throwing and handling flow

* fix: make `accept` optional

* docs: beef up actions experimental docs

* fix: defineAction type narrowing on `accept`

* fix: bad `getNameProps()` arg type

* refactor: move to single `error` object + `isInputError()` util

* fix: move res.json() parse to avoid double parse

* feat: support async zod schemas

* feat: serialize and expose zod properties on input error

* feat: test input error in comment example

* fix: remove ZodError import

* fix: add actions-module to files export

* fix: use workspace for test pkg versions

* refactor: default export -> server export

* fix: type inference for json vs. form

* refactor: accept form -> defineFormAction

* refactor: better callSafely signature

* feat: block action calls from the server with RFC link

* feat: move getActionResult to global

* refactor: getNameProps -> getActionProps

* refactor: body.toString()

* edit: capitAl

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

* edit: highlight `actions`

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

* edit: add actions file name

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

* edit: not you can. You DO

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

* edit: declare with feeling

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

* edit: clarify what the `handler` does

* edit: schema -> input

* edit: add FormData mdn reference

* edit: add defineFormAction() explainer

* refactor: inline getDotAstroTypeRefs

* edit: yeah yeah maybe

* fix: existsSync test mock

* refactor: use callSafely in middleware

* test: upgradeFormData()

* chore: stray console log

* refactor: extract helper functions

* fix: include status in error response

* fix: return `undefined` when there's no action result

* fix: content-type

* test: e2e like button action

* test: comment e2e

* fix: existsSync mock for other sync test

* test: action dev server raw fetch

* test: build preview

* chore: fix lock

* fix: add dotAstroDir to existsSync

* chore: slim down e2e fixture

* chore: remove unneeded disabled test

* refactor: better api context error

* fix: return `false` for envDts

* refactor: defineFormAction -> defineAction with accept

* fix: check FormData on getActionProps

* edit: uppercase

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

* fix: add switch default for 500

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

* fix: add `toLowerCase()` on content-type check

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

* chore: use VIRTUAL_MODULE_ID for plugin

* fix: remove incorrect ts-ignore

* chore: remove unneeded POST method check

* refactor: route callSafely

* refactor: error switch case to map

* chore: add link to trpc error code table

* fix: add readable error on failed json.stringify

* refactor: add param -> callerParam with comment

* feat: always return safe from getActionResult()

* refactor: move actions module to templates/

* refactor: remove unneeded existsSync on dotAstro

* fix: hasContentType util for toLowerCase()

* chore: comment on 415 code

* refactor: upgradeFormData -> formDataToObj

* fix: avoid leaking stack in production

* refactor: defineProperty with write false

* fix: revert package.json back to spaces

* edit: use config docs for changeset

* refactor: stringifiedActionsPath -> stringifiedActionsImport

* fix: avoid double-handling for route

* fix: support zero arg actions

* refactor: move actionHandler to helper fn

* fix: restore mdast deps

* docs: add `output` to config

---------

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
Co-authored-by: bholmesdev <bholmesdev@gmail.com>
2024-05-08 07:53:17 -04:00
.changeset Actions experimental release (#10858) 2024-05-08 07:53:17 -04:00
.devcontainer chore(deps): update mcr.microsoft.com/devcontainers/javascript-node docker tag to v1 (#10902) 2024-04-30 11:57:42 +08:00
.github fix(actions): Make it possible for users with write access to make preview releases (#10903) 2024-04-29 12:51:30 +02:00
.gitpod chore: removed adapters cleanup (#8726) 2023-10-10 19:36:35 +05:30
.vscode update prettier width (#2968) 2022-04-02 14:15:41 -06:00
benchmark Fix typos (#10923) 2024-05-01 13:56:38 +08:00
examples [ci] release (#10890) 2024-05-02 19:59:20 +08:00
packages Actions experimental release (#10858) 2024-05-08 07:53:17 -04:00
scripts Fix typos (#10923) 2024-05-01 13:56:38 +08:00
.editorconfig chore: upgrade biome and renovate (#10879) 2024-04-26 07:20:59 +01:00
.git-blame-ignore-revs chore: ignore commit (#10181) 2024-02-21 14:13:24 +00:00
.gitignore feat(audits): Add initial perf audits (#10015) 2024-02-14 14:01:53 +01:00
.gitpod.yml chore: removed adapters cleanup (#8726) 2023-10-10 19:36:35 +05:30
.npmrc Handle compiler breaking change (#5803) 2023-01-12 22:46:56 +08:00
.nvmrc Fix test runner issues by upgrading nodejs version to 18.17.1 (#10672) 2024-04-04 15:08:25 +08:00
.prettierignore chore: use Biome to format JS files (#10788) 2024-04-17 09:37:22 +01:00
biome.json chore: upgrade biome and renovate (#10879) 2024-04-26 07:20:59 +01:00
CONTRIBUTING.md docs: fix typo in CONTRIBUTING.md (#10910) 2024-05-01 14:08:53 +08:00
eslint.config.js chore: remove eslint plugins (#10874) 2024-04-25 10:14:05 +01:00
LICENSE Implement new a11y audits for the Dev Toolbar app (#9170) 2023-12-04 11:16:27 -06:00
package.json fix(deps): update all non-major dependencies (#10901) 2024-04-30 12:00:05 +08:00
pnpm-lock.yaml Actions experimental release (#10858) 2024-05-08 07:53:17 -04:00
pnpm-workspace.yaml Upgrade turbo (#6911) 2023-04-27 11:39:15 +08:00
prettier.config.js chore: use Biome to format JS files (#10788) 2024-04-17 09:37:22 +01:00
README.md Compress banner image (#9493) 2023-12-22 16:48:12 +00:00
SECURITY.md Update security flow to report on GitHub (#10328) 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 (#2455) 2022-03-08 15:46:11 -06:00
tsconfig.base.json feat(assets): Delete original assets unused outside of the optimization pipeline (#8954) 2023-11-08 10:23:23 +01:00
tsconfig.eslint.json feat: use typescript-eslint@v6's reworked configs (#7425) 2023-07-03 20:59:43 +08:00
tsconfig.json chore: add empty tsconfig to prevent TypeScript from crawling (#4937) 2022-09-30 16:02:39 -05:00
turbo.json Update turbo test dependsOn (#10329) 2024-03-05 15:16:55 +00:00

Build the web you want


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

Build Status 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 astro version
@astrojs/preact astro version
@astrojs/solid-js astro version
@astrojs/svelte astro version
@astrojs/vue astro version
@astrojs/lit astro version
@astrojs/node astro version
@astrojs/vercel astro version
@astrojs/cloudflare astro version
@astrojs/partytown astro version
@astrojs/sitemap astro version
@astrojs/tailwind astro version
@astrojs/alpinejs astro version
@astrojs/mdx astro 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.