Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
65 changes: 22 additions & 43 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,52 +1,31 @@
## Explanation

<!--
Thanks for your contribution!
Thanks for your contribution! Take a moment to answer these questions so that reviewers have the information they need to properly understand your changes:

Please ensure that any applicable requirements below are satisfied before submitting this pull request. This will help ensure a quick and efficient review cycle.
* What is the current state of things and why does it need to change?
* What is the solution your changes offer and how does it work?
* Are there any changes whose purpose might not obvious to those unfamiliar with the domain?
* If your primary goal was to update one package but you found you had to update another one along the way, why did you do so?
* If you had to upgrade a dependency, why did you do so?
-->

**PR Title**

- A brief description of changes. If the PR has breaking changes add `BREAKING:`
to the start of the PR title.

**Description**

_Itemize the changes you have made into the categories below_

- BREAKING:

- _Describe the how to patch your code for the breaking changes_
- _Create PRs for other projects with patches to breaking changes_

- FIXED:

- _Describe the fix/bug addressed_

- CHANGED:

- _Describe the change you have made to existing functionality_
## References

- REMOVED:

- _Describe functionality removed and why_

- ADDED:

- _Describe functionality added and why_

- DEPRECATED:

- _Describe what was deprecated and why_

- SECURITY:

- _These should not be in a standard PR and addressed using the Security Advisory process_
<!--
Are there any issues that this pull request is tied to?
Are there other links that reviewers should consult to understand these changes better?
Are there client or consumer pull requests to adopt any breaking changes?

**Checklist**
For example:

- [ ] Tests are included if applicable
- [ ] Any added code is fully documented
* Fixes #12345
* Related to #67890
-->

**Issue**
## Checklist

Resolves #???
- [ ] I've updated the test suite for new or updated code as appropriate
- [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
- [ ] I've communicated my changes to consumers by [updating changelogs for packages I've changed](https://github.com/MetaMask/core/tree/main/docs/contributing.md#updating-changelogs), highlighting breaking changes as necessary
- [ ] I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes
18 changes: 18 additions & 0 deletions .github/workflows/changelog-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Check Changelog

on:
pull_request:
types: [opened, synchronize, labeled, unlabeled]

jobs:
check_changelog:
uses: MetaMask/github-tools/.github/workflows/changelog-check.yml@fc6fe1a3fb591f6afa61f0dbbe7698bd50fab9c7
with:
action-sha: fc6fe1a3fb591f6afa61f0dbbe7698bd50fab9c7
base-branch: ${{ github.event.pull_request.base.ref }}
head-ref: ${{ github.head_ref }}
labels: ${{ toJSON(github.event.pull_request.labels) }}
pr-number: ${{ github.event.pull_request.number }}
repo: ${{ github.repository }}
secrets:
gh-token: ${{ secrets.GITHUB_TOKEN }}
13 changes: 9 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,19 @@ on:
branches: [main]
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ !contains(github.ref, 'refs/heads/main') }}

jobs:
check-workflows:
name: Check workflows
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Download actionlint
id: download-actionlint
run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/7fdc9630cc360ea1a469eed64ac6d78caeda1234/scripts/download-actionlint.bash) 1.6.22
run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/7fdc9630cc360ea1a469eed64ac6d78caeda1234/scripts/download-actionlint.bash) 1.6.25
shell: bash
- name: Check workflow files
run: ${{ steps.download-actionlint.outputs.executable }} -color
Expand All @@ -33,9 +37,9 @@ jobs:
IS_RELEASE: ${{ steps.is-release.outputs.IS_RELEASE }}
steps:
- id: is-release
uses: MetaMask/action-is-release@v1
uses: MetaMask/action-is-release@dc4672b05e3b1d464cdaf783579b04a4e43f8b02
with:
commit-starts-with: 'Release [version]'
commit-starts-with: 'Release v[version]'

publish-release:
name: Publish release
Expand All @@ -46,6 +50,7 @@ jobs:
uses: ./.github/workflows/publish-release.yml
secrets:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

all-jobs-pass:
name: All jobs pass
Expand Down
20 changes: 8 additions & 12 deletions .github/workflows/publish-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
outputs:
IS_FORK: ${{ steps.is-fork.outputs.IS_FORK }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Determine whether this PR is from a fork
id: is-fork
run: echo "IS_FORK=$(gh pr view --json isCrossRepository --jq '.isCrossRepository' "${PR_NUMBER}" )" >> "$GITHUB_OUTPUT"
Expand All @@ -29,24 +29,20 @@ jobs:
if: ${{ needs.is-fork-pull-request.outputs.IS_FORK == 'false' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout pull request
- uses: actions/checkout@v4
- name: Check out pull request
run: gh pr checkout "${PR_NUMBER}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.issue.number }}
- name: Setup Node
uses: actions/setup-node@v3
- name: Checkout and setup environment
uses: MetaMask/action-checkout-and-setup@v1
with:
node-version-file: '.nvmrc'
cache: yarn
registry-url: 'https://npm.pkg.github.com'
scope: '@MetaMask'
- run: yarn --immutable
is-high-risk-environment: true
- name: Get commit SHA
id: commit-sha
run: echo "COMMIT_SHA=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
- run: yarn prepare-preview-builds ${{ steps.commit-sha.outputs.COMMIT_SHA }}
- run: yarn prepare-preview-builds @metamask-previews ${{ steps.commit-sha.outputs.COMMIT_SHA }}
- run: yarn build
- name: Publish preview build
run: yarn publish-previews
Expand All @@ -59,4 +55,4 @@ jobs:
env:
COMMIT_SHA: ${{ steps.commit-sha.outputs.COMMIT_SHA }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.issue.number }}
PR_NUMBER: ${{ github.event.issue.number }}
72 changes: 36 additions & 36 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,69 +5,69 @@ on:
secrets:
NPM_TOKEN:
required: true
SLACK_WEBHOOK_URL:
required: true

jobs:
publish-release:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.sha }}
- name: Setup Node
uses: actions/setup-node@v3
- name: Checkout and setup environment
uses: MetaMask/action-checkout-and-setup@v1
with:
node-version-file: '.nvmrc'
cache: yarn
- uses: actions/cache@v3
is-high-risk-environment: true
- uses: MetaMask/action-publish-release@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: yarn build
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: publish-release-artifacts-${{ github.sha }}
include-hidden-files: true
retention-days: 4
path: |
./packages/**/dist
./node_modules/.yarn-state.yml
key: ${{ github.sha }}
- uses: MetaMask/action-publish-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: yarn --immutable
- run: yarn build

publish-npm-dry-run:
name: Dry run publish to NPM
runs-on: ubuntu-latest
needs: publish-release
steps:
- uses: actions/checkout@v3
- name: Checkout and setup environment
uses: MetaMask/action-checkout-and-setup@v1
with:
is-high-risk-environment: true
ref: ${{ github.sha }}
- uses: actions/cache@v3
- name: Restore build artifacts
uses: actions/download-artifact@v4
with:
path: |
./packages/**/dist
./node_modules/.yarn-state.yml
key: ${{ github.sha }}
- name: Dry Run Publish
# omit npm-token token to perform dry run publish
uses: MetaMask/action-npm-publish@v2
env:
SKIP_PREPACK: true
name: publish-release-artifacts-${{ github.sha }}
- name: Dry run publish to NPM
uses: MetaMask/action-npm-publish@v5
with:
slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }}
subteam: S042S7RE4AE # @metamask-npm-publishers

publish-npm:
name: Publish to NPM
environment: npm-publish
runs-on: ubuntu-latest
needs: publish-npm-dry-run
steps:
- uses: actions/checkout@v3
- name: Checkout and setup environment
uses: MetaMask/action-checkout-and-setup@v1
with:
is-high-risk-environment: true
ref: ${{ github.sha }}
- uses: actions/cache@v3
- name: Restore build artifacts
uses: actions/download-artifact@v4
with:
path: |
./packages/**/dist
./node_modules/.yarn-state.yml
key: ${{ github.sha }}
- name: Publish
uses: MetaMask/action-npm-publish@v2
name: publish-release-artifacts-${{ github.sha }}
- name: Publish to NPM
uses: MetaMask/action-npm-publish@v5
with:
npm-token: ${{ secrets.NPM_TOKEN }}
env:
SKIP_PREPACK: true
npm-token: ${{ secrets.NPM_TOKEN }}
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18
4 changes: 2 additions & 2 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ nodeLinker: node-modules
plugins:
- path: .yarn/plugins/@yarnpkg/plugin-allow-scripts.cjs
spec: "https://raw.githubusercontent.com/LavaMoat/LavaMoat/main/packages/yarn-plugin-allow-scripts/bundles/@yarnpkg/plugin-allow-scripts.js"
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: "@yarnpkg/plugin-workspace-tools"
- path: .yarn/plugins/@yarnpkg/plugin-constraints.cjs
spec: "@yarnpkg/plugin-constraints"
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: "@yarnpkg/plugin-workspace-tools"

yarnPath: .yarn/releases/yarn-3.3.0.cjs
13 changes: 12 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@
"apps/*"
],
"scripts": {
"build": "yarn workspaces foreach --topological run build",
"build": "yarn workspaces foreach --topological --verbose run build",
"prepack": "./scripts/prepack.sh",
"changelog:update": "yarn workspaces foreach --no-private --parallel --interlaced --verbose run changelog:update",
"changelog:validate": "yarn workspaces foreach --no-private --parallel --interlaced --verbose run changelog:validate",
"create-release-branch": "create-release-branch",
"prepare-preview-builds": "./scripts/prepare-preview-builds.sh",
"publish-previews": "yarn workspaces foreach --no-private --parallel --verbose run publish:preview",
"test": "vitest run",
"test:unit": "vitest run --exclude '**/integration-tests/**' --exclude '**/*.integration.test.ts'",
"test:integration": "vitest run packages/integration-tests **/*.integration.test.ts",
Expand All @@ -23,8 +29,13 @@
"devDependencies": {
"@biomejs/biome": "2.0.0",
"@lavamoat/allow-scripts": "^3.3.3",
"@metamask/auto-changelog": "^3.4.4",
"@metamask/create-release-branch": "^4.1.3",
"@types/node": "^24.0.3",
"@vitest/coverage-v8": "3.2.4",
"execa": "^5.0.0",
"rimraf": "^5.0.5",
"ts-node": "^10.9.1",
"tsup": "^8.5.0",
"typescript": "^5.8.3",
"vitest": "^3.2.4"
Expand Down
3 changes: 3 additions & 0 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed
- Updated package metadata and added publishing scripts. ([#21])

[Unreleased]: https://github.com/MetaMask/metamask-monorepo-template/
6 changes: 4 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "@metamask/mobile-wallet-protocol-core",
"version": "0.1.0",
"private": true,
"homepage": "https://github.com/MetaMask/mobile-wallet-protocol/tree/main/packages/core#readme",
"bugs": {
"url": "https://github.com/MetaMask/mobile-wallet-protocol/issues"
Expand All @@ -14,7 +13,10 @@
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"scripts": {
"build": "tsup src/index.ts --format cjs,esm --dts"
"build": "tsup src/index.ts --format cjs,esm --dts",
"changelog:update": "../../scripts/update-changelog.sh @metamask/mobile-wallet-protocol-core",
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/mobile-wallet-protocol-core",
"publish:preview": "yarn npm publish --tag preview"
},
"publishConfig": {
"access": "public",
Expand Down
3 changes: 3 additions & 0 deletions packages/dapp-client/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed
- Updated package metadata and added publishing scripts. ([#21])

[Unreleased]: https://github.com/MetaMask/metamask-monorepo-template/
6 changes: 4 additions & 2 deletions packages/dapp-client/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "@metamask/mobile-wallet-protocol-dapp-client",
"version": "0.1.0",
"private": true,
"homepage": "https://github.com/MetaMask/mobile-wallet-protocol/tree/main/packages/dapp-client#readme",
"bugs": {
"url": "https://github.com/MetaMask/mobile-wallet-protocol/issues"
Expand All @@ -14,7 +13,10 @@
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"scripts": {
"build": "tsup src/index.ts --format cjs,esm --dts"
"build": "tsup src/index.ts --format cjs,esm --dts",
"changelog:update": "../../scripts/update-changelog.sh @metamask/mobile-wallet-protocol-dapp-client",
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/mobile-wallet-protocol-dapp-client",
"publish:preview": "yarn npm publish --tag preview"
},
"publishConfig": {
"access": "public",
Expand Down
Loading