refactor(v2): move website dir out of v2 for cleaner separations
|
|
@ -151,7 +151,7 @@ jobs:
|
|||
command: cd v2 && yarn test
|
||||
- run:
|
||||
name: Test Static Website Builds
|
||||
command: cd v2/website && yarn build
|
||||
command: cd v2-website && yarn build
|
||||
|
||||
publish-npm:
|
||||
<<: *defaults
|
||||
|
|
|
|||
|
|
@ -8,3 +8,5 @@ node_modules
|
|||
.eslintcache
|
||||
|
||||
yarn-error.log
|
||||
build
|
||||
__generated__
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ id: installation
|
|||
title: Installation
|
||||
---
|
||||
|
||||
Docusaurus was designed from the ground up to be easily installed and used to get your website up and running quickly.
|
||||
Docusaurus was designed from the ground up to be easily installed and used to get your website up and running quickly.
|
||||
|
||||
## Installing Docusaurus
|
||||
|
||||
|
|
@ -62,11 +62,11 @@ runnable, example website to use as your site's base. To run:
|
|||
1. In your root, rename `docs-examples-from-docusaurus` to `docs`.
|
||||
1. `cd website`
|
||||
1. Rename `blog-examples-from-docusaurus` to `blog`.
|
||||
1. From within the `website` directory, run the local webserver using
|
||||
1. From within the `website` directory, run the local webserver using
|
||||
`yarn start` or `npm start`.
|
||||
1. Load the example site at http://localhost:3000 if it did not already open
|
||||
automatically.
|
||||
|
||||
|
||||
You should see the example site loaded in your web browser. There's also a LiveReload server running and any changes made to the docs and files in the `website` directory will cause the page to refresh.
|
||||
|
||||

|
||||
|
|
@ -82,7 +82,7 @@ yarn start (or npm run start)
|
|||
|
||||
## Updating Your Docusaurus Version
|
||||
|
||||
At any time after Docusaurus is installed, you can check your current version of Docusaurus by going into the `website` directory and typing `yarn outdated docusaurus` or `npm outdated docusaurus`.
|
||||
At any time after Docusaurus is installed, you can check your current version of Docusaurus by going into the `website` directory and typing `yarn outdated docusaurus` or `npm outdated docusaurus`.
|
||||
|
||||
You will see something like this:
|
||||
|
||||
|
|
@ -92,11 +92,11 @@ Using globally installed version of Yarn
|
|||
yarn outdated v1.5.1
|
||||
warning package.json: No license field
|
||||
warning No license field
|
||||
info Color legend :
|
||||
"<red>" : Major Update backward-incompatible updates
|
||||
"<yellow>" : Minor Update backward-compatible features
|
||||
info Color legend :
|
||||
"<red>" : Major Update backward-incompatible updates
|
||||
"<yellow>" : Minor Update backward-compatible features
|
||||
"<green>" : Patch Update backward-compatible bug fixes
|
||||
Package Current Wanted Latest Package Type URL
|
||||
Package Current Wanted Latest Package Type URL
|
||||
docusaurus 1.0.9 1.2.0 1.2.0 devDependencies https://github.com/facebook/Docusaurus#readme
|
||||
✨ Done in 0.41s.
|
||||
```
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ module.exports = {
|
|||
organizationName: 'facebook',
|
||||
projectName: 'docusaurus',
|
||||
baseUrl: '/',
|
||||
customDocsPath: '../docs',
|
||||
customDocsPath: './docs',
|
||||
url: 'https://docusaurus.io',
|
||||
headerLinks: [
|
||||
{doc: 'installation', label: 'Docs'},
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"scripts": {
|
||||
"start": "node ../v2/bin/docusaurus start",
|
||||
"build": "node ../v2/bin/docusaurus build",
|
||||
"eject": "node ../v2/bin/docusaurus eject",
|
||||
"deploy": "node ../v2/bin/docusaurus deploy"
|
||||
},
|
||||
"dependencies": {
|
||||
"classnames": "^2.2.6",
|
||||
"docusaurus": "../v2",
|
||||
"react": "^16.7.0-alpha.0",
|
||||
"react-dom": "^16.7.0-alpha.0",
|
||||
"react-youtube": "^7.6.0"
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 9.4 KiB After Width: | Height: | Size: 9.4 KiB |
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.3 KiB |
|
Before Width: | Height: | Size: 86 KiB After Width: | Height: | Size: 86 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 224 KiB After Width: | Height: | Size: 224 KiB |
|
Before Width: | Height: | Size: 179 KiB After Width: | Height: | Size: 179 KiB |
|
Before Width: | Height: | Size: 219 KiB After Width: | Height: | Size: 219 KiB |
|
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 61 KiB |
|
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 85 KiB |
|
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 59 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 7.4 KiB |
|
Before Width: | Height: | Size: 796 B After Width: | Height: | Size: 796 B |
|
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 7.0 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 804 B After Width: | Height: | Size: 804 B |
|
|
@ -2354,7 +2354,7 @@ docsearch.js@^2.5.2:
|
|||
to-factory "^1.0.0"
|
||||
zepto "^1.2.0"
|
||||
|
||||
docusaurus@../:
|
||||
docusaurus@../v2:
|
||||
version "2.0.0"
|
||||
dependencies:
|
||||
"@babel/core" "^7.0.0"
|
||||
|
|
@ -2385,6 +2385,7 @@ docusaurus@../:
|
|||
koa-range "^0.3.0"
|
||||
koa-static "^5.0.0"
|
||||
loader-utils "^1.1.0"
|
||||
lodash "^4.17.11"
|
||||
mini-css-extract-plugin "^0.4.1"
|
||||
portfinder "^1.0.13"
|
||||
prismjs "^1.15.0"
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
.DS_Store
|
||||
.vscode
|
||||
.idea
|
||||
.eslintcache
|
||||
node_modules
|
||||
dist
|
||||
yarn-error.log
|
||||
__generated__
|
||||
website/node_modules
|
||||
build
|
||||
|
|
@ -36,10 +36,10 @@ async function getPort(reqPort) {
|
|||
module.exports = async function start(siteDir, cliOptions = {}) {
|
||||
console.log('Start command invoked ...');
|
||||
|
||||
// Process all related files as a prop
|
||||
// Process all related files as a prop.
|
||||
const props = await load(siteDir);
|
||||
|
||||
// Reload files processing
|
||||
// Reload files processing.
|
||||
if (!cliOptions.noWatch) {
|
||||
const reload = () => {
|
||||
load(siteDir).catch(err => {
|
||||
|
|
@ -71,7 +71,7 @@ module.exports = async function start(siteDir, cliOptions = {}) {
|
|||
const host = getHost(cliOptions.host);
|
||||
const {baseUrl} = props;
|
||||
|
||||
// create compiler from generated webpack config
|
||||
// Create compiler from generated webpack config.
|
||||
let config = createClientConfig(props);
|
||||
|
||||
const {siteConfig} = props;
|
||||
|
|
@ -86,7 +86,7 @@ module.exports = async function start(siteDir, cliOptions = {}) {
|
|||
]);
|
||||
config = config.toConfig();
|
||||
|
||||
// apply user webpack config
|
||||
// Apply user webpack config.
|
||||
const {
|
||||
siteConfig: {configureWebpack},
|
||||
} = props;
|
||||
|
|
@ -94,7 +94,7 @@ module.exports = async function start(siteDir, cliOptions = {}) {
|
|||
|
||||
const compiler = webpack(config);
|
||||
|
||||
// webpack-serve
|
||||
// Run webpack serve.
|
||||
await serve(
|
||||
{},
|
||||
{
|
||||
|
|
@ -111,16 +111,16 @@ module.exports = async function start(siteDir, cliOptions = {}) {
|
|||
port,
|
||||
host,
|
||||
add: app => {
|
||||
// serve static files
|
||||
// Serve static files.
|
||||
const staticDir = path.resolve(siteDir, 'static');
|
||||
if (fs.existsSync(staticDir)) {
|
||||
app.use(mount(baseUrl, serveStatic(staticDir)));
|
||||
}
|
||||
|
||||
// enable HTTP range requests
|
||||
// Enable HTTP range requests.
|
||||
app.use(range);
|
||||
|
||||
// rewrite request to `/` since dev is only a SPA
|
||||
// Rewrite request to `/` since dev is only a SPA.
|
||||
app.use(
|
||||
convert(
|
||||
history({
|
||||
|
|
|
|||
|
|
@ -21,12 +21,8 @@
|
|||
},
|
||||
"scripts": {
|
||||
"docusaurus": "node bin/docusaurus",
|
||||
"start": "node bin/docusaurus start website",
|
||||
"build": "node bin/docusaurus build website",
|
||||
"eject": "node bin/docusaurus eject website",
|
||||
"deploy": "node bin/docusaurus deploy website",
|
||||
"prettier": "prettier --config ../.prettierrc --write \"**/*.js\"",
|
||||
"lint": "eslint --cache \"{lib,bin,test,website}/**/*.js\"",
|
||||
"lint": "eslint --cache \"{lib,bin,test}/**/*.js\"",
|
||||
"test": "jest --config test/jest.config.js"
|
||||
},
|
||||
"bugs": {
|
||||
|
|
|
|||
|
|
@ -1,13 +0,0 @@
|
|||
{
|
||||
"scripts": {
|
||||
"start": "node ../bin/docusaurus start",
|
||||
"build": "node ../bin/docusaurus build"
|
||||
},
|
||||
"dependencies": {
|
||||
"classnames": "^2.2.6",
|
||||
"docusaurus": "../",
|
||||
"react": "^16.7.0-alpha.0",
|
||||
"react-dom": "^16.7.0-alpha.0",
|
||||
"react-youtube": "^7.6.0"
|
||||
}
|
||||
}
|
||||