@qualcomm-ui/mdx-vite 2.1.2 → 2.1.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"angular-demo-plugin.d.ts","sourceRoot":"","sources":["../../src/angular-demo-plugin/angular-demo-plugin.ts"],"names":[],"mappings":"AAUA,OAAO,EAGL,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC/B,MAAM,OAAO,CAAA;AAEd,OAAO,KAAK,EAAC,MAAM,EAAgB,MAAM,MAAM,CAAA;AAU/C,MAAM,WAAW,wBAAwB;IACvC,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IAC/B;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACpC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE;QACN,IAAI,EACA,oBAAoB,GACpB,iBAAiB,GACjB,yBAAyB,GACzB,MAAM,CAAA;QACV,KAAK,EACD,oBAAoB,GACpB,iBAAiB,GACjB,yBAAyB,GACzB,MAAM,CAAA;KACX,CAAA;CACF;AAqCD,wBAAgB,iBAAiB,CAAC,EAChC,WAAwC,EACxC,WAAW,EACX,SAAwB,EACxB,KAGC,GACF,GAAE,wBAA6B,GAAG,MAAM,CA2qCxC"}
1
+ {"version":3,"file":"angular-demo-plugin.d.ts","sourceRoot":"","sources":["../../src/angular-demo-plugin/angular-demo-plugin.ts"],"names":[],"mappings":"AAUA,OAAO,EAGL,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC/B,MAAM,OAAO,CAAA;AAEd,OAAO,KAAK,EAAC,MAAM,EAAgB,MAAM,MAAM,CAAA;AAU/C,MAAM,WAAW,wBAAwB;IACvC,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IAC/B;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACpC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE;QACN,IAAI,EACA,oBAAoB,GACpB,iBAAiB,GACjB,yBAAyB,GACzB,MAAM,CAAA;QACV,KAAK,EACD,oBAAoB,GACpB,iBAAiB,GACjB,yBAAyB,GACzB,MAAM,CAAA;KACX,CAAA;CACF;AAqCD,wBAAgB,iBAAiB,CAAC,EAChC,WAAwC,EACxC,WAAW,EACX,SAAwB,EACxB,KAGC,GACF,GAAE,wBAA6B,GAAG,MAAM,CA8pCxC"}
package/dist/index.js CHANGED
@@ -109,10 +109,10 @@ function angularDemoPlugin({
109
109
  }
110
110
  });
111
111
  },
112
- async handleHotUpdate({ file, server }) {
112
+ async handleHotUpdate({ file, modules, server }) {
113
113
  if (!isAngularDemoFile(file)) {
114
114
  if (isCssAsset2(file)) {
115
- return server.moduleGraph.getModulesByFile(file)?.values()?.toArray();
115
+ return modules;
116
116
  } else if (file.endsWith("main.js")) {
117
117
  const ids = [...hotUpdateDemoIds];
118
118
  server.ws.send({
@@ -140,23 +140,9 @@ function angularDemoPlugin({
140
140
  const affectedDemos = await scanDemosForFileImport(file);
141
141
  if (affectedDemos.length > 0) {
142
142
  hotUpdateDemoIds = [];
143
- const mainModule2 = server.moduleGraph.getModuleById(VIRTUAL_MODULE_ID);
144
- if (mainModule2) {
145
- server.moduleGraph.invalidateModule(mainModule2);
146
- await server.reloadModule(mainModule2);
147
- }
148
143
  for (const demo of affectedDemos) {
149
144
  hotUpdateDemoIds.push(demo.id);
150
145
  }
151
- const pageIds = new Set(affectedDemos.map((demo) => demo.pageId));
152
- for (const pageId of pageIds) {
153
- const pageModuleId2 = `\0${VIRTUAL_MODULE_PREFIX}${pageId}`;
154
- const pageModule2 = server.moduleGraph.getModuleById(pageModuleId2);
155
- if (pageModule2) {
156
- server.moduleGraph.invalidateModule(pageModule2);
157
- await server.reloadModule(pageModule2);
158
- }
159
- }
160
146
  }
161
147
  server.ws.send({
162
148
  data: {
@@ -241,7 +227,7 @@ function angularDemoPlugin({
241
227
  for (const [demoId, demo] of demoRegistry.entries()) {
242
228
  if (demo.sourceCode.find((entry) => entry.filePath === file)) {
243
229
  logDev(
244
- `${chalk.blue.bold(LOG_PREFIX)} Re-parsing demo ${chalk.cyan(demoId)} due to imported file change: ${chalk.yellow(file)}`
230
+ `${chalk.blue.bold(LOG_PREFIX)} Reloading demo ${chalk.cyan(demoId)} due to imported file change: ${chalk.yellow(file)}`
245
231
  );
246
232
  const code = await readFile(demo.filePath, "utf-8");
247
233
  const updatedDemo = await parseAngularDemo(demo.filePath, code);
@@ -624,6 +610,7 @@ function angularDemoPlugin({
624
610
  );
625
611
  sourceCode.push({
626
612
  fileName: importedFileName,
613
+ filePath: resolvedPath,
627
614
  highlighted: {
628
615
  full: highlightedImportedSource,
629
616
  preview: ""