@mintlify/cli 4.0.1431 → 4.0.1433
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/bin/vendor/converter.js
CHANGED
|
@@ -2654,29 +2654,54 @@ function isJSXContent(str) {
|
|
|
2654
2654
|
function getTextContent(node) {
|
|
2655
2655
|
return node.textContent;
|
|
2656
2656
|
}
|
|
2657
|
+
var BARE_OBJECT_KEY = /^[A-Za-z_$][\w$]*$/;
|
|
2657
2658
|
function serializePropValue(v) {
|
|
2658
2659
|
if (v === null || v === void 0)
|
|
2659
2660
|
return null;
|
|
2660
2661
|
if (typeof v === "object") {
|
|
2661
|
-
const
|
|
2662
|
-
return `{${
|
|
2662
|
+
const literal = Array.isArray(v) ? serializeJsValue(v) : serializeJsObjectLiteral(v, true);
|
|
2663
|
+
return `{${literal}}`;
|
|
2663
2664
|
}
|
|
2664
2665
|
if (typeof v === "string") {
|
|
2665
2666
|
if (v === "")
|
|
2666
|
-
return
|
|
2667
|
-
if (isJSXContent(v)
|
|
2667
|
+
return '""';
|
|
2668
|
+
if (isJSXContent(v)) {
|
|
2668
2669
|
return `{${v}}`;
|
|
2669
2670
|
}
|
|
2670
|
-
if (v.includes('"') &&
|
|
2671
|
+
if (v.includes('"') && v.includes("'")) {
|
|
2672
|
+
return `{${JSON.stringify(v)}}`;
|
|
2673
|
+
}
|
|
2674
|
+
if (v.includes('"')) {
|
|
2671
2675
|
return `'${v}'`;
|
|
2672
2676
|
}
|
|
2673
|
-
return `"${v
|
|
2677
|
+
return `"${v}"`;
|
|
2674
2678
|
}
|
|
2675
2679
|
if (typeof v === "number" || typeof v === "boolean") {
|
|
2676
2680
|
return `{${v}}`;
|
|
2677
2681
|
}
|
|
2678
2682
|
return `{${JSON.stringify(v)}}`;
|
|
2679
2683
|
}
|
|
2684
|
+
function serializeJsValue(value) {
|
|
2685
|
+
var _a;
|
|
2686
|
+
if (value === null || value === void 0)
|
|
2687
|
+
return "null";
|
|
2688
|
+
if (typeof value === "string")
|
|
2689
|
+
return JSON.stringify(value);
|
|
2690
|
+
if (typeof value === "number" || typeof value === "boolean")
|
|
2691
|
+
return String(value);
|
|
2692
|
+
if (Array.isArray(value))
|
|
2693
|
+
return `[${value.map(serializeJsValue).join(",")}]`;
|
|
2694
|
+
if (typeof value === "object")
|
|
2695
|
+
return serializeJsObjectLiteral(value, false);
|
|
2696
|
+
return (_a = JSON.stringify(value)) !== null && _a !== void 0 ? _a : "null";
|
|
2697
|
+
}
|
|
2698
|
+
function serializeJsObjectLiteral(value, outermost) {
|
|
2699
|
+
const entries = Object.entries(value).filter(([, entry]) => entry !== void 0).map(([key, entry]) => {
|
|
2700
|
+
const literalKey = BARE_OBJECT_KEY.test(key) ? key : JSON.stringify(key);
|
|
2701
|
+
return `${literalKey}:${serializeJsValue(entry)}`;
|
|
2702
|
+
});
|
|
2703
|
+
return outermost ? `{ ${entries.join(",")} }` : `{${entries.join(",")}}`;
|
|
2704
|
+
}
|
|
2680
2705
|
function serializeJsxAttribute(attrs2, key, value) {
|
|
2681
2706
|
const rawExpression = getNamedExpressionAttr(attrs2, key);
|
|
2682
2707
|
if (rawExpression !== void 0) {
|
|
@@ -2688,9 +2713,10 @@ function serializeJsxAttribute(attrs2, key, value) {
|
|
|
2688
2713
|
const serialized = serializePropValue(value);
|
|
2689
2714
|
return serialized ? `${key}=${serialized}` : null;
|
|
2690
2715
|
}
|
|
2716
|
+
var isAttributeRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
2691
2717
|
function getNamedExpressionAttr(attrs2, key) {
|
|
2692
2718
|
const raw = attrs2[NAMED_EXPRESSION_ATTRS_KEY];
|
|
2693
|
-
if (!
|
|
2719
|
+
if (!isAttributeRecord(raw))
|
|
2694
2720
|
return void 0;
|
|
2695
2721
|
const value = raw[key];
|
|
2696
2722
|
return typeof value === "string" ? value : void 0;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mintlify/cli",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.1433",
|
|
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.1110",
|
|
49
|
+
"@mintlify/link-rot": "3.0.1312",
|
|
50
50
|
"@mintlify/models": "0.0.350",
|
|
51
|
-
"@mintlify/prebuild": "1.0.
|
|
52
|
-
"@mintlify/previewing": "4.0.
|
|
53
|
-
"@mintlify/validation": "0.1.
|
|
51
|
+
"@mintlify/prebuild": "1.0.1264",
|
|
52
|
+
"@mintlify/previewing": "4.0.1336",
|
|
53
|
+
"@mintlify/validation": "0.1.841",
|
|
54
54
|
"adm-zip": "0.6.0",
|
|
55
55
|
"chalk": "5.2.0",
|
|
56
56
|
"color": "4.2.3",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"keytar": "7.9.0"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
|
-
"@mintlify/editor": "0.0.
|
|
85
|
+
"@mintlify/editor": "0.0.326",
|
|
86
86
|
"@mintlify/ts-config": "2.0.2",
|
|
87
87
|
"@tsconfig/recommended": "1.0.2",
|
|
88
88
|
"@types/detect-port": "1.3.2",
|
|
@@ -101,5 +101,5 @@
|
|
|
101
101
|
"vitest": "2.1.9",
|
|
102
102
|
"vitest-mock-process": "1.0.4"
|
|
103
103
|
},
|
|
104
|
-
"gitHead": "
|
|
104
|
+
"gitHead": "b35172bff15786ea8cfd4e8e00f868046e5e1ff8"
|
|
105
105
|
}
|