Commit graph

1201 commits

Author SHA1 Message Date
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
16034f0dd5
Fix double-escaping of non-highlighted code blocks in Astro-flavored markdown (#4169) 2022-08-05 16:23:16 +02: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
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
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
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
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
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
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
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
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
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
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
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
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
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 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
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
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
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
Matthew Phillips
6120a71e54
Ensure file and url are always present in MDX for Astro.glob (#4076) 2022-07-28 10:58:44 -04: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
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
Matthew Phillips
54b33d50fd
Add errors to cloudflare/vercel adapters when no output config (#4068) 2022-07-27 11:50:48 -04: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
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. 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
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
9ab66c4ba9
add support for injected page-ssr scripts (#4050) 2022-07-26 00:26:47 -04: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
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
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
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
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
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
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