create-docusaurus 3.7.0 → 3.8.0-canary-6327
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 +13 -12
- package/package.json +5 -5
- package/templates/classic/docusaurus.config.js +5 -0
- package/templates/classic/package.json +5 -5
- package/templates/classic-typescript/docusaurus.config.ts +5 -0
- package/templates/classic-typescript/package.json +6 -6
- package/templates/shared/README.md +14 -14
- package/templates/shared/blog/authors.yml +4 -2
package/lib/index.js
CHANGED
|
@@ -9,10 +9,12 @@ import { fileURLToPath } from 'url';
|
|
|
9
9
|
import path from 'path';
|
|
10
10
|
import _ from 'lodash';
|
|
11
11
|
import { logger } from '@docusaurus/logger';
|
|
12
|
-
import
|
|
12
|
+
import execa from 'execa';
|
|
13
13
|
import prompts from 'prompts';
|
|
14
14
|
import supportsColor from 'supports-color';
|
|
15
|
-
|
|
15
|
+
// TODO remove dependency on large @docusaurus/utils
|
|
16
|
+
// would be better to have a new smaller @docusaurus/utils-cli package
|
|
17
|
+
import { askPreferredLanguage } from '@docusaurus/utils';
|
|
16
18
|
async function getLanguage(options) {
|
|
17
19
|
if (options.typescript) {
|
|
18
20
|
return 'typescript';
|
|
@@ -45,9 +47,9 @@ function findPackageManagerFromUserAgent() {
|
|
|
45
47
|
return packageManagers.find((packageManager) => process.env.npm_config_user_agent?.startsWith(packageManager));
|
|
46
48
|
}
|
|
47
49
|
async function askForPackageManagerChoice() {
|
|
48
|
-
const hasYarn =
|
|
49
|
-
const hasPnpm =
|
|
50
|
-
const hasBun =
|
|
50
|
+
const hasYarn = (await execa.command('yarn --version')).exitCode === 0;
|
|
51
|
+
const hasPnpm = (await execa.command('pnpm --version')).exitCode === 0;
|
|
52
|
+
const hasBun = (await execa.command('bun --version')).exitCode === 0;
|
|
51
53
|
if (!hasYarn && !hasPnpm && !hasBun) {
|
|
52
54
|
return 'npm';
|
|
53
55
|
}
|
|
@@ -351,8 +353,7 @@ export default async function init(rootDir, reqName, reqTemplate, cliOptions = {
|
|
|
351
353
|
logger.info('Creating new Docusaurus project...');
|
|
352
354
|
if (source.type === 'git') {
|
|
353
355
|
const gitCommand = await getGitCommand(source.strategy);
|
|
354
|
-
|
|
355
|
-
if (shell.exec(gitCloneCommand).code !== 0) {
|
|
356
|
+
if ((await execa(gitCommand, [source.url, dest])).exitCode !== 0) {
|
|
356
357
|
logger.error `Cloning Git template failed!`;
|
|
357
358
|
process.exit(1);
|
|
358
359
|
}
|
|
@@ -402,20 +403,20 @@ export default async function init(rootDir, reqName, reqTemplate, cliOptions = {
|
|
|
402
403
|
const cdpath = path.relative('.', dest);
|
|
403
404
|
const pkgManager = await getPackageManager(dest, cliOptions);
|
|
404
405
|
if (!cliOptions.skipInstall) {
|
|
405
|
-
|
|
406
|
+
process.chdir(dest);
|
|
406
407
|
logger.info `Installing dependencies with name=${pkgManager}...`;
|
|
407
|
-
|
|
408
|
+
// ...
|
|
409
|
+
if ((await execa.command(pkgManager === 'yarn'
|
|
408
410
|
? 'yarn'
|
|
409
411
|
: pkgManager === 'bun'
|
|
410
412
|
? 'bun install'
|
|
411
413
|
: `${pkgManager} install --color always`, {
|
|
412
414
|
env: {
|
|
413
415
|
...process.env,
|
|
414
|
-
// Force coloring the output
|
|
415
|
-
// shelljs, which is not an interactive shell
|
|
416
|
+
// Force coloring the output
|
|
416
417
|
...(supportsColor.stdout ? { FORCE_COLOR: '1' } : {}),
|
|
417
418
|
},
|
|
418
|
-
}).
|
|
419
|
+
})).exitCode !== 0) {
|
|
419
420
|
logger.error('Dependency installation failed.');
|
|
420
421
|
logger.info `The site directory has already been created, and you can retry by typing:
|
|
421
422
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-docusaurus",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.8.0-canary-6327",
|
|
4
4
|
"description": "Create Docusaurus apps easily.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
},
|
|
23
23
|
"license": "MIT",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@docusaurus/logger": "3.
|
|
26
|
-
"@docusaurus/utils": "3.
|
|
25
|
+
"@docusaurus/logger": "3.8.0-canary-6327",
|
|
26
|
+
"@docusaurus/utils": "3.8.0-canary-6327",
|
|
27
27
|
"commander": "^5.1.0",
|
|
28
|
+
"execa": "5.1.1",
|
|
28
29
|
"fs-extra": "^11.1.1",
|
|
29
30
|
"lodash": "^4.17.21",
|
|
30
31
|
"prompts": "^2.4.2",
|
|
31
32
|
"semver": "^7.5.4",
|
|
32
|
-
"shelljs": "^0.8.5",
|
|
33
33
|
"supports-color": "^9.4.0",
|
|
34
34
|
"tslib": "^2.6.0"
|
|
35
35
|
},
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"engines": {
|
|
40
40
|
"node": ">=18.0"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "d50539dea74625c994ac3f78926ed7b37d704c84"
|
|
43
43
|
}
|
|
@@ -14,6 +14,11 @@ const config = {
|
|
|
14
14
|
tagline: 'Dinosaurs are cool',
|
|
15
15
|
favicon: 'img/favicon.ico',
|
|
16
16
|
|
|
17
|
+
// Future flags, see https://docusaurus.io/docs/api/docusaurus-config#future
|
|
18
|
+
future: {
|
|
19
|
+
v4: true, // Improve compatibility with the upcoming Docusaurus v4
|
|
20
|
+
},
|
|
21
|
+
|
|
17
22
|
// Set the production url of your site here
|
|
18
23
|
url: 'https://your-docusaurus-site.example.com',
|
|
19
24
|
// Set the /<baseUrl>/ pathname under which your site is served
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "docusaurus-2-classic-template",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.8.0-canary-6327",
|
|
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": "3.
|
|
18
|
-
"@docusaurus/preset-classic": "3.
|
|
17
|
+
"@docusaurus/core": "3.8.0-canary-6327",
|
|
18
|
+
"@docusaurus/preset-classic": "3.8.0-canary-6327",
|
|
19
19
|
"@mdx-js/react": "^3.0.0",
|
|
20
20
|
"clsx": "^2.0.0",
|
|
21
21
|
"prism-react-renderer": "^2.3.0",
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"react-dom": "^19.0.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@docusaurus/module-type-aliases": "3.
|
|
27
|
-
"@docusaurus/types": "3.
|
|
26
|
+
"@docusaurus/module-type-aliases": "3.8.0-canary-6327",
|
|
27
|
+
"@docusaurus/types": "3.8.0-canary-6327"
|
|
28
28
|
},
|
|
29
29
|
"browserslist": {
|
|
30
30
|
"production": [
|
|
@@ -9,6 +9,11 @@ const config: Config = {
|
|
|
9
9
|
tagline: 'Dinosaurs are cool',
|
|
10
10
|
favicon: 'img/favicon.ico',
|
|
11
11
|
|
|
12
|
+
// Future flags, see https://docusaurus.io/docs/api/docusaurus-config#future
|
|
13
|
+
future: {
|
|
14
|
+
v4: true, // Improve compatibility with the upcoming Docusaurus v4
|
|
15
|
+
},
|
|
16
|
+
|
|
12
17
|
// Set the production url of your site here
|
|
13
18
|
url: 'https://your-docusaurus-site.example.com',
|
|
14
19
|
// Set the /<baseUrl>/ pathname under which your site is served
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "docusaurus-2-classic-typescript-template",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.8.0-canary-6327",
|
|
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": "3.
|
|
19
|
-
"@docusaurus/preset-classic": "3.
|
|
18
|
+
"@docusaurus/core": "3.8.0-canary-6327",
|
|
19
|
+
"@docusaurus/preset-classic": "3.8.0-canary-6327",
|
|
20
20
|
"@mdx-js/react": "^3.0.0",
|
|
21
21
|
"clsx": "^2.0.0",
|
|
22
22
|
"prism-react-renderer": "^2.3.0",
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
"react-dom": "^19.0.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@docusaurus/module-type-aliases": "3.
|
|
28
|
-
"@docusaurus/tsconfig": "3.
|
|
29
|
-
"@docusaurus/types": "3.
|
|
27
|
+
"@docusaurus/module-type-aliases": "3.8.0-canary-6327",
|
|
28
|
+
"@docusaurus/tsconfig": "3.8.0-canary-6327",
|
|
29
|
+
"@docusaurus/types": "3.8.0-canary-6327",
|
|
30
30
|
"typescript": "~5.6.2"
|
|
31
31
|
},
|
|
32
32
|
"browserslist": {
|
|
@@ -2,40 +2,40 @@
|
|
|
2
2
|
|
|
3
3
|
This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Installation
|
|
6
6
|
|
|
7
|
-
```
|
|
8
|
-
|
|
7
|
+
```bash
|
|
8
|
+
yarn
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
## Local Development
|
|
12
12
|
|
|
13
|
-
```
|
|
14
|
-
|
|
13
|
+
```bash
|
|
14
|
+
yarn start
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
## Build
|
|
20
20
|
|
|
21
|
-
```
|
|
22
|
-
|
|
21
|
+
```bash
|
|
22
|
+
yarn build
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
This command generates static content into the `build` directory and can be served using any static contents hosting service.
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
## Deployment
|
|
28
28
|
|
|
29
29
|
Using SSH:
|
|
30
30
|
|
|
31
|
-
```
|
|
32
|
-
|
|
31
|
+
```bash
|
|
32
|
+
USE_SSH=true yarn deploy
|
|
33
33
|
```
|
|
34
34
|
|
|
35
35
|
Not using SSH:
|
|
36
36
|
|
|
37
|
-
```
|
|
38
|
-
|
|
37
|
+
```bash
|
|
38
|
+
GIT_USER=<Your GitHub username> yarn deploy
|
|
39
39
|
```
|
|
40
40
|
|
|
41
41
|
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
yangshun:
|
|
2
2
|
name: Yangshun Tay
|
|
3
|
-
title:
|
|
4
|
-
url: https://
|
|
3
|
+
title: Ex-Meta Staff Engineer, Co-founder GreatFrontEnd
|
|
4
|
+
url: https://linkedin.com/in/yangshun
|
|
5
5
|
image_url: https://github.com/yangshun.png
|
|
6
6
|
page: true
|
|
7
7
|
socials:
|
|
8
8
|
x: yangshunz
|
|
9
|
+
linkedin: yangshun
|
|
9
10
|
github: yangshun
|
|
11
|
+
newsletter: https://www.greatfrontend.com
|
|
10
12
|
|
|
11
13
|
slorber:
|
|
12
14
|
name: Sébastien Lorber
|