mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-03 19:32:35 +02:00
refactor(v2): add common typing package @docusaurus/types
(#1797)
* add common typing package `@docusaurus/typing-common` . * change name to `@docusaurus/types` * refactor `packages/docusaurus/src/server/types` * use directly `index.d.ts` . * add missing dependency `@docusaurus/types` on `@docusaurus/core` * add missing dependency `@types/webpack` * fix mistaken type * typing package move to dev dependency * Update package.json see https://stackoverflow.com/questions/45176661/how-do-i-decide-whether-types-goes-into-dependencies-or-devdependencies
This commit is contained in:
parent
0397f7b719
commit
961eb44ab1
28 changed files with 81 additions and 113 deletions
|
@ -19,13 +19,13 @@ import {
|
|||
BlogContent,
|
||||
BlogItemsToModules,
|
||||
TagsModule,
|
||||
ConfigureWebpackUtils,
|
||||
} from './types';
|
||||
import {
|
||||
LoadContext,
|
||||
PluginContentLoadedActions,
|
||||
RouteModule,
|
||||
} from './typesDocusaurus';
|
||||
ConfigureWebpackUtils,
|
||||
} from '@docusaurus/types';
|
||||
import {Configuration} from 'webpack';
|
||||
|
||||
// YYYY-MM-DD-{name}.mdx?
|
||||
|
@ -57,7 +57,7 @@ export default function pluginContentBlog(
|
|||
context: LoadContext,
|
||||
opts: Partial<PluginOptions>,
|
||||
) {
|
||||
const options = {...DEFAULT_OPTIONS, ...opts};
|
||||
const options: PluginOptions = {...DEFAULT_OPTIONS, ...opts};
|
||||
const contentPath = path.resolve(context.siteDir, options.path);
|
||||
|
||||
return {
|
||||
|
@ -79,7 +79,7 @@ export default function pluginContentBlog(
|
|||
return null;
|
||||
}
|
||||
|
||||
const {baseUrl} = siteConfig;
|
||||
const {baseUrl = ''} = siteConfig;
|
||||
const blogFiles = await globby(include, {
|
||||
cwd: blogDir,
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue