Upgrade electron-forge to 7.5.0 (#2526)
* Upgrade electron-forge to 7.5.0. Delete lodash path for electron-app, its not need anymore
This commit is contained in:
1 parent
e411c0ab7b
commit
a889cb30e0
5 files changed
+333
-558
No files matched your search
@@ -2,6 +2,20 @@ const fs = require('fs');
|
||||
const path = require('path');
|
||||
const { isLinux } = require('../src/helpers/platform.js');
|
||||
|
||||
/** Always returns a valid semVer. Composed of Major.Minor.Path and all valid integers
|
||||
* Otherwise we run into this issue: https://github.com/electron/packager/issues/1714#issuecomment-2091266284
|
||||
*/
|
||||
const returnSemVerFromReleaseVersion = (releaseVersion) => {
|
||||
let [major, minor, patch] = releaseVersion.split('.').slice(0, 3);
|
||||
|
||||
// Delete, if present, v from Major
|
||||
if (!parseInt(major)) {
|
||||
major = major.replace('v', '');
|
||||
}
|
||||
// parseInt the patch to eliminate any text after the version integer.
|
||||
return `${major}.${minor}.${parseInt(patch)}`;
|
||||
};
|
||||
|
||||
// Create config
|
||||
const createConfig = () => {
|
||||
const config = {
|
||||
@@ -11,11 +25,19 @@ const createConfig = () => {
|
||||
releaseVersion: process.env.RELEASE_VERSION,
|
||||
releaseCommit: process.env.RELEASE_COMMIT,
|
||||
executableName: 'Boundary',
|
||||
releaseVersionRaw: process.env.RELEASE_VERSION,
|
||||
};
|
||||
|
||||
if (isLinux()) config.executableName = 'boundary-desktop';
|
||||
// Take a valid release version in semVer format.
|
||||
if (!config.releaseVersion) {
|
||||
config.releaseVersion = '0.0.0';
|
||||
} else {
|
||||
config.releaseVersion = returnSemVerFromReleaseVersion(
|
||||
config.releaseVersion,
|
||||
);
|
||||
}
|
||||
|
||||
if (!config.releaseVersion) config.releaseVersion = '0.0.0';
|
||||
if (isLinux()) config.executableName = 'boundary-desktop';
|
||||
return config;
|
||||
};
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ module.exports = {
|
||||
// Copy artifacts into release folder
|
||||
options.forEach(({ artifacts, platform, arch }) => {
|
||||
// Generate release name
|
||||
const version = forgeConfig.packagerConfig.appVersion;
|
||||
const version = config.releaseVersionRaw;
|
||||
const destination = path.join('out', 'release', version);
|
||||
if (!fs.existsSync(destination))
|
||||
fs.mkdirSync(destination, { recursive: true });
|
||||
|
||||
@@ -15,8 +15,7 @@
|
||||
"premake": "yarn build:cli && yarn build:config",
|
||||
"make": "electron-forge make",
|
||||
"publish": "electron-forge publish",
|
||||
"lint": "echo \"No linting configured\"",
|
||||
"postinstall": "patch-package"
|
||||
"lint": "echo \"No linting configured\""
|
||||
},
|
||||
"keywords": [],
|
||||
"config": {
|
||||
@@ -37,15 +36,13 @@
|
||||
"which": "^4.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@electron-forge/cli": "^7.2.0",
|
||||
"@electron-forge/maker-deb": "^7.2.0",
|
||||
"@electron-forge/maker-dmg": "^7.2.0",
|
||||
"@electron-forge/maker-squirrel": "^7.2.0",
|
||||
"@electron-forge/maker-zip": "^7.2.0",
|
||||
"@electron-forge/cli": "^7.5.0",
|
||||
"@electron-forge/maker-deb": "^7.5.0",
|
||||
"@electron-forge/maker-dmg": "^7.5.0",
|
||||
"@electron-forge/maker-squirrel": "^7.5.0",
|
||||
"@electron-forge/maker-zip": "^7.5.0",
|
||||
"electron": "31.0.1",
|
||||
"unzipper": "^0.11.5",
|
||||
"patch-package": "^8.0.0",
|
||||
"postinstall-postinstall": "^2.1.0"
|
||||
"unzipper": "^0.11.5"
|
||||
},
|
||||
"resolutions": {
|
||||
"highlight.js": "^10.4.1"
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
diff --git a/node_modules/lodash.template/index.js b/node_modules/lodash.template/index.js
|
||||
index f051141..0c45a8d 100644
|
||||
--- a/node_modules/lodash.template/index.js
|
||||
+++ b/node_modules/lodash.template/index.js
|
||||
@@ -17,6 +17,9 @@ var HOT_COUNT = 800,
|
||||
var INFINITY = 1 / 0,
|
||||
MAX_SAFE_INTEGER = 9007199254740991;
|
||||
|
||||
+/** Error message constants. */
|
||||
+var INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
|
||||
+
|
||||
/** `Object#toString` result references. */
|
||||
var argsTag = '[object Arguments]',
|
||||
arrayTag = '[object Array]',
|
||||
@@ -1343,6 +1346,18 @@ function keysIn(object) {
|
||||
return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
|
||||
}
|
||||
|
||||
+/**
|
||||
+ * Used to validate the `validate` option in `_.template` variable.
|
||||
+ *
|
||||
+ * Forbids characters which could potentially change the meaning of the function argument definition:
|
||||
+ * - "()," (modification of function parameters)
|
||||
+ * - "=" (default value)
|
||||
+ * - "[]{}" (destructuring of function parameters)
|
||||
+ * - "/" (beginning of a comment)
|
||||
+ * - whitespace
|
||||
+ */
|
||||
+var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
|
||||
+
|
||||
/**
|
||||
* Creates a compiled template function that can interpolate data properties
|
||||
* in "interpolate" delimiters, HTML-escape interpolated data properties in
|
||||
@@ -1522,6 +1537,11 @@ function template(string, options, guard) {
|
||||
if (!variable) {
|
||||
source = 'with (obj) {\n' + source + '\n}\n';
|
||||
}
|
||||
+ // Throw an error if a forbidden character was found in `variable`, to prevent
|
||||
+ // potential command injection attacks.
|
||||
+ else if (reForbiddenIdentifierChars.test(variable)) {
|
||||
+ throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
|
||||
+ }
|
||||
// Cleanup code by stripping empty strings.
|
||||
source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
|
||||
.replace(reEmptyStringMiddle, '$1')
|
||||
+301
-500
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user