Commit graph

3358 commits

Author SHA1 Message Date
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
Ben Holmes
328c671790
fix: specify astro peer dep version (#6691) 2023-03-28 11:11:23 -04: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
bluwy
4ddec1cd8c [ci] format 2023-03-28 08:47:15 +00:00
Smit Patel
aff53c109c
Expose partytown config options from astro plugin (#6667) 2023-03-28 16:44:54 +08:00
bholmesdev
9352e0056c [ci] format 2023-03-27 22:06:51 +00: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
bholmesdev
c13d428a78 Revert accidental create-astro fix 2023-03-27 17:46:00 -04:00
bholmesdev
c853ffc606 fix: log e.message 2023-03-27 17:39:20 -04:00
bholmesdev
88a8e7ae1a fix: check for nonexistent templates 2023-03-27 17:37:28 -04:00
matthewp
4b899d2257 [ci] format 2023-03-27 19:37:29 +00: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
Erika
a0b6aac2f3
fix(node): Fix http import to not be type-only (#6650) 2023-03-24 17:31:45 +01:00
matthewp
8a721173b3 [ci] format 2023-03-24 15:32:44 +00: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
matthewp
b558bd5140 [ci] format 2023-03-24 15:20:00 +00: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
bholmesdev
8bd0ca08cd [ci] format 2023-03-24 12:01:10 +00: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
Princesseuh
af4bd5e79c [ci] format 2023-03-23 16:52:45 +00: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
matthewp
0c8c5fc919 [ci] format 2023-03-23 16:03:49 +00: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
bluwy
cc1831c519 [ci] format 2023-03-22 06:12:47 +00: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
bholmesdev
25af481992 [ci] format 2023-03-21 13:22:55 +00: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
bholmesdev
e8b3c886a7 [ci] format 2023-03-21 12:20:02 +00: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
ematipico
00838b9856 [ci] format 2023-03-20 18:46:54 +00: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
Princesseuh
97f876abba [ci] format 2023-03-20 16:05:06 +00:00
Erika
1e7d6af412
feat(all): Migrate to TypeScript 5.0 (#6579) 2023-03-20 17:02:07 +01: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