Commit graph

2149 commits

Author SHA1 Message Date
Tony Sullivan
5811208182
Fixes local image resolution in SSR builds on Windows (#4173)
* fixing SSR local file resolution path on windows

* chore: add changeset

* nit: fixing typo in image README file

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2022-08-05 20:36:30 +00:00
FredKSchott
ee38b02aa8 [ci] format 2022-08-05 20:02:26 +00:00
Fred K. Schott
2f0b823f28
do not resolve renderer.serverEntrypoint url before loading it (#4143) 2022-08-05 13:00:44 -07:00
bholmesdev
78eeb4075d [ci] format 2022-08-05 19:45:50 +00:00
Ben Holmes
471c6f784e
[markdown] Harder, better, faster, stronger vite-plugin-markdown (#4137)
* refactor: vite-plugin-md -> vite-plugin-md-legacy

* wip: add vite-plugin-md

* feat: always apply jsx renderer

* fix: markHTMLString on VNode result

* feat: apply new vite-plugin-markdown!

* fix: add meta export to md

* fix: remove needless $$metadata export

* fix: toggle to legacy plugin on flag

* fix: pass fileId to renderMarkdown

* test: raw and compiled content on plain md

* fix: escape vite env refs

* refactor: astro-md -> legacy-astro-flavored-md, astro-md-mode -> astro-markdown

* fix: import.meta.env refs with tests

* fix: add pkg.json to clientAddress

* fix: prefer JSX integration over Astro runtime

* Revert "fix: prefer JSX integration over Astro runtime"

This reverts commit 3e5fa49344be9c857393da9af095faab152e92e1.

* fix: remove .mdx check on importSource

* chore: changeset

* chore: remove TODO

* fix: add back getHeadings

* fix: add pkg.json to astro-head fixture

* fix: default to Astro renderer for MDX and MD

* feat: add "headings" and "frontmatter" to md layouts

* refactor: remove legacy flag conditionals from legacy plugin

* fix: add back MDX warning when legacy is off

* test: getHeadings() glob

* fix: add error on "astro.headings" access

* feat: update docs example astro.headings => headings

* refactor: readFile as string w/ utf-8

* chore: remove astro metadata TODO

* refactor: stringify HTML once

* fix: add pkg.json to glob-pages-css
2022-08-05 15:43:50 -04:00
natemoo-re
838eb3e5cc [ci] format 2022-08-05 19:42:58 +00:00
Nate Moore
36223f663e
Add getViteConfig helper (#4154)
* feat: add astro/compat entrypoint for vitest

* chore: add with-vitest example

* chore: add vitest as optional peer dependency

* chore: update lockfile

* refactor: remove astro/compat, use astro/config

* feat: allow arbitrary modes for `create-vite`

* feat: pass vite mode and command when using `getViteConfig`

* chore: remove vitest from peer deps

* chore: add changeset

* chore: update lockfile

Co-authored-by: Nate Moore <nate@astro.build>
2022-08-05 14:41:01 -05:00
natemoo-re
3118dd26d1 [ci] format 2022-08-05 18:37:38 +00:00
Nate Moore
025743849d
Fix duplicate CSS in dev mode (#4157)
* fix(hmr): remove SSR styles once HMR styles are injected

* refactor: remove data-astro-injected tag

* chore: add changeset

Co-authored-by: Nate Moore <nate@astro.build>
2022-08-05 13:36:03 -05:00
natemoo-re
29da99c4b3 [ci] format 2022-08-05 15:41:32 +00:00
Nate Moore
9014f0f8cb
fix: hide error overlay tip, log [astro] instead of [vite] (#4162)
Co-authored-by: Nate Moore <nate@astro.build>
2022-08-05 10:39:24 -05:00
Nate Moore
e569f0a5c7
Handle edge case in jsx-runtime (#4158)
* fix(#4135): handle edge case in jsx-runtime

* test: add mdx test case

* chore: fix utils reference

* test: fix mdx escape test

Co-authored-by: Nate Moore <nate@astro.build>
2022-08-05 10:35:47 -05:00
hippotastic
e7bee22d18 [ci] format 2022-08-05 14:24:50 +00:00
hippotastic
16034f0dd5
Fix double-escaping of non-highlighted code blocks in Astro-flavored markdown (#4169) 2022-08-05 16:23:16 +02:00
matthewp
9315ce65dd [ci] format 2022-08-05 13:53:50 +00:00
Matthew Phillips
82a1063cc2
Include CSS when child component uses Astro.glob on page (#4156)
* Include CSS when child component uses Astro.glob on page

* windows compat

* Make work on windows

* Remove unnecessary concat
2022-08-05 09:52:12 -04:00
Fred K. Schott
c7efcf57e0
fix missing newline bug in mdx (#4145) 2022-08-04 23:12:07 -07:00
Fred K. Schott
3321aace06
improve an error message for getstaticpaths (#4153) 2022-08-04 23:11:58 -07:00
natemoo-re
9c7021f695 [ci] format 2022-08-04 19:41:44 +00:00
kagankan
81c9ad9a6b
Add vite.build.cssTarget support for CSS build (#4155)
* Add `vite.build.cssTarget` support for CSS build

* chore: update lockfile

Co-authored-by: Nate Moore <nate@astro.build>
2022-08-04 14:39:43 -05:00
Princesseuh
3362ec2478 [ci] format 2022-08-04 18:19:18 +00:00
Erika
f591150512
Audit examples templates (#3940)
* basics, framework-alpine, framework-solid, delete unused examples

* framework-multiple

* Remove non-standard file extensions, add missing .vscode folders

* Remove robots.txt

* Remove blog-multiple-authors

* Rewrite components comments to be consistent

* Update lockfile

* Remove unnecessary usage of SCSS in subpath example

* Fix props weirdness in portfolio example

* Remove Lit from `framework-multiple` for now

* Misc fixes

* Update lockfile

* I'm in lockfile hell, send help
2022-08-04 14:16:51 -04:00
Fred K. Bot
32580d4fdc
[ci] release (#4152)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-08-04 12:21:38 -04:00
matthewp
b913c8afb5 [ci] format 2022-08-04 15:45:37 +00:00
Matthew Phillips
4d64752274
Order server CSS the same as static (#4149)
* Order server CSS the same as static

* Adds a changeset
2022-08-04 11:43:25 -04:00
Fred K. Bot
7300f094fd
[ci] release (#4133)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-08-03 23:14:04 -07:00
Fred K. Schott
65f2d3b4b1
fix windows package export (#4141)
* fix windows package export

* Create neat-badgers-bow.md
2022-08-03 23:11:37 -07:00
bholmesdev
66319cb49f [ci] format 2022-08-03 21:56:30 +00:00
Ben Holmes
2968ba2b6f
[MDX] Add headings and frontmatter to layout props (#4134)
* feat: expose headings on layout props

* test: frontmatter AND content

* test: headings in layouts

* chore: changeset
2022-08-03 17:54:55 -04:00
natemoo-re
7bc75a03a7 [ci] format 2022-08-03 19:06:40 +00:00
Viktor Persson
ec5518fe30
Add mdx extension to tailwind content glob. (#4063)
* Add mdx extension to tailwind content glob.

* Create wicked-hairs-rescue.md

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2022-08-03 14:04:44 -05:00
Nate Moore
5f3b3b44db
Improve style HMR (#4125)
* feat: improve style HMR

* chore: add inline comments

* Update hmr.ts

Co-authored-by: Nate Moore <nate@astro.build>
2022-08-03 14:03:56 -05:00
Matthew Phillips
09eca9be5e
Only rethrow renderer error when no renderer found (#4131)
* Only rethrow renderer error when no renderer found

* Adds a changeset
2022-08-03 14:33:31 -04:00
Fred K. Bot
acd0b6da3c
[ci] update lockfile (#4100)
* [ci] update lockfile

* fix: remove @ts-expect-error

Co-authored-by: FredKSchott <FredKSchott@users.noreply.github.com>
Co-authored-by: Nate Moore <nate@astro.build>
2022-08-03 11:16:07 -05:00
Alan
08432d5b01
Allow globbed mdx files to have typed frontmatter (#4108)
* Allow frontmatter typing for .mdx files from glob

`Astro.glob<T>("*.md")` is special cased to allow `T` to be a type for the frontmatter in the markdown. Since .mdx files also get frontmatter added to the globbed result, let's type it as such.

* Add changeset

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
Co-authored-by: Tony Sullivan <tony.f.sullivan@outlook.com>
2022-08-03 10:45:31 -05:00
Zade Viggers
a28b441763
Remove renderer tag to fix a docs issue (#4127)
[This page](https://docs.astro.build/en/guides/integrations-guide/) is autogenerated based on the packages in this repo and said packages' tags. Removing the renderer tag here should stop it from appearing in the UI Framework category.
2022-08-03 10:36:38 -05:00
Fred K. Bot
077d78fddc
[ci] release (#4116)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-08-02 14:50:21 -07:00
Matthew Phillips
2ee8e881d4
Upgrade Vite to 3.0.4 (#4124)
* Upgrade Vite to 3.0.4

* Add a changeset
2022-08-02 14:25:38 -07:00
Erika
ac6ffdb310
Audit dependencies (#4096)
* Remove some unused dependencies

* Update lockfile

* Add util

* Remove util
2022-08-02 16:08:21 -04:00
Princesseuh
27d29698ee [ci] format 2022-08-02 19:55:13 +00:00
Erika
64432bcb87
Refactor @astrojs/prism, fix Prism component import not working (#4114)
* Upgrade @astrojs/prism to a real package, fix component import not working

* Remove `@astrojs/prism` as a dependency of `astro`

* Update lock file

* Refactor to multiple files

* Oops, can't have astro imports run inside node

* Follow Nate's suggestion on being minors instead of patchs

* Update lockfile
2022-08-02 15:53:18 -04:00
natemoo-re
59aa8d4283 [ci] format 2022-08-02 19:08:52 +00:00
Nate Moore
b60cc0538b
Add generic plugin for page-ssr injection (#4049)
* feat: add generic page-ssr plugin

* refactor: remove page-specific logic from astro/markdown/mdx plugins

* refactor: revert changes to vite-plugin-scripts

* fix: handle injected `page` scripts in build

* fix: prepend injected `page` scripts with `/@id/` in dev

Co-authored-by: Nate Moore <nate@astro.build>
2022-08-02 14:07:17 -05:00
Adrian Dimitrov
9cc3a11c44
Do not send body with HEAD and GET on node integration (#4105)
* Do not send body with HEAD and GET on node integration

* Create seven-suits-sit.md

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2022-08-02 11:19:43 -05:00
natemoo-re
ba801b99e5 [ci] format 2022-08-02 15:28:12 +00:00
Nate Moore
26cc0bbf78
Do not crawl non-style deps imported by styles (#4115)
* fix: do not crawl non-style deps imported by styles

* Update vite.ts

Co-authored-by: Nate Moore <nate@astro.build>
2022-08-02 10:26:38 -05:00
Isaac McFadyen
004995eecd
Update README.md (#4119) 2022-08-02 10:26:25 -05:00
Nate Moore
abfaf6bb0e
chore: skip cloudflare test for now (#4117)
Co-authored-by: Nate Moore <nate@astro.build>
2022-08-02 10:26:00 -05:00
matthewp
7d1f86d4b7 [ci] format 2022-08-02 12:10:35 +00:00
Matthew Phillips
e33fc9bc46
Load configs with Vite when loading with Proload fails (#4112)
* 4078 breaking test

* Use Vite for loading the config

* Try it

* Fallback to loading with Vite only when needed

* Remove console.error

* Remove extra console.log

* Add a changeset

* Use middlewareMode
2022-08-02 08:08:28 -04:00
bholmesdev
10a8fa5dcd [ci] format 2022-08-01 21:25:50 +00:00
Ben Holmes
40ef43a59b
[MDX] Add getHeadings + generate anchor links (#4095)
* deps: mdx github-slugger

* feat: add getHeadings via rehype plugin

* chore: stray console.log

* test: getHeadings w/ & w/0 JSX expressions

* docs: add generated exports

* refactor: pass headings using vfile.data

* deps: vfile

* test: heading anchor IDs

* docs: add collect-headings to default rehype plugins

* chore: changeset

* deps: estree-util-value-to-estree

* refactor: inject getHeadings export the right way!

* deps: switch to acorn

* refactor: just use acorn

* docs: `getHeadings` info structuring

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

* docs: clarify `url` example

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

* fix: move slugger inside plugin call

* refactor: cleanup code reassignment

* chore: lint

* deps: mdast-util-mdx, test utils

* refactor: add jsToTreeNode util

* feat: expose utils for lib authors

* test: rehype plugins w/ and w/o extends

* test: fixture

* refactor: remove utils from package exports

Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
2022-08-01 17:23:56 -04:00
FredKSchott
f62f05f181 [ci] format 2022-08-01 16:16:51 +00:00
Fred K. Schott
643443bcd9
remove unused util polyfill dependency (#4097)
* remove util dependency

* update tests
2022-08-01 09:15:23 -07:00
Sarah Rainsberger
76ec35ff30
[docs content] Image README formatting (#4082)
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
2022-07-30 09:29:03 -03:00
Fred K. Bot
268d44e25b
[ci] release (#4086)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-30 00:29:04 -04:00
tony-sull
2ac5c557cf [ci] format 2022-07-29 20:56:25 +00:00
Tony Sullivan
a0d1731a7e
Updates the dev server to handle multiple routes matching the same URL (#4087)
* updates the dev server to handle multiple routes matching the same URL

* Adding an error message when multiple routes match in SSR

* resetting the flag used by the `calledTwiceTest`

* injected routes should be sorted with a higher priority than user-defined routes

* adding routing priority tests for injected routes

* chore: add changeset

* adding a dev test to make sure getStaticPaths is called once
2022-07-29 20:54:51 +00:00
bholmesdev
8e20156638 [ci] format 2022-07-29 15:24:57 +00:00
Ben Holmes
1743fe140e
feat: support layout in MDX frontmatter (#4088)
* deps: add gray-matter

* feat: support layout frontmatter property

* test: frontmatter, content prop

* docs: update layout recommendation

* deps: fix lockfile

* chore: changeset

* fix: inherit rollup plugin transform

* fix: avoid parsing frontmatter on custom parsers

* fix: match YAML err handling from md

* docs: absolute url to docs

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

* chore: formatting

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2022-07-29 11:22:57 -04:00
matthewp
45bec97d28 [ci] format 2022-07-29 14:48:08 +00:00
Matthew Phillips
09c1e586ee
Prevent hydration scripts from being rendered in the wrong order (#4080)
* Prevent hydration scripts from being rendered in the wrong order

* Remove comment

* Update jsx

* Remove promise for stop

* Try skipping lit tests

* Stringify these chunks too

* Unskip lit
2022-07-29 10:46:09 -04:00
Erika
c15cb36636
Fix shape of Markdown component to work with the language-server (#4085)
* Fix shape of Markdown component to work with the language-server

* Add changeset
2022-07-28 16:00:11 -04:00
Fred K. Bot
84193e3ea1
[ci] release (#4081)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-28 15:53:57 -04:00
Matthew Phillips
8efe43ffe1 Fix lit e2e 2022-07-28 14:17:05 -04:00
Princesseuh
c2512230ee [ci] format 2022-07-28 16:07:57 +00:00
Erika
cc10a5c8e0
Fix misc create-astro issues (#4075)
* Add prompt to automatically fix cache issue

* Throw an error when an invalid template is used

* Use already existing util

* Add changeset
2022-07-28 12:05:39 -04:00
matthewp
22f76b8a7e [ci] format 2022-07-28 15:00:32 +00:00
Matthew Phillips
6120a71e54
Ensure file and url are always present in MDX for Astro.glob (#4076) 2022-07-28 10:58:44 -04:00
Sarah Rainsberger
6fb95dbdd6
[docs content] MDX layouts (#4077) 2022-07-28 10:06:23 -03:00
Fred K. Bot
6d103ddceb
[ci] release (#4056)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-28 08:17:45 -04:00
Alfredo González Martínez
c565465a96
Add properties (url, file) to MarkdownContent type (#4028)
'url' and 'file' properties were missing in MarkdownContent type,
but they should there according to:
https://docs.astro.build/en/guides/markdown-content/#markdown-layouts
2022-07-28 08:13:27 -04:00
Chell
9697649d31
fix link (#4070) 2022-07-28 08:11:37 -04:00
matthewp
3a599f2144 [ci] format 2022-07-27 20:17:38 +00:00
Matthew Phillips
a198028b04
Fixes cloudflare throwing over process (#4072)
* Fixes cloudflare throwing over process

* Up the timeout for slower CI servers

* Fix linting

* Up the timeout a bit
2022-07-27 16:15:19 -04:00
Matthew Phillips
13b4f8ad88
Add fontsource packages to always be noExternal (#4073)
* Add fontsource packages to always be noExternal

* Adds a changesetp
2022-07-27 15:48:21 -04:00
matthewp
6fa6369678 [ci] format 2022-07-27 15:52:44 +00:00
Matthew Phillips
54b33d50fd
Add errors to cloudflare/vercel adapters when no output config (#4068) 2022-07-27 11:50:48 -04:00
tony-sull
57770bbae2 [ci] format 2022-07-27 15:41:22 +00:00
Tony Sullivan
a397b981f5
Fixes type definitions @astrojs/image and adds more documentation to the README (#4045)
* WIP: moving to a static .d.ts types file

* fixing named exports for getImage and getPicture

* removing the exports.astro map for now

* WIP: adding readme docs for component attributes

* Adding docs for getImage and getPicture

* leaning fully on TSC to build .d.ts files

* finally found the solution for proper ESM import types

* adding a note to the README for tsconfig updates

* chore: add changesets

* typo

* docs: removing the "Images in Markdown" example

* removing the need for publishing src to NPM

* fix: make type re-export explicit

* updating image module defs to match InputFormat

* using astro syntax highlighting for README code blocks

* nit: missing backtick in README

* make sure Astro component directives aren't recommended twice
2022-07-27 15:39:05 +00:00
matthewp
55c8aced44 [ci] format 2022-07-26 21:33:54 +00:00
Matthew Phillips
da5e6ca128
Add tests for markdown content escaping (#4058) 2022-07-26 17:31:57 -04:00
matthewp
c57242d534 [ci] format 2022-07-26 18:06:03 +00:00
Matthew Phillips
40251118f8
Prevent Svelte HMR warning during the build (#4057) 2022-07-26 14:04:26 -04:00
Matthew Phillips
44694d8a90
Fixes binary data request bodies in the Node adapter (#4055)
* Fixes binary data request bodies in the Node adapter

* Fix type
2022-07-26 10:31:54 -04:00
Fred K. Schott
00768580af
Update CHANGELOG.md 2022-07-26 10:06:25 -04:00
Fred K. Bot
d790eabd98
[ci] release (#3972)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-26 09:58:38 -04:00
matthewp
6a89867844 [ci] format 2022-07-26 12:57:00 +00:00
Matthew Phillips
453c026aa7
Move getStaticPaths call to happen during generation (#4047)
* Move getStaticPaths call to happen during generation

* Adds a changeset

* Update routing-priority.test.js

* revert test change, clarify test purpose

* Keep track of paths that have already been built

Co-authored-by: Fred K. Schott <fkschott@gmail.com>
2022-07-26 08:54:49 -04:00
Fred K. Schott
f64aa1475b update md deprecation messages 2022-07-26 00:32:55 -04:00
Fred K. Schott
9ab66c4ba9
add support for injected page-ssr scripts (#4050) 2022-07-26 00:26:47 -04:00
tony-sull
2a13e430b1 [ci] format 2022-07-25 21:16:11 +00:00
Tony Sullivan
e60d6d9c1d
Removes fileURLToPath dependency from @astrojs/image SSR production endpoint (#4048)
* removing fileURLToPath dependency from SSR production endpoint

* chore: add changeset
2022-07-25 21:14:03 +00:00
Sarah Rainsberger
ab8f4901a2
[docs content] use "version" not since (#4043)
* [docs content] use "version" not since

Change to use `@version` to create the `<Since />` component for docs. (not `@since)

Also, quick sentence edit.

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

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2022-07-25 14:39:58 -05:00
matthewp
813d392717 [ci] format 2022-07-25 19:17:18 +00:00
Matthew Phillips
c811be49ab
Add warnings on markdown deprecations (#4046)
* Warn when using content.astro.headers

* Warn when using setup without the legacy flag enabled

* Adds a changeset
2022-07-25 15:14:53 -04:00
matthewp
f9e8e72a48 [ci] format 2022-07-25 16:16:22 +00:00
Matthew Phillips
7e5ac1f45c
Build the before-hydration script (#4042)
* Build the before-hydration script

* Adding a changeset
2022-07-25 12:14:41 -04:00
Princesseuh
149780493e [ci] format 2022-07-25 15:12:45 +00:00
András Torma
6f88597c36
Added missing "loading" attribute for "IFrameHTMLAttributes" (#4044)
* Add missing "loading" attr to iFrame

* Add changeset

* re-ordering attributes
2022-07-25 11:11:08 -04:00
FredKSchott
d2148ce982 [ci] format 2022-07-25 04:20:38 +00:00
Sarah Rainsberger
552d23bc9b
[Doc-generated content] legacy.astroFlavoredMarkdown (#4027)
* Update astro.ts

* custom aside syntax

* adding `@since` tag

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

* closing comment

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

* Update astro.ts

Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
Co-authored-by: Fred K. Schott <fkschott@gmail.com>
2022-07-25 00:18:15 -04:00
Matthew Phillips
6fd161d769
Add the output option (#4015)
* Start of work on astroConfig.mode === 'server'

* Add tests and more

* adapter -> deploy in some places

* Add fallback for `adapter` config

* Update more tests

* Update image tests

* Fix clientAddress test

* Updates based on PR review

* Add a changeset

* Update integrations tests + readme

* Oops

* Remove old option

* Rename `mode` to `output`

* Update Node adapter test

* Update test

* fred pass

* fred pass

* fred pass

* fix test

Co-authored-by: Fred K. Schott <fkschott@gmail.com>
2022-07-25 00:18:02 -04:00
Nate Moore
8859655f15
Update astro version to 1.0.0-rc.0 (#4030)
* chore: update `astro` to `1.0.0-rc.0`

* chore: update `astro` version in examples

Co-authored-by: Nate Moore <nate@astro.build>
2022-07-24 22:32:28 -04:00
natemoo-re
436512c00d [ci] format 2022-07-23 23:29:32 +00:00
Ari Gibson
beddf073b5
Fix: (patching old PR) Check node version and find acceptable host accordingly (#4032)
* fix: check node version and find acceptable host accordingly

* Update for Node v18.4+

* Removed unrelated changesets

* Revert "Removed unrelated changesets"

This reverts commit e77ffc0fed.

* chore: remove duplicate changeset

Co-authored-by: Nate Moore <nate@astro.build>
2022-07-23 18:27:35 -05:00
natemoo-re
8c08181822 [ci] format 2022-07-23 22:25:44 +00:00
Nate Moore
6e27a5fdc2
Rename Markdown util getHeaders() to getHeadings() (#4031)
* Renamed getHeaders() to getHeadings(), according to RFC #208.

* chore: update changeset

* fix: expose MarkdownHeading type from `astro`

Co-authored-by: Félix Sanz <me@felixsanz.com>
Co-authored-by: Nate Moore <nate@astro.build>
2022-07-23 17:23:15 -05:00
Nate Moore
1215e731b8
Preserve authored CSS specificity (#4024)
* feat: preserve authored CSS specificity

* chore: update tests to use :where()

* test: fix HTML and CSS test

* test: fix imported markdown CSS test

Co-authored-by: Nate Moore <nate@astro.build>
2022-07-23 13:11:12 -05:00
tony-sull
cb1db133ba [ci] format 2022-07-22 23:04:01 +00:00
Tony Sullivan
ef9345767b
WIP: [image] Fixing SSR support and improving error validation (#4013)
* fix: SSR builds were hitting an undefined error and skipping the step for copying original assets

* chore: update lockfile

* chore: adding better error validation to getImage and getPicture

* refactor: cleaning up index.ts

* refactor: moving SSG build generation logic out of the integration

* splitting build to ssg & ssr helpers, re-enabling SSR image build tests

* sharp should automatically rotate based on EXIF

* cleaning up how static images are tracked for SSG builds

* undo unrelated mod.d.ts change

* chore: add changeset
2022-07-22 23:01:56 +00:00
tony-sull
41f4a8f9cb [ci] format 2022-07-22 22:47:21 +00:00
Ben Holmes
00fab4ce13
Feat: new legacy.astroFlavoredMarkdown flag (#4016)
* refactor: add legacy.jsxInMarkdown flag to config

* refactor: jsxInMarkdown -> astroFlavoredMarkdown

* refactor: remove `markdown.mode`

* feat: wire up legacy.astroFlavoredMarkdown

* test: add legacy to astro-markdown fixture

* test: remark autolinking

* test: remark components

* test: remark expressions

* test: remark strictness

* chore: remove "mode" from md component

* chore: remove "mode: md" from tests

* Fixing legacy MD tests, adding named slots tests for MDX pages

* chore: update lock file

* WIP: debugging named slots in MDX

* fix: handle named slots in MDX properly

* chore: re-enabling slots tests for MDX pages

* fixing test validation for svelte & vue

* removing unused Tailwind test

* legacy flag for Markdown component tests

* adding is:raw to Markdown component test

* adding is:raw to all Markdown component test fixtures

* can't use is:raw when nesting markdown components

* another nested test can't use is:raw

* one more <Markdown> test fix

* fixing another JSX markdown component test

* chore: add changeset

* e2e tests were missing the legacy flag

* removing the broken tailwind E2E markdown page

Co-authored-by: Tony Sullivan <tony.f.sullivan@outlook.com>
Co-authored-by: Nate Moore <nate@astro.build>
2022-07-22 22:45:16 +00:00
matthewp
c17efc1ad9 [ci] format 2022-07-22 20:32:12 +00:00
Okiki Ojo
0cc6ede362
SSR 404 and 500 routes in adapters (#4018)
* fix(WIP): SSR 404 and 500 routes

* Implement the feature

Co-authored-by: Matthew Phillips <matthew@skypack.dev>
2022-07-22 16:30:17 -04:00
matthewp
4392083cca [ci] format 2022-07-22 19:24:58 +00:00
Matthew Phillips
4ca6a0933d
Fixes Node adapter receiving a request body (#4023)
* Fixes Node adapter receiving a request body

* Updated lockfile
2022-07-22 15:22:31 -04:00
Chris Swithinbank
9aecf7c7c7
Handle EXIF orientation flag (#4021)
* Handle EXIF orientation flag

* Create gentle-mails-mate.md
2022-07-22 19:14:00 +00:00
natemoo-re
337318142a [ci] format 2022-07-22 18:39:30 +00:00
Nate Moore
27ee8b97ae
Overhaul HMR handling for .astro files (#3932)
* feat(hmr): overhaul HMR handling for `.astro` files

* test: remove irrelevant hmr-css test

* fix: ignore HMR logs for monorepo files

* fix: explicitly call import.meta.hot.decline()

* chore: add changeset

* fix: run smoke tests in serial

* chore: bump postcss test timeout

* test: fix undefined `this`

Co-authored-by: Nate Moore <nate@astro.build>
2022-07-22 13:37:20 -05:00
natemoo-re
4819e7b071 [ci] format 2022-07-22 15:34:44 +00:00
Nate Moore
7250e4e86d
Add .html support (#3867)
* feat: add html package

* feat: support assets in HTML

* feat(html): upgrade html integration

* feat(html): add `@astrojs/html` integration

* feat(html): add html support to astro core

* test(html): update html tests with package.json files

* chore: add changeset

* fix: remove import cycle

* chore: fix types

* refactor: remove @astrojs/html, add to core

* chore: update types for `*.html`

* fix: move *.html to astro/env

Co-authored-by: Nate Moore <nate@astro.build>
2022-07-22 10:32:36 -05:00
natemoo-re
8b468ccccc [ci] format 2022-07-22 15:16:46 +00:00
Nate Moore
fbef6a7f72
New handling for define:vars scripts and styles (#3976)
* feat: new handling for `define:vars` scripts and styles

* fix: handle new script hoisting pattern

* refactor: compiler handles sourcemaps

* chore: update to handle is:inline define:vars

* chore: bump compiler to latest

* chore: update define:vars tests

* fix: output of `define:vars` is not object style

* fix: appease ts

* chore: remove unused file

* chore: revert unecessary refactors

* chore: prefer sync `defineScriptVars`

* chore: add changeset

Co-authored-by: Nate Moore <nate@astro.build>
Co-authored-by: Okiki Ojo <okikio.dev@gmail.com>
2022-07-22 10:14:25 -05:00
Juan Martín Seery
1666fdb4c5
feat(vercel): remove requirement of ENABLE_VC_BUILD=1 (#4020)
* Remove requirement of `ENABLE_VC_BUILD=1`

* Changeset
2022-07-22 10:13:35 -05:00
bholmesdev
476766b0d9 [ci] format 2022-07-21 22:03:46 +00:00
Ben Holmes
399d7e2698
Fix: use set:html when markdown mode is md (#4008)
* refactor: add legacy.jsxInMarkdown flag to config

* fix: use `set:html` when `markdown.mode` is 'md'

* Revert "refactor: add legacy.jsxInMarkdown flag to config"

This reverts commit 5572e8d9b3.

* fix: move `remarkUnwrap, remarkEscape` to MDX only

* fix: only apply scary HTML passthroughs on MDX

* fix: move all JSX-specific rehype plugins under `isMDX`

* fix: "allowDangerousHtml" for md (required for Shiki)

* fix: apply `set:html` for non-layouts too

* test: JSX expressions, components, syntax highlighting

* chore: changeset

* fix: ignore "setup" and "components" in plain MD mode

* refactor: create new fixture to avoid weird caching error

* fix: dup package name

* chore: update lock

* fix: apply rehypeCollectHeaders to md
2022-07-21 18:01:26 -04:00
bholmesdev
c2968b0542 [ci] format 2022-07-21 20:46:16 +00:00
Ben Holmes
3b8a744524
[MDX] Add Prism and Shiki support (#4002)
* deps: add rehype-prism, shiki, rehype-pretty-code

* wip: apply rehype plugins depending on config

* wip: cherry-pick jsx-runtime fix?

* deps: rehype-pretty-code -> shiki-twoslash, add rehype-raw

* wip: add jsx-runtime fix

* feat: get shiki working!

* deps: add @astrojs/prism, prismjs, unist-util-visit

* feat: add prism support

* example: add small syntax highlight demo to with-mdx

* deps: remove rehype-prism

* chore: remove unused async

* chore: add .test.js to all mdx tests

* test: shiki, shikiConfig, prism

* fix: remove "is:raw" from prism output

* docs: add syntax highlighting section

* chore: add changeset

* nit: "Shiki config" -> Shiki config

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

* Revert "wip: add jsx-runtime fix"

This reverts commit 07f4528f44.

* docs: link to integration README from example

Co-authored-by: Nate Moore <nate@astro.build>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2022-07-21 16:43:58 -04:00
natemoo-re
3f7b5f155e [ci] format 2022-07-21 18:47:11 +00:00
Nate Moore
48011cbcf8
fix: provide hint for undefined exports (#4003)
Co-authored-by: Nate Moore <nate@astro.build>
2022-07-21 13:45:33 -05:00
matthewp
81758f1c1e [ci] format 2022-07-21 17:48:45 +00:00
Fred K. Schott
ddefb172f6
Replace/Rename Astro.canonicalURL with new Astro.url helper (#3959)
* add Astro.url

* Add examples of how to create the canonicalURL

Co-authored-by: Matthew Phillips <matthew@skypack.dev>
2022-07-21 13:45:59 -04:00
Matthew Phillips
d503c5bf3d
Fixes using tsconfig to set aliases (#4010) 2022-07-21 13:45:20 -04:00
natemoo-re
92de6e00a3 [ci] format 2022-07-21 17:39:31 +00:00
Allan Chain
21462feb4a
fix: better dev routing with base using middleware (#3942) 2022-07-21 12:37:26 -05:00
Sarah Rainsberger
ef9c4152b2
[READMEs] removed "experimental" from astro add instructions (#4004) 2022-07-21 14:33:59 -03:00
natemoo-re
4626eddd3b [ci] format 2022-07-21 17:18:01 +00:00
Nate Moore
2a5e92facd
Support objects for style attribute (#3776)
* feat: support style objects

* chore: update jsx types

* feat: support className for better JSX compat

Co-authored-by: Nate Moore <nate@astro.build>
2022-07-21 12:16:08 -05:00
matthewp
ce2994c9c0 [ci] format 2022-07-21 16:28:25 +00:00
Matthew Phillips
01ba07d8fa
Make the Lit integration be compat with Vite 3.0.1 (#4009)
* Make the Lit integration be compat with Vite 3.0.1

* Changeset

* Pin Vite version

* Update lockfile
2022-07-21 12:25:57 -04:00
bholmesdev
29eef85ce5 [ci] format 2022-07-21 01:36:26 +00:00
Ben Holmes
b2b367c969
[MDX] Support YAML frontmatter (#3995)
* chore: remove old comment

* deps: add remark-frontmatter

* deps: add remark-mdx-frontmatter

* fix: handle null or undefined frontmatter key

* feat: configure frontmatter plugins with defaults

* test: frontmatter and custom frontmatter name

* docs: add frontmatterOptions config

* docs: add "variables" and "frontmatter" docs

* chore: excessible -> accessible

* chore: changeset

* chore: remove bad mdx comment
2022-07-20 21:34:21 -04:00
Erika
40a45e3ef6
Properly support and type optional props in Svelte components (#3993)
* Properly support and type optional props in Svelte components

* Change output to support documentating components

* Add changeset
2022-07-20 17:32:46 -04:00
Tony Sullivan
1c1b9da624
Updates SSR routing to always give priority to public assets (#4000)
* matchRoute should ignore requests for public assets

* chore: add changeset
2022-07-20 20:54:46 +00:00
matthewp
335e58cd8b [ci] format 2022-07-20 20:47:28 +00:00
Matthew Phillips
bccd88f0eb
Move the Markdown component to its own package (#3986)
* Move the Markdown component to its own package

* Update the examples

* Updated lockfile

* Use is:raw

* Add a main field

* Update the formatting of the readme

* Rename to @astrojs/markdown-component
2022-07-20 16:45:05 -04:00
matthewp
d13afad272 [ci] format 2022-07-20 19:53:46 +00:00
Matthew Phillips
ccae431426
Removes warnings / flags for integrations and ssr (#3992) 2022-07-20 15:52:10 -04:00
bholmesdev
74b0099cd1 [ci] format 2022-07-20 18:16:33 +00:00