feat: npm init docusaurus, yarn create docusaurus (#5635)

* initial create-docusaurus impl

* cleanup

* @docusaurus/init renamed to create-docusaurus

* 0.0.6

* update lockfile

* fix lint

* remove npm2yarn for "npm init" because npm2yarn doesn't convert it and yarn result fails to execute

* prettier

* add correct version

* prettier

* prettier

* prettier

* prettier

* fix annoying --config .prettierrc issue
This commit is contained in:
Sébastien Lorber 2021-10-07 16:06:42 +02:00 committed by GitHub
parent e1b4da04fe
commit f6ec757aa0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
102 changed files with 80 additions and 93 deletions

View file

@ -51,7 +51,7 @@ The end result can be seen at [docusaurus-crowdin-example.netlify.app](https://d
Initialize a new Docusaurus site:
```bash
npx @docusaurus/init@latest init website classic
npm init docusaurus@latest website classic
```
Add the site configuration for the French language:

View file

@ -39,7 +39,7 @@ This is a walk-through of using Git to translate a newly initialized English Doc
Initialize a new Docusaurus site:
```bash
npx @docusaurus/init@latest init website classic
npm init docusaurus@latest website classic
```
Add the site configuration for the French language:

View file

@ -8,7 +8,7 @@ This tutorial will walk you through the basis of the **Docusaurus i18n system**.
We will add **French** translations to a **newly initialized English Docusaurus website**.
Initialize a new site with `npx @docusaurus/init@latest init website classic` (like [this one](https://github.com/facebook/docusaurus/tree/main/examples/classic)).
Initialize a new site with `npm init docusaurus@latest website classic` (like [this one](https://github.com/facebook/docusaurus/tree/main/examples/classic)).
## Configure your site {#configure-your-site}

View file

@ -23,33 +23,33 @@ Use **[docusaurus.new](https://docusaurus.new)** to test Docusaurus immediately
The easiest way to install Docusaurus is to use the command line tool that helps you scaffold a skeleton Docusaurus website. You can run this command anywhere in a new empty repository or within an existing repository, it will create a new directory containing the scaffolded files.
```bash
npx @docusaurus/init@latest init [name] [template]
npm init docusaurus@latest [name] [template]
```
Example:
```bash
npx @docusaurus/init@latest init my-website classic
npm init docusaurus@latest website classic
```
If you do not specify `name` or `template`, it will prompt you for them. We recommend the `classic` template so that you can get started quickly and it contains features found in Docusaurus 1. The `classic` template contains `@docusaurus/preset-classic` which includes standard documentation, a blog, custom pages, and a CSS framework (with dark mode support). You can get up and running extremely quickly with the classic template and customize things later on when you have gained more familiarity with Docusaurus.
If you do not specify `name` or `template`, it will prompt you for them. We recommend the `classic` template so that you can get started quickly, and it contains features found in Docusaurus 1. The `classic` template contains `@docusaurus/preset-classic` which includes standard documentation, a blog, custom pages, and a CSS framework (with dark mode support). You can get up and running extremely quickly with the classic template and customize things later on when you have gained more familiarity with Docusaurus.
**[FB-Only]:** If you are setting up a new Docusaurus website for a Facebook open source project, use the `facebook` template instead, which comes with some useful Facebook-specific defaults:
```bash
npx @docusaurus/init@latest init my-website facebook
npm init docusaurus@latest my-website facebook
```
If you want to skip installing dependencies, use the `--skip-install` option, like the following:
```bash
npx @docusaurus/init@latest init my-website classic --skip-install
npm init docusaurus@latest my-website classic --skip-install
```
You can also use the template's TypeScript variant by passing the `--typescript` flag.
```bash
npx @docusaurus/init@latest init my-website classic --typescript
npm init docusaurus@latest my-website classic --typescript
```
## Project structure {#project-structure}

View file

@ -26,7 +26,7 @@ Create a new Docusaurus site and follow the **very short** embedded tutorial.
Install [Node.js](https://nodejs.org/en/download/) and create a new Docusaurus site:
```bash
npx @docusaurus/init@latest init my-website classic
npm init docusaurus@latest my-website classic
```
Start the site:

View file

@ -122,7 +122,7 @@ yarn-error.log*
### `README` {#readme}
The D1 website may have an existing README file. You can modify it to reflect the D2 changes, or copy the default [Docusaurus v2 README](https://github.com/facebook/docusaurus/blob/main/packages/docusaurus-init/templates/classic/README.md).
The D1 website may have an existing README file. You can modify it to reflect the D2 changes, or copy the default [Docusaurus v2 README](https://github.com/facebook/docusaurus/blob/main/packages/create-docusaurus/templates/classic/README.md).
## Site configurations {#site-configurations}

View file

@ -10,7 +10,7 @@ Docusaurus is written in TypeScript, and provides first-class TypeScript support
Docusaurus supports writing and using TypeScript theme components. If the init template provides a Typescript variant, you can directly initialize a site with full TypeScript support by using the `--typescript` flag.
```bash
npx @docusaurus/init@latest init my-website classic --typescript
npm init docusaurus@latest my-website classic --typescript
```
Below are some guides on how to migrate an existing project to TypeScript.

View file

@ -51,7 +51,7 @@ The end result can be seen at [docusaurus-crowdin-example.netlify.app](https://d
Initialize a new Docusaurus site:
```bash
npx @docusaurus/init@latest init website classic
npm init docusaurus@latest website classic
```
Add the site configuration for the French language:

View file

@ -39,7 +39,7 @@ This is a walk-through of using Git to translate a newly initialized English Doc
Initialize a new Docusaurus site:
```bash
npx @docusaurus/init@latest init website classic
npm init docusaurus@latest website classic
```
Add the site configuration for the French language:

View file

@ -8,7 +8,7 @@ This tutorial will walk you through the basis of the **Docusaurus i18n system**.
We will add **French** translations to a **newly initialized English Docusaurus website**.
Initialize a new site with `npx @docusaurus/init@latest init website classic` (like [this one](https://github.com/facebook/docusaurus/tree/main/examples/classic)).
Initialize a new site with `npm init docusaurus@latest website classic` (like [this one](https://github.com/facebook/docusaurus/tree/main/examples/classic)).
## Configure your site {#configure-your-site}

View file

@ -23,13 +23,13 @@ Use **[docusaurus.new](https://docusaurus.new)** to test Docusaurus immediately
The easiest way to install Docusaurus is to use the command line tool that helps you scaffold a skeleton Docusaurus website. You can run this command anywhere in a new empty repository or within an existing repository, it will create a new directory containing the scaffolded files.
```bash
npx @docusaurus/init@latest init [name] [template]
npm init docusaurus@latest [name] [template]
```
Example:
```bash
npx @docusaurus/init@latest init my-website classic
npm init docusaurus@latest my-website classic
```
If you do not specify `name` or `template`, it will prompt you for them. We recommend the `classic` template so that you can get started quickly and it contains features found in Docusaurus 1. The `classic` template contains `@docusaurus/preset-classic` which includes standard documentation, a blog, custom pages, and a CSS framework (with dark mode support). You can get up and running extremely quickly with the classic template and customize things later on when you have gained more familiarity with Docusaurus.
@ -37,25 +37,25 @@ If you do not specify `name` or `template`, it will prompt you for them. We reco
**[FB-Only]:** If you are setting up a new Docusaurus website for a Facebook open source project, use the `facebook` template instead, which comes with some useful Facebook-specific defaults:
```bash
npx @docusaurus/init@latest init my-website facebook
npm init docusaurus@latest my-website facebook
```
**[Experimental]:** If you want setting up a new website using [bootstrap](https://getbootstrap.com/), use the `bootstrap` template, like the following:
```bash
npx @docusaurus/init@latest init my-website bootstrap
npm init docusaurus@latest my-website bootstrap
```
If you want to skip installing dependencies, use the `--skip-install` option, like the following:
```bash
npx @docusaurus/init@latest init my-website classic --skip-install
npm init docusaurus@latest my-website classic --skip-install
```
You can also use the template's TypeScript variant by passing the `--typescript` flag.
```bash
npx @docusaurus/init@latest init my-website classic --typescript
npm init docusaurus@latest my-website classic --typescript
```
## Project structure {#project-structure}

View file

@ -26,7 +26,7 @@ Create a new Docusaurus site and follow the **very short** embedded tutorial.
Install [Node.js](https://nodejs.org/en/download/) and create a new Docusaurus site:
```bash
npx @docusaurus/init@latest init my-website classic
npm init docusaurus@latest my-website classic
```
Start the site:

View file

@ -122,7 +122,7 @@ yarn-error.log*
### `README` {#readme}
The D1 website may have an existing README file. You can modify it to reflect the D2 changes, or copy the default [Docusaurus v2 README](https://github.com/facebook/docusaurus/blob/main/packages/docusaurus-init/templates/classic/README.md).
The D1 website may have an existing README file. You can modify it to reflect the D2 changes, or copy the default [Docusaurus v2 README](https://github.com/facebook/docusaurus/blob/main/packages/create-docusaurus/templates/classic/README.md).
## Site configurations {#site-configurations}

View file

@ -10,7 +10,7 @@ Docusaurus is written in TypeScript, and provide first-class TypeScript support.
Docusaurus supports writing and using TypeScript theme components. If the init template provides a Typescript variant, you can directly initialize a site with full TypeScript support by using the `--typescript` flag.
```bash
npx @docusaurus/init@latest init my-website classic --typescript
npm init docusaurus@latest my-website classic --typescript
```
Below are some guides on how to migrate an existing project to TypeScript.

View file

@ -51,7 +51,7 @@ The end result can be seen at [docusaurus-crowdin-example.netlify.app](https://d
Initialize a new Docusaurus site:
```bash
npx @docusaurus/init@latest init website classic
npm init docusaurus@latest website classic
```
Add the site configuration for the French language:

View file

@ -39,7 +39,7 @@ This is a walk-through of using Git to translate a newly initialized English Doc
Initialize a new Docusaurus site:
```bash
npx @docusaurus/init@latest init website classic
npm init docusaurus@latest website classic
```
Add the site configuration for the French language:

View file

@ -8,7 +8,7 @@ This tutorial will walk you through the basis of the **Docusaurus i18n system**.
We will add **French** translations to a **newly initialized English Docusaurus website**.
Initialize a new site with `npx @docusaurus/init@latest init website classic` (like [this one](https://github.com/facebook/docusaurus/tree/main/examples/classic)).
Initialize a new site with `npm init docusaurus@latest website classic` (like [this one](https://github.com/facebook/docusaurus/tree/main/examples/classic)).
## Configure your site {#configure-your-site}

View file

@ -23,13 +23,13 @@ Use **[docusaurus.new](https://docusaurus.new)** to test Docusaurus immediately
The easiest way to install Docusaurus is to use the command line tool that helps you scaffold a skeleton Docusaurus website. You can run this command anywhere in a new empty repository or within an existing repository, it will create a new directory containing the scaffolded files.
```bash
npx @docusaurus/init@latest init [name] [template]
npm init docusaurus@latest [name] [template]
```
Example:
```bash
npx @docusaurus/init@latest init my-website classic
npm init docusaurus@latest my-website classic
```
If you do not specify `name` or `template`, it will prompt you for them. We recommend the `classic` template so that you can get started quickly and it contains features found in Docusaurus 1. The `classic` template contains `@docusaurus/preset-classic` which includes standard documentation, a blog, custom pages, and a CSS framework (with dark mode support). You can get up and running extremely quickly with the classic template and customize things later on when you have gained more familiarity with Docusaurus.
@ -37,25 +37,25 @@ If you do not specify `name` or `template`, it will prompt you for them. We reco
**[FB-Only]:** If you are setting up a new Docusaurus website for a Facebook open source project, use the `facebook` template instead, which comes with some useful Facebook-specific defaults:
```bash
npx @docusaurus/init@latest init my-website facebook
npm init docusaurus@latest my-website facebook
```
**[Experimental]:** If you want setting up a new website using [bootstrap](https://getbootstrap.com/), use the `bootstrap` template, like the following:
```bash
npx @docusaurus/init@latest init my-website bootstrap
npm init docusaurus@latest my-website bootstrap
```
If you want to skip installing dependencies, use the `--skip-install` option, like the following:
```bash
npx @docusaurus/init@latest init my-website classic --skip-install
npm init docusaurus@latest my-website classic --skip-install
```
You can also use the template's TypeScript variant by passing the `--typescript` flag.
```bash
npx @docusaurus/init@latest init my-website classic --typescript
npm init docusaurus@latest my-website classic --typescript
```
## Project structure {#project-structure}

View file

@ -26,7 +26,7 @@ Create a new Docusaurus site and follow the **very short** embedded tutorial.
Install [Node.js](https://nodejs.org/en/download/) and create a new Docusaurus site:
```bash
npx @docusaurus/init@latest init my-website classic
npm init docusaurus@latest my-website classic
```
Start the site:

View file

@ -122,7 +122,7 @@ yarn-error.log*
### `README` {#readme}
The D1 website may have an existing README file. You can modify it to reflect the D2 changes, or copy the default [Docusaurus v2 README](https://github.com/facebook/docusaurus/blob/main/packages/docusaurus-init/templates/classic/README.md).
The D1 website may have an existing README file. You can modify it to reflect the D2 changes, or copy the default [Docusaurus v2 README](https://github.com/facebook/docusaurus/blob/main/packages/create-docusaurus/templates/classic/README.md).
## Site configurations {#site-configurations}

View file

@ -10,7 +10,7 @@ Docusaurus is written in TypeScript, and provide first-class TypeScript support.
Docusaurus supports writing and using TypeScript theme components. If the init template provides a Typescript variant, you can directly initialize a site with full TypeScript support by using the `--typescript` flag.
```bash
npx @docusaurus/init@latest init my-website classic --typescript
npm init docusaurus@latest my-website classic --typescript
```
Below are some guides on how to migrate an existing project to TypeScript.