Commit graph

2046 commits

Author SHA1 Message Date
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