summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/snowpack/astro.config.mjs2
-rw-r--r--examples/snowpack/astro/components/Banner.astro (renamed from examples/snowpack/astro/components/Banner.hmx)0
-rw-r--r--examples/snowpack/astro/components/Hero.astro (renamed from examples/snowpack/astro/components/Hero.hmx)0
-rw-r--r--examples/snowpack/astro/components/Menu.astro (renamed from examples/snowpack/astro/components/Menu.hmx)0
-rw-r--r--examples/snowpack/astro/components/Nav.astro (renamed from examples/snowpack/astro/components/Nav.hmx)0
-rw-r--r--examples/snowpack/astro/components/Subnav.astro (renamed from examples/snowpack/astro/components/Subnav.hmx)0
-rw-r--r--examples/snowpack/astro/layouts/base.astro (renamed from examples/snowpack/astro/layouts/base.hmx)4
-rw-r--r--examples/snowpack/astro/layouts/content-with-cover.astro (renamed from examples/snowpack/astro/layouts/content-with-cover.hmx)6
-rw-r--r--examples/snowpack/astro/layouts/content.astro (renamed from examples/snowpack/astro/layouts/content.hmx)6
-rw-r--r--examples/snowpack/astro/layouts/main.astro (renamed from examples/snowpack/astro/layouts/main.hmx)4
-rw-r--r--examples/snowpack/astro/layouts/post.astro (renamed from examples/snowpack/astro/layouts/post.hmx)2
-rw-r--r--examples/snowpack/astro/pages/404.astro (renamed from examples/snowpack/astro/pages/404.hmx)2
-rw-r--r--examples/snowpack/astro/pages/concepts/build-pipeline.md2
-rw-r--r--examples/snowpack/astro/pages/concepts/dev-server.md2
-rw-r--r--examples/snowpack/astro/pages/concepts/hot-module-replacement.md2
-rw-r--r--examples/snowpack/astro/pages/concepts/how-snowpack-works.md2
-rw-r--r--examples/snowpack/astro/pages/guides.astro (renamed from examples/snowpack/astro/pages/guides.hmx)2
-rw-r--r--examples/snowpack/astro/pages/guides/babel.md2
-rw-r--r--examples/snowpack/astro/pages/guides/connecting-tools.md2
-rw-r--r--examples/snowpack/astro/pages/guides/hmr.md2
-rw-r--r--examples/snowpack/astro/pages/guides/https-ssl-certificates.md2
-rw-r--r--examples/snowpack/astro/pages/guides/jest.md2
-rw-r--r--examples/snowpack/astro/pages/guides/optimize-and-bundle.md2
-rw-r--r--examples/snowpack/astro/pages/guides/plugins.md2
-rw-r--r--examples/snowpack/astro/pages/guides/postcss.md2
-rw-r--r--examples/snowpack/astro/pages/guides/preact.md2
-rw-r--r--examples/snowpack/astro/pages/guides/react-global-imports.md2
-rw-r--r--examples/snowpack/astro/pages/guides/react-loadable-components.md2
-rw-r--r--examples/snowpack/astro/pages/guides/routing.md2
-rw-r--r--examples/snowpack/astro/pages/guides/sass.md2
-rw-r--r--examples/snowpack/astro/pages/guides/server-side-render.md2
-rw-r--r--examples/snowpack/astro/pages/guides/streaming-imports.md2
-rw-r--r--examples/snowpack/astro/pages/guides/tailwind-css.md2
-rw-r--r--examples/snowpack/astro/pages/guides/testing.md2
-rw-r--r--examples/snowpack/astro/pages/guides/upgrade-guide.md2
-rw-r--r--examples/snowpack/astro/pages/guides/vue.md2
-rw-r--r--examples/snowpack/astro/pages/guides/wasm.md2
-rw-r--r--examples/snowpack/astro/pages/guides/web-test-runner.md2
-rw-r--r--examples/snowpack/astro/pages/guides/web-worker.md2
-rw-r--r--examples/snowpack/astro/pages/guides/workbox.md2
-rw-r--r--examples/snowpack/astro/pages/index.astro (renamed from examples/snowpack/astro/pages/index.hmx)6
-rw-r--r--examples/snowpack/astro/pages/news.astro (renamed from examples/snowpack/astro/pages/news.hmx)2
-rw-r--r--examples/snowpack/astro/pages/plugins.astro (renamed from examples/snowpack/astro/pages/plugins.hmx)2
-rw-r--r--examples/snowpack/astro/pages/posts/2020-05-26-snowpack-2-0-release.md2
-rw-r--r--examples/snowpack/astro/pages/posts/2020-07-30-snowpack-2-7-release.md2
-rw-r--r--examples/snowpack/astro/pages/posts/2020-12-03-snowpack-3-release-candidate.md2
-rw-r--r--examples/snowpack/astro/pages/posts/2021-01-13-snowpack-3-0.md2
-rw-r--r--examples/snowpack/astro/pages/proof-of-concept-dynamic/[slug].astro (renamed from examples/snowpack/astro/pages/proof-of-concept-dynamic/[slug].hmx)6
-rw-r--r--examples/snowpack/astro/pages/reference/cli-command-line-interface.md2
-rw-r--r--examples/snowpack/astro/pages/reference/common-error-details.md2
-rw-r--r--examples/snowpack/astro/pages/reference/configuration.md2
-rw-r--r--examples/snowpack/astro/pages/reference/environment-variables.md2
-rw-r--r--examples/snowpack/astro/pages/reference/hot-module-replacement.md2
-rw-r--r--examples/snowpack/astro/pages/reference/javascript-interface.md2
-rw-r--r--examples/snowpack/astro/pages/reference/plugins.md2
-rw-r--r--examples/snowpack/astro/pages/reference/supported-files.md2
-rw-r--r--examples/snowpack/astro/pages/tutorials/getting-started.md2
-rw-r--r--examples/snowpack/astro/pages/tutorials/quick-start.md2
-rw-r--r--examples/snowpack/astro/pages/tutorials/react.md2
-rw-r--r--examples/snowpack/astro/pages/tutorials/svelte.md2
-rw-r--r--snowpack-plugin.cjs4
-rw-r--r--src/@types/astro.ts6
-rw-r--r--src/codegen/index.ts8
-rw-r--r--src/compiler/README.md2
-rw-r--r--src/compiler/parse/index.ts10
-rw-r--r--src/config.ts2
-rw-r--r--src/dev.ts2
-rw-r--r--src/frontend/h.ts6
-rw-r--r--src/generate.ts10
-rw-r--r--src/runtime.ts22
-rw-r--r--src/transform2.ts22
-rw-r--r--test/astro-basic.test.js (renamed from test/hmx-basic.test.js)6
-rw-r--r--test/astro-markdown.test.js (renamed from test/hmx-markdown.test.js)14
-rw-r--r--test/fixtures/astro-basic/astro.config.mjs (renamed from test/fixtures/hmx-basic/astro.config.mjs)2
-rw-r--r--test/fixtures/astro-basic/astro/pages/index.astro (renamed from test/fixtures/hmx-basic/astro/pages/index.hmx)0
-rw-r--r--test/fixtures/astro-basic/snowpack.config.js (renamed from test/fixtures/hmx-basic/snowpack.config.js)0
-rw-r--r--test/fixtures/astro-markdown/astro.config.mjs (renamed from test/fixtures/hmx-markdown/astro.config.mjs)2
-rw-r--r--test/fixtures/astro-markdown/astro/components/Example.jsx (renamed from test/fixtures/hmx-markdown/astro/components/Example.jsx)0
-rw-r--r--test/fixtures/astro-markdown/astro/layouts/content.astro (renamed from test/fixtures/hmx-markdown/astro/layouts/content.hmx)0
-rw-r--r--test/fixtures/astro-markdown/astro/pages/index.astro (renamed from test/fixtures/hmx-markdown/astro/pages/index.hmx)0
-rw-r--r--test/fixtures/astro-markdown/astro/pages/post.md (renamed from test/fixtures/hmx-markdown/astro/pages/post.md)2
-rw-r--r--test/fixtures/astro-markdown/snowpack.config.js (renamed from test/fixtures/hmx-markdown/snowpack.config.js)0
-rw-r--r--test/fixtures/react-component/astro.config.mjs2
-rw-r--r--test/fixtures/react-component/astro/pages/index.astro (renamed from test/fixtures/react-component/astro/pages/index.hmx)0
-rw-r--r--test/react-component.test.js2
-rw-r--r--test/snowpack-integration.test.js2
86 files changed, 129 insertions, 127 deletions
diff --git a/examples/snowpack/astro.config.mjs b/examples/snowpack/astro.config.mjs
index 0f0be4b94..b9138b71f 100644
--- a/examples/snowpack/astro.config.mjs
+++ b/examples/snowpack/astro.config.mjs
@@ -1,7 +1,7 @@
export default {
projectRoot: '.',
- hmxRoot: './astro',
+ astroRoot: './astro',
dist: './_site',
extensions: {
'.jsx': 'preact'
diff --git a/examples/snowpack/astro/components/Banner.hmx b/examples/snowpack/astro/components/Banner.astro
index 565027678..565027678 100644
--- a/examples/snowpack/astro/components/Banner.hmx
+++ b/examples/snowpack/astro/components/Banner.astro
diff --git a/examples/snowpack/astro/components/Hero.hmx b/examples/snowpack/astro/components/Hero.astro
index 8b287c197..8b287c197 100644
--- a/examples/snowpack/astro/components/Hero.hmx
+++ b/examples/snowpack/astro/components/Hero.astro
diff --git a/examples/snowpack/astro/components/Menu.hmx b/examples/snowpack/astro/components/Menu.astro
index f96961aed..f96961aed 100644
--- a/examples/snowpack/astro/components/Menu.hmx
+++ b/examples/snowpack/astro/components/Menu.astro
diff --git a/examples/snowpack/astro/components/Nav.hmx b/examples/snowpack/astro/components/Nav.astro
index d679553c6..d679553c6 100644
--- a/examples/snowpack/astro/components/Nav.hmx
+++ b/examples/snowpack/astro/components/Nav.astro
diff --git a/examples/snowpack/astro/components/Subnav.hmx b/examples/snowpack/astro/components/Subnav.astro
index 2c054a5fc..2c054a5fc 100644
--- a/examples/snowpack/astro/components/Subnav.hmx
+++ b/examples/snowpack/astro/components/Subnav.astro
diff --git a/examples/snowpack/astro/layouts/base.hmx b/examples/snowpack/astro/layouts/base.astro
index 1620a17b6..4b460c8c2 100644
--- a/examples/snowpack/astro/layouts/base.hmx
+++ b/examples/snowpack/astro/layouts/base.astro
@@ -1,6 +1,6 @@
---
- import Banner from '../components/Banner.hmx';
- import Nav from '../components/Nav.hmx';
+ import Banner from '../components/Banner.astro';
+ import Nav from '../components/Nav.astro';
export function setup({ context }) {
return {
context: {
diff --git a/examples/snowpack/astro/layouts/content-with-cover.hmx b/examples/snowpack/astro/layouts/content-with-cover.astro
index 34797f31f..066cdea3f 100644
--- a/examples/snowpack/astro/layouts/content-with-cover.hmx
+++ b/examples/snowpack/astro/layouts/content-with-cover.astro
@@ -1,8 +1,8 @@
---
- import Menu from '../components/Menu.hmx';
- import Subnav from '../components/Subnav.hmx';
+ import Menu from '../components/Menu.astro';
+ import Subnav from '../components/Subnav.astro';
- export const layout = 'layouts/base.hmx';
+ export const layout = 'layouts/base.astro';
export function setup({ context }) {
return {};
}
diff --git a/examples/snowpack/astro/layouts/content.hmx b/examples/snowpack/astro/layouts/content.astro
index 8995e049b..1d72bed9f 100644
--- a/examples/snowpack/astro/layouts/content.hmx
+++ b/examples/snowpack/astro/layouts/content.astro
@@ -1,8 +1,8 @@
---
- import Subnav from '../components/Subnav.hmx';
- import Menu from '../components/Menu.hmx';
+ import Subnav from '../components/Subnav.astro';
+ import Menu from '../components/Menu.astro';
- export const layout = 'layouts/base.hmx';
+ export const layout = 'layouts/base.astro';
export function setup({ context }) {
return {
context: {
diff --git a/examples/snowpack/astro/layouts/main.hmx b/examples/snowpack/astro/layouts/main.astro
index 27d6985e8..cb1787a50 100644
--- a/examples/snowpack/astro/layouts/main.hmx
+++ b/examples/snowpack/astro/layouts/main.astro
@@ -1,6 +1,6 @@
---
- import Menu from '../components/Menu.hmx';
- export const layout = 'layouts/base.hmx';
+ import Menu from '../components/Menu.astro';
+ export const layout = 'layouts/base.astro';
export function setup({ context }) {
return {};
}
diff --git a/examples/snowpack/astro/layouts/post.hmx b/examples/snowpack/astro/layouts/post.astro
index 2f857447b..3528f0cd8 100644
--- a/examples/snowpack/astro/layouts/post.hmx
+++ b/examples/snowpack/astro/layouts/post.astro
@@ -1,6 +1,6 @@
---
import { format as formatDate, parseISO } from 'date-fns';
- export const layout = 'layouts/base.hmx';
+ export const layout = 'layouts/base.astro';
export function setup({ context }) {
return {};
}
diff --git a/examples/snowpack/astro/pages/404.hmx b/examples/snowpack/astro/pages/404.astro
index f26d1ac2b..9687c2d9b 100644
--- a/examples/snowpack/astro/pages/404.hmx
+++ b/examples/snowpack/astro/pages/404.astro
@@ -1,5 +1,5 @@
---
- export const layout = 'layouts/main.hmx';
+ export const layout = 'layouts/main.astro';
export function setup({ context }) {
return {
diff --git a/examples/snowpack/astro/pages/concepts/build-pipeline.md b/examples/snowpack/astro/pages/concepts/build-pipeline.md
index 20689b907..2ff7e58a2 100644
--- a/examples/snowpack/astro/pages/concepts/build-pipeline.md
+++ b/examples/snowpack/astro/pages/concepts/build-pipeline.md
@@ -1,5 +1,5 @@
---
-layout: layouts/content.hmx
+layout: layouts/content.astro
title: The Build Pipeline
description: Snowpack Build creates a production-ready website with or without a bundler
---
diff --git a/examples/snowpack/astro/pages/concepts/dev-server.md b/examples/snowpack/astro/pages/concepts/dev-server.md
index 11b307f1b..5fad2d99f 100644
--- a/examples/snowpack/astro/pages/concepts/dev-server.md
+++ b/examples/snowpack/astro/pages/concepts/dev-server.md
@@ -1,5 +1,5 @@
---
-layout: layouts/content.hmx
+layout: layouts/content.astro
title: The Dev Server
description: Snowpack's dev server is fast because it only rebuilds the files you change. Powered by ESM (ES modules).
---
diff --git a/examples/snowpack/astro/pages/concepts/hot-module-replacement.md b/examples/snowpack/astro/pages/concepts/hot-module-replacement.md
index a38e0209d..58d510c3c 100644
--- a/examples/snowpack/astro/pages/concepts/hot-module-replacement.md
+++ b/examples/snowpack/astro/pages/concepts/hot-module-replacement.md
@@ -1,5 +1,5 @@
---
-layout: layouts/content.hmx
+layout: layouts/content.astro
title: HMR + Fast Refresh
description: Snowpack's ESM-powered unbundled development means near-instant single file builds that only take 10-25ms to load and update in the browser.
---
diff --git a/examples/snowpack/astro/pages/concepts/how-snowpack-works.md b/examples/snowpack/astro/pages/concepts/how-snowpack-works.md
index ad30409d6..186c5037b 100644
--- a/examples/snowpack/astro/pages/concepts/how-snowpack-works.md
+++ b/examples/snowpack/astro/pages/concepts/how-snowpack-works.md
@@ -1,5 +1,5 @@
---
-layout: layouts/content.hmx
+layout: layouts/content.astro
title: How Snowpack Works
description: Snowpack serves your application unbundled during development. Each file is built only once and is cached until it changes.
---
diff --git a/examples/snowpack/astro/pages/guides.hmx b/examples/snowpack/astro/pages/guides.astro
index ae1829ea1..093284869 100644
--- a/examples/snowpack/astro/pages/guides.hmx
+++ b/examples/snowpack/astro/pages/guides.astro
@@ -1,7 +1,7 @@
---
import Card from '../components/Card.jsx';
- export const layout = 'layouts/main.hmx';
+ export const layout = 'layouts/main.astro';
// mocked for now, to be added later
// 1. import {paginate} from 'magicthing';
diff --git a/examples/snowpack/astro/pages/guides/babel.md b/examples/snowpack/astro/pages/guides/babel.md
index dca562465..ecb3108a3 100644
--- a/examples/snowpack/astro/pages/guides/babel.md
+++ b/examples/snowpack/astro/pages/guides/babel.md
@@ -1,5 +1,5 @@
---
-layout: layouts/content.hmx
+layout: layouts/content.astro
title: 'Babel'
tags: communityGuide
published: true
diff --git a/examples/snowpack/astro/pages/guides/connecting-tools.md b/examples/snowpack/astro/pages/guides/connecting-tools.md
index 4ba91e72b..d0208ea43 100644
--- a/examples/snowpack/astro/pages/guides/connecting-tools.md
+++ b/examples/snowpack/astro/pages/guides/connecting-tools.md
@@ -1,5 +1,5 @@
---
-layout: layouts/content.hmx
+layout: layouts/content.astro
title: The Snowpack Guide to connecting your favorite tools
description: 'How do you use your favorite tools in Snowpack? This Guide will help you get started'
published: true
diff --git a/examples/snowpack/astro/pages/guides/hmr.md b/examples/snowpack/astro/pages/guides/hmr.md
index 661f6d452..daf38cc5c 100644
--- a/examples/snowpack/astro/pages/guides/hmr.md
+++ b/examples/snowpack/astro/pages/guides/hmr.md
@@ -1,5 +1,5 @@
---
-layout: layouts/content.hmx
+layout: layouts/content.astro
title: Hot Module Replacement (HMR)
description: Enable Snowpack's Hot Module Replacement (HMR) on your development server.
published: false
diff --git a/examples/snowpack/astro/pages/guides/https-ssl-certificates.md b/examples/snowpack/astro/pages/guides/https-ssl-certificates.md
index 2b4f666a6..bd311a07c 100644
--- a/examples/snowpack/astro/pages/guides/https-ssl-certificates.md
+++ b/examples/snowpack/astro/pages/guides/https-ssl-certificates.md
@@ -1,5 +1,5 @@
---
-layout: layouts/content.hmx
+layout: layouts/content.astro
title: SSL Certificates
description: How to use HTTPs during development and generate SSL certifcates for your Snowpack build.
---
diff --git a/examples/snowpack/astro/pages/guides/jest.md b/examples/snowpack/astro/pages/guides/jest.md
index 52a4f854c..98199f6ec 100644
--- a/examples/snowpack/astro/pages/guides/jest.md
+++ b/examples/snowpack/astro/pages/guides/jest.md
@@ -1,5 +1,5 @@
---
-layout: layouts/content.hmx
+layout: layouts/content.astro
title: 'Jest'
tags: communityGuide
img: '/img/logos/jest.svg'
diff --git a/examples/snowpack/astro/pages/guides/optimize-and-bundle.md b/examples/snowpack/astro/pages/guides/optimize-and-bundle.md
index 4e7b4f787..162a9cffe 100644
--- a/examples/snowpack/astro/pages/guides/optimize-and-bundle.md
+++ b/examples/snowpack/astro/pages/guides/optimize-and-bundle.md
@@ -1,5 +1,5 @@
---
-layout: layouts/content.hmx
+layout: layouts/content.astro
title: Optimize & Bundle for Production
published: true
description: How to optimize your Snowpack build for production, with or without a bundler.
diff --git a/examples/snowpack/astro/pages/guides/plugins.md b/examples/snowpack/astro/pages/guides/plugins.md
index 35f87c859..60818562f 100644
--- a/examples/snowpack/astro/pages/guides/plugins.md
+++ b/examples/snowpack/astro/pages/guides/plugins.md
@@ -1,5 +1,5 @@
---
-layout: layouts/content.hmx
+layout: layouts/content.astro
title: Creating Your Own Plugin
description: Learn the basics of our Plugin API through working examples.
---
diff --git a/examples/snowpack/astro/pages/guides/postcss.md b/examples/snowpack/astro/pages/guides/postcss.md
index d474121a8..f3fe0212a 100644
--- a/examples/snowpack/astro/pages/guides/postcss.md
+++ b/examples/snowpack/astro/pages/guides/postcss.md
@@ -1,5 +1,5 @@
---
-layout: layouts/content.hmx
+layout: layouts/content.astro
title: 'PostCSS'
tags: communityGuide
published: true
diff --git a/examples/snowpack/astro/pages/guides/preact.md b/examples/snowpack/astro/pages/guides/preact.md
index 796ca48e4..1dd700ed8 100644
--- a/examples/snowpack/astro/pages/guides/preact.md
+++ b/examples/snowpack/astro/pages/guides/preact.md
@@ -1,5 +1,5 @@
---
-layout: layouts/content.hmx
+layout: layouts/content.astro
title: Preact
tags: communityGuide
img: '/img/logos/preact.svg'
diff --git a/examples/snowpack/astro/pages/guides/react-global-imports.md b/examples/snowpack/astro/pages/guides/react-global-imports.md
index f6cf2b636..7286337ab 100644
--- a/examples/snowpack/astro/pages/guides/react-global-imports.md
+++ b/examples/snowpack/astro/pages/guides/react-global-imports.md
@@ -1,5 +1,5 @@
---
-layout: layouts/content.hmx
+layout: layouts/content.astro
title: React + babel-plugin-import-global
published: false
---
diff --git a/examples/snowpack/astro/pages/guides/react-loadable-components.md b/examples/snowpack/astro/pages/guides/react-loadable-components.md
index 85d64862b..4d5575327 100644
--- a/examples/snowpack/astro/pages/guides/react-loadable-components.md
+++ b/examples/snowpack/astro/pages/guides/react-loadable-components.md
@@ -1,5 +1,5 @@
---
-layout: layouts/content.hmx
+layout: layouts/content.astro
title: React + Loadable Components
published: false
---
diff --git a/examples/snowpack/astro/pages/guides/routing.md b/examples/snowpack/astro/pages/guides/routing.md
index 1c3047fca..b63830aad 100644
--- a/examples/snowpack/astro/pages/guides/routing.md
+++ b/examples/snowpack/astro/pages/guides/routing.md
@@ -1,5 +1,5 @@
---
-layout: layouts/content.hmx
+layout: layouts/content.astro
title: Routing
published: true
description: This guide will walk you through some common routing scenarios and how to configure the routes option to support them in development.
diff --git a/examples/snowpack/astro/pages/guides/sass.md b/examples/snowpack/astro/pages/guides/sass.md
index c227821aa..3da5c9f7c 100644
--- a/examples/snowpack/astro/pages/guides/sass.md
+++ b/examples/snowpack/astro/pages/guides/sass.md
@@ -1,5 +1,5 @@
---
-layout: layouts/content.hmx
+layout: layouts/content.astro
title: 'Sass'
tags: communityGuide
published: true
diff --git a/examples/snowpack/astro/pages/guides/server-side-render.md b/examples/snowpack/astro/pages/guides/server-side-render.md
index 5fea8ce1a..8c698f9fb 100644
--- a/examples/snowpack/astro/pages/guides/server-side-render.md
+++ b/examples/snowpack/astro/pages/guides/server-side-render.md
@@ -1,5 +1,5 @@
---
-layout: layouts/content.hmx
+layout: layouts/content.astro
title: Server-Side Rendering (SSR)
description: This guide will walk you through three different options for setting up Snowpack with your own custom server.
published: true
diff --git a/examples/snowpack/astro/pages/guides/streaming-imports.md b/examples/snowpack/astro/pages/guides/streaming-imports.md
index 70fd6aa3d..39f167f1f 100644
--- a/examples/snowpack/astro/pages/guides/streaming-imports.md
+++ b/examples/snowpack/astro/pages/guides/streaming-imports.md
@@ -1,5 +1,5 @@
---
-layout: layouts/content.hmx
+layout: layouts/content.astro
title: Streaming Imports
published: true
stream: Fetch your npm dependencies on-demand from a remote ESM CDN.
diff --git a/examples/snowpack/astro/pages/guides/tailwind-css.md b/examples/snowpack/astro/pages/guides/tailwind-css.md
index 03f372871..ce8597b0b 100644
--- a/examples/snowpack/astro/pages/guides/tailwind-css.md
+++ b/examples/snowpack/astro/pages/guides/tailwind-css.md
@@ -1,5 +1,5 @@
---
-layout: layouts/content.hmx
+layout: layouts/content.astro
title: 'Tailwind CSS'
tags: communityGuide
published: true
diff --git a/examples/snowpack/astro/pages/guides/testing.md b/examples/snowpack/astro/pages/guides/testing.md
index 215255351..f33c3324e 100644
--- a/examples/snowpack/astro/pages/guides/testing.md
+++ b/examples/snowpack/astro/pages/guides/testing.md
@@ -1,5 +1,5 @@
---
-layout: layouts/content.hmx
+layout: layouts/content.astro
title: Testing
published: true
description: How to choose and use a JavaScript test runner for your Snowpack site.
diff --git a/examples/snowpack/astro/pages/guides/upgrade-guide.md b/examples/snowpack/astro/pages/guides/upgrade-guide.md
index 1eed66dde..098e1c812 100644
--- a/examples/snowpack/astro/pages/guides/upgrade-guide.md
+++ b/examples/snowpack/astro/pages/guides/upgrade-guide.md
@@ -1,5 +1,5 @@
---
-layout: layouts/content.hmx
+layout: layouts/content.astro
title: Snowpack Upgrade Guide
published: true
description: How to upgrade to Snowpack v3 from older versions of Snowpack.
diff --git a/examples/snowpack/astro/pages/guides/vue.md b/examples/snowpack/astro/pages/guides/vue.md
index a287fc538..95b56d8f6 100644
--- a/examples/snowpack/astro/pages/guides/vue.md
+++ b/examples/snowpack/astro/pages/guides/vue.md
@@ -1,5 +1,5 @@
---
-layout: layouts/content.hmx
+layout: layouts/content.astro
title: Vue
tags: communityGuide
img: '/img/logos/vue.png'
diff --git a/examples/snowpack/astro/pages/guides/wasm.md b/examples/snowpack/astro/pages/guides/wasm.md
index bf988f39e..66119afbd 100644
--- a/examples/snowpack/astro/pages/guides/wasm.md
+++ b/examples/snowpack/astro/pages/guides/wasm.md
@@ -1,5 +1,5 @@
---
-layout: layouts/content.hmx
+layout: layouts/content.astro
title: 'WASM'
tags: communityGuide
published: true
diff --git a/examples/snowpack/astro/pages/guides/web-test-runner.md b/examples/snowpack/astro/pages/guides/web-test-runner.md
index c4adadb2d..43e77e357 100644
--- a/examples/snowpack/astro/pages/guides/web-test-runner.md
+++ b/examples/snowpack/astro/pages/guides/web-test-runner.md
@@ -1,5 +1,5 @@
---
-layout: layouts/content.hmx
+layout: layouts/content.astro
title: '@web/test-runner'
tags: communityGuide
img: '/img/logos/modern-web.svg'
diff --git a/examples/snowpack/astro/pages/guides/web-worker.md b/examples/snowpack/astro/pages/guides/web-worker.md
index 4fc6b6447..afb87b3da 100644
--- a/examples/snowpack/astro/pages/guides/web-worker.md
+++ b/examples/snowpack/astro/pages/guides/web-worker.md
@@ -1,5 +1,5 @@
---
-layout: layouts/content.hmx
+layout: layouts/content.astro
title: 'Web Workers'
tags: communityGuide
published: true
diff --git a/examples/snowpack/astro/pages/guides/workbox.md b/examples/snowpack/astro/pages/guides/workbox.md
index ab0c5f45b..f74eadd18 100644
--- a/examples/snowpack/astro/pages/guides/workbox.md
+++ b/examples/snowpack/astro/pages/guides/workbox.md
@@ -1,5 +1,5 @@
---
-layout: layouts/content.hmx
+layout: layouts/content.astro
title: Workbox
tags: communityGuide
description: The Workbox CLI integrates well with Snowpack.
diff --git a/examples/snowpack/astro/pages/index.hmx b/examples/snowpack/astro/pages/index.astro
index 3f5669824..3911bcc84 100644
--- a/examples/snowpack/astro/pages/index.hmx
+++ b/examples/snowpack/astro/pages/index.astro
@@ -1,8 +1,8 @@
---
- import Menu from '../components/Menu.hmx';
- import Hero from '../components/Hero.hmx';
+ import Menu from '../components/Menu.astro';
+ import Hero from '../components/Hero.astro';
- export const layout = 'layouts/base.hmx';
+ export const layout = 'layouts/base.astro';
export function setup({ context }) {
return {};
}
diff --git a/examples/snowpack/astro/pages/news.hmx b/examples/snowpack/astro/pages/news.astro
index 7bc012226..3cbe694b5 100644
--- a/examples/snowpack/astro/pages/news.hmx
+++ b/examples/snowpack/astro/pages/news.astro
@@ -4,7 +4,7 @@
import NewsAssets from '../components/NewsAssets.svelte';
import NewsTitle from '../components/NewsTitle.vue';
- export const layout = 'layouts/main.hmx';
+ export const layout = 'layouts/main.astro';
import news from '../data/news.json';
import users from '../data/users.json';
diff --git a/examples/snowpack/astro/pages/plugins.hmx b/examples/snowpack/astro/pages/plugins.astro
index 4062904e4..cf66f8885 100644
--- a/examples/snowpack/astro/pages/plugins.hmx
+++ b/examples/snowpack/astro/pages/plugins.astro
@@ -3,7 +3,7 @@
import users from '../data/users.json';
import PluginSearchPage from '../components/PluginSearchPage.jsx';
- export const layout = 'layouts/main.hmx';
+ export const layout = 'layouts/main.astro';
export function setup({ context }) {
return {
diff --git a/examples/snowpack/astro/pages/posts/2020-05-26-snowpack-2-0-release.md b/examples/snowpack/astro/pages/posts/2020-05-26-snowpack-2-0-release.md
index f615045f6..76b9098c0 100644
--- a/examples/snowpack/astro/pages/posts/2020-05-26-snowpack-2-0-release.md
+++ b/examples/snowpack/astro/pages/posts/2020-05-26-snowpack-2-0-release.md
@@ -1,5 +1,5 @@
---
-layout: layouts/post.hmx
+layout: layouts/post.astro
bannerVideo: '/img/extra-space-4.mp4'
permalink: '/posts/2020-05-26-snowpack-2-0-release/'
title: Snowpack v2.0
diff --git a/examples/snowpack/astro/pages/posts/2020-07-30-snowpack-2-7-release.md b/examples/snowpack/astro/pages/posts/2020-07-30-snowpack-2-7-release.md
index eb3e169f9..6ef94ab69 100644
--- a/examples/snowpack/astro/pages/posts/2020-07-30-snowpack-2-7-release.md
+++ b/examples/snowpack/astro/pages/posts/2020-07-30-snowpack-2-7-release.md
@@ -1,5 +1,5 @@
---
-layout: layouts/post.hmx
+layout: layouts/post.astro
title: Snowpack 2.7
description: 'A new plugin API plus smaller, faster production builds.'
tagline: v2.7.0 release post
diff --git a/examples/snowpack/astro/pages/posts/2020-12-03-snowpack-3-release-candidate.md b/examples/snowpack/astro/pages/posts/2020-12-03-snowpack-3-release-candidate.md
index 9f3657e4d..b5c4d5bab 100644
--- a/examples/snowpack/astro/pages/posts/2020-12-03-snowpack-3-release-candidate.md
+++ b/examples/snowpack/astro/pages/posts/2020-12-03-snowpack-3-release-candidate.md
@@ -1,5 +1,5 @@
---
-layout: layouts/post.hmx
+layout: layouts/post.astro
title: 'Snowpack v3.0 Release Candidate'
tagline: New features to change the way you build for the web.
description: 'New features to change the way you build for the web. Snowpack v3.0 will release on January 6th, 2021 (the one-year anniversary of its original launch post). This is our biggest release yet with some serious new features, including a new way to load npm packages on-demand that lets you skip the `npm install` step entirely.'
diff --git a/examples/snowpack/astro/pages/posts/2021-01-13-snowpack-3-0.md b/examples/snowpack/astro/pages/posts/2021-01-13-snowpack-3-0.md
index a5e9041a9..bfc1d8fb6 100644
--- a/examples/snowpack/astro/pages/posts/2021-01-13-snowpack-3-0.md
+++ b/examples/snowpack/astro/pages/posts/2021-01-13-snowpack-3-0.md
@@ -1,5 +1,5 @@
---
-layout: layouts/post.hmx
+layout: layouts/post.astro
title: 'Snowpack v3.0'
description: Snowpack v3.0 is here! Our biggest release yet with some serious new features, including pre-bundled streaming imports, built-in bundling & optimizations, new JavaScript APIs, and more.'
date: 2021-01-13
diff --git a/examples/snowpack/astro/pages/proof-of-concept-dynamic/[slug].hmx b/examples/snowpack/astro/pages/proof-of-concept-dynamic/[slug].astro
index 8ff8a446f..c81ed0d94 100644
--- a/examples/snowpack/astro/pages/proof-of-concept-dynamic/[slug].hmx
+++ b/examples/snowpack/astro/pages/proof-of-concept-dynamic/[slug].astro
@@ -1,11 +1,11 @@
---
- import Subnav from '../components/Subnav.hmx';
- import { content as Menu } from '../components/Menu.hmx';
+ import Subnav from '../components/Subnav.astro';
+ import { content as Menu } from '../components/Menu.astro';
// import contentful from 'skypack:contentful';
export default async function ({ params }) {
const entry = await contentful.getEntry(params.slug);
- return { title: entry.fields.title, description: entry.fields.description, layout: 'layouts/base.hmx', props: { entry } };
+ return { title: entry.fields.title, description: entry.fields.description, layout: 'layouts/base.astro', props: { entry } };
}
---
diff --git a/examples/snowpack/astro/pages/reference/cli-command-line-interface.md b/examples/snowpack/astro/pages/reference/cli-command-line-interface.md
index 03e2b8a10..af4dc4d43 100644
--- a/examples/snowpack/astro/pages/reference/cli-command-line-interface.md
+++ b/examples/snowpack/astro/pages/reference/cli-command-line-interface.md
@@ -1,5 +1,5 @@
---
-layout: layouts/content.hmx
+layout: layouts/content.astro
title: Command Line API
description: The Snowpack Command Line tool's API, commands, and flags.
---
diff --git a/examples/snowpack/astro/pages/reference/common-error-details.md b/examples/snowpack/astro/pages/reference/common-error-details.md
index b94e29f74..066b82f40 100644
--- a/examples/snowpack/astro/pages/reference/common-error-details.md
+++ b/examples/snowpack/astro/pages/reference/common-error-details.md
@@ -1,5 +1,5 @@
---
-layout: layouts/content.hmx
+layout: layouts/content.astro
title: Common Error Details
description: How to troubleshoot common issues and error messagesm, plus our resources for getting help.
---
diff --git a/examples/snowpack/astro/pages/reference/configuration.md b/examples/snowpack/astro/pages/reference/configuration.md
index f735cf039..60afba42d 100644
--- a/examples/snowpack/astro/pages/reference/configuration.md
+++ b/examples/snowpack/astro/pages/reference/configuration.md
@@ -1,5 +1,5 @@
---
-layout: layouts/content.hmx
+layout: layouts/content.astro
title: snowpack.config.js
description: The Snowpack configuration API reference.
---
diff --git a/examples/snowpack/astro/pages/reference/environment-variables.md b/examples/snowpack/astro/pages/reference/environment-variables.md
index 4e51e2628..66bd8a91f 100644
--- a/examples/snowpack/astro/pages/reference/environment-variables.md
+++ b/examples/snowpack/astro/pages/reference/environment-variables.md
@@ -1,5 +1,5 @@
---
-layout: layouts/content.hmx
+layout: layouts/content.astro
title: Environment Variables
description: Using environment variables with Snowpack
---
diff --git a/examples/snowpack/astro/pages/reference/hot-module-replacement.md b/examples/snowpack/astro/pages/reference/hot-module-replacement.md
index 433755a00..a18c8dcca 100644
--- a/examples/snowpack/astro/pages/reference/hot-module-replacement.md
+++ b/examples/snowpack/astro/pages/reference/hot-module-replacement.md
@@ -1,5 +1,5 @@
---
-layout: layouts/content.hmx
+layout: layouts/content.astro
title: Hot Module Replacement (HMR) API
description: Snowpack implements HMR via the esm-hmr spec, an attempted standard for ESM-based Hot Module Replacement (HMR).
---
diff --git a/examples/snowpack/astro/pages/reference/javascript-interface.md b/examples/snowpack/astro/pages/reference/javascript-interface.md
index 1b3a95a07..26f7c59e7 100644
--- a/examples/snowpack/astro/pages/reference/javascript-interface.md
+++ b/examples/snowpack/astro/pages/reference/javascript-interface.md
@@ -1,5 +1,5 @@
---
-layout: layouts/content.hmx
+layout: layouts/content.astro
title: JavaScript API
description: Snowpack's JavaScript API is for anyone who wants to integrate with some custom build pipeline or server-side rendering engine.
---
diff --git a/examples/snowpack/astro/pages/reference/plugins.md b/examples/snowpack/astro/pages/reference/plugins.md
index eba268180..71425d52f 100644
--- a/examples/snowpack/astro/pages/reference/plugins.md
+++ b/examples/snowpack/astro/pages/reference/plugins.md
@@ -1,5 +1,5 @@
---
-layout: layouts/content.hmx
+layout: layouts/content.astro
title: Plugin API
description: The Snowpack Plugin API and how to use it.
---
diff --git a/examples/snowpack/astro/pages/reference/supported-files.md b/examples/snowpack/astro/pages/reference/supported-files.md
index 40de2855d..48b148967 100644
--- a/examples/snowpack/astro/pages/reference/supported-files.md
+++ b/examples/snowpack/astro/pages/reference/supported-files.md
@@ -1,5 +1,5 @@
---
-layout: layouts/content.hmx
+layout: layouts/content.astro
title: Supported Files
description: Snowpack ships with built-in support for many file types including json, js, ts, jsx, css, css modules, and images.
---
diff --git a/examples/snowpack/astro/pages/tutorials/getting-started.md b/examples/snowpack/astro/pages/tutorials/getting-started.md
index 96e77442a..57a317134 100644
--- a/examples/snowpack/astro/pages/tutorials/getting-started.md
+++ b/examples/snowpack/astro/pages/tutorials/getting-started.md
@@ -1,5 +1,5 @@
---
-layout: layouts/content.hmx
+layout: layouts/content.astro
title: 'Starting a New Project'
description: This guide shows you how to set up Snowpack from scratch in a Node.js project. Along the way learn key concepts of Snowpack and unbundled development.
---
diff --git a/examples/snowpack/astro/pages/tutorials/quick-start.md b/examples/snowpack/astro/pages/tutorials/quick-start.md
index d528ed0f3..183fafa32 100644
--- a/examples/snowpack/astro/pages/tutorials/quick-start.md
+++ b/examples/snowpack/astro/pages/tutorials/quick-start.md
@@ -1,5 +1,5 @@
---
-layout: layouts/content.hmx
+layout: layouts/content.astro
title: Quick Start
description: A very basic guide for developers who want to run Snowpack as quickly as possible.
---
diff --git a/examples/snowpack/astro/pages/tutorials/react.md b/examples/snowpack/astro/pages/tutorials/react.md
index 1256cc246..036d4d295 100644
--- a/examples/snowpack/astro/pages/tutorials/react.md
+++ b/examples/snowpack/astro/pages/tutorials/react.md
@@ -1,5 +1,5 @@
---
-layout: layouts/content-with-cover.hmx
+layout: layouts/content-with-cover.astro
title: 'Getting Started with React'
description: 'Get started with this in-depth tutorial on how to build React applications and websites with Snowpack and developer tools like React Fast Refresh'
date: 2020-12-01
diff --git a/examples/snowpack/astro/pages/tutorials/svelte.md b/examples/snowpack/astro/pages/tutorials/svelte.md
index 623a59131..cffe1dd88 100644
--- a/examples/snowpack/astro/pages/tutorials/svelte.md
+++ b/examples/snowpack/astro/pages/tutorials/svelte.md
@@ -1,5 +1,5 @@
---
-layout: layouts/content-with-cover.hmx
+layout: layouts/content-with-cover.astro
title: 'Getting Started with Svelte'
description: 'Get started with this in-depth tutorial on how to build Svelte applications and websites with Snowpack'
date: 2020-12-01
diff --git a/snowpack-plugin.cjs b/snowpack-plugin.cjs
index b4ea1b9af..cacd1d017 100644
--- a/snowpack-plugin.cjs
+++ b/snowpack-plugin.cjs
@@ -5,10 +5,10 @@ const transformPromise = import('./lib/transform2.js');
module.exports = function (snowpackConfig, { resolve, extensions } = {}) {
return {
- name: 'snowpack-hmx',
+ name: 'snowpack-astro',
knownEntrypoints: ['deepmerge'],
resolve: {
- input: ['.hmx', '.md'],
+ input: ['.astro', '.md'],
output: ['.js'],
},
async load({ filePath }) {
diff --git a/src/@types/astro.ts b/src/@types/astro.ts
index 8d5979eec..9ec2aec53 100644
--- a/src/@types/astro.ts
+++ b/src/@types/astro.ts
@@ -1,16 +1,16 @@
export interface AstroConfigRaw {
dist: string;
projectRoot: string;
- hmxRoot: string;
+ astroRoot: string;
jsx?: string;
}
-export type ValidExtensionPlugins = 'hmx' | 'react' | 'preact' | 'svelte' | 'vue';
+export type ValidExtensionPlugins = 'astro' | 'react' | 'preact' | 'svelte' | 'vue';
export interface AstroConfig {
dist: string;
projectRoot: URL;
- hmxRoot: URL;
+ astroRoot: URL;
extensions?: Record<string, ValidExtensionPlugins>
}
diff --git a/src/codegen/index.ts b/src/codegen/index.ts
index a9fc433f4..d248b2a60 100644
--- a/src/codegen/index.ts
+++ b/src/codegen/index.ts
@@ -25,7 +25,7 @@ interface CodeGenOptions {
}
function internalImport(internalPath: string) {
- return `/__hmx_internal__/${internalPath}`;
+ return `/_astro_internal/${internalPath}`;
}
function getAttributes(attrs: Attribute[]): Record<string, string> {
@@ -96,7 +96,7 @@ interface ComponentInfo {
}
const defaultExtensions: Readonly<Record<string, ValidExtensionPlugins>> = {
- '.hmx': 'hmx',
+ '.astro': 'astro',
'.jsx': 'react',
'.vue': 'vue',
'.svelte': 'svelte'
@@ -117,9 +117,9 @@ function getComponentWrapper(_name: string, { type, url }: ComponentInfo, compil
}
switch (plugin) {
- case 'hmx': {
+ case 'astro': {
if (kind) {
- throw new Error(`HMX does not support :${kind}`);
+ throw new Error(`Astro does not support :${kind}`);
}
return {
wrapper: name,
diff --git a/src/compiler/README.md b/src/compiler/README.md
index bef440860..f44d45ecf 100644
--- a/src/compiler/README.md
+++ b/src/compiler/README.md
@@ -1,3 +1,3 @@
-# `hmx/compiler`
+# `astro/compiler`
This directory is a fork of `svelte/compiler`. It is meant to stay as close to the original source as possible, so that upstream changes are easy to integrate. Everything svelte-specific and unrelated to parsing (compiler, preprocess, etc) has been removed. \ No newline at end of file
diff --git a/src/compiler/parse/index.ts b/src/compiler/parse/index.ts
index 00eccdb7d..052cf0317 100644
--- a/src/compiler/parse/index.ts
+++ b/src/compiler/parse/index.ts
@@ -226,7 +226,7 @@ export default function parse(template: string, options: ParserOptions = {}): As
parser.error(
{
code: 'duplicate-style',
- message: 'You can only have one <style> tag per HMX file',
+ message: 'You can only have one <style> tag per Astro file',
},
parser.css[1].start
);
@@ -234,15 +234,15 @@ export default function parse(template: string, options: ParserOptions = {}): As
// const instance_scripts = parser.js.filter((script) => script.context === 'default');
// const module_scripts = parser.js.filter((script) => script.context === 'module');
- const hmx_scripts = parser.js.filter((script) => script.context === 'setup');
+ const astro_scripts = parser.js.filter((script) => script.context === 'setup');
- if (hmx_scripts.length > 1) {
+ if (astro_scripts.length > 1) {
parser.error(
{
code: 'invalid-script',
message: 'A component can only have one frontmatter (---) script',
},
- hmx_scripts[1].start
+ astro_scripts[1].start
);
}
@@ -260,6 +260,6 @@ export default function parse(template: string, options: ParserOptions = {}): As
html: parser.html,
css: parser.css[0],
// instance: instance_scripts[0],
- module: hmx_scripts[0],
+ module: astro_scripts[0],
};
}
diff --git a/src/config.ts b/src/config.ts
index da58b7a03..1a80d4a15 100644
--- a/src/config.ts
+++ b/src/config.ts
@@ -17,6 +17,6 @@ export async function loadConfig(rawRoot: string | undefined): Promise<AstroConf
const astroConfig: AstroConfig = (await import(astroConfigPath)).default;
astroConfig.projectRoot = new URL(astroConfig.projectRoot + '/', fileProtocolRoot);
- astroConfig.hmxRoot = new URL(astroConfig.hmxRoot + '/', fileProtocolRoot);
+ astroConfig.astroRoot = new URL(astroConfig.astroRoot + '/', fileProtocolRoot);
return astroConfig;
}
diff --git a/src/dev.ts b/src/dev.ts
index c6ad9ff7c..5c80133a7 100644
--- a/src/dev.ts
+++ b/src/dev.ts
@@ -53,7 +53,7 @@ export default async function (astroConfig: AstroConfig) {
break;
}
default: {
- error(logging, 'executing hmx', result.error);
+ error(logging, 'executing astro', result.error);
break;
}
}
diff --git a/src/frontend/h.ts b/src/frontend/h.ts
index 77ecf857b..cd94583f8 100644
--- a/src/frontend/h.ts
+++ b/src/frontend/h.ts
@@ -1,7 +1,7 @@
export type HProps = Record<string, string> | null | undefined;
export type HChild = string | undefined | (() => string);
-export type HMXComponent = (props: HProps, ...children: Array<HChild>) => string;
-export type HTag = string | HMXComponent;
+export type AstroComponent = (props: HProps, ...children: Array<HChild>) => string;
+export type HTag = string | AstroComponent;
const voidTags = new Set(['area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr']);
@@ -41,7 +41,7 @@ function* _h(tag: string, attrs: HProps, children: Array<HChild>) {
export async function h(tag: HTag, attrs: HProps, ...pChildren: Array<Promise<HChild>>) {
const children = await Promise.all(pChildren.flat(Infinity));
if (typeof tag === 'function') {
- // We assume it's an hmx component
+ // We assume it's an astro component
return tag(attrs, ...children);
}
diff --git a/src/generate.ts b/src/generate.ts
index 225bf4fde..4a31cc291 100644
--- a/src/generate.ts
+++ b/src/generate.ts
@@ -19,8 +19,8 @@ async function* allPages(root: URL): AsyncGenerator<URL, void, unknown> {
}
export default async function (astroConfig: AstroConfig) {
- const { projectRoot, hmxRoot } = astroConfig;
- const pageRoot = new URL('./pages/', hmxRoot);
+ const { projectRoot, astroRoot } = astroConfig;
+ const pageRoot = new URL('./pages/', astroRoot);
const dist = new URL(astroConfig.dist + '/', projectRoot);
const configPath = new URL('./snowpack.config.js', projectRoot).pathname;
@@ -39,11 +39,11 @@ export default async function (astroConfig: AstroConfig) {
const runtime = snowpack.getServerRuntime();
for await (const filepath of allPages(pageRoot)) {
- const rel = pathRelative(hmxRoot.pathname, filepath.pathname); // pages/index.hmx
- const pagePath = `/_hmx/${rel.replace(/\.(hmx|md)/, '.js')}`;
+ const rel = pathRelative(astroRoot.pathname, filepath.pathname); // pages/index.astro
+ const pagePath = `/_astro/${rel.replace(/\.(astro|md)/, '.js')}`;
try {
- const outPath = new URL('./' + rel.replace(/\.(hmx|md)/, '.html'), dist);
+ const outPath = new URL('./' + rel.replace(/\.(astro|md)/, '.html'), dist);
const outFolder = new URL('./', outPath);
const mod = await runtime.importModule(pagePath);
const html = await mod.exports.default({});
diff --git a/src/runtime.ts b/src/runtime.ts
index ed498c331..889224548 100644
--- a/src/runtime.ts
+++ b/src/runtime.ts
@@ -28,18 +28,18 @@ export type LoadResult = LoadResultSuccess | LoadResultNotFound | LoadResultErro
async function load(config: RuntimeConfig, rawPathname: string | undefined): Promise<LoadResult> {
const { logging, snowpack, snowpackRuntime } = config;
- const { hmxRoot } = config.astroConfig;
+ const { astroRoot } = config.astroConfig;
const fullurl = new URL(rawPathname || '/', 'https://example.org/');
const reqPath = decodeURI(fullurl.pathname);
const selectedPage = reqPath.substr(1) || 'index';
info(logging, 'access', reqPath);
- const selectedPageLoc = new URL(`./pages/${selectedPage}.hmx`, hmxRoot);
- const selectedPageMdLoc = new URL(`./pages/${selectedPage}.md`, hmxRoot);
- const selectedPageUrl = `/_hmx/pages/${selectedPage}.js`;
+ const selectedPageLoc = new URL(`./pages/${selectedPage}.astro`, astroRoot);
+ const selectedPageMdLoc = new URL(`./pages/${selectedPage}.md`, astroRoot);
+ const selectedPageUrl = `/_astro/pages/${selectedPage}.js`;
- // Non-hmx pages (file resources)
+ // Non-Astro pages (file resources)
if (!existsSync(selectedPageLoc) && !existsSync(selectedPageMdLoc)) {
try {
const result = await snowpack.loadUrl(reqPath);
@@ -96,19 +96,19 @@ async function load(config: RuntimeConfig, rawPathname: string | undefined): Pro
}
export async function createRuntime(astroConfig: AstroConfig, logging: LogOptions) {
- const { projectRoot, hmxRoot, extensions } = astroConfig;
+ const { projectRoot, astroRoot, extensions } = astroConfig;
const internalPath = new URL('./frontend/', import.meta.url);
// Workaround for SKY-251
- const hmxPlugOptions: {
+ const astroPlugOptions: {
resolve?: (s: string) => string;
extensions?: Record<string, string>
} = { extensions };
if (existsSync(new URL('./package-lock.json', projectRoot))) {
const pkgLockStr = await readFile(new URL('./package-lock.json', projectRoot), 'utf-8');
const pkgLock = JSON.parse(pkgLockStr);
- hmxPlugOptions.resolve = (pkgName: string) => {
+ astroPlugOptions.resolve = (pkgName: string) => {
const ver = pkgLock.dependencies[pkgName].version;
return `/_snowpack/pkg/${pkgName}.v${ver}.js`;
};
@@ -117,10 +117,10 @@ export async function createRuntime(astroConfig: AstroConfig, logging: LogOption
const snowpackConfig = await loadConfiguration({
root: projectRoot.pathname,
mount: {
- [hmxRoot.pathname]: '/_hmx',
- [internalPath.pathname]: '/__hmx_internal__',
+ [astroRoot.pathname]: '/_astro',
+ [internalPath.pathname]: '/_astro_internal',
},
- plugins: [[new URL('../snowpack-plugin.cjs', import.meta.url).pathname, hmxPlugOptions]],
+ plugins: [[new URL('../snowpack-plugin.cjs', import.meta.url).pathname, astroPlugOptions]],
devOptions: {
open: 'none',
output: 'stream',
diff --git a/src/transform2.ts b/src/transform2.ts
index c58502f2f..27956fb9f 100644
--- a/src/transform2.ts
+++ b/src/transform2.ts
@@ -24,16 +24,16 @@ const defaultCompileOptions: CompileOptions = {
};
function internalImport(internalPath: string) {
- return `/__hmx_internal__/${internalPath}`;
+ return `/_astro_internal/${internalPath}`;
}
-interface ConvertHmxOptions {
+interface ConvertAstroOptions {
compileOptions: CompileOptions;
filename: string;
fileID: string;
}
-async function convertHmxToJsx(template: string, opts: ConvertHmxOptions): Promise<TransformResult> {
+async function convertAstroToJsx(template: string, opts: ConvertAstroOptions): Promise<TransformResult> {
const { filename } = opts;
// 1. Parse
@@ -90,17 +90,19 @@ async function convertMdToJsx(
const convertOptions = { compileOptions, filename, fileID };
- return convertHmxToJsx(raw, convertOptions);
+ return convertAstroToJsx(raw, convertOptions);
}
+type SupportedExtensions = '.astro' | '.md';
+
async function transformFromSource(
contents: string,
{ compileOptions, filename, projectRoot }: { compileOptions: CompileOptions; filename: string; projectRoot: string }
): Promise<TransformResult> {
const fileID = path.relative(projectRoot, filename);
- switch (path.extname(filename)) {
- case '.hmx':
- return convertHmxToJsx(contents, { compileOptions, filename, fileID });
+ switch (path.extname(filename) as SupportedExtensions) {
+ case '.astro':
+ return convertAstroToJsx(contents, { compileOptions, filename, fileID });
case '.md':
return convertMdToJsx(contents, { compileOptions, filename, fileID });
default:
@@ -125,7 +127,7 @@ export async function compileComponent(
// <script astro></script>
${sourceJsx.script}
-// \`__render()\`: Render the contents of the HMX module. "<slot:*>" elements are not
+// \`__render()\`: Render the contents of the Astro module. "<slot:*>" elements are not
// included (see below).
import { h, Fragment } from '${internalImport('h.js')}';
export function __slothead(children, context) { return h(Fragment, null, ${headItemJsx}); }
@@ -135,7 +137,7 @@ export default __render;
if (headItemJsx) {
modJsx += `
-// \`__renderPage()\`: Render the contents of the HMX module as a page. This is a special flow,
+// \`__renderPage()\`: Render the contents of the Astro module as a page. This is a special flow,
// triggered by loading a component directly by URL.
// If the page exports a defined "layout", then load + render those first. "context", "astro:head",
// and "slot:body" should all inherit from parent layouts, merging together in the correct order.
@@ -149,7 +151,7 @@ export async function __renderPage({request, children}) {
// find all layouts, going up the layout chain.
if (currentChild.layout) {
- const layoutComponent = (await import('/_hmx/layouts/' + layout.replace(/.*layouts\\//, "").replace(/\.hmx$/, '.js')));
+ const layoutComponent = (await import('/_astro/layouts/' + layout.replace(/.*layouts\\//, "").replace(/\.astro$/, '.js')));
return layoutComponent.__renderPage({
request,
children: [currentChild, ...children],
diff --git a/test/hmx-basic.test.js b/test/astro-basic.test.js
index 4c2c7da52..1bc3cd47b 100644
--- a/test/hmx-basic.test.js
+++ b/test/astro-basic.test.js
@@ -9,8 +9,8 @@ let runtime;
Basics.before(async () => {
const astroConfig = {
- projectRoot: new URL('./fixtures/hmx-basic/', import.meta.url),
- hmxRoot: new URL('./fixtures/hmx-basic/astro/', import.meta.url),
+ projectRoot: new URL('./fixtures/astro-basic/', import.meta.url),
+ hmxRoot: new URL('./fixtures/astro-basic/astro/', import.meta.url),
dist: './_site'
};
@@ -26,7 +26,7 @@ Basics.after(async () => {
await runtime && runtime.shutdown();
});
-Basics('Can load hmx page', async () => {
+Basics('Can load page', async () => {
const result = await runtime.load('/');
assert.equal(result.statusCode, 200);
diff --git a/test/hmx-markdown.test.js b/test/astro-markdown.test.js
index 1a3a2e11c..7f40bdd05 100644
--- a/test/hmx-markdown.test.js
+++ b/test/astro-markdown.test.js
@@ -4,12 +4,12 @@ import { createRuntime } from '../lib/runtime.js';
import { loadConfig } from '../lib/config.js';
import { doc } from './test-utils.js';
-const HMXMD = suite('HMX Markdown');
+const Markdown = suite('Astro Markdown');
let runtime, setupError;
-HMXMD.before(async () => {
- const astroConfig = await loadConfig(new URL('./fixtures/hmx-markdown', import.meta.url).pathname);
+Markdown.before(async () => {
+ const astroConfig = await loadConfig(new URL('./fixtures/astro-markdown', import.meta.url).pathname);
const logging = {
level: 'error',
@@ -24,15 +24,15 @@ HMXMD.before(async () => {
}
});
-HMXMD.after(async () => {
+Markdown.after(async () => {
runtime && runtime.shutdown();
});
-HMXMD('No errors creating a runtime', () => {
+Markdown('No errors creating a runtime', () => {
assert.equal(setupError, undefined);
});
-HMXMD('Can load markdown pages with hmx', async () => {
+Markdown('Can load markdown pages with hmx', async () => {
const result = await runtime.load('/post');
assert.equal(result.statusCode, 200);
@@ -42,4 +42,4 @@ HMXMD('Can load markdown pages with hmx', async () => {
assert.ok($('#test').length, 'There is a div added via a component from markdown');
});
-HMXMD.run(); \ No newline at end of file
+Markdown.run(); \ No newline at end of file
diff --git a/test/fixtures/hmx-basic/astro.config.mjs b/test/fixtures/astro-basic/astro.config.mjs
index dbe6dc0ac..8219ada3a 100644
--- a/test/fixtures/hmx-basic/astro.config.mjs
+++ b/test/fixtures/astro-basic/astro.config.mjs
@@ -1,6 +1,6 @@
export default {
projectRoot: '.',
- hmxRoot: './astro',
+ astroRoot: './astro',
dist: './_site'
} \ No newline at end of file
diff --git a/test/fixtures/hmx-basic/astro/pages/index.hmx b/test/fixtures/astro-basic/astro/pages/index.astro
index d4f6fc5a1..d4f6fc5a1 100644
--- a/test/fixtures/hmx-basic/astro/pages/index.hmx
+++ b/test/fixtures/astro-basic/astro/pages/index.astro
diff --git a/test/fixtures/hmx-basic/snowpack.config.js b/test/fixtures/astro-basic/snowpack.config.js
index 2cbf0ef07..2cbf0ef07 100644
--- a/test/fixtures/hmx-basic/snowpack.config.js
+++ b/test/fixtures/astro-basic/snowpack.config.js
diff --git a/test/fixtures/hmx-markdown/astro.config.mjs b/test/fixtures/astro-markdown/astro.config.mjs
index 0f0be4b94..b9138b71f 100644
--- a/test/fixtures/hmx-markdown/astro.config.mjs
+++ b/test/fixtures/astro-markdown/astro.config.mjs
@@ -1,7 +1,7 @@
export default {
projectRoot: '.',
- hmxRoot: './astro',
+ astroRoot: './astro',
dist: './_site',
extensions: {
'.jsx': 'preact'
diff --git a/test/fixtures/hmx-markdown/astro/components/Example.jsx b/test/fixtures/astro-markdown/astro/components/Example.jsx
index 57bde3a95..57bde3a95 100644
--- a/test/fixtures/hmx-markdown/astro/components/Example.jsx
+++ b/test/fixtures/astro-markdown/astro/components/Example.jsx
diff --git a/test/fixtures/hmx-markdown/astro/layouts/content.hmx b/test/fixtures/astro-markdown/astro/layouts/content.astro
index 52f79400c..52f79400c 100644
--- a/test/fixtures/hmx-markdown/astro/layouts/content.hmx
+++ b/test/fixtures/astro-markdown/astro/layouts/content.astro
diff --git a/test/fixtures/hmx-markdown/astro/pages/index.hmx b/test/fixtures/astro-markdown/astro/pages/index.astro
index d4f6fc5a1..d4f6fc5a1 100644
--- a/test/fixtures/hmx-markdown/astro/pages/index.hmx
+++ b/test/fixtures/astro-markdown/astro/pages/index.astro
diff --git a/test/fixtures/hmx-markdown/astro/pages/post.md b/test/fixtures/astro-markdown/astro/pages/post.md
index 057b1febb..3a97cf4ec 100644
--- a/test/fixtures/hmx-markdown/astro/pages/post.md
+++ b/test/fixtures/astro-markdown/astro/pages/post.md
@@ -1,5 +1,5 @@
---
-layout: layouts/content.hmx
+layout: layouts/content.astro
title: My Blog Post
description: This is a post about some stuff.
import:
diff --git a/test/fixtures/hmx-markdown/snowpack.config.js b/test/fixtures/astro-markdown/snowpack.config.js
index 2cbf0ef07..2cbf0ef07 100644
--- a/test/fixtures/hmx-markdown/snowpack.config.js
+++ b/test/fixtures/astro-markdown/snowpack.config.js
diff --git a/test/fixtures/react-component/astro.config.mjs b/test/fixtures/react-component/astro.config.mjs
index 3a3006dd8..69595a18d 100644
--- a/test/fixtures/react-component/astro.config.mjs
+++ b/test/fixtures/react-component/astro.config.mjs
@@ -1,7 +1,7 @@
export default {
projectRoot: '.',
- hmxRoot: './astro',
+ astroRoot: './astro',
dist: './_site'
// No extensions needed, React is the default.
} \ No newline at end of file
diff --git a/test/fixtures/react-component/astro/pages/index.hmx b/test/fixtures/react-component/astro/pages/index.astro
index 5debf6380..5debf6380 100644
--- a/test/fixtures/react-component/astro/pages/index.hmx
+++ b/test/fixtures/react-component/astro/pages/index.astro
diff --git a/test/react-component.test.js b/test/react-component.test.js
index d901c62b0..df57fa7c6 100644
--- a/test/react-component.test.js
+++ b/test/react-component.test.js
@@ -32,7 +32,7 @@ React('No error creating the runtime', () => {
assert.equal(setupError, undefined);
});
-React('Can load hmx page', async () => {
+React('Can load page', async () => {
const result = await runtime.load('/');
assert.equal(result.statusCode, 200);
diff --git a/test/snowpack-integration.test.js b/test/snowpack-integration.test.js
index 033f5587d..ebe21f274 100644
--- a/test/snowpack-integration.test.js
+++ b/test/snowpack-integration.test.js
@@ -52,7 +52,7 @@ async function* allPageFiles(root) {
async function* allPages(root) {
for await (let fileURL of allPageFiles(root)) {
- let bare = fileURL.pathname.replace(/\.(hmx|md)$/, '').replace(/index$/, '');
+ let bare = fileURL.pathname.replace(/\.(astro|md)$/, '').replace(/index$/, '');
yield '/' + pathRelative(root.pathname, bare);
}