create-docusaurus 3.0.0-alpha.0 → 3.0.0-beta.0

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/bin/index.js CHANGED
@@ -31,7 +31,7 @@ program
31
31
  .arguments('[siteName] [template] [rootDir]')
32
32
  .option(
33
33
  '-p, --package-manager <manager>',
34
- 'The package manager used to install dependencies. One of yarn, npm, and pnpm.',
34
+ 'The package manager used to install dependencies. One of yarn, npm, pnpm, and bun.',
35
35
  )
36
36
  .option(
37
37
  '-s, --skip-install',
package/lib/index.d.ts CHANGED
@@ -14,6 +14,7 @@ declare const lockfileNames: {
14
14
  npm: string;
15
15
  yarn: string;
16
16
  pnpm: string;
17
+ bun: string;
17
18
  };
18
19
  type PackageManager = keyof typeof lockfileNames;
19
20
  declare const gitStrategies: readonly ["deep", "shallow", "copy", "custom"];
package/lib/index.js CHANGED
@@ -20,6 +20,7 @@ const lockfileNames = {
20
20
  npm: 'package-lock.json',
21
21
  yarn: 'yarn.lock',
22
22
  pnpm: 'pnpm-lock.yaml',
23
+ bun: 'bun.lockb',
23
24
  };
24
25
  const packageManagers = Object.keys(lockfileNames);
25
26
  async function findPackageManagerFromLockFile(rootDir) {
@@ -37,10 +38,11 @@ function findPackageManagerFromUserAgent() {
37
38
  async function askForPackageManagerChoice() {
38
39
  const hasYarn = shell.exec('yarn --version', { silent: true }).code === 0;
39
40
  const hasPnpm = shell.exec('pnpm --version', { silent: true }).code === 0;
40
- if (!hasYarn && !hasPnpm) {
41
+ const hasBun = shell.exec('bun --version', { silent: true }).code === 0;
42
+ if (!hasYarn && !hasPnpm && !hasBun) {
41
43
  return 'npm';
42
44
  }
43
- const choices = ['npm', hasYarn && 'yarn', hasPnpm && 'pnpm']
45
+ const choices = ['npm', hasYarn && 'yarn', hasPnpm && 'pnpm', hasBun && 'bun']
44
46
  .filter((p) => Boolean(p))
45
47
  .map((p) => ({ title: p, value: p }));
46
48
  return ((await prompts({
@@ -387,7 +389,11 @@ export default async function init(rootDir, reqName, reqTemplate, cliOptions = {
387
389
  if (!cliOptions.skipInstall) {
388
390
  shell.cd(dest);
389
391
  logger.info `Installing dependencies with name=${pkgManager}...`;
390
- if (shell.exec(pkgManager === 'yarn' ? 'yarn' : `${pkgManager} install --color always`, {
392
+ if (shell.exec(pkgManager === 'yarn'
393
+ ? 'yarn'
394
+ : pkgManager === 'bun'
395
+ ? 'bun install'
396
+ : `${pkgManager} install --color always`, {
391
397
  env: {
392
398
  ...process.env,
393
399
  // Force coloring the output, since the command is invoked by
@@ -404,19 +410,21 @@ export default async function init(rootDir, reqName, reqTemplate, cliOptions = {
404
410
  }
405
411
  }
406
412
  const useNpm = pkgManager === 'npm';
413
+ const useBun = pkgManager === 'bun';
414
+ const useRunCommand = useNpm || useBun;
407
415
  logger.success `Created name=${cdpath}.`;
408
416
  logger.info `Inside that directory, you can run several commands:
409
417
 
410
418
  code=${`${pkgManager} start`}
411
419
  Starts the development server.
412
420
 
413
- code=${`${pkgManager} ${useNpm ? 'run ' : ''}build`}
421
+ code=${`${pkgManager} ${useRunCommand ? 'run ' : ''}build`}
414
422
  Bundles your website into static files for production.
415
423
 
416
- code=${`${pkgManager} ${useNpm ? 'run ' : ''}serve`}
424
+ code=${`${pkgManager} ${useRunCommand ? 'run ' : ''}serve`}
417
425
  Serves the built website locally.
418
426
 
419
- code=${`${pkgManager} deploy`}
427
+ code=${`${pkgManager} ${useRunCommand ? 'run ' : ''}deploy`}
420
428
  Publishes the website to GitHub pages.
421
429
 
422
430
  We recommend that you begin by typing:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-docusaurus",
3
- "version": "3.0.0-alpha.0",
3
+ "version": "3.0.0-beta.0",
4
4
  "description": "Create Docusaurus apps easily.",
5
5
  "type": "module",
6
6
  "repository": {
@@ -22,16 +22,16 @@
22
22
  },
23
23
  "license": "MIT",
24
24
  "dependencies": {
25
- "@docusaurus/logger": "3.0.0-alpha.0",
26
- "@docusaurus/utils": "3.0.0-alpha.0",
25
+ "@docusaurus/logger": "3.0.0-beta.0",
26
+ "@docusaurus/utils": "3.0.0-beta.0",
27
27
  "commander": "^5.1.0",
28
- "fs-extra": "^11.1.0",
28
+ "fs-extra": "^11.1.1",
29
29
  "lodash": "^4.17.21",
30
30
  "prompts": "^2.4.2",
31
- "semver": "^7.3.8",
31
+ "semver": "^7.5.4",
32
32
  "shelljs": "^0.8.5",
33
- "supports-color": "^9.3.1",
34
- "tslib": "^2.5.0"
33
+ "supports-color": "^9.4.0",
34
+ "tslib": "^2.6.0"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/supports-color": "^8.1.1"
@@ -39,5 +39,5 @@
39
39
  "engines": {
40
40
  "node": ">=16.14"
41
41
  },
42
- "gitHead": "7327f7ff880ed97ad7855744e59c9c55d467a950"
42
+ "gitHead": "27a1e90d9fff88af90ecad35bea16d4d7230482a"
43
43
  }
@@ -14,7 +14,7 @@ const config = {
14
14
  favicon: 'img/favicon.ico',
15
15
 
16
16
  // Set the production url of your site here
17
- url: 'https://your-docusaurus-test-site.com',
17
+ url: 'https://your-docusaurus-site.example.com',
18
18
  // Set the /<baseUrl>/ pathname under which your site is served
19
19
  // For GitHub pages deployment, it is often '/<projectName>/'
20
20
  baseUrl: '/',
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docusaurus-2-classic-template",
3
- "version": "3.0.0-alpha.0",
3
+ "version": "3.0.0-beta.0",
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.0.0-alpha.0",
18
- "@docusaurus/preset-classic": "3.0.0-alpha.0",
17
+ "@docusaurus/core": "3.0.0-beta.0",
18
+ "@docusaurus/preset-classic": "3.0.0-beta.0",
19
19
  "@mdx-js/react": "^2.3.0",
20
20
  "clsx": "^1.2.1",
21
21
  "prism-react-renderer": "^1.3.5",
@@ -23,7 +23,7 @@
23
23
  "react-dom": "^18.0.0"
24
24
  },
25
25
  "devDependencies": {
26
- "@docusaurus/module-type-aliases": "3.0.0-alpha.0"
26
+ "@docusaurus/module-type-aliases": "3.0.0-beta.0"
27
27
  },
28
28
  "browserslist": {
29
29
  "production": [
@@ -32,9 +32,9 @@
32
32
  "not op_mini all"
33
33
  ],
34
34
  "development": [
35
- "last 1 chrome version",
36
- "last 1 firefox version",
37
- "last 1 safari version"
35
+ "last 3 chrome version",
36
+ "last 3 firefox version",
37
+ "last 5 safari version"
38
38
  ]
39
39
  },
40
40
  "engines": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docusaurus-2-classic-typescript-template",
3
- "version": "3.0.0-alpha.0",
3
+ "version": "3.0.0-beta.0",
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.0.0-alpha.0",
19
- "@docusaurus/preset-classic": "3.0.0-alpha.0",
18
+ "@docusaurus/core": "3.0.0-beta.0",
19
+ "@docusaurus/preset-classic": "3.0.0-beta.0",
20
20
  "@mdx-js/react": "^2.3.0",
21
21
  "clsx": "^1.2.1",
22
22
  "prism-react-renderer": "^1.3.5",
@@ -24,9 +24,9 @@
24
24
  "react-dom": "^18.0.0"
25
25
  },
26
26
  "devDependencies": {
27
- "@docusaurus/module-type-aliases": "3.0.0-alpha.0",
28
- "@docusaurus/tsconfig": "3.0.0-alpha.0",
29
- "typescript": "^5.0.4"
27
+ "@docusaurus/module-type-aliases": "3.0.0-beta.0",
28
+ "@docusaurus/tsconfig": "3.0.0-beta.0",
29
+ "typescript": "~5.2.2"
30
30
  },
31
31
  "browserslist": {
32
32
  "production": [
@@ -35,9 +35,9 @@
35
35
  "not op_mini all"
36
36
  ],
37
37
  "development": [
38
- "last 1 chrome version",
39
- "last 1 firefox version",
40
- "last 1 safari version"
38
+ "last 3 chrome version",
39
+ "last 3 firefox version",
40
+ "last 5 safari version"
41
41
  ]
42
42
  },
43
43
  "engines": {