@mintlify/scraping 4.0.114 → 4.0.115
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/CONTRIBUTING.md +22 -106
- package/bin/cli.js +6 -1
- package/bin/cli.js.map +1 -1
- package/bin/constants.js +1 -1
- package/bin/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/cli.ts +7 -1
- package/src/constants.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mintlify/scraping",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.115",
|
|
4
4
|
"description": "Scrape documentation frameworks to Mintlify docs",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=18.0.0"
|
|
@@ -78,5 +78,5 @@
|
|
|
78
78
|
"typescript": "^5.5.3",
|
|
79
79
|
"vitest": "^2.0.4"
|
|
80
80
|
},
|
|
81
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "e1b8033198735204d29862b5feb1ee17486f8fea"
|
|
82
82
|
}
|
package/src/cli.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { MintConfigType } from '@mintlify/models';
|
|
3
|
+
import { upgradeToDocsConfig } from '@mintlify/validation';
|
|
2
4
|
import yargs from 'yargs';
|
|
3
5
|
import { hideBin } from 'yargs/helpers';
|
|
4
6
|
|
|
@@ -123,7 +125,11 @@ async function site(url: string) {
|
|
|
123
125
|
|
|
124
126
|
const result = await scrapeAllSiteTabs(html, urlObj);
|
|
125
127
|
if (result.success) {
|
|
126
|
-
|
|
128
|
+
const mintConfig = result.data as MintConfigType;
|
|
129
|
+
const docsConfig = upgradeToDocsConfig(mintConfig, {
|
|
130
|
+
shouldUpgradeTheme: true,
|
|
131
|
+
});
|
|
132
|
+
write('docs.json', JSON.stringify(docsConfig, undefined, 2));
|
|
127
133
|
log(FINAL_SUCCESS_MESSAGE);
|
|
128
134
|
} else {
|
|
129
135
|
log(result.message);
|
package/src/constants.ts
CHANGED
|
@@ -51,4 +51,4 @@ export const MDAST_FAILURE_MSG = 'failed to convert MDAST to Markdown string';
|
|
|
51
51
|
|
|
52
52
|
export const FINAL_SUCCESS_MESSAGE = `We've successfully scraped your docs site.
|
|
53
53
|
${SPACES}We've downloaded the ${activeColors.cyan}\`navigation\`${activeColors.default} array (and if necessary, the ${activeColors.cyan}\`tabs\`${activeColors.default} array)
|
|
54
|
-
${SPACES}into ${activeColors.blue}\`
|
|
54
|
+
${SPACES}into ${activeColors.blue}\`docs.json\`${activeColors.default}.`;
|