Commit graph

351 commits

Author SHA1 Message Date
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
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
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
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
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
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
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
Fred K. Bot
f36a0e87a6
[ci] update lockfile (#4089)
Co-authored-by: FredKSchott <FredKSchott@users.noreply.github.com>
2022-07-30 00:20:02 -04: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
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
Fred K. Bot
742eedee39
[ci] update lockfile (#4067)
Co-authored-by: FredKSchott <FredKSchott@users.noreply.github.com>
Co-authored-by: Matthew Phillips <matthew@skypack.dev>
2022-07-28 11:02:33 -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
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
54b33d50fd
Add errors to cloudflare/vercel adapters when no output config (#4068) 2022-07-27 11:50:48 -04:00
Matthew Phillips
da5e6ca128
Add tests for markdown content escaping (#4058) 2022-07-26 17:31:57 -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
Fred K. Bot
c7e117ce32
[ci] update lockfile (#4054)
Co-authored-by: FredKSchott <FredKSchott@users.noreply.github.com>
2022-07-26 09:02:53 -04:00
Fred K. Bot
adf8cde10f
[ci] update lockfile (#4040)
Co-authored-by: FredKSchott <FredKSchott@users.noreply.github.com>
Co-authored-by: Fred K. Schott <fkschott@gmail.com>
2022-07-26 00:50:43 -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
Fred K. Bot
cd4be4822c
[ci] update lockfile (#4036)
Co-authored-by: FredKSchott <FredKSchott@users.noreply.github.com>
2022-07-25 00:18:32 -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
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
Fred K. Bot
7db1cc20e9
[ci] update lockfile (#4026)
Co-authored-by: FredKSchott <FredKSchott@users.noreply.github.com>
2022-07-23 12:42:21 -05: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
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
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
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
Fred K. Bot
a626600a9e
[ci] update lockfile (#4019)
Co-authored-by: FredKSchott <FredKSchott@users.noreply.github.com>
2022-07-22 13:14:42 -05: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
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
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
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
Matthew Phillips
d503c5bf3d
Fixes using tsconfig to set aliases (#4010) 2022-07-21 13:45:20 -04:00
Allan Chain
21462feb4a
fix: better dev routing with base using middleware (#3942) 2022-07-21 12:37:26 -05: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
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
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
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
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
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
Matthew Phillips
04070c0c12
Migrate to Vite 3 ️ (#3570)
* Vite 3 test

* deps: bump to Vite beta.1

* refactor: move to use optimizeDeps.force option

* refactor: stub out new updateModuleInfo params

* nit: remove comment on deprecated Vite feature

* nit: remove comment on deprecated vite feature

* hail mary: destroy all ssr external / noexternal!

* fix: use new middlewareMode config settings

* fix: resolve npm package paths for rollup input

* wip: revert to unresolved. Issue reported!

* sad refactor: use legacy devDepsScanner for component HMR

* fix: add astro/components to noExternal for Code component

* refactor: use ALWAYS_NOEXTERNAL array

* refactor: add package.json to all test runners for noExternal error

* deps: bump to latest vite 3 beta

* wip: add package.json to smoke

* fix: remove accidental "force true" on create-vite

* refactor: write smoke package.json programmatically

* refactor: add fontsource to noExternal

* fix: only add to ssr.noExternal if present in project

* wip: what if we just... didn't have a memory test

* deps: bump to latest vite beta

* Revert "wip: what if we just... didn't have a memory test"

This reverts commit 173729dbdc685e52881fc3333487b8f744add55f.

* fix: add type check for plugin.name

* feat: remove legacy.devDepsScanner. Vite 3 strat is now Vite 2.x strat!

* fix: add ssr.noExternal to components ex

* wip: ignore with-mdx starter

* fix: add serviceEntryPoint to ssr.noExternal

* temp: reset NODE_ENV on prod builds

* fix: missing async tag

* VITE 3 IS STABLE BABY

* deps: bump svelte to vite 3

* deps: bump vue to vite 3

* fix: resolve plugins for proper sorting

* sad fix: regex "export default" out of CSS ssr

* chore: add TODO to understand sad fix

* Revert "fix: resolve plugins for proper sorting"

This reverts commit e67c194d3a8e11070487ed325947e7c59e8d69cd.

* Revert "sad fix: regex "export default" out of CSS ssr"

This reverts commit 721d40b62b61440dc9e488787901c915579659db.

* fix: sort plugins WITHOUT resolveConfig

* Revert "wip: ignore with-mdx starter"

This reverts commit 7d4f7338e6.

* chore: revert memory test changes

* chore: add nanostores/preact ot noexternal

* chore: changeset

* chore: changeset

* deps: use Vite ^3.0.0

* fix: add back third party astro pkg scanner

Co-authored-by: bholmesdev <hey@bholmes.dev>
2022-07-18 22:19:23 -07:00