Commit graph

2198 commits

Author SHA1 Message Date
Erika
dc062f6695
Upgrade to version 1.0.0 of the language server (#6953) 2023-05-01 16:41:21 +02:00
Chris Swithinbank
a98df9374d
Show injected custom 404 route in dev (#6940)
* Add unit test for injected 404 routes

* Add fixture test for injected 404 routes

* Use any route pattern to find custom 404

* Fix frozen lockfile error

* Use `route` instead of `pattern` to match custom 404

Dynamic catch-all routes can match against `/404/` but will then error because they’re not actually designed to handle a param of `'404'`. Testing `route` instead excludes dynamic routes (because they’ll contain dynamic segments inside square brackets). Not sure if someone might _want_ to render the 404 via a dynamic route, but we already don’t support that, so this doesn’t change anything.

* Fix injected 404 fixture

* Add tests for `src/pages/404.html`

* Add changeset

* Fix lockfile

* And again
2023-05-01 10:37:07 -04:00
Matthew Phillips
c405cef647
Catch errors that occur within the stream in the Node adapter (#6935)
* Catch errors that occur within the stream in the Node adapter

* Adding a changeset

* Better error message on completely uncaught errors within the stream

* Update test
2023-05-01 10:08:18 -04:00
Matthew Phillips
649d70934e
Configure redoc to be noExternal (#6933) 2023-05-01 09:31:44 -04:00
Bjorn Lu
2dca81bf21
Update dependencies to remove peer dep warnings (#6930) 2023-04-28 21:21:47 +08:00
Bjorn Lu
ac57b5549f
Upgrade undici to v5.22.0 (#6929) 2023-04-28 21:13:49 +08:00
Yan Thomas
d11d185951
Add missing code language in Cloudflare README (#6925) 2023-04-28 14:37:26 +08:00
Erika
ebae1eaf87
feat(image): Update image service config to allow passing settings to the service (#6848) 2023-04-27 18:16:40 +02:00
Bjorn Lu
de5a25f4e9
Fix changeset publish (#6923) 2023-04-27 22:55:48 +08:00
Houston (Bot)
06c527330a
[ci] release (#6914)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-04-27 22:12:14 +08:00
Bjorn Lu
b89042553e
Fix tsconfig alias baseUrl handling for "." and ".." imports (#6920) 2023-04-27 18:30:17 +08:00
Bjorn Lu
465a1a5efe
Fix changeset version run (#6917) 2023-04-27 17:15:58 +08:00
Daniel
081b2402cf
esbuild respects vite.build.minify option (#6222)
* esbuild respects `vite.build.minify` option
* Docs update
---------
Co-authored-by: AirBorne04 <>
Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>
2023-04-27 10:11:05 +02:00
Phil Nash
4ea716e569
Adds extra elements to RSS items. (#6707) 2023-04-26 13:58:53 +01:00
Houston (Bot)
c6f1264586
[ci] release (#6863)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-04-25 22:48:36 +08:00
Bjorn Lu
edabf01b44
Upgrade to Vite 4.3 (#6877) 2023-04-25 22:04:45 +08:00
Bjorn Lu
0afff32741
Disable Vite optimizer for sync and config loading (#6902) 2023-04-25 20:54:41 +08:00
Bjorn Lu
b6154d2d57
Fix hoisted scripts path for linked package Astro components (#6872) 2023-04-21 10:42:23 +02:00
Nathaniel Blackburn
43230b2cac
Align adapter setup (#6874) 2023-04-19 09:36:46 +02:00
André Alves
4c7ba4da08
Fix Astro.params does not contain path parameter from URL with non-English characters (#6859) 2023-04-17 16:44:48 +02:00
jcdogo
1f2699461d
fix: astro island urls missing assetsPrefix in SSR mode (#6862)
Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
2023-04-17 08:35:48 +02:00
Houston (Bot)
763b7500e5
[ci] release (#6842)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-04-14 12:11:17 -04:00
Bjorn Lu
2e3125e180
Fix vercel edge private env vars (#6841) 2023-04-14 21:46:24 +08:00
Chris Swithinbank
00a2e1d7c7
Fix warning syntax in Vercel integration README (#6840) 2023-04-14 12:08:31 +02:00
Houston (Bot)
b105ccb9ca
[ci] release (#6835)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-04-13 14:41:56 -04:00
Bjorn Lu
8539eb1643
Support tsconfig aliases in CSS @import (#6816) 2023-04-13 22:11:21 +08:00
Erika
2511d58d58
feat(mdx): Add support for turning ![]() into <Image> (#6824) 2023-04-13 11:54:40 +02:00
Erika
948a6d7be0
fix(content): Remove unsupported file warning for images (#6825) 2023-04-13 11:54:26 +02:00
André Alves
3356023443
add validation for non-printable chars in CLI (#6682) 2023-04-12 15:30:09 -04:00
wulinsheng123
a9c22994e4
fix #6420 (#6544)
* fix #6420

* add test

* add test

* fix an error that parsed path

* fix path error when in Windows environment

* fix a path error

* update comment

---------

Co-authored-by: wuls <linsheng.wu@beantechs.com>
2023-04-12 14:26:53 -04:00
Houston (Bot)
b2254bd786
[ci] release (#6818)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-04-12 08:51:55 -04:00
Bjorn Lu
7653cf9e9f
Fix CSS chunking between multiple framework components (#6582)
* Fix CSS chunking between multiple framework components

* Better CSS dedupe handling

* Add more tests

* Update docs
2023-04-12 08:24:32 -04:00
Happydev
76dd53e3f6
Fix slot fallbacks unexpectedly showing up in some cases (#6819)
* test: add test fixture

* test: add test case

* test: revert unneeded changes in fixture

* fix

* chore: changeset
2023-04-12 08:23:14 -04:00
Erika
6c09ac03bf
Fix experimental.assets's Squoosh service not working on Netlify and Vercel SSR (#6765) 2023-04-12 10:45:35 +02:00
Ben Holmes
f882bc1636
Refactor content collection transforms (#6817)
* feat: json collection POC

* wip: add test json file

* refactor: rework content flag transforms

* refactor: simplify propagatedAsset check

* chore: remove JSON playground code

* chore: respect build sourcemap option

* deps: magic-string, source-map

* chore: formatting

* fix: add sourcemaps to MDX plugin

* chore: changeset

* deps: remove magic-string from mdx

* chore: remove unecessary MagicString
2023-04-11 13:44:39 -04:00
Houston (Bot)
b1d07bcf40
[ci] release (#6809)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-04-11 13:10:00 -04:00
Bjorn Lu
60c16db6ff
Fix check CLI fs load fallback behaviour (#6811) 2023-04-11 11:57:11 +08:00
amirhhashemi
c12ca5ece3
fix(error-overlay): force error overlay direction to be LTR (#6782) 2023-04-10 16:59:17 +02:00
Alper Doğan
99479e6b95
Optional Sizes prop on Picture component (#6773) 2023-04-10 14:09:02 +02:00
Houston (Bot)
a5601a3cd3
[ci] release (#6807)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-04-10 16:57:31 +08:00
André Alves
1e3873c04a
Fix no edge functions deployed to netlify (#6793) 2023-04-10 16:50:54 +08:00
Nathaniel Blackburn
84a4648884
Revert vercel env fix (#6776) 2023-04-10 16:40:29 +08:00
Houston (Bot)
d531239201
[ci] release (#6769)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-04-07 17:25:00 -04:00
Ben Holmes
7f74326b76
Fix: astro:server:setup middleware (#6781)
* Revert "Fix: stop executing `astro:server:setup` twice (#6693)"

This reverts commit c0b7864a41.

* fix: delay `astro:server:setup` to `configureServer`

* test: middleware from astro:server:setup

* chore: lock

* chore: changeset

* chore: remove minimal example change

* chore: revert minimal env change
2023-04-07 12:28:55 -04:00
Matthew Phillips
fa84f1a7d2
Support streaming inside of slots (#6775)
* Rename renderSlot to renderSlotToString for internal sync usage

* Support streaming inside of slots

* Fix lame lint warning

* Update compiler to fix test

* Up the wait

* Use compiler 1.3.1

* It should be exactly 3
2023-04-07 11:04:31 -04:00
Matthew Phillips
a98f6f418c
Prevent body head content injection in MDX when using layout (#6779) 2023-04-06 18:33:47 -04:00
Matthew Phillips
416ceb9730
Use Deno API to set Astro.clientAddress (#6651)
* Use Deno API to set Astro.clientAddress

* Add types
2023-04-06 15:40:50 -04:00
Ben Holmes
9e88e0f23c
Fix: remove slug() from defineCollection() (#6774)
* fix: remove `slug()` from `defineCollection()`

* chore: changeset
2023-04-06 14:25:14 -04:00
Nate Moore
45bff6fccb
feat(prerender): support quoted true / false values and 0 / 1 (#6772) 2023-04-06 11:36:28 -05:00
Erika
52d7a4a011
Update client types to match Vite (#6770)
* fix(types): Update client types to match Vite's

* chore: changeset
2023-04-06 15:13:13 +02:00
Xetera
72fed684a3
Exporting ImageFunction from astro:content (#6766) 2023-04-06 13:58:34 +02:00
Houston (Bot)
29e7b82b8d
[ci] release (#6720)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-04-05 13:38:45 -04:00
Bjorn Lu
7116c021a3
Upgrade to Vite 4.2 (#6759) 2023-04-06 00:03:58 +08:00
Erika
8b88e4cf15
Show the actual error when there was an error while generating types (#6762) 2023-04-05 17:12:35 +02:00
Erika
a1108e0371
Move image() to be passed as part of schema (#6703)
* feat(images): Move image() to schema so we can do relative images easily instead of clumsily

* chore: changeset

* fix: apply feedback

* test: add more tests

* fix: properly infer type if a function is used

* feat(iamge): Add errors when using the old methods

* chore: update to minor

* feat(image): Move function shape to be experimental.asets only

* Update packages/astro/src/content/template/virtual-mod.mjs

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

---------

Co-authored-by: Ben Holmes <hey@bholmes.dev>
2023-04-05 15:40:05 +02:00
Bjorn Lu
ff04307863
Add build.assetsPrefix option for CDN support (#6714)
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2023-04-05 21:31:17 +08:00
Nathaniel Blackburn
26daba8d9f
@astrojs/vercel: Fix vercel analytics id not being provided (#6751)
* fix wrong environment variable being used

* added changeset
2023-04-05 09:23:40 -04:00
Bjorn Lu
489dd8d69c
Fix getViteConfig return type (#6753) 2023-04-05 09:06:00 -04:00
Augustine Kim
c7eb0d4310
Fix lit integration nested component rendering (#6752)
* Provide renderInfo to renderShadow

* Add test for rendering nested components

* Add changeset
2023-04-05 09:05:45 -04:00
Erika
4cc1bf61b8
fix(node): Fix malformed URLs crashing the server in certain cases (#6746) 2023-04-04 15:48:28 +02:00
André Alves
1ec1df1264
Fix #6618: sitemap urls generated without slash (#6658) 2023-04-04 21:13:49 +08:00
Erika
a1a4f45b51
fix(images): Simpler logic for collecting images in Markdown (#6744) 2023-04-04 10:21:13 +02:00
Erika
2f2e572e93
feat(image): Export more types and utilities for users to use (#6739) 2023-04-03 18:11:45 +02:00
Erika
4c347ab51e
fix(images): Return the proper content-type for the chosen format (#6741) 2023-04-03 18:11:32 +02:00
Ben Holmes
73fcc7627e
[Markdoc] Fix: Support render: null (#6723)
* fix: handle array of tree nodes

* test: render null in document node

* chore: lock

* refactor: consolidate render test logic

* chore: changeset
2023-04-03 11:27:51 -04:00
Matthew Phillips
d54cbe4134
Better errors for when response is already sent (#6719)
* Better errors for when response is already sent

* Changeset

* Casing

* Change to a 300x error
2023-03-31 15:27:14 -04:00
wulinsheng123
d59e511d16
supporting top of await (#6671)
* add fix

* fix

* revert verison

* fix fn is undefined g

* add e2e test

* fix unit test

* delete redundant code

* add changeset

---------

Co-authored-by: wuls <linsheng.wu@beantechs.com>
2023-03-31 13:42:03 -04:00
Houston (Bot)
07e8a1bab4
[ci] release (#6694)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-03-31 16:32:28 +02:00
Erika
c2d4ae1cbe
fix(check): Dynamically import check command (#6717) 2023-03-31 15:18:37 +02:00
Peter Timoshevsky
08e92f4f8e
Fix incorrect path in error overlay on Win (#6679) 2023-03-31 13:07:19 +02:00
Erika
46ecf46628
Remove unnecessary image-related .wasm files inside build output when possible (#6701)
* fix(image): Remove unnecessary .wasm files after build

* chore: changeset
2023-03-30 20:57:57 +02:00
Erika
c04ea0d43c
Fix InferGetStaticParamsType and InferGetStaticPropsType not working with sync getStaticPaths (#6711)
* fix(types): Fix InferGetStaticParamsType (and its props equivalent) not working when getStaticPaths wasn't async

* chore: changeset

* fix: use type imports
2023-03-30 11:41:36 +02:00
Erika
a0bdf4ce2f
Fix multiple images being generated for the same image (#6710)
* fix(images): Fix multiple calls to same image generating multiple images

* chore: changeset
2023-03-30 11:31:04 +02:00
Aivars Liepa
b1b9b1390f
[RSS] Fix: update RSSFeedItem type to comply with strictest tsconfig (#6614)
* fix RSSFeedItem type for `strictest` tsconfig

* add .changeset

---------

Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
2023-03-30 11:25:36 +02:00
Elliott Marquez
4b077318fb
Update lit-ssr dependency (#6681)
* update lit-ssr dependency

* delete unnecessary lit shim checks

* delete another unused lit shim feature

* fix sass build

* bump lit and polyfill versions to match ssr req

* shim HTMLElement in test

* remove lit global shim workarounds

* re-shim Astro's ce.define

* remove fix window test and shim HTML Element

* Update .changeset/gold-windows-fly.md

Co-authored-by: Augustine Kim <ajk830@gmail.com>

* fix window check test

* implement suggestoins

---------

Co-authored-by: Augustine Kim <ajk830@gmail.com>
2023-03-29 12:43:40 -04:00
Erika
f0b732d326
fix(images): Improve error handling around the new assets feature (#6649)
* fix(images): Improve error handling around the new assets feature

* fix: add missing error message

* fix(images): Fix schema preprocessing logic returning undefined when the file doesn't exist

* test: add tests

* chore: lockfile

* chore: changeset

* Apply suggestions from code review

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

* test: remove console.logs

* fix(images): properly join with path

* fix: attempt a fix

* test: remove console.log

* Apply suggestions from code review

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

* fix: add undefined test for global for SSR

---------

Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2023-03-29 14:58:42 +02:00
Ben Holmes
fc71c3f188
chore: update changeset (#6698) 2023-03-28 16:38:23 -04:00
Ben Holmes
5e33c51a9c
Fix: Paginate adds unexpected trailing slash on index route (#6676)
* fix: remove unexpected trailing / on paginate

* test: next and prev href

* chore: changesset

* fix: correct empty string to '/' for index route

* edit: and typo

Co-authored-by: Happydev <81974850+MoustaphaDev@users.noreply.github.com>

* fix: tests not running!

---------

Co-authored-by: Happydev <81974850+MoustaphaDev@users.noreply.github.com>
2023-03-28 16:05:35 -04:00
Matthew Phillips
239b9a2fb8
Add use-immer as a noExternal module (#6696) 2023-03-28 15:35:21 -04:00
Ben Holmes
c0b7864a41
Fix: stop executing astro:server:setup twice (#6693)
* fix: remove integrations container plugin

* chore: changeset
2023-03-28 13:43:16 -04:00
Houston (Bot)
af108e4b4a
[ci] release (#6652)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-03-28 13:17:46 -04:00
Johannes Klauss
2e92e9aa97
Fix: Crash in NodeApp.render if req.body is null (#6688)
* Add additional null check for req.body

* Add changeset
2023-03-28 12:24:01 -04:00
Ben Holmes
2df24e9430
fix: change minor to patch (#6692) 2023-03-28 12:19:00 -04:00
wulinsheng123
4bf87c64ff
Improve error message for endpoint getStaticPaths with undefined value (#6353)
Co-authored-by: bluwy <bjornlu.dev@gmail.com>
Co-authored-by: wuls <linsheng.wu@beantechs.com>
2023-03-28 23:13:46 +08:00
Kilian Gosewisch
386336441a
Fix image regeneration after changing image service (#6680) 2023-03-28 14:59:01 +02:00
wulinsheng123
adecda7d60
add a new flag with --open for the dev and the preview (#6578) 2023-03-28 19:59:43 +08:00
Ben Holmes
4a32620600
[create-astro] Error on --template that does not exist (#6677)
* Revert "Revert accidental create-astro fix"

This reverts commit c13d428a78.

* chore: changeset
2023-03-28 07:08:43 -04:00
Smit Patel
aff53c109c
Expose partytown config options from astro plugin (#6667) 2023-03-28 16:44:54 +08:00
Ben Holmes
7c439868a3
[Markdoc] New config format with runtime variable support! (#6653)
* deps: esbuild

* feat: support direct component imports for render!

* deps: add devalue back

* refactor: remove unused components prop

* refactor: load experimental assets config separately

* fix: upate Content type def to support props

* refactor: replace astro stub with inline data

* feat: pass through viteId to getRenderMod

* fix: add back $entry var with defaults convention

* chore: remove unneeded validateRenderProps

* chore: remove uneeded validateComponents

* fix: remove userMarkdocConfig prop

* chore: add helpful error for legacy config

* deps: kleur

* fix: add back `isCapitalized`

* fix: log instead of throw to avoid scary stacktrace

* chore: delete more old logic (nice)

* chore: delete MORE unused utils

* chore: comment on separate assets config

* chore: remove console.log

* chore: general code cleanup

* test: new render config

* docs: new README

* fix: add expect-error on astro:assets

* feat: add defineMarkdocConfig helper

* docs: update example README

* test: add runtime variable

* chore: lint

* chore: changeset

* chore: add component import deletion

* docs: add notes on Vite fork

* fix: astro check

* chore: add `.mts` to markdoc config formats
2023-03-27 18:04:37 -04:00
Matthew Phillips
1f783e3207
Prevent frontmatter errors from crashing dev server (#6675)
* Prevent frontmatter errors from crashing dev server

* fix windows
2023-03-27 15:35:32 -04:00
Erika
fc0ed9c53c
Fix using optimized images with base (#6643)
* fix(images): Fix images having the wrong path when using `base`

* test(images): Add test for using images with base

* test: add more tests

* chore: changeset

* fix: paths

* refactor: feedback
2023-03-27 15:50:02 +02:00
Tony Sullivan
25cd3e5749
fix: updating HTML attribute types for the <link> element (#6639)
* fix: updating a few camel-cased properties on the LinkHTMLAttributes type

* chore: add changeset

---------

Co-authored-by: Tony Sullivan <tony.f.sullivan@outlook.com>
2023-03-24 15:36:11 -05:00
Houston (Bot)
12d42f47bd
[ci] release (#6646)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-03-24 13:17:01 -04:00
Eric R Glass
b7194103e3
Fix for Node SSR with Express JSON middleware fails on POST (#6192)
* Fix for Node SSR with Express JSON middleware fails on POST

* Removed the unwanted setting of the req property

* Removed the unwanted setting of the req property

* Removed the unwanted setting of the req property

* Fixed the if statement to not break the existing logic and unit test

* Cleaned up the if statement

* Changed to better solution from Geoffrey-Pliez

* Added class NodeIncomingMessage with body defined as any

---------

Co-authored-by: Matthew Phillips <matthew@skypack.dev>
2023-03-24 11:30:47 -04:00
Bjorn Lu
45da39a864
Pass --mode flag to build (#6647) 2023-03-24 11:17:46 -04:00
Matthew Phillips
7daef9a299
Avoid implicit head injection when there is a head element in the tree (#6638)
* Avoid implicit head injection when there is a head element in the tree

* more

* only do it once

* Update the tests

* Update more tests

* update compiler version

* See if scope stuff can be removed now

* Move up where head injection occurs

* Remove result scoping
2023-03-24 11:17:25 -04:00
Ben Holmes
cfcf2e2ffd
[Markdoc] Support automatic image optimization with experimental.assets (#6630)
* wip: scrappy implementation. It works! 🥳

* chore: add code comments on inline utils

* fix: code cleanup, run on experimental.assets

* feat: support ~/assets alias

* fix: spoof `astro:assets` when outside experimental

* test: image paths in dev and prod

* feat: support any vite alias with ctx.resolve

* fix: avoid trying to process absolute paths

* fix: raise helpful error for invalid vite paths

* refactor: revert URL support on emitAsset

* chore: lint

* refactor: expose emitESMImage from assets base

* wip: why doesn't assets exist

* scary chore: make @astrojs/markdoc truly depend on astro

* fix: import emitESMImage straight from dist

* chore: remove type def from assets package

* chore: screw it, just ts ignore

* deps: rollup types

* refactor: optimize images during parse step

* chore: remove unneeded `.flat()`

* fix: use file-based relative paths

* fix: add back helpful error

* chore: changeset

* deps: move astro back to dev dep

* fix: put emit assets behind flag

* chore: change to markdoc patch
2023-03-24 07:58:56 -04:00
Houston (Bot)
dfbd09b711
[ci] release (#6634)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-03-24 13:49:12 +08:00
Erika
d338b6f74a
Resolve images in the frontmatter relative to the current file (#6627)
* feat(images): Resolve images in the frontmatter relative to the current file

* fix(images): Only recursively go through the object if it's not undefined

* fix(images): Add more safeguards

* test(images): Update content collections tests to be relative

* chore: changeset
2023-03-23 17:50:44 +01:00
Matthew Phillips
4685f55549
Change how squoosh is loaded in the image integration (#6548)
* WIP fix image integration in Netlify

* Add a changeset

* Try another way

* Get the chunks folder

* try inlining

* deep sigh

* fix some things

* more

* Remove some stuff

* remove unused imports

* Add changeset

* remove unused --copy-wasm

* Remove unused post:build
2023-03-23 12:01:27 -04:00
Ben Holmes
9caf2a9ccc
Revert tsconfig-alias plugin changes (#6633)
* Revert "Fix tsconfig alias regression (#6617)"

This reverts commit 38e6ec21e2.

* chore: changeset

* fix: add back fs

* chore: remove stray console log

* Revert "Support tsconfig aliases in styles (#6566)"

This reverts commit ea9b3dd72b.

* chore: add note on css style aliases
2023-03-23 09:30:27 -04:00
Houston (Bot)
66e006028c
[ci] release (#6612)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-03-22 20:53:15 +08:00
Erika
7f7a8504b5
Fix using optimized images in Markdown (#6604)
* fix(images): Fix using optimized images in Markdown

* test(images): Update tests to be a bit more robust + new tests

* chore: changeset

* refactor: use spreadAttributes instead
2023-03-22 12:19:01 +01:00
Happydev
38e6ec21e2
Fix tsconfig alias regression (#6617) 2023-03-22 14:10:10 +08:00
paulrudy
b37b865400
edit commands for installing @markdoc/markdoc (#6622)
* edit commands for installing @markdoc/markdoc

* Create twenty-islands-protect.md

---------

Co-authored-by: Ben Holmes <hey@bholmes.dev>
2023-03-21 20:53:46 -04:00
Ben Holmes
f42f47dc6a
feat: Expose $entry variable to Markdoc (#6588)
* wip: dream api

* deps: rollup types

* feat: get entry data in there

* fix: properly show mdoc errors in overlay

* feat: implement with cache

* fix: wait for in-flight entry resolution

* test: entry properties can be rendered

* chore: changeset

* fix: remove rollup type import

* Revert "deps: rollup types"

This reverts commit 484ccb1c81.

* docs: add README reference

* docs nit: missing space

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

* refactor: split config config loading to separate helper

* refactor: choose more readable variable names

* refactor: store awaiting queue in existing cache

* docs: add clear code comments

* nit: add skip module code comment

* refactor: add `idHandledByContentRenderPlugin`

* nit: store chokidar modified events in const

* fix: remove loop from content renderer

* nit: else if -> if

---------

Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>
2023-03-21 09:20:23 -04:00
Ben Holmes
86273b5881
[Markdoc] Refactor Renderer internals to use renderComponent() (#6607)
* wip: new TreeNode setup

* fix: pass children through `render`

* deps: remove stringify-attributes

* chore: changeset

---------

Co-authored-by: Nate Moore <nate@astro.build>
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2023-03-21 08:17:20 -04:00
Houston (Bot)
6afb1efea8
[ci] release (#6541)
* [ci] release

* nit: typo in #6594 changeset

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Ben Holmes <hey@bholmes.dev>
2023-03-21 08:03:46 -04:00
btea
a661907b40
chore: wrap the projectDir in quotes if it contains spaces (#6594)
* chore: wrap the projectDir in quotes if it contains spaces

* chore: add changeset

* fix: update output projectDir

* Update .changeset/tall-beans-own.md

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

---------

Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
2023-03-21 06:27:52 -03:00
Bjorn Lu
f112c12b15
Fix plugin apply args when filtering (#6601) 2023-03-21 12:06:04 +08:00
Erika
2837345250
fix(tsconfig): Update tsconfig templates to ignore 5.0 deprecations (#6605) 2023-03-20 16:12:59 -03:00
Chloe A
6898842511
fix: Add missing --watch flag when running astro check --help (#6586)
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
2023-03-20 15:44:58 -03:00
Bjorn Lu
3881901028
Simplify internal resolver in dev (#6576) 2023-03-18 17:58:21 +08:00
Happydev
fa132e35c2
Fix error in empty markdown files with content (#6572)
* test: add test fixture

* test: add test case

* 🤏 fix

* chore: changeset

---------

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2023-03-17 11:38:10 -05:00
Franco Romano Losada
66858f1f23
Fix overflow title in error message (#6583)
* Fix overflow title in error message

* Add changeset
2023-03-17 11:16:55 -05:00
Erika
f5fddafc24
Add validateOptions hook to Image Service API (#6555)
* feat(assets): Add a validateOptions hooks to set default and do error handling

* chore: changeset
2023-03-17 13:29:25 +01:00
Erika
f413446a85
Fix image() type to be compatible with ImageMetadata (#6568)
* fix(assest): Fix `image()` type to be compatible with ImageMetadata

* chore: changeset
2023-03-16 22:35:14 +01:00
Bjorn Lu
ea9b3dd72b
Support tsconfig aliases in styles (#6566) 2023-03-17 01:04:26 +08:00
Bjorn Lu
6c465e958e
Fix prerendered 404 page handling in SSR (#6558) 2023-03-16 23:03:17 +08:00
Bjorn Lu
392ba3e4d5
Fix mdx and markdoc integrations return type (#6552) 2023-03-16 23:02:37 +08:00
Richard Simpson
2c829fdf65
fix(cloudflare): base strip logic (#6550) 2023-03-16 22:39:54 +08:00
Erika
90e5f87d03
Vendor image-size (#6559)
* feat(assets): Vendor image-size

* fix(assets): Also vendor queue, the CJS virus runs deep

* fix: remove unneeded queue

* chore: lockfile

* fix: build

* fix: build part 2

* chore: changeset
2023-03-16 15:10:46 +01:00
wulinsheng123
bf024cb342
It even starts to remove a file before it finish it. (#6472)
* dont finish the action of the copy before removing all files.

* change name
2023-03-15 13:53:10 -04:00
Erika
22955b895c
fix(assets): Fix usage of custom service resulting in Invalid Input error (#6556) 2023-03-15 16:21:13 +01:00
Erika
035c0c4df2
fix(assets): Fix images from public not working with the new Assets feature (#6536)
* fix(assets): Fix images from public not working with <Image> and `getImage`

* test(assets): Add test for public images

* refactor: simplify logic
2023-03-14 17:20:17 +01:00
Erika
04dddd783d
Fix local images having the wrong width and height when both dimensions were provided (#6547)
* fix(images): Fix Image providing the wrong width and height if both attributes were provided on local images

* chore: changeset
2023-03-14 15:02:27 +01:00
Ben Holmes
400ef26c99
[RSS] Fix: Preserve self-closing tags in customData (#6538)
* fix: preserve self-closing tags in customData

* test: self-closing tags preserved

* chore: changeset
2023-03-13 17:34:23 -04:00
Houston (Bot)
43daac7a9b
[ci] release (#6476)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-03-13 16:05:43 -04:00
Matthew Phillips
6a7cf0712d
Prevent astro:content from depending on Node builtins (#6537)
* Prevent astro:content from depending on Node builtins

* Right file

* Move the plugin into test-plugins.js
2023-03-13 15:36:11 -04:00
Ben Holmes
c638740906
[Content collections] Better error formatting (#6508)
* feat: new error map with unions, literal, and fbs

* fix: bad type casting on type error

* refactor: add comments, clean up edge cases

* refactor: JSON.stringify, add colon for follow ups

* refactor: bold file name in msg

* fix: prefix union errors

* test: new error mapping

* refactor: clean up Required handling

* test: required, fallthrough

* chore: changeset

* fix: out-of-date error msg

* chore: stray console log

* docs: revert to old error msg
2023-03-13 14:16:17 -04:00
Bjorn Lu
04e624d062
Treeshake exported client components that are not imported (#6527)
* Treeshake exported client components that are not imported

* Fix plugin name

* Fix mdx test
2023-03-13 13:16:56 -04:00
Erika
cc90d72197
Add warning when using assets with non-node adapters (#6533)
* feat(assets): Add a warning that the project won't be able to build if used with a non-Node adapter

* chore: changeset
2023-03-13 13:16:17 -04:00
Richard Simpson
1c3e8f6c3b
fix: rebase _routes.json for Cloudflare when config.base set (#6473) 2023-03-13 22:58:21 +08:00
Yan Thomas
a13e9d7e33
Consistency improvements to several package descriptions (#6494)
* Add small improvements to package descriptions

* Add changeset

---------

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2023-03-13 09:25:47 -05:00
Matthew Phillips
4ddf348938
Remove false-positive warnings from Cloudflare's build (#6531) 2023-03-13 10:05:54 -04:00
Erika
637f9bc728
Fix env.d.ts switching back between types on every restart when assets are enabled (#6532)
* fix(assets): Fix assets types reverting back on every dev server starts

* chore: changeset
2023-03-13 14:53:39 +01:00
Erika
acf78c5e27
fix(assets): Fix types to be more accurate (#6530)
* fix(assets): Fix types to be more accurate

* chore: changeset
2023-03-13 13:54:56 +01:00
Ben Holmes
f6eddffa04
feat: cache getCollection() calls in production (#6503)
* feat: cache getCollection() in prod

* chore: changeset
2023-03-10 13:50:34 -05:00
Yan Thomas
0de08773f3
Make Tailwind & Turbolinks integration descriptions more consistent (#6419)
* Fix npm description for Tailwind & Turbolinks

* Change order so all start with Astro

* More descriptive descriptions!

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

* Add changeset

---------

Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
2023-03-09 16:55:49 -06:00
Matthew Phillips
bfd67ea749
Remove usage of createRequire in core image (#6488)
* Add fallback for hosts without import.meta.url

* Try using an import

* Add image-size as external

* Make image-size external

* Apply suggestions from code review

* leave image-size alone
2023-03-09 16:08:47 -05:00
Bjorn Lu
d637d1ea5b
Fix @astrojs/prism edgecase with pnpm (#6485) 2023-03-09 14:44:14 -05:00
Erika
a9a6ae2981
Fix using images in content collections (#6483)
* fix(images): Fix not being able to refer to images in content collections

* fix(images): Normalize path

* fix(images): Do it properly

* chore: changeset
2023-03-09 14:43:58 -05:00
Matthew Phillips
700a555499
Add back support for Astro.clientAddress to Vercel serverless (#6484) 2023-03-09 11:27:16 -05:00
Emanuele Stoppa
2e362042c2
feat(rss): add option to remove the trailing slash (#6453)
* feat(rss): add option to remove the trailing slash

* Apply suggestions from code review

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

* suggestions

---------

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2023-03-09 07:57:03 +00:00
Bjorn Lu
77a046e886
Add default .npmrc for astro add lit (#6460)
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2023-03-09 14:42:57 +08:00
Houston (Bot)
af25778a9b
[ci] release (#6468)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-03-08 17:39:06 -05:00
Matthew Phillips
ec04553525
Fix asset loading in dev mode (#6466)
* Fix asset loading in dev mode

* Proper windows support
2023-03-08 17:32:39 -05:00
Houston (Bot)
401b97ad0e
[ci] release (#6456)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-03-08 16:09:20 -05:00
Matthew Phillips
65c07ce1b6
Fixes ESM imported assets to be root relative (#6465)
* Fixes ESM imported assets to be root relative

* Add changeset
2023-03-08 15:16:13 -05:00
Bjorn Lu
964d55246b
Prevent HTML-escape of raw strings in JSX script/style tags (#6459)
Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
2023-03-09 00:29:22 +08:00