create-docusaurus 2.0.0-beta.14 → 2.0.0-beta.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +4 -5
- package/package.json +4 -6
- package/templates/classic/package.json +3 -3
- package/templates/classic/src/css/custom.css +18 -7
- package/templates/classic-typescript/package.json +4 -4
- package/templates/classic-typescript/src/components/HomepageFeatures.tsx +6 -1
- package/templates/facebook/.eslintrc.js +0 -1
- package/templates/facebook/.prettierrc +1 -1
- package/templates/facebook/package.json +4 -4
- package/templates/facebook/src/css/custom.css +18 -7
- package/templates/shared/docs/intro.md +19 -7
package/lib/index.js
CHANGED
|
@@ -33,7 +33,7 @@ async function updatePkg(pkgPath, obj) {
|
|
|
33
33
|
const content = await fs_extra_1.default.readFile(pkgPath, 'utf-8');
|
|
34
34
|
const pkg = JSON.parse(content);
|
|
35
35
|
const newPkg = Object.assign(pkg, obj);
|
|
36
|
-
await fs_extra_1.default.outputFile(pkgPath, JSON.stringify(newPkg, null, 2));
|
|
36
|
+
await fs_extra_1.default.outputFile(pkgPath, `${JSON.stringify(newPkg, null, 2)}\n`);
|
|
37
37
|
}
|
|
38
38
|
function readTemplates(templatesDir) {
|
|
39
39
|
const templates = fs_extra_1.default
|
|
@@ -225,12 +225,11 @@ async function init(rootDir, siteName, reqTemplate, cliOptions = {}) {
|
|
|
225
225
|
}
|
|
226
226
|
const pkgManager = useYarn ? 'yarn' : 'npm';
|
|
227
227
|
// Display the most elegant way to cd.
|
|
228
|
-
const cdpath = path_1.default.
|
|
229
|
-
? name
|
|
230
|
-
: path_1.default.relative(process.cwd(), name);
|
|
228
|
+
const cdpath = path_1.default.relative('.', dest);
|
|
231
229
|
if (!cliOptions.skipInstall) {
|
|
230
|
+
shelljs_1.default.cd(dest);
|
|
232
231
|
logger_1.default.info `Installing dependencies with name=${pkgManager}...`;
|
|
233
|
-
if (shelljs_1.default.exec(
|
|
232
|
+
if (shelljs_1.default.exec(useYarn ? 'yarn' : 'npm install --color always', {
|
|
234
233
|
env: {
|
|
235
234
|
...process.env,
|
|
236
235
|
// Force coloring the output, since the command is invoked by shelljs, which is not the interactive shell
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-docusaurus",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.15",
|
|
4
4
|
"description": "Create Docusaurus apps easily.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -15,15 +15,13 @@
|
|
|
15
15
|
"build": "tsc",
|
|
16
16
|
"watch": "tsc --watch"
|
|
17
17
|
},
|
|
18
|
-
"bin":
|
|
19
|
-
"create-docusaurus": "bin/index.js"
|
|
20
|
-
},
|
|
18
|
+
"bin": "bin/index.js",
|
|
21
19
|
"publishConfig": {
|
|
22
20
|
"access": "public"
|
|
23
21
|
},
|
|
24
22
|
"license": "MIT",
|
|
25
23
|
"dependencies": {
|
|
26
|
-
"@docusaurus/logger": "2.0.0-beta.
|
|
24
|
+
"@docusaurus/logger": "2.0.0-beta.15",
|
|
27
25
|
"commander": "^5.1.0",
|
|
28
26
|
"fs-extra": "^10.0.0",
|
|
29
27
|
"lodash": "^4.17.20",
|
|
@@ -39,5 +37,5 @@
|
|
|
39
37
|
"devDependencies": {
|
|
40
38
|
"@types/supports-color": "^8.1.1"
|
|
41
39
|
},
|
|
42
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "32ec84ef3c0a238436e913b2026ab809e5750fa8"
|
|
43
41
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "docusaurus-2-classic-template",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.15",
|
|
4
4
|
"private": true,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"docusaurus": "docusaurus",
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
"write-heading-ids": "docusaurus write-heading-ids"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@docusaurus/core": "2.0.0-beta.
|
|
18
|
-
"@docusaurus/preset-classic": "2.0.0-beta.
|
|
17
|
+
"@docusaurus/core": "2.0.0-beta.15",
|
|
18
|
+
"@docusaurus/preset-classic": "2.0.0-beta.15",
|
|
19
19
|
"@mdx-js/react": "^1.6.21",
|
|
20
20
|
"clsx": "^1.1.1",
|
|
21
21
|
"prism-react-renderer": "^1.2.1",
|
|
@@ -6,16 +6,27 @@
|
|
|
6
6
|
|
|
7
7
|
/* You can override the default Infima variables here. */
|
|
8
8
|
:root {
|
|
9
|
-
--ifm-color-primary: #
|
|
10
|
-
--ifm-color-primary-dark:
|
|
11
|
-
--ifm-color-primary-darker:
|
|
12
|
-
--ifm-color-primary-darkest:
|
|
13
|
-
--ifm-color-primary-light:
|
|
14
|
-
--ifm-color-primary-lighter:
|
|
15
|
-
--ifm-color-primary-lightest:
|
|
9
|
+
--ifm-color-primary: #2e8555;
|
|
10
|
+
--ifm-color-primary-dark: #29784c;
|
|
11
|
+
--ifm-color-primary-darker: #277148;
|
|
12
|
+
--ifm-color-primary-darkest: #205d3b;
|
|
13
|
+
--ifm-color-primary-light: #33925d;
|
|
14
|
+
--ifm-color-primary-lighter: #359962;
|
|
15
|
+
--ifm-color-primary-lightest: #3cad6e;
|
|
16
16
|
--ifm-code-font-size: 95%;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
/* For readability concerns, you should choose a lighter palette in dark mode. */
|
|
20
|
+
html[data-theme='dark'] {
|
|
21
|
+
--ifm-color-primary: #25c2a0;
|
|
22
|
+
--ifm-color-primary-dark: #21af90;
|
|
23
|
+
--ifm-color-primary-darker: #1fa588;
|
|
24
|
+
--ifm-color-primary-darkest: #1a8870;
|
|
25
|
+
--ifm-color-primary-light: #29d5b0;
|
|
26
|
+
--ifm-color-primary-lighter: #32d8b4;
|
|
27
|
+
--ifm-color-primary-lightest: #4fddbf;
|
|
28
|
+
}
|
|
29
|
+
|
|
19
30
|
.docusaurus-highlight-code-line {
|
|
20
31
|
background-color: rgba(0, 0, 0, 0.1);
|
|
21
32
|
display: block;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "docusaurus-2-classic-typescript-template",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.15",
|
|
4
4
|
"private": true,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"docusaurus": "docusaurus",
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"typecheck": "tsc"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@docusaurus/core": "2.0.0-beta.
|
|
19
|
-
"@docusaurus/preset-classic": "2.0.0-beta.
|
|
18
|
+
"@docusaurus/core": "2.0.0-beta.15",
|
|
19
|
+
"@docusaurus/preset-classic": "2.0.0-beta.15",
|
|
20
20
|
"@mdx-js/react": "^1.6.21",
|
|
21
21
|
"clsx": "^1.1.1",
|
|
22
22
|
"prism-react-renderer": "^1.2.1",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"react-dom": "^17.0.1"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@docusaurus/module-type-aliases": "2.0.0-beta.
|
|
27
|
+
"@docusaurus/module-type-aliases": "2.0.0-beta.15",
|
|
28
28
|
"@tsconfig/docusaurus": "^1.0.4",
|
|
29
29
|
"typescript": "^4.5.2"
|
|
30
30
|
},
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import useBaseUrl from '@docusaurus/useBaseUrl';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import clsx from 'clsx';
|
|
3
4
|
import styles from './HomepageFeatures.module.css';
|
|
@@ -45,7 +46,11 @@ function Feature({title, image, description}: FeatureItem) {
|
|
|
45
46
|
return (
|
|
46
47
|
<div className={clsx('col col--4')}>
|
|
47
48
|
<div className="text--center">
|
|
48
|
-
<img
|
|
49
|
+
<img
|
|
50
|
+
className={styles.featureSvg}
|
|
51
|
+
alt={title}
|
|
52
|
+
src={useBaseUrl(image)}
|
|
53
|
+
/>
|
|
49
54
|
</div>
|
|
50
55
|
<div className="text--center padding-horiz--md">
|
|
51
56
|
<h3>{title}</h3>
|
|
@@ -52,7 +52,6 @@ module.exports = {
|
|
|
52
52
|
' ',
|
|
53
53
|
],
|
|
54
54
|
],
|
|
55
|
-
'react/jsx-closing-bracket-location': OFF, // Conflicts with Prettier.
|
|
56
55
|
'react/jsx-filename-extension': OFF,
|
|
57
56
|
'react-hooks/rules-of-hooks': ERROR,
|
|
58
57
|
'react/prop-types': OFF, // PropTypes aren't used much these days.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "docusaurus-2-facebook-template",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.15",
|
|
4
4
|
"private": true,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"docusaurus": "docusaurus",
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"format:diff": "prettier --config .prettierrc --list-different \"**/*.{js,jsx,ts,tsx,md,mdx}\""
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@docusaurus/core": "2.0.0-beta.
|
|
22
|
-
"@docusaurus/preset-classic": "2.0.0-beta.
|
|
21
|
+
"@docusaurus/core": "2.0.0-beta.15",
|
|
22
|
+
"@docusaurus/preset-classic": "2.0.0-beta.15",
|
|
23
23
|
"@mdx-js/react": "^1.6.21",
|
|
24
24
|
"clsx": "^1.1.1",
|
|
25
25
|
"react": "^17.0.1",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"eslint-plugin-jsx-a11y": "^6.5.1",
|
|
36
36
|
"eslint-plugin-react": "^7.27.0",
|
|
37
37
|
"eslint-plugin-react-hooks": "^4.3.0",
|
|
38
|
-
"prettier": "^2.5.
|
|
38
|
+
"prettier": "^2.5.1",
|
|
39
39
|
"stylelint": "^13.2.1"
|
|
40
40
|
},
|
|
41
41
|
"browserslist": {
|
|
@@ -15,16 +15,27 @@
|
|
|
15
15
|
|
|
16
16
|
/* You can override the default Infima variables here. */
|
|
17
17
|
:root {
|
|
18
|
-
--ifm-color-primary: #
|
|
19
|
-
--ifm-color-primary-dark:
|
|
20
|
-
--ifm-color-primary-darker:
|
|
21
|
-
--ifm-color-primary-darkest:
|
|
22
|
-
--ifm-color-primary-light:
|
|
23
|
-
--ifm-color-primary-lighter:
|
|
24
|
-
--ifm-color-primary-lightest:
|
|
18
|
+
--ifm-color-primary: #2e8555;
|
|
19
|
+
--ifm-color-primary-dark: #29784c;
|
|
20
|
+
--ifm-color-primary-darker: #277148;
|
|
21
|
+
--ifm-color-primary-darkest: #205d3b;
|
|
22
|
+
--ifm-color-primary-light: #33925d;
|
|
23
|
+
--ifm-color-primary-lighter: #359962;
|
|
24
|
+
--ifm-color-primary-lightest: #3cad6e;
|
|
25
25
|
--ifm-code-font-size: 95%;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
/* For readability concerns, you should choose a lighter palette in dark mode. */
|
|
29
|
+
html[data-theme='dark'] {
|
|
30
|
+
--ifm-color-primary: #25c2a0;
|
|
31
|
+
--ifm-color-primary-dark: #21af90;
|
|
32
|
+
--ifm-color-primary-darker: #1fa588;
|
|
33
|
+
--ifm-color-primary-darkest: #1a8870;
|
|
34
|
+
--ifm-color-primary-light: #29d5b0;
|
|
35
|
+
--ifm-color-primary-lighter: #32d8b4;
|
|
36
|
+
--ifm-color-primary-lightest: #4fddbf;
|
|
37
|
+
}
|
|
38
|
+
|
|
28
39
|
.docusaurus-highlight-code-line {
|
|
29
40
|
background-color: rgb(72, 77, 91);
|
|
30
41
|
display: block;
|
|
@@ -12,24 +12,36 @@ Get started by **creating a new site**.
|
|
|
12
12
|
|
|
13
13
|
Or **try Docusaurus immediately** with **[docusaurus.new](https://docusaurus.new)**.
|
|
14
14
|
|
|
15
|
+
### What you'll need
|
|
16
|
+
|
|
17
|
+
- [Node.js](https://nodejs.org/en/download/) version 14 or above:
|
|
18
|
+
- When installing Node.js, you are recommended to check all checkboxes related to dependencies.
|
|
19
|
+
|
|
15
20
|
## Generate a new site
|
|
16
21
|
|
|
17
|
-
Generate a new Docusaurus site using the **classic template
|
|
22
|
+
Generate a new Docusaurus site using the **classic template**.
|
|
18
23
|
|
|
19
|
-
|
|
24
|
+
The classic template will automatically be added to your project after you run the command:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
20
27
|
npm init docusaurus@latest my-website classic
|
|
21
28
|
```
|
|
22
29
|
|
|
30
|
+
You can type this command into Command Prompt, Powershell, Terminal, or any other integrated terminal of your code editor.
|
|
31
|
+
|
|
32
|
+
The command also installs all necessary dependencies you need to run Docusaurus.
|
|
33
|
+
|
|
23
34
|
## Start your site
|
|
24
35
|
|
|
25
36
|
Run the development server:
|
|
26
37
|
|
|
27
|
-
```
|
|
38
|
+
```bash
|
|
28
39
|
cd my-website
|
|
29
|
-
|
|
30
|
-
npx docusaurus start
|
|
40
|
+
npm run start
|
|
31
41
|
```
|
|
32
42
|
|
|
33
|
-
|
|
43
|
+
The `cd` command changes the directory you're working with. In order to work with your newly created Docusaurus site, you'll need to navigate the terminal there.
|
|
44
|
+
|
|
45
|
+
The `npm run start` command builds your website locally and serves it through a development server, ready for you to view at http://localhost:3000/.
|
|
34
46
|
|
|
35
|
-
Open `docs/intro.md` and edit some lines: the site **reloads automatically** and displays your changes.
|
|
47
|
+
Open `docs/intro.md` (this page) and edit some lines: the site **reloads automatically** and displays your changes.
|