@mintlify/scraping 4.0.1183 → 4.0.1185

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mintlify/scraping",
3
- "version": "4.0.1183",
3
+ "version": "4.0.1185",
4
4
  "description": "Scrape documentation frameworks to Mintlify docs",
5
5
  "engines": {
6
6
  "node": ">=18.0.0"
@@ -43,7 +43,7 @@
43
43
  "format:check": "oxfmt --check"
44
44
  },
45
45
  "dependencies": {
46
- "@mintlify/common": "1.0.1309",
46
+ "@mintlify/common": "1.0.1310",
47
47
  "fast-xml-parser": "5.7.3",
48
48
  "fs-extra": "11.1.1",
49
49
  "graphql": "16.11.0",
@@ -87,5 +87,5 @@
87
87
  "optional": true
88
88
  }
89
89
  },
90
- "gitHead": "c32639354792b7678f023b42e6e85cfd1d942d42"
90
+ "gitHead": "942f3d5baac187dc0f64ed7234d98201e6703353"
91
91
  }
@@ -198,12 +198,28 @@ export async function convertGo(sourcePath: string): Promise<SdkReference> {
198
198
  for (const renderer of renderers) {
199
199
  const packagePages = renderer.packagePages();
200
200
  pages.push(...packagePages, ...renderer.memberPages());
201
- groups.push({ group: renderer.group, pages: packagePages.map((page) => page.slug) });
201
+ groups.push({ group: renderer.group, pages: packageEntries(packagePages) });
202
202
  }
203
203
 
204
204
  return { pages, groups };
205
205
  }
206
206
 
207
+ const KIND_GROUPS = [
208
+ { tag: TYPE_TAGS.interface, group: 'Interfaces' },
209
+ { tag: TYPE_TAGS.struct, group: 'Structs' },
210
+ { tag: TYPE_TAGS.defined, group: 'Types' },
211
+ { tag: 'FUNCTION', group: 'Functions' },
212
+ ];
213
+
214
+ function packageEntries([overview, ...rest]: SdkPage[]): (string | SdkNavGroup)[] {
215
+ const buckets = KIND_GROUPS.map(({ tag, group }) => ({
216
+ group,
217
+ pages: rest.filter((page) => page.tag === tag).map((page) => page.slug),
218
+ })).filter((bucket) => bucket.pages.length > 0);
219
+ const entries = buckets.length > 1 ? buckets : rest.map((page) => page.slug);
220
+ return overview ? [overview.slug, ...entries] : entries;
221
+ }
222
+
207
223
  function parseArtifact(raw: unknown, sourcePath: string): GoArtifact {
208
224
  const version =
209
225
  typeof raw === 'object' && raw !== null && 'schemaVersion' in raw