@vixoniccom/module-packager 2.10.2-test.5 → 2.10.2-test.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/dist/build/371.bundle.js +433 -0
- package/dist/build/676.bundle.js +693 -0
- package/dist/build/index.html +73 -0
- package/dist/build/main.bundle.js +419356 -0
- package/dist/electron.js +68 -0
- package/dist/main.js +109 -83
- package/dist/webpack.config.js +140 -108
- package/index.html +73 -52
- package/package.json +25 -20
package/index.html
CHANGED
|
@@ -1,67 +1,88 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
2
|
<html style="width: 100%; height: 100%; margin: 0; padding: 0;">
|
|
3
|
+
|
|
3
4
|
<head>
|
|
4
5
|
<title></title>
|
|
5
6
|
</head>
|
|
7
|
+
|
|
6
8
|
<body style="width: 100%; height: 100%; margin: 0; padding: 0;">
|
|
7
|
-
<webview style="width: 100%; height: 100%; margin: 0; padding: 0;" id="webview"
|
|
8
|
-
<script type="text/javascript">
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
webview.addEventListener('did-finish-load', () => {
|
|
19
|
-
win.show()
|
|
20
|
-
win.focus()
|
|
21
|
-
})
|
|
22
|
-
webview.src = options.mode === 'watch'
|
|
23
|
-
? `http://localhost:${options.port}/index.html`
|
|
24
|
-
: `file://${path.join(options.build, 'index.html')}`
|
|
25
|
-
|
|
26
|
-
function getData () {
|
|
27
|
-
let data = {}
|
|
28
|
-
try {
|
|
29
|
-
data.parameters = require(path.join(options.src, '/test/parameters.json')).parameters
|
|
30
|
-
} catch (err) {
|
|
31
|
-
console.log('No parameters.')
|
|
32
|
-
}
|
|
9
|
+
<webview style="width: 100%; height: 100%; margin: 0; padding: 0;" id="webview"></webview>
|
|
10
|
+
<script type="text/javascript">
|
|
11
|
+
// import path from 'path'
|
|
12
|
+
// import { ipcRenderer } from 'electron'
|
|
13
|
+
// import remote from '@electron/remote'
|
|
14
|
+
// import ModuleController from '@vixoniccom/module-controller'
|
|
15
|
+
const path = require('path')
|
|
16
|
+
const ModuleController = require('@vixoniccom/module-controller')
|
|
17
|
+
const { ipcRenderer } = require('electron')
|
|
18
|
+
const remote = require('@electron/remote')
|
|
33
19
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
20
|
+
ipcRenderer.on('init', (event, options) => {
|
|
21
|
+
console.log('[WEBVIEW] init', options)
|
|
22
|
+
let webview = document.getElementById('webview')
|
|
23
|
+
let win = remote.getCurrentWindow()
|
|
24
|
+
webview.setAttribute('nodeintegration', '');
|
|
25
|
+
webview.setAttribute('webpreferences', 'contextIsolation=no, nodeIntegration=yes');
|
|
26
|
+
webview.addEventListener('did-finish-load', () => {
|
|
27
|
+
console.log('[WEBVIEW] did-finish-load fired');
|
|
28
|
+
win.show()
|
|
29
|
+
win.focus()
|
|
30
|
+
})
|
|
39
31
|
|
|
40
|
-
|
|
32
|
+
webview.addEventListener('did-fail-load', (e) => {
|
|
33
|
+
console.error('[WEBVIEW] did-fail-load', e);
|
|
34
|
+
});
|
|
41
35
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
36
|
+
console.log('[WEBVIEW] Resolved src:', options.mode === 'watch'
|
|
37
|
+
? `http://localhost:${options.port}/index.html`
|
|
38
|
+
: `file://${path.join(options.build, 'index.html')}`);
|
|
39
|
+
|
|
40
|
+
webview.src = options.mode === 'watch'
|
|
41
|
+
? `http://localhost:${options.port}/index.html`
|
|
42
|
+
: `file://${path.join(options.build, 'index.html')}`
|
|
43
|
+
|
|
44
|
+
function getData() {
|
|
45
|
+
let data = {}
|
|
46
|
+
try {
|
|
47
|
+
data.parameters = require(path.join(options.src, '/test/parameters.json')).parameters
|
|
48
|
+
} catch (err) {
|
|
49
|
+
console.log(err)
|
|
50
|
+
console.log('No parameters.')
|
|
51
|
+
}
|
|
48
52
|
|
|
49
|
-
|
|
50
|
-
|
|
53
|
+
let escaped = path.join(options.mode === 'watch' ? options.src : options.build, 'test', 'downloads')
|
|
54
|
+
console.log("🚀 ~ getData ~ escaped:", escaped)
|
|
51
55
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
// Add file:// to watch because in this mode the app will be in a localhost hosted environment.
|
|
57
|
+
if (options.mode === 'watch') escaped = `file://${escaped}`
|
|
58
|
+
escaped = escaped.replace(/\\/g, '/')
|
|
59
|
+
|
|
60
|
+
data.downloadsPath = escaped
|
|
61
|
+
|
|
62
|
+
try {
|
|
63
|
+
data.services = require(path.join(options.src, '/test/services.json')).services
|
|
64
|
+
console.log(data.services)
|
|
65
|
+
} catch (err) {
|
|
66
|
+
console.log('No services.')
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return data
|
|
58
70
|
}
|
|
59
|
-
return data
|
|
60
|
-
}
|
|
61
71
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
72
|
+
function getSchema() {
|
|
73
|
+
let data = {}
|
|
74
|
+
try {
|
|
75
|
+
data = require(path.join(options.src, '../configuration.json')).schema
|
|
76
|
+
} catch (err) {
|
|
77
|
+
console.log('No schema.')
|
|
78
|
+
}
|
|
79
|
+
return data
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
ModuleController.init(win, webview, getData(), getSchema(), options.mode === 'watch')
|
|
83
|
+
})
|
|
84
|
+
</script>
|
|
65
85
|
|
|
66
86
|
</body>
|
|
67
|
-
|
|
87
|
+
|
|
88
|
+
</html>
|
package/package.json
CHANGED
|
@@ -59,11 +59,7 @@
|
|
|
59
59
|
"@vixoniccom/module-controller": "1.3.0-dev.5",
|
|
60
60
|
"@vixoniccom/modules": "^2.20.0",
|
|
61
61
|
"archiver": "^5.3.0",
|
|
62
|
-
"
|
|
63
|
-
"babel-loader": "^10.0.0",
|
|
64
|
-
"babel-polyfill": "^6.26.0",
|
|
65
|
-
"@babel/preset-env": "^7.27.2",
|
|
66
|
-
"@babel/preset-react": "^7.26.3",
|
|
62
|
+
"clean-webpack-plugin": "^4.0.0",
|
|
67
63
|
"cli-color": "^1.2.0",
|
|
68
64
|
"command-line-args": "^3.0.1",
|
|
69
65
|
"copy-webpack-plugin": "^13.0.0",
|
|
@@ -74,12 +70,11 @@
|
|
|
74
70
|
"html-webpack-plugin": "^4.5.2",
|
|
75
71
|
"lodash": "^4.17.21",
|
|
76
72
|
"raw-loader": "^0.5.1",
|
|
77
|
-
"ts-loader": "^
|
|
73
|
+
"ts-loader": "^9.5.0",
|
|
78
74
|
"ts-node": "^10.9.1",
|
|
79
|
-
"clean-webpack-plugin": "^4.0.0",
|
|
80
75
|
"typescript": "^5.8.3",
|
|
81
|
-
"webpack": "5",
|
|
82
|
-
"webpack-cli": "^
|
|
76
|
+
"webpack": "^5.99.8",
|
|
77
|
+
"webpack-cli": "^6.0.1",
|
|
83
78
|
"webpack-dev-server": "^5.2.1"
|
|
84
79
|
},
|
|
85
80
|
"directories": {},
|
|
@@ -87,7 +82,7 @@
|
|
|
87
82
|
"shasum": "9735f3bcbf2101d404d7bb058cb8337b0a87c503",
|
|
88
83
|
"tarball": "https://registry.npmjs.org/@vixoniccom/module-packager/-/module-packager-1.2.0.tgz"
|
|
89
84
|
},
|
|
90
|
-
"main": "main.js",
|
|
85
|
+
"main": "dist/build/main.bundle.js",
|
|
91
86
|
"maintainers": [
|
|
92
87
|
{
|
|
93
88
|
"name": "vixonic",
|
|
@@ -97,23 +92,33 @@
|
|
|
97
92
|
"name": "@vixoniccom/module-packager",
|
|
98
93
|
"readme": "ERROR: No README data found!",
|
|
99
94
|
"scripts": {
|
|
100
|
-
"start": "electron",
|
|
101
|
-
"
|
|
102
|
-
"build
|
|
103
|
-
"build": "
|
|
104
|
-
"
|
|
95
|
+
"start": "electron dist/electron.js --mode run --build ./dist/build",
|
|
96
|
+
"build:renderer": "webpack ./webpack.config.js --mode production --env src=./ --env build=./dist/build",
|
|
97
|
+
"build:main": "tsc -p tsconfig.json",
|
|
98
|
+
"build": "npm-run-all -p build:renderer build:main",
|
|
99
|
+
"dev:renderer": "webpack serve ./webpack.config.js --mode development --env src=./src --env build=./dist/build --env port=8080",
|
|
100
|
+
"dev:electron": "wait-on http://localhost:8080/index.html && electron dist/electron.js --mode watch --port 8080 --build ./dist/build",
|
|
101
|
+
"dev": "npm-run-all -p dev:renderer dev:electron",
|
|
105
102
|
"prerelease-dev": "standard-version --prerelease dev",
|
|
106
103
|
"prerelease-rc": "standard-version --prerelease rc",
|
|
107
104
|
"prerelease-test": "standard-version --prerelease test",
|
|
108
105
|
"release": "standard-version"
|
|
109
106
|
},
|
|
110
|
-
"
|
|
107
|
+
"type": "module",
|
|
108
|
+
"version": "2.10.2-test.7",
|
|
111
109
|
"license": "ISC",
|
|
112
110
|
"devDependencies": {
|
|
113
|
-
"@
|
|
114
|
-
"@
|
|
115
|
-
"@
|
|
111
|
+
"@types/archiver": "^6.0.3",
|
|
112
|
+
"@types/cli-color": "^2.0.6",
|
|
113
|
+
"@types/command-line-args": "^5.2.3",
|
|
116
114
|
"@types/node": "^20.11.25",
|
|
117
|
-
"
|
|
115
|
+
"concurrently": "^9.1.2",
|
|
116
|
+
"css-loader": "^7.1.2",
|
|
117
|
+
"npm-run-all": "^4.1.5",
|
|
118
|
+
"sass": "^1.88.0",
|
|
119
|
+
"sass-loader": "^16.0.5",
|
|
120
|
+
"standard-version": "^9.3.1",
|
|
121
|
+
"style-loader": "^4.0.0",
|
|
122
|
+
"wait-on": "^8.0.3"
|
|
118
123
|
}
|
|
119
124
|
}
|