Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions constraints.pro
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,16 @@ gen_enforced_field(WorkspaceCwd, 'scripts.changelog:validate', CorrectChangelogV
atom_concat('../../scripts/validate-changelog.sh ', WorkspacePackageName, ExpectedPrefix),
\+ atom_concat(ExpectedPrefix, _, ChangelogValidationCommand).

% The "changelog:update" script for each published package must run a common
% script with the name of the package as the first argument.
gen_enforced_field(WorkspaceCwd, 'scripts.changelog:update', CorrectChangelogUpdateCommand) :-
\+ workspace_field(WorkspaceCwd, 'private', true),
workspace_field(WorkspaceCwd, 'scripts.changelog:update', ChangelogUpdateCommand),
workspace_package_name(WorkspaceCwd, WorkspacePackageName),
atomic_list_concat(['../../scripts/update-changelog.sh ', WorkspacePackageName, ' [...]'], CorrectChangelogUpdateCommand),
atom_concat('../../scripts/update-changelog.sh ', WorkspacePackageName, ExpectedPrefix),
\+ atom_concat(ExpectedPrefix, _, ChangelogUpdateCommand).

% All non-root packages must have the same "test" script.
gen_enforced_field(WorkspaceCwd, 'scripts.test', 'jest --reporters=jest-silent-reporter') :-
WorkspaceCwd \= '.'.
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"build:clean": "rimraf dist '**/*.tsbuildinfo' && yarn build",
"build:docs": "yarn workspaces foreach --parallel --interlaced --verbose run build:docs",
"build:watch": "yarn run build --watch",
"changelog:update": "yarn workspaces foreach --parallel --interlaced --verbose run changelog:update",
"changelog:validate": "yarn workspaces foreach --parallel --interlaced --verbose run changelog:validate",
"child-workspace-package-names-as-json": "ts-node scripts/child-workspace-package-names-as-json.ts",
"create-package": "ts-node scripts/create-package",
Expand Down
1 change: 1 addition & 0 deletions packages/accounts-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
],
"scripts": {
"build:docs": "typedoc",
"changelog:update": "../../scripts/update-changelog.sh @metamask/accounts-controller",
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/accounts-controller",
"publish:preview": "yarn npm publish --tag preview",
"test": "jest --reporters=jest-silent-reporter",
Expand Down
1 change: 1 addition & 0 deletions packages/address-book-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
],
"scripts": {
"build:docs": "typedoc",
"changelog:update": "../../scripts/update-changelog.sh @metamask/address-book-controller",
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/address-book-controller",
"publish:preview": "yarn npm publish --tag preview",
"test": "jest --reporters=jest-silent-reporter",
Expand Down
1 change: 1 addition & 0 deletions packages/announcement-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
],
"scripts": {
"build:docs": "typedoc",
"changelog:update": "../../scripts/update-changelog.sh @metamask/announcement-controller",
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/announcement-controller",
"publish:preview": "yarn npm publish --tag preview",
"test": "jest --reporters=jest-silent-reporter",
Expand Down
1 change: 1 addition & 0 deletions packages/approval-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
],
"scripts": {
"build:docs": "typedoc",
"changelog:update": "../../scripts/update-changelog.sh @metamask/approval-controller",
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/approval-controller",
"publish:preview": "yarn npm publish --tag preview",
"test": "jest --reporters=jest-silent-reporter",
Expand Down
1 change: 1 addition & 0 deletions packages/assets-controllers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
],
"scripts": {
"build:docs": "typedoc",
"changelog:update": "../../scripts/update-changelog.sh @metamask/assets-controllers",
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/assets-controllers",
"publish:preview": "yarn npm publish --tag preview",
"test": "jest --reporters=jest-silent-reporter",
Expand Down
1 change: 1 addition & 0 deletions packages/base-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
],
"scripts": {
"build:docs": "typedoc",
"changelog:update": "../../scripts/update-changelog.sh @metamask/base-controller",
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/base-controller",
"publish:preview": "yarn npm publish --tag preview",
"test": "jest --reporters=jest-silent-reporter",
Expand Down
1 change: 1 addition & 0 deletions packages/build-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
],
"scripts": {
"build:docs": "typedoc",
"changelog:update": "../../scripts/update-changelog.sh @metamask/build-utils",
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/build-utils",
"publish:preview": "yarn npm publish --tag preview",
"test": "jest --reporters=jest-silent-reporter",
Expand Down
1 change: 1 addition & 0 deletions packages/composable-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
],
"scripts": {
"build:docs": "typedoc",
"changelog:update": "../../scripts/update-changelog.sh @metamask/composable-controller",
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/composable-controller",
"publish:preview": "yarn npm publish --tag preview",
"test": "jest --reporters=jest-silent-reporter",
Expand Down
1 change: 1 addition & 0 deletions packages/controller-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
],
"scripts": {
"build:docs": "typedoc",
"changelog:update": "../../scripts/update-changelog.sh @metamask/controller-utils",
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/controller-utils",
"publish:preview": "yarn npm publish --tag preview",
"test": "jest --reporters=jest-silent-reporter",
Expand Down
1 change: 1 addition & 0 deletions packages/ens-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
],
"scripts": {
"build:docs": "typedoc",
"changelog:update": "../../scripts/update-changelog.sh @metamask/ens-controller",
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/ens-controller",
"publish:preview": "yarn npm publish --tag preview",
"test": "jest --reporters=jest-silent-reporter",
Expand Down
1 change: 1 addition & 0 deletions packages/eth-json-rpc-provider/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"build": "tsc --project tsconfig.build.json",
"build:clean": "rimraf dist && yarn build",
"build:docs": "typedoc",
"changelog:update": "../../scripts/update-changelog.sh @metamask/eth-json-rpc-provider",
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/eth-json-rpc-provider",
"lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:dependencies",
"lint:dependencies": "depcheck",
Expand Down
1 change: 1 addition & 0 deletions packages/gas-fee-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
],
"scripts": {
"build:docs": "typedoc",
"changelog:update": "../../scripts/update-changelog.sh @metamask/gas-fee-controller",
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/gas-fee-controller",
"publish:preview": "yarn npm publish --tag preview",
"test": "jest --reporters=jest-silent-reporter",
Expand Down
1 change: 1 addition & 0 deletions packages/json-rpc-engine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"build": "tsc --project tsconfig.build.json",
"build:clean": "rimraf dist && yarn build",
"build:docs": "typedoc",
"changelog:update": "../../scripts/update-changelog.sh @metamask/json-rpc-engine --tag-prefix-before-package-rename json-rpc-engine@ --version-before-package-rename 6.1.0",
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/json-rpc-engine --tag-prefix-before-package-rename json-rpc-engine@ --version-before-package-rename 6.1.0",
"lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:dependencies && yarn lint:changelog",
"lint:changelog": "auto-changelog validate",
Expand Down
1 change: 1 addition & 0 deletions packages/json-rpc-middleware-stream/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
],
"scripts": {
"build:docs": "typedoc",
"changelog:update": "../../scripts/update-changelog.sh @metamask/json-rpc-middleware-stream --tag-prefix-before-package-rename json-rpc-middleware-stream@ --version-before-package-rename 5.0.1",
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/json-rpc-middleware-stream --tag-prefix-before-package-rename json-rpc-middleware-stream@ --version-before-package-rename 5.0.1",
"publish:preview": "yarn npm publish --tag preview",
"test": "jest --reporters=jest-silent-reporter",
Expand Down
1 change: 1 addition & 0 deletions packages/keyring-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
],
"scripts": {
"build:docs": "typedoc",
"changelog:update": "../../scripts/update-changelog.sh @metamask/keyring-controller",
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/keyring-controller",
"publish:preview": "yarn npm publish --tag preview",
"test": "jest --reporters=jest-silent-reporter",
Expand Down
1 change: 1 addition & 0 deletions packages/logging-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
],
"scripts": {
"build:docs": "typedoc",
"changelog:update": "../../scripts/update-changelog.sh @metamask/logging-controller",
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/logging-controller",
"publish:preview": "yarn npm publish --tag preview",
"test": "jest --reporters=jest-silent-reporter",
Expand Down
1 change: 1 addition & 0 deletions packages/message-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
],
"scripts": {
"build:docs": "typedoc",
"changelog:update": "../../scripts/update-changelog.sh @metamask/message-manager",
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/message-manager",
"publish:preview": "yarn npm publish --tag preview",
"test": "jest --reporters=jest-silent-reporter",
Expand Down
1 change: 1 addition & 0 deletions packages/name-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
],
"scripts": {
"build:docs": "typedoc",
"changelog:update": "../../scripts/update-changelog.sh @metamask/name-controller",
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/name-controller",
"prepare-manifest:preview": "../../scripts/prepare-preview-manifest.sh",
"publish:preview": "yarn npm publish --tag preview",
Expand Down
1 change: 1 addition & 0 deletions packages/network-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
],
"scripts": {
"build:docs": "typedoc",
"changelog:update": "../../scripts/update-changelog.sh @metamask/network-controller",
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/network-controller",
"publish:preview": "yarn npm publish --tag preview",
"test": "jest --reporters=jest-silent-reporter",
Expand Down
1 change: 1 addition & 0 deletions packages/notification-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
],
"scripts": {
"build:docs": "typedoc",
"changelog:update": "../../scripts/update-changelog.sh @metamask/notification-controller",
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/notification-controller",
"publish:preview": "yarn npm publish --tag preview",
"test": "jest --reporters=jest-silent-reporter",
Expand Down
1 change: 1 addition & 0 deletions packages/permission-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
],
"scripts": {
"build:docs": "typedoc",
"changelog:update": "../../scripts/update-changelog.sh @metamask/permission-controller",
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/permission-controller",
"publish:preview": "yarn npm publish --tag preview",
"test": "jest --reporters=jest-silent-reporter",
Expand Down
1 change: 1 addition & 0 deletions packages/permission-log-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
],
"scripts": {
"build:docs": "typedoc",
"changelog:update": "../../scripts/update-changelog.sh @metamask/permission-log-controller",
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/permission-log-controller",
"publish:preview": "yarn npm publish --tag preview",
"test": "jest --reporters=jest-silent-reporter",
Expand Down
1 change: 1 addition & 0 deletions packages/phishing-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
],
"scripts": {
"build:docs": "typedoc",
"changelog:update": "../../scripts/update-changelog.sh @metamask/phishing-controller",
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/phishing-controller",
"publish:preview": "yarn npm publish --tag preview",
"test": "jest --reporters=jest-silent-reporter",
Expand Down
1 change: 1 addition & 0 deletions packages/polling-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
],
"scripts": {
"build:docs": "typedoc",
"changelog:update": "../../scripts/update-changelog.sh @metamask/polling-controller",
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/polling-controller",
"publish:preview": "yarn npm publish --tag preview",
"test": "jest --reporters=jest-silent-reporter",
Expand Down
1 change: 1 addition & 0 deletions packages/preferences-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
],
"scripts": {
"build:docs": "typedoc",
"changelog:update": "../../scripts/update-changelog.sh @metamask/preferences-controller",
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/preferences-controller",
"publish:preview": "yarn npm publish --tag preview",
"test": "jest --reporters=jest-silent-reporter",
Expand Down
1 change: 1 addition & 0 deletions packages/queued-request-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
],
"scripts": {
"build:docs": "typedoc",
"changelog:update": "../../scripts/update-changelog.sh @metamask/queued-request-controller",
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/queued-request-controller",
"publish:preview": "yarn npm publish --tag preview",
"test": "jest --reporters=jest-silent-reporter",
Expand Down
1 change: 1 addition & 0 deletions packages/rate-limit-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
],
"scripts": {
"build:docs": "typedoc",
"changelog:update": "../../scripts/update-changelog.sh @metamask/rate-limit-controller",
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/rate-limit-controller",
"publish:preview": "yarn npm publish --tag preview",
"test": "jest --reporters=jest-silent-reporter",
Expand Down
1 change: 1 addition & 0 deletions packages/selected-network-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
],
"scripts": {
"build:docs": "typedoc",
"changelog:update": "../../scripts/update-changelog.sh @metamask/selected-network-controller",
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/selected-network-controller",
"publish:preview": "yarn npm publish --tag preview",
"test": "jest --reporters=jest-silent-reporter",
Expand Down
1 change: 1 addition & 0 deletions packages/signature-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
],
"scripts": {
"build:docs": "typedoc",
"changelog:update": "../../scripts/update-changelog.sh @metamask/signature-controller",
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/signature-controller",
"publish:preview": "yarn npm publish --tag preview",
"test": "jest --reporters=jest-silent-reporter",
Expand Down
1 change: 1 addition & 0 deletions packages/transaction-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
],
"scripts": {
"build:docs": "typedoc",
"changelog:update": "../../scripts/update-changelog.sh @metamask/transaction-controller",
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/transaction-controller",
"publish:preview": "yarn npm publish --tag preview",
"test": "jest --reporters=jest-silent-reporter",
Expand Down
1 change: 1 addition & 0 deletions packages/user-operation-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
],
"scripts": {
"build:docs": "typedoc",
"changelog:update": "../../scripts/update-changelog.sh @metamask/user-operation-controller",
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/user-operation-controller",
"prepare-manifest:preview": "../../scripts/prepare-preview-manifest.sh",
"publish:preview": "yarn npm publish --tag preview",
Expand Down
21 changes: 21 additions & 0 deletions scripts/update-changelog.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash

set -euo pipefail

# Get the current package name
if [[ $# -eq 0 ]]; then
echo "Missing package name."
exit 1
fi

package_name="$1"
shift # remove package name from arguments

# Get the current git branch
branch=$(git rev-parse --abbrev-ref HEAD)

if [[ $branch =~ "^release/" ]]; then
yarn auto-changelog update --tag-prefix "${package_name}@" --rc "$@"
else
yarn auto-changelog update --tag-prefix "${package_name}@" "$@"
fi