Skip to content

Commit ff6cd33

Browse files
authored
Merge branch 'main' into fix-repo-links-in-updated-changelogs
2 parents 68f1121 + 8e22513 commit ff6cd33

37 files changed

+4615
-339
lines changed

.github/workflows/build-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ jobs:
8585
- run: yarn lint
8686
- name: Validate RC changelog
8787
if: ${{ startsWith(github.head_ref, 'release/') }}
88-
run: yarn auto-changelog validate --rc
88+
run: yarn auto-changelog validate --rc --prettier
8989
- name: Validate changelog
9090
if: ${{ !startsWith(github.head_ref, 'release/') }}
91-
run: yarn auto-changelog validate
91+
run: yarn auto-changelog validate --prettier
9292
- name: Require clean working directory
9393
shell: bash
9494
run: |

.github/workflows/create-release-pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ jobs:
3333
uses: actions/setup-node@v3
3434
with:
3535
node-version-file: '.nvmrc'
36-
- uses: MetaMask/action-create-release-pr@v1
36+
- uses: MetaMask/action-create-release-pr@v3
3737
env:
3838
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3939
with:
4040
release-type: ${{ github.event.inputs.release-type }}
4141
release-version: ${{ github.event.inputs.release-version }}
4242
artifacts-path: gh-action__release-authors
4343
# Upload the release author artifact for use in subsequent workflows
44-
- uses: actions/upload-artifact@v3
44+
- uses: actions/upload-artifact@v4
4545
with:
4646
name: release-authors
4747
path: gh-action__release-authors

.github/workflows/security-code-scanner.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
name: 'MetaMask Security Code Scanner'
1+
name: MetaMask Security Code Scanner
22

33
on:
44
push:
5-
branches: ['main']
5+
branches:
6+
- main
67
pull_request:
7-
branches: ['main']
8+
branches:
9+
- main
10+
workflow_dispatch:
811

912
jobs:
1013
run-security-scan:
@@ -15,7 +18,7 @@ jobs:
1518
security-events: write
1619
steps:
1720
- name: MetaMask Security Code Scanner
18-
uses: MetaMask/Security-Code-Scanner@main
21+
uses: MetaMask/action-security-code-scanner@v1
1922
with:
2023
repo: ${{ github.repository }}
2124
paths_ignored: |

CHANGELOG.md

Lines changed: 58 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,92 @@
11
# Changelog
2+
23
All notable changes to this project will be documented in this file.
34

45
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
56
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
67

78
## [Unreleased]
89

10+
## [4.1.2]
11+
12+
### Fixed
13+
14+
- Improved error handling when opening browser fails due to System Events permissions or non-standard browser configurations ([#178](https://github.com/MetaMask/create-release-branch/pull/178))
15+
- Now provides clear manual URL instructions instead of failing with osascript errors
16+
- Handles both cases: when terminal lacks System Events permissions and when using alternative browsers like Brave
17+
18+
## [4.1.1]
19+
20+
### Fixed
21+
22+
- Ask users to include peer dependents of a major-bumped package in the release, even they've had no changes ([#173](https://github.com/MetaMask/create-release-branch/pull/173))
23+
- UI: Include all peer dependents of a major-bumped package as available packages to release, even if they've had no changes ([#173](https://github.com/MetaMask/create-release-branch/pull/173))
24+
25+
## [4.1.0]
26+
27+
### Added
28+
29+
- Add interactive web UI for selecting package versions to release ([#166](https://github.com/MetaMask/create-release-branch/pull/166))
30+
- Added `--interactive` (`-i`) flag to launch a web-based UI for easier version selection
31+
- Added `--port` option to configure the web server port (default: 3000)
32+
33+
### Changed
34+
35+
- Refine breaking change dependent detection to only consider peer dependencies ([#170](https://github.com/MetaMask/create-release-branch/pull/170))
36+
- This change supports our policy of requiring packages with breaking changes to be released alongside their dependents
37+
- Regular dependencies are no longer included in this check
38+
- Allow `npm:name@version` dependency redirections in manifest ([#158](https://github.com/MetaMask/create-release-branch/pull/158))
39+
940
## [4.0.0]
41+
1042
### Changed
43+
1144
- **BREAKING:** Bump minimum Node.js version to `^18.18` ([#156](https://github.com/MetaMask/create-release-branch/pull/156))
1245
- **BREAKING:** Bump `@metamask/auto-changelog` to `^4.0.0` ([#156](https://github.com/MetaMask/create-release-branch/pull/156))
1346
- This requires `prettier@>=3.0.0`.
1447

1548
## [3.1.0]
49+
1650
### Changed
51+
1752
- Allow `npm:name@version` dependency redirections in manifest ([#158](https://github.com/MetaMask/create-release-branch/pull/158)) ([#159](https://github.com/MetaMask/create-release-branch/pull/159))
1853

1954
## [3.0.1]
55+
2056
### Changed
57+
2158
- Bump `@metamask/utils` to `^9.0.0` ([#150](https://github.com/MetaMask/create-release-branch/pull/150))
2259

2360
### Fixed
61+
2462
- Correct Yarn constraint violations and update Yarn lockfile at the end of the release process ([#145](https://github.com/MetaMask/create-release-branch/pull/145))
2563
- This was previously a required step after running `create-release-branch`.
2664

2765
### Security
66+
2867
- Enable MetaMask security code scanner ([#133](https://github.com/MetaMask/create-release-branch/pull/133))
2968

3069
## [3.0.0]
70+
3171
### Changed
72+
3273
- **BREAKING:** Format changelogs using Prettier ([#100](https://github.com/MetaMask/create-release-branch/pull/100))
3374
- This is a breaking change since it changes the default formatting of the changelog in new release PRs. If you have a package script that runs `auto-changelog validate`, or you're calling `auto-changelog validate` in CI, you'll now need to pass the `--prettier` flag (see [example](https://github.com/MetaMask/metamask-module-template/pull/219)).
3475

3576
### Fixed
77+
3678
- Restore support for monorepos that use `workspace:^` references for interdependencies ([#125](https://github.com/MetaMask/create-release-branch/pull/125))
3779

3880
## [2.0.1]
81+
3982
### Fixed
83+
4084
- Move `@metamask/auto-changelog` from `devDependencies` to `dependencies` and pin to ~3.3.0 ([#122](https://github.com/MetaMask/create-release-branch/pull/122))
4185

4286
## [2.0.0]
87+
4388
### Changed
89+
4490
- **BREAKING** Bump minimum Node version to 16 ([#114](https://github.com/MetaMask/create-release-branch/pull/114))
4591
- Reorder workflow to update changelogs first ([#109](https://github.com/MetaMask/create-release-branch/pull/109))
4692
- When you run this tool you can use the changelogs to decide which versions to include in your release.
@@ -49,27 +95,37 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4995
- Soft-enforce major-bumped packages to be released along with their dependents ([#101](https://github.com/MetaMask/create-release-branch/pull/101))
5096
- If a new major version of a package A is being included in the release, and there are is a package B which depends on A but which is not also being released at the same time, then the tool will produce an error. This is to ensure that if a consumer is upgrading package A in a project and they also need to upgrade package B for compatibility reasons, they can.
5197
- Soft-enforce dependents to be released along with their dependencies ([#102](https://github.com/MetaMask/create-release-branch/pull/102))
52-
- If package B depends on package A, and A has changed since its last release, and B is being included in the release but not A, then the tool will produce an error. This is to ensure that if B has been changed to rely on a new feature that was added to A, it doesn't break when it is used in a project (since that feature is present in development but has not been published).
98+
- If package B depends on package A, and A has changed since its last release, and B is being included in the release but not A, then the tool will produce an error. This is to ensure that if B has been changed to rely on a new feature that was added to A, it doesn't break when it is used in a project (since that feature is present in development but has not been published).
5399

54100
## [1.1.0]
101+
55102
### Added
103+
56104
- Add support for nested workspaces ([#84](https://github.com/MetaMask/create-release-branch/pull/84))
57105

58106
### Changed
107+
59108
- Add `.yml` extension to `RELEASE_SPEC` file ([#83](https://github.com/MetaMask/create-release-branch/pull/83))
60109

61110
## [1.0.1]
111+
62112
### Fixed
113+
63114
- Update changelogs correctly for monorepo packages ([#50](https://github.com/MetaMask/create-release-branch/pull/50))
64115
- The changelog update step was encountering an error when used for a monorepo package release that had already been released at least once. Related to this, the changelog was being updated with the wrong tag links. Both problems should now be resolved.
65116

66117
## [1.0.0]
118+
67119
### Added
120+
68121
- Initial release
69122
- In this first release, this tool only supports monorepos with an independent versioning scheme. We will add support for other kinds of projects in future releases.
70123
- You can learn more on how to use this tool by reading the [documentation](docs/).
71124

72-
[Unreleased]: https://github.com/MetaMask/create-release-branch/compare/v4.0.0...HEAD
125+
[Unreleased]: https://github.com/MetaMask/create-release-branch/compare/v4.1.2...HEAD
126+
[4.1.2]: https://github.com/MetaMask/create-release-branch/compare/v4.1.1...v4.1.2
127+
[4.1.1]: https://github.com/MetaMask/create-release-branch/compare/v4.1.0...v4.1.1
128+
[4.1.0]: https://github.com/MetaMask/create-release-branch/compare/v4.0.0...v4.1.0
73129
[4.0.0]: https://github.com/MetaMask/create-release-branch/compare/v3.1.0...v4.0.0
74130
[3.1.0]: https://github.com/MetaMask/create-release-branch/compare/v3.0.1...v3.1.0
75131
[3.0.1]: https://github.com/MetaMask/create-release-branch/compare/v3.0.0...v3.0.1

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This is an interactive command-line tool that automates steps involved in preparing a new release of a project. These steps include updating versions of one or more desired packages, adding a new section to the packages' changelogs to include changes since the previous release, and then creating a new branch from which a pull request can be submitted for review before the release goes live.
44

5-
> **Note**
5+
> **Note**
66
> At the moment, this tool only supports monorepos that use an independent versioning strategy. Support for other types of projects is planned in a future release.
77
88
## Installation
@@ -61,7 +61,7 @@ The project follows the same release process as the other libraries in the MetaM
6161
- Generally any changes that don't affect consumers of the package (e.g. lockfile changes or development environment changes) are omitted. Exceptions may be made for changes that might be of interest despite not having an effect upon the published package (e.g. major test improvements, security improvements, improved documentation, etc.).
6262
- Try to explain each change in terms that users of the package would understand (e.g. avoid referencing internal variables/concepts).
6363
- Consolidate related changes into one change entry if it makes it easier to explain.
64-
- Run `yarn auto-changelog validate --rc` to check that the changelog is correctly formatted.
64+
- Run `yarn auto-changelog validate --rc --prettier` to check that the changelog is correctly formatted.
6565

6666
5. Review and QA the release.
6767

docs/changelog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ After running this tool, you'll want to follow a few steps:
1212
- **Consolidation.** A changelog entry represents a complete unit of work, and some work may be split across multiple commits. In this case, you can combine multiple entries together, listing multiple PRs instead of just one.
1313
- **Omission.** Some changes do not affect end users of the project (e.g. lockfile changes, development environment changes, etc.). In these cases, you may remove these entries entirely. Exceptions may be made for changes that might be of interest despite not having an effect upon the published package (e.g. major test improvements, security improvements, improved documentation, etc.).
1414

15-
3. Once you're made your edits, make sure to run `yarn auto-changelog validate --rc` to check that the changelog is correctly formatted.
15+
3. Once you're made your edits, make sure to run `yarn auto-changelog validate --rc --prettier` to check that the changelog is correctly formatted.

jest.config.cjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ module.exports = {
5959
'/node_modules/',
6060
'/src/cli.ts',
6161
'/src/command-line-arguments.ts',
62+
'/src/ui.ts',
63+
'/src/ui/types.ts',
64+
'/src/dirname.ts',
6265
],
6366

6467
// Indicates which provider should be used to instrument code for coverage
@@ -217,7 +220,7 @@ module.exports = {
217220

218221
// A map from regular expressions to paths to transformers
219222
transform: {
220-
"\\.[jt]sx?$": "babel-jest"
223+
'\\.[jt]sx?$': 'babel-jest',
221224
},
222225

223226
// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation

package.json

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@metamask/create-release-branch",
3-
"version": "4.0.0",
3+
"version": "4.1.2",
44
"description": "An interactive command-line tool to prepare a release branch by automatically bumping versions and updating changelogs for desired packages. Works for both polyrepos and monorepos.",
55
"repository": {
66
"type": "git",
@@ -14,7 +14,8 @@
1414
"dist/"
1515
],
1616
"scripts": {
17-
"build": "tsc --project tsconfig.build.json",
17+
"build": "tsc --project tsconfig.build.json && yarn build:ui",
18+
"build:ui": "vite build",
1819
"build:clean": "rimraf dist && yarn build",
1920
"lint": "yarn lint:eslint && yarn lint:misc --check",
2021
"lint:eslint": "eslint . --cache --ext js,ts",
@@ -30,6 +31,8 @@
3031
"@metamask/utils": "^9.0.0",
3132
"debug": "^4.3.4",
3233
"execa": "^8.0.1",
34+
"express": "^4.21.2",
35+
"open": "^10.1.0",
3336
"pony-cause": "^2.1.9",
3437
"semver": "^7.5.4",
3538
"validate-npm-package-name": "^5.0.0",
@@ -47,17 +50,22 @@
4750
"@metamask/eslint-config-jest": "^10.0.0",
4851
"@metamask/eslint-config-nodejs": "^10.0.0",
4952
"@metamask/eslint-config-typescript": "^10.0.0",
53+
"@tailwindcss/vite": "^4.0.9",
5054
"@types/debug": "^4.1.7",
55+
"@types/express": "^5.0.0",
5156
"@types/jest": "^29.5.10",
5257
"@types/jest-when": "^3.5.2",
5358
"@types/node": "^17.0.23",
5459
"@types/prettier": "^2.7.3",
60+
"@types/react": "^19.0.8",
61+
"@types/react-dom": "^19.0.3",
5562
"@types/rimraf": "^4.0.5",
5663
"@types/validate-npm-package-name": "^4.0.2",
5764
"@types/which": "^3.0.0",
5865
"@types/yargs": "^17.0.10",
5966
"@typescript-eslint/eslint-plugin": "^5.62.0",
6067
"@typescript-eslint/parser": "^5.62.0",
68+
"@vitejs/plugin-react": "^4.3.4",
6169
"babel-jest": "^29.7.0",
6270
"deepmerge": "^4.2.2",
6371
"eslint": "^8.27.0",
@@ -73,10 +81,15 @@
7381
"nanoid": "^3.3.4",
7482
"prettier": "^3.3.3",
7583
"prettier-plugin-packagejson": "^2.5.2",
84+
"react": "^19.0.0",
85+
"react-dom": "^19.0.0",
86+
"react-markdown": "^9.0.3",
7687
"rimraf": "^4.0.5",
7788
"stdio-mock": "^1.2.0",
89+
"tailwindcss": "^4.0.9",
7890
"tsx": "^4.6.1",
79-
"typescript": "~5.1.6"
91+
"typescript": "~5.1.6",
92+
"vite": "^6.2.0"
8093
},
8194
"peerDependencies": {
8295
"prettier": ">=3.0.0"
@@ -92,7 +105,8 @@
92105
"lavamoat": {
93106
"allowScripts": {
94107
"@lavamoat/preinstall-always-fail": false,
95-
"tsx>esbuild": false
108+
"tsx>esbuild": false,
109+
"vite>esbuild": false
96110
}
97111
}
98112
}

src/command-line-arguments.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ export type CommandLineArguments = {
77
reset: boolean;
88
backport: boolean;
99
defaultBranch: string;
10+
interactive: boolean;
11+
port: number;
1012
};
1113

1214
/**
@@ -51,6 +53,19 @@ export async function readCommandLineArguments(
5153
default: 'main',
5254
type: 'string',
5355
})
56+
.option('interactive', {
57+
alias: 'i',
58+
describe:
59+
'Start an interactive web UI for selecting package versions to release',
60+
type: 'boolean',
61+
default: false,
62+
})
63+
.option('port', {
64+
describe:
65+
'Port to run the interactive web UI server (only used with --interactive)',
66+
type: 'number',
67+
default: 3000,
68+
})
5469
.help()
5570
.strict()
5671
.parse();

src/dirname.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { fileURLToPath } from 'url';
2+
import { dirname } from 'path';
3+
4+
const __filename = fileURLToPath(import.meta.url);
5+
const __dirname = dirname(__filename);
6+
7+
/**
8+
* Get the current directory path.
9+
*
10+
* @returns The current directory path.
11+
*/
12+
export function getCurrentDirectoryPath() {
13+
return __dirname;
14+
}

0 commit comments

Comments
 (0)