From 3c24faa8cab428b17ba2f8e083f5296b1b931fe1 Mon Sep 17 00:00:00 2001 From: Matthew Phillips Date: Wed, 24 Mar 2021 11:45:38 -0400 Subject: [PATCH] =?UTF-8?q?hmx=20=E2=98=9E=20astro=20(#22)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This changes all hmx files to astro files and updates all code to not reference hmx any more. --- examples/snowpack/astro.config.mjs | 2 +- .../components/{Banner.hmx => Banner.astro} | 0 .../astro/components/{Hero.hmx => Hero.astro} | 0 .../astro/components/{Menu.hmx => Menu.astro} | 0 .../astro/components/{Nav.hmx => Nav.astro} | 0 .../components/{Subnav.hmx => Subnav.astro} | 0 .../astro/layouts/{base.hmx => base.astro} | 4 ++-- ...ith-cover.hmx => content-with-cover.astro} | 6 ++--- .../layouts/{content.hmx => content.astro} | 6 ++--- .../astro/layouts/{main.hmx => main.astro} | 4 ++-- .../astro/layouts/{post.hmx => post.astro} | 2 +- .../astro/pages/{404.hmx => 404.astro} | 2 +- .../astro/pages/concepts/build-pipeline.md | 2 +- .../astro/pages/concepts/dev-server.md | 2 +- .../pages/concepts/hot-module-replacement.md | 2 +- .../pages/concepts/how-snowpack-works.md | 2 +- .../astro/pages/{guides.hmx => guides.astro} | 2 +- examples/snowpack/astro/pages/guides/babel.md | 2 +- .../astro/pages/guides/connecting-tools.md | 2 +- examples/snowpack/astro/pages/guides/hmr.md | 2 +- .../pages/guides/https-ssl-certificates.md | 2 +- examples/snowpack/astro/pages/guides/jest.md | 2 +- .../astro/pages/guides/optimize-and-bundle.md | 2 +- .../snowpack/astro/pages/guides/plugins.md | 2 +- .../snowpack/astro/pages/guides/postcss.md | 2 +- .../snowpack/astro/pages/guides/preact.md | 2 +- .../pages/guides/react-global-imports.md | 2 +- .../pages/guides/react-loadable-components.md | 2 +- .../snowpack/astro/pages/guides/routing.md | 2 +- examples/snowpack/astro/pages/guides/sass.md | 2 +- .../astro/pages/guides/server-side-render.md | 2 +- .../astro/pages/guides/streaming-imports.md | 2 +- .../astro/pages/guides/tailwind-css.md | 2 +- .../snowpack/astro/pages/guides/testing.md | 2 +- .../astro/pages/guides/upgrade-guide.md | 2 +- examples/snowpack/astro/pages/guides/vue.md | 2 +- examples/snowpack/astro/pages/guides/wasm.md | 2 +- .../astro/pages/guides/web-test-runner.md | 2 +- .../snowpack/astro/pages/guides/web-worker.md | 2 +- .../snowpack/astro/pages/guides/workbox.md | 2 +- .../astro/pages/{index.hmx => index.astro} | 6 ++--- .../astro/pages/{news.hmx => news.astro} | 2 +- .../pages/{plugins.hmx => plugins.astro} | 2 +- .../posts/2020-05-26-snowpack-2-0-release.md | 2 +- .../posts/2020-07-30-snowpack-2-7-release.md | 2 +- ...2020-12-03-snowpack-3-release-candidate.md | 2 +- .../pages/posts/2021-01-13-snowpack-3-0.md | 2 +- .../{[slug].hmx => [slug].astro} | 6 ++--- .../reference/cli-command-line-interface.md | 2 +- .../pages/reference/common-error-details.md | 2 +- .../astro/pages/reference/configuration.md | 2 +- .../pages/reference/environment-variables.md | 2 +- .../pages/reference/hot-module-replacement.md | 2 +- .../pages/reference/javascript-interface.md | 2 +- .../snowpack/astro/pages/reference/plugins.md | 2 +- .../astro/pages/reference/supported-files.md | 2 +- .../astro/pages/tutorials/getting-started.md | 2 +- .../astro/pages/tutorials/quick-start.md | 2 +- .../snowpack/astro/pages/tutorials/react.md | 2 +- .../snowpack/astro/pages/tutorials/svelte.md | 2 +- snowpack-plugin.cjs | 4 ++-- src/@types/astro.ts | 6 ++--- src/codegen/index.ts | 8 +++---- src/compiler/README.md | 2 +- src/compiler/parse/index.ts | 10 ++++----- src/config.ts | 2 +- src/dev.ts | 2 +- src/frontend/h.ts | 6 ++--- src/generate.ts | 10 ++++----- src/runtime.ts | 22 +++++++++---------- src/transform2.ts | 22 ++++++++++--------- ...{hmx-basic.test.js => astro-basic.test.js} | 6 ++--- ...arkdown.test.js => astro-markdown.test.js} | 14 ++++++------ .../astro.config.mjs | 2 +- .../astro/pages/index.astro} | 0 .../snowpack.config.js | 0 .../astro.config.mjs | 2 +- .../astro/components/Example.jsx | 0 .../astro/layouts/content.astro} | 0 .../astro/pages/index.astro} | 0 .../astro/pages/post.md | 2 +- .../snowpack.config.js | 0 .../fixtures/react-component/astro.config.mjs | 2 +- .../astro/pages/{index.hmx => index.astro} | 0 test/react-component.test.js | 2 +- test/snowpack-integration.test.js | 2 +- 86 files changed, 129 insertions(+), 127 deletions(-) rename examples/snowpack/astro/components/{Banner.hmx => Banner.astro} (100%) rename examples/snowpack/astro/components/{Hero.hmx => Hero.astro} (100%) rename examples/snowpack/astro/components/{Menu.hmx => Menu.astro} (100%) rename examples/snowpack/astro/components/{Nav.hmx => Nav.astro} (100%) rename examples/snowpack/astro/components/{Subnav.hmx => Subnav.astro} (100%) rename examples/snowpack/astro/layouts/{base.hmx => base.astro} (96%) rename examples/snowpack/astro/layouts/{content-with-cover.hmx => content-with-cover.astro} (90%) rename examples/snowpack/astro/layouts/{content.hmx => content.astro} (81%) rename examples/snowpack/astro/layouts/{main.hmx => main.astro} (76%) rename examples/snowpack/astro/layouts/{post.hmx => post.astro} (98%) rename examples/snowpack/astro/pages/{404.hmx => 404.astro} (83%) rename examples/snowpack/astro/pages/{guides.hmx => guides.astro} (97%) rename examples/snowpack/astro/pages/{index.hmx => index.astro} (97%) rename examples/snowpack/astro/pages/{news.hmx => news.astro} (98%) rename examples/snowpack/astro/pages/{plugins.hmx => plugins.astro} (96%) rename examples/snowpack/astro/pages/proof-of-concept-dynamic/{[slug].hmx => [slug].astro} (83%) rename test/{hmx-basic.test.js => astro-basic.test.js} (79%) rename test/{hmx-markdown.test.js => astro-markdown.test.js} (71%) rename test/fixtures/{hmx-basic => astro-basic}/astro.config.mjs (70%) rename test/fixtures/{hmx-basic/astro/pages/index.hmx => astro-basic/astro/pages/index.astro} (100%) rename test/fixtures/{hmx-basic => astro-basic}/snowpack.config.js (100%) rename test/fixtures/{hmx-markdown => astro-markdown}/astro.config.mjs (80%) rename test/fixtures/{hmx-markdown => astro-markdown}/astro/components/Example.jsx (100%) rename test/fixtures/{hmx-markdown/astro/layouts/content.hmx => astro-markdown/astro/layouts/content.astro} (100%) rename test/fixtures/{hmx-markdown/astro/pages/index.hmx => astro-markdown/astro/pages/index.astro} (100%) rename test/fixtures/{hmx-markdown => astro-markdown}/astro/pages/post.md (86%) rename test/fixtures/{hmx-markdown => astro-markdown}/snowpack.config.js (100%) rename test/fixtures/react-component/astro/pages/{index.hmx => index.astro} (100%) 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 similarity index 100% rename from examples/snowpack/astro/components/Banner.hmx rename to examples/snowpack/astro/components/Banner.astro diff --git a/examples/snowpack/astro/components/Hero.hmx b/examples/snowpack/astro/components/Hero.astro similarity index 100% rename from examples/snowpack/astro/components/Hero.hmx rename to examples/snowpack/astro/components/Hero.astro diff --git a/examples/snowpack/astro/components/Menu.hmx b/examples/snowpack/astro/components/Menu.astro similarity index 100% rename from examples/snowpack/astro/components/Menu.hmx rename to examples/snowpack/astro/components/Menu.astro diff --git a/examples/snowpack/astro/components/Nav.hmx b/examples/snowpack/astro/components/Nav.astro similarity index 100% rename from examples/snowpack/astro/components/Nav.hmx rename to examples/snowpack/astro/components/Nav.astro diff --git a/examples/snowpack/astro/components/Subnav.hmx b/examples/snowpack/astro/components/Subnav.astro similarity index 100% rename from examples/snowpack/astro/components/Subnav.hmx rename to examples/snowpack/astro/components/Subnav.astro diff --git a/examples/snowpack/astro/layouts/base.hmx b/examples/snowpack/astro/layouts/base.astro similarity index 96% rename from examples/snowpack/astro/layouts/base.hmx rename to 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 similarity index 90% rename from examples/snowpack/astro/layouts/content-with-cover.hmx rename to 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 similarity index 81% rename from examples/snowpack/astro/layouts/content.hmx rename to 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 similarity index 76% rename from examples/snowpack/astro/layouts/main.hmx rename to 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 similarity index 98% rename from examples/snowpack/astro/layouts/post.hmx rename to 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 similarity index 83% rename from examples/snowpack/astro/pages/404.hmx rename to 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 similarity index 97% rename from examples/snowpack/astro/pages/guides.hmx rename to 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 similarity index 97% rename from examples/snowpack/astro/pages/index.hmx rename to 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 similarity index 98% rename from examples/snowpack/astro/pages/news.hmx rename to 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 similarity index 96% rename from examples/snowpack/astro/pages/plugins.hmx rename to 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 similarity index 83% rename from examples/snowpack/astro/pages/proof-of-concept-dynamic/[slug].hmx rename to 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 } 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 { @@ -96,7 +96,7 @@ interface ComponentInfo { } const defaultExtensions: Readonly> = { - '.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