0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00
Commit graph

7769 commits

Author SHA1 Message Date
Arsh
dc87214141
feat: middleware and virtual routes (#10206)
* add test

* app

* dev

* api route -> page

* adjust test

* add changeset

* remove `any`

* DEFAULT_404_COMPONENT constant

* Apply suggestions from code review

* Apply suggestions from code review

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

---------

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2024-03-08 22:09:12 +05:30
Bjorn Lu
8107a2721b
Treeshake unused Astro scoped styles (#10291) 2024-03-08 23:03:02 +08:00
Sarah Rainsberger
3faa1b8fce [ci] format 2024-03-08 14:06:26 +00:00
Sarah Rainsberger
580d333f25
[docs] update JSDoc for formatting in docs (#10372) 2024-03-08 14:05:28 +00:00
Erika
78bafc5d66
fix(tsconfigs): Add jsx: 'preserve' to the base template (#10368)
* fix(tsconfigs): Add `jsx: 'preserve'` to the base template

* chore: changeset
2024-03-08 13:45:43 +00:00
Zhang Zhipeng
b44f830a0e [ci] format 2024-03-08 13:11:08 +00:00
Zhang Zhipeng
1ea0a25b94
Add multiple cdn v2 (#10189)
* feat: add multiple cdn

* add multiple cdn test

* assetsPrefix not empty string

* add changeset

* simplify code

* change docs

* replace getFileExtension with node path.extname

* Adapt node extname

* multiple image test

* wip space

* update docs

* update docs, assetsPrefix type

* update docs

* update docs

* chore: update types and rename to `fallback`

* enhance changelog

* change docs

* update change defaultAeestsPrefix to fallback key test

* move utility to a new to avoid importing `node:path` inside vite plugins

* Update packages/astro/src/@types/astro.ts

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

* Apply suggestions from code review

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

* chore: address Bjorn's comments

* kill the variable

* kill the variable /2

* Fix CI fail

* Apply suggestions from code review

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

* uniform code sample

* add `.` string for fit getAssetsPrefix

* Fix extension function

---------

Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: bluwy <bjornlu.dev@gmail.com>
Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
2024-03-08 13:10:07 +00:00
Bjorn Lu
d9336668e5 [ci] format 2024-03-08 13:04:14 +00:00
Bjorn Lu
e3f02f5fb1
Add experimental.directRenderScript option (#10102)
* Add `experimental.directRenderScript` option

* Support inlining scripts

* Use compiler preview release

* Address feedback

* Fix

* Add enable by default note

* Fix build

* Dedupe rendered scripts

* Fix test

* Update deps

* Update .changeset/cool-jobs-fetch.md

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

* Update jsdoc

* Typo

* resolve merge conflicts

* Fix examples check fail

---------

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
2024-03-08 13:03:02 +00:00
StandardGage
c081adf998
Allow Code Component to have custom props and extra class styles (#9960)
* Create simple react element if element has no children

* Fix for when element has text

* add changeset

* Add additionalProps to Code component and ShikiHighlighter.highlight()

* Add changeset

* Create simple react element if element has no children

* Fix for when element has text

* add changeset

* Add additionalProps to Code component and ShikiHighlighter.highlight()

* Add changeset

* reverted accidental changes

* remove unnecessary parts

* Add HTMLAttributes type to additionalProps

* Update .changeset/calm-bags-deliver.md

Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>

* extend HTMLAtts instead

* add suggestions

* feat: address reviews

* chore: remove empty line

* feat: move attributes to options

---------

Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
2024-03-08 13:02:53 +00:00
Erika
01497f2bc2
fix(toolbar): Fixes some errors tests after merges brought up (#10371) 2024-03-08 12:48:44 +00:00
Bjorn Lu
9e1ef6f0c9
Fix mdx test fail with rehype-pretty-code (#10370) 2024-03-08 20:39:15 +08:00
Erika
de9911bbb5 [ci] format 2024-03-08 11:16:35 +00:00
Erika
5c7862a9fe
feat(audits): Add new UI (#10217)
* feat(audits): Add selected style for audits

* feat(audits): Fully add new style

* feat: new iteration

* chore: changeset

* feat: separate audits by category

* fred pass

* feat: new UI

* refactor: fix everything

* fix: recreate UI on further lints

* fix: remove unnecessary changes

* chore: lockfile

* fix: tryout for descriptions

* fix: remove change, will do in other PR

* Apply suggestions from code review

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

* test: fix

* nit: format styles

---------

Co-authored-by: Fred K. Schott <fkschott@gmail.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2024-03-08 12:10:38 +01:00
Erika
c7edb22b4b [ci] format 2024-03-08 10:58:49 +00:00
Erika
2013e70bce
feat(audits): Handle mutations (#10268)
* feat(audits): Handle mutations

* chore: changeset

* nit: add comments
2024-03-08 11:56:23 +01:00
Oliver Speir
0204b7de37
Reload scripts (#9977)
* do not add astroExec if data-astro-reload attr exists

* add changeset

* Update .changeset/rare-coins-jump.md

Co-authored-by: Martin Trapp <94928215+martrapp@users.noreply.github.com>

* change to data-astro-rerun

* Update .changeset/rare-coins-jump.md

Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>

* add example to changeset

---------

Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
Co-authored-by: Martin Trapp <94928215+martrapp@users.noreply.github.com>
Co-authored-by: Happydev <81974850+MoustaphaDev@users.noreply.github.com>
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
2024-03-08 10:55:41 +00:00
Alexander Niebuhr
65692fa7b5
feat: experimental content collection JSON schemas (#10145)
* feat: experimental content collection JSON schemas

* solves review comments

* solves review comments

* updates changeset

* updates path

* fixes formatting

* removes unrelated changes

* adds test

* fixes lockfile

* chore: fixes package name

* improves code branching depth

* resolves docs comments

Co-authored-by: Sarah Rainsberger <5098874+sarah11918@users.noreply.github.com>

* Update packages/astro/src/content/types-generator.ts

* Update .changeset/slow-items-heal.md

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

* Update packages/astro/src/@types/astro.ts

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

---------

Co-authored-by: Sarah Rainsberger <5098874+sarah11918@users.noreply.github.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2024-03-08 10:54:51 +00:00
Matthew Phillips
9cd84bd19b
Allow islands to be re-rendered with new props on page transition (#10136)
* Allow islands to be re-rendered with new props on page transition

* Adjust the expected styles

* Restore test expectation

* Add changeset and final change

* linting

* Implement transition:persist-props behavior

* Fix lockfile

* Fix expectations

* App is hyrid

* Update .changeset/lovely-nails-cough.md

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

* Update .changeset/lovely-nails-cough.md

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

* Update .changeset/lovely-nails-cough.md

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

---------

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2024-03-08 10:54:16 +00:00
Erika
3307cb34f1
Add new levels of notification for dev toolbar apps (#10252)
* Add new levels of notification

* feat: proper support

* chore: changeset

* fix: remove unrelated change

* test: add test

* feat: implement new icons

* fix: go back to previous layout

* fix: custom app number

---------

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2024-03-08 11:53:48 +01:00
Remco Haszing
a31bbd7ff8
fix(markdown): don’t generate mdast html nodes (#10104)
* fix(markdown): don’t generate mdast html nodes

`html` nodes from mdast are converted to `raw` hast nodes. These nodes
are then not processed by proper rehype plugins. Typically if a remark
plugin generates `html` nodes, this indicates it should have actually
been a rehype plugin.

This changes the remark plugins that generate `html` nodes into rehype
nodes. These were `remarkPrism` and `remarkShiki`.

Closes #9909

* Apply suggestions from code review

* refactor(mdx): move user defined rehype plugins after syntax highlighting

* fix(mdx): fix issue in mdx rehype plugin ordering

* docs: explain why html/raw nodes are avoided in changeset

This also includes some hints on what users could do to upgrade of they
rely on these nodes.

* Fix MDX rehype plugin ordering

* refactor(remark): restore remarkPrism and remarkShiki

They aren’t used anymore, but removing would be a breaking change.

* chore: mark deprecated

* Apply suggestions from code review

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

* Update .changeset/thirty-beds-smoke.md

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

---------

Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2024-03-08 10:53:39 +00:00
Bjorn Lu
5a9528741f
Move to shiki and stabilize dual themes support (#10130)
* Update to shiki

* Stabilize shikiConfig.experimentalThemes

* Add changeset

* Fix merge issues
2024-03-08 10:53:19 +00:00
Erika
959ca5f9f8
feat(toolbar): Allow every element to have every color (#10186)
* feat(toolbar): Allow every element to have every color

* chore: changeset

* fix: add validatio

* fix: ok but what happened even

* nit: cooler messages

* fix: toggles
2024-03-08 11:52:50 +01:00
Bjorn Lu
33616ba226
Update security flow to report on GitHub (#10328) 2024-03-08 09:58:29 +00:00
Bjorn Lu
03f79f005e
Fix check-merge workflow on PRs from forks (#10366) 2024-03-08 16:21:33 +08:00
Nicolas Mattia
ac766647b0
fix(config): prevent vite from loading config (#10360) 2024-03-08 12:22:58 +08:00
Houston (Bot)
82d81a1485
[ci] release (#10362)
* [ci] release

* Update CHANGELOG.md

* Update CHANGELOG.md

* Update CHANGELOG.md

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2024-03-07 19:53:37 -06:00
Chris Swithinbank
3f27e09628
Rename defineDB to defineDb (#10364)
* Rename `defineDB` to `defineDb`

* Add changeset

* Improve changeset
2024-03-07 19:21:03 -06:00
Chris Swithinbank
b6ccaa6dc7
Revert "[ci] release (#10359)" (#10363)
This reverts commit 76c21b19d2.
2024-03-08 01:45:27 +01:00
Houston (Bot)
76c21b19d2
[ci] release (#10359)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-03-07 14:55:50 -05:00
Nate Moore
6964b6f9a6 [ci] format 2024-03-07 19:51:22 +00:00
Nate Moore
7001ae48db
db: scaffold db files when using astro add db (#10349)
* feat(add): scaffold db files

* refactor: no `recursive` needed
2024-03-07 13:50:23 -06:00
Ben Holmes
988aad6705
Add batch support (#10361)
* deps: drizzle preview

* feat: db.batch and method run handling

* refactor: use db.batch in test fixture

* deps: bump to drizzle 0.29.5

* chore: changeset

* fix: unpin drizzle version

* fix: db execute should uh... execute
2024-03-07 14:49:46 -05:00
Chris Swithinbank
52fba64cb2 [ci] format 2024-03-07 19:20:45 +00:00
Chris Swithinbank
2e4958c8a7
Add integrations API for db config/seed files (#10321)
* Add integrations API for adding db config/seed files

* Fix seeding when user seed file is present

* Add basic test and fixture for integrations API

* Freeze that lockfile

* Test to see if this is a Windows fix

* Don’t import.meta.glob integration seed files

* Make integration seed files export a default function

* style: rejiggle

* Fix temporary file conflicts

* Remove changes to Astro’s core types, type utility method instead

* Use `astro:db` instead of `@astrojs/db`

* Revert unnecessarily cautious temporary path name

This reverts commit ef2156e41b.

* Add changeset

* Fix entrypoints and `asDrizzleTable` usage in changeset

* Getting Nate in on the co-author action

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>

* Fix user seed file in integrations fixture

* Update `seedLocal()` after merge

* Provide empty `seedFiles` array in `db execute`

---------

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2024-03-07 20:19:17 +01:00
Ben Holmes
e086a9f8c8 [ci] format 2024-03-07 18:39:47 +00:00
Ben Holmes
06fe94e29d
Add --remote flag for remote connection (#10352)
* feat: check for --remote

* chore: remove bad ticketing example cols

* fix: get seed file working with build

* Revert "fix: get seed file working with build"

This reverts commit 92830a106164b0997c820a3e0bf2a582018084a0.

* fix: seed from build instead of runtime

* refactor: move recreateTables out of runtime

* Revert "refactor: move recreateTables out of runtime"

This reverts commit d01a802ad7915fabc4c4ac35b2d907eae0538d95.

* fix: in-memory db for test fixture

* chore: changeset

* refactor: generate random db name instead

* refactor: use yargs-parser for flag

* chore: remove in-memory db logi

* refactor: rename random id flag for clarity

* feat: support --remote in dev

* feat: support --remote on shell

* refactor: inline db client

* feat: support --remote on db execute

* chore: stray console log

* chore: remove recreateTables from runtime

* chore: update seeding for new signature

* chore: remove unused error imports
2024-03-07 13:38:43 -05:00
Nate Moore
123f6f8551 [ci] format 2024-03-07 18:16:14 +00:00
Nate Moore
2aec2cdc21
Adds create-astro fallback values for package versions (#10255)
* fix(create-astro): add fallback when registry fails to return the current package version

* feat(create-astro): inline most current package versions as fallback

* test(create-astro): update typescript tests to check for undefined

* test(create-astro): properly reset fixtures

* refactor: read dependencies from workspace root

* refactor: error on missing values
2024-03-07 12:14:48 -06:00
Chris Swithinbank
bad9b583a2
Update seed to use export default function() instead of top-level await (#10334)
* Update fixtures seed files to export default function

* Call default export when running seed files

* Add changeset
2024-03-07 13:04:16 -05:00
Ben Holmes
5a9dab286f
Fix: drizzle vs. config runtime export conflict (#10357)
* fix: drizzle vs config export problem

* chore: remove drizzle runtime export

* chore: changeset
2024-03-07 12:55:33 -05:00
Matthew Phillips
652bd497dc [ci] format 2024-03-07 16:38:45 +00:00
Matthew Phillips
9f422e9bd3
db: rename experimentalVersion to version (#10348)
* db: rename experimentalVersion to version

* Fix tests

* Update .changeset/fluffy-bobcats-arrive.md

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

---------

Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
2024-03-07 11:37:36 -05:00
Arsh
e7eb83252e [ci] format 2024-03-07 16:26:03 +00:00
Arsh
33583e8b31
fix(rendering): prevent removal of necessary <astro-slot> elements (#10317)
* fix(rendering): prevent removal of necessary `<astro-slot>` elements

* add test

* add changeset

* missed a spot

* adjust test

* assume `supportsAstroStaticSlot`

* bring back accidentally removed `markHTMLString` call
2024-03-07 21:55:03 +05:30
Houston (Bot)
3de48e8f62
[ci] release (#10354)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-03-07 15:31:00 +00:00
Emanuele Stoppa
8ce9fffd44
fix(routing): regression on partial dynamic routes (#10355)
* fix(routing): regression on partial dynamic routes

* Update .changeset/eight-spoons-nail.md

Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>

---------

Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
2024-03-07 14:48:39 +00:00
Arsh
4eab7f4ac3 [ci] format 2024-03-07 14:46:00 +00:00
Arsh
f33cce8f6c
fix(Astro global): parity with ctx.site (#10325)
* move `createResult()` into `RenderContext`

* `Astro.site`-`ctx.site` parity

* shared `clientAdress()` implementation

* remove base from `manifest.site`

* astro global tests

* add api context tests

* add changeset

* flaky test

* error on `Astro.response.headers` reassignment
2024-03-07 14:44:53 +00:00
Ross Robino
fdd5bf277e
fix: client prerender fallback (#10295)
* fix: client prerender fallback

* Use Speculation Rules prefetch as prerender fallback instead of link tag, improve changeset

* Update .changeset/warm-spoons-fetch.md

---------

Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
2024-03-07 13:31:30 +00:00