1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 01:47:00 +01:00

Migrate version from _base manifest to package.json (#11029)

The version field is now stored in the main `package.json` file rather
than in the base manifest. It is built into the final manifest during
the build script.

This makes it easier to communicate what the current version should be
to our `auto-changelog` script. It's also generally a more conventional
place to keep track of the version, even considering that we're not
publishing to npm.
This commit is contained in:
Mark Stacey 2021-05-10 18:46:03 -02:30 committed by GitHub
parent c188e3fda0
commit 36869a4350
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 17 additions and 15 deletions

View File

@ -19,9 +19,7 @@ fi
printf '%s\n' 'Updating the manifest version if needed'
version="${CIRCLE_BRANCH/Version-v/}"
updated_manifest="$(jq ".version = \"$version\"" app/manifest/_base.json)"
printf '%s\n' "$updated_manifest" > app/manifest/_base.json
yarn prettier --write app/manifest/_base.json
yarn version --no-git-tag-version --new-version "${version}"
if [[ -z $(git status --porcelain) ]]
then

View File

@ -28,7 +28,7 @@ fi
printf '%s\n' 'Commit the manifest version and changelog if the manifest has changed'
if git diff --quiet app/manifest/_base.json;
if git diff --quiet package.json;
then
printf '%s\n' 'No manifest changes to commit'
exit 0
@ -38,7 +38,7 @@ git \
-c user.name='MetaMask Bot' \
-c user.email='metamaskbot@users.noreply.github.com' \
commit --message "${CIRCLE_BRANCH/-/ }" \
CHANGELOG.md app/manifest/_base.json
CHANGELOG.md package.json
repo_slug="$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME"
git push "https://$GITHUB_TOKEN_USER:$GITHUB_TOKEN@github.com/$repo_slug" "$CIRCLE_BRANCH"

View File

@ -71,6 +71,5 @@
"notifications"
],
"short_name": "__MSG_appName__",
"version": "9.5.0",
"web_accessible_resources": ["inpage.js", "phishing.html"]
}

View File

@ -1,6 +1,6 @@
const fs = require('fs');
const path = require('path');
const { version } = require('../app/manifest/_base.json');
const { version } = require('../package.json');
const changelog = fs.readFileSync(
path.join(__dirname, '..', 'CHANGELOG.md'),

View File

@ -4,7 +4,7 @@ const gulpZip = require('gulp-zip');
const del = require('del');
const pify = require('pify');
const pump = pify(require('pump'));
const baseManifest = require('../../app/manifest/_base.json');
const { version } = require('../../package.json');
const { createTask, composeParallel } = require('./task');
module.exports = createEtcTasks;
@ -38,7 +38,7 @@ function createZipTask(target) {
return async () => {
await pump(
gulp.src(`dist/${target}/**`),
gulpZip(`metamask-${target}-${baseManifest.version}.zip`),
gulpZip(`metamask-${target}-${version}.zip`),
gulp.dest('builds'),
);
};

View File

@ -3,6 +3,7 @@ const path = require('path');
const { merge, cloneDeep } = require('lodash');
const baseManifest = require('../../app/manifest/_base.json');
const { version } = require('../../package.json');
const { createTask, composeSeries } = require('./task');
@ -23,7 +24,11 @@ function createManifestTasks({ browserPlatforms }) {
`${platform}.json`,
),
);
const result = merge(cloneDeep(baseManifest), platformModifications);
const result = merge(
cloneDeep(baseManifest),
{ version },
platformModifications,
);
const dir = path.join('.', 'dist', platform);
await fs.mkdir(dir, { recursive: true });
await writeJson(result, path.join(dir, 'manifest.json'));

View File

@ -22,7 +22,7 @@ const metamaskrc = require('rc')('metamask', {
SEGMENT_LEGACY_WRITE_KEY: process.env.SEGMENT_LEGACY_WRITE_KEY,
});
const baseManifest = require('../../app/manifest/_base.json');
const { version } = require('../../package.json');
const packageJSON = require('../../package.json');
const {
@ -424,7 +424,7 @@ function getEnvironmentVariables({ devMode, testing }) {
return {
METAMASK_DEBUG: devMode,
METAMASK_ENVIRONMENT: environment,
METAMASK_VERSION: baseManifest.version,
METAMASK_VERSION: version,
NODE_ENV: devMode ? 'development' : 'production',
IN_TEST: testing ? 'true' : false,
PUBNUB_SUB_KEY: process.env.PUBNUB_SUB_KEY || '',

View File

@ -1,6 +1,6 @@
{
"name": "metamask-crx",
"version": "0.0.0",
"version": "9.5.0",
"private": true,
"repository": {
"type": "git",
@ -103,6 +103,7 @@
"@metamask/jazzicon": "^2.0.0",
"@metamask/logo": "^2.5.0",
"@metamask/obs-store": "^5.0.0",
"@metamask/post-message-stream": "^4.0.0",
"@popperjs/core": "^2.4.0",
"@reduxjs/toolkit": "^1.5.0",
"@sentry/browser": "^5.26.0",
@ -162,7 +163,6 @@
"nonce-tracker": "^1.0.0",
"obj-multiplex": "^1.0.0",
"pify": "^5.0.0",
"@metamask/post-message-stream": "^4.0.0",
"promise-to-callback": "^1.0.0",
"prop-types": "^15.6.1",
"pubnub": "4.27.3",

View File

@ -3,7 +3,7 @@ const os = require('os');
const path = require('path');
const { Builder, By, until } = require('selenium-webdriver');
const firefox = require('selenium-webdriver/firefox');
const { version } = require('../../../app/manifest/_base.json');
const { version } = require('../../../package.json');
/**
* The prefix for temporary Firefox profiles. All Firefox profiles used for e2e tests