@codedrifters/configulator 0.0.309 → 0.0.310

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/lib/index.d.mts CHANGED
@@ -10281,9 +10281,22 @@ interface StarlightEditLink {
10281
10281
  readonly baseUrl: string;
10282
10282
  }
10283
10283
  /**
10284
- * Sidebar item accepted by Starlight's `sidebar` config. Covers the four
10285
- * common shapes: link, group with nested items, autogenerated group, and
10286
- * internal slug reference.
10284
+ * Sidebar item accepted by Starlight's `sidebar` config.
10285
+ *
10286
+ * Covers the shapes Starlight 0.39+ accepts:
10287
+ * - link (`{ label, link, badge? }`)
10288
+ * - group with nested items (`{ label, collapsed?, items }`)
10289
+ * - bare autogenerated entry, nested inside a group's `items` array
10290
+ * (`{ autogenerate: { directory, collapsed? } }`)
10291
+ * - internal slug reference (`{ label, slug }`)
10292
+ *
10293
+ * Plus one legacy shape kept for one deprecation cycle:
10294
+ * - top-level autogenerated group (`{ label, collapsed?, autogenerate }`).
10295
+ * Starlight v0.39.0 removed runtime support for this shape; the
10296
+ * `StarlightProject` emitter translates it to the nested form
10297
+ * `{ label, collapsed?, items: [{ autogenerate }] }` before writing
10298
+ * `astro.config.mjs`. Migrate to the nested form directly — this
10299
+ * variant will be removed in a future release.
10287
10300
  */
10288
10301
  type StarlightSidebarItem = {
10289
10302
  readonly label: string;
@@ -10297,6 +10310,12 @@ type StarlightSidebarItem = {
10297
10310
  readonly collapsed?: boolean;
10298
10311
  readonly items: ReadonlyArray<StarlightSidebarItem>;
10299
10312
  } | {
10313
+ readonly autogenerate: {
10314
+ readonly directory: string;
10315
+ readonly collapsed?: boolean;
10316
+ };
10317
+ } | {
10318
+ /** @deprecated Use `{ label, items: [{ autogenerate }] }` instead. Translated by the emitter for one cycle. */
10300
10319
  readonly label: string;
10301
10320
  readonly collapsed?: boolean;
10302
10321
  readonly autogenerate: {
package/lib/index.d.ts CHANGED
@@ -10330,9 +10330,22 @@ interface StarlightEditLink {
10330
10330
  readonly baseUrl: string;
10331
10331
  }
10332
10332
  /**
10333
- * Sidebar item accepted by Starlight's `sidebar` config. Covers the four
10334
- * common shapes: link, group with nested items, autogenerated group, and
10335
- * internal slug reference.
10333
+ * Sidebar item accepted by Starlight's `sidebar` config.
10334
+ *
10335
+ * Covers the shapes Starlight 0.39+ accepts:
10336
+ * - link (`{ label, link, badge? }`)
10337
+ * - group with nested items (`{ label, collapsed?, items }`)
10338
+ * - bare autogenerated entry, nested inside a group's `items` array
10339
+ * (`{ autogenerate: { directory, collapsed? } }`)
10340
+ * - internal slug reference (`{ label, slug }`)
10341
+ *
10342
+ * Plus one legacy shape kept for one deprecation cycle:
10343
+ * - top-level autogenerated group (`{ label, collapsed?, autogenerate }`).
10344
+ * Starlight v0.39.0 removed runtime support for this shape; the
10345
+ * `StarlightProject` emitter translates it to the nested form
10346
+ * `{ label, collapsed?, items: [{ autogenerate }] }` before writing
10347
+ * `astro.config.mjs`. Migrate to the nested form directly — this
10348
+ * variant will be removed in a future release.
10336
10349
  */
10337
10350
  type StarlightSidebarItem = {
10338
10351
  readonly label: string;
@@ -10346,6 +10359,12 @@ type StarlightSidebarItem = {
10346
10359
  readonly collapsed?: boolean;
10347
10360
  readonly items: ReadonlyArray<StarlightSidebarItem>;
10348
10361
  } | {
10362
+ readonly autogenerate: {
10363
+ readonly directory: string;
10364
+ readonly collapsed?: boolean;
10365
+ };
10366
+ } | {
10367
+ /** @deprecated Use `{ label, items: [{ autogenerate }] }` instead. Translated by the emitter for one cycle. */
10349
10368
  readonly label: string;
10350
10369
  readonly collapsed?: boolean;
10351
10370
  readonly autogenerate: {
package/lib/index.js CHANGED
@@ -35662,7 +35662,7 @@ function buildStarlightConfig(options) {
35662
35662
  config.social = options.social;
35663
35663
  }
35664
35664
  if (options.sidebar !== void 0) {
35665
- config.sidebar = options.sidebar;
35665
+ config.sidebar = options.sidebar.map(translateSidebarItem);
35666
35666
  }
35667
35667
  if (options.customCss !== void 0) {
35668
35668
  config.customCss = options.customCss;
@@ -35675,6 +35675,31 @@ function buildStarlightConfig(options) {
35675
35675
  }
35676
35676
  return config;
35677
35677
  }
35678
+ function translateSidebarItem(item) {
35679
+ if (item === null || typeof item !== "object") {
35680
+ return item;
35681
+ }
35682
+ const record = item;
35683
+ if (typeof record.label === "string" && record.autogenerate !== void 0 && record.items === void 0) {
35684
+ const translated = {
35685
+ label: record.label,
35686
+ items: [{ autogenerate: record.autogenerate }]
35687
+ };
35688
+ if (record.collapsed !== void 0) {
35689
+ translated.collapsed = record.collapsed;
35690
+ }
35691
+ return translated;
35692
+ }
35693
+ if (Array.isArray(record.items)) {
35694
+ return {
35695
+ ...record,
35696
+ items: record.items.map(
35697
+ translateSidebarItem
35698
+ )
35699
+ };
35700
+ }
35701
+ return item;
35702
+ }
35678
35703
  var DEFAULT_INDEX_MDX = `---
35679
35704
  title: Welcome
35680
35705
  description: Starlight-powered documentation site.