@sequent-org/ifc-viewer 1.2.4-ci.37.0 → 1.2.4-ci.39.0

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@sequent-org/ifc-viewer",
3
3
  "private": false,
4
- "version": "1.2.4-ci.37.0",
4
+ "version": "1.2.4-ci.39.0",
5
5
  "type": "module",
6
6
  "description": "IFC 3D model viewer component for web applications - fully self-contained with local IFCLoader",
7
7
  "main": "src/index.js",
@@ -2,6 +2,9 @@ import fs from 'node:fs';
2
2
  import path from 'node:path';
3
3
  import { createRequire } from 'node:module';
4
4
 
5
+ // bump when web-ifc version changes (used for cache-busting via directory name)
6
+ const WASM_DIR_VERSION = '0.0.74';
7
+
5
8
  function ensureDir(p) {
6
9
  fs.mkdirSync(p, { recursive: true });
7
10
  }
@@ -29,7 +32,10 @@ function main() {
29
32
  ? path.join(path.dirname(webIfcPkgJson), 'web-ifc.wasm')
30
33
  : path.join(appRoot, 'node_modules', 'web-ifc', 'web-ifc.wasm');
31
34
 
35
+ // Default location (legacy)
32
36
  const dst = path.join(appRoot, 'public', 'wasm', 'web-ifc.wasm');
37
+ // Versioned location (recommended to avoid cache-mismatch for end-users)
38
+ const dstV = path.join(appRoot, 'public', 'wasm', `v${WASM_DIR_VERSION}`, 'web-ifc.wasm');
33
39
 
34
40
  if (!fs.existsSync(src)) {
35
41
  console.error(`[copy-web-ifc-wasm] Source not found: ${src}`);
@@ -38,15 +44,20 @@ function main() {
38
44
  }
39
45
 
40
46
  copyFile(src, dst);
47
+ copyFile(src, dstV);
41
48
 
42
49
  const s = fs.statSync(src);
43
50
  const d = fs.statSync(dst);
51
+ const dv = fs.statSync(dstV);
44
52
  console.log('[copy-web-ifc-wasm] OK', {
45
53
  appRoot: appRoot,
46
54
  src: src,
47
55
  dst: dst,
56
+ dstV: dstV,
57
+ versionDir: `v${WASM_DIR_VERSION}`,
48
58
  bytes: d.size,
49
59
  sameSize: s.size === d.size,
60
+ sameSizeV: s.size === dv.size,
50
61
  });
51
62
  }
52
63
 
@@ -79,13 +79,17 @@ export class IfcService {
79
79
  */
80
80
  _getWasmPaths() {
81
81
  const paths = [];
82
-
83
- // 1. Пользовательский путь (если указан)
82
+
83
+ // 1) Версионированный путь (cache-busting). Должен быть ПЕРВЫМ даже если задан wasmUrl,
84
+ // иначе потребитель, который передаёт wasmUrl="/wasm/", будет всегда грузить старый URL.
85
+ paths.push('/wasm/v0.0.74/');
86
+
87
+ // 2) Пользовательский путь (если указан)
84
88
  if (this.wasmUrl) {
85
89
  paths.push(this.wasmUrl);
86
90
  }
87
-
88
- // 2. Популярные пути по умолчанию (в порядке приоритета)
91
+
92
+ // 3) Популярные пути по умолчанию (в порядке приоритета)
89
93
  // Ожидаемый итоговый URL после SetWasmPath(path):
90
94
  // path + 'web-ifc.wasm'
91
95
  paths.push(