@qualcomm-ui/mdx-vite 2.5.0 → 2.5.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/cli.js CHANGED
@@ -5762,7 +5762,7 @@ function extractProps(props, isPartial) {
5762
5762
  function removePreviewLines(code) {
5763
5763
  return code.split("\n").filter((line) => !isPreviewLine(line.trim())).join("\n");
5764
5764
  }
5765
- function getIntroLines(pages, projectName, description, baseUrl) {
5765
+ function getIntroLines(pages, projectName, description) {
5766
5766
  const lines = [];
5767
5767
  if (projectName) {
5768
5768
  lines.push(`# ${projectName}`);
@@ -5775,25 +5775,13 @@ function getIntroLines(pages, projectName, description, baseUrl) {
5775
5775
  lines.push("## Components and Integrations");
5776
5776
  lines.push("");
5777
5777
  for (const page of pages) {
5778
- const url = baseUrl ? `${baseUrl}/${kebabCase(page.title)}` : `#${kebabCase(page.title)}`;
5779
- if (page.title.includes("Introduction")) {
5780
- lines.push(`- [${page.title}](${url}): introduction and getting started`);
5781
- } else if (page.title.includes("Tailwind")) {
5782
- lines.push(
5783
- `- [${page.title}](${url}): integration documentation and examples`
5784
- );
5785
- } else {
5786
- lines.push(
5787
- `- [${page.title}](${url}): component documentation and examples`
5788
- );
5789
- }
5778
+ const url = page.url ?? `#${kebabCase(page.title)}`;
5779
+ lines.push(`- [${page.title}](${url})`);
5790
5780
  }
5791
5781
  return lines.join("\n");
5792
5782
  }
5793
- async function generateLlmsTxt(pages, projectName, description, baseUrl) {
5794
- const lines = [
5795
- getIntroLines(pages, projectName, description, baseUrl)
5796
- ];
5783
+ async function generateLlmsTxt(pages, projectName, description) {
5784
+ const lines = [getIntroLines(pages, projectName, description)];
5797
5785
  lines.push("");
5798
5786
  for (const page of pages) {
5799
5787
  const content = page.content.split("\n").map((line) => {
@@ -6091,7 +6079,8 @@ async function processComponent(component, docProps, verbose) {
6091
6079
  content: contentWithoutFrontmatter.trim(),
6092
6080
  demoFiles,
6093
6081
  frontmatter,
6094
- title
6082
+ title,
6083
+ url: component.url
6095
6084
  };
6096
6085
  } catch (error) {
6097
6086
  console.error(`Error processing component ${component.name}:`, error);
@@ -6244,8 +6233,7 @@ async function generate({
6244
6233
  const llmsTxtContent = await generateLlmsTxt(
6245
6234
  processedPages,
6246
6235
  name,
6247
- description,
6248
- baseUrl
6236
+ description
6249
6237
  );
6250
6238
  await mkdir2(dirname(outputPath), { recursive: true }).catch();
6251
6239
  await writeFile3(outputPath, llmsTxtContent, "utf-8");