From f591150512903014461e4fa1be3bc53bd261af2f Mon Sep 17 00:00:00 2001 From: Erika <3019731+Princesseuh@users.noreply.github.com> Date: Thu, 4 Aug 2022 14:16:51 -0400 Subject: [PATCH 1/2] Audit examples templates (#3940) * basics, framework-alpine, framework-solid, delete unused examples * framework-multiple * Remove non-standard file extensions, add missing .vscode folders * Remove robots.txt * Remove blog-multiple-authors * Rewrite components comments to be consistent * Update lockfile * Remove unnecessary usage of SCSS in subpath example * Fix props weirdness in portfolio example * Remove Lit from `framework-multiple` for now * Misc fixes * Update lockfile * I'm in lockfile hell, send help --- examples/README.md | 1 - examples/basics/src/components/Card.astro | 4 +- examples/basics/src/pages/index.astro | 1 + examples/blog-multiple-authors/.gitignore | 19 --- examples/blog-multiple-authors/.npmrc | 2 - examples/blog-multiple-authors/.stackblitzrc | 6 - examples/blog-multiple-authors/README.md | 54 -------- .../blog-multiple-authors/astro.config.mjs | 9 -- examples/blog-multiple-authors/package.json | 19 --- .../blog-multiple-authors/public/favicon.ico | Bin 4286 -> 0 bytes .../public/images/chapter-01.jpg | Bin 153734 -> 0 bytes .../public/images/chapter-02.jpg | Bin 99769 -> 0 bytes .../public/images/chapter-03.jpg | Bin 168485 -> 0 bytes .../public/images/don.jpg | Bin 27833 -> 0 bytes .../public/images/sancho.jpg | Bin 28204 -> 0 bytes .../blog-multiple-authors/sandbox.config.json | 11 -- .../src/components/MainHead.astro | 49 -------- .../src/components/Nav.astro | 63 ---------- .../src/components/Pagination.astro | 44 ------- .../src/components/PostPreview.astro | 66 ---------- .../src/data/authors.json | 10 -- .../src/layouts/post.astro | 82 ------------- .../src/pages/about.astro | 74 ----------- .../src/pages/authors/[author].astro | 80 ------------ .../src/pages/index.astro | 45 ------- .../src/pages/post/chapter-i.md | 13 -- .../src/pages/post/chapter-ii.md | 15 --- .../src/pages/post/chapter-iii.md | 13 -- .../src/pages/posts/[...page].astro | 83 ------------- .../src/styles/global.css | 25 ---- examples/blog-multiple-authors/tsconfig.json | 15 --- examples/component/demo/public/robots.txt | 2 - examples/docs/src/components/HeadSEO.astro | 2 +- .../docs/src/components/Header/Header.astro | 10 +- .../components/LeftSidebar/LeftSidebar.astro | 4 +- .../components/PageContent/PageContent.astro | 2 +- .../components/RightSidebar/MoreMenu.astro | 2 +- .../RightSidebar/RightSidebar.astro | 2 +- .../.vscode/extensions.json | 0 .../{starter => env-vars}/.vscode/launch.json | 0 examples/env-vars/src/env.d.ts | 3 + .../framework-alpine/.vscode/extensions.json | 4 + examples/framework-alpine/.vscode/launch.json | 11 ++ examples/framework-alpine/package.json | 1 + .../src/components/Counter.astro | 9 +- .../framework-alpine/src/pages/index.astro | 1 - .../framework-lit/.vscode/extensions.json | 4 + examples/framework-lit/.vscode/launch.json | 11 ++ examples/framework-lit/public/robots.txt | 2 - examples/framework-lit/src/pages/index.astro | 3 + .../.vscode/extensions.json | 4 + .../framework-multiple/.vscode/launch.json | 11 ++ examples/framework-multiple/astro.config.mjs | 3 +- examples/framework-multiple/package.json | 3 - .../framework-multiple/src/components/A.astro | 3 - .../framework-multiple/src/components/B.astro | 3 - .../src/components/LitCounter.js | 33 ----- .../src/components/PreactCounter.tsx | 4 +- .../src/components/PreactSFC.tsx | 10 -- .../{ReactCounter.jsx => ReactCounter.tsx} | 2 +- .../src/components/SolidCounter.tsx | 4 +- .../src/components/SvelteCounter.svelte | 21 ++-- .../src/components/VueCounter.vue | 8 +- .../src/components/index.ts | 2 - .../framework-multiple/src/pages/index.astro | 26 ++-- examples/framework-multiple/tsconfig.json | 2 + .../framework-preact/.vscode/extensions.json | 4 + examples/framework-preact/.vscode/launch.json | 11 ++ .../framework-preact/src/pages/index.astro | 2 +- .../framework-react/.vscode/extensions.json | 4 + examples/framework-react/.vscode/launch.json | 11 ++ .../components/{Counter.jsx => Counter.tsx} | 4 +- .../framework-react/src/pages/index.astro | 2 +- .../framework-solid/.vscode/extensions.json | 4 + examples/framework-solid/.vscode/launch.json | 11 ++ .../components/{Counter.jsx => Counter.tsx} | 0 .../framework-solid/src/pages/index.astro | 8 +- .../framework-svelte/.vscode/extensions.json | 4 + examples/framework-svelte/.vscode/launch.json | 11 ++ .../src/components/Counter.svelte | 45 +++---- .../framework-vue/.vscode/extensions.json | 4 + examples/framework-vue/.vscode/launch.json | 11 ++ .../framework-vue/src/components/Counter.vue | 3 +- examples/framework-vue/tsconfig.json | 2 + examples/integrations-playground/.gitignore | 19 --- examples/integrations-playground/.npmrc | 2 - .../integrations-playground/.stackblitzrc | 6 - examples/integrations-playground/README.md | 7 -- .../integrations-playground/astro.config.mjs | 14 --- examples/integrations-playground/package.json | 31 ----- .../public/assets/logo.svg | 12 -- .../public/favicon.ico | Bin 4286 -> 0 bytes .../integrations-playground/public/robots.txt | 2 - .../sandbox.config.json | 11 -- .../src/components/Link.jsx | 6 - .../src/components/Lorem.astro | 115 ------------------ .../src/components/SolidCounter.jsx | 18 --- .../src/components/calc-add.js | 17 --- .../src/components/my-counter.js | 32 ----- .../src/pages/foo.astro | 15 --- .../src/pages/index.astro | 54 -------- .../integrations-playground/tsconfig.json | 15 --- .../non-html-pages/.vscode/extensions.json | 4 + examples/non-html-pages/.vscode/launch.json | 11 ++ examples/portfolio/src/pages/projects.astro | 4 - examples/ssr/.vscode/extensions.json | 4 + examples/ssr/.vscode/launch.json | 11 ++ examples/starter/.gitignore | 19 --- examples/starter/.npmrc | 2 - examples/starter/.stackblitzrc | 6 - examples/starter/README.md | 43 ------- examples/starter/astro.config.mjs | 4 - examples/starter/package.json | 14 --- examples/starter/public/favicon.ico | Bin 4286 -> 0 bytes examples/starter/public/logo.svg | 12 -- examples/starter/sandbox.config.json | 11 -- examples/starter/src/components/Logo.astro | 10 -- examples/starter/src/content/Tour.md | 28 ----- examples/starter/src/pages/index.astro | 86 ------------- examples/starter/src/styles/global.css | 29 ----- examples/starter/src/styles/home.css | 54 -------- examples/starter/tsconfig.json | 15 --- examples/subpath/package.json | 3 +- examples/subpath/public/robots.txt | 2 - examples/subpath/src/pages/index.astro | 5 +- examples/subpath/src/styles/main.css | 3 + examples/subpath/src/styles/main.scss | 5 - .../with-vite-plugin-pwa/public/robots.txt | 2 - packages/webapi/mod.d.ts | 2 +- pnpm-lock.yaml | 72 ++--------- 130 files changed, 273 insertions(+), 1720 deletions(-) delete mode 100644 examples/blog-multiple-authors/.gitignore delete mode 100644 examples/blog-multiple-authors/.npmrc delete mode 100644 examples/blog-multiple-authors/.stackblitzrc delete mode 100644 examples/blog-multiple-authors/README.md delete mode 100644 examples/blog-multiple-authors/astro.config.mjs delete mode 100644 examples/blog-multiple-authors/package.json delete mode 100644 examples/blog-multiple-authors/public/favicon.ico delete mode 100644 examples/blog-multiple-authors/public/images/chapter-01.jpg delete mode 100644 examples/blog-multiple-authors/public/images/chapter-02.jpg delete mode 100644 examples/blog-multiple-authors/public/images/chapter-03.jpg delete mode 100644 examples/blog-multiple-authors/public/images/don.jpg delete mode 100644 examples/blog-multiple-authors/public/images/sancho.jpg delete mode 100644 examples/blog-multiple-authors/sandbox.config.json delete mode 100644 examples/blog-multiple-authors/src/components/MainHead.astro delete mode 100644 examples/blog-multiple-authors/src/components/Nav.astro delete mode 100644 examples/blog-multiple-authors/src/components/Pagination.astro delete mode 100644 examples/blog-multiple-authors/src/components/PostPreview.astro delete mode 100644 examples/blog-multiple-authors/src/data/authors.json delete mode 100644 examples/blog-multiple-authors/src/layouts/post.astro delete mode 100644 examples/blog-multiple-authors/src/pages/about.astro delete mode 100644 examples/blog-multiple-authors/src/pages/authors/[author].astro delete mode 100644 examples/blog-multiple-authors/src/pages/index.astro delete mode 100644 examples/blog-multiple-authors/src/pages/post/chapter-i.md delete mode 100644 examples/blog-multiple-authors/src/pages/post/chapter-ii.md delete mode 100644 examples/blog-multiple-authors/src/pages/post/chapter-iii.md delete mode 100644 examples/blog-multiple-authors/src/pages/posts/[...page].astro delete mode 100644 examples/blog-multiple-authors/src/styles/global.css delete mode 100644 examples/blog-multiple-authors/tsconfig.json delete mode 100644 examples/component/demo/public/robots.txt rename examples/{starter => env-vars}/.vscode/extensions.json (100%) rename examples/{starter => env-vars}/.vscode/launch.json (100%) create mode 100644 examples/framework-alpine/.vscode/extensions.json create mode 100644 examples/framework-alpine/.vscode/launch.json create mode 100644 examples/framework-lit/.vscode/extensions.json create mode 100644 examples/framework-lit/.vscode/launch.json delete mode 100644 examples/framework-lit/public/robots.txt create mode 100644 examples/framework-multiple/.vscode/extensions.json create mode 100644 examples/framework-multiple/.vscode/launch.json delete mode 100644 examples/framework-multiple/src/components/A.astro delete mode 100644 examples/framework-multiple/src/components/B.astro delete mode 100644 examples/framework-multiple/src/components/LitCounter.js delete mode 100644 examples/framework-multiple/src/components/PreactSFC.tsx rename examples/framework-multiple/src/components/{ReactCounter.jsx => ReactCounter.tsx} (92%) delete mode 100644 examples/framework-multiple/src/components/index.ts create mode 100644 examples/framework-preact/.vscode/extensions.json create mode 100644 examples/framework-preact/.vscode/launch.json create mode 100644 examples/framework-react/.vscode/extensions.json create mode 100644 examples/framework-react/.vscode/launch.json rename examples/framework-react/src/components/{Counter.jsx => Counter.tsx} (84%) create mode 100644 examples/framework-solid/.vscode/extensions.json create mode 100644 examples/framework-solid/.vscode/launch.json rename examples/framework-solid/src/components/{Counter.jsx => Counter.tsx} (100%) create mode 100644 examples/framework-svelte/.vscode/extensions.json create mode 100644 examples/framework-svelte/.vscode/launch.json create mode 100644 examples/framework-vue/.vscode/extensions.json create mode 100644 examples/framework-vue/.vscode/launch.json delete mode 100644 examples/integrations-playground/.gitignore delete mode 100644 examples/integrations-playground/.npmrc delete mode 100644 examples/integrations-playground/.stackblitzrc delete mode 100644 examples/integrations-playground/README.md delete mode 100644 examples/integrations-playground/astro.config.mjs delete mode 100644 examples/integrations-playground/package.json delete mode 100644 examples/integrations-playground/public/assets/logo.svg delete mode 100644 examples/integrations-playground/public/favicon.ico delete mode 100644 examples/integrations-playground/public/robots.txt delete mode 100644 examples/integrations-playground/sandbox.config.json delete mode 100644 examples/integrations-playground/src/components/Link.jsx delete mode 100644 examples/integrations-playground/src/components/Lorem.astro delete mode 100644 examples/integrations-playground/src/components/SolidCounter.jsx delete mode 100644 examples/integrations-playground/src/components/calc-add.js delete mode 100644 examples/integrations-playground/src/components/my-counter.js delete mode 100644 examples/integrations-playground/src/pages/foo.astro delete mode 100644 examples/integrations-playground/src/pages/index.astro delete mode 100644 examples/integrations-playground/tsconfig.json create mode 100644 examples/non-html-pages/.vscode/extensions.json create mode 100644 examples/non-html-pages/.vscode/launch.json create mode 100644 examples/ssr/.vscode/extensions.json create mode 100644 examples/ssr/.vscode/launch.json delete mode 100644 examples/starter/.gitignore delete mode 100644 examples/starter/.npmrc delete mode 100644 examples/starter/.stackblitzrc delete mode 100644 examples/starter/README.md delete mode 100644 examples/starter/astro.config.mjs delete mode 100644 examples/starter/package.json delete mode 100644 examples/starter/public/favicon.ico delete mode 100644 examples/starter/public/logo.svg delete mode 100644 examples/starter/sandbox.config.json delete mode 100644 examples/starter/src/components/Logo.astro delete mode 100644 examples/starter/src/content/Tour.md delete mode 100644 examples/starter/src/pages/index.astro delete mode 100644 examples/starter/src/styles/global.css delete mode 100644 examples/starter/src/styles/home.css delete mode 100644 examples/starter/tsconfig.json delete mode 100644 examples/subpath/public/robots.txt create mode 100644 examples/subpath/src/styles/main.css delete mode 100644 examples/subpath/src/styles/main.scss delete mode 100644 examples/with-vite-plugin-pwa/public/robots.txt diff --git a/examples/README.md b/examples/README.md index e3e295b6d71c..50caa7f1801b 100644 --- a/examples/README.md +++ b/examples/README.md @@ -1,6 +1,5 @@ # Astro Examples Library - The easiest way to check out one of these examples on your machine is by running this command in an empty directory: ``` diff --git a/examples/basics/src/components/Card.astro b/examples/basics/src/components/Card.astro index 4039d4f4f84a..aea28c83f88e 100644 --- a/examples/basics/src/components/Card.astro +++ b/examples/basics/src/components/Card.astro @@ -4,7 +4,8 @@ export interface Props { body: string; href: string; } -const { href, title, body } = Astro.props; + +const { href, title, body } = Astro.props as Props; ---