@thallylabs/migrate 0.2.0 → 0.2.1
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/dist/index.js +26 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -520,8 +520,19 @@ function projectDocusaurusNavigation(input) {
|
|
|
520
520
|
};
|
|
521
521
|
}
|
|
522
522
|
|
|
523
|
-
// src/
|
|
523
|
+
// src/frontmatter.ts
|
|
524
524
|
import matter from "gray-matter";
|
|
525
|
+
var FRONTMATTER_OPTIONS = {
|
|
526
|
+
engines: {
|
|
527
|
+
javascript: () => ({}),
|
|
528
|
+
js: () => ({})
|
|
529
|
+
}
|
|
530
|
+
};
|
|
531
|
+
function parseFrontmatter(raw) {
|
|
532
|
+
return matter(raw, FRONTMATTER_OPTIONS);
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
// src/mdx.ts
|
|
525
536
|
function titleFromId(id) {
|
|
526
537
|
const value = id.split("/").at(-1) ?? id;
|
|
527
538
|
if (value === "introduction") return "Introduction";
|
|
@@ -577,7 +588,7 @@ function normalizeMdx(body) {
|
|
|
577
588
|
}).replace(/<\/TabItem>/g, "</Tab>").replace(/<Link\b([^>]*)\bto=(?:"([^"]*)"|'([^']*)')([^>]*)>/g, (_match, before, doubleQuoted, singleQuoted, after) => `<a${before}href="${doubleQuoted ?? singleQuoted}"${after}>`).replace(/<\/Link>/g, "</a>").replace(/<(?:DocCardList|TOCInline)\b[^>]*\/>/g, "").replace(/<!--([\s\S]*?)-->/g, (_match, content) => `{/*${content}*/}`).replace(/<Danger(\s[^>]*)?>/g, "<Error$1>").replace(/<\/Danger>/g, "</Error>").replace(/<Check(\s[^>]*)?>/g, "<Note$1>").replace(/<\/Check>/g, "</Note>").replace(/<Tree\.Folder/g, "<Folder").replace(/<\/Tree\.Folder>/g, "</Folder>").replace(/<Tree\.File/g, "<File").replace(/<\/Tree\.File>/g, "</File>");
|
|
578
589
|
}
|
|
579
590
|
function parseMarkdownPage(input) {
|
|
580
|
-
const parsed =
|
|
591
|
+
const parsed = parseFrontmatter(input.raw);
|
|
581
592
|
const fallbackIdentity = {
|
|
582
593
|
id: input.id,
|
|
583
594
|
navigationId: input.navigationId ?? input.id,
|
|
@@ -1583,13 +1594,22 @@ var PORTABLE_MDX_COMPONENTS = /* @__PURE__ */ new Set([
|
|
|
1583
1594
|
"Danger",
|
|
1584
1595
|
"Error",
|
|
1585
1596
|
"Expandable",
|
|
1597
|
+
"Agent",
|
|
1598
|
+
"Embed",
|
|
1586
1599
|
"File",
|
|
1587
1600
|
"Folder",
|
|
1588
1601
|
"Frame",
|
|
1602
|
+
"GitHub",
|
|
1603
|
+
"Github",
|
|
1589
1604
|
"Hero",
|
|
1605
|
+
"Human",
|
|
1590
1606
|
"Icon",
|
|
1591
1607
|
"Info",
|
|
1608
|
+
"InlinePanel",
|
|
1609
|
+
"InlineRequestExample",
|
|
1610
|
+
"InlineResponseExample",
|
|
1592
1611
|
"Latex",
|
|
1612
|
+
"LegacyView",
|
|
1593
1613
|
"Mermaid",
|
|
1594
1614
|
"Note",
|
|
1595
1615
|
"Panel",
|
|
@@ -1604,6 +1624,9 @@ var PORTABLE_MDX_COMPONENTS = /* @__PURE__ */ new Set([
|
|
|
1604
1624
|
"Steps",
|
|
1605
1625
|
"Tab",
|
|
1606
1626
|
"Tabs",
|
|
1627
|
+
"Terminal",
|
|
1628
|
+
"TerminalInput",
|
|
1629
|
+
"TerminalOutput",
|
|
1607
1630
|
"Tile",
|
|
1608
1631
|
"TileGroup",
|
|
1609
1632
|
"Tip",
|
|
@@ -1611,6 +1634,7 @@ var PORTABLE_MDX_COMPONENTS = /* @__PURE__ */ new Set([
|
|
|
1611
1634
|
"Tree",
|
|
1612
1635
|
"Update",
|
|
1613
1636
|
"View",
|
|
1637
|
+
"Visibility",
|
|
1614
1638
|
"Warning"
|
|
1615
1639
|
]);
|
|
1616
1640
|
var LOCALE_CODES = /* @__PURE__ */ new Set([
|