clean-jsdoc-theme 5.0.7 → 5.1.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/dist/publish.mjs CHANGED
@@ -104,7 +104,10 @@ var loadUtils = () => loadDep("@clean-jsdoc-theme/utils", [
104
104
  "formatRenderError",
105
105
  "normalizeBasePath",
106
106
  "withBase",
107
- "toExtractManifest"
107
+ "toExtractManifest",
108
+ "normalizeCollapsibleSidebarSections",
109
+ "unmatchedCollapsibleSections",
110
+ "topLevelSectionLabels"
108
111
  ]);
109
112
  var loadOra = async () => {
110
113
  try {
@@ -1050,7 +1053,10 @@ async function publish(data, opts, tutorials) {
1050
1053
  formatRenderError,
1051
1054
  normalizeBasePath,
1052
1055
  withBase,
1053
- toExtractManifest
1056
+ toExtractManifest,
1057
+ normalizeCollapsibleSidebarSections,
1058
+ unmatchedCollapsibleSections,
1059
+ topLevelSectionLabels
1054
1060
  }
1055
1061
  // Loaded sequentially (not Promise.all) so the spinner can step its label
1056
1062
  // through each module — the evaluation of these large ESM bundles is the
@@ -1125,6 +1131,8 @@ async function publish(data, opts, tutorials) {
1125
1131
  const sectionOrder = normalizeSectionOrder(opts.sectionOrder);
1126
1132
  const menu = normalizeMenu(opts.menu);
1127
1133
  const clubSidebarItems = opts.clubSidebarItems === true;
1134
+ const { value: collapsibleSidebarSections, warnings: collapsibleWarnings } = normalizeCollapsibleSidebarSections(opts.collapsibleSidebarSections);
1135
+ collapsibleWarnings.forEach((w) => console.warn(`clean-jsdoc-theme: ${w}`));
1128
1136
  const playground = normalizePlayground(opts.playground);
1129
1137
  const siteOptions = {
1130
1138
  ...pkg ? { pkg } : {},
@@ -1138,12 +1146,22 @@ async function publish(data, opts, tutorials) {
1138
1146
  ...sectionOrder ? { sectionOrder } : {},
1139
1147
  ...menu ? { menu } : {},
1140
1148
  ...clubSidebarItems ? { clubSidebarItems } : {},
1149
+ ...collapsibleSidebarSections !== void 0 ? { collapsibleSidebarSections } : {},
1141
1150
  ...playground ? { playground: playground.site } : {}
1142
1151
  };
1143
1152
  const manifest = await progress.stage(
1144
1153
  "Generating pages",
1145
1154
  () => buildSpec ? stampSite(data, buildSpec.apiMessages, siteOptions) : generateSite(data, siteOptions)
1146
1155
  );
1156
+ if (Array.isArray(collapsibleSidebarSections)) {
1157
+ const present = topLevelSectionLabels(manifest.nav);
1158
+ const unmatched = unmatchedCollapsibleSections(collapsibleSidebarSections, present);
1159
+ if (unmatched.length > 0) {
1160
+ console.warn(
1161
+ `clean-jsdoc-theme: collapsibleSidebarSections \u2014 no sidebar section matches ${unmatched.map((l) => `'${l}'`).join(", ")}. Available sections: ${present.join(", ")}.`
1162
+ );
1163
+ }
1164
+ }
1147
1165
  const extractPath = process.env.CLEAN_JSDOC_THEME_EXTRACT?.trim();
1148
1166
  if (extractPath) {
1149
1167
  const target = resolvePath(extractPath);