iobroker.mywebui 1.40.5 → 1.40.7

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/io-package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "mywebui",
4
- "version": "1.40.5",
4
+ "version": "1.40.7",
5
5
  "titleLang": {
6
6
  "en": "mywebui",
7
7
  "de": "mywebui",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.mywebui",
3
- "version": "1.40.5",
3
+ "version": "1.40.7",
4
4
  "description": "ioBroker mywebui - Custom edited mywebui by gokturk413 with 3D Editor",
5
5
  "type": "module",
6
6
  "main": "dist/backend/main.js",
@@ -11,8 +11,9 @@
11
11
  "start": "web-dev-server --open",
12
12
  "startwww": "cd www && web-dev-server --node-resolve --open",
13
13
  "prepublishOnly": "npm run build",
14
- "build": "npm i && npm run reflection && gulp delAll && tsc && gulp",
15
- "postinstall": "node scripts/copy-three.mjs && node setup-scada-utils.js || echo 'SCADA setup will run on adapter start'",
14
+ "copy-three": "node scripts/copy-three.mjs",
15
+ "build": "npm i && npm run copy-three && npm run reflection && gulp delAll && tsc && gulp",
16
+ "postinstall": "node setup-scada-utils.js || echo 'SCADA setup will run on adapter start'",
16
17
  "test:ts": "mocha --config test/mocharc.custom.json test/tests/*.js",
17
18
  "test:package": "mocha test/package --exit",
18
19
  "test:unit": "mocha test/unit --exit",
@@ -54,6 +55,7 @@
54
55
  "dist/",
55
56
  "www/",
56
57
  "widgets/",
58
+ "scripts/",
57
59
  "io-package.json",
58
60
  "LICENSE",
59
61
  "README.md",
@@ -0,0 +1,94 @@
1
+ /**
2
+ * Copy Three.js to www/node_modules for demo.html
3
+ * Simple, robust version with detailed logging
4
+ */
5
+
6
+ import fs from 'fs';
7
+ import path from 'path';
8
+ import { fileURLToPath } from 'url';
9
+
10
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
11
+ const rootDir = path.join(__dirname, '..');
12
+ const sourceDir = path.join(rootDir, 'node_modules', 'three');
13
+ const targetDir = path.join(rootDir, 'www', 'node_modules', 'three');
14
+ const wwwNodeModules = path.dirname(targetDir);
15
+
16
+ console.log('📦 Three.js Copy Script');
17
+ console.log(`Root: ${rootDir}`);
18
+ console.log(`Source: ${sourceDir}`);
19
+ console.log(`Target: ${targetDir}`);
20
+
21
+ function copyDirSync(src, dest) {
22
+ try {
23
+ // Create destination if needed
24
+ if (!fs.existsSync(dest)) {
25
+ fs.mkdirSync(dest, { recursive: true });
26
+ console.log(`✓ Created: ${dest}`);
27
+ }
28
+
29
+ // Copy all files
30
+ const items = fs.readdirSync(src, { withFileTypes: true });
31
+ let fileCount = 0;
32
+ let dirCount = 0;
33
+
34
+ for (const item of items) {
35
+ const srcPath = path.join(src, item.name);
36
+ const destPath = path.join(dest, item.name);
37
+
38
+ if (item.isDirectory()) {
39
+ dirCount++;
40
+ copyDirSync(srcPath, destPath);
41
+ } else {
42
+ fileCount++;
43
+ fs.copyFileSync(srcPath, destPath);
44
+ }
45
+ }
46
+
47
+ console.log(`✓ Copied ${dirCount} dirs, ${fileCount} files from ${src}`);
48
+ } catch (error) {
49
+ console.error(`✗ Copy failed: ${src}`);
50
+ console.error(` Error: ${error.message}`);
51
+ throw error;
52
+ }
53
+ }
54
+
55
+ try {
56
+ // Check source exists
57
+ if (!fs.existsSync(sourceDir)) {
58
+ console.error(`✗ Source not found: ${sourceDir}`);
59
+ console.log(' Run: npm install');
60
+ process.exit(1);
61
+ }
62
+
63
+ console.log(`✓ Source found: ${sourceDir}`);
64
+
65
+ // Create www/node_modules parent
66
+ if (!fs.existsSync(wwwNodeModules)) {
67
+ fs.mkdirSync(wwwNodeModules, { recursive: true });
68
+ console.log(`✓ Created: ${wwwNodeModules}`);
69
+ }
70
+
71
+ // Remove old copy
72
+ if (fs.existsSync(targetDir)) {
73
+ fs.rmSync(targetDir, { recursive: true, force: true });
74
+ console.log(`✓ Removed old: ${targetDir}`);
75
+ }
76
+
77
+ // Copy three.js
78
+ console.log('📋 Copying Three.js...');
79
+ copyDirSync(sourceDir, targetDir);
80
+
81
+ // Verify
82
+ const testFile = path.join(targetDir, 'build', 'three.module.js');
83
+ if (fs.existsSync(testFile)) {
84
+ console.log(`✅ SUCCESS! Three.js copied to www/node_modules`);
85
+ console.log(` ${testFile}`);
86
+ process.exit(0);
87
+ } else {
88
+ console.error(`✗ Verification failed: ${testFile}`);
89
+ process.exit(1);
90
+ }
91
+ } catch (error) {
92
+ console.error(`✗ FAILED: ${error.message}`);
93
+ process.exit(1);
94
+ }