create-docusaurus 3.0.0-beta.0 → 3.0.0-rc.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/lib/index.js CHANGED
@@ -95,15 +95,6 @@ async function readTemplates() {
95
95
  }
96
96
  async function copyTemplate(template, dest, typescript) {
97
97
  await fs.copy(path.join(templatesDir, 'shared'), dest);
98
- // TypeScript variants will copy duplicate resources like CSS & config from
99
- // base template
100
- if (typescript) {
101
- await fs.copy(template.path, dest, {
102
- filter: async (filePath) => (await fs.stat(filePath)).isDirectory() ||
103
- path.extname(filePath) === '.css' ||
104
- path.basename(filePath) === 'docusaurus.config.js',
105
- });
106
- }
107
98
  await fs.copy(typescript ? template.tsVariantPath : template.path, dest, {
108
99
  // Symlinks don't exist in published npm packages anymore, so this is only
109
100
  // to prevent errors during local testing
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-docusaurus",
3
- "version": "3.0.0-beta.0",
3
+ "version": "3.0.0-rc.0",
4
4
  "description": "Create Docusaurus apps easily.",
5
5
  "type": "module",
6
6
  "repository": {
@@ -22,8 +22,8 @@
22
22
  },
23
23
  "license": "MIT",
24
24
  "dependencies": {
25
- "@docusaurus/logger": "3.0.0-beta.0",
26
- "@docusaurus/utils": "3.0.0-beta.0",
25
+ "@docusaurus/logger": "3.0.0-rc.0",
26
+ "@docusaurus/utils": "3.0.0-rc.0",
27
27
  "commander": "^5.1.0",
28
28
  "fs-extra": "^11.1.1",
29
29
  "lodash": "^4.17.21",
@@ -37,7 +37,7 @@
37
37
  "@types/supports-color": "^8.1.1"
38
38
  },
39
39
  "engines": {
40
- "node": ">=16.14"
40
+ "node": ">=18.0"
41
41
  },
42
- "gitHead": "27a1e90d9fff88af90ecad35bea16d4d7230482a"
42
+ "gitHead": "e66dfe04d2972edce66f431908470c61340f8ffc"
43
43
  }
@@ -4,8 +4,7 @@
4
4
  // There are various equivalent ways to declare your Docusaurus config.
5
5
  // See: https://docusaurus.io/docs/api/docusaurus-config
6
6
 
7
- const lightCodeTheme = require('prism-react-renderer/themes/github');
8
- const darkCodeTheme = require('prism-react-renderer/themes/dracula');
7
+ import {themes as prismThemes} from 'prism-react-renderer';
9
8
 
10
9
  /** @type {import('@docusaurus/types').Config} */
11
10
  const config = {
@@ -41,7 +40,7 @@ const config = {
41
40
  /** @type {import('@docusaurus/preset-classic').Options} */
42
41
  ({
43
42
  docs: {
44
- sidebarPath: require.resolve('./sidebars.js'),
43
+ sidebarPath: './sidebars.js',
45
44
  // Please change this to your repo.
46
45
  // Remove this to remove the "edit this page" links.
47
46
  editUrl:
@@ -55,7 +54,7 @@ const config = {
55
54
  'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
56
55
  },
57
56
  theme: {
58
- customCss: require.resolve('./src/css/custom.css'),
57
+ customCss: './src/css/custom.css',
59
58
  },
60
59
  }),
61
60
  ],
@@ -133,10 +132,10 @@ const config = {
133
132
  copyright: `Copyright © ${new Date().getFullYear()} My Project, Inc. Built with Docusaurus.`,
134
133
  },
135
134
  prism: {
136
- theme: lightCodeTheme,
137
- darkTheme: darkCodeTheme,
135
+ theme: prismThemes.github,
136
+ darkTheme: prismThemes.dracula,
138
137
  },
139
138
  }),
140
139
  };
141
140
 
142
- module.exports = config;
141
+ export default config;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docusaurus-2-classic-template",
3
- "version": "3.0.0-beta.0",
3
+ "version": "3.0.0-rc.0",
4
4
  "private": true,
5
5
  "scripts": {
6
6
  "docusaurus": "docusaurus",
@@ -14,16 +14,17 @@
14
14
  "write-heading-ids": "docusaurus write-heading-ids"
15
15
  },
16
16
  "dependencies": {
17
- "@docusaurus/core": "3.0.0-beta.0",
18
- "@docusaurus/preset-classic": "3.0.0-beta.0",
17
+ "@docusaurus/core": "3.0.0-rc.0",
18
+ "@docusaurus/preset-classic": "3.0.0-rc.0",
19
19
  "@mdx-js/react": "^2.3.0",
20
20
  "clsx": "^1.2.1",
21
- "prism-react-renderer": "^1.3.5",
21
+ "prism-react-renderer": "^2.1.0",
22
22
  "react": "^18.0.0",
23
23
  "react-dom": "^18.0.0"
24
24
  },
25
25
  "devDependencies": {
26
- "@docusaurus/module-type-aliases": "3.0.0-beta.0"
26
+ "@docusaurus/module-type-aliases": "3.0.0-rc.0",
27
+ "@docusaurus/types": "3.0.0-rc.0"
27
28
  },
28
29
  "browserslist": {
29
30
  "production": [
@@ -38,6 +39,6 @@
38
39
  ]
39
40
  },
40
41
  "engines": {
41
- "node": ">=16.14"
42
+ "node": ">=18.0"
42
43
  }
43
44
  }
@@ -30,4 +30,4 @@ const sidebars = {
30
30
  */
31
31
  };
32
32
 
33
- module.exports = sidebars;
33
+ export default sidebars;
@@ -0,0 +1,133 @@
1
+ import {themes as prismThemes} from 'prism-react-renderer';
2
+ import type {Config} from '@docusaurus/types';
3
+ import type * as Preset from '@docusaurus/preset-classic';
4
+
5
+ const config: Config = {
6
+ title: 'My Site',
7
+ tagline: 'Dinosaurs are cool',
8
+ favicon: 'img/favicon.ico',
9
+
10
+ // Set the production url of your site here
11
+ url: 'https://your-docusaurus-site.example.com',
12
+ // Set the /<baseUrl>/ pathname under which your site is served
13
+ // For GitHub pages deployment, it is often '/<projectName>/'
14
+ baseUrl: '/',
15
+
16
+ // GitHub pages deployment config.
17
+ // If you aren't using GitHub pages, you don't need these.
18
+ organizationName: 'facebook', // Usually your GitHub org/user name.
19
+ projectName: 'docusaurus', // Usually your repo name.
20
+
21
+ onBrokenLinks: 'throw',
22
+ onBrokenMarkdownLinks: 'warn',
23
+
24
+ // Even if you don't use internationalization, you can use this field to set
25
+ // useful metadata like html lang. For example, if your site is Chinese, you
26
+ // may want to replace "en" with "zh-Hans".
27
+ i18n: {
28
+ defaultLocale: 'en',
29
+ locales: ['en'],
30
+ },
31
+
32
+ presets: [
33
+ [
34
+ 'classic',
35
+ {
36
+ docs: {
37
+ sidebarPath: './sidebars.ts',
38
+ // Please change this to your repo.
39
+ // Remove this to remove the "edit this page" links.
40
+ editUrl:
41
+ 'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
42
+ },
43
+ blog: {
44
+ showReadingTime: true,
45
+ // Please change this to your repo.
46
+ // Remove this to remove the "edit this page" links.
47
+ editUrl:
48
+ 'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
49
+ },
50
+ theme: {
51
+ customCss: './src/css/custom.css',
52
+ },
53
+ } satisfies Preset.Options,
54
+ ],
55
+ ],
56
+
57
+ themeConfig: {
58
+ // Replace with your project's social card
59
+ image: 'img/docusaurus-social-card.jpg',
60
+ navbar: {
61
+ title: 'My Site',
62
+ logo: {
63
+ alt: 'My Site Logo',
64
+ src: 'img/logo.svg',
65
+ },
66
+ items: [
67
+ {
68
+ type: 'docSidebar',
69
+ sidebarId: 'tutorialSidebar',
70
+ position: 'left',
71
+ label: 'Tutorial',
72
+ },
73
+ {to: '/blog', label: 'Blog', position: 'left'},
74
+ {
75
+ href: 'https://github.com/facebook/docusaurus',
76
+ label: 'GitHub',
77
+ position: 'right',
78
+ },
79
+ ],
80
+ },
81
+ footer: {
82
+ style: 'dark',
83
+ links: [
84
+ {
85
+ title: 'Docs',
86
+ items: [
87
+ {
88
+ label: 'Tutorial',
89
+ to: '/docs/intro',
90
+ },
91
+ ],
92
+ },
93
+ {
94
+ title: 'Community',
95
+ items: [
96
+ {
97
+ label: 'Stack Overflow',
98
+ href: 'https://stackoverflow.com/questions/tagged/docusaurus',
99
+ },
100
+ {
101
+ label: 'Discord',
102
+ href: 'https://discordapp.com/invite/docusaurus',
103
+ },
104
+ {
105
+ label: 'Twitter',
106
+ href: 'https://twitter.com/docusaurus',
107
+ },
108
+ ],
109
+ },
110
+ {
111
+ title: 'More',
112
+ items: [
113
+ {
114
+ label: 'Blog',
115
+ to: '/blog',
116
+ },
117
+ {
118
+ label: 'GitHub',
119
+ href: 'https://github.com/facebook/docusaurus',
120
+ },
121
+ ],
122
+ },
123
+ ],
124
+ copyright: `Copyright © ${new Date().getFullYear()} My Project, Inc. Built with Docusaurus.`,
125
+ },
126
+ prism: {
127
+ theme: prismThemes.github,
128
+ darkTheme: prismThemes.dracula,
129
+ },
130
+ } satisfies Preset.ThemeConfig,
131
+ };
132
+
133
+ export default config;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docusaurus-2-classic-typescript-template",
3
- "version": "3.0.0-beta.0",
3
+ "version": "3.0.0-rc.0",
4
4
  "private": true,
5
5
  "scripts": {
6
6
  "docusaurus": "docusaurus",
@@ -15,17 +15,18 @@
15
15
  "typecheck": "tsc"
16
16
  },
17
17
  "dependencies": {
18
- "@docusaurus/core": "3.0.0-beta.0",
19
- "@docusaurus/preset-classic": "3.0.0-beta.0",
18
+ "@docusaurus/core": "3.0.0-rc.0",
19
+ "@docusaurus/preset-classic": "3.0.0-rc.0",
20
20
  "@mdx-js/react": "^2.3.0",
21
21
  "clsx": "^1.2.1",
22
- "prism-react-renderer": "^1.3.5",
22
+ "prism-react-renderer": "^2.1.0",
23
23
  "react": "^18.0.0",
24
24
  "react-dom": "^18.0.0"
25
25
  },
26
26
  "devDependencies": {
27
- "@docusaurus/module-type-aliases": "3.0.0-beta.0",
28
- "@docusaurus/tsconfig": "3.0.0-beta.0",
27
+ "@docusaurus/module-type-aliases": "3.0.0-rc.0",
28
+ "@docusaurus/tsconfig": "3.0.0-rc.0",
29
+ "@docusaurus/types": "3.0.0-rc.0",
29
30
  "typescript": "~5.2.2"
30
31
  },
31
32
  "browserslist": {
@@ -41,6 +42,6 @@
41
42
  ]
42
43
  },
43
44
  "engines": {
44
- "node": ">=16.14"
45
+ "node": ">=18.0"
45
46
  }
46
47
  }
@@ -0,0 +1,31 @@
1
+ import type {SidebarsConfig} from '@docusaurus/plugin-content-docs';
2
+
3
+ /**
4
+ * Creating a sidebar enables you to:
5
+ - create an ordered group of docs
6
+ - render a sidebar for each doc of that group
7
+ - provide next/previous navigation
8
+
9
+ The sidebars can be generated from the filesystem, or explicitly defined here.
10
+
11
+ Create as many sidebars as you want.
12
+ */
13
+ const sidebars: SidebarsConfig = {
14
+ // By default, Docusaurus generates a sidebar from the docs folder structure
15
+ tutorialSidebar: [{type: 'autogenerated', dirName: '.'}],
16
+
17
+ // But you can create a sidebar manually
18
+ /*
19
+ tutorialSidebar: [
20
+ 'intro',
21
+ 'hello',
22
+ {
23
+ type: 'category',
24
+ label: 'Tutorial',
25
+ items: ['tutorial-basics/create-a-document'],
26
+ },
27
+ ],
28
+ */
29
+ };
30
+
31
+ export default sidebars;
@@ -14,7 +14,7 @@ Or **try Docusaurus immediately** with **[docusaurus.new](https://docusaurus.new
14
14
 
15
15
  ### What you'll need
16
16
 
17
- - [Node.js](https://nodejs.org/en/download/) version 16.14 or above:
17
+ - [Node.js](https://nodejs.org/en/download/) version 18.0 or above:
18
18
  - When installing Node.js, you are recommended to check all checkboxes related to dependencies.
19
19
 
20
20
  ## Generate a new site
@@ -42,7 +42,7 @@ This is my **first Docusaurus document**!
42
42
  It is also possible to create your sidebar explicitly in `sidebars.js`:
43
43
 
44
44
  ```js title="sidebars.js"
45
- module.exports = {
45
+ export default {
46
46
  tutorialSidebar: [
47
47
  'intro',
48
48
  // highlight-next-line
@@ -28,7 +28,7 @@ To navigate seamlessly across versions, add a version dropdown.
28
28
  Modify the `docusaurus.config.js` file:
29
29
 
30
30
  ```js title="docusaurus.config.js"
31
- module.exports = {
31
+ export default {
32
32
  themeConfig: {
33
33
  navbar: {
34
34
  items: [
@@ -11,7 +11,7 @@ Let's translate `docs/intro.md` to French.
11
11
  Modify `docusaurus.config.js` to add support for the `fr` locale:
12
12
 
13
13
  ```js title="docusaurus.config.js"
14
- module.exports = {
14
+ export default {
15
15
  i18n: {
16
16
  defaultLocale: 'en',
17
17
  locales: ['en', 'fr'],
@@ -54,7 +54,7 @@ To navigate seamlessly across languages, add a locale dropdown.
54
54
  Modify the `docusaurus.config.js` file:
55
55
 
56
56
  ```js title="docusaurus.config.js"
57
- module.exports = {
57
+ export default {
58
58
  themeConfig: {
59
59
  navbar: {
60
60
  items: [