@mintlify/cli 4.0.1479 → 4.0.1481
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/__test__/format.test.ts +66 -0
- package/bin/format.js +1 -1
- package/bin/tsconfig.build.tsbuildinfo +1 -1
- package/bin/vendor/converter.js +5 -10
- package/package.json +8 -8
- package/src/format.tsx +1 -1
package/bin/vendor/converter.js
CHANGED
|
@@ -1331,11 +1331,7 @@ import remarkFrontmatter from "remark-frontmatter";
|
|
|
1331
1331
|
import remarkGfm from "remark-gfm";
|
|
1332
1332
|
import remarkMath from "remark-math";
|
|
1333
1333
|
import remarkMdx from "remark-mdx";
|
|
1334
|
-
|
|
1335
|
-
return remark().use(remarkMdx).use(remarkGfm).use(remarkFrontmatter, ["yaml", "toml"]).use(remarkMath, { singleDollarTextMath }).freeze();
|
|
1336
|
-
}
|
|
1337
|
-
var coreRemark = buildRemark(true);
|
|
1338
|
-
var noSingleDollarTextMathRemark = buildRemark(false);
|
|
1334
|
+
var coreRemark = remark().use(remarkMdx).use(remarkGfm).use(remarkFrontmatter, ["yaml", "toml"]).use(remarkMath).freeze();
|
|
1339
1335
|
function convertHtmlCommentsToJsx(mdx) {
|
|
1340
1336
|
const parts = mdx.split(/(```[\s\S]*?```|~~~[\s\S]*?~~~)/);
|
|
1341
1337
|
return parts.map((part, i) => i % 2 === 0 ? part.replace(/<!--([\s\S]*?)-->/g, (_m, c) => `{/* ${c} */}`) : part).join("");
|
|
@@ -1348,14 +1344,13 @@ function preprocessMdxSource(mdx, options = {}) {
|
|
|
1348
1344
|
preprocessed: preprocessCustomHeadingIds(sanitized, { preserveOriginal: true })
|
|
1349
1345
|
};
|
|
1350
1346
|
}
|
|
1351
|
-
function parsePreprocessedMdx(preprocessed
|
|
1352
|
-
|
|
1353
|
-
return parser().parse(preprocessed);
|
|
1347
|
+
function parsePreprocessedMdx(preprocessed) {
|
|
1348
|
+
return coreRemark().parse(preprocessed);
|
|
1354
1349
|
}
|
|
1355
1350
|
function mdxToMdast(mdx, options = {
|
|
1356
1351
|
omitHtmlComments: true
|
|
1357
1352
|
}) {
|
|
1358
|
-
return parsePreprocessedMdx(preprocessMdxSource(mdx, options).preprocessed
|
|
1353
|
+
return parsePreprocessedMdx(preprocessMdxSource(mdx, options).preprocessed);
|
|
1359
1354
|
}
|
|
1360
1355
|
|
|
1361
1356
|
// ../editor/dist/converter/parse/handlers/prompt.js
|
|
@@ -12266,7 +12261,7 @@ var Preserver = class _Preserver {
|
|
|
12266
12261
|
const coords = SourceCoords.create(source, sanitized, preprocessed);
|
|
12267
12262
|
if (!coords)
|
|
12268
12263
|
return null;
|
|
12269
|
-
const root = parsePreprocessedMdx(preprocessed
|
|
12264
|
+
const root = parsePreprocessedMdx(preprocessed);
|
|
12270
12265
|
const ser = Object.assign(Object.assign({}, serializerOptions), { removeTrailingNewline: true, hasReferenceDefinitions: hasReferenceDefinitions(doc) });
|
|
12271
12266
|
return new _Preserver(doc, coords, root, parseOptions, ser);
|
|
12272
12267
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mintlify/cli",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.1481",
|
|
4
4
|
"description": "The Mintlify CLI",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=18.0.0"
|
|
@@ -45,12 +45,12 @@
|
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@inquirer/prompts": "7.9.0",
|
|
48
|
-
"@mintlify/common": "1.0.
|
|
49
|
-
"@mintlify/link-rot": "3.0.
|
|
48
|
+
"@mintlify/common": "1.0.1133",
|
|
49
|
+
"@mintlify/link-rot": "3.0.1335",
|
|
50
50
|
"@mintlify/models": "0.0.353",
|
|
51
|
-
"@mintlify/prebuild": "1.0.
|
|
52
|
-
"@mintlify/previewing": "4.0.
|
|
53
|
-
"@mintlify/validation": "0.1.
|
|
51
|
+
"@mintlify/prebuild": "1.0.1287",
|
|
52
|
+
"@mintlify/previewing": "4.0.1359",
|
|
53
|
+
"@mintlify/validation": "0.1.850",
|
|
54
54
|
"adm-zip": "0.6.0",
|
|
55
55
|
"chalk": "5.2.0",
|
|
56
56
|
"color": "4.2.3",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"keytar": "7.9.0"
|
|
87
87
|
},
|
|
88
88
|
"devDependencies": {
|
|
89
|
-
"@mintlify/editor": "0.0.
|
|
89
|
+
"@mintlify/editor": "0.0.365",
|
|
90
90
|
"@mintlify/ts-config": "2.0.2",
|
|
91
91
|
"@tsconfig/recommended": "1.0.2",
|
|
92
92
|
"@types/detect-port": "1.3.2",
|
|
@@ -105,5 +105,5 @@
|
|
|
105
105
|
"vitest": "2.1.9",
|
|
106
106
|
"vitest-mock-process": "1.0.4"
|
|
107
107
|
},
|
|
108
|
-
"gitHead": "
|
|
108
|
+
"gitHead": "457fe2e146dcc76222d433e6be6fafcaf93c24ff"
|
|
109
109
|
}
|
package/src/format.tsx
CHANGED
|
@@ -45,7 +45,7 @@ export const formatHandler = async (): Promise<void> => {
|
|
|
45
45
|
let formatted = raw;
|
|
46
46
|
let originalFrontmatterKeys = 0;
|
|
47
47
|
for (let pass = 0; pass < 3; pass++) {
|
|
48
|
-
const { doc, frontmatter } = mdxToPm(formatted
|
|
48
|
+
const { doc, frontmatter } = mdxToPm(formatted);
|
|
49
49
|
if (pass === 0) originalFrontmatterKeys = Object.keys(frontmatter).length;
|
|
50
50
|
const next = `${pmToMdx(doc, { frontmatter, ...canonicalPmToMdxOptions })}\n`;
|
|
51
51
|
if (next === formatted) break;
|