* Remove `prettier-plugin-astro` from `yarn test` while it is outside the monorepo.
* Apply suggestions from code review
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
* Implements low-level custom element support
* Changes based on self review
* Adds a changeset
* Polyfills are added even when not hydrating
* Remove hydrationMethod option
Punting on this idea until it's really needed.
* Add a test for JSX embedded in an attribute. This test currently fails.
* Oops forgot the semicolons on the correct output
* Add `--scope prettier-plugin-astro` so that the prettier plugin is tested on default CI
* Replace `assert.equal` with `assert.fixture` to remain inline w/ main
* Update astro-prettier.test.js
* Skip the other failing test.
Co-authored-by: Fred K. Schott <fkschott@gmail.com>
* Start of allowing node builtins issue
* Allow use of node:builtin
* Produce an error in Astro files with bare builtin usage
* Upgrade snowpack version
bug fixes for packages that use `node:`
* Document node builtins
* Use the provided builtins list
* Add repository remotes for all astro packages
* Add repository.directory key instead of adding the path to repository.url
* Include changeset
* Add repository key to create-astro
* create initial docs site
* change copy for title and header to say Astro Docs
* create initial docs site
* remove text merge changes
* change workspaceRoot and remove yarn.lock from docs-www
* add docs-www to workspace
Co-authored-by: Kitto Khrangtong <kitto@queensboro.com>
* redesign create astro
* add changeset
* Use npm start
* Update the astro version
* Adds the changeset
Co-authored-by: Fred Schott <fks@Freds-MBP.attlocal.net>
Co-authored-by: Matthew Phillips <matthew@skypack.dev>
* Use npm package names to load internal deps
This is necessary so that published Astro components work. These components will be built by esinstall and therefore they cannot rely on `_astro_internal`. The fix is to use npm specifiers everywhere.
* Move most of frontend to internal
* Mark astro/internal/markdown.js as external
* Move markdown stuff to its own package
This moves the markdown stuff to its own package so that we can externalize it in the markdown component.
* Add the changeset
* Improve dev startup by making most dependencies externals
This moves most dependencies to be an `external` for Snowpack, preventing backend deps from going through esinstall.
* Update benchmark times
* chore: add benchmark script for convenience
* fix: update externals to allow renderers
* chore: update benchmark times
Co-authored-by: Nate Moore <nate@skypack.dev>
* Remove create-astro from workspace
* Improve contrast ratio
* Swap blank template for blog template
* Remove counter components from blog template
* Use `latest` astro version
* fix: add svelte plugin for esbuild, remove precompiled svelte components
* refactor: public export map, public types
* feat: add source-map-support to common code paths
* chore: move new "exports" to "imports" map, add internal types
* Include outPath in error logging for bad load status, and drop error stack (#163)
* Include outPath in the error logging for bad load status
* Discard error stack since it seems not useful
* feat: improve build error logging
* refactor: use object param for writeResult
Co-authored-by: Kevin (Kun) "Kassimo" Qian <kevinkassimo@gmail.com>
* Start of cli docs
* Document the CLI
Also adds support for the `--config` option and `--port` option for the dev server.
* Add tests for --config and --port flags
* Add port to validateConfig
* Pass the `mode` through to snowpack
This allows the production packages to be prepared.
* Use snowpack 3.3.1
* Update path to prism loadComponents external ref
* Upgrade to snowpack 3.3.2
* chore(examples): add kitchen-sink
* feat: support children in rendered components
* feat: add support for rendering children in Svelte
* fix: cleanup p/react fragment children
* chore: add @ts-nocheck to svelte files
* chore: update lockfiles
* fix: types
* feat: memoize frontend/renderer/utils
* fix: disable eslint for compiled SvelteWrapper
* fix: add missing dep
Co-authored-by: Nate Moore <nate@skypack.dev>
* Change to import.meta.glob()
Change of plans—maintain parity with Snowpack and Vite because our Collections API will use a different interface
* Get basic pagination working
* Get params working
* Rename to import.meta.fetchContent
* Upgrade to fdir
* add dep domhandler imported in in src/build/static
* lint and jsDoc error
* move domhandler to devDep
* chore: add package lock
* escape string jsDoc
* chore: add astro dep in until prism import is refactored
* chore: add snowpack example package lock
* Add support for syntax highlighting of code blocks
* Escape usage of backtick strings
* Add workspace root for snowpack
* Use prismjs/components as an external module
* Add example blog
* Add author data
* Improve navigation
* Style nav
* Add friendly error message
* Throw error if import glob used for non-Markdown files
* Use import.meta.collection() API instead
* README fixes
This adds astro/components/ and moves the Prism.astro component into there. So to use in a project you can do:
```html
---
import Prism from 'astro/components/Prism.astro';
---
<Prism lang="html" code={`<html> ... </html>`}
```
* Fix complex MDX parsing
This allows fully MDX support using the micromark MDX extension. One caveat is that if you do something like use the less than sign, you need to escape it because the parser expects these to be tags otherwise.
* Move micromark definition
* Implement fallback capability
This makes it possible for a dynamic component to render fallback content on the server.
The mechanism is a special `static` prop passed to the component. If `static` is true then the component knows it can render static content.
Putting aside the word `static`, is this the right approach? I think giving components the flexibility to make the decision themselves *is* the right approach.
However in this case we have a special property that is passed in non-explicitly. I think we have to do it this way because if the caller passes in a prop it will get serialized and appear on the client. By making this something we *add* during rendering, it only happens on the server (and only when using `:load`).
Assuming this is the right approach, is `static` the right name for this prop? Other candidates:
* `server`
That's all I have!
* Use `import.meta.env.astro` to tell if running in SSR mode.
* Run formatter
* Convert CSS Modules to scoped styles
* Update README
* Move class scoping into HTML walker
* Fix SSR styles test
* Fix mustache tags
* Update PostCSS plugin name
* Add JSDoc comment
* Update test
* Add support for React components.
This adds support for react components via a new `extensions` config in astro.config.mjs. In the future we can extend this to do things like look at the import statements, as Snowpack does.
* Fix the tests
* Begin debugging
* Initial tests set up
This adds tests using uvu (we can switch if people want) and restructures things a bit so that it's easier to test.
Like in snowpack you set up a little project. In our tests you can say:
```js
const result = await runtime.load('/blog/hello-world')
```
And analyze the result. I included a `test-helpers.js` which has a function that will turn HTML into a cheerio instance, for inspecting the result HTML.
* Add CI
* Remove extra console logs
* Formatting