A Metamask fork with Infura removed and default networks editable
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Rationalize build system arguments (#12047)
This rationalizes how arguments are passed to and parsed by the build system. To accomplish this, everything that isn't an environment variable from `.metamaskrc` or our CI environment is now passed as an argument on the command line.
Of such arguments, the `entryTask` is still expected as a positional argument in the first position (i.e. `process.argv[2]`), but everything else must be passed as a named argument. We use `minimist` to parse the arguments, and set defaults to preserve existing behavior.
Arguments are parsed in a new function, `parseArgv`, in `development/build/index.js`. They are assigned to environment variables where convenient, and otherwise returned from `parseArgv` to be passed to other functions invoked in the same file.
This change is motivated by our previous inconsistent handling of arguments to the build system, which will grow increasingly problematic as the build system grows in complexity. (Which it will very shortly, as we introduce Flask builds.)
Miscellaneous changes:
- Adds a build system readme at `development/build/README.md`
- Removes the `beta` package script. Now, we can instead call: `yarn dist --build-type beta`
- Fixes the casing of some log messages and reorders some parameters in the build system
3 years ago
|
|
|
/**
|
|
|
|
* @returns {Object} An object with browser as key and next version of beta
|
|
|
|
* as the value. E.g. { firefox: '9.6.0.beta0', chrome: '9.6.0.1' }
|
|
|
|
*/
|
|
|
|
function getNextBetaVersionMap(currentVersion, betaVersion, platforms) {
|
|
|
|
const [major, minor] = currentVersion.split('.');
|
|
|
|
|
|
|
|
return platforms.reduce((platformMap, platform) => {
|
|
|
|
platformMap[platform] = [
|
|
|
|
// Keeps the current major
|
|
|
|
major,
|
|
|
|
// Bump the minor version
|
|
|
|
Number(minor) + 1,
|
|
|
|
// This isn't typically used
|
|
|
|
0,
|
|
|
|
// The beta number
|
Rationalize build system arguments (#12047)
This rationalizes how arguments are passed to and parsed by the build system. To accomplish this, everything that isn't an environment variable from `.metamaskrc` or our CI environment is now passed as an argument on the command line.
Of such arguments, the `entryTask` is still expected as a positional argument in the first position (i.e. `process.argv[2]`), but everything else must be passed as a named argument. We use `minimist` to parse the arguments, and set defaults to preserve existing behavior.
Arguments are parsed in a new function, `parseArgv`, in `development/build/index.js`. They are assigned to environment variables where convenient, and otherwise returned from `parseArgv` to be passed to other functions invoked in the same file.
This change is motivated by our previous inconsistent handling of arguments to the build system, which will grow increasingly problematic as the build system grows in complexity. (Which it will very shortly, as we introduce Flask builds.)
Miscellaneous changes:
- Adds a build system readme at `development/build/README.md`
- Removes the `beta` package script. Now, we can instead call: `yarn dist --build-type beta`
- Fixes the casing of some log messages and reorders some parameters in the build system
3 years ago
|
|
|
`${platform === 'firefox' ? 'beta' : ''}${betaVersion}`,
|
|
|
|
].join('.');
|
|
|
|
return platformMap;
|
|
|
|
}, {});
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
getNextBetaVersionMap,
|
|
|
|
};
|