@qualcomm-ui/mdx-vite 2.12.0 → 2.14.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 CHANGED
@@ -3488,8 +3488,8 @@ var require_extra_typings = __commonJS({
3488
3488
  import chalk5 from "chalk";
3489
3489
  import { watch } from "chokidar";
3490
3490
  import { glob as glob2 } from "glob";
3491
- import { existsSync } from "node:fs";
3492
- import { readFile as readFile3, stat as stat2 } from "node:fs/promises";
3491
+ import { existsSync, statSync } from "node:fs";
3492
+ import { readFile as readFile3 } from "node:fs/promises";
3493
3493
  import { basename as basename2, dirname as dirname2, join as join4, relative as relative3, resolve as resolve3 } from "node:path";
3494
3494
  import {
3495
3495
  createHighlighter
@@ -5507,7 +5507,7 @@ var KnowledgeGenerator = class {
5507
5507
  return docProps;
5508
5508
  } catch (error) {
5509
5509
  if (this.config.verbose) {
5510
- console.log(`Error loading doc props: ${error}`);
5510
+ console.log("Error loading doc props", error);
5511
5511
  }
5512
5512
  return null;
5513
5513
  }
@@ -5604,7 +5604,7 @@ var KnowledgeGenerator = class {
5604
5604
  }
5605
5605
  } catch (error) {
5606
5606
  if (this.config.verbose) {
5607
- console.log(` Error processing ${normalizedPath}: ${error}`);
5607
+ console.log(`Error processing ${normalizedPath}`, error);
5608
5608
  }
5609
5609
  }
5610
5610
  return modules;
@@ -5721,6 +5721,10 @@ ${codeText}
5721
5721
  const path = this.getAttrExpression(node, "data");
5722
5722
  return path && getPath(themes, path);
5723
5723
  },
5724
+ SpacingTable: (node) => {
5725
+ const path = this.getAttrExpression(node, "data");
5726
+ return path && getPath(themes, path);
5727
+ },
5724
5728
  ThemePropertyTable: (node) => {
5725
5729
  const path = this.getAttrExpression(node, "data");
5726
5730
  const property = this.getAttrExpression(node, "cssProperty");
@@ -5957,7 +5961,7 @@ ${propsToDefinitionList(outputs)}`);
5957
5961
  });
5958
5962
  } catch (error) {
5959
5963
  if (this.config.verbose) {
5960
- console.log(` Error reading demo ${demoName}: ${error}`);
5964
+ console.log(`Error reading demo ${demoName}`, error);
5961
5965
  }
5962
5966
  if (parent && index !== void 0) {
5963
5967
  parent.children.splice(index, 1);
@@ -6047,7 +6051,7 @@ ${propsToDefinitionList(outputs)}`);
6047
6051
  throw error;
6048
6052
  }
6049
6053
  }
6050
- async generateLlmsTxt(pages) {
6054
+ generateLlmsTxt(pages) {
6051
6055
  const lines = [
6052
6056
  getIntroLines(this.config.name, this.config.description)
6053
6057
  ];
@@ -6070,7 +6074,7 @@ ${propsToDefinitionList(outputs)}`);
6070
6074
  return lines.join("\n");
6071
6075
  }
6072
6076
  async generateAggregatedOutput(processedPages, pages) {
6073
- const llmsTxtContent = await this.generateLlmsTxt(processedPages);
6077
+ const llmsTxtContent = this.generateLlmsTxt(processedPages);
6074
6078
  await mkdir(dirname(this.config.outputPath), { recursive: true }).catch(
6075
6079
  () => {
6076
6080
  }
@@ -6561,7 +6565,7 @@ function quiDocsPlugin(opts) {
6561
6565
  });
6562
6566
  state.servers.push(server);
6563
6567
  },
6564
- handleHotUpdate: async ({ file: updateFile, modules, server }) => {
6568
+ handleHotUpdate: ({ file: updateFile, modules, server }) => {
6565
6569
  if (updateFile.endsWith(".css")) {
6566
6570
  return modules;
6567
6571
  }
@@ -7777,7 +7781,7 @@ function angularDemoPlugin({
7777
7781
  if (process.env.NODE_ENV === "development") {
7778
7782
  if (!hasWatcherInitialized) {
7779
7783
  hasWatcherInitialized = true;
7780
- await setupAngularWatcher();
7784
+ setupAngularWatcher();
7781
7785
  } else {
7782
7786
  logDev(
7783
7787
  `${chalk5.blue.bold(LOG_PREFIX)} Watcher already initialized by another instance`
@@ -7878,7 +7882,7 @@ function angularDemoPlugin({
7878
7882
  }
7879
7883
  return [];
7880
7884
  },
7881
- async load(id) {
7885
+ load(id) {
7882
7886
  if (id === VIRTUAL_MODULE_ID2) {
7883
7887
  return generateRegistryModule();
7884
7888
  }
@@ -8458,7 +8462,7 @@ export function getAngularDemoInfo(demoId) {
8458
8462
  }
8459
8463
  return pathAliases;
8460
8464
  }
8461
- async function setupAngularWatcher() {
8465
+ function setupAngularWatcher() {
8462
8466
  watcher = watch(routesDir, {
8463
8467
  ignoreInitial: true,
8464
8468
  persistent: true
@@ -8468,18 +8472,23 @@ export function getAngularDemoInfo(demoId) {
8468
8472
  `${chalk5.blue.bold(LOG_PREFIX)} Registered ${chalk5.green(demoRegistry.size)} demo files. Watching for file changes...`
8469
8473
  );
8470
8474
  });
8471
- watcher.on("add", async (filePath) => {
8472
- const fileStats = await stat2(filePath).catch(() => void 0);
8473
- if (!fileStats || fileStats.size === 0) {
8474
- console.debug("Failed to read file stats", filePath);
8475
- return;
8476
- }
8477
- if (isAngularDemoFile(filePath)) {
8478
- logDev(
8479
- `${chalk5.blue.bold(LOG_PREFIX)} New Angular demo: ${chalk5.green(filePath)}`
8480
- );
8481
- await handleAngularDemoUpdate(filePath);
8482
- triggerRegistryUpdate();
8475
+ watcher.on("add", (filePath) => {
8476
+ try {
8477
+ const fileStats = statSync(filePath);
8478
+ if (!fileStats || fileStats.size === 0) {
8479
+ console.debug("Failed to read file stats", filePath);
8480
+ return;
8481
+ }
8482
+ if (isAngularDemoFile(filePath)) {
8483
+ logDev(
8484
+ `${chalk5.blue.bold(LOG_PREFIX)} New Angular demo: ${chalk5.green(filePath)}`
8485
+ );
8486
+ void handleAngularDemoUpdate(filePath).then(() => {
8487
+ triggerRegistryUpdate();
8488
+ });
8489
+ }
8490
+ } catch {
8491
+ console.debug("Failed to update registry file stats");
8483
8492
  }
8484
8493
  });
8485
8494
  watcher.on("unlink", (filePath) => {
@@ -9030,7 +9039,7 @@ function reactDemoPlugin({
9030
9039
  }
9031
9040
  return [];
9032
9041
  },
9033
- async load(id) {
9042
+ load(id) {
9034
9043
  if (id === VIRTUAL_MODULE_IDS.AUTO) {
9035
9044
  return generateAutoScopeModule();
9036
9045
  }