@qualcomm-ui/mdx-vite 2.1.1 → 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":"docs-plugin.d.ts","sourceRoot":"","sources":["../../src/docs-plugin/docs-plugin.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAa,YAAY,EAAgB,MAAM,MAAM,CAAA;AAmBjE,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IAEnB;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;CACb;AAiKD,wBAAgB,aAAa,CAAC,IAAI,CAAC,EAAE,oBAAoB,GAAG,YAAY,
|
|
1
|
+
{"version":3,"file":"docs-plugin.d.ts","sourceRoot":"","sources":["../../src/docs-plugin/docs-plugin.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAa,YAAY,EAAgB,MAAM,MAAM,CAAA;AAmBjE,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IAEnB;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;CACb;AAiKD,wBAAgB,aAAa,CAAC,IAAI,CAAC,EAAE,oBAAoB,GAAG,YAAY,CA+GvE"}
|
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
|
|
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)}
|
|
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: ""
|
|
@@ -2874,7 +2861,10 @@ function quiDocsPlugin(opts) {
|
|
|
2874
2861
|
});
|
|
2875
2862
|
state.servers.push(server);
|
|
2876
2863
|
},
|
|
2877
|
-
handleHotUpdate: async ({ file: updateFile, server }) => {
|
|
2864
|
+
handleHotUpdate: async ({ file: updateFile, modules, server }) => {
|
|
2865
|
+
if (updateFile.endsWith(".css")) {
|
|
2866
|
+
return modules;
|
|
2867
|
+
}
|
|
2878
2868
|
const file = fixPath(updateFile);
|
|
2879
2869
|
if ((!config.hotUpdateIgnore || !config.hotUpdateIgnore.test(file)) && // ignore watched files. We watch for these separately.
|
|
2880
2870
|
file !== state.configFilePath) {
|