mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Update changelog headers and fix dates (#10805)
The changelog release header format has been updated to match the "keep a changelog" [1] format. Each header is now the bracketed version number followed by a dash, then the release date in ISO-8601 format. The release dates in each header were also updated to match the date of the corresponding GitHub Release [2]. Many of these dates were incorrect because they were set on the day we created the release candidate, rather than on the day of release. Any changelog release entries without a corresponding GitHub release was left with the date already specified. The three oldest release headers were missing dates. For the first two, I used the date of the version bump commit. For the third, I removed it since no changes were listed anyway, and it represented a range of releases rather than a single one. The `auto-changelog.js` script has been updated to account for this new format as well. [1]: https://keepachangelog.com/en/1.0.0/ [2]: https://github.com/MetaMask/metamask-extension/releases
This commit is contained in:
parent
097439eda3
commit
13862cbc1b
540
CHANGELOG.md
540
CHANGELOG.md
File diff suppressed because it is too large
Load Diff
@ -2,6 +2,7 @@
|
|||||||
const fs = require('fs').promises;
|
const fs = require('fs').promises;
|
||||||
const assert = require('assert').strict;
|
const assert = require('assert').strict;
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
const { escapeRegExp } = require('lodash');
|
||||||
const { version } = require('../app/manifest/_base.json');
|
const { version } = require('../app/manifest/_base.json');
|
||||||
const runCommand = require('./lib/runCommand');
|
const runCommand = require('./lib/runCommand');
|
||||||
|
|
||||||
@ -72,12 +73,13 @@ async function main() {
|
|||||||
const mostRecentVersion = mostRecentTag.slice(1);
|
const mostRecentVersion = mostRecentTag.slice(1);
|
||||||
|
|
||||||
const isReleaseCandidate = mostRecentVersion !== version;
|
const isReleaseCandidate = mostRecentVersion !== version;
|
||||||
const versionHeader = `## ${version}`;
|
const versionHeader = `## [${version}]`;
|
||||||
|
const escapedVersionHeader = escapeRegExp(versionHeader);
|
||||||
const currentDevelopBranchHeader = '## Current Develop Branch';
|
const currentDevelopBranchHeader = '## Current Develop Branch';
|
||||||
const currentReleaseHeaderPattern = isReleaseCandidate
|
const currentReleaseHeaderPattern = isReleaseCandidate
|
||||||
? // This ensures this doesn't match on a version with a suffix
|
? // This ensures this doesn't match on a version with a suffix
|
||||||
// e.g. v9.0.0 should not match on the header v9.0.0-beta.0
|
// e.g. v9.0.0 should not match on the header v9.0.0-beta.0
|
||||||
`${versionHeader}$|${versionHeader}\\s`
|
`${escapedVersionHeader}$|${escapedVersionHeader}\\s`
|
||||||
: currentDevelopBranchHeader;
|
: currentDevelopBranchHeader;
|
||||||
|
|
||||||
let releaseHeaderIndex = changelogLines.findIndex((line) =>
|
let releaseHeaderIndex = changelogLines.findIndex((line) =>
|
||||||
@ -92,7 +94,7 @@ async function main() {
|
|||||||
|
|
||||||
// Add release header if not found
|
// Add release header if not found
|
||||||
const firstReleaseHeaderIndex = changelogLines.findIndex((line) =>
|
const firstReleaseHeaderIndex = changelogLines.findIndex((line) =>
|
||||||
line.match(/## \d+\.\d+\.\d+/u),
|
line.match(/## \[\d+\.\d+\.\d+\]/u),
|
||||||
);
|
);
|
||||||
changelogLines.splice(firstReleaseHeaderIndex, 0, versionHeader, '');
|
changelogLines.splice(firstReleaseHeaderIndex, 0, versionHeader, '');
|
||||||
releaseHeaderIndex = firstReleaseHeaderIndex;
|
releaseHeaderIndex = firstReleaseHeaderIndex;
|
||||||
|
Loading…
Reference in New Issue
Block a user