diff --git a/docusaurus/docs/README.md b/docusaurus/docs/README.md new file mode 100644 index 00000000000..da362138798 --- /dev/null +++ b/docusaurus/docs/README.md @@ -0,0 +1,3 @@ +# Nothing to see here right now + +Please refer to the [Readme](https://github.com/facebook/create-react-app/blob/master/README.md) or the [User Guide](https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md). diff --git a/docusaurus/docs/getting-started.md b/docusaurus/docs/getting-started.md new file mode 100644 index 00000000000..1fcd24cf712 --- /dev/null +++ b/docusaurus/docs/getting-started.md @@ -0,0 +1,119 @@ +--- +id: getting-started +title: Getting started +sidebar_label: Getting started +--- + +## Quick Overview + +```sh +npx create-react-app my-app +cd my-app +npm start +``` + +_([npx](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b) comes with npm 5.2+ and higher, see [instructions for older npm versions](https://gist.github.com/gaearon/4064d3c23a77c74a3614c498a8bb1c5f))_ + +Then open [http://localhost:3000/](http://localhost:3000/) to see your app.
+When you’re ready to deploy to production, create a minified bundle with `npm run build`. + +

+npm start +

+ +### Get Started Immediately + +You **don’t** need to install or configure tools like Webpack or Babel.
+They are preconfigured and hidden so that you can focus on the code. + +Just create a project, and you’re good to go. + +## Creating an App + +**You’ll need to have Node >= 6 on your local development machine** (but it’s not required on the server). You can use [nvm](https://github.com/creationix/nvm#installation) (macOS/Linux) or [nvm-windows](https://github.com/coreybutler/nvm-windows#node-version-manager-nvm-for-windows) to easily switch Node versions between different projects. + +To create a new app, you may choose one of the following methods: + +### npx + +```sh +npx create-react-app my-app +``` + +_([npx](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b) comes with npm 5.2+ and higher, see [instructions for older npm versions](https://gist.github.com/gaearon/4064d3c23a77c74a3614c498a8bb1c5f))_ + +### npm + +```sh +npm init react-app my-app +``` + +_`npm init ` is available in npm 6+_ + +### Yarn + +```sh +yarn create react-app my-app +``` + +_`yarn create` is available in Yarn 0.25+_ + +It will create a directory called `my-app` inside the current folder.
+Inside that directory, it will generate the initial project structure and install the transitive dependencies: + +``` +my-app +├── README.md +├── node_modules +├── package.json +├── .gitignore +├── public +│ ├── favicon.ico +│ ├── index.html +│ └── manifest.json +└── src + ├── App.css + ├── App.js + ├── App.test.js + ├── index.css + ├── index.js + ├── logo.svg + └── registerServiceWorker.js +``` + +No configuration or complicated folder structures, just the files you need to build your app.
+Once the installation is done, you can open your project folder: + +```sh +cd my-app +``` + +Inside the newly created project, you can run some built-in commands: + +### `npm start` or `yarn start` + +Runs the app in development mode.
+Open [http://localhost:3000](http://localhost:3000) to view it in the browser. + +The page will automatically reload if you make changes to the code.
+You will see the build errors and lint warnings in the console. + +

+Build errors +

+ +### `npm test` or `yarn test` + +Runs the test watcher in an interactive mode.
+By default, runs tests related to files changed since the last commit. + +[Read more about testing.](https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#running-tests) + +### `npm run build` or `yarn build` + +Builds the app for production to the `build` folder.
+It correctly bundles React in production mode and optimizes the build for the best performance. + +The build is minified and the filenames include the hashes.
+ +Your app is ready to be deployed. diff --git a/docusaurus/docs/user-guide.md b/docusaurus/docs/user-guide.md new file mode 100644 index 00000000000..09f6c67f0fb --- /dev/null +++ b/docusaurus/docs/user-guide.md @@ -0,0 +1,7 @@ +--- +id: user-guide +title: User guide +sidebar_label: User guide +--- + +The user guide can be found on [GitHub](https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md) for now. diff --git a/website/README.md b/docusaurus/website/README.md similarity index 100% rename from website/README.md rename to docusaurus/website/README.md diff --git a/website/core/Footer.js b/docusaurus/website/core/Footer.js similarity index 92% rename from website/core/Footer.js rename to docusaurus/website/core/Footer.js index 7e08f80efb4..c82516f874b 100644 --- a/website/core/Footer.js +++ b/docusaurus/website/core/Footer.js @@ -34,11 +34,11 @@ class Footer extends React.Component {
Docs
- - Getting Started (or other categories) + + Getting Started - - Guides (or other categories) + + User Guide API Reference (or other categories) diff --git a/website/i18n/en.json b/docusaurus/website/i18n/en.json similarity index 57% rename from website/i18n/en.json rename to docusaurus/website/i18n/en.json index 545f15e5994..3e05a5b987e 100644 --- a/website/i18n/en.json +++ b/docusaurus/website/i18n/en.json @@ -4,16 +4,26 @@ "next": "Next", "previous": "Previous", "tagline": "Create React apps with no build configuration.", - "docs": {}, + "docs": { + "getting-started": { + "title": "Getting started", + "sidebar_label": "Getting started" + }, + "README": { + "title": "README" + }, + "user-guide": { + "title": "User guide", + "sidebar_label": "User guide" + } + }, "links": { - "Docs": "Docs", - "API": "API", + "Getting started": "Getting started", "Help": "Help" }, "categories": { - "Docusaurus": "Docusaurus", - "First Category": "First Category", - "Second Category": "Second Category" + "Getting Started": "Getting Started", + "User Guide": "User Guide" } }, "pages-strings": { diff --git a/website/package.json b/docusaurus/website/package.json similarity index 100% rename from website/package.json rename to docusaurus/website/package.json diff --git a/website/pages/en/index.js b/docusaurus/website/pages/en/index.js similarity index 95% rename from website/pages/en/index.js rename to docusaurus/website/pages/en/index.js index 2e13392c351..2b3501180c0 100755 --- a/website/pages/en/index.js +++ b/docusaurus/website/pages/en/index.js @@ -82,8 +82,10 @@ class HomeSplash extends React.Component { - - + +
diff --git a/docusaurus/website/sidebars.json b/docusaurus/website/sidebars.json new file mode 100644 index 00000000000..3144ebc562f --- /dev/null +++ b/docusaurus/website/sidebars.json @@ -0,0 +1,6 @@ +{ + "docs": { + "Getting Started": ["getting-started"], + "User Guide": ["user-guide"] + } +} diff --git a/website/siteConfig.js b/docusaurus/website/siteConfig.js similarity index 97% rename from website/siteConfig.js rename to docusaurus/website/siteConfig.js index 1a8b1cb1f64..28d59faf2d2 100644 --- a/website/siteConfig.js +++ b/docusaurus/website/siteConfig.js @@ -26,8 +26,7 @@ const siteConfig = { // For no header links in the top nav bar -> headerLinks: [], headerLinks: [ - { doc: 'doc1', label: 'Docs' }, - { doc: 'doc4', label: 'API' }, + { doc: 'getting-started', label: 'Getting started' }, { href: 'https://reactjs.org/community/support.html', label: 'Help' }, ], diff --git a/website/static/css/custom.css b/docusaurus/website/static/css/custom.css similarity index 100% rename from website/static/css/custom.css rename to docusaurus/website/static/css/custom.css diff --git a/website/static/img/docusaurus.svg b/docusaurus/website/static/img/docusaurus.svg similarity index 100% rename from website/static/img/docusaurus.svg rename to docusaurus/website/static/img/docusaurus.svg diff --git a/website/static/img/favicon/favicon.ico b/docusaurus/website/static/img/favicon/favicon.ico similarity index 100% rename from website/static/img/favicon/favicon.ico rename to docusaurus/website/static/img/favicon/favicon.ico diff --git a/website/static/img/logo-og.png b/docusaurus/website/static/img/logo-og.png similarity index 100% rename from website/static/img/logo-og.png rename to docusaurus/website/static/img/logo-og.png diff --git a/website/static/img/oss_logo.png b/docusaurus/website/static/img/oss_logo.png similarity index 100% rename from website/static/img/oss_logo.png rename to docusaurus/website/static/img/oss_logo.png diff --git a/website/yarn.lock b/docusaurus/website/yarn.lock similarity index 100% rename from website/yarn.lock rename to docusaurus/website/yarn.lock diff --git a/website/sidebars.json b/website/sidebars.json deleted file mode 100644 index 7a1d0540185..00000000000 --- a/website/sidebars.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "docs": { - "Docusaurus": ["doc1"], - "First Category": ["doc2"], - "Second Category": ["doc3"] - }, - "docs-other": { - "First Category": ["doc4", "doc5"] - } -}