From a800bf7ec1fc227710323bac4b94646afc4b7a79 Mon Sep 17 00:00:00 2001 From: Michael Rienstra Date: Fri, 16 Sep 2022 10:40:06 -0700 Subject: [PATCH] .md only: npm init astro --> npm create astro (#4760) * .md only: npm init astro --> npm create astro For consistency with https://github.com/withastro/docs/pull/360. Docs always use `npm create astro` (never `npm init astro`), README.md files in this repo should do the same. Search: `\b(npm|yarn|pnpm) init astro\b` Replace: `$1 create astro` Except for two instances: 1. `packages/create-astro/CHANGELOG.md` -- skipped because changelog. 2. `packages/create-astro/test/create-astro.test.js.skipped` -- skipped, old test disabled in https://github.com/withastro/astro/pull/3168. * docs: add `@latest` to `npm create astro` Co-authored-by: Bjorn Lu Co-authored-by: Michael Rienstra --- examples/README.md | 8 ++++---- examples/blog/README.md | 2 +- examples/component/README.md | 2 +- examples/docs/README.md | 2 +- examples/framework-alpine/README.md | 2 +- examples/framework-lit/README.md | 2 +- examples/framework-multiple/README.md | 2 +- examples/framework-preact/README.md | 2 +- examples/framework-react/README.md | 2 +- examples/framework-solid/README.md | 2 +- examples/framework-svelte/README.md | 2 +- examples/framework-vue/README.md | 2 +- examples/minimal/README.md | 2 +- examples/non-html-pages/README.md | 2 +- examples/portfolio/README.md | 2 +- examples/with-markdown-plugins/README.md | 2 +- examples/with-markdown-shiki/README.md | 2 +- examples/with-mdx/README.md | 2 +- examples/with-nanostores/README.md | 2 +- examples/with-tailwindcss/README.md | 2 +- examples/with-vite-plugin-pwa/README.md | 2 +- examples/with-vitest/README.md | 2 +- packages/create-astro/README.md | 12 ++++++------ 23 files changed, 31 insertions(+), 31 deletions(-) diff --git a/examples/README.md b/examples/README.md index 50caa7f18..ab0e5a6c0 100644 --- a/examples/README.md +++ b/examples/README.md @@ -3,19 +3,19 @@ The easiest way to check out one of these examples on your machine is by running this command in an empty directory: ``` -npm init astro -- --template [EXAMPLE_NAME] +npm create astro@latest -- --template [EXAMPLE_NAME] ``` ## Community Examples -Visit [awesome-astro](https://github.com/one-aalam/awesome-astro) for a full list of community examples. You can use `npm init astro` to check out any community examples: +Visit [awesome-astro](https://github.com/one-aalam/awesome-astro) for a full list of community examples. You can use `npm create astro@latest` to check out any community examples: ``` -npm init astro -- --template [GITHUB_USER]/[REPO_NAME] +npm create astro@latest -- --template [GITHUB_USER]/[REPO_NAME] ``` Paths to examples nested inside of a repo are also supported: ``` -npm init astro -- --template [GITHUB_USER]/[REPO_NAME]/path/to/example +npm create astro@latest -- --template [GITHUB_USER]/[REPO_NAME]/path/to/example ``` diff --git a/examples/blog/README.md b/examples/blog/README.md index 05d663f65..32934f6ef 100644 --- a/examples/blog/README.md +++ b/examples/blog/README.md @@ -1,7 +1,7 @@ # Astro Starter Kit: Blog ``` -npm init astro -- --template blog +npm create astro@latest -- --template blog ``` [![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/blog) diff --git a/examples/component/README.md b/examples/component/README.md index 2023a749e..91540eae4 100644 --- a/examples/component/README.md +++ b/examples/component/README.md @@ -3,7 +3,7 @@ This is a template for an Astro component library. Use this template for writing components to use in multiple projects or publish to NPM. ``` -npm init astro -- --template component +npm create astro@latest -- --template component ``` [![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/non-html-pages) diff --git a/examples/docs/README.md b/examples/docs/README.md index b88fb0808..68bed033c 100644 --- a/examples/docs/README.md +++ b/examples/docs/README.md @@ -1,7 +1,7 @@ # Astro Starter Kit: Docs Site ```bash -npm init astro -- --template docs +npm create astro@latest -- --template docs ``` [![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/docs) diff --git a/examples/framework-alpine/README.md b/examples/framework-alpine/README.md index d15834999..b87682b77 100644 --- a/examples/framework-alpine/README.md +++ b/examples/framework-alpine/README.md @@ -1,7 +1,7 @@ # Astro + AlpineJS Example ``` -npm init astro -- --template framework-alpine +npm create astro@latest -- --template framework-alpine ``` [![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/framework-alpine) diff --git a/examples/framework-lit/README.md b/examples/framework-lit/README.md index 168022b53..5f84b5db5 100644 --- a/examples/framework-lit/README.md +++ b/examples/framework-lit/README.md @@ -1,7 +1,7 @@ # Astro + Lit Example ``` -npm init astro -- --template framework-lit +npm create astro@latest -- --template framework-lit ``` [![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/framework-lit) diff --git a/examples/framework-multiple/README.md b/examples/framework-multiple/README.md index 66258aed9..dc3e6d3de 100644 --- a/examples/framework-multiple/README.md +++ b/examples/framework-multiple/README.md @@ -1,7 +1,7 @@ # Kitchen Sink: Microfrontends with Astro ``` -npm init astro -- --template framework-multiple +npm create astro@latest -- --template framework-multiple ``` [![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/framework-multiple) diff --git a/examples/framework-preact/README.md b/examples/framework-preact/README.md index d5396fcdd..2ba528e71 100644 --- a/examples/framework-preact/README.md +++ b/examples/framework-preact/README.md @@ -1,7 +1,7 @@ # Astro + Preact Example ``` -npm init astro -- --template framework-preact +npm create astro@latest -- --template framework-preact ``` [![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/framework-preact) diff --git a/examples/framework-react/README.md b/examples/framework-react/README.md index b82e192a6..1bcf52dcb 100644 --- a/examples/framework-react/README.md +++ b/examples/framework-react/README.md @@ -1,7 +1,7 @@ # Astro + React Example ``` -npm init astro -- --template framework-react +npm create astro@latest -- --template framework-react ``` [![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/framework-react) diff --git a/examples/framework-solid/README.md b/examples/framework-solid/README.md index 7df3b5848..932ef0699 100644 --- a/examples/framework-solid/README.md +++ b/examples/framework-solid/README.md @@ -1,7 +1,7 @@ # Astro + Solid.js Example ``` -npm init astro -- --template framework-solid +npm create astro@latest -- --template framework-solid ``` [![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/framework-solid) diff --git a/examples/framework-svelte/README.md b/examples/framework-svelte/README.md index 20927e031..6ef399f48 100644 --- a/examples/framework-svelte/README.md +++ b/examples/framework-svelte/README.md @@ -1,7 +1,7 @@ # Astro + Svelte Example ``` -npm init astro -- --template framework-svelte +npm create astro@latest -- --template framework-svelte ``` [![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/framework-svelte) diff --git a/examples/framework-vue/README.md b/examples/framework-vue/README.md index 95acfffde..34761e72f 100644 --- a/examples/framework-vue/README.md +++ b/examples/framework-vue/README.md @@ -1,7 +1,7 @@ # Astro + Vue Example ``` -npm init astro -- --template framework-vue +npm create astro@latest -- --template framework-vue ``` [![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/framework-vue) diff --git a/examples/minimal/README.md b/examples/minimal/README.md index 62b3f469b..da4f712f6 100644 --- a/examples/minimal/README.md +++ b/examples/minimal/README.md @@ -1,7 +1,7 @@ # Astro Starter Kit: Minimal ``` -npm init astro -- --template minimal +npm create astro@latest -- --template minimal ``` [![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/minimal) diff --git a/examples/non-html-pages/README.md b/examples/non-html-pages/README.md index 571916240..8419813db 100644 --- a/examples/non-html-pages/README.md +++ b/examples/non-html-pages/README.md @@ -5,7 +5,7 @@ Documentation for "Non-HTML Pages": https://docs.astro.build/en/core-concepts/astro-pages/#non-html-pages ``` -npm init astro -- --template non-html-pages +npm create astro@latest -- --template non-html-pages ``` [![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/non-html-pages) diff --git a/examples/portfolio/README.md b/examples/portfolio/README.md index 234bc15b1..68d211132 100644 --- a/examples/portfolio/README.md +++ b/examples/portfolio/README.md @@ -1,7 +1,7 @@ # Astro Starter Kit: Portfolio ``` -npm init astro -- --template portfolio +npm create astro@latest -- --template portfolio ``` [![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/portfolio) diff --git a/examples/with-markdown-plugins/README.md b/examples/with-markdown-plugins/README.md index b1d3f3b38..2d0b359bd 100644 --- a/examples/with-markdown-plugins/README.md +++ b/examples/with-markdown-plugins/README.md @@ -1,7 +1,7 @@ # Astro Example: Markdown with Plugins ``` -npm init astro -- --template with-markdown-plugins +npm create astro@latest -- --template with-markdown-plugins ``` [![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/with-markdown-plugins) diff --git a/examples/with-markdown-shiki/README.md b/examples/with-markdown-shiki/README.md index 2c39f9334..83596fa5f 100644 --- a/examples/with-markdown-shiki/README.md +++ b/examples/with-markdown-shiki/README.md @@ -1,7 +1,7 @@ # Astro Example: Markdown with Shiki ``` -npm init astro -- --template with-markdown-shiki +npm create astro@latest -- --template with-markdown-shiki ``` [![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/with-markdown-shiki) diff --git a/examples/with-mdx/README.md b/examples/with-mdx/README.md index 1a13dcdcc..8930cd95f 100644 --- a/examples/with-mdx/README.md +++ b/examples/with-mdx/README.md @@ -1,7 +1,7 @@ # Astro Example: MDX ``` -npm init astro -- --template with-mdx +npm create astro@latest -- --template with-mdx ``` [![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/with-mdx) diff --git a/examples/with-nanostores/README.md b/examples/with-nanostores/README.md index e5070d816..c8851fad1 100644 --- a/examples/with-nanostores/README.md +++ b/examples/with-nanostores/README.md @@ -1,7 +1,7 @@ # Astro Example: Nanostores ``` -npm init astro -- --template with-nanostores +npm create astro@latest -- --template with-nanostores ``` [![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/with-nanostores) diff --git a/examples/with-tailwindcss/README.md b/examples/with-tailwindcss/README.md index 16270da54..896727736 100644 --- a/examples/with-tailwindcss/README.md +++ b/examples/with-tailwindcss/README.md @@ -1,7 +1,7 @@ # Astro with Tailwind ``` -npm init astro -- --template with-tailwindcss +npm create astro@latest -- --template with-tailwindcss ``` [![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/with-tailwindcss) diff --git a/examples/with-vite-plugin-pwa/README.md b/examples/with-vite-plugin-pwa/README.md index 3b5b359b0..4b5d54f95 100644 --- a/examples/with-vite-plugin-pwa/README.md +++ b/examples/with-vite-plugin-pwa/README.md @@ -1,7 +1,7 @@ # Astro Starter Kit: Vite PWA ``` -npm init astro -- --template with-vite-plugin-pwa +npm create astro@latest -- --template with-vite-plugin-pwa ``` [![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/with-vite-plugin-pwa) diff --git a/examples/with-vitest/README.md b/examples/with-vitest/README.md index 8f1f2e6a0..97a375dda 100644 --- a/examples/with-vitest/README.md +++ b/examples/with-vitest/README.md @@ -1,7 +1,7 @@ # Astro + [Vitest](https://vitest.dev/) Example ``` -npm init astro -- --template with-vitest +npm create astro@latest -- --template with-vitest ``` [![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/with-vitest) diff --git a/packages/create-astro/README.md b/packages/create-astro/README.md index 80a0da093..d8dca6c24 100644 --- a/packages/create-astro/README.md +++ b/packages/create-astro/README.md @@ -5,7 +5,7 @@ **With NPM:** ```bash -npm init astro +npm create astro@latest ``` **With Yarn:** @@ -18,10 +18,10 @@ yarn create astro ```bash # npm 6.x -npm init astro my-astro-project --template starter +npm create astro@latest my-astro-project --template starter # npm 7+, extra double-dash is needed: -npm init astro my-astro-project -- --template starter +npm create astro@latest my-astro-project -- --template starter # yarn yarn create astro my-astro-project --template starter @@ -31,7 +31,7 @@ yarn create astro my-astro-project --template starter You can also use any GitHub repo as a template: ```bash -npm init astro my-astro-project -- --template cassidoo/shopify-react-astro +npm create astro@latest my-astro-project -- --template cassidoo/shopify-react-astro ``` ### CLI Flags @@ -49,10 +49,10 @@ To debug `create-astro`, you can use the `--verbose` flag which will log the out ```bash # npm 6.x -npm init astro my-astro-project --verbose +npm create astro@latest my-astro-project --verbose # npm 7+, extra double-dash is needed: -npm init astro my-astro-project -- --verbose +npm create astro@latest my-astro-project -- --verbose # yarn yarn create astro my-astro-project --verbose