Commit graph

2003 commits

Author SHA1 Message Date
Matthew Phillips
609b249c8d
Revert "Deno fix #6131 (#6248)" (#6281)
* Revert "Deno fix #6131 (#6248)"

This reverts commit ef5cea4dc5.

* Create gold-months-live.md
2023-02-17 10:58:53 -05:00
Bjorn Lu
d9474d467e
Bump Vite to 4.1 (#6277) 2023-02-17 22:16:25 +08:00
Houston (Bot)
a486104692
[ci] release (#6269)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-02-17 14:48:21 +01:00
Erika
0f5d122cd5
fix(create-astro): Pin giget to 1.0.0 (#6278) 2023-02-17 14:45:47 +01:00
Julien Barbay
dbffee4e38
fix: add property name to rss errors (#6259)
* fix: add property name to rss errors

* Create good-snails-attend.md

---------

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2023-02-16 15:33:12 -06:00
Houston (Bot)
17869bf749
[ci] release (#6267)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-02-16 15:15:51 -06:00
Nate Moore
066b4b4efc
Improve create-astro error handling (#6266)
* fix(create-astro): improve error handling for tasks that use spinner display

* refactor: timeout after 60s

* chore: remove unused file
2023-02-16 14:28:15 -06:00
Houston (Bot)
fb4e79bf1f
[ci] release (#6261)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-02-16 14:36:33 -05:00
Ben Holmes
2fec478487
Fix: recursive getCollection() hanging (#6257)
* fix: avoid trying to SSR md?astroPropagatedAssets

* test: layout prop with recursive getCollection

* chore: changeset
2023-02-16 12:32:50 -05:00
Chris Swithinbank
0fe74b6648
Only inject Vercel analytics in production (#6258)
* Only inject Vercel analytics in production

* Add changeset
2023-02-16 09:19:08 -06:00
wulinsheng123
ef5cea4dc5
Deno fix #6131 (#6248)
* fix: #6131

* fix: delete

* update code

* fix: fix bug

* add some tests

* fix route error

* delete comment

* delete trash code

---------

Co-authored-by: wuls <linsheng.wu@beantechs.com>
2023-02-16 09:16:07 -06:00
Bjorn Lu
0049fda62f
Support rehype plugins that inject namespaced attributes 2 (#6253) 2023-02-16 18:53:30 +08:00
Houston (Bot)
66acc6a65c
[ci] release (#6251)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-02-15 22:54:16 +08:00
Bjorn Lu
0fbcf838a7
Revert previous mdx breaking change (#6252) 2023-02-15 22:44:11 +08:00
Bjorn Lu
5c7c7e463d
Fix unmount Svelte slots (#6250) 2023-02-15 22:28:59 +08:00
Houston (Bot)
4b89c2b553
[ci] release (#6239)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-02-15 08:05:27 -05:00
Bjorn Lu
4f6ecba4c1
Support rehype plugins that inject namespaced attributes (#6243)
* Support rehype plugins that inject namespaced attributes

* Fix rehype property casing
2023-02-15 17:06:33 +08:00
Bjorn Lu
1c678f7ebf
Fix hydration path for circular imports (#6244) 2023-02-15 16:49:57 +08:00
Gérald Gounot
ac3649bb58
Add support for SVG images to  @astrojs/image (#6118)
* @astrojs/image: add support for SVG images

* @astrojs/image: add tests for SVG images

* @astrojs/image: update README.md with SVG format info

* Add minor changeset for @astrojs/image
2023-02-15 09:21:41 +01:00
Ben Holmes
deacd5443a
Run integration config hook on astro sync (#6238)
* refactor: move sync to core

* fix: runHookConfigSetup in CLI

* chore: changeset

* fix: sync import on test-utils

* fix: use syncCli in check
2023-02-14 09:26:30 -05:00
Happydev
c397be324f
fix: add support for js/mjs file extensions for Content Collections config file (#6229)
* test: add fixture

* test: add test case

* test: fix tests

* feat: support mjs/ js file extensions for cc config

* chore: sync lockfile

* test: make assertion more specific

* test: make template minimal

* chore: add changeset

* feat: add warning when `allowJs` is `false`

* improve warning

* extract tsconfig loader to another function

* rename to more descriptive variable

* apply review suggestion

Co-authored-by: Ben Holmes <hey@bholmes.dev>

---------

Co-authored-by: Ben Holmes <hey@bholmes.dev>
2023-02-13 22:19:16 +00:00
Houston (Bot)
27a0b6339b
[ci] release (#6200)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-02-13 15:26:13 -05:00
Matthew Phillips
a7f18051b1
Prevent hydration mismatches in Preact (#6215) 2023-02-13 14:48:36 -05:00
Ben Holmes
baa2dbb3b5
Fix getEntryType failure on spaces in file name (#6218)
* fix: avoid url -> file -> url parsing

* chore: changeset
2023-02-13 10:10:33 -05:00
Matthew Phillips
79783fc018
Fix head injection in body with slots.render() and head buffering (#6216)
* Fix head injection in body with slots.render() and head buffering

* Adding a changeset

* An MDX test too
2023-02-13 07:49:10 -05:00
Marvin Frachet
79f49acbe1
Fix 6206: Cloudflare function path resolving one step above (#6208)
* Fix 6206: Cloudflare function path resolving one step above
2023-02-13 02:19:38 +01:00
Nate Moore
8b7cb64dad
Preserve --root CLI flag on restart (#6049)
* fix(#5985): preserve `--root` CLI flag on restart

* fix: resolve --root relative to automatic root

* chore: revert container changes

* fix: pass flags.root to restart container

---------

Co-authored-by: Nate Moore <nate@astro.build>
2023-02-09 14:02:51 -06:00
Houston (Bot)
d6845245f2
[ci] release (#6184)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-02-09 14:27:56 -05:00
Matthew Phillips
a9bdd9cc4e
Fixes usage of Code component in Vercel (#6198)
* Fixes usage of Code component in Vercel

* Adding a changeset
2023-02-09 14:22:57 -05:00
Bryce Russell
c75d319ee6
Fix types for TableHTMLAttributes (#6197)
* Fix types for TableHTMLAttributes

- Add 'string' type to 'border' attribute
- Add 'false | true' to 'frame' attribute

Thanks Princesseuh for helping

* Create sixty-scissors-refuse.md

* Make changeset more descriptive

* Fix previous changset

---------

Co-authored-by: BryceRussell <19967622+BryceRussell@users.noreply.github.com>
2023-02-09 13:12:15 -06:00
Chris Swithinbank
11e1fa9883
Vercel adapter README tweaks (#6191) 2023-02-09 18:14:57 +01:00
Matthew Phillips
3390cb8444
Fix head injection misplacement with Astro.slots.render() (#6196)
* Fix head injection misplacement with Astro.slots.render()

* Adding a changeset

* Fix case of JSX with no layout

* missing break
2023-02-09 11:50:04 -05:00
Dan Jutan
436bd09341
Fix root directory spread pagination url.prev for first page (#6183)
* Fix root pagination `url.prev` for first page

* fix lockfile?

* add changeset
2023-02-08 19:14:47 -05:00
Matthew Phillips
938ad514cd
Ensure base configuration appended to content collection styles (#6182)
* Fix, base appended to propagated scripts

* Test scripts
2023-02-08 17:15:33 -05:00
Matthew Phillips
6fa6025b34
Allow binary data to be returned from api routes in SSG (#6180)
* Allow binary data to be returned from api routes in SSG

* Adding a changeset
2023-02-08 16:42:52 -05:00
Houston (Bot)
919d0db428
[ci] release (#6178)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-02-08 14:11:29 -05:00
Justin Sun
23c60cfa45
feat(vercel): Add support for analytics (Audiences & Web Vitals) (#6148)
* feat(intergration/vercel): add vercel analytics support

* docs(intergration/vercel): add vercel analytics prop

* docs(intergration/vercel): bump version to 3.1.0

* Update packages/integrations/vercel/README.md

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

* docs(intergration/vercel): add file name for example

* feat(intergration/vercel): convert analytics to ts and support in edge

* docs(intergration/vercel): move file names to code blocks as comments

* fix(intergration/vercel): remove unused import

* feat(intergration/vercel): add analytics support to static mode

* chore(intergration/vercel): revert version change

* style(intergration/vercel): add a blank line after astro import

* chore(intergration/vercel): generate file by changeset

* Update .changeset/eighty-bobcats-deliver.md

Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>

* Update packages/integrations/vercel/README.md

Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>

* Update packages/integrations/vercel/src/analytics.ts

Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>

* chore(intergration/vercel): simplify analytics script

---------

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
2023-02-08 13:32:20 -03:00
Ben Holmes
ec2f2a31de
[Content collections] Surface content config errors in overlay (#6170)
* fix: throw error during import to catch error boundary

* fix: throw from astro sync

* chore: changeset

* chore: add comment on why error here

* chore: consolidate imports
2023-02-08 10:43:38 -05:00
Matthew Phillips
8bbdcf17dd
Take dynamic imports into account for CSS ordering (#6176)
* Take dynamic imports into account for CSS ordering

* Adding a changeset

* updated lockfile
2023-02-08 10:15:36 -05:00
Houston (Bot)
d9061da447
[ci] release (#6169)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-02-07 17:08:12 -05:00
Matthew Phillips
c0e4b1df9f
Fix mixed usage of aliases and relative for client hydration (#6168)
* Fix mixed usgae of aliases and relative for client hydration

* Add a changeset
2023-02-07 16:24:05 -05:00
Houston (Bot)
27eecd3998
[ci] release (#6116)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-02-07 13:45:08 -05:00
Matthew Phillips
d1f5611feb
Add additional scoping for head buffering (#6152)
* Add additional scoping for head buffering

* Add test for direct usage of nested component

* Add special scoping for Astro.scopes.render()

* Generate propagation map during the build

* Move to a maybeHead instruction

* Properly serialize for SSR

* More conservative scoping

* Maybe had should honor result._metadata.hasRenderedHead

* Properly type slots

* Allow template result to be passed

* Add changeset
2023-02-07 10:56:32 -05:00
Erika
cee70f5c6a
Fix returning images from endpoints in dev (#6163)
* fix(dev): Fix dev server responses not being encoded following the specified encoding

* test: Add test

* chore: changeset
2023-02-07 16:52:15 +01:00
Matthew Phillips
f6fc662c3c
Prevent ?inline and ?raw CSS from being bundled as CSS (#6161)
* Prevent ?inline and ?raw CSS from being bundled as CSS

* Add a changeset

* oopts

* Replace use of isCSSRequest
2023-02-07 10:49:13 -05:00
Charles F. Munat
460f9e7329
Fix duplicate alt attribute on Picture component. (#6157)
* Fix duplicate alt attribute on Picture component.

* Create tidy-buses-mate.md

---------

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2023-02-06 20:25:17 -06:00
Elliott Marquez
ec38a8921f
[Lit] add client:only functionality to Lit integration (#6111)
* [Lit] add `client:only` functionality to Lit integration

* add changeset

* update lit changeset to minor
2023-02-06 20:01:21 -05:00
Erika
32abe49bd0
Fix polyfills not being available to imports on Netlify (#6117)
* fix(netlify): Try to make polyfill external

* feat(webapi): Add polyfill applier for SSR

* fix(netlify): Externalize polyfills so they're always applied before user code

* chore: changeset

* test(netlify): Add test for polyfill being in the proper place

* config(netlify): Remove unnecessary change to package.json

* revert(netlify): Revert changes

* feat(astro): Add a way for packages to explicitely mark themselves as needing to be external

* Update .changeset/silent-dragons-sell.md

---------

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2023-02-06 14:17:34 -06:00
Isaac
1b591a1431
Check vite.emptyOutDir before emptying dir (#6153)
* Check vite.emptyOutDir before emptying dir

* Fix: add .build to object path

* Update packages/astro/src/core/build/static-build.ts

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

* Create flat-dolphins-admire.md

---------

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2023-02-06 14:16:46 -06:00
wulinsheng123
9fdecb5606
fix: #5979 (#6142)
* fix: #5979

* Update lazy-plums-sit.md

---------

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2023-02-06 13:28:08 -06:00
Andrew Bloyce
592386b755
Move pagination error to AstroErrorData (#6149)
* Move error to AstroErrorData

* Add changeset
2023-02-06 10:30:36 -06:00
Nate Moore
8d2187d8b8
Refactor create-astro (#6082)
* refactor: new version of create-astro

* chore: update README

* fix(create-astro): update project name logic

* test(create-astro): fix test on windows

* test(create-astro): fix test on windows

* test(create-astro): remove unused import

* chore: remove log

* chore: increase test timeout

* fix: message when skipping

* fix: message for env.d.ts file

* fix: always hard exit

* fix: return from next-steps

* chore: add message

* refactor dependencies, bundle create-astro

* chore: disable create-astro typings

* chore: switch to arg

* chore: update message

* fix: split typescript into two steps, fix context test

* chore: update wording

* chore: update wording

* Update packages/create-astro/src/actions/dependencies.ts

Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>

* refactor: move tests back to mocha/chai

* chore: update cli-kit

* update test script

* chore: add comment about setStdout

* chore: update cli-kit

* Update packages/create-astro/src/messages.ts

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

* Update packages/create-astro/src/messages.ts

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

* chore: update lockfile

* fix(create-astro): support scoped package names, improve project-name tests

* better git initialization

* update cli-kit

---------

Co-authored-by: Nate Moore <nate@astro.build>
Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2023-02-06 10:19:37 -06:00
Matthew Phillips
2189170be5
Fix hoisted script propagation in content collection pages (#6119)
* chore: unskip

* chore: stray console logs

* chore: clarify analyzer comments

* wip: store propagated scripts separately

* Implement getting hoisted scripts for propagation

* Add changeset

* fix

* oops

* update based on code review

---------

Co-authored-by: bholmesdev <hey@bholmes.dev>
2023-02-06 10:42:08 -05:00
Fred K. Schott
f20a85b642
Fix outdated error message in paginate() function (#6124)
* Update paginate.ts

* Create gorgeous-mails-sniff.md
2023-02-03 17:34:09 -06:00
Ben Holmes
9f22ac3d09
[Content collections] Fix "underscore to ignore" warnings (#6122)
* refactor: fix underscore check

* fix: add "ignore list" to always silence log

* fix: hide log on file deleted

* refactor: move getEntryType to util

* test: getEntryType unit

* fix: handle all unsupported cases

* chore: changeset
2023-02-03 16:48:34 -05:00
Ben Holmes
bf8d7366ac
[Content collections] Load content config with full Vite setup (#6092)
* feat: use vite dev server for content config

* refactor: improve export naming

* chore: update `sync` to spin up server

* refactor: run sync before build in cli

* fix: move sync call to build setup

* chore: clean up attachContent... types

* chore: remove unneeded comment

* chore: changeset

* fix: attachContentServerListeners in unit tests

* fix: allow forced contentDirExists

* chore: update schema signature

* fix: move content listeners to unit test

* chore remove contentDirExists flag; unused

* chore: stub weird unit test fix
2023-02-03 15:52:05 -05:00
Nacho Vazquez
45b41d98f5
fix: use the root of the project as the functions location (#6075)
* fix: use the root of the project as the functions location
* test: add test to check where the functions folder is added
2023-02-03 16:19:44 +01:00
Bjorn Lu
ac7fb04d6b
Fix scanning sourcemap handling (#6114) 2023-02-03 20:47:20 +08:00
Houston (Bot)
a1c0cbe604
[ci] release (#6109)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-02-02 19:43:30 -05:00
Matthew Phillips
67ccec9e16
Node adapter: handle prerendering and serving with query params (#6110)
* Node adapter: handle prerendering and serving with query params

* Adding a changeset
2023-02-02 19:10:16 -05:00
Matthew Phillips
f9babc38b4
Upgrade preact's dependencies to fix security issue (#6108) 2023-02-02 16:41:10 -05:00
Houston (Bot)
81615c5004
[ci] release (#6094)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-02-02 15:38:04 -05:00
Matthew Phillips
9bec6bc410
Prevent eager rendering of head content in multi-level MDX layout (#6107)
* Prevent eager rendering of head content in multi-level MDX layout

* Adding a changeset

* Remove old comment

* Keep track of slot position as well
2023-02-02 14:21:32 -05:00
Yasser Hennawi
8c80e78dd5
chore: bump vitefu for @astrojs/solid-js (#6104)
Co-authored-by: Yasser Hennawi <yasser.hennawi@nordsec.com>
2023-02-02 23:02:17 +08:00
Daniel
b236b5cc8e
fix: solidjs integration for vercel edge build (adopting same mechanics as cloudflare) (#6085)
* fix solidjs integration for vercel deployment

* downgrade change to patch

---------

Co-authored-by: AirBorne04 <>
2023-02-01 17:16:18 -05:00
Houston (Bot)
a007dbc759
[ci] release (#6089)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-02-01 14:38:18 -05:00
Matthew Phillips
97a97196fc
Move @netlify/functions to be a dep (#6090)
* Move @netlify/functions to be a de

* Adding a changeset
2023-02-01 14:33:37 -05:00
Shiina
6a03649f00
Fix incorrent encoded when path has other language characters (#6088)
* fix: Incorrent encoded when path has Chinese

* chore: exec changeset
2023-02-01 13:53:09 -05:00
Houston (Bot)
f05eb9f8ba
[ci] release (#6048)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-02-01 08:58:35 -05:00
Elliott Marquez
2567aa48bb
[Lit] Forwards compatiblity for streaming Declarative Shadow DOM (#6055)
* Forwards compatiblity for streaming DSD

* add shadowrootmode

* update tests

* add changeset
2023-02-01 08:44:56 -05:00
Ben Holmes
2fb72c887f
[Content collections] Apply MDX components on render (#6064)
* fix: apply MDX components during render()

* test: MDX components export in SSG and SSR

* chore: changeset
2023-02-01 08:33:18 -05:00
Daniel
f91615f5c0
fix: Failed to execute 'encode' on 'TextEncoder': parameter 1 is not of type 'String' in Edge Runtime SSR (#6070)
* minor fixes for errors related to vercel SSR in core

* yielding empty string instead of nothing, to not exit the iterator

---------

Co-authored-by: AirBorne04 <>
2023-02-01 08:26:45 -05:00
Elliott Marquez
0db2204153
[Lit] Fix hydration not having the same reactive values as server (#6080)
* Fix lit hydration not having the same reactive values

* add changeset

* add clientEntrypoint to package exports

* update tests

* add changeset

* only add defer-hydration when strictly necessary

* remove second changest

* fix test typos
2023-02-01 08:18:37 -05:00
Ben Holmes
2ab32b59ef
[MDX] Syntax highlighting after user plugins (#6050)
* fix: load MDX syntax highlighting after user plugins

* chore: changeset
2023-01-31 17:46:59 -05:00
Chris Swithinbank
c6cf847bd0
Revert MDX README changes (#6062) 2023-01-31 15:41:22 +01:00
Mayank
9793f19ecd
error overlay: show cause if available (#6052)
* show `cause` in error overlay

* add extra check for string

* add changeset
2023-01-31 10:12:42 +01:00
Alexey Shmalko
b3e65991f7
fix(image): allow usage of image from any directory (#5932)
Currently, @astrojs/image allows *importing* images from srcDir
only. Importing images from outside srcDir fails miserably *in dev
mode* and produces incorrect src.

This happens because `path.relative(fileURLToPath(config.srcDir), id)`
resolves to "../something" and when joined with '/@astroimage' cancels
it out (`join('/@astroimage', '../../something')` => `'/something'`).

Rework /@astroimage URL scheme to be similar to "/@fs/" scheme—always
export absolute path to the target file.
2023-01-30 15:29:41 -05:00
Renato Lacerda
ca91976edb
Fix GetPictureResult interface (#5894) 2023-01-30 15:29:03 -05:00
Houston (Bot)
a2cbc75ac4
[ci] release (#6041)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-01-30 15:28:32 -05:00
Nate Moore
41e97158ba
Handle invalid argument errors (#6045)
* fix: add error handling for invalid arguments

* chore: add changeset

* Update packages/astro/src/core/errors/errors-data.ts

Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>

---------

Co-authored-by: Nate Moore <nate@astro.build>
Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>
2023-01-30 14:11:54 -06:00
Matthew Phillips
df32011652
Fix Cloudflare directory mode regression (#6046)
* Fix Cloudflare directory mode regression

* Adding a changeset
2023-01-30 14:50:44 -05:00
Houston (Bot)
d9787a6ff6
[ci] release (#5995)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-01-30 12:38:31 -05:00
Nate Moore
e779c62424
fix(#5922): improve top-level return error (#6036)
Co-authored-by: Nate Moore <nate@astro.build>
2023-01-30 11:37:13 -06:00
Matthew Phillips
071e1dee7e
Simplified head injection (#6034)
* Simplified head injection

* Make renderHead also yield an instruction

* Add changeset

* Add mdx test
2023-01-30 11:55:10 -05:00
Ben Holmes
b4432cd6b6
[Content collections] Load MDX hoisted scripts in dev (#6035)
* chore: script, rename delayed -> propagated

* fix: consistent propagatedAssets flag

* feat: inject those scripts in dev!

* test: scripts included in dev and build

* chore: add TODO for prod build fix

* chore: changeset
2023-01-30 11:22:17 -05:00
Happydev
98a4a914bc
Remove outdated MDX import types (#6024) 2023-01-30 16:48:40 +08:00
Caleb Jasik
9c298aa5ae
@astrojs/image: Allow passing undefined to transform options (#6008)
* Allow passing `undefined` to transform options

This fixes #6001, allowing undefined passed as a variable in addition to not passing the property at all

* Create strange-olives-rest.md

* Improve error message for missing `widths` prop

* Add changeset
2023-01-27 18:05:00 +01:00
Tony Sullivan
b994f6f35e
Makes the AstroCookies type importable directly from "astro" (#6006)
* re-exports the AstroCookie type from the main 'astro' types

* chore: add changeset
2023-01-27 11:00:24 -06:00
Juan Miguel Guerrero
1c230f1037
feat(@astrojs/netlify): Add on-demand builders Netlify functions (#5874)
* Add on-demand builders option

* chore: add changeset

* docs: add documentation in configuration section

* Update packages/integrations/netlify/README.md

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

* Update packages/integrations/netlify/README.md

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

* Update packages/integrations/netlify/README.md

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

* Update .changeset/twenty-pans-agree.md

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

---------

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2023-01-27 10:20:34 -05:00
Roy Eden
254eb21c83
fix: autoprefixer on dev mode for tailwind plugin (#6002)
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2023-01-27 23:14:19 +08:00
Anders Kaseorg
12c68343c0
fix: Don’t require getCollection() filter to be a type guard (#5998)
Commit dabce6b8c6 (#5970) broke the use
of a plain boolean filter.  Add an overload similar to TypeScript’s
Array#filter overload:

https://github.com/microsoft/TypeScript/blob/v4.9.4/lib/lib.es5.d.ts#L1442-L1453

Signed-off-by: Anders Kaseorg <andersk@mit.edu>

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2023-01-26 21:03:09 -05:00
Chris Banford
5c64324c0a
Add a check for existing .git directory (and skip if one is found). (#5953)
* Add a check for existing .git directory (and skip if one is found).

* Changeset attempt :-)

* Update .changeset/try-button-rumor.md

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2023-01-26 15:34:49 -05:00
银河渡舟
322e059d0d
fix: undefined remarkPluginFrontmatter after calling render method (#5927)
* Update vite-plugin-content-assets.ts

* Add changeset for #5927

Signed-off-by: Anders Kaseorg <andersk@mit.edu>

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Co-authored-by: Anders Kaseorg <andersk@mit.edu>
2023-01-26 13:47:09 -06:00
Subha Chanda
1c7eef308e
Updated according to new configuration (#5478)
* Updated according to new configuration

Astro imports the `defineConfig` function from `astro/config`. The `integrations` key needs to be passed into the `defineConfig` function, but it is not shown in the README. Updated the README according to the CLI example.

* update alpine

* update image

* update lit

* update mdx

* update preact

* update prefetch

* update react

* update sitemap

* update solid

* update svelte

* update tailwind

* update turbolinks

* update vue

* chore: add changeset

* update image

* update svelte readme

Co-authored-by: Nate Moore <nate@astro.build>
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2023-01-26 13:03:00 -06:00
Houston (Bot)
607f0ac31a
[ci] release (#5984)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-01-26 13:53:32 -05:00
HiDeoo
7abb1e9056
Fix MDX heading IDs generation when using a frontmatter reference (#5978)
* Fix MDX heading IDs generation when using a frontmatter reference

* Hoist safelyGetAstroData() call and add statement null check
2023-01-26 12:52:50 -05:00
Matthew Phillips
9855db676e
Support for prerendering in the Cloudflare integration (#5993)
* Cloudflare prerender branch

* Add prerendered routes to Cloudflare routes.json

* Adding changeset

* Prevent process proxy from running during prerender phase
2023-01-26 12:43:39 -05:00
HiDeoo
60b32d5856
Fix Astro.url.protocol when using the @astrojs/node SSR adapter with HTTPS (#5992) 2023-01-26 12:39:57 -05:00
Angus
088f5194c5
Re-enable streaming on Cloudflare Pages (#5914)
* Support streaming on Cloudflare Pages

* Create tidy-ties-repeat.md

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2023-01-26 07:44:09 -06:00
wulinsheng123
aedf23f858
fix: component is not able to use a custom theme anymore (#5952)
* Astro <Code> component is not able to use a custom theme anymore

* Astro <Code> component is not able to use a custom theme anymore

* Astro <Code> component is not able to use a custom theme anymore

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2023-01-25 17:21:15 -06:00
Yaroslav Lapin
883e0cc299
change @astrojs/solid to @astrojs/solid-js (#5971)
* change @astrojs/solid to @astrojs/solid-js

@astrojs/solid package doesn't exist

* Create serious-turtles-explode.md

* Update .changeset/serious-turtles-explode.md

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

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
2023-01-25 17:21:03 -06:00
HiDeoo
9d4bfc76e8
Support passing children as props to a React component (#5886) 2023-01-25 16:31:57 -06:00
Ben Holmes
dabce6b8c6
[Content collections] Support type guards on getCollection() filter (#5970)
* fix: respect type guards from collection filter

* chore: changeset
2023-01-25 16:21:27 -06:00
Nate Moore
b53e0717b7
Handle unmatched 404 when using prerender in dev mode (#5983)
* fix(#5975): unmatched static paths should 404 during dev

* chore: add changeset

Co-authored-by: Nate Moore <nate@astro.build>
2023-01-25 13:57:32 -06:00
Houston (Bot)
4842d6acb0
[ci] release (#5963)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-01-25 10:19:27 +08:00
Bjorn Lu
02549b8ced
Upgrade semver dependency (#5972) 2023-01-25 10:13:47 +08:00
Matthew Phillips
f4c71e5eb9
Protect against shimmed process usage in Vercel Edge (#5969)
* Protect against shimmed process usage in Vercel Edge

* Adding a changeset
2023-01-24 21:11:09 -05:00
Happydev
46b6e14265
Fix Content Collections not loading config file when there are spaces in the folder tree (#5962)
* fix

* add test

* use `fileURLToPath` instead

* chore: changeset

* remove useless config file

* revert back to using `decodeURIComponent`

* test: better test

* re-revert back to using `fileURLToPath`
2023-01-24 20:00:17 +00:00
Houston (Bot)
398a516f03
[ci] release (#5959)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-01-24 11:12:02 -06:00
Nate Moore
d0d7f61182
fix(create-astro): typescript prompt handling (#5958)
* fix(create-astro): typescript prompt handling

* fallback

* fix(create-astro): additional case

Co-authored-by: Nate Moore <nate@astro.build>
2023-01-24 11:01:26 -06:00
Houston (Bot)
73ca0ef383
[ci] release (#5948)
* [ci] release

* Update changelogs (#5955)

* [ci] release

* Wrap astro 2.0 beta logs in `<details>`

* Add link to docs upgrade guide

* First pass cleaning up 2.0 release notes

* mdx changes from Sarah

* combine 5584 and 5842 in deno, image, netlify

* markdown/remark incl (5684 & 5769) to match mdx

* Tweak markdown/remark formatting

* Format astro-prism

* Format astro-rss

* Format create-astro

* Format cloudflare

* Format lit

* Format partytown

* Format node

* Format preact

* Format react

* Format solid

* Format svelte

* Format tailwind

* Format vercel

* Format vue

* Format telemetry

* Format webapi

* Format scripts

* Reinstate h3s for headings

Co-authored-by: Ben Holmes <hey@bholmes.dev>

* Reformat mdx

* astro & markdown/remark: Combine #5679 & #5684 changelogs

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Ben Holmes <hey@bholmes.dev>

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Matthew Phillips <matthew@skypack.dev>
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Ben Holmes <hey@bholmes.dev>
2023-01-24 11:38:06 -05:00
Matthew Phillips
58dfdc5a36
Bump lit changesets to minor (#5954) 2023-01-24 10:55:56 -05:00
Matthew Phillips
8c03c76923
Exit pre mode (#5947) 2023-01-23 16:30:21 -05:00
Houston (Bot)
a75177f843
[ci] release (beta) (#5911)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-01-23 16:11:39 -05:00
Matthew Phillips
c61ec4202a
Go back to pre-mode (#5946) 2023-01-23 16:08:46 -05:00
Matthew Phillips
453b373dc5
Exit pre-mode for 2.0 release (#5942) 2023-01-23 15:07:51 -05:00
Ben Holmes
304823811e
[Content Collections] Add slug frontmatter field (#5941)
* feat: respect `slug` frontmatter prop

* chore: replace `slug` check with proper types

* fix: regen types on `slug` change

* chore: add TODO on slug gen

* tests: update to use `slug` frontmatter prop

* chore: add error message on `slug` inside object schema

* lint

* chore: add note on frontmatter parse

* refactor: move content errors to new heading

* chore: ContentSchemaContainsSlugError

* chore: changeset

* docs: be 10% less gentle

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

* fix: avoid parsing slug on unlink

* docs: clarify old API is for beta users

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2023-01-23 15:04:56 -05:00
Nate Moore
7325df4121
Remove duplicate CSS in dev (#5917)
* fix(#5817): remove duplicate CSS in dev

* chore: add changeset

Co-authored-by: Nate Moore <nate@astro.build>
2023-01-23 12:03:19 -06:00
Bjorn Lu
4987d6f44c
Handle custom injected entry files during build (#5499) 2023-01-23 23:00:05 +08:00
Matthew Phillips
f5adbd6b55
Support prerender in Netlify redirects (#5904)
* Support prerender in Netlify redirects

* Updated sorting algorithm

* Update packages/integrations/netlify/src/shared.ts

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

Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
2023-01-23 09:47:33 -05:00
Happydev
9e57268f13
fix(@astrojs/tailwind): manually load postcss config file (#5908) 2023-01-23 22:46:19 +08:00
Rishi Raj Jain
77ae7a597a
fix: trailingSlash with base breaking partytown file path (#5936)
* fix: trailingSlash with base breaking partytown file path

* Update index.ts

* Update index.ts

* Update index.ts

* fix lint

* Update index.ts
2023-01-23 09:43:06 -05:00
heyhoe
46ecd5de34
Update magic-string used by @astrojs/image and @astrojs/webapi (#5930) 2023-01-22 17:11:19 +08:00
Chris Swithinbank
f32bf07c19
Improve Svelte README (#5923)
* First stylistic pass

* Rework for x/o instead of and

* fix typo

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

* Add changeset

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2023-01-21 10:55:19 +01:00
Chris Swithinbank
f27bb3d79f
Improve error message for third-party template 404s (#5920) 2023-01-21 00:04:39 +01:00
Reuben Tier
d8919b1a21
Add headless support to create-astro (#5898)
* Add headless support to create-astro

* Document new flags for create-astro
2023-01-20 08:53:12 -06:00
Bjorn Lu
a8d3e79246
Fix CLI node version check (#5905) 2023-01-20 15:37:42 +08:00
Caleb Jasik
5fd9208d44
Update compiler to 1.0.1 (#5909)
* Update compiler to 1.0.1

* Add changeset
2023-01-19 13:51:45 -05:00
Hoston (Bot)
9ddb7a2f2e
[ci] release (beta) (#5906)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-01-19 11:40:44 -05:00
Ben Holmes
81dce94f2a
[RSS] Get ready for content collections (#5851)
* chore: strictNullChecks for zod

* feat: expose `rssSchema` helper

* refactor: align types with schema types

* feat: break glob handler to globToRssItems util

* refactor: RSS options validation to Zod

* refactor: avoid intermediate type

* fix: allow numbers and dates in pubDate

* test: update glob and error tests

* feat: add rss to with-content starter

* fix: move globToRssItems back to internal behavior

* chore: JSON.stringify

* Revert "fix: move globToRssItems back to internal behavior"

This reverts commit 85305075e6444907455541b24bccbccd5016951a.

* test: missing url

* docs: `import.meta.env.SITE` -> `context.site`

* docs: update README to content collections example

* fix: url -> link

* docs: add `rssSchema` to README

* chore: consistent formatting

* docs: add `pagesGlobToRssItems()` reference

* chore: globToRssItems -> pagesGlobToRssItems

* chore: changeset

* fix: bad docs line highlighting

* fix: add collections export to example

* nit: remove "our"

* fix: are -> all

* fix: more README edits

* deps: kleur

* chore: add back import.meta.glob handling as deprecated

* docs: bump down to `minor`, update headline to be less content collections-y

* typo: suggest adding

* chore: support URL object on `site`

* docs: add await to pagesGlob ex

* docs: tighten `rssSchema` explainer

* docs: tighten pagesGlobToRssItems section

* docs: add content to README

* docs: replace examples with docs link

* docs: re-we

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

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2023-01-19 11:24:55 -05:00
Hoston (Bot)
97267e3881
[ci] release (beta) (#5856)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-01-19 11:00:03 -05:00
Matthew Phillips
be901dc98c
Rename getEntry to getEntryBySlug (#5893)
* Rename getEntry to getEntryBySchema

* Improve entrySlug types and return undefined

* Add changeset

* Update packages/astro/src/content/template/types.d.ts

Co-authored-by: Ben Holmes <hey@bholmes.dev>

* Update the types to accept both raw string and known value

* Add comment on the implementation not currently being O(1)

Co-authored-by: Ben Holmes <hey@bholmes.dev>
2023-01-19 08:34:27 -05:00
Bjorn Lu
a342a486c2
Refactor Svelte preprocess integration handling (#5901)
* Let user setup vitePreprocess

* Abstract function

* Add changeset

* Update svelte syntax

* Make fallback

* Fix docs

* Update changeset

* Fix types
2023-01-19 08:13:40 -05:00
Junya Kono
899214298c
fix(astro/core): Do not automatically add trailing slash (#5608)
* fix: Do not automatically add trailing slash

* Update .changeset/twelve-cooks-tickle.md

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

* fix: change semver

Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
2023-01-19 08:12:37 -05:00
Erika
35b26f377f
Fix image integration crash on Netlify Functions due to import.meta.url (#5888)
* fix(image): Fix immediate crash on Netlify functions due to `import.meta.url`

* chore: changeset
2023-01-19 14:04:15 +01:00
Happydev
ce5c5dbd46
feat: add theme toggle button to error overlay (#5884)
* feat: add theme toggle button for error overlay

* add changeset

* simplify toggling logic

Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>

* redesign toggle

* code figma design

* style: remove code indent

* add `aria-hidden` to svgs

Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>

* apply Yan a11y suggestions

Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>
2023-01-18 22:35:41 +00:00
Nate Moore
64b8082e77
chore: update compiler (#5896)
Co-authored-by: Nate Moore <nate@astro.build>
2023-01-18 16:12:00 -06:00
Ben Holmes
05caf445d4
Cleanup deprecated Markdown APIs from 0.X (#5891)
* chore: remove deprecated `getHeaders()`

* chore: remove `rawContent()` and `compiledContent()`

* chore: remove raw and compiled content from MDX type

* chore: remove 0.X error for `astro` property

* chore: changeset

* lint: no empty interface

* chore: update changeset
2023-01-18 17:04:37 -05:00
Nate Moore
16dc36a870
Remove legacy compiler error handling (#5855)
* refactor: remove legacy compiler handling

* docs: add hint to unknown compiler error

* feat: add link detection to error overlay

* chore: update compiler

* chore: update compiler issue link

* Update packages/astro/src/core/errors/overlay.ts

Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>

Co-authored-by: Nate Moore <nate@astro.build>
Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
2023-01-18 12:57:31 -06:00
Nate Moore
8f1ae06e58
fix(#5723): build prerendered pages with Netlify edge functions (#5885)
* fix(#5723): build prerendered pages with Netlify edge functions

* chore: add changeset

Co-authored-by: Nate Moore <nate@astro.build>
2023-01-18 12:54:49 -06:00
Happydev
006405d33c
Refactor Props of Image and Picture component to support type checking (#5788)
* correct props type

* refactor Picture and Image typings

* add missing `alt` property

* add changeset

* apply suggestions

* correct `astro/types` import

Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>

* apply suggestions

* convert to type import

Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
2023-01-18 02:41:50 +00:00
Matthew Phillips
28556a89fe
Make image and mdx changesets be minor instead of major (#5883) 2023-01-17 10:49:25 -05:00
Bjorn Lu
1ca81c16b8
Remove unused exports (#5862) 2023-01-17 23:12:08 +08:00
Erika
1bd42c6b2a
Fix image integration not working on Node 18+ (#5871)
* fix(image): Remove unnecessary polyfill now that we dropped Node 14

* fix(squoosh): Remove fetch of local wasm binary since undici doesn't support that

* chore: changeset
2023-01-17 15:48:06 +01:00
Bjorn Lu
998f412c57
Revert "Add missing noPropertyAccessFromIndexSignature to strictest tsconfig profile (#5864)" (#5876)
This reverts commit 63d5d89038.
2023-01-17 11:17:59 +08:00
Clément Nerma
63d5d89038
Add missing noPropertyAccessFromIndexSignature to strictest tsconfig profile (#5864) 2023-01-17 10:36:15 +08:00
Bjorn Lu
b66d7195c1
Enable skipLibCheck by default (#5872) 2023-01-17 09:43:07 +08:00
Bjorn Lu
8c100a6fe6
Handle server restart from Vite plugins (#5849) 2023-01-14 16:51:01 +08:00
Bjorn Lu
e818cc0466
Fix importing client-side components with alias (#5845) 2023-01-14 16:50:46 +08:00
Rishi Raj Jain
3a00ecb3eb
Support envPrefix in Astro config (#5852)
* Support envPrefix in Astro config

* Update packages/astro/src/core/config/schema.ts

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

* Update packages/astro/src/core/build/static-build.ts

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

* Update packages/astro/src/core/build/static-build.ts

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

* Update packages/astro/src/core/config/schema.ts

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

* Update packages/astro/src/core/create-vite.ts

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

* Update .changeset/twenty-llamas-type.md

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2023-01-13 14:57:53 -06:00