mirror of
https://github.com/streamwall/streamwall.git
synced 2025-12-06 01:45:37 -05:00
Fix build/run errors: add missing dependencies on windows 11, add prune (clean build) script, add "start-dev" script with increased verbosity, configure output for webpack, configure basic file-based logging, fix control's export
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -5,4 +5,5 @@ node_modules
|
||||
reports
|
||||
|
||||
# Individual files
|
||||
junit.xml
|
||||
junit.xml
|
||||
streamwall.log
|
||||
42
package-lock.json
generated
42
package-lock.json
generated
@@ -52,6 +52,7 @@
|
||||
"babel-jest": "^29.7.0",
|
||||
"babel-loader": "^9.1.2",
|
||||
"babel-plugin-styled-components": "^2.1.1",
|
||||
"bufferutil": "^4.0.8",
|
||||
"copy-webpack-plugin": "^11.0.0",
|
||||
"css-loader": "^6.7.3",
|
||||
"file-loader": "^6.2.0",
|
||||
@@ -62,6 +63,7 @@
|
||||
"prettier": "2.8.7",
|
||||
"style-loader": "^3.3.2",
|
||||
"supertest": "^6.3.3",
|
||||
"utf-8-validate": "^5.0.10",
|
||||
"webpack": "^5.79.0",
|
||||
"webpack-cli": "^5.0.1"
|
||||
}
|
||||
@@ -4443,6 +4445,20 @@
|
||||
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz",
|
||||
"integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ=="
|
||||
},
|
||||
"node_modules/bufferutil": {
|
||||
"version": "4.0.8",
|
||||
"resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.8.tgz",
|
||||
"integrity": "sha512-4T53u4PdgsXqKaIctwF8ifXlRTTmEPJ8iEPWFdGZvcf7sbwYo6FKFEX9eNNAnzFZ7EzJAQ3CJeOtCRA4rDp7Pw==",
|
||||
"devOptional": true,
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"node-gyp-build": "^4.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.14.2"
|
||||
}
|
||||
},
|
||||
"node_modules/bytes": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz",
|
||||
@@ -9784,6 +9800,18 @@
|
||||
"node": ">= 4.5.0"
|
||||
}
|
||||
},
|
||||
"node_modules/node-gyp-build": {
|
||||
"version": "4.8.1",
|
||||
"resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.1.tgz",
|
||||
"integrity": "sha512-OSs33Z9yWr148JZcbZd5WiAXhh/n9z8TxQcdMhIOlpN9AhWpLfvVFO73+m77bBABQMaY9XSvIa+qk0jlI7Gcaw==",
|
||||
"devOptional": true,
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"node-gyp-build": "bin.js",
|
||||
"node-gyp-build-optional": "optional.js",
|
||||
"node-gyp-build-test": "build-test.js"
|
||||
}
|
||||
},
|
||||
"node_modules/node-int64": {
|
||||
"version": "0.4.0",
|
||||
"resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz",
|
||||
@@ -12258,6 +12286,20 @@
|
||||
"requires-port": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/utf-8-validate": {
|
||||
"version": "5.0.10",
|
||||
"resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.10.tgz",
|
||||
"integrity": "sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==",
|
||||
"devOptional": true,
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"node-gyp-build": "^4.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.14.2"
|
||||
}
|
||||
},
|
||||
"node_modules/util-deprecate": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
|
||||
|
||||
@@ -5,8 +5,10 @@
|
||||
"main": "src/index.js",
|
||||
"scripts": {
|
||||
"build": "webpack",
|
||||
"prune": "rm -rf dist",
|
||||
"start": "npm run build -- --stats=errors-only && electron dist",
|
||||
"start-local": "npm run build -- --stats=errors-only && electron dist --control.address=http://localhost:4444 --control.username=streamwall --control.password=local-dev",
|
||||
"start-dev": "NODE_DEBUG=* npm run build -- --stats=verbose && NODE_DEBUG=* electron dist --enable-logging --control.address=http://localhost:4444 --control.address=http://localhost:4444 --control.username=streamwall --control.password=local-dev",
|
||||
"test-full": "jest",
|
||||
"test": "jest --ci --reporters=default --reporters=jest-junit --testPathIgnorePatterns=src/node/server.test.js --coverage"
|
||||
},
|
||||
@@ -56,6 +58,7 @@
|
||||
"babel-jest": "^29.7.0",
|
||||
"babel-loader": "^9.1.2",
|
||||
"babel-plugin-styled-components": "^2.1.1",
|
||||
"bufferutil": "^4.0.8",
|
||||
"copy-webpack-plugin": "^11.0.0",
|
||||
"css-loader": "^6.7.3",
|
||||
"file-loader": "^6.2.0",
|
||||
@@ -66,6 +69,7 @@
|
||||
"prettier": "2.8.7",
|
||||
"style-loader": "^3.3.2",
|
||||
"supertest": "^6.3.3",
|
||||
"utf-8-validate": "^5.0.10",
|
||||
"webpack": "^5.79.0",
|
||||
"webpack-cli": "^5.0.1"
|
||||
},
|
||||
|
||||
@@ -211,6 +211,16 @@ function parseArgs() {
|
||||
}
|
||||
|
||||
async function main(argv) {
|
||||
const fs = require('fs');
|
||||
const util = require('util');
|
||||
const log_file = fs.createWriteStream('streamwall.log', { flags: 'w' });
|
||||
const log_stdout = process.stdout;
|
||||
|
||||
console.log = console.info = console.warn = console.error = function(d) {
|
||||
log_file.write(util.format(d) + '\n');
|
||||
log_stdout.write(util.format(d) + '\n');
|
||||
};
|
||||
|
||||
// Reject all permission requests from web content.
|
||||
session
|
||||
.fromPartition('persist:session')
|
||||
@@ -327,9 +337,15 @@ async function main(argv) {
|
||||
})
|
||||
}
|
||||
if (msg.type === 'browse') {
|
||||
ensureValidURL(msg.url)
|
||||
browseWindow.loadURL(msg.url)
|
||||
} else if (msg.type === 'dev-tools') {
|
||||
console.error('Attempting to browse URL:', msg.url)
|
||||
try {
|
||||
ensureValidURL(msg.url)
|
||||
browseWindow.loadURL(msg.url)
|
||||
} catch (error) {
|
||||
console.error('Invalid URL:', msg.url)
|
||||
console.error('Error:', error)
|
||||
}
|
||||
} else if (msg.type === 'dev-tools') {
|
||||
streamWindow.openDevTools(msg.viewIdx, browseWindow.webContents)
|
||||
}
|
||||
} else if (msg.type === 'set-stream-censored' && streamdelayClient) {
|
||||
|
||||
@@ -1489,7 +1489,7 @@ const TIN = styled.div`
|
||||
font-family: monospace;
|
||||
`
|
||||
|
||||
function main() {
|
||||
export function main() {
|
||||
const script = document.getElementById('main-script')
|
||||
const wsEndpoint = typeof script?.dataset?.wsEndpoint === 'string' ? script.dataset.wsEndpoint : 'defaultWsEndpoint';
|
||||
const role = typeof script?.dataset?.role === 'string' ? script.dataset.role : 'defaultRole';
|
||||
|
||||
@@ -118,6 +118,13 @@ const webConfig = {
|
||||
patterns: [{ from: 'src/web/*.ejs', to: '[name].ejs' }],
|
||||
}),
|
||||
],
|
||||
stats: {
|
||||
colors: true,
|
||||
modules: true,
|
||||
reasons: true,
|
||||
errorDetails: true,
|
||||
warnings: true,
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = [nodeConfig, browserConfig, webConfig]
|
||||
|
||||
Reference in New Issue
Block a user