update: upgrade electron to major version 9 with spectron to 11 and associated changes
This commit is contained in:
parent
0baba65686
commit
f39c033a45
File diff suppressed because it is too large
Load Diff
|
@ -74,7 +74,7 @@
|
||||||
"chai": "^4.2.0",
|
"chai": "^4.2.0",
|
||||||
"chokidar": "^3.4.1",
|
"chokidar": "^3.4.1",
|
||||||
"concurrently": "^5.2.0",
|
"concurrently": "^5.2.0",
|
||||||
"electron": "^8.4.1",
|
"electron": "^9.1.1",
|
||||||
"electron-rebuild": "^1.11.0",
|
"electron-rebuild": "^1.11.0",
|
||||||
"eslint": "^7.5.0",
|
"eslint": "^7.5.0",
|
||||||
"eslint-config-prettier": "^6.11.0",
|
"eslint-config-prettier": "^6.11.0",
|
||||||
|
@ -89,7 +89,7 @@
|
||||||
"prettier": "^2.0.5",
|
"prettier": "^2.0.5",
|
||||||
"rewiremock": "^3.14.3",
|
"rewiremock": "^3.14.3",
|
||||||
"sinon": "^9.0.2",
|
"sinon": "^9.0.2",
|
||||||
"spectron": "^10.0.1",
|
"spectron": "^11.1.0",
|
||||||
"svelte": "^3.24.0",
|
"svelte": "^3.24.0",
|
||||||
"svelte-loader": "^2.13.6",
|
"svelte-loader": "^2.13.6",
|
||||||
"ts-loader": "^8.0.1",
|
"ts-loader": "^8.0.1",
|
||||||
|
|
|
@ -15,11 +15,11 @@ export class Session implements ISession {
|
||||||
? [
|
? [
|
||||||
'default-src devtools:;' +
|
'default-src devtools:;' +
|
||||||
"script-src 'unsafe-eval';" +
|
"script-src 'unsafe-eval';" +
|
||||||
"script-src-elem devtools: 'sha256-hl04hLzKBpmsfWF2wIA/0Vs6ZNV5T9ZNFY//3uXrgSk=';" +
|
"script-src-elem file: devtools: 'sha256-hl04hLzKBpmsfWF2wIA/0Vs6ZNV5T9ZNFY//3uXrgSk=';" +
|
||||||
"style-src devtools: 'unsafe-inline';" +
|
"style-src devtools: 'unsafe-inline';" +
|
||||||
'connect-src devtools: data:',
|
'connect-src devtools: data:',
|
||||||
]
|
]
|
||||||
: ["default-src 'none'"],
|
: ["default-src 'self';" + "style-src 'unsafe-inline'"],
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
{
|
|
||||||
"prod": {
|
|
||||||
"csp": {
|
|
||||||
"default-src": ["self"],
|
|
||||||
"style-src": ["unsafe-inline"]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"dev": {
|
|
||||||
"csp": {
|
|
||||||
"default-src": ["self"],
|
|
||||||
"style-src": ["unsafe-inline"],
|
|
||||||
"script-src": ["self", "unsafe-eval"]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -2,12 +2,6 @@
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
{{#if csp}}
|
|
||||||
<meta
|
|
||||||
http-equiv="Content-Security-Policy"
|
|
||||||
content="{{#each csp}}{{@key}}{{#each this}} '{{this}}'{{/each}};{{/each}}"
|
|
||||||
/>
|
|
||||||
{{/if}}
|
|
||||||
<title>{{appTitle}}</title>
|
<title>{{appTitle}}</title>
|
||||||
</head>
|
</head>
|
||||||
<body id="app"></body>
|
<body id="app"></body>
|
||||||
|
|
|
@ -3,22 +3,16 @@ const path = require('path');
|
||||||
const handlebars = require('handlebars');
|
const handlebars = require('handlebars');
|
||||||
const packageJson = require('../package');
|
const packageJson = require('../package');
|
||||||
|
|
||||||
function compile(isDevMode = false) {
|
function compile() {
|
||||||
const dataPath = path.resolve(__dirname, 'data.json');
|
|
||||||
const data = JSON.parse(fs.readFileSync(dataPath).toString());
|
|
||||||
const templatePath = path.resolve(__dirname, 'index.html.handlebars');
|
const templatePath = path.resolve(__dirname, 'index.html.handlebars');
|
||||||
const template = fs.readFileSync(templatePath).toString();
|
const template = fs.readFileSync(templatePath).toString();
|
||||||
const delegate = handlebars.compile(template);
|
const delegate = handlebars.compile(template);
|
||||||
let extendedData;
|
const data = {
|
||||||
if (isDevMode) {
|
appBundle: './bundle.js',
|
||||||
extendedData = data.dev;
|
appTitle: packageJson.productName,
|
||||||
} else {
|
};
|
||||||
extendedData = data.prod;
|
|
||||||
}
|
|
||||||
extendedData.appBundle = './bundle.js';
|
|
||||||
extendedData.appTitle = packageJson.productName;
|
|
||||||
|
|
||||||
return delegate(extendedData);
|
return delegate(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.compile = compile;
|
exports.compile = compile;
|
||||||
|
|
Loading…
Reference in New Issue