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