Commit graph

3544 commits

Author SHA1 Message Date
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
FredKSchott
31142411b0 [ci] format 2022-07-20 21:12:42 +00:00
Fred K. Schott
fe7cde41f5
Update snapshot release instructions 2022-07-20 14:10:26 -07: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
Nate Moore
4dd341c8a1
chore: add changeset (#3991)
Co-authored-by: Nate Moore <nate@astro.build>
2022-07-20 14:25:44 -05:00
bholmesdev
74b0099cd1 [ci] format 2022-07-20 18:16:33 +00:00
Ben Holmes
19433eb4a4
[MDX] Support remark and rehype plugins, with defaults (#3977)
* feaet: allow remark and rehype plugin config

* deps: add remark-gfm, remark-smartypants

* feat: add gfm and smartypants by default

* test: add GFM and remark plugin tests

* feat: preserve default plugins with "extends"

* docs: add remarkPlugins

* docs: add rehypePlugins

* chore: changeset

* fix: remove skip from mdx tests

* chore: dup hyperlink flavor text

* chore: authGen -> autoGen

* nit: markdown -> Markdown

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>

* nit: markdown -> Markdown 1

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>

* nit: markdown -> Markdown 2

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>

* nit: markdown -> Markdown 3

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>

* nit: markdown -> Markdown 4

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2022-07-20 14:14:23 -04:00
Princesseuh
d50f46bfab [ci] format 2022-07-20 15:18:23 +00:00
Erika
9841c21e8e
Fix astro check file paths not handling URL paths correctly (#3988)
* Fix `astro check` file paths not handling URLs path correctly

* Add changeset
2022-07-20 11:16:22 -04:00
bholmesdev
66012e334a [ci] format 2022-07-20 14:58:33 +00:00
Ben Holmes
61fec63044
[MDX] Include url in glob result (#3981)
* deps: add es-module-lexer

* feat: inject url export on mdx files

* fix: apply url transform in prod

* test: page urls with overrides

* fix: revert test skips

* chore: changeset

* fix: add newline before export
2022-07-20 10:56:32 -04:00
Tony Sullivan
eaf187f2c4
Fixing TypeScript type definitions for image components (#3980)
* moving back to importing from components directory

* exporting components with a .ts file instead of .js

* chore: changeset
2022-07-20 00:33:11 +00:00
natemoo-re
b043fb1980 [ci] format 2022-07-19 21:49:29 +00:00
Nate Moore
4412fe61f4
Improve error handling (#3859)
* feat: tag JSX exports with correct renderer

* feat(error): enhance generic errors with frame

* feat(error): surface errors from streaming response

* feat(error): use vite overlay to display errors

* chore: fix build issues

* feat: use custom logger to hide vite errors for known packages

* chore: move error-react-spectrum to e2e test

* chore: add todo comment

* test: fix error overlay handling

* refactor: extract overlay message to util

* test(e2e): update shared component tests

* fix: give error overlay more time

* refactor: move errors tests to e2e

* fix: appease ts

* test: move sass error to e2e tests

* fix: scope optimizeDeps to `src/pages/**/*`

* chore: update lockfile

* chore: update test script

* chore: log error overlay

* chore: log error tests

* chore: update playwright config

* test(e2e): update errors tests

* test(e2e): fix overlay util

* test(e2e): fix test utils

* test(e2e): try timeout

* test(e2e): give up on overlay tests

* fix: typo

* fix: typo

* refactor: collapse definition

* fix: let errors throw

* chore: revert scanner change

* chore: refactor err.plugin handling

* chore: add clarifying comments

* fix: make astro:renderer non enumerable

* chore: update comments

* refactor: replace astro:renderer string with Symbol

* chore: add comment about tagged components

* feat: improve error overlay when hint exists

Co-authored-by: Nate Moore <nate@astro.build>
2022-07-19 16:47:31 -05:00
matthewp
4ee997da43 [ci] format 2022-07-19 20:11:53 +00:00
Matthew Phillips
5a23483efb
Adds support for Astro.clientAddress (#3973)
* Adds support for Astro.clientAddress

* Pass through mode and adapterName in SSG

* Pass through the mode provided

* Provide an adapter specific error message when possible
2022-07-19 16:10:15 -04:00
Tony Sullivan
d73c04a9e5
<Picture> component should pass all unknown attributes to the <img> element (#3961)
* <Picture /> should pass all unrecognized props down to the <img> element

* chore: add changeset

* Adding test coverage for custom <img> attributes

* chore: adding a README note for passing attributes to the picture's img

* Revert "<Picture /> should pass all unrecognized props down to the <img> element"

This reverts commit ce3e33930f.

* Picture should pass alt text to the img
2022-07-19 19:21:58 +00:00
Astroalex
b37d7078a0
minor: updating the README for @astrojs/sitemap@0.2.0 changes (#3978)
* fix: updating the README for `v0.2.0` changes

* Create chilled-cherries-decide.md

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2022-07-19 14:02:30 -05:00
bholmesdev
6f69516f98 [ci] format 2022-07-19 17:49:40 +00:00
Ben Holmes
95eaa207d8
Feat: log warning on astro.config change, restart server on astro.config added (#3968)
* feat: log on config change, restart on config add

* chore: changeset

* chore: remove unused export
2022-07-19 13:48:07 -04:00
Ben Holmes
91e051dc62
temp: pull astro.build from smoke (#3975) 2022-07-19 13:11:40 -04:00
Mihkel Eidast
e82ff13f18
fix: add export keyword to file stub (#3944) 2022-07-19 10:55:59 -05:00
Erika
54865612ea
Add missing media attribute on MetaHTMLAttributes (#3974)
* Add missing media attribute on MetaHTMLAttributes

* Fixed media not being optional, oops

* Add changeset
2022-07-19 11:41:29 -04:00
Tony Sullivan
e6e2160614
Adds back create-astro support for GitHub repos (#3971)
* adding create-astro support for GitHub repos

* chore: add changeset

* nit: adding a comment to document what the fix is doing
2022-07-19 14:24:19 +00:00