diff --git a/.gitignore b/.gitignore index af615c7fe..489fc719a 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,6 @@ parser/ dist/ *.tsbuildinfo .DS_Store -test/fixtures/*/_site/ -www/_site +test/fixtures/*/dist/ +www/dist .vercel diff --git a/README.md b/README.md index 7b3c6257e..ae07926e1 100644 --- a/README.md +++ b/README.md @@ -40,9 +40,9 @@ export default { /** Where to resolve all URLs relative to. Useful if you have a monorepo project. */ projectRoot: '.', /** Path to Astro components, pages, and data */ - astroRoot: './astro', + astroRoot: './src', /** When running `astro build`, path to final static output */ - dist: './_site', + dist: './dist', /** A folder of static files Astro will copy to the root. Useful for favicons, images, and other files that don’t need processing. */ public: './public', /** Extension-specific handlings */ @@ -204,7 +204,7 @@ Then run: npm run build ``` -Now upload the contents of `/_site_` to your favorite static site host. +Now upload the contents of `/dist` to your favorite static site host. ## 📚 API diff --git a/docs/api.md b/docs/api.md index 95a522f3b..785f9a83b 100644 --- a/docs/api.md +++ b/docs/api.md @@ -17,9 +17,9 @@ The `Astro` global is available in all contexts in `.astro` files. It has the fo `Astro.fetchContent()` is a way to load local `*.md` files into your static site setup. You can either use this on its own, or within [Astro Collections][docs-collections]. ```jsx -// ./astro/components/my-component.astro +// ./src/components/my-component.astro --- -const data = Astro.fetchContent('../pages/post/*.md'); // returns an array of posts that live at ./astro/pages/post/*.md +const data = Astro.fetchContent('../pages/post/*.md'); // returns an array of posts that live at ./src/pages/post/*.md ---
diff --git a/docs/styling.md b/docs/styling.md index e5546e887..0688d2959 100644 --- a/docs/styling.md +++ b/docs/styling.md @@ -95,7 +95,7 @@ And also create a `tailwind.config.js` in your project root: module.exports = { mode: 'jit', - purge: ['./public/**/*.html', './astro/**/*.{astro,js,jsx,ts,tsx,vue}'], + purge: ['./public/**/*.html', './src/**/*.{astro,js,jsx,ts,tsx,vue}'], // more options here }; ``` diff --git a/examples/blog/.gitignore b/examples/blog/.gitignore index ca35be08d..1521c8b76 100644 --- a/examples/blog/.gitignore +++ b/examples/blog/.gitignore @@ -1 +1 @@ -_site +dist diff --git a/examples/blog/README.md b/examples/blog/README.md index 2cc988b7e..f1894ad62 100644 --- a/examples/blog/README.md +++ b/examples/blog/README.md @@ -20,4 +20,4 @@ Preview at `http://localhost:3000` npm build ``` -Will output static site at `./_site` +Will output static site at `./dist` diff --git a/examples/blog/astro/components/AuthorCard.astro b/examples/blog/src/components/AuthorCard.astro similarity index 100% rename from examples/blog/astro/components/AuthorCard.astro rename to examples/blog/src/components/AuthorCard.astro diff --git a/examples/blog/astro/components/Counter.jsx b/examples/blog/src/components/Counter.jsx similarity index 100% rename from examples/blog/astro/components/Counter.jsx rename to examples/blog/src/components/Counter.jsx diff --git a/examples/blog/astro/components/MainHead.astro b/examples/blog/src/components/MainHead.astro similarity index 100% rename from examples/blog/astro/components/MainHead.astro rename to examples/blog/src/components/MainHead.astro diff --git a/examples/blog/astro/components/Nav.astro b/examples/blog/src/components/Nav.astro similarity index 100% rename from examples/blog/astro/components/Nav.astro rename to examples/blog/src/components/Nav.astro diff --git a/examples/blog/astro/components/Pagination.astro b/examples/blog/src/components/Pagination.astro similarity index 100% rename from examples/blog/astro/components/Pagination.astro rename to examples/blog/src/components/Pagination.astro diff --git a/examples/blog/astro/components/PostPreview.astro b/examples/blog/src/components/PostPreview.astro similarity index 100% rename from examples/blog/astro/components/PostPreview.astro rename to examples/blog/src/components/PostPreview.astro diff --git a/examples/blog/astro/data/authors.json b/examples/blog/src/data/authors.json similarity index 100% rename from examples/blog/astro/data/authors.json rename to examples/blog/src/data/authors.json diff --git a/examples/blog/astro/layouts/post.astro b/examples/blog/src/layouts/post.astro similarity index 100% rename from examples/blog/astro/layouts/post.astro rename to examples/blog/src/layouts/post.astro diff --git a/examples/blog/astro/pages/$posts.astro b/examples/blog/src/pages/$posts.astro similarity index 100% rename from examples/blog/astro/pages/$posts.astro rename to examples/blog/src/pages/$posts.astro diff --git a/examples/blog/astro/pages/$tag.astro b/examples/blog/src/pages/$tag.astro similarity index 100% rename from examples/blog/astro/pages/$tag.astro rename to examples/blog/src/pages/$tag.astro diff --git a/examples/blog/astro/pages/index.astro b/examples/blog/src/pages/index.astro similarity index 100% rename from examples/blog/astro/pages/index.astro rename to examples/blog/src/pages/index.astro diff --git a/examples/blog/astro/pages/post/muppet-babies.md b/examples/blog/src/pages/post/muppet-babies.md similarity index 100% rename from examples/blog/astro/pages/post/muppet-babies.md rename to examples/blog/src/pages/post/muppet-babies.md diff --git a/examples/blog/astro/pages/post/muppet-treasure-island.md b/examples/blog/src/pages/post/muppet-treasure-island.md similarity index 100% rename from examples/blog/astro/pages/post/muppet-treasure-island.md rename to examples/blog/src/pages/post/muppet-treasure-island.md diff --git a/examples/blog/astro/pages/post/muppets-from-space.md b/examples/blog/src/pages/post/muppets-from-space.md similarity index 100% rename from examples/blog/astro/pages/post/muppets-from-space.md rename to examples/blog/src/pages/post/muppets-from-space.md diff --git a/examples/blog/astro/pages/post/muppets-most-wanted.md b/examples/blog/src/pages/post/muppets-most-wanted.md similarity index 100% rename from examples/blog/astro/pages/post/muppets-most-wanted.md rename to examples/blog/src/pages/post/muppets-most-wanted.md diff --git a/examples/blog/astro/pages/post/the-muppet-christmas-carol.md b/examples/blog/src/pages/post/the-muppet-christmas-carol.md similarity index 100% rename from examples/blog/astro/pages/post/the-muppet-christmas-carol.md rename to examples/blog/src/pages/post/the-muppet-christmas-carol.md diff --git a/examples/blog/astro/pages/post/the-muppet-show.md b/examples/blog/src/pages/post/the-muppet-show.md similarity index 100% rename from examples/blog/astro/pages/post/the-muppet-show.md rename to examples/blog/src/pages/post/the-muppet-show.md diff --git a/examples/blog/astro/pages/post/the-muppets.md b/examples/blog/src/pages/post/the-muppets.md similarity index 100% rename from examples/blog/astro/pages/post/the-muppets.md rename to examples/blog/src/pages/post/the-muppets.md diff --git a/examples/kitchen-sink/package-lock.json b/examples/kitchen-sink/package-lock.json index 1088d9907..1b50f9ea3 100644 --- a/examples/kitchen-sink/package-lock.json +++ b/examples/kitchen-sink/package-lock.json @@ -76,6 +76,7 @@ "version": "file:../..", "dev": true, "requires": { + "@babel/code-frame": "^7.12.13", "@babel/generator": "^7.13.9", "@babel/parser": "^7.13.15", "@babel/traverse": "^7.13.15", @@ -89,6 +90,7 @@ "es-module-lexer": "^0.4.1", "esbuild": "^0.10.1", "estree-walker": "^3.0.0", + "fast-xml-parser": "^3.19.0", "fdir": "^5.0.0", "find-up": "^5.0.0", "github-slugger": "^1.3.0", @@ -115,7 +117,7 @@ "rollup": "^2.43.1", "rollup-plugin-terser": "^7.0.2", "sass": "^1.32.8", - "snowpack": "^3.3.2", + "snowpack": "^3.3.4", "svelte": "^3.35.0", "tiny-glob": "^0.2.8", "unified": "^9.2.1", @@ -1984,6 +1986,12 @@ "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=" }, + "fast-xml-parser": { + "version": "3.19.0", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-3.19.0.tgz", + "integrity": "sha512-4pXwmBplsCPv8FOY1WRakF970TjNGnGnfbOnLqjlYvMiF1SR3yOHyxMR/YCXpPTOspNF5gwudqktIP4VsWkvBg==", + "dev": true + }, "fastq": { "version": "1.11.0", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.11.0.tgz", diff --git a/examples/kitchen-sink/astro/components/PreactCounter.tsx b/examples/kitchen-sink/src/components/PreactCounter.tsx similarity index 100% rename from examples/kitchen-sink/astro/components/PreactCounter.tsx rename to examples/kitchen-sink/src/components/PreactCounter.tsx diff --git a/examples/kitchen-sink/astro/components/ReactCounter.jsx b/examples/kitchen-sink/src/components/ReactCounter.jsx similarity index 100% rename from examples/kitchen-sink/astro/components/ReactCounter.jsx rename to examples/kitchen-sink/src/components/ReactCounter.jsx diff --git a/examples/kitchen-sink/astro/components/SvelteCounter.svelte b/examples/kitchen-sink/src/components/SvelteCounter.svelte similarity index 100% rename from examples/kitchen-sink/astro/components/SvelteCounter.svelte rename to examples/kitchen-sink/src/components/SvelteCounter.svelte diff --git a/examples/kitchen-sink/astro/components/VueCounter.vue b/examples/kitchen-sink/src/components/VueCounter.vue similarity index 100% rename from examples/kitchen-sink/astro/components/VueCounter.vue rename to examples/kitchen-sink/src/components/VueCounter.vue diff --git a/examples/kitchen-sink/astro/pages/index.astro b/examples/kitchen-sink/src/pages/index.astro similarity index 100% rename from examples/kitchen-sink/astro/pages/index.astro rename to examples/kitchen-sink/src/pages/index.astro diff --git a/examples/snowpack/.gitignore b/examples/snowpack/.gitignore index 888e5be06..8a882418f 100644 --- a/examples/snowpack/.gitignore +++ b/examples/snowpack/.gitignore @@ -1,4 +1,4 @@ .DS_Store build node_modules -_site \ No newline at end of file +dist diff --git a/examples/snowpack/astro.config.mjs b/examples/snowpack/astro.config.mjs index 5339e88ed..47fc0d32e 100644 --- a/examples/snowpack/astro.config.mjs +++ b/examples/snowpack/astro.config.mjs @@ -1,7 +1,7 @@ export default { projectRoot: '.', - astroRoot: './astro', - dist: './_site', + astroRoot: './src', + dist: './dist', public: './public', extensions: { '.jsx': 'preact', diff --git a/examples/snowpack/astro/components/Banner.astro b/examples/snowpack/src/components/Banner.astro similarity index 100% rename from examples/snowpack/astro/components/Banner.astro rename to examples/snowpack/src/components/Banner.astro diff --git a/examples/snowpack/astro/components/BaseHead.astro b/examples/snowpack/src/components/BaseHead.astro similarity index 100% rename from examples/snowpack/astro/components/BaseHead.astro rename to examples/snowpack/src/components/BaseHead.astro diff --git a/examples/snowpack/astro/components/BaseLayout.astro b/examples/snowpack/src/components/BaseLayout.astro similarity index 100% rename from examples/snowpack/astro/components/BaseLayout.astro rename to examples/snowpack/src/components/BaseLayout.astro diff --git a/examples/snowpack/astro/components/Card.css b/examples/snowpack/src/components/Card.css similarity index 100% rename from examples/snowpack/astro/components/Card.css rename to examples/snowpack/src/components/Card.css diff --git a/examples/snowpack/astro/components/Card.jsx b/examples/snowpack/src/components/Card.jsx similarity index 100% rename from examples/snowpack/astro/components/Card.jsx rename to examples/snowpack/src/components/Card.jsx diff --git a/examples/snowpack/astro/components/CompanyLogo.jsx b/examples/snowpack/src/components/CompanyLogo.jsx similarity index 100% rename from examples/snowpack/astro/components/CompanyLogo.jsx rename to examples/snowpack/src/components/CompanyLogo.jsx diff --git a/examples/snowpack/astro/components/ContentfulRichText.jsx b/examples/snowpack/src/components/ContentfulRichText.jsx similarity index 100% rename from examples/snowpack/astro/components/ContentfulRichText.jsx rename to examples/snowpack/src/components/ContentfulRichText.jsx diff --git a/examples/snowpack/astro/components/Hero.astro b/examples/snowpack/src/components/Hero.astro similarity index 100% rename from examples/snowpack/astro/components/Hero.astro rename to examples/snowpack/src/components/Hero.astro diff --git a/examples/snowpack/astro/components/MainLayout.astro b/examples/snowpack/src/components/MainLayout.astro similarity index 100% rename from examples/snowpack/astro/components/MainLayout.astro rename to examples/snowpack/src/components/MainLayout.astro diff --git a/examples/snowpack/astro/components/Menu.astro b/examples/snowpack/src/components/Menu.astro similarity index 100% rename from examples/snowpack/astro/components/Menu.astro rename to examples/snowpack/src/components/Menu.astro diff --git a/examples/snowpack/astro/components/Nav.astro b/examples/snowpack/src/components/Nav.astro similarity index 100% rename from examples/snowpack/astro/components/Nav.astro rename to examples/snowpack/src/components/Nav.astro diff --git a/examples/snowpack/astro/components/NewsAssets.svelte b/examples/snowpack/src/components/NewsAssets.svelte similarity index 100% rename from examples/snowpack/astro/components/NewsAssets.svelte rename to examples/snowpack/src/components/NewsAssets.svelte diff --git a/examples/snowpack/astro/components/NewsTitle.vue b/examples/snowpack/src/components/NewsTitle.vue similarity index 100% rename from examples/snowpack/astro/components/NewsTitle.vue rename to examples/snowpack/src/components/NewsTitle.vue diff --git a/examples/snowpack/astro/components/PluginSearchPage.jsx b/examples/snowpack/src/components/PluginSearchPage.jsx similarity index 100% rename from examples/snowpack/astro/components/PluginSearchPage.jsx rename to examples/snowpack/src/components/PluginSearchPage.jsx diff --git a/examples/snowpack/astro/components/PluginSearchPage.module.css b/examples/snowpack/src/components/PluginSearchPage.module.css similarity index 100% rename from examples/snowpack/astro/components/PluginSearchPage.module.css rename to examples/snowpack/src/components/PluginSearchPage.module.css diff --git a/examples/snowpack/astro/components/PokemonLookup.astro b/examples/snowpack/src/components/PokemonLookup.astro similarity index 100% rename from examples/snowpack/astro/components/PokemonLookup.astro rename to examples/snowpack/src/components/PokemonLookup.astro diff --git a/examples/snowpack/astro/components/Subnav.astro b/examples/snowpack/src/components/Subnav.astro similarity index 100% rename from examples/snowpack/astro/components/Subnav.astro rename to examples/snowpack/src/components/Subnav.astro diff --git a/examples/snowpack/astro/components/docsearch.js b/examples/snowpack/src/components/docsearch.js similarity index 100% rename from examples/snowpack/astro/components/docsearch.js rename to examples/snowpack/src/components/docsearch.js diff --git a/examples/snowpack/astro/components/index.ts b/examples/snowpack/src/components/index.ts similarity index 100% rename from examples/snowpack/astro/components/index.ts rename to examples/snowpack/src/components/index.ts diff --git a/examples/snowpack/astro/data/news.json b/examples/snowpack/src/data/news.json similarity index 100% rename from examples/snowpack/astro/data/news.json rename to examples/snowpack/src/data/news.json diff --git a/examples/snowpack/astro/data/users.json b/examples/snowpack/src/data/users.json similarity index 100% rename from examples/snowpack/astro/data/users.json rename to examples/snowpack/src/data/users.json diff --git a/examples/snowpack/astro/data/version.js b/examples/snowpack/src/data/version.js similarity index 100% rename from examples/snowpack/astro/data/version.js rename to examples/snowpack/src/data/version.js diff --git a/examples/snowpack/astro/layouts/content-with-cover.astro b/examples/snowpack/src/layouts/content-with-cover.astro similarity index 100% rename from examples/snowpack/astro/layouts/content-with-cover.astro rename to examples/snowpack/src/layouts/content-with-cover.astro diff --git a/examples/snowpack/astro/layouts/content.astro b/examples/snowpack/src/layouts/content.astro similarity index 100% rename from examples/snowpack/astro/layouts/content.astro rename to examples/snowpack/src/layouts/content.astro diff --git a/examples/snowpack/astro/layouts/post.astro b/examples/snowpack/src/layouts/post.astro similarity index 100% rename from examples/snowpack/astro/layouts/post.astro rename to examples/snowpack/src/layouts/post.astro diff --git a/examples/snowpack/astro/pages/404.astro b/examples/snowpack/src/pages/404.astro similarity index 100% rename from examples/snowpack/astro/pages/404.astro rename to examples/snowpack/src/pages/404.astro diff --git a/examples/snowpack/astro/pages/concepts/build-pipeline.md b/examples/snowpack/src/pages/concepts/build-pipeline.md similarity index 100% rename from examples/snowpack/astro/pages/concepts/build-pipeline.md rename to examples/snowpack/src/pages/concepts/build-pipeline.md diff --git a/examples/snowpack/astro/pages/concepts/dev-server.md b/examples/snowpack/src/pages/concepts/dev-server.md similarity index 100% rename from examples/snowpack/astro/pages/concepts/dev-server.md rename to examples/snowpack/src/pages/concepts/dev-server.md diff --git a/examples/snowpack/astro/pages/concepts/hot-module-replacement.md b/examples/snowpack/src/pages/concepts/hot-module-replacement.md similarity index 100% rename from examples/snowpack/astro/pages/concepts/hot-module-replacement.md rename to examples/snowpack/src/pages/concepts/hot-module-replacement.md diff --git a/examples/snowpack/astro/pages/concepts/how-snowpack-works.md b/examples/snowpack/src/pages/concepts/how-snowpack-works.md similarity index 100% rename from examples/snowpack/astro/pages/concepts/how-snowpack-works.md rename to examples/snowpack/src/pages/concepts/how-snowpack-works.md diff --git a/examples/snowpack/astro/pages/guides.astro b/examples/snowpack/src/pages/guides.astro similarity index 100% rename from examples/snowpack/astro/pages/guides.astro rename to examples/snowpack/src/pages/guides.astro diff --git a/examples/snowpack/astro/pages/guides/babel.md b/examples/snowpack/src/pages/guides/babel.md similarity index 100% rename from examples/snowpack/astro/pages/guides/babel.md rename to examples/snowpack/src/pages/guides/babel.md diff --git a/examples/snowpack/astro/pages/guides/connecting-tools.md b/examples/snowpack/src/pages/guides/connecting-tools.md similarity index 100% rename from examples/snowpack/astro/pages/guides/connecting-tools.md rename to examples/snowpack/src/pages/guides/connecting-tools.md diff --git a/examples/snowpack/astro/pages/guides/hmr.md b/examples/snowpack/src/pages/guides/hmr.md similarity index 100% rename from examples/snowpack/astro/pages/guides/hmr.md rename to examples/snowpack/src/pages/guides/hmr.md diff --git a/examples/snowpack/astro/pages/guides/https-ssl-certificates.md b/examples/snowpack/src/pages/guides/https-ssl-certificates.md similarity index 100% rename from examples/snowpack/astro/pages/guides/https-ssl-certificates.md rename to examples/snowpack/src/pages/guides/https-ssl-certificates.md diff --git a/examples/snowpack/astro/pages/guides/jest.md b/examples/snowpack/src/pages/guides/jest.md similarity index 100% rename from examples/snowpack/astro/pages/guides/jest.md rename to examples/snowpack/src/pages/guides/jest.md diff --git a/examples/snowpack/astro/pages/guides/optimize-and-bundle.md b/examples/snowpack/src/pages/guides/optimize-and-bundle.md similarity index 100% rename from examples/snowpack/astro/pages/guides/optimize-and-bundle.md rename to examples/snowpack/src/pages/guides/optimize-and-bundle.md diff --git a/examples/snowpack/astro/pages/guides/plugins.md b/examples/snowpack/src/pages/guides/plugins.md similarity index 100% rename from examples/snowpack/astro/pages/guides/plugins.md rename to examples/snowpack/src/pages/guides/plugins.md diff --git a/examples/snowpack/astro/pages/guides/postcss.md b/examples/snowpack/src/pages/guides/postcss.md similarity index 100% rename from examples/snowpack/astro/pages/guides/postcss.md rename to examples/snowpack/src/pages/guides/postcss.md diff --git a/examples/snowpack/astro/pages/guides/preact.md b/examples/snowpack/src/pages/guides/preact.md similarity index 100% rename from examples/snowpack/astro/pages/guides/preact.md rename to examples/snowpack/src/pages/guides/preact.md diff --git a/examples/snowpack/astro/pages/guides/react-global-imports.md b/examples/snowpack/src/pages/guides/react-global-imports.md similarity index 100% rename from examples/snowpack/astro/pages/guides/react-global-imports.md rename to examples/snowpack/src/pages/guides/react-global-imports.md diff --git a/examples/snowpack/astro/pages/guides/react-loadable-components.md b/examples/snowpack/src/pages/guides/react-loadable-components.md similarity index 100% rename from examples/snowpack/astro/pages/guides/react-loadable-components.md rename to examples/snowpack/src/pages/guides/react-loadable-components.md diff --git a/examples/snowpack/astro/pages/guides/routing.md b/examples/snowpack/src/pages/guides/routing.md similarity index 100% rename from examples/snowpack/astro/pages/guides/routing.md rename to examples/snowpack/src/pages/guides/routing.md diff --git a/examples/snowpack/astro/pages/guides/sass.md b/examples/snowpack/src/pages/guides/sass.md similarity index 100% rename from examples/snowpack/astro/pages/guides/sass.md rename to examples/snowpack/src/pages/guides/sass.md diff --git a/examples/snowpack/astro/pages/guides/server-side-render.md b/examples/snowpack/src/pages/guides/server-side-render.md similarity index 100% rename from examples/snowpack/astro/pages/guides/server-side-render.md rename to examples/snowpack/src/pages/guides/server-side-render.md diff --git a/examples/snowpack/astro/pages/guides/streaming-imports.md b/examples/snowpack/src/pages/guides/streaming-imports.md similarity index 100% rename from examples/snowpack/astro/pages/guides/streaming-imports.md rename to examples/snowpack/src/pages/guides/streaming-imports.md diff --git a/examples/snowpack/astro/pages/guides/tailwind-css.md b/examples/snowpack/src/pages/guides/tailwind-css.md similarity index 100% rename from examples/snowpack/astro/pages/guides/tailwind-css.md rename to examples/snowpack/src/pages/guides/tailwind-css.md diff --git a/examples/snowpack/astro/pages/guides/testing.md b/examples/snowpack/src/pages/guides/testing.md similarity index 100% rename from examples/snowpack/astro/pages/guides/testing.md rename to examples/snowpack/src/pages/guides/testing.md diff --git a/examples/snowpack/astro/pages/guides/upgrade-guide.md b/examples/snowpack/src/pages/guides/upgrade-guide.md similarity index 100% rename from examples/snowpack/astro/pages/guides/upgrade-guide.md rename to examples/snowpack/src/pages/guides/upgrade-guide.md diff --git a/examples/snowpack/astro/pages/guides/vue.md b/examples/snowpack/src/pages/guides/vue.md similarity index 100% rename from examples/snowpack/astro/pages/guides/vue.md rename to examples/snowpack/src/pages/guides/vue.md diff --git a/examples/snowpack/astro/pages/guides/wasm.md b/examples/snowpack/src/pages/guides/wasm.md similarity index 100% rename from examples/snowpack/astro/pages/guides/wasm.md rename to examples/snowpack/src/pages/guides/wasm.md diff --git a/examples/snowpack/astro/pages/guides/web-test-runner.md b/examples/snowpack/src/pages/guides/web-test-runner.md similarity index 100% rename from examples/snowpack/astro/pages/guides/web-test-runner.md rename to examples/snowpack/src/pages/guides/web-test-runner.md diff --git a/examples/snowpack/astro/pages/guides/web-worker.md b/examples/snowpack/src/pages/guides/web-worker.md similarity index 100% rename from examples/snowpack/astro/pages/guides/web-worker.md rename to examples/snowpack/src/pages/guides/web-worker.md diff --git a/examples/snowpack/astro/pages/guides/workbox.md b/examples/snowpack/src/pages/guides/workbox.md similarity index 100% rename from examples/snowpack/astro/pages/guides/workbox.md rename to examples/snowpack/src/pages/guides/workbox.md diff --git a/examples/snowpack/astro/pages/index.astro b/examples/snowpack/src/pages/index.astro similarity index 100% rename from examples/snowpack/astro/pages/index.astro rename to examples/snowpack/src/pages/index.astro diff --git a/examples/snowpack/astro/pages/news.astro b/examples/snowpack/src/pages/news.astro similarity index 100% rename from examples/snowpack/astro/pages/news.astro rename to examples/snowpack/src/pages/news.astro diff --git a/examples/snowpack/astro/pages/plugins.astro b/examples/snowpack/src/pages/plugins.astro similarity index 100% rename from examples/snowpack/astro/pages/plugins.astro rename to examples/snowpack/src/pages/plugins.astro diff --git a/examples/snowpack/astro/pages/posts/2020-05-26-snowpack-2-0-release.md b/examples/snowpack/src/pages/posts/2020-05-26-snowpack-2-0-release.md similarity index 100% rename from examples/snowpack/astro/pages/posts/2020-05-26-snowpack-2-0-release.md rename to examples/snowpack/src/pages/posts/2020-05-26-snowpack-2-0-release.md diff --git a/examples/snowpack/astro/pages/posts/2020-07-30-snowpack-2-7-release.md b/examples/snowpack/src/pages/posts/2020-07-30-snowpack-2-7-release.md similarity index 100% rename from examples/snowpack/astro/pages/posts/2020-07-30-snowpack-2-7-release.md rename to examples/snowpack/src/pages/posts/2020-07-30-snowpack-2-7-release.md diff --git a/examples/snowpack/astro/pages/posts/2020-12-03-snowpack-3-release-candidate.md b/examples/snowpack/src/pages/posts/2020-12-03-snowpack-3-release-candidate.md similarity index 100% rename from examples/snowpack/astro/pages/posts/2020-12-03-snowpack-3-release-candidate.md rename to examples/snowpack/src/pages/posts/2020-12-03-snowpack-3-release-candidate.md diff --git a/examples/snowpack/astro/pages/posts/2021-01-13-snowpack-3-0.md b/examples/snowpack/src/pages/posts/2021-01-13-snowpack-3-0.md similarity index 100% rename from examples/snowpack/astro/pages/posts/2021-01-13-snowpack-3-0.md rename to examples/snowpack/src/pages/posts/2021-01-13-snowpack-3-0.md diff --git a/examples/snowpack/astro/pages/proof-of-concept-dynamic/[slug].astro.ignore b/examples/snowpack/src/pages/proof-of-concept-dynamic/[slug].astro.ignore similarity index 100% rename from examples/snowpack/astro/pages/proof-of-concept-dynamic/[slug].astro.ignore rename to examples/snowpack/src/pages/proof-of-concept-dynamic/[slug].astro.ignore diff --git a/examples/snowpack/astro/pages/reference/cli-command-line-interface.md b/examples/snowpack/src/pages/reference/cli-command-line-interface.md similarity index 100% rename from examples/snowpack/astro/pages/reference/cli-command-line-interface.md rename to examples/snowpack/src/pages/reference/cli-command-line-interface.md diff --git a/examples/snowpack/astro/pages/reference/common-error-details.md b/examples/snowpack/src/pages/reference/common-error-details.md similarity index 100% rename from examples/snowpack/astro/pages/reference/common-error-details.md rename to examples/snowpack/src/pages/reference/common-error-details.md diff --git a/examples/snowpack/astro/pages/reference/configuration.md b/examples/snowpack/src/pages/reference/configuration.md similarity index 100% rename from examples/snowpack/astro/pages/reference/configuration.md rename to examples/snowpack/src/pages/reference/configuration.md diff --git a/examples/snowpack/astro/pages/reference/environment-variables.md b/examples/snowpack/src/pages/reference/environment-variables.md similarity index 100% rename from examples/snowpack/astro/pages/reference/environment-variables.md rename to examples/snowpack/src/pages/reference/environment-variables.md diff --git a/examples/snowpack/astro/pages/reference/hot-module-replacement.md b/examples/snowpack/src/pages/reference/hot-module-replacement.md similarity index 100% rename from examples/snowpack/astro/pages/reference/hot-module-replacement.md rename to examples/snowpack/src/pages/reference/hot-module-replacement.md diff --git a/examples/snowpack/astro/pages/reference/javascript-interface.md b/examples/snowpack/src/pages/reference/javascript-interface.md similarity index 100% rename from examples/snowpack/astro/pages/reference/javascript-interface.md rename to examples/snowpack/src/pages/reference/javascript-interface.md diff --git a/examples/snowpack/astro/pages/reference/plugins.md b/examples/snowpack/src/pages/reference/plugins.md similarity index 100% rename from examples/snowpack/astro/pages/reference/plugins.md rename to examples/snowpack/src/pages/reference/plugins.md diff --git a/examples/snowpack/astro/pages/reference/supported-files.md b/examples/snowpack/src/pages/reference/supported-files.md similarity index 100% rename from examples/snowpack/astro/pages/reference/supported-files.md rename to examples/snowpack/src/pages/reference/supported-files.md diff --git a/examples/snowpack/astro/pages/tutorials/getting-started.md b/examples/snowpack/src/pages/tutorials/getting-started.md similarity index 100% rename from examples/snowpack/astro/pages/tutorials/getting-started.md rename to examples/snowpack/src/pages/tutorials/getting-started.md diff --git a/examples/snowpack/astro/pages/tutorials/quick-start.md b/examples/snowpack/src/pages/tutorials/quick-start.md similarity index 100% rename from examples/snowpack/astro/pages/tutorials/quick-start.md rename to examples/snowpack/src/pages/tutorials/quick-start.md diff --git a/examples/snowpack/astro/pages/tutorials/react.md b/examples/snowpack/src/pages/tutorials/react.md similarity index 100% rename from examples/snowpack/astro/pages/tutorials/react.md rename to examples/snowpack/src/pages/tutorials/react.md diff --git a/examples/snowpack/astro/pages/tutorials/svelte.md b/examples/snowpack/src/pages/tutorials/svelte.md similarity index 100% rename from examples/snowpack/astro/pages/tutorials/svelte.md rename to examples/snowpack/src/pages/tutorials/svelte.md diff --git a/examples/tailwindcss/.gitignore b/examples/tailwindcss/.gitignore index ca35be08d..1521c8b76 100644 --- a/examples/tailwindcss/.gitignore +++ b/examples/tailwindcss/.gitignore @@ -1 +1 @@ -_site +dist diff --git a/examples/tailwindcss/README.md b/examples/tailwindcss/README.md index e16be0504..dd96562bd 100644 --- a/examples/tailwindcss/README.md +++ b/examples/tailwindcss/README.md @@ -20,4 +20,4 @@ Preview at `http://localhost:3000` npm build ``` -Will output static site at `./_site` +Will output static site at `./dist` diff --git a/examples/tailwindcss/astro/components/Button.astro b/examples/tailwindcss/src/components/Button.astro similarity index 100% rename from examples/tailwindcss/astro/components/Button.astro rename to examples/tailwindcss/src/components/Button.astro diff --git a/examples/tailwindcss/astro/pages/index.astro b/examples/tailwindcss/src/pages/index.astro similarity index 100% rename from examples/tailwindcss/astro/pages/index.astro rename to examples/tailwindcss/src/pages/index.astro diff --git a/examples/tailwindcss/tailwind.config.js b/examples/tailwindcss/tailwind.config.js index 279237052..9b380cc46 100644 --- a/examples/tailwindcss/tailwind.config.js +++ b/examples/tailwindcss/tailwind.config.js @@ -1,4 +1,4 @@ module.exports = { mode: 'jit', - purge: ['./public/**/*.html', './astro/**/*.{astro,js,jsx,ts,tsx,vue}'], + purge: ['./public/**/*.html', './src/**/*.{astro,js,jsx,ts,tsx,vue}'], }; diff --git a/src/config.ts b/src/config.ts index 5b77a3402..8f3ebaf5a 100644 --- a/src/config.ts +++ b/src/config.ts @@ -35,8 +35,8 @@ function configDefaults(userConfig?: any): any { const config: any = { ...(userConfig || {}) }; if (!config.projectRoot) config.projectRoot = '.'; - if (!config.astroRoot) config.astroRoot = './astro'; - if (!config.dist) config.dist = './_site'; + if (!config.astroRoot) config.astroRoot = './src'; + if (!config.dist) config.dist = './dist'; if (!config.public) config.public = './public'; if (!config.devOptions) config.devOptions = {}; if (!config.devOptions.port) config.devOptions.port = 3000; diff --git a/test/astro-markdown.test.js b/test/astro-markdown.test.js index 4d6a4f438..281243b49 100644 --- a/test/astro-markdown.test.js +++ b/test/astro-markdown.test.js @@ -34,7 +34,7 @@ Markdown.before(async () => { Markdown.after(async () => { (await runtime) && runtime.shutdown(); - rmdir(join(fixturePath, '_site'), { recursive: true }); + rmdir(join(fixturePath, 'dist'), { recursive: true }); }); Markdown('No errors creating a runtime', () => { @@ -62,10 +62,10 @@ Markdown('Can load more complex jsxy stuff', async () => { Markdown('Bundles client-side JS for prod', async () => { await build(astroConfig); - const complexHtml = await readFile(join(fixturePath, './_site/complex/index.html'), 'utf-8'); + const complexHtml = await readFile(join(fixturePath, './dist/complex/index.html'), 'utf-8'); assert.match(complexHtml, `import("/_astro/components/Counter.js"`); - assert.ok(existsSync(join(fixturePath, `./_site/_astro/components/Counter.js`)), 'Counter.jsx is bundled for prod'); + assert.ok(existsSync(join(fixturePath, `./dist/_astro/components/Counter.js`)), 'Counter.jsx is bundled for prod'); }); Markdown.run(); diff --git a/test/astro-rss.test.js b/test/astro-rss.test.js index 53a48f158..ed0d37818 100644 --- a/test/astro-rss.test.js +++ b/test/astro-rss.test.js @@ -13,14 +13,14 @@ const snapshot = ` del(path.join(fileURLToPath(cwd), '_site')); // clear _site output +const clear = () => del(path.join(fileURLToPath(cwd), 'dist')); // clear dist output RSS.before(() => clear()); RSS.after(() => clear()); RSS('Generates RSS correctly', async () => { execSync('node ../../../astro.mjs build', { cwd: fileURLToPath(cwd) }); - const rss = await fs.promises.readFile(path.join(fileURLToPath(cwd), '_site', 'feed', 'episodes.xml'), 'utf8'); + const rss = await fs.promises.readFile(path.join(fileURLToPath(cwd), 'dist', 'feed', 'episodes.xml'), 'utf8'); assert.match(rss, snapshot); }); diff --git a/test/astro-sitemap.test.js b/test/astro-sitemap.test.js index b2edd9312..dccaac326 100644 --- a/test/astro-sitemap.test.js +++ b/test/astro-sitemap.test.js @@ -12,14 +12,14 @@ const snapshot = `