-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core): support TypeScript + ESM configuration (#9317)
Co-authored-by: Joshua Chen <sidachen2003@gmail.com> Co-authored-by: sebastienlorber <lorber.sebastien@gmail.com>
- Loading branch information
1 parent
336a44f
commit 45f1a66
Showing
126 changed files
with
2,051 additions
and
911 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
133 changes: 133 additions & 0 deletions
133
packages/create-docusaurus/templates/classic-typescript/docusaurus.config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
import {themes as prismThemes} from 'prism-react-renderer'; | ||
import type {Config} from '@docusaurus/types'; | ||
import type * as Preset from '@docusaurus/preset-classic'; | ||
|
||
const config: Config = { | ||
title: 'My Site', | ||
tagline: 'Dinosaurs are cool', | ||
favicon: 'img/favicon.ico', | ||
|
||
// Set the production url of your site here | ||
url: 'https://your-docusaurus-site.example.com', | ||
// Set the /<baseUrl>/ pathname under which your site is served | ||
// For GitHub pages deployment, it is often '/<projectName>/' | ||
baseUrl: '/', | ||
|
||
// GitHub pages deployment config. | ||
// If you aren't using GitHub pages, you don't need these. | ||
organizationName: 'facebook', // Usually your GitHub org/user name. | ||
projectName: 'docusaurus', // Usually your repo name. | ||
|
||
onBrokenLinks: 'throw', | ||
onBrokenMarkdownLinks: 'warn', | ||
|
||
// Even if you don't use internationalization, you can use this field to set | ||
// useful metadata like html lang. For example, if your site is Chinese, you | ||
// may want to replace "en" with "zh-Hans". | ||
i18n: { | ||
defaultLocale: 'en', | ||
locales: ['en'], | ||
}, | ||
|
||
presets: [ | ||
[ | ||
'classic', | ||
{ | ||
docs: { | ||
sidebarPath: './sidebars.ts', | ||
// Please change this to your repo. | ||
// Remove this to remove the "edit this page" links. | ||
editUrl: | ||
'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/', | ||
}, | ||
blog: { | ||
showReadingTime: true, | ||
// Please change this to your repo. | ||
// Remove this to remove the "edit this page" links. | ||
editUrl: | ||
'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/', | ||
}, | ||
theme: { | ||
customCss: './src/css/custom.css', | ||
}, | ||
} satisfies Preset.Options, | ||
], | ||
], | ||
|
||
themeConfig: { | ||
// Replace with your project's social card | ||
image: 'img/docusaurus-social-card.jpg', | ||
navbar: { | ||
title: 'My Site', | ||
logo: { | ||
alt: 'My Site Logo', | ||
src: 'img/logo.svg', | ||
}, | ||
items: [ | ||
{ | ||
type: 'docSidebar', | ||
sidebarId: 'tutorialSidebar', | ||
position: 'left', | ||
label: 'Tutorial', | ||
}, | ||
{to: '/blog', label: 'Blog', position: 'left'}, | ||
{ | ||
href: 'https://github.com/facebook/docusaurus', | ||
label: 'GitHub', | ||
position: 'right', | ||
}, | ||
], | ||
}, | ||
footer: { | ||
style: 'dark', | ||
links: [ | ||
{ | ||
title: 'Docs', | ||
items: [ | ||
{ | ||
label: 'Tutorial', | ||
to: '/docs/intro', | ||
}, | ||
], | ||
}, | ||
{ | ||
title: 'Community', | ||
items: [ | ||
{ | ||
label: 'Stack Overflow', | ||
href: 'https://stackoverflow.com/questions/tagged/docusaurus', | ||
}, | ||
{ | ||
label: 'Discord', | ||
href: 'https://discordapp.com/invite/docusaurus', | ||
}, | ||
{ | ||
label: 'Twitter', | ||
href: 'https://twitter.com/docusaurus', | ||
}, | ||
], | ||
}, | ||
{ | ||
title: 'More', | ||
items: [ | ||
{ | ||
label: 'Blog', | ||
to: '/blog', | ||
}, | ||
{ | ||
label: 'GitHub', | ||
href: 'https://github.com/facebook/docusaurus', | ||
}, | ||
], | ||
}, | ||
], | ||
copyright: `Copyright © ${new Date().getFullYear()} My Project, Inc. Built with Docusaurus.`, | ||
}, | ||
prism: { | ||
theme: prismThemes.github, | ||
darkTheme: prismThemes.dracula, | ||
}, | ||
} satisfies Preset.ThemeConfig, | ||
}; | ||
|
||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
packages/create-docusaurus/templates/classic-typescript/sidebars.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import type {SidebarsConfig} from '@docusaurus/plugin-content-docs'; | ||
|
||
/** | ||
* Creating a sidebar enables you to: | ||
- create an ordered group of docs | ||
- render a sidebar for each doc of that group | ||
- provide next/previous navigation | ||
The sidebars can be generated from the filesystem, or explicitly defined here. | ||
Create as many sidebars as you want. | ||
*/ | ||
const sidebars: SidebarsConfig = { | ||
// By default, Docusaurus generates a sidebar from the docs folder structure | ||
tutorialSidebar: [{type: 'autogenerated', dirName: '.'}], | ||
|
||
// But you can create a sidebar manually | ||
/* | ||
tutorialSidebar: [ | ||
'intro', | ||
'hello', | ||
{ | ||
type: 'category', | ||
label: 'Tutorial', | ||
items: ['tutorial-basics/create-a-document'], | ||
}, | ||
], | ||
*/ | ||
}; | ||
|
||
export default sidebars; |
1 change: 0 additions & 1 deletion
1
...docusaurus/templates/classic-typescript/src/components/HomepageFeatures/styles.module.css
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
packages/create-docusaurus/templates/classic-typescript/src/pages/index.module.css
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,4 +30,4 @@ const sidebars = { | |
*/ | ||
}; | ||
|
||
module.exports = sidebars; | ||
export default sidebars; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.