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
feature/default_network_editable
Mark Stacey 4 years ago committed by GitHub
parent 097439eda3
commit 13862cbc1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 540
      CHANGELOG.md
  2. 8
      development/auto-changelog.js

File diff suppressed because it is too large Load Diff

@ -2,6 +2,7 @@
const fs = require('fs').promises;
const assert = require('assert').strict;
const path = require('path');
const { escapeRegExp } = require('lodash');
const { version } = require('../app/manifest/_base.json');
const runCommand = require('./lib/runCommand');
@ -72,12 +73,13 @@ async function main() {
const mostRecentVersion = mostRecentTag.slice(1);
const isReleaseCandidate = mostRecentVersion !== version;
const versionHeader = `## ${version}`;
const versionHeader = `## [${version}]`;
const escapedVersionHeader = escapeRegExp(versionHeader);
const currentDevelopBranchHeader = '## Current Develop Branch';
const currentReleaseHeaderPattern = isReleaseCandidate
? // 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
`${versionHeader}$|${versionHeader}\\s`
`${escapedVersionHeader}$|${escapedVersionHeader}\\s`
: currentDevelopBranchHeader;
let releaseHeaderIndex = changelogLines.findIndex((line) =>
@ -92,7 +94,7 @@ async function main() {
// Add release header if not found
const firstReleaseHeaderIndex = changelogLines.findIndex((line) =>
line.match(/## \d+\.\d+\.\d+/u),
line.match(/## \[\d+\.\d+\.\d+\]/u),
);
changelogLines.splice(firstReleaseHeaderIndex, 0, versionHeader, '');
releaseHeaderIndex = firstReleaseHeaderIndex;

Loading…
Cancel
Save