@docusaurus/plugin-content-docs 0.0.0-5439 → 0.0.0-5449

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.
@@ -5,18 +5,18 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  import type { UseDataOptions } from '@docusaurus/types';
8
- export declare type ActivePlugin = {
8
+ export type ActivePlugin = {
9
9
  pluginId: string;
10
10
  pluginData: GlobalPluginData;
11
11
  };
12
- export declare type ActiveDocContext = {
12
+ export type ActiveDocContext = {
13
13
  activeVersion?: GlobalVersion;
14
14
  activeDoc?: GlobalDoc;
15
15
  alternateDocVersions: {
16
16
  [versionName: string]: GlobalDoc;
17
17
  };
18
18
  };
19
- export declare type GlobalDoc = {
19
+ export type GlobalDoc = {
20
20
  /**
21
21
  * For generated index pages, this is the `slug`, **not** `permalink`
22
22
  * (without base URL). Because slugs have leading slashes but IDs don't,
@@ -27,7 +27,7 @@ export declare type GlobalDoc = {
27
27
  sidebar?: string;
28
28
  unlisted?: boolean;
29
29
  };
30
- export declare type GlobalVersion = {
30
+ export type GlobalVersion = {
31
31
  name: string;
32
32
  label: string;
33
33
  isLast: boolean;
@@ -41,18 +41,18 @@ export declare type GlobalVersion = {
41
41
  [sidebarId: string]: GlobalSidebar;
42
42
  };
43
43
  };
44
- export declare type GlobalSidebar = {
44
+ export type GlobalSidebar = {
45
45
  link?: {
46
46
  label: string;
47
47
  path: string;
48
48
  };
49
49
  };
50
- export declare type GlobalPluginData = {
50
+ export type GlobalPluginData = {
51
51
  path: string;
52
52
  versions: GlobalVersion[];
53
53
  breadcrumbs: boolean;
54
54
  };
55
- export declare type DocVersionSuggestions = {
55
+ export type DocVersionSuggestions = {
56
56
  /** Suggest the latest version */
57
57
  latestVersionSuggestion: GlobalVersion;
58
58
  /** Suggest the same doc, in latest version (if one exists) */
package/lib/docs.d.ts CHANGED
@@ -10,7 +10,7 @@ import type { SidebarsUtils } from './sidebars/utils';
10
10
  import type { DocFile } from './types';
11
11
  export declare function readDocFile(versionMetadata: Pick<VersionMetadata, 'contentPath' | 'contentPathLocalized'>, source: string): Promise<DocFile>;
12
12
  export declare function readVersionDocs(versionMetadata: VersionMetadata, options: Pick<PluginOptions, 'include' | 'exclude' | 'showLastUpdateAuthor' | 'showLastUpdateTime'>): Promise<DocFile[]>;
13
- export declare type DocEnv = 'production' | 'development';
13
+ export type DocEnv = 'production' | 'development';
14
14
  export declare function processDocMetadata(args: {
15
15
  docFile: DocFile;
16
16
  versionMetadata: VersionMetadata;
package/lib/routes.d.ts CHANGED
@@ -7,11 +7,11 @@
7
7
  import type { PluginContentLoadedActions, RouteConfig } from '@docusaurus/types';
8
8
  import type { FullVersion } from './types';
9
9
  import type { PluginOptions } from '@docusaurus/plugin-content-docs';
10
- declare type BuildAllRoutesParam = Omit<CreateAllRoutesParam, 'actions'> & {
10
+ type BuildAllRoutesParam = Omit<CreateAllRoutesParam, 'actions'> & {
11
11
  actions: Omit<PluginContentLoadedActions, 'addRoute' | 'setGlobalData'>;
12
12
  };
13
13
  export declare function buildAllRoutes(param: BuildAllRoutesParam): Promise<RouteConfig[]>;
14
- declare type CreateAllRoutesParam = {
14
+ type CreateAllRoutesParam = {
15
15
  baseUrl: string;
16
16
  versions: FullVersion[];
17
17
  options: PluginOptions;
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  import type { Sidebars, SidebarProcessorParams, ProcessedSidebars } from './types';
8
- export declare type SidebarPostProcessorParams = SidebarProcessorParams & {
8
+ export type SidebarPostProcessorParams = SidebarProcessorParams & {
9
9
  draftIds: Set<string>;
10
10
  };
11
11
  export declare function postProcessSidebars(sidebars: ProcessedSidebars, params: SidebarProcessorParams): Sidebars;
@@ -7,18 +7,18 @@
7
7
  import type { Optional, Required } from 'utility-types';
8
8
  import type { NumberPrefixParser, SidebarOptions, CategoryIndexMatcher, DocMetadataBase, VersionMetadata } from '@docusaurus/plugin-content-docs';
9
9
  import type { Slugger } from '@docusaurus/utils';
10
- declare type Expand<T extends {
10
+ type Expand<T extends {
11
11
  [x: string]: unknown;
12
12
  }> = {
13
13
  [P in keyof T]: T[P];
14
14
  };
15
- export declare type SidebarItemBase = {
15
+ export type SidebarItemBase = {
16
16
  className?: string;
17
17
  customProps?: {
18
18
  [key: string]: unknown;
19
19
  };
20
20
  };
21
- export declare type SidebarItemDoc = SidebarItemBase & {
21
+ export type SidebarItemDoc = SidebarItemBase & {
22
22
  type: 'doc' | 'ref';
23
23
  label?: string;
24
24
  id: string;
@@ -28,32 +28,32 @@ export declare type SidebarItemDoc = SidebarItemBase & {
28
28
  */
29
29
  translatable?: true;
30
30
  };
31
- export declare type SidebarItemHtml = SidebarItemBase & {
31
+ export type SidebarItemHtml = SidebarItemBase & {
32
32
  type: 'html';
33
33
  value: string;
34
34
  defaultStyle?: boolean;
35
35
  };
36
- export declare type SidebarItemLink = SidebarItemBase & {
36
+ export type SidebarItemLink = SidebarItemBase & {
37
37
  type: 'link';
38
38
  href: string;
39
39
  label: string;
40
40
  autoAddBaseUrl?: boolean;
41
41
  };
42
- export declare type SidebarItemAutogenerated = SidebarItemBase & {
42
+ export type SidebarItemAutogenerated = SidebarItemBase & {
43
43
  type: 'autogenerated';
44
44
  dirName: string;
45
45
  };
46
- declare type SidebarItemCategoryBase = SidebarItemBase & {
46
+ type SidebarItemCategoryBase = SidebarItemBase & {
47
47
  type: 'category';
48
48
  label: string;
49
49
  collapsed: boolean;
50
50
  collapsible: boolean;
51
51
  };
52
- export declare type SidebarItemCategoryLinkDoc = {
52
+ export type SidebarItemCategoryLinkDoc = {
53
53
  type: 'doc';
54
54
  id: string;
55
55
  };
56
- export declare type SidebarItemCategoryLinkGeneratedIndexConfig = {
56
+ export type SidebarItemCategoryLinkGeneratedIndexConfig = {
57
57
  type: 'generated-index';
58
58
  slug?: string;
59
59
  title?: string;
@@ -61,7 +61,7 @@ export declare type SidebarItemCategoryLinkGeneratedIndexConfig = {
61
61
  image?: string;
62
62
  keywords?: string | readonly string[];
63
63
  };
64
- export declare type SidebarItemCategoryLinkGeneratedIndex = {
64
+ export type SidebarItemCategoryLinkGeneratedIndex = {
65
65
  type: 'generated-index';
66
66
  slug: string;
67
67
  permalink: string;
@@ -70,70 +70,70 @@ export declare type SidebarItemCategoryLinkGeneratedIndex = {
70
70
  image?: string;
71
71
  keywords?: string | readonly string[];
72
72
  };
73
- export declare type SidebarItemCategoryLinkConfig = SidebarItemCategoryLinkDoc | SidebarItemCategoryLinkGeneratedIndexConfig;
74
- export declare type SidebarItemCategoryLink = SidebarItemCategoryLinkDoc | SidebarItemCategoryLinkGeneratedIndex;
75
- export declare type SidebarItemCategoryConfig = Expand<Optional<SidebarItemCategoryBase, 'collapsed' | 'collapsible'> & {
73
+ export type SidebarItemCategoryLinkConfig = SidebarItemCategoryLinkDoc | SidebarItemCategoryLinkGeneratedIndexConfig;
74
+ export type SidebarItemCategoryLink = SidebarItemCategoryLinkDoc | SidebarItemCategoryLinkGeneratedIndex;
75
+ export type SidebarItemCategoryConfig = Expand<Optional<SidebarItemCategoryBase, 'collapsed' | 'collapsible'> & {
76
76
  items: SidebarCategoriesShorthand | SidebarItemConfig[];
77
77
  link?: SidebarItemCategoryLinkConfig;
78
78
  }>;
79
- export declare type SidebarCategoriesShorthand = {
79
+ export type SidebarCategoriesShorthand = {
80
80
  [sidebarCategory: string]: SidebarCategoriesShorthand | SidebarItemConfig[];
81
81
  };
82
- export declare type SidebarItemConfig = Omit<SidebarItemDoc, 'translatable'> | SidebarItemHtml | SidebarItemLink | SidebarItemAutogenerated | SidebarItemCategoryConfig | string | SidebarCategoriesShorthand;
83
- export declare type SidebarConfig = SidebarCategoriesShorthand | SidebarItemConfig[];
84
- export declare type SidebarsConfig = {
82
+ export type SidebarItemConfig = Omit<SidebarItemDoc, 'translatable'> | SidebarItemHtml | SidebarItemLink | SidebarItemAutogenerated | SidebarItemCategoryConfig | string | SidebarCategoriesShorthand;
83
+ export type SidebarConfig = SidebarCategoriesShorthand | SidebarItemConfig[];
84
+ export type SidebarsConfig = {
85
85
  [sidebarId: string]: SidebarConfig;
86
86
  };
87
- export declare type NormalizedSidebarItemCategory = Expand<Optional<SidebarItemCategoryBase, 'collapsed' | 'collapsible'> & {
87
+ export type NormalizedSidebarItemCategory = Expand<Optional<SidebarItemCategoryBase, 'collapsed' | 'collapsible'> & {
88
88
  items: NormalizedSidebarItem[];
89
89
  link?: SidebarItemCategoryLinkConfig;
90
90
  }>;
91
- export declare type NormalizedSidebarItem = SidebarItemDoc | SidebarItemHtml | SidebarItemLink | NormalizedSidebarItemCategory | SidebarItemAutogenerated;
92
- export declare type NormalizedSidebar = NormalizedSidebarItem[];
93
- export declare type NormalizedSidebars = {
91
+ export type NormalizedSidebarItem = SidebarItemDoc | SidebarItemHtml | SidebarItemLink | NormalizedSidebarItemCategory | SidebarItemAutogenerated;
92
+ export type NormalizedSidebar = NormalizedSidebarItem[];
93
+ export type NormalizedSidebars = {
94
94
  [sidebarId: string]: NormalizedSidebar;
95
95
  };
96
- export declare type ProcessedSidebarItemCategory = Expand<Optional<SidebarItemCategoryBase, 'collapsed' | 'collapsible'> & {
96
+ export type ProcessedSidebarItemCategory = Expand<Optional<SidebarItemCategoryBase, 'collapsed' | 'collapsible'> & {
97
97
  items: ProcessedSidebarItem[];
98
98
  link?: SidebarItemCategoryLinkConfig;
99
99
  }>;
100
- export declare type ProcessedSidebarItem = SidebarItemDoc | SidebarItemHtml | SidebarItemLink | ProcessedSidebarItemCategory;
101
- export declare type ProcessedSidebar = ProcessedSidebarItem[];
102
- export declare type ProcessedSidebars = {
100
+ export type ProcessedSidebarItem = SidebarItemDoc | SidebarItemHtml | SidebarItemLink | ProcessedSidebarItemCategory;
101
+ export type ProcessedSidebar = ProcessedSidebarItem[];
102
+ export type ProcessedSidebars = {
103
103
  [sidebarId: string]: ProcessedSidebar;
104
104
  };
105
- export declare type SidebarItemCategory = Expand<SidebarItemCategoryBase & {
105
+ export type SidebarItemCategory = Expand<SidebarItemCategoryBase & {
106
106
  items: SidebarItem[];
107
107
  link?: SidebarItemCategoryLink;
108
108
  }>;
109
- export declare type SidebarItemCategoryWithLink = Required<SidebarItemCategory, 'link'>;
110
- export declare type SidebarItemCategoryWithGeneratedIndex = SidebarItemCategoryWithLink & {
109
+ export type SidebarItemCategoryWithLink = Required<SidebarItemCategory, 'link'>;
110
+ export type SidebarItemCategoryWithGeneratedIndex = SidebarItemCategoryWithLink & {
111
111
  link: SidebarItemCategoryLinkGeneratedIndex;
112
112
  };
113
- export declare type SidebarItem = SidebarItemDoc | SidebarItemHtml | SidebarItemLink | SidebarItemCategory;
114
- export declare type SidebarNavigationItem = SidebarItemDoc | SidebarItemCategoryWithLink;
115
- export declare type Sidebar = SidebarItem[];
116
- export declare type SidebarItemType = SidebarItem['type'];
117
- export declare type Sidebars = {
113
+ export type SidebarItem = SidebarItemDoc | SidebarItemHtml | SidebarItemLink | SidebarItemCategory;
114
+ export type SidebarNavigationItem = SidebarItemDoc | SidebarItemCategoryWithLink;
115
+ export type Sidebar = SidebarItem[];
116
+ export type SidebarItemType = SidebarItem['type'];
117
+ export type Sidebars = {
118
118
  [sidebarId: string]: Sidebar;
119
119
  };
120
- export declare type PropSidebarItemCategory = Expand<SidebarItemCategoryBase & {
120
+ export type PropSidebarItemCategory = Expand<SidebarItemCategoryBase & {
121
121
  items: PropSidebarItem[];
122
122
  href?: string;
123
123
  linkUnlisted?: boolean;
124
124
  }>;
125
- export declare type PropSidebarItemLink = SidebarItemLink & {
125
+ export type PropSidebarItemLink = SidebarItemLink & {
126
126
  docId?: string;
127
127
  unlisted?: boolean;
128
128
  };
129
- export declare type PropSidebarItemHtml = SidebarItemHtml;
130
- export declare type PropSidebarItem = PropSidebarItemLink | PropSidebarItemCategory | PropSidebarItemHtml;
131
- export declare type PropSidebar = PropSidebarItem[];
132
- export declare type PropSidebars = {
129
+ export type PropSidebarItemHtml = SidebarItemHtml;
130
+ export type PropSidebarItem = PropSidebarItemLink | PropSidebarItemCategory | PropSidebarItemHtml;
131
+ export type PropSidebar = PropSidebarItem[];
132
+ export type PropSidebars = {
133
133
  [sidebarId: string]: PropSidebar;
134
134
  };
135
- export declare type PropSidebarBreadcrumbsItem = PropSidebarItemLink | PropSidebarItemCategory;
136
- export declare type CategoryMetadataFile = {
135
+ export type PropSidebarBreadcrumbsItem = PropSidebarItemLink | PropSidebarItemCategory;
136
+ export type CategoryMetadataFile = {
137
137
  label?: string;
138
138
  position?: number;
139
139
  collapsed?: boolean;
@@ -144,9 +144,9 @@ export declare type CategoryMetadataFile = {
144
144
  [key: string]: unknown;
145
145
  };
146
146
  };
147
- export declare type SidebarItemsGeneratorDoc = Pick<DocMetadataBase, 'id' | 'unversionedId' | 'title' | 'frontMatter' | 'source' | 'sourceDirName' | 'sidebarPosition'>;
148
- export declare type SidebarItemsGeneratorVersion = Pick<VersionMetadata, 'versionName' | 'contentPath'>;
149
- export declare type SidebarItemsGeneratorArgs = {
147
+ export type SidebarItemsGeneratorDoc = Pick<DocMetadataBase, 'id' | 'unversionedId' | 'title' | 'frontMatter' | 'source' | 'sourceDirName' | 'sidebarPosition'>;
148
+ export type SidebarItemsGeneratorVersion = Pick<VersionMetadata, 'versionName' | 'contentPath'>;
149
+ export type SidebarItemsGeneratorArgs = {
150
150
  /** The sidebar item with type "autogenerated" to be transformed. */
151
151
  item: SidebarItemAutogenerated;
152
152
  /** Useful metadata for the version this sidebar belongs to. */
@@ -165,8 +165,8 @@ export declare type SidebarItemsGeneratorArgs = {
165
165
  [filePath: string]: CategoryMetadataFile;
166
166
  };
167
167
  };
168
- export declare type SidebarItemsGenerator = (generatorArgs: SidebarItemsGeneratorArgs) => NormalizedSidebar | Promise<NormalizedSidebar>;
169
- export declare type SidebarItemsGeneratorOption = (generatorArgs: {
168
+ export type SidebarItemsGenerator = (generatorArgs: SidebarItemsGeneratorArgs) => NormalizedSidebar | Promise<NormalizedSidebar>;
169
+ export type SidebarItemsGeneratorOption = (generatorArgs: {
170
170
  /**
171
171
  * Useful to re-use/enhance the default sidebar generation logic from
172
172
  * Docusaurus.
@@ -174,7 +174,7 @@ export declare type SidebarItemsGeneratorOption = (generatorArgs: {
174
174
  */
175
175
  defaultSidebarItemsGenerator: SidebarItemsGenerator;
176
176
  } & SidebarItemsGeneratorArgs) => NormalizedSidebar | Promise<NormalizedSidebar>;
177
- export declare type SidebarProcessorParams = {
177
+ export type SidebarProcessorParams = {
178
178
  sidebarItemsGenerator: SidebarItemsGeneratorOption;
179
179
  numberPrefixParser: NumberPrefixParser;
180
180
  docs: DocMetadataBase[];
@@ -20,12 +20,12 @@ export declare function collectSidebarsDocIds(sidebars: Sidebars): {
20
20
  export declare function collectSidebarsNavigations(sidebars: Sidebars): {
21
21
  [sidebarId: string]: SidebarNavigationItem[];
22
22
  };
23
- export declare type SidebarNavigation = {
23
+ export type SidebarNavigation = {
24
24
  sidebarName: string | undefined;
25
25
  previous: SidebarNavigationItem | undefined;
26
26
  next: SidebarNavigationItem | undefined;
27
27
  };
28
- export declare type SidebarsUtils = {
28
+ export type SidebarsUtils = {
29
29
  sidebars: Sidebars;
30
30
  getFirstDocIdOfFirstSidebar: () => string | undefined;
31
31
  getSidebarNameByDocId: (docId: string) => string | undefined;
package/lib/types.d.ts CHANGED
@@ -7,29 +7,29 @@
7
7
  import type { BrokenMarkdownLink, Tag } from '@docusaurus/utils';
8
8
  import type { VersionMetadata, LoadedVersion, CategoryGeneratedIndexMetadata } from '@docusaurus/plugin-content-docs';
9
9
  import type { SidebarsUtils } from './sidebars/utils';
10
- export declare type DocFile = {
10
+ export type DocFile = {
11
11
  contentPath: string;
12
12
  filePath: string;
13
13
  source: string;
14
14
  content: string;
15
15
  };
16
- export declare type SourceToPermalink = {
16
+ export type SourceToPermalink = {
17
17
  [source: string]: string;
18
18
  };
19
- export declare type VersionTag = Tag & {
19
+ export type VersionTag = Tag & {
20
20
  /** All doc ids having this tag. */
21
21
  docIds: string[];
22
22
  unlisted: boolean;
23
23
  };
24
- export declare type VersionTags = {
24
+ export type VersionTags = {
25
25
  [permalink: string]: VersionTag;
26
26
  };
27
- export declare type FullVersion = LoadedVersion & {
27
+ export type FullVersion = LoadedVersion & {
28
28
  sidebarsUtils: SidebarsUtils;
29
29
  categoryGeneratedIndices: CategoryGeneratedIndexMetadata[];
30
30
  };
31
- export declare type DocBrokenMarkdownLink = BrokenMarkdownLink<VersionMetadata>;
32
- export declare type DocsMarkdownOption = {
31
+ export type DocBrokenMarkdownLink = BrokenMarkdownLink<VersionMetadata>;
32
+ export type DocsMarkdownOption = {
33
33
  versionsMetadata: VersionMetadata[];
34
34
  siteDir: string;
35
35
  sourceToPermalink: SourceToPermalink;
@@ -7,7 +7,7 @@
7
7
  import type { FullVersion } from '../types';
8
8
  import type { LoadContext } from '@docusaurus/types';
9
9
  import type { LoadedVersion, PluginOptions, VersionBanner, VersionMetadata } from '@docusaurus/plugin-content-docs';
10
- export declare type VersionContext = {
10
+ export type VersionContext = {
11
11
  /** The version name to get banner of. */
12
12
  versionName: string;
13
13
  /** All versions, ordered from newest to oldest. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docusaurus/plugin-content-docs",
3
- "version": "0.0.0-5439",
3
+ "version": "0.0.0-5449",
4
4
  "description": "Docs plugin for Docusaurus.",
5
5
  "main": "lib/index.js",
6
6
  "sideEffects": false,
@@ -35,22 +35,22 @@
35
35
  },
36
36
  "license": "MIT",
37
37
  "dependencies": {
38
- "@docusaurus/core": "0.0.0-5439",
39
- "@docusaurus/logger": "0.0.0-5439",
40
- "@docusaurus/mdx-loader": "0.0.0-5439",
41
- "@docusaurus/module-type-aliases": "0.0.0-5439",
42
- "@docusaurus/types": "0.0.0-5439",
43
- "@docusaurus/utils": "0.0.0-5439",
44
- "@docusaurus/utils-validation": "0.0.0-5439",
38
+ "@docusaurus/core": "0.0.0-5449",
39
+ "@docusaurus/logger": "0.0.0-5449",
40
+ "@docusaurus/mdx-loader": "0.0.0-5449",
41
+ "@docusaurus/module-type-aliases": "0.0.0-5449",
42
+ "@docusaurus/types": "0.0.0-5449",
43
+ "@docusaurus/utils": "0.0.0-5449",
44
+ "@docusaurus/utils-validation": "0.0.0-5449",
45
45
  "@types/react-router-config": "^5.0.6",
46
46
  "combine-promises": "^1.1.0",
47
- "fs-extra": "^10.1.0",
47
+ "fs-extra": "^11.1.0",
48
48
  "import-fresh": "^3.3.0",
49
49
  "js-yaml": "^4.1.0",
50
50
  "lodash": "^4.17.21",
51
- "tslib": "^2.4.0",
51
+ "tslib": "^2.4.1",
52
52
  "utility-types": "^3.10.0",
53
- "webpack": "^5.74.0"
53
+ "webpack": "^5.75.0"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@types/js-yaml": "^4.0.5",
@@ -66,5 +66,5 @@
66
66
  "engines": {
67
67
  "node": ">=16.14"
68
68
  },
69
- "gitHead": "1ab77d04f08d6b0d97d8004b2c5bde18ef5ffe27"
69
+ "gitHead": "46fe5ffd9189c11945c3c150c17c7f048e92b398"
70
70
  }