bimplus-renderer 1.8.41 → 1.8.42

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/README.md CHANGED
@@ -150,6 +150,17 @@ npm run test-vitest-modelviewer-chrome
150
150
  npm run test-vitest-modelviewer-chrome-long
151
151
  ```
152
152
 
153
+ Run all four Firefox geometry and visual suites (short and long datasets) with:
154
+
155
+ ```sh
156
+ npm run test-modelviewer-all
157
+ ```
158
+
159
+ The suites run serially and continue after failures. A final table lists each
160
+ suite's PASS/FAIL status, exit code, and duration, followed by an overall result.
161
+ The command exits with code 1 if any suite fails, or 0 if all four pass.
162
+ Individual test counts remain in each suite's output.
163
+
153
164
  ### Modelviewer image comparison (Playwright Test)
154
165
 
155
166
  The standalone Playwright suite loads each IFC into the real renderer, checks
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  " set there the full version string! ": "",
7
7
  " e.g.: semverRange: '1.8.20-my-tag-name-01' ": "",
8
8
  "================================================================================================-": "",
9
- "version": "1.8.41",
9
+ "version": "1.8.42",
10
10
  "description": "bim+ renderer",
11
11
  "types": "types/bimplus-renderer.d.ts",
12
12
  "keywords": [
@@ -48,11 +48,11 @@
48
48
  "build-lls": "npm run copy-wasm-node-modules && npm run build-worker-dev && npm run eslint && webpack --config webpack.dev.js && npm run copy-wasm-lls",
49
49
  "build-prod-lls": "npm run copy-wasm-node-modules && npm run build-worker-prod && npm run eslint && webpack --config webpack.prod.js && npm run check-es2019 && npm run copy-wasm-lls",
50
50
  "code-metrics": "plato -r -d metrics src",
51
- "copy-compiled-worker": "cpy --flat ./dist/GlbProcessorWorker.bimplus-renderer.worker.js ./src/compiledWorkers",
51
+ "copy-compiled-worker": "node scripts/copy-files.js --flat ./dist/GlbProcessorWorker.bimplus-renderer.worker.js ./src/compiledWorkers",
52
52
  "cleanup-compiled-worker": "rimraf ./src/compiledWorkers/GlbProcessorWorker.bimplus-renderer.worker.js",
53
- "copy-wasm": "cpy ./src/wasm/*.wasm ./dist/",
54
- "copy-wasm-node-modules": "cpy ./node_modules/web-ifc/web-ifc.wasm ./node_modules/web-ifc/web-ifc-mt.wasm ./src/wasm/ --flat",
55
- "copy-wasm-lls": "cpy './src/wasm/*.wasm' ./dist/",
53
+ "copy-wasm": "node scripts/copy-files.js \"./src/wasm/*.wasm\" ./dist/",
54
+ "copy-wasm-node-modules": "node scripts/copy-files.js ./node_modules/web-ifc/web-ifc.wasm ./node_modules/web-ifc/web-ifc-mt.wasm ./src/wasm/ --flat",
55
+ "copy-wasm-lls": "node scripts/copy-files.js \"./src/wasm/*.wasm\" ./dist/",
56
56
  "npm-publish-lls": "npm run build-prod-lls && npm run publish",
57
57
  "npm-publish-rc-lls": "npm run build-prod-lls && npm run publish --tag rc",
58
58
  "npm-publish-branch-lls": "npm run build-prod-lls && npm run publish --tag",
@@ -65,6 +65,7 @@
65
65
  "test": "npm run test-firefox-coverage",
66
66
  "test-chrome": "npm run test-chrome-headed",
67
67
  "test-firefox": "npm run test-firefox-headed",
68
+ "test-all": "npm run test-firefox-coverage && npm run test-modelviewer-all",
68
69
  "//===================== Test helpers and browser/Polly prerequisites ==========================": "",
69
70
  "test-firefox-task": "vitest run --project=firefox --outputFile.junit=test-results/vitest-firefox.xml",
70
71
  "test-firefox-headed": "start-server-and-test test-polly-listen-task tcp:localhost:3000 \"npm run test-firefox-task -- --browser.headless=false\"",
@@ -101,6 +102,7 @@
101
102
  "//=========================================================================================-===": "",
102
103
  "// 2.) DDT TESTS Scripts starting modelviewer-data-driven-tests ": "",
103
104
  "//============================================================================================-": "",
105
+ "test-modelviewer-all": "node scripts/test-modelviewer-all.js",
104
106
  "test-modelviewer-ddt": "npm run test-vitest-modelviewer-firefox",
105
107
  "test-modelviewer-ddt-long": "npm run test-vitest-modelviewer-firefox-long",
106
108
  "test-modelviewer-ddt-watch": "npm run test-vitest-modelviewer-firefox-watch",
@@ -137,10 +139,9 @@
137
139
  "@vitest/coverage-istanbul": "5.0.5",
138
140
  "acorn": "8.19.0",
139
141
  "babel-loader": "^10.1.1",
140
- "bimplus-websdk": "^1.0.71",
142
+ "bimplus-websdk": "^1.0.72",
141
143
  "clean-webpack-plugin": "^4.0.0",
142
144
  "copy-webpack-plugin": "^14.0.0",
143
- "cpy-cli": "^7.0.0",
144
145
  "eslint": "^10.13.0",
145
146
  "file-loader": "6.2.0",
146
147
  "globals": "17.13.0",
@@ -0,0 +1,83 @@
1
+ // Minimal dependency-free replacement for cpy-cli, covering the copy tasks
2
+ // used by this package.
3
+ //
4
+ // Usage: node scripts/copy-files.js [--flat] <file|glob>... <destinationDirectory>
5
+ //
6
+ // - Wildcards (* and ?) are supported in the file name part of a pattern only,
7
+ // e.g. "./src/wasm/*.wasm". Recursive globs (**) are not supported.
8
+ // - All files are copied directly into the destination directory. Because
9
+ // wildcards are restricted to the file name part, this matches both the
10
+ // default and the --flat behavior of cpy for the patterns used here.
11
+ // The --flat flag is accepted and ignored for compatibility.
12
+
13
+ const fs = require('fs');
14
+ const path = require('path');
15
+
16
+ const args = process.argv.slice(2).filter((arg) => arg !== '--flat');
17
+
18
+ if (args.length < 2) {
19
+ console.error('Usage: node scripts/copy-files.js [--flat] <file|glob>... <destinationDirectory>');
20
+ process.exit(1);
21
+ }
22
+
23
+ const destination = args.pop();
24
+ const patterns = args;
25
+
26
+ const hasWildcard = (text) => /[*?]/.test(text);
27
+
28
+ // Convert a wildcard pattern ("*" and "?") to a regular expression.
29
+ const wildcardToRegExp = (pattern) => {
30
+ const escaped = pattern
31
+ .replace(/[.+^${}()|[\]\\]/g, '\\$&')
32
+ .replace(/\*/g, '.*')
33
+ .replace(/\?/g, '.');
34
+ return new RegExp(`^${escaped}$`);
35
+ };
36
+
37
+ const resolvePattern = (pattern) => {
38
+ const directory = path.dirname(pattern);
39
+ const fileNamePattern = path.basename(pattern);
40
+
41
+ if (hasWildcard(directory)) {
42
+ console.error(`Wildcards are only supported in the file name part of a pattern: ${pattern}`);
43
+ process.exit(1);
44
+ }
45
+
46
+ if (!hasWildcard(fileNamePattern)) {
47
+ return [pattern];
48
+ }
49
+
50
+ if (!fs.existsSync(directory)) {
51
+ return [];
52
+ }
53
+
54
+ const matcher = wildcardToRegExp(fileNamePattern);
55
+ return fs
56
+ .readdirSync(directory, { withFileTypes: true })
57
+ .filter((entry) => entry.isFile() && matcher.test(entry.name))
58
+ .map((entry) => path.join(directory, entry.name));
59
+ };
60
+
61
+ let copiedCount = 0;
62
+ for (const pattern of patterns) {
63
+ const files = resolvePattern(pattern.replace(/\\/g, '/'));
64
+
65
+ if (files.length === 0) {
66
+ console.error(`No files matched pattern: ${pattern}`);
67
+ process.exit(1);
68
+ }
69
+
70
+ for (const file of files) {
71
+ if (!fs.existsSync(file)) {
72
+ console.error(`File not found: ${file}`);
73
+ process.exit(1);
74
+ }
75
+
76
+ const destinationPath = path.join(destination, path.basename(file));
77
+ fs.mkdirSync(path.dirname(destinationPath), { recursive: true });
78
+ fs.copyFileSync(file, destinationPath);
79
+ copiedCount += 1;
80
+ }
81
+ }
82
+
83
+ console.log(`Copied ${copiedCount} file(s) to ${destination}`);
@@ -0,0 +1,35 @@
1
+ const { spawnSync } = require('node:child_process');
2
+ const path = require('node:path');
3
+
4
+ const scripts = [
5
+ 'test-modelviewer-ddt',
6
+ 'test-modelviewer-ddt-long',
7
+ 'test-modelviewer-ddt-visual',
8
+ 'test-modelviewer-ddt-visual-long'
9
+ ];
10
+
11
+ const results = scripts.map(script => {
12
+ console.log(`\n=== ${script} ===\n`);
13
+ const started = Date.now();
14
+ const result = spawnSync(process.execPath, [process.env.npm_execpath, 'run', script], {
15
+ cwd: path.resolve(__dirname, '..'),
16
+ stdio: 'inherit'
17
+ });
18
+
19
+ if (result.error) {
20
+ console.error(result.error.message);
21
+ }
22
+
23
+ return {
24
+ Suite: script,
25
+ Result: result.status === 0 ? 'PASS' : 'FAIL',
26
+ 'Exit Code': result.status === null ? result.signal || 'ERROR' : result.status,
27
+ Duration: `${((Date.now() - started) / 1000).toFixed(1)}s`
28
+ };
29
+ });
30
+
31
+ const failed = results.filter(result => result.Result === 'FAIL').length;
32
+ console.log('\n=== Modelviewer Test Summary ===\n');
33
+ console.table(results);
34
+ console.log(`Overall: ${failed === 0 ? 'PASS' : 'FAIL'} (${results.length - failed} passed, ${failed} failed)`);
35
+ process.exitCode = failed === 0 ? 0 : 1;