fluidcad 0.0.9 → 0.0.10

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fluidcad",
3
- "version": "0.0.9",
3
+ "version": "0.0.10",
4
4
  "description": "Parametric CAD modeling library using javascript",
5
5
  "author": "Marwan Aouida <contact@marwan.dev>",
6
6
  "homepage": "https://fluidcad.io",
@@ -20,7 +20,8 @@ export class FluidCadServer {
20
20
  if (!this.sceneManager) {
21
21
  return null;
22
22
  }
23
- const normalizedFileName = normalizePath(filePath.replace('virtual:live-render:', ''));
23
+ filePath = normalizePath(filePath);
24
+ const normalizedFileName = filePath.replace('virtual:live-render:', '');
24
25
  this.currentFileName = normalizedFileName;
25
26
  if (!ignoreCache) {
26
27
  const fromCache = this.renderingCache.get(normalizedFileName);
@@ -65,6 +66,7 @@ export class FluidCadServer {
65
66
  }
66
67
  }
67
68
  async updateLiveCode(fileName, code) {
69
+ fileName = normalizePath(fileName);
68
70
  const id = `virtual:live-render:${fileName}`;
69
71
  this.viteManager.setBuffer(id, code);
70
72
  this.renderingCache.delete(fileName);
@@ -71,7 +71,7 @@ export class ViteManager {
71
71
  }
72
72
  },
73
73
  transform(code, id) {
74
- if (id.startsWith(rootPath) || id.startsWith('virtual:live-render')) {
74
+ if ((id.startsWith(that.rootPath) && !id.includes('/node_modules/')) || id.startsWith('virtual:live-render')) {
75
75
  const blocked = scanForBlockedImports(code);
76
76
  if (blocked) {
77
77
  const moduleName = getBlockedNodeModule(blocked);
@@ -104,7 +104,7 @@ export class ViteManager {
104
104
  }
105
105
  invalidateModule() {
106
106
  for (const [id, mod] of this.server.moduleGraph.idToModuleMap) {
107
- if (id.startsWith(this.rootPath) || id.startsWith('virtual:live-render')) {
107
+ if ((id.startsWith(this.rootPath) && !id.includes('/node_modules/')) || id.startsWith('virtual:live-render')) {
108
108
  this.server.moduleGraph.invalidateModule(mod);
109
109
  }
110
110
  }