Commit graph

18 commits

Author SHA1 Message Date
Juan Martín Seery
de123b28b3
refactor(markdown): removed rehype-slug in favor of our own implementation ()
* Moved types arround

* Removed `rehype-slug` in favor of our own implementation

* Changeset

* Removed rehype-slug from examples

* Remove rehype-slug from tests

* Updated reference

* rehypeCollectHeaders is a function again

* Reverted rehype-slug removes

* Re-added rehype-slug to reference
2022-04-29 21:07:09 -03:00
Fred K. Schott
1335797903
update prettier width () 2022-04-02 14:15:41 -06:00
Nate Moore
17c02925c5
Migrate to new config ()
* wip: config migration

* fix: formatting

* refactor: projectRoot -> root

* refactor: pageUrlFormat -> format

* refactor: buildOptions.site -> site

* refactor: public -> publicDir

* refactor: dist -> outDir

* refactor: styleOptions -> style

* fix: some dist tests -> outDir

* refactor: remove legacyBuild (with TODOs)

* refactor: more legacyBuild cleanup

* refactor: server host and port

* fix: remove experimentalStaticBuild CLI flag

* refactor: src -> srcDir

* refactor: devOptions.trailing -> trailing

* refactor: remove sitemap + related flags

* refactor: experimentalSSR -> experimental.ssr

* fix: last devOptions

* refactor: drafts -> markdown.drafts

* fix: TS error on port as const

* refactor: remove pages

* refactor: more --project-root updates

* refactor: markdownOptions -> markdown

* fix: remaining type errors

* feat: update AstroUserConfig

* refactor: update CLI flag mapper + server mapper

* fix: loadFixture projectRoot

* fix: merge CLI flags before validating / transforming

* wip: attempt to fix bad createRouteManifest config

* refactor: combine config.base and config.site

* fix: skip route manifest test for now

* fix: site and base handling

* refactor: update failing config testes

* fix: build failure

* feat: update config types with migration help

* chore: update types

* fix(deno): update deno fixture

* chore: remove config migration logic

* chore: remove logLevel

* chore: clean-up config types

* chore: update config warning

* chore: add changeset

* Sitemap Integration ()

* feat: add sitemap filter config option

* feat: add canonicalURL sitemap config option

* docs: update sitemap README

* fix: update for new config

* fix: filter not being applied

* chore: changeset

Co-authored-by: bholmesdev <hey@bholmes.dev>

* fred pass

* fix: Astro.resolve typo

* fix: public => publicDir

Co-authored-by: bholmesdev <hey@bholmes.dev>
Co-authored-by: Fred K. Schott <fkschott@gmail.com>
2022-04-02 12:29:59 -06:00
Fred K. Schott
6386c14d00
Astro Integration System ()
* update examples

* add initial integrations

* update tests

* update astro

* update ci

* get final tests working

* update injectelement todo

* update ben code review

* respond to final code review feedback
2022-03-18 15:35:45 -07:00
Nate Moore
2b76ee8d75
Export defineConfig helper ()
* feat: add astro/config entrypoint

* chore: update examples to use `defineConfig` util

* chore: prettier fix

* chore: add changeset
2022-03-15 15:27:17 -05:00
Nate Moore
d08ddaf5b9
Move from yarn to pnpm ()
* chore: `yarn` => `pnpm`

* docs: `yarn` => `pnpm`

* chore(ci): yarn => pnpm

* chore(ci): update pnpm cache path

* fix: add missing deps

* fix: add missing deps

* test: add package.json to all test fixtures

* chore: improve hoisting behavior

* chore: move turbo into package.json

* chore: update npmrc

* fix: add missing `debug` dependency

* chore: remove prepare script

* test: fix new tests

* fix: fully resolve renderer paths and `astro/internal` path

* chore: update lockfile

* chore: remove log

* fix: resolve renderers in vite-plugin-jsx

* fix: prefer public-hoist-pattern to shamefully-hoist

* chore: ignore @babel/core peer warning

* chore: update dependencies

* test: add autoprefixer as explicit dep

* chore: update `.npmrc` file in examples

* chore: update dependencies

* fix: resolve renderer dependencies in static build

* fix: static build renderer resolution

* chore: fix smoke tests

* chore: hoist autoprefixer

* chore: update lockfile

* attempt: use full file:// path on Windows

* attempt: use astro/internal

* attempt: optimize astro/internal

* attempt: expose ./internal.js

* chore: add missing package.json files

* attempt: resolve astro/internal path

* chore: tidy package.json

* chore: update lockfile

* chore: update deps

* chore: update deps

* chore: yarn -> pnpm

* attempt: explicit /@fs urls

* attempt: explicit /@fs urls

* chore: update all examples for pnpm

* chore: fix hoisting for with-vite-plugin-pwa

* chore(ci): fix sharp install

* chore: update with-vite-plugin-pwa example

* fix: pin vite-plugin-pwa to 0.11.11

* fix: add workbox-window to vite-plugin-pwa deps

* refactor: use pnpm update --recursive

Co-authored-by: JuanM04 <me@juanm04.com>

* chore: yarn => pnpm

* chore: yarn => pnpm

* fix: update smoke test to skip examples which don't work in static build

* update lockfile

* chore: update .npmrc files

* chore: update lockfile

* fix: smoke script

* chore: update .npmrc file

* fix: return to shamefully-hoist (shamefully)

* chore: update lockfile

* fix(smoke): ignore scripts for smoke tests

* fix: update example to disable renderers

* chore: bump version

* chore(ci): fix smoke tests

* attempt: disable --frozen-lockfile for smoke tests

* chore: update smoke test

* chore: fix rebase issue

* chore: update lockfile

* fix: smoke tests

* fix(ci): run external smoke tests first

* fix(ci): run syntax

* chore: update lockfile

* fix(ci): ensure submodules are up-to-date

* fix(ci): ensure submodules are up-to-date

* chore: update lockfile

* chore: update for webapi

* chore: silence node:* warnings

* chore: update deps

* fix(ci): persist generated webapi assets

* fix(ci): webapi build script

* chore(ci): remove custom node caching

* chore: keep turbo.json

* chore: update turbo, ignore create-astro

* chore: update deps

* fix(ci): test command

* chore(ci): update test script

Co-authored-by: JuanM04 <me@juanm04.com>
2022-03-08 15:46:11 -06:00
Juan Martín Seery
cfeaa9414a
fix: import local plugins into markdown ()
* Replaced "UnifiedPluginImport" for a function

* Updated tests

* Updated docs

* Updated examples

* Added changeset

* Fixed tests

* Removed unused "UnifiedPluginImport"

* Duplicated add-classes.mjs
2022-02-04 13:49:50 -05:00
Matthew Phillips
2770588867
Remove rehype-add-classes ()
* Remove rehype-add-classes

* Fix the markdown plugin test
2022-01-04 15:09:10 -05:00
Jonathan Neal
6ddd7678ff
Use accessible indentation () 2021-12-22 16:11:05 -05:00
JuanM04
679d4395ec
Markdown package improvements ()
* Re-add smartypants

* Updated packages

* Remove all the default plugins if there are either remark or rehype plugins

* Replace deperecated remark-slug with rehype-slug

* Added MarkdownParserResponse type

* Update documentation

* Removed type import from markdown package

* Updated remark-smartypants

* Changelog

* Missed one change

* Split changelogs

* Upgraded some MDX dependencies

* Fix typos in documentation

* Changed CHANGELOG.md package name

* Renamed smartypants
2021-11-22 14:48:00 -06:00
natemoo-re
a5c6f922fa [ci] yarn format 2021-10-29 19:47:01 +00:00
Nate Moore
34e03cf912
do not format vite ()
* Revert "[ci] yarn format"

This reverts commit 93489946cc.

* chore: ignore vendor
2021-10-29 14:45:32 -05:00
matthewp
93489946cc [ci] yarn format 2021-10-29 19:31:54 +00:00
Drew Powers
d84bfe719a
🚀 Astro Next (0.21.0) ()
* make astro-root uids unique

* Move Astro to Vite

* Update tests

* More test improvements

* fred fixes

* Update compiler, improve tests

* Fix runtime, improve code frame

* Add Markdown support

* Tycho fixes

* Fred fixes part 2

* Throw Error for WIP Features

* Improve testing suite

* Allow users to pass config to Vite

* Fix npm install ()

* Automate publish on merge ()

* Add NPM_TOKEN to publish script ()

* Create .npmrc

* Clean up astro deps ()

* Use new renderers ()

* feat: update compiler ()

* Try mocha/chai test runners ()

* Try mocha/chai test runners

* Disable failing smoke test for now

Will revert when next can build docs

* Enable mocha in parallel mode

* Remove warning

* Update docs

* Fix Windows bug

* Fix internal imports

* Fix styles

* Fix CI release on merge to next ()

* Fix logger locale parsing ()

* fix(logger): locale parsing
* Fixed issue of compiler crash when "c" locale was encountered
* Return default locale if parsed locale is less than 2 chars long

* chore: add changeset

* Apply changes from 

* Add back in support for children ()

* Add back in support for children

* Be more careful

* Enables most slot tests ()

* Enables most slot tests

* Use spreadAttributes

* Add hydration to Solid renderer () ()

* feat: add hydration to Solid renderer

* fix: intersection observer, move script to the end

Co-authored-by: Ryan Carniato <ryansolid@gmail.com>

* [next] support Astro.slots API ()

* [next] Support for custom elements ()

* [next] Support for custom elements

* Fix eslint errors

* eslint again

* [next] Fix Astro.fetchContent ()

* fix Astro.fetchContent

* fix(fetchContent): cast type

Co-authored-by: Nate Moore <nate@skypack.dev>

* Move hydration to the compiler ()

* Move hydration to the compiler

* Move extracting url, export to util fn

* Brings back astro-dynamic tests ()

* Implements top-level Astro + Astro.resolve ()

* Implements top-level Astro + Astro.resolve

* Fix linting

* [next] Update renderers ()

* chore: update vite

* fix(renderers): point renderers to resolved server/client entrypoints

* Chore: Enable more tests with new compiler changes ()

* [Next] `fetch` support ()

* fix: polyfill fetch in every ssr scenario

* test(fetch): update fetch tests

* docs: update data fetching guide to remove caveats about `fetch` and isomorphic usage

* refactor: update regex for clarity

* Restructure ()

* Upgrade to @astrojs/compiler 0.2.0 ()

* Use Vite fork ()

* Use Vite fork

* Fix linting

* Move Vite to vendor/ and add a license

* Fix linting

* Include the dist folder

* Update files config

* Markdown compilation ()

* Markdown compilation

* remove debugger

* Gets lit hydration working ()

* Gets Astro.fetchContent compilation to work ()

* Gets Astro.fetchContent compilation to work

This fixes Astro.fetchContent so that we handle esbuild transforming the
name of the nested Astro call.

* Remove debugging

* Update the tests

* Remove another debugger

* Update Vite to latest ()

* Add Prism syntax highlighting ()

* Scoped styles with markdown ()

* Bugfix: fix getStaticPaths() cache miss ()

* Fix build order ()

* Bugfix: restore build to get all paths earlier, when build. Same as main.

* Also re-add timings

* [next] blog example fully working ()

* Add environment variables docs (Closes ) ()

* Added environment variables docs (Closes )

* Fixed prefix

* Remove numbered comments ()

* Chore: remove numbered comments

* Clean up block comments

* comment style fixes ()

* [next] Upgrade compiler ()

* [next] Upgrade compiler

* Upgrade to latest compiler

* Fix the path to global css

* Removed debugger

* feat: add fragment support to vite-plugin-astro ()

* [next] fix `.tsx` handling ()

* fix: support tsx in JSX plugin

* fix: preserve JSX via esbuild, only use Babel for JSX compilation

* fix: handle upcoming Vite API for `ssr` flag

* [next] Add CSS preprocessing  ()

* Add concept for style support in Astro

* Update style preprocessor to use new compiler

* fix: massage preprocessStyle type

* fix: @astrojs/compiler types

Co-authored-by: Nate Moore <nate@skypack.dev>

* fix issues in blog-multiple-authors ()

* Move Sass to deps ()

* Update renderer API for Vite ()

* Update renderer API for Vite

* Fix lit-element tests

* Clean up comments

* Throw friendly error if renderer provides viteConfig in a bad format

* Fix changesets ()

* Remove cheerio scanning from build stats ()

* Minor change to jsxTransformOptions, update Renderer API docs ()

* [next] docs example fully working ()

* [next] docs example fully working

* Upgrade compiler to unlock docs

* Add `class:list` directive ()

* Add support for class:list directive

The `class:list` directive serializes an expression of css class names. For React components, `className:list` is also supported.

* Remove `className` support and React tests

* Add tests for the absence of omitted classes

* fix: `define:vars` scoping for styles ()

* feat: fix Debug component ()

* [next] Fix `<Markdown>` component ()

* fix: cleanup issues with <Markdown> component

* fix: fix `content` usage with Markdown

* [next] Fix `<Code>` component ()

* fix: enable Code component

* test: update expect to chai format

* Fixes solid ()

* Fixes solid

* Rename the test

* Rebase with next

* Skip solid test for now

* Add support for markdown plugins ()

* Fix broken next release ()

* Prevent passing  to Svelte components

* Prevent passing class to Vue components

* Add CSS injection, fix portfolio example ()

* Fix portfolio example

* Add .pcss extension

* Update load ssr opts

* Update packages/astro/src/runtime/server/index.ts

Co-authored-by: Jonathan Neal <jonathantneal@hotmail.com>

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

* Fixes external HMR ()

* Upgrade compiler version ()

Fixes docs and blog examples

* Resolve renderers relative to the projectRoot ()

* Template fixes ()

* fix: dedupe hashes for identical islands ()

* fix: scope `define:vars` to `:root` for `<style global>` ()

* chore: update compiler to latest ()

* [next] fix island hydration inside of `<Markdown>` ()

* fix: create rehype plugin to smooth over island hydration bugs

* refactor: remove debug code

* chore: explain need for `rehypeIslands`

* Bugfix: renderer-lit missing files on npm ()

* Force Vite to rebuild dependencies ()

* [next] Add `preact/compat` renderer ()

* feat: add preact/compat entry for `@astrojs/renderer-preact`

* Update index.js

* Bugfix: plugin-astro-fetch tries to append node-fetch to node-fetch ()

* Fix Vite race condition ()

* Fix with-nanostore deps ()

Adds missing Solid renderer

* [next] Fix `resolveDependency` on Windows ()

* fix: Windows issue with resolveDependency util

* chore: add comment

* Update CONTRIBUTING.md ()

* Prevent scanning a user's deps ()

* Prevent scanning a user's deps

* Remove unused things

* remove unused util

* Adding a changeset for the remark plugin

* Config changes needed for stater template ()

This does 2 things:

1. Adds prismjs as a dep.
2. Adds shiki as an external.

* Next bugs ()

* fix(): hoisted <script> rendering

* fix(): do not print global for styles, but do for scripts

* fix: update ObjectSet implementation

* fix: dedupe elements in sets

* [next] update compiler ()

* chore: update compiler

* chore: update compiler (again)

* Fix Astro HMR bottleneck ()

* Bugfix: JSX renderers can be declared in any order ()

* chore: update compiler ()

* Exclude lit-server from being optimized ()

This should get the lit example working from `npm`.

* fix: exclude all renderer server entrypoints ()

* chore: update compiler ()

* fix: do not crash when Markdown has no content ()

* feat: improve support for third-party React packages ()

* Remove prism warning when no language is provided ()

* Remove prism warning when no language is provided

* Add the plaintext language instead

* retry deploy

* chore: enter prerelease mode under `next` ()

* Updates to the changesets ()

* Updates to the changesets

* Adds a changeset for astro-prism

Co-authored-by: Fred K. Schott <fkschott@gmail.com>
Co-authored-by: Nate Moore <nate@skypack.dev>
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
Co-authored-by: Pranav Karawale <52596591+obnoxiousnerd@users.noreply.github.com>
Co-authored-by: Matthew Phillips <matthew@skypack.dev>
Co-authored-by: Matthew Phillips <matthew@matthewphillips.info>
Co-authored-by: Ryan Carniato <ryansolid@gmail.com>
Co-authored-by: AsyncBanana <58297401+AsyncBanana@users.noreply.github.com>
Co-authored-by: Jonathan Neal <jonathantneal@hotmail.com>
2021-10-29 15:30:22 -04:00
Robin Métral
397d8f3d84
Upgrade unified deps and improve unified plugins types ()
* Upgrade @astrojs/markdown-support deps and update types

* Add changeset

* Update changeset

* Switch astro-markdown-plugins example to use rehype-autolink-headings

Usage of remark-autolink-headings is discouraged in favor of the rehype counterpart: https://github.com/remarkjs/remark-autolink-headings\#remark-autolink-headings

* Add stricter types for unified plugins

This includes a few suggestions from a code review:
- use vfile.toString instead of vfile.value.toString
- refactor plugins to follow unified best practices instead of returning functions that return a plugin
- use any instead of any[] for plugin options types

* Narrow down types to more specific hast or mdast typings
2021-08-25 08:17:45 -04:00
Fred K. Schott
f9cd031033
Add zod schema validation ()
* add zod schema validation

* update pageUrlFormat config name

* add trailing slash support to config
2021-08-23 14:07:03 -07:00
FredKSchott
50f82e1a53 [ci] yarn format 2021-07-20 04:07:49 +00:00
Pavel Mineev
d3969436dc
Remark and rehype plugins ()
* remark plugins

* remove unused dependency

* enable codeblocks

* backward compatibility with remark-code-titles

* add support for rehype plugins

* add proper types for plugins

* fixes after review

- connect plugins by name
- make plugins configurable
- connect gfm and footnotes if no plugins provided from config
- add more plugins to example

* update and rename example

* add documentation for markdown plugins

* chore: rename with-markdown-plugins example

* chore: restructure dependencies

* feat: add back smartypants, fix mdx expressions

* chore: remove log

* test: add markdown plugin tests

* chore: add changeset

* docs: update markdown doc

Co-authored-by: Nate Moore <nate@skypack.dev>
2021-07-01 11:55:22 -05:00