Commit graph

547 commits

Author SHA1 Message Date
Bjorn Lu
aa555932be
Support vite.build.cssCodeSplit: false option (#4458) 2022-08-25 16:34:13 +08:00
Fred K. Bot
8b00456765
[ci] update lockfile (#4452)
Co-authored-by: FredKSchott <FredKSchott@users.noreply.github.com>
Co-authored-by: Matthew Phillips <matthew@skypack.dev>
2022-08-24 11:28:39 -04:00
Bjorn Lu
a38a568299
Fix incorrect css test (#4451) 2022-08-24 22:11:42 +08:00
hippotastic
57fafc7c01
Add tests: Special chars in component import paths (#4263)
* Add tests: Special chars in component import paths

* Fix ESLint warnings, add Windows dev exclusion

* Crude fix

* chore: update compiler

* chore: bump compiler

* fix: remove decodeURI

* Fix tests and skip them for now

Co-authored-by: Princesseuh <princssdev@gmail.com>
Co-authored-by: Nate Moore <nate@astro.build>
2022-08-23 15:55:03 -04:00
Fred K. Bot
65885e2066
[ci] update lockfile (#4434)
* [ci] update lockfile

* Pin rollup to ~2.77.0

Co-authored-by: FredKSchott <FredKSchott@users.noreply.github.com>
Co-authored-by: bluwy <bjornlu.dev@gmail.com>
2022-08-23 15:49:43 -04:00
Fred K. Bot
5427e89491
[ci] release (#4431)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-08-23 15:27:10 -04:00
Matthew Phillips
f40065f510
Ensure index pages are generated on paginated results (#4426)
* Ensure index pages are generated on paginated results

* Changeset
2022-08-23 08:47:20 -04:00
Fred K. Bot
457e559cd5
[ci] release (#4363)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-08-22 15:46:46 -04:00
Tony Sullivan
c4af8723bd
[@astrojs/image] adds a logger to the the image integration (#4342)
* WIP: adding a console logger that respect vite.logLevel

* adds an optional prefix for messages

* remove temporary debug log

* typo fix

* cleaning up log syntax

* fixing logger whitespace

* adding README docs

* test: disable integration logging in tests

* chore: add changeset
2022-08-22 19:13:19 +00:00
Fred K. Schott
7310e8a178
add an alpine integration and update example (#4406) 2022-08-22 14:25:57 -04:00
Bjorn Lu
39088e11db
Bump Vite to 3.0.9 (#4415) 2022-08-22 10:58:50 -04:00
Matthew Phillips
5e82f6c245
Fix race condition with directive definitions (#4375) 2022-08-22 10:39:16 -04:00
Fred K. Bot
1de82f0f78
[ci] release (#4333)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-08-16 10:14:44 -04:00
Patrick Smith
45fdbc4650
Don’t use Buffer.byteLength() as Deno can’t use it (#4324)
* Don’t use Buffer.byteLength() as Deno can’t use it

* Add changeset

* Add tests for Markdown & MDX with Deno

Co-authored-by: Matthew Phillips <matthew@skypack.dev>
2022-08-16 10:08:40 -04:00
Matthew Phillips
b55f76c1ca
Fix double injecting of head content in md pages (#4334)
* Fix double injecting of head content

* Refactor

* Changeset

* Break into a separate util fn

* fix oops

* remove unused code
2022-08-15 13:10:28 -04:00
Ben Holmes
f1a52c18af
[MDX] Switch from Shiki Twoslash -> Astro Markdown highlighter (#4292)
* freat: twoslash -> Astro shiki parser

* test: update shiki style check

* feat: always apply rehypeRaw

* deps: move remark-shiki-twoslash to dev

* test: add shiki-twoslash test

* docs: update readme with twoslash example

* chore: changeset

* nit: remove "describe('disabled')"
2022-08-15 10:43:12 -04:00
Fred K. Schott
0e2f4d74b7
image fix (#4322) 2022-08-15 00:26:33 -04:00
Fred K. Bot
16edf0c773
[ci] release (#4296)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-08-13 10:09:17 -07:00
Fred K. Schott
d2063b4cf9 update examples/blog package.json 2022-08-13 01:01:49 -07:00
Fred K. Schott
d54588c7a4
Update: blog template (#4283)
* add new blog template

* update placeholder images

* use svg favicon

* Update examples/blog/src/pages/blog/using-mdx.mdx

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

* fred pass

* more fred pass

Co-authored-by: Nate Moore <nate@astro.build>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2022-08-13 00:09:40 -07:00
Fred K. Bot
b1bd52e9ea
[ci] release (#4290)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-08-12 17:40:47 -05:00
Nate Moore
24d2f7a6e6
Fix namespaced component usage in MDX (#4272)
* fix(#4209): handle namespaced JSX and MDX

* chore: add changeset

* chore: update lockfile

* fix: throw error when componentExport is unresolved

* chore: bump compiler

* chore: bump compiler

* chore: revert example changes

Co-authored-by: Nate Moore <nate@astro.build>
2022-08-12 17:01:05 -05:00
Fred K. Bot
bb3d7d4f39
[ci] release (#4249)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-08-11 16:50:59 -07:00
Fred K. Bot
692e361ef1
[ci] update lockfile (#4262)
Co-authored-by: FredKSchott <FredKSchott@users.noreply.github.com>
2022-08-11 12:37:55 -05:00
Fred K. Bot
1ee08baf91
[ci] release (#4228)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-08-10 16:54:12 -04:00
Matthew Phillips
561a34d912
Include astro components for HMR invalidation (#4240)
* Include astro components for HMR invalidation

* Changeset

* remove extra vite server passing
2022-08-10 15:26:58 -04:00
Matthew Phillips
0af5aa7a3b
Fix solid recursion bug (#4215)
* Fix solid recursion bug

* Fix types

* Remove debug code

* Remove logging from e2e test
2022-08-10 15:10:31 -04:00
Bjorn Lu
f8e3853394
Fix preact compat support for libraries (#4213)
Co-authored-by: Matthew Phillips <matthew@skypack.dev>
2022-08-10 22:22:10 +08:00
Fred K. Bot
9703f6f8f3
[ci] update lockfile (#4233)
Co-authored-by: FredKSchott <FredKSchott@users.noreply.github.com>
2022-08-10 09:26:20 -04:00
Fred K. Bot
74528a1973
[ci] release (#4224)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-08-09 17:31:06 -07:00
Fred K. Schott
3a7f2385ea Revert "[ci] release (#4223)"
This reverts commit d4ad409875.
2022-08-09 17:28:02 -07:00
Fred K. Bot
d4ad409875
[ci] release (#4223)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-08-09 19:25:15 -04:00
Nate Moore
9f067dca27
Astro 1.0.0 (#4214)
* chore: remove changesets patch

* chore: add changesets

* chore: version packages

* chore: normalize formatting

* chore: update lockfile

* chore: fix codeblocks

* Update packages/astro/CHANGELOG.md

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

* Update packages/astro/CHANGELOG.md

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

* Update packages/astro/CHANGELOG.md

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

* chore: fixup code samples

* chore: move v0.25 message out of note

Co-authored-by: Nate Moore <nate@astro.build>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2022-08-09 11:10:25 -05:00
Fred K. Bot
4d29163d11
[ci] release (#4197)
* [ci] release

* Update CHANGELOG.md

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2022-08-08 18:10:55 -05:00
Ben Holmes
4c2ca5352d
[MDX] Remove frontmatterOptions (#4204)
* feat: remove frontmatterOptions config

* test: remove custom frontmatter suite

* deps: remove remark-mdx-frontmatter

* docs: remove `frontmatterOptions` config

* chore: changeset
2022-08-08 17:33:35 -05:00
Nate Moore
f207c417e0
Add Astro.generator (#4012)
* feat: add generator property and component

* chore: remove `Generator` component

* chore: update generator description

* chore: include generator in examples

* chore: update lockfile

* chore: format

* fix: do not reference core from server runtime

* chore: remove component test

Co-authored-by: Nate Moore <nate@astro.build>
2022-08-08 12:34:05 -05:00
Fred K. Bot
2c71a99202
[ci] update lockfile (#4184)
Co-authored-by: FredKSchott <FredKSchott@users.noreply.github.com>
2022-08-08 09:40:28 -05:00
Bjorn Lu
28ab273a3d
Fix client build sourcemap generation (#4195) 2022-08-08 21:55:18 +08:00
Fred K. Bot
4e4061f485
[ci] release (#4159)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-08-05 21:48:35 -07:00
Erika
24c8e7d853
Add prettier-plugin-astro to the monorepo (#4083)
* Add `prettier-plugin-astro` to the monorepo

* Fix issue that prevent formatting Picture component

* Revert "Fix issue that prevent formatting Picture component"

This reverts commit 5536c5122ca01c64e2be6bdbc88aaaa71a690a58.

* Add back CLI parameter

* Update to latest prettier plugin

* Add more ignored files, unfortunately
2022-08-05 21:36:31 -07:00
Ben Holmes
2675b8633c
Frontmatter injection for MD and MDX (#4176)
* feat: inject vfile data as exports

* feat: add vfile to renderMarkdown output

* feat: add safe astroExports parser to utils

* refactor: expose vite-plugin-utils on astro package

* feat: handle astroExports in mdx

* deps: vfile

* chore: lockfile

* test: astroExports in mdx

* refactor: merge plugin exports into forntmatter

* refactor: astroExports -> astro.frontmatter

* refactor: md astroExports -> astro.frontmatter

* feat: astro.frontmatter vite-plugin-markdown

* chore: remove unused import

* fix: inline safelyGetAstroData in MDX integration

* chore: check that frontmatter export is valid export name

* chore: error log naming

* test: mdx remark frontmatter injection

* fix: inconsistent shiki mod resolution

* fix: add new frontmatter and heading props

* test: remark vdata

* fix: spread astro.data.frontmatter

* test deps: mdast-util-to-string, reading-time

* fix: astro-md test package name

* test: md frontmatter injection

* fix: layouts

* deps: remove vite-plugin-utils export

* fix: package lock

* chore: remove dup import

* chore: changeset

* chore: add comment on safelyGetAstroData source

* deps: move mdast-util-to-string + reading-time to test fixture

* chore: move remark plugins to test fixture

* fix: override plugin frontmatter with user frontmatter

* test: md injected frontmatter overrides

* test: frontmatter injection overrides mdx
2022-08-05 18:55:38 -05:00
Matthew Phillips
69db0298d0
Update compiler version (#4175)
* Update compiler version

* Adds a changesetp

* Update lockfile

* Skip old non-html5 doctype test

* update compiler to 0.23.1
2022-08-05 17:41:35 -04:00
Matthew Phillips
8eb3a8c6d9
Add test for mdx + React usage (#4174)
* Add test for mdx + React usage

* Add a changeset

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2022-08-05 17:13:30 -04: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
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
Fred K. Bot
23ec87532b
[ci] update lockfile (#4148)
Co-authored-by: FredKSchott <FredKSchott@users.noreply.github.com>
2022-08-05 14:14:25 -05: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
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
Fred K. Bot
37534004f0
[ci] release (#3939)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-18 21:54:25 -07:00
Matthew Phillips
5fde2fd8bc
Moves Debug component's styles to be inlined (#3963) 2022-07-18 16:42:57 -04:00
Erika
b37695c34c
Improve astro check (#3906)
* Improve astro check

* Fix lockfile

* Update to latest language-server version

* Add simple tests

* Fix lock file, again

* Fix `astro check` not working on Windows, speeds up tests

* Add changeest
2022-07-18 15:34:35 -04:00
Fred K. Bot
f7fa39e682
[ci] release (#3925)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-14 15:36:23 -04:00
Matthew Phillips
d6dfef0caa
Add @babel/core dependencies to react/preact integrations (#3928)
* Add @babel/core dependencies

* Adds a changeset
2022-07-14 14:39:58 -04:00
Fred K. Bot
78e765dc65
[ci] release (#3921)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-14 11:36:33 -05:00
Nate Moore
6a7a17f735
chore: update compiler (#3918)
Co-authored-by: Nate Moore <nate@astro.build>
2022-07-14 11:09:44 -05:00
Fred K. Bot
056d4d5fd2
[ci] release (#3903)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-13 17:16:24 -04:00
Fred K. Bot
ba67a924ca
[ci] release (#3900)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-12 12:18:13 -04:00
Fred K. Bot
4bf4736768
[ci] release (#3899)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-12 11:16:15 -04:00
Fred K. Bot
c2b14d5253
[ci] release (#3894)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-12 09:08:15 -04:00
Yuji Sugiura
c4f6fdf372
Remove unused(and also vulnerable) libs from @astro/telemetry (#3898)
* Remove unused(and also vulnerable) libs from @astro/telemetry

* Add changeset
2022-07-12 09:07:21 -04:00
Nate Moore
93e1020b1e
Fix: reintroduce smoke tests across example projects (#3669)
* chore: update smoke tests

* chore: bump smoke tests to node@16

* chore: remove gitmodules

* chore(ci): prefer node@14

* wip: remove path from smoke clone step

* feat: run build:examples from test:smoke

* fix: remove no-frozen-lockfile

* fix: checkout monorepo last for pnpm setup

* wip: replace @astrojs/markdown/remark import from md

* fix: remove type defs from generated file

* fix: function order

* chore: remove ssr-utils export

* wip: remove windows from smoke test

* fix: instantiate slugger in snippet

* fix: exclude with-mdx from smoke (for now)

* fix: add quotes on filter flag for safety

* chore: changeset

* wip: try reintroducing windows smoke

* sad chore: remove client: directive from with-mdx

* Revert "wip: try reintroducing windows smoke"

This reverts commit 9529b1a45c.

Co-authored-by: Nate Moore <nate@astro.build>
Co-authored-by: bholmesdev <hey@bholmes.dev>
2022-07-11 22:51:17 -04:00
Matthew Phillips
5f4ecbad1b
Allow defining Astro components in Vite plugins (#3889)
* Allow defining Astro components in Vite plugins

* Adds a changeset

* Move non-main compilation into load

* Use the cachedCompilation in the markdown plugin

* Fix HMR test

* Simplify getNormalizedID

* Use a windows-friendly virtual module id for the test
2022-07-11 16:13:21 -04:00
Ben Holmes
faf3f3a8d1
Update with-nanostores example to match docs walkthrough (#3840)
* feat: replace with-nanostores with new example

* docs: update README with docs call-out

* chore: small formatting inconsistencies

* nit: standardize to spaces :'(

* nit: standardize to tabs!

* refactor: use html "hidden" property

* nit: beta.66 for sanity
2022-07-11 15:42:10 -04:00
Fred K. Bot
1554a37622
[ci] release (#3887)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-11 13:38:42 -05:00
Nate Moore
7c49096e86
Update compiler (#3892)
* chore: update @astrojs/compiler

* chore: add changeset

* chore: update test

Co-authored-by: Nate Moore <nate@astro.build>
2022-07-11 13:34:29 -05:00
Fred K. Bot
1785e568a0
[ci] release (#3850)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-08 20:54:39 -04:00
Erika
f9ed77bb0d
Add editor integrations to language integrations (#3864) 2022-07-08 17:47:01 -04:00
Tony Sullivan
89d76753a0
Adds a new <Picture> component to the image integration (#3866)
* moving all normalization logic out of the Image component

* refactor: only require loaders to provide the image src

* Adding a `<Picture />` component

* fixing types.ts imports

* refactor: moving getImage to it's own file

* updating component types to use astroHTML.JSX

* Revert "updating component types to use astroHTML.JSX"

This reverts commit 6e5f578da8.

* going back to letting loaders add extra HTML attributes

* Always use lazy loading and async decoding

* Cleaning up the Picture component

* Adding test coverage for <Picture>

* updating the README

* using JSX types for the Image and Picture elements

* chore: adding changeset

* Update packages/integrations/image/src/get-image.ts

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

* allow users to override loading and async on the <img>

* renaming config to constants, exporting getPicture()

* found the right syntax to import astro-jsx

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2022-07-08 21:37:55 +00:00
Nate Moore
70b0246d4c
fix(#3843): move @babel/types to dependencies (#3863)
* fix(#3843): move @babel/types to dependencies

* chore: update lockfile

Co-authored-by: Nate Moore <nate@astro.build>
2022-07-08 14:49:06 -05:00
Nate Moore
bd11c01fa8
chore: bump Vite minimum version (#3861)
Co-authored-by: Nate Moore <nate@astro.build>
2022-07-08 11:11:02 -05:00
Matthew Phillips
c2c4e5c238
Better response.arrayBuffer() handling in Node (#3860)
* Better response.arrayBuffer() handling in Node

* Adds a changeset
2022-07-08 11:38:06 -04:00
Fred K. Bot
ed8161f3d9
[ci] update lockfile (#3858)
Co-authored-by: FredKSchott <FredKSchott@users.noreply.github.com>
2022-07-08 10:06:52 -05:00
Fred K. Schott
2b7b626629
update lockfile (#3828) 2022-07-07 12:06:56 -07:00
Nate Moore
5afb807688
Fix slot attribute inside expressions (#3837)
* fix: use slots inside expressions

* test: add test for conditional named slots

* test: fix incorrect test fixture

* chore: update `@astrojs/compiler`

* chore: add test coverage for `switch`

Co-authored-by: Nate Moore <nate@astro.build>
2022-07-07 13:23:51 -05:00
Fred K. Schott
eedb32c797
detect package manager and improve types (#3847) 2022-07-07 11:12:31 -07:00
Nate Moore
0e01e0bb58
Upgrade to pnpm@7.4.1, remove patch-package (#3747)
* chore: upgrade to pnpm@7.4.0, remove `patch-package`

* chore: update contributing

* chore: pnpm@7.4.1

* chore: bump to pnpm@7.5.0

Co-authored-by: Nate Moore <nate@astro.build>
2022-07-07 12:52:53 -05:00
Fred K. Bot
568960f175
[ci] release (#3818)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-06 21:00:18 -04:00
Fred K. Bot
08d068496d
[ci] release (#3800)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-01 15:56:49 -05:00
Fred K. Bot
94143fcdba
[ci] release (#3789)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-01 17:43:26 +00:00
Fred K. Bot
deab65d7b3
[ci] update lockfile (#3786)
Co-authored-by: FredKSchott <FredKSchott@users.noreply.github.com>
2022-07-01 08:50:18 -07:00
Tony Sullivan
e8593e7ead
Adds an @astrojs/image integration for optimizing images (#3694)
* initial commit

* WIP: starting to define interfaces for images and transformers

* WIP: basic sharp service to test out the API setup

* adding a few tests for sharp.toImageSrc

* Adding tests for sharp.parseImageSrc

* hooking up basic SSR support

* updating image services to return width/height

* simplifying config setup for v1

* hooking up basic SSR + SSG support (dev & build)

* refactor: a bit of code cleanup and commenting

* WIP: migrating local files to ESM + vite plugin

* WIP: starting to hook up user-provided loaderEntryPoints

* chore: update lock file

* chore: update merged lockfile

* refactor: code cleanup and type docs

* pulling over the README template for first-party integrations

* moving metadata out to the loader

* updating the test for the refactored import

* revert: remove unrelated webapi formatting

* revert: remove unrelated change

* fixing up the existing sharp tests

* fix: vite plugin wasn't dynamically loading the image service properly

* refactor: minor API renaming, removing last hard-coded use of sharp loader

* don't manipulate src for hosted image services

* Adding support for automatically calculating dimensions by aspect ratio, if needed

* a few bug fixes + renaming the aspect ratio search param to "ar"

* Adding ETag support, removing need for loaders to parse file metadata

* using the battle tested `etag` package

* Adding support for dynamically calculating partial sizes

* refactor: moving to the packages/integrations dir, Astro Labs TBD later

* refactor: renaming parse/serialize functions

* Adding tests for SSG image optimizations

* refactor: clean up outdated names related to ImageProps

* nit: reusing cached SSG filename

* chore: update pnpm lock file

* handling file URLs when resolving local image imports

* updating image file resolution to use file URLs

* increasing test timeout for image build tests

* fixing eslint error in sharp test

* adding slash for windows compat in src URLs

* chore: update lockfile after merge

* Adding README content

* adding a readme call to action for configuration options

* review: A few of the quick updates from the PR review

* hack: adds a one-off check to allow query params for the _image route

* Adds support for src={import("...")}, and named component exports

* adding SSR tests

* nit: adding a bit more comments

* limiting the query params in SSG dev to the images integration
2022-07-01 15:47:48 +00:00
Fred K. Bot
0f73ece26b
[ci] release (#3783)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-01 03:09:17 +00:00
Tony Sullivan
976e1f175a
Adding an option to disable HTTP streaming (#3777)
* Adding a flag to disable HTTP streaming

* refactor: adding support for SSG builds

* handling string responses in the server runtime, adding tests

* removing streaming CLI flag

* removing import.meta.env.STREAMING

* include Content-Length header when streaming is disabled

* Verifying content-length header in dev

* fix: default streaming to enabled in the base App server

* TEMP: disabling the production test to investigate the test-adapter

* re-enabling the test with an adapter option to disable streaming for the test

* fix: use the existing TextEncoder to get the body's byte length

* moving config to build.streaming, ignoring it in `dev`

* fixing dev test to expect response streaming

* chore: add changsets

* removing the new config option all together 🎉

* remove temp debug log

* Updating astro changeset now that streaming isn't a config option
2022-07-01 02:29:59 +00:00
Fred K. Bot
d07ad8a782
[ci] release (#3774)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-30 11:39:44 -07:00
Nate Moore
032ad1c047
MDX support (#3706)
* feat: first pass at MDX support

* fix: move built-in JSX renderer to come first

* chore: remove jsx example

* chore: update lockfile

* chore: cleanup example

* fix: missing deps

* refactor: move component render logic to `renderPage`

* chore: update HMR script

* chore: update MDX example

* refactor: prefer unshit

* refactor: remove TODO comment

* fix: remove duplicate identifier

* refactor: cleanup mdx entrypoint

* fix: better html handling

* fix: add tsconfig to mdx package

* chore: update lockfile

* fix: do not sort plugins unless mdx is enabled

* chore: update compiler

* fix(hmr): maybe render head for non-Astro pages

* fix: set initial pageExtensions

* refactor: cleanup addPageExtension

* refactor: remove addPageExtensions from types

* refactor: expose HookParameters type

* fix: only default to astro for MDX

* test: pick up jsx support in test fixtures

* refactor: simplify mdx entrypoint

* test: add basic MDX tests

* test(e2e): add mdx + framework tests

* chore: update lockfile

* test(e2e): fix preact mdx e2e test

* fix(mdx): disable .md support

* test(e2e): fix vue-component test missing mdx

* test(e2e): fix solid component needing import

* fix: allow `client:only="solid"` as an alias to `solid-js`

* chore: move to with-mdx example

* chore: update MDX readme

* chore: update example readme

* chore: bump astro version

* chore: update lockfile

* Update mod.d.ts

* feat: support `export const components` in MDX pages

* chore: update mdx example

* fix: update jsx-runtime with better slot support

* refactor: remove object style support

* chore: cleanup package exports

* chore: add todo comment

* refactor: improve isPage function, move to utils

* refactor: dry up manual HMR updates

* chore: add dev tests for MDX

* chore: prefer set to array

* chore: add changesets

* fix(hmr): flip public/private route

Co-authored-by: Nate Moore <nate@astro.build>
2022-06-30 13:09:09 -05:00
Fred K. Bot
d137169b7b
[ci] update lockfile (#3771)
Co-authored-by: FredKSchott <FredKSchott@users.noreply.github.com>
2022-06-30 11:22:18 -05:00
Fred K. Bot
8cbe92b74b
[ci] release (#3772)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-30 08:08:09 -05:00
Fred K. Bot
38f2fd7723
[ci] release (#3759)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-29 17:11:48 -05:00
Fred K. Schott
4bc6c7ceaa
manual lockfile update (#3751)
* lockfile update

* update lockfile gen script

* Update index.ts
2022-06-29 14:54:40 -07:00
Chris Swithinbank
e3fdc9b403
Add preact/compat support to @astrojs/preact (#3712)
* Add preact/compat renderer (likely broken)

Based on the current Preact renderer and the old preact/compat implementation: f892aeb52f/packages/renderers/renderer-preact/compat/index.js

* Make sure name is consistent

* Switch to single integration with compat option

* fix: add module-resolver to alias react => preact/compat

* fix: preact/compat mode

* chore: remove client-compat entrypoint

* chore: add e2e test for preact/compat

* Try to fix frozen lock file error

* Add changeset

* Update README to new structure & document `compat`

* Fix changeset wording

* Fix README typo

* Tweak wording

Co-authored-by: Kevin Zuniga Cuellar <46791833+kevinzunigacuellar@users.noreply.github.com>

Co-authored-by: Nate Moore <nate@astro.build>
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
Co-authored-by: Kevin Zuniga Cuellar <46791833+kevinzunigacuellar@users.noreply.github.com>
2022-06-29 17:42:47 +02:00
Fred K. Bot
a59a27eb0c
[ci] release (#3733)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-28 15:11:59 +00:00
Fred K. Bot
768c8ed21d
[ci] update lockfile (#3740)
Co-authored-by: FredKSchott <FredKSchott@users.noreply.github.com>
2022-06-28 08:33:13 -05:00
Tony Sullivan
79fe09fa30
Adds a prefetch integration for near-instant page navigations (#3725)
* Adds a basic @astrojs/prefetch integration

* adding tests for custom selectors

* missed in last commit

* Adding a few docs, removing the option for `selectors` to be an element array

* adding an option for the concurrency limit

* fixing test for updated integration options

* Update packages/labs/prefetch/src/client.ts

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

* nit: removing the NodeJS.Timer type to allow typescript to infer the return

* updating docs for default selector with ~=

* Skip prefetching on 2G connections, or when data saver is enabled

* refactor: moving to packages/integrations, Astro Labs TBD down the road

* README typo fix

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2022-06-27 18:26:21 +00:00
Fred K. Schott
9d78162fd9
Prettier update with caching speedup (#3710)
* update lockfile on fresh install

* update prettier
2022-06-27 11:24:22 -07:00
github-actions[bot]
0ae1365533
[ci] release (#3726)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-27 10:40:35 -04:00
Fred K. Schott
c3d41d1f60
update lockfile on fresh install (#3709) 2022-06-25 10:24:59 -07:00
github-actions[bot]
701a3bd698
[ci] release (#3707)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-24 17:02:11 -04:00
Matthew Phillips
b5e3403fa1
Simplified Response#text() implementation (#3705)
* Simplified Response#text() implementation

* Adds a changeset

* Fix tsignore
2022-06-24 16:58:14 -04:00
Matthew Phillips
b11e3b38eb
Ensure import.meta.env.SSR is true in SSR mode (#3702)
* Ensure import.meta.env.SSR is true in SSR mode

* Define in the env plugin instead
2022-06-24 16:14:00 -04:00
Nate Moore
908c2638cb
Add *private* built-in JSX renderer (#3697)
* feat: add private `addPageExtensions` hook

* feat: experimental JSX support

* chore: remove experimental.jsx option from config

* chore: remove automatic astro JSX runtime detection

* fix: throw warning when client:* directive is used but no client entrypoint is found

* feat: add slot support to renderer

* chore: remove client entrypoint from jsx renderer

* test: add barebones JSX test

* test: add frameworks-in-jsx test

* feat: improve error message when no matching import is found

* feat: support slots

* fix: do not strip `astro-slot` when using JSX renderer

* fix: handle null values in isVNode

* fix: do not transform slots for elements

Co-authored-by: Nate Moore <nate@astro.build>
2022-06-24 15:11:17 -05:00
github-actions[bot]
67b5aa4ca4
[ci] release (#3701)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-24 16:05:02 -04:00
Matthew Phillips
47c81effa6
Make Astro.redirect use a 302 status code (#3700)
* Make Astro.redirect use a 302 status code

* Adds a changeset

* Add a package.json
2022-06-24 15:55:06 -04:00
Matthew Phillips
3daaf510ea
Streaming (#3696)
* Start of streaming

* New lockfile

* Base should be Uint8Arrays

* Remove the ability to throw from a component

* Add a warning when returning a Response from a non-page component

* Adds a changeset
2022-06-24 15:35:21 -04:00
github-actions[bot]
6a6047483b
[ci] release (#3692)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-24 12:55:36 -05:00
Matthew Phillips
fa7ed3f3a9
Remove post-rendering head injection (#3679)
* Remove post-rendering head injection

* Adds a changeset

* Use a layout component for vue
2022-06-23 15:37:55 -04:00
d-suke
446f8c4f13
Added test for dir parameter in astro:build:done. (#3649)
* Added test for dir in astro:build:done

* Added changeset

* Change pathname for Windows

* Change changeset generated file summary

* Eliminate testing of branches by os

* Eliminate OS dependence

* Change changeset generated file summary

* Using fileURLToPath

* Cross-platform fixes.

* Use posix for everything.

* Pass an empty string for relative from

* Use path.join for the correct value

* Update packages/astro/test/static-build-dir.test.js

* Update packages/astro/test/static-build-dir.test.js

* Update packages/astro/test/static-build-dir.test.js

* Remove trailing slash

* add toString

* fix syntax error

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2022-06-23 14:04:10 -05:00
Nate Moore
7373d61cdc
Enable named slots in renderers (#3652)
* feat: pass all slots to renderers

* refactor: pass `slots` as top-level props

* test: add named slot test for frameworks

* fix: nested hydration, slots that are not initially rendered

* test: add nested-recursive e2e test

* fix: render unmatched custom element children

* chore: update lockfile

* fix: unrendered slots for client:only

* fix(lit): ensure lit integration uses new slots API

* chore: add changeset

* chore: add changesets

* fix: lit slots

* feat: convert dash-case or snake_case slots to camelCase for JSX

* feat: remove tmpl special logic

* test: add slot components-in-markdown test

* refactor: prefer Object.entries.map() to for/of loop

Co-authored-by: Nate Moore <nate@astro.build>
2022-06-23 10:10:54 -05:00
github-actions[bot]
19cd962d0b
[ci] release (#3684)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-23 09:14:17 -04:00
Matthew Phillips
b36ecb717e
Include partytown scripts in SSR manifest (#3686)
* Include partytown scripts in SSR manifst

* Adds a changeset
2022-06-23 09:03:43 -04:00
Ben Holmes
3d554fdbfb
Fix: pass Astro config postcss to Svelte preprocess (#3685)
* fix: pass Astro config postcss to Svelte preprocess

* test: preset env for nested styles

* chore: changeset
2022-06-22 19:52:32 -04:00
Matthew Phillips
9a813268db
Allow TypeScript in hoisted scripts (#3665)
* Allow TypeScript in hoisted scripts

* Pass skipSelf

* Fix linting
2022-06-22 12:47:52 -04:00
Matthew Phillips
85c33751c2
Allow specifying entryFileNames for client JS (#3676)
* Allow specifying entryFileNames for client JS

* Adds a changeset
2022-06-22 12:32:17 -04:00
github-actions[bot]
8ad146a5d7
[ci] release (#3683)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-22 12:19:43 -04:00
Tony Sullivan
b8c6dabfb7
Enables eslint on the full repo and adds a rule for no only() tests (#3659)
* enabling eslint on the all packages and tests

* enabling for all packages

* TEMP: adding an only() test to verify it fails CI

* using our eslint config and ignore in CI

* removing the temporary .only() test

* update lock file

* lint: fixing new test with a no-shadow warning

* chore: update lock file
2022-06-22 15:59:49 +00:00
Matthew Phillips
898845402c
Include all client build artifacts in SSRManifest (#3678)
* Include all client build artifacts in SSRManifest

* Adds a changeset
2022-06-22 11:35:54 -04:00
github-actions[bot]
119283775a
[ci] release (#3666)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-22 10:05:21 -04:00
hippotastic
ba5ad7855c
Fix react dependencies to improve test reliability (#3673)
* Fix local react tests by unifying versions

* Add missing dependencies to react tests

* Add changeset

* Fix lockfile

Co-authored-by: Matthew Phillips <matthew@skypack.dev>
2022-06-22 09:11:48 -04:00
Matthew Phillips
46d1ea941b
Revert "add Astro Deno Example (#3645)" (#3674)
This reverts commit e88b23ea52.
2022-06-22 08:30:22 -04:00
Elian ☕️
e88b23ea52
add Astro Deno Example (#3645)
* add Astro Deno Example

* add changeset

* update pnpm lock

Co-authored-by: Dan Jutan <danjutan@gmail.com>
2022-06-21 13:07:07 -04:00
github-actions[bot]
b4db008e53
[ci] release (#3664)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-21 12:47:04 -04:00
Matthew Phillips
c20b93c484
Resolve .jsx -> .tsx in hydrated components (#3663) 2022-06-21 12:35:11 -04:00
github-actions[bot]
e13ce4d751
[ci] release (#3662)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-21 11:50:06 -04:00
Jeff Mendez
195f88bf0b
chore(example): fix @types install type (#3656) 2022-06-21 10:27:22 -05:00
github-actions[bot]
e67171252c
[ci] release (#3615)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Matthew Phillips <matthew@skypack.dev>
2022-06-21 09:43:19 -04:00
Matthew Phillips
f5afaf2498
Support re-exporting astro components containing client components (#3625)
* Support re-exporting astro components containing client components

* Include metadata for markdown too

* Fix ssr, probably

* Inject post-build

* Remove tagName custom element test

* Allows using the constructor for lit elements

* Fix hoisted script scanning

* Pass through plugin context

* Get edge functions working in the edge tests

* Fix types for the edge function integration

* Upgrade the compiler

* Upgrade compiler version

* Better release notes for lit

* Update .changeset/unlucky-hairs-camp.md

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

* Properly test that the draft was not rendered

* Prevent from rendering draft posts

* Add a changeset about the build perf improvement.

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2022-06-21 08:32:05 -04:00
Nate Moore
8e3e4894c9
Add private addPageExtension hook (#3628)
* feat: add private `addPageExtensions` hook

* chore: remove renderer binding

Co-authored-by: Nate Moore <nate@astro.build>
2022-06-20 14:05:16 -05:00
Oleksii Tymoshenko
1031c06f9c
feat: improved sitemap (#3579)
* feat: extended sitemap functionality

* docs: del samples

* docs: readme

* feat: new sitemap

* feat: createLinkInHead removed

* docs: updated changeset text

* refactor: 'zod' function() instead of self made refine()

* Revert "refactor: 'zod' function() instead of self made refine()"

This reverts commit 036bac730d.

undo function()
2022-06-16 19:06:48 +00:00
github-actions[bot]
81104a9335
[ci] release (#3604)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-16 12:05:10 -04:00
Richard Cooke
7f42358141
feat: add SSR adaptor for cloudflare pages functions (#3600) 2022-06-16 10:12:25 -04:00
Matthew Phillips
fc52321a88
Consolidate hydration scripts into just one (#3571)
* Remove redundant hydration scripts

* Prebuild the island JS

* Fix build

* Updates to tests

* Update more references

* Custom element test now has two classic scripts

* Account for non-default exports

* Restructure hydration directives

* Move nested logic into the island component

* Remove try/catch
2022-06-15 08:50:05 -04:00
github-actions[bot]
31e3224319
[ci] release (#3596)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-14 15:46:51 -05:00
Nate Moore
5ab9d573f6
Collect project meta info (#3587)
* chore: add project meta

* Update index.ts
2022-06-14 15:30:39 -05:00
Matthew Phillips
330fef448e
Handle importing multiple CSS packages in same bundle (#3595)
* Handle importing multiple CSS packages in same bundle

* Changeset
2022-06-14 16:27:21 -04:00
github-actions[bot]
acc8afbdda
[ci] release (#3594)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-14 15:51:10 -04:00
github-actions[bot]
c54b024803
[ci] release (#3569)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-10 21:07:03 -05:00
Oleksii Tymoshenko
098031294f
unused dependency 'sitemap', 'filter' option should return boolean (#3563)
* refactor: @astrojs/sitemap does't use 'sitemap' pkg

* refactor: 'filter' option should return boolean instead of string

* fix: forgotten `pnpm install`

* chore: add changeset

Co-authored-by: Nate Moore <nate@skypack.dev>
2022-06-10 13:16:08 -05:00
Matthew Phillips
614769a39b
Preoptimize renderers and hydration directives (#3568)
* Preoptimize renderers and hydration directives

* Adds a changeset

* Upgrade to Vite 2.9.12
2022-06-10 12:38:19 -04:00
github-actions[bot]
d02578fd4c
[ci] release (#3549)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-10 15:03:52 +00:00
hippotastic
c549f161ca
Allow AlpineJS syntax extensions in Markdown (#3554)
* Allow AlpineJS syntax extensions in Markdown

* Remove unwanted MDX ESM import/export support
2022-06-08 12:41:36 -05:00
github-actions[bot]
ec89def67d
[ci] release (#3534)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-07 12:45:50 -04:00
Matthew Phillips
f3ab822e32
Allow dynamic imports when using Netlify Edge Functions (#3535)
* Allow dynamic imports when using Netlify Edge Functions

* Update deno test script and changeset
2022-06-07 11:41:32 -04:00
Matthew Phillips
51c60de76c
Fix importing CSS packages in frontmatter (#3537)
* Fix importing CSS packages in frontmatter

* Formatting

* Only update if the source code contains the import

* Consolidate the two plugins

* we do need a pre and a post

* Adds a changeset
2022-06-06 18:26:15 -04:00
Nate Moore
a87ce4412c
Improve HMR handling for styles, persisted islands (#3492)
* feat: improve HMR handling for styles, persisted islands

* Also using data-persist to keep injected <style>'s during HMR

* Updating E2E tests to validate that .astro HMR doesn't blow away component styles

* chore: add changeset

* copy/paste error when cleaning up tests

* big change - using inline <style> blocks instead of <link>s in dev

* Updating tests that were expecting <link> stylesheets in dev

* updating all E2E tests to use workspace versions for astro deps

* TEMP: adding debug logging to see why the Ubuntu test only fails in CI

* fix: Svelte styles are automatically handled by Vite, we can skip them in dev

* fix: svelte is more interesting, we need Astro to inject styles only until hydration

* avoiding extra HMTL noise by only including the data-astro-injected URL for svelte components

* TEMP: ubuntu CI doesn't like the svelte HMR test...

* disabling the svelte component test on ubuntu for now

Co-authored-by: Tony Sullivan <tony.f.sullivan@outlook.com>
2022-06-06 18:39:48 +00:00
Fred K. Schott
5b06398b7b
format: automatically organize imports and removed unused (#3499)
* add import formatting

* chore: update lockfile

Co-authored-by: Nate Moore <nate@skypack.dev>
2022-06-06 09:47:28 -07:00
Matthew Phillips
c22a07db13
Fix use of dynamic imports / Astro.glob with Deno Deploy (#3532)
* Fix use of dynamic imports / Astro.glob with Deno Deploy

* Adds a changeset

* Mark the markdown package as external
2022-06-06 12:02:13 -04:00
github-actions[bot]
9029c43549
[ci] release (#3512)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-06 09:40:09 -04:00
Fred K. Schott
25fa0f527d
[ci] update lockfile (#3515)
Co-authored-by: FredKSchott <FredKSchott@users.noreply.github.com>
2022-06-03 13:00:47 -04:00
Nate Moore
2fedb97489
Patch Lit server shim to fix sass compatability (#3511)
* fix(#2623, #3508): patch lit server shim to allow sass compat

* chore: add changeset
2022-06-02 14:45:11 -05:00
github-actions[bot]
a74cf98002
[ci] release (#3509)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-02 15:31:44 -04:00
Fred K. Schott
88cd7525be
[ci] update lockfile (#3501)
Co-authored-by: FredKSchott <FredKSchott@users.noreply.github.com>
2022-06-02 15:30:46 -04:00
github-actions[bot]
67ad33debf
[ci] release (#3488)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-02 13:42:18 -04:00
Matthew Phillips
d588bc4a9c
Update rollup to prevent empty slot bug (#3496)
* Update rollup to prevent empty slot bug

* Adds a changeset

* Updated lockfile

* provide import.meta.env.SITE when there are private envs
2022-06-01 12:21:32 -04:00