@docusaurus/plugin-content-docs 2.0.0-beta.12faed89d → 2.0.0-beta.13

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.
Files changed (138) hide show
  1. package/lib/.tsbuildinfo +1 -1
  2. package/lib/categoryGeneratedIndex.d.ts +12 -0
  3. package/lib/categoryGeneratedIndex.js +37 -0
  4. package/lib/cli.d.ts +2 -2
  5. package/lib/cli.js +12 -34
  6. package/lib/client/docsClientUtils.d.ts +0 -3
  7. package/lib/client/docsClientUtils.js +19 -22
  8. package/lib/docFrontMatter.d.ts +1 -1
  9. package/lib/docFrontMatter.js +7 -3
  10. package/lib/docs.d.ts +25 -3
  11. package/lib/docs.js +125 -41
  12. package/lib/globalData.d.ts +1 -1
  13. package/lib/index.d.ts +1 -1
  14. package/lib/index.js +100 -131
  15. package/lib/lastUpdate.js +8 -9
  16. package/lib/markdown/index.d.ts +3 -6
  17. package/lib/markdown/index.js +3 -3
  18. package/lib/markdown/linkify.js +2 -2
  19. package/lib/numberPrefix.d.ts +1 -1
  20. package/lib/options.d.ts +3 -3
  21. package/lib/options.js +48 -11
  22. package/lib/props.d.ts +7 -2
  23. package/lib/props.js +60 -8
  24. package/lib/routes.d.ts +27 -0
  25. package/lib/routes.js +105 -0
  26. package/lib/{sidebarItemsGenerator.d.ts → sidebars/generator.d.ts} +5 -2
  27. package/lib/sidebars/generator.js +216 -0
  28. package/lib/sidebars/index.d.ts +15 -0
  29. package/lib/sidebars/index.js +73 -0
  30. package/lib/sidebars/normalization.d.ts +14 -0
  31. package/lib/sidebars/normalization.js +77 -0
  32. package/lib/sidebars/processor.d.ts +18 -0
  33. package/lib/sidebars/processor.js +85 -0
  34. package/lib/sidebars/types.d.ts +127 -0
  35. package/lib/sidebars/types.js +8 -0
  36. package/lib/sidebars/utils.d.ts +35 -0
  37. package/lib/sidebars/utils.js +228 -0
  38. package/lib/sidebars/validation.d.ts +10 -0
  39. package/lib/sidebars/validation.js +138 -0
  40. package/lib/slug.d.ts +4 -3
  41. package/lib/slug.js +27 -15
  42. package/lib/tags.d.ts +8 -0
  43. package/lib/tags.js +20 -0
  44. package/lib/theme/hooks/useDocs.js +21 -21
  45. package/lib/translations.d.ts +2 -2
  46. package/lib/translations.js +71 -29
  47. package/lib/types.d.ts +52 -63
  48. package/lib/versions.d.ts +3 -3
  49. package/lib/versions.js +41 -22
  50. package/package.json +20 -20
  51. package/src/__tests__/__fixtures__/simple-site/docs/_partials/somePartial.md +3 -0
  52. package/src/__tests__/__fixtures__/simple-site/docs/_partials/subfolder/somePartial.md +3 -0
  53. package/src/__tests__/__fixtures__/simple-site/docs/_somePartial.md +3 -0
  54. package/src/__tests__/__fixtures__/simple-site/docs/foo/baz.md +5 -0
  55. package/src/__tests__/__fixtures__/simple-site/docs/hello.md +2 -0
  56. package/src/__tests__/__fixtures__/simple-site/docs/rootAbsoluteSlug.md +2 -0
  57. package/src/__tests__/__fixtures__/simple-site/docs/rootRelativeSlug.md +2 -0
  58. package/src/__tests__/__fixtures__/simple-site/docs/rootResolvedSlug.md +2 -0
  59. package/src/__tests__/__fixtures__/simple-site/docs/rootTryToEscapeSlug.md +2 -0
  60. package/src/__tests__/__fixtures__/simple-site/sidebars.json +15 -1
  61. package/src/__tests__/__fixtures__/site-with-doc-label/docs/hello-1.md +1 -0
  62. package/src/__tests__/__fixtures__/versioned-site/docs/foo/bar.md +6 -0
  63. package/src/__tests__/__fixtures__/versioned-site/docs/hello.md +3 -0
  64. package/src/__tests__/__fixtures__/versioned-site/i18n/en/docusaurus-plugin-content-docs/version-1.0.0/hello.md +3 -0
  65. package/src/__tests__/__fixtures__/versioned-site/i18n/fr/docusaurus-plugin-content-docs/version-1.0.0/hello.md +3 -0
  66. package/src/__tests__/__fixtures__/versioned-site/versioned_docs/version-1.0.0/hello.md +3 -0
  67. package/src/__tests__/__fixtures__/versioned-site/versioned_docs/version-1.0.1/_partials/somePartial.md +3 -0
  68. package/src/__tests__/__fixtures__/versioned-site/versioned_docs/version-1.0.1/_partials/subfolder/somePartial.md +3 -0
  69. package/src/__tests__/__fixtures__/versioned-site/versioned_docs/version-1.0.1/_somePartial.md +3 -0
  70. package/src/__tests__/__fixtures__/versioned-site/versioned_docs/version-1.0.1/hello.md +3 -0
  71. package/src/__tests__/__fixtures__/versioned-site/versioned_sidebars/version-1.0.1-sidebars.json +2 -2
  72. package/src/__tests__/__snapshots__/cli.test.ts.snap +48 -73
  73. package/src/__tests__/__snapshots__/docs.test.ts.snap +140 -0
  74. package/src/__tests__/__snapshots__/index.test.ts.snap +745 -97
  75. package/src/__tests__/__snapshots__/translations.test.ts.snap +45 -15
  76. package/src/__tests__/cli.test.ts +15 -11
  77. package/src/__tests__/docFrontMatter.test.ts +160 -45
  78. package/src/__tests__/docs.test.ts +311 -150
  79. package/src/__tests__/index.test.ts +108 -66
  80. package/src/__tests__/lastUpdate.test.ts +1 -1
  81. package/src/__tests__/options.test.ts +48 -3
  82. package/src/__tests__/props.test.ts +62 -0
  83. package/src/__tests__/slug.test.ts +127 -20
  84. package/src/__tests__/translations.test.ts +7 -1
  85. package/src/__tests__/versions.test.ts +73 -70
  86. package/src/categoryGeneratedIndex.ts +57 -0
  87. package/src/cli.ts +8 -41
  88. package/src/client/docsClientUtils.ts +14 -26
  89. package/{types.d.ts → src/deps.d.ts} +0 -0
  90. package/src/docFrontMatter.ts +9 -4
  91. package/src/docs.ts +158 -32
  92. package/src/globalData.ts +6 -1
  93. package/src/index.ts +125 -169
  94. package/src/lastUpdate.ts +10 -13
  95. package/src/markdown/index.ts +8 -12
  96. package/src/numberPrefix.ts +5 -3
  97. package/src/options.ts +59 -14
  98. package/src/plugin-content-docs.d.ts +173 -40
  99. package/src/props.ts +90 -15
  100. package/src/routes.ts +173 -0
  101. package/src/{__tests__ → sidebars/__tests__}/__fixtures__/sidebars/sidebars-category-shorthand.js +0 -0
  102. package/src/{__tests__ → sidebars/__tests__}/__fixtures__/sidebars/sidebars-category-wrong-items.json +0 -0
  103. package/src/{__tests__ → sidebars/__tests__}/__fixtures__/sidebars/sidebars-category-wrong-label.json +0 -0
  104. package/src/{__tests__ → sidebars/__tests__}/__fixtures__/sidebars/sidebars-category.js +0 -0
  105. package/src/{__tests__ → sidebars/__tests__}/__fixtures__/sidebars/sidebars-collapsed-first-level.json +0 -0
  106. package/src/{__tests__ → sidebars/__tests__}/__fixtures__/sidebars/sidebars-collapsed.json +0 -0
  107. package/src/{__tests__ → sidebars/__tests__}/__fixtures__/sidebars/sidebars-doc-id-not-string.json +0 -0
  108. package/src/{__tests__ → sidebars/__tests__}/__fixtures__/sidebars/sidebars-first-level-not-category.js +0 -0
  109. package/src/{__tests__ → sidebars/__tests__}/__fixtures__/sidebars/sidebars-link-wrong-href.json +0 -0
  110. package/src/{__tests__ → sidebars/__tests__}/__fixtures__/sidebars/sidebars-link-wrong-label.json +0 -0
  111. package/src/{__tests__ → sidebars/__tests__}/__fixtures__/sidebars/sidebars-link.json +0 -0
  112. package/src/{__tests__ → sidebars/__tests__}/__fixtures__/sidebars/sidebars-unknown-type.json +0 -0
  113. package/src/{__tests__ → sidebars/__tests__}/__fixtures__/sidebars/sidebars-wrong-field.json +0 -0
  114. package/src/{__tests__ → sidebars/__tests__}/__fixtures__/sidebars/sidebars.json +0 -0
  115. package/src/{__tests__/__snapshots__/sidebars.test.ts.snap → sidebars/__tests__/__snapshots__/index.test.ts.snap} +36 -6
  116. package/src/{__tests__/sidebarItemsGenerator.test.ts → sidebars/__tests__/generator.test.ts} +143 -18
  117. package/src/sidebars/__tests__/index.test.ts +204 -0
  118. package/src/sidebars/__tests__/processor.test.ts +237 -0
  119. package/src/sidebars/__tests__/utils.test.ts +695 -0
  120. package/src/sidebars/__tests__/validation.test.ts +105 -0
  121. package/src/sidebars/generator.ts +310 -0
  122. package/src/sidebars/index.ts +94 -0
  123. package/src/sidebars/normalization.ts +112 -0
  124. package/src/sidebars/processor.ts +154 -0
  125. package/src/sidebars/types.ts +211 -0
  126. package/src/sidebars/utils.ts +329 -0
  127. package/src/sidebars/validation.ts +168 -0
  128. package/src/slug.ts +32 -17
  129. package/src/tags.ts +19 -0
  130. package/src/translations.ts +103 -47
  131. package/src/types.ts +64 -107
  132. package/src/versions.ts +59 -25
  133. package/lib/sidebarItemsGenerator.js +0 -211
  134. package/lib/sidebars.d.ts +0 -43
  135. package/lib/sidebars.js +0 -320
  136. package/src/__tests__/sidebars.test.ts +0 -639
  137. package/src/sidebarItemsGenerator.ts +0 -307
  138. package/src/sidebars.ts +0 -522
package/lib/sidebars.js DELETED
@@ -1,320 +0,0 @@
1
- "use strict";
2
- /**
3
- * Copyright (c) Facebook, Inc. and its affiliates.
4
- *
5
- * This source code is licensed under the MIT license found in the
6
- * LICENSE file in the root directory of this source tree.
7
- */
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.createSidebarsUtils = exports.collectSidebarsDocIds = exports.transformSidebarItems = exports.collectSidebarLinks = exports.collectSidebarCategories = exports.collectSidebarDocItems = exports.processSidebars = exports.processSidebar = exports.toSidebarItemsGeneratorVersion = exports.toSidebarItemsGeneratorDoc = exports.loadSidebars = exports.resolveSidebarPathOption = exports.DisabledSidebars = exports.DefaultSidebars = exports.DefaultCategoryCollapsedValue = void 0;
10
- const tslib_1 = require("tslib");
11
- const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
12
- const import_fresh_1 = tslib_1.__importDefault(require("import-fresh"));
13
- const lodash_1 = require("lodash");
14
- const utils_1 = require("@docusaurus/utils");
15
- const combine_promises_1 = tslib_1.__importDefault(require("combine-promises"));
16
- const sidebarItemsGenerator_1 = require("./sidebarItemsGenerator");
17
- const path_1 = tslib_1.__importDefault(require("path"));
18
- function isCategoryShorthand(item) {
19
- return typeof item !== 'string' && !item.type;
20
- }
21
- // categories are collapsed by default, unless user set collapsed = false
22
- exports.DefaultCategoryCollapsedValue = true;
23
- /**
24
- * Convert {category1: [item1,item2]} shorthand syntax to long-form syntax
25
- */
26
- function normalizeCategoryShorthand(sidebar) {
27
- return Object.entries(sidebar).map(([label, items]) => ({
28
- type: 'category',
29
- collapsed: exports.DefaultCategoryCollapsedValue,
30
- label,
31
- items,
32
- }));
33
- }
34
- /**
35
- * Check that item contains only allowed keys.
36
- */
37
- function assertItem(item, keys) {
38
- const unknownKeys = Object.keys(item).filter(
39
- // @ts-expect-error: key is always string
40
- (key) => !keys.includes(key) && key !== 'type');
41
- if (unknownKeys.length) {
42
- throw new Error(`Unknown sidebar item keys: ${unknownKeys}. Item: ${JSON.stringify(item)}`);
43
- }
44
- }
45
- function assertIsCategory(item) {
46
- assertItem(item, ['items', 'label', 'collapsed', 'customProps']);
47
- if (typeof item.label !== 'string') {
48
- throw new Error(`Error loading ${JSON.stringify(item)}: "label" must be a string.`);
49
- }
50
- if (!Array.isArray(item.items)) {
51
- throw new Error(`Error loading ${JSON.stringify(item)}: "items" must be an array.`);
52
- }
53
- // "collapsed" is an optional property
54
- if (typeof item.collapsed !== 'undefined' &&
55
- typeof item.collapsed !== 'boolean') {
56
- throw new Error(`Error loading ${JSON.stringify(item)}: "collapsed" must be a boolean.`);
57
- }
58
- }
59
- function assertIsAutogenerated(item) {
60
- assertItem(item, ['dirName', 'customProps']);
61
- if (typeof item.dirName !== 'string') {
62
- throw new Error(`Error loading ${JSON.stringify(item)}: "dirName" must be a string.`);
63
- }
64
- if (item.dirName.startsWith('/') || item.dirName.endsWith('/')) {
65
- throw new Error(`Error loading ${JSON.stringify(item)}: "dirName" must be a dir path relative to the docs folder root, and should not start or end with slash`);
66
- }
67
- }
68
- function assertIsDoc(item) {
69
- assertItem(item, ['id', 'label', 'customProps']);
70
- if (typeof item.id !== 'string') {
71
- throw new Error(`Error loading ${JSON.stringify(item)}: "id" must be a string.`);
72
- }
73
- if (item.label && typeof item.label !== 'string') {
74
- throw new Error(`Error loading ${JSON.stringify(item)}: "label" must be a string.`);
75
- }
76
- }
77
- function assertIsLink(item) {
78
- assertItem(item, ['href', 'label', 'customProps']);
79
- if (typeof item.href !== 'string') {
80
- throw new Error(`Error loading ${JSON.stringify(item)}: "href" must be a string.`);
81
- }
82
- if (typeof item.label !== 'string') {
83
- throw new Error(`Error loading ${JSON.stringify(item)}: "label" must be a string.`);
84
- }
85
- }
86
- /**
87
- * Normalizes recursively item and all its children. Ensures that at the end
88
- * each item will be an object with the corresponding type.
89
- */
90
- function normalizeItem(item) {
91
- if (typeof item === 'string') {
92
- return [
93
- {
94
- type: 'doc',
95
- id: item,
96
- },
97
- ];
98
- }
99
- if (isCategoryShorthand(item)) {
100
- return lodash_1.flatMap(normalizeCategoryShorthand(item), normalizeItem);
101
- }
102
- switch (item.type) {
103
- case 'category':
104
- assertIsCategory(item);
105
- return [
106
- {
107
- collapsed: exports.DefaultCategoryCollapsedValue,
108
- ...item,
109
- items: lodash_1.flatMap(item.items, normalizeItem),
110
- },
111
- ];
112
- case 'autogenerated':
113
- assertIsAutogenerated(item);
114
- return [item];
115
- case 'link':
116
- assertIsLink(item);
117
- return [item];
118
- case 'ref':
119
- case 'doc':
120
- assertIsDoc(item);
121
- return [item];
122
- default: {
123
- const extraMigrationError = item.type === 'subcategory'
124
- ? 'Docusaurus v2: "subcategory" has been renamed as "category".'
125
- : '';
126
- throw new Error(`Unknown sidebar item type "${item.type}". Sidebar item is ${JSON.stringify(item)}.\n${extraMigrationError}`);
127
- }
128
- }
129
- }
130
- function normalizeSidebar(sidebar) {
131
- const normalizedSidebar = Array.isArray(sidebar)
132
- ? sidebar
133
- : normalizeCategoryShorthand(sidebar);
134
- return lodash_1.flatMap(normalizedSidebar, normalizeItem);
135
- }
136
- function normalizeSidebars(sidebars) {
137
- return lodash_1.mapValues(sidebars, normalizeSidebar);
138
- }
139
- exports.DefaultSidebars = {
140
- defaultSidebar: [
141
- {
142
- type: 'autogenerated',
143
- dirName: '.',
144
- },
145
- ],
146
- };
147
- exports.DisabledSidebars = {};
148
- // If a path is provided, make it absolute
149
- // use this before loadSidebars()
150
- function resolveSidebarPathOption(siteDir, sidebarPathOption) {
151
- return sidebarPathOption
152
- ? path_1.default.resolve(siteDir, sidebarPathOption)
153
- : sidebarPathOption;
154
- }
155
- exports.resolveSidebarPathOption = resolveSidebarPathOption;
156
- // TODO refactor: make async
157
- // Note: sidebarFilePath must be absolute, use resolveSidebarPathOption
158
- function loadSidebars(sidebarFilePath) {
159
- // false => no sidebars
160
- if (sidebarFilePath === false) {
161
- return exports.DisabledSidebars;
162
- }
163
- // undefined => defaults to autogenerated sidebars
164
- if (typeof sidebarFilePath === 'undefined') {
165
- return exports.DefaultSidebars;
166
- }
167
- // unexisting sidebars file: no sidebars
168
- // Note: this edge case can happen on versioned docs, not current version
169
- // We avoid creating empty versioned sidebars file with the CLI
170
- if (!fs_extra_1.default.existsSync(sidebarFilePath)) {
171
- return exports.DisabledSidebars;
172
- }
173
- // We don't want sidebars to be cached because of hot reloading.
174
- const sidebarJson = import_fresh_1.default(sidebarFilePath);
175
- return normalizeSidebars(sidebarJson);
176
- }
177
- exports.loadSidebars = loadSidebars;
178
- function toSidebarItemsGeneratorDoc(doc) {
179
- return lodash_1.pick(doc, [
180
- 'id',
181
- 'frontMatter',
182
- 'source',
183
- 'sourceDirName',
184
- 'sidebarPosition',
185
- ]);
186
- }
187
- exports.toSidebarItemsGeneratorDoc = toSidebarItemsGeneratorDoc;
188
- function toSidebarItemsGeneratorVersion(version) {
189
- return lodash_1.pick(version, ['versionName', 'contentPath']);
190
- }
191
- exports.toSidebarItemsGeneratorVersion = toSidebarItemsGeneratorVersion;
192
- // Handle the generation of autogenerated sidebar items
193
- async function processSidebar({ sidebarItemsGenerator, numberPrefixParser, unprocessedSidebar, docs, version, }) {
194
- // Just a minor lazy transformation optimization
195
- const getSidebarItemsGeneratorDocsAndVersion = lodash_1.memoize(() => ({
196
- docs: docs.map(toSidebarItemsGeneratorDoc),
197
- version: toSidebarItemsGeneratorVersion(version),
198
- }));
199
- async function processRecursive(item) {
200
- if (item.type === 'category') {
201
- return [
202
- {
203
- ...item,
204
- items: (await Promise.all(item.items.map(processRecursive))).flat(),
205
- },
206
- ];
207
- }
208
- if (item.type === 'autogenerated') {
209
- return sidebarItemsGenerator({
210
- item,
211
- numberPrefixParser,
212
- defaultSidebarItemsGenerator: sidebarItemsGenerator_1.DefaultSidebarItemsGenerator,
213
- ...getSidebarItemsGeneratorDocsAndVersion(),
214
- });
215
- }
216
- return [item];
217
- }
218
- return (await Promise.all(unprocessedSidebar.map(processRecursive))).flat();
219
- }
220
- exports.processSidebar = processSidebar;
221
- async function processSidebars({ sidebarItemsGenerator, numberPrefixParser, unprocessedSidebars, docs, version, }) {
222
- return combine_promises_1.default(lodash_1.mapValues(unprocessedSidebars, (unprocessedSidebar) => processSidebar({
223
- sidebarItemsGenerator,
224
- numberPrefixParser,
225
- unprocessedSidebar,
226
- docs,
227
- version,
228
- })));
229
- }
230
- exports.processSidebars = processSidebars;
231
- function collectSidebarItemsOfType(type, sidebar) {
232
- function collectRecursive(item) {
233
- const currentItemsCollected = item.type === type ? [item] : [];
234
- const childItemsCollected = item.type === 'category' ? lodash_1.flatten(item.items.map(collectRecursive)) : [];
235
- return [...currentItemsCollected, ...childItemsCollected];
236
- }
237
- return lodash_1.flatten(sidebar.map(collectRecursive));
238
- }
239
- function collectSidebarDocItems(sidebar) {
240
- return collectSidebarItemsOfType('doc', sidebar);
241
- }
242
- exports.collectSidebarDocItems = collectSidebarDocItems;
243
- function collectSidebarCategories(sidebar) {
244
- return collectSidebarItemsOfType('category', sidebar);
245
- }
246
- exports.collectSidebarCategories = collectSidebarCategories;
247
- function collectSidebarLinks(sidebar) {
248
- return collectSidebarItemsOfType('link', sidebar);
249
- }
250
- exports.collectSidebarLinks = collectSidebarLinks;
251
- function transformSidebarItems(sidebar, updateFn) {
252
- function transformRecursive(item) {
253
- if (item.type === 'category') {
254
- return updateFn({
255
- ...item,
256
- items: item.items.map(transformRecursive),
257
- });
258
- }
259
- return updateFn(item);
260
- }
261
- return sidebar.map(transformRecursive);
262
- }
263
- exports.transformSidebarItems = transformSidebarItems;
264
- function collectSidebarsDocIds(sidebars) {
265
- return lodash_1.mapValues(sidebars, (sidebar) => {
266
- return collectSidebarDocItems(sidebar).map((docItem) => docItem.id);
267
- });
268
- }
269
- exports.collectSidebarsDocIds = collectSidebarsDocIds;
270
- function createSidebarsUtils(sidebars) {
271
- const sidebarNameToDocIds = collectSidebarsDocIds(sidebars);
272
- function getFirstDocIdOfFirstSidebar() {
273
- var _a;
274
- return (_a = Object.values(sidebarNameToDocIds)[0]) === null || _a === void 0 ? void 0 : _a[0];
275
- }
276
- function getSidebarNameByDocId(docId) {
277
- // TODO lookup speed can be optimized
278
- const entry = Object.entries(sidebarNameToDocIds).find(([_sidebarName, docIds]) => docIds.includes(docId));
279
- return entry === null || entry === void 0 ? void 0 : entry[0];
280
- }
281
- function getDocNavigation(docId) {
282
- const sidebarName = getSidebarNameByDocId(docId);
283
- if (sidebarName) {
284
- const docIds = sidebarNameToDocIds[sidebarName];
285
- const currentIndex = docIds.indexOf(docId);
286
- const { previous, next } = utils_1.getElementsAround(docIds, currentIndex);
287
- return {
288
- sidebarName,
289
- previousId: previous,
290
- nextId: next,
291
- };
292
- }
293
- else {
294
- return {
295
- sidebarName: undefined,
296
- previousId: undefined,
297
- nextId: undefined,
298
- };
299
- }
300
- }
301
- function checkSidebarsDocIds(validDocIds, sidebarFilePath) {
302
- const allSidebarDocIds = lodash_1.flatten(Object.values(sidebarNameToDocIds));
303
- const invalidSidebarDocIds = lodash_1.difference(allSidebarDocIds, validDocIds);
304
- if (invalidSidebarDocIds.length > 0) {
305
- throw new Error(`Invalid sidebar file at "${utils_1.toMessageRelativeFilePath(sidebarFilePath)}".
306
- These sidebar document ids do not exist:
307
- - ${invalidSidebarDocIds.sort().join('\n- ')}
308
-
309
- Available document ids are:
310
- - ${validDocIds.sort().join('\n- ')}`);
311
- }
312
- }
313
- return {
314
- getFirstDocIdOfFirstSidebar,
315
- getSidebarNameByDocId,
316
- getDocNavigation,
317
- checkSidebarsDocIds,
318
- };
319
- }
320
- exports.createSidebarsUtils = createSidebarsUtils;