You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore: Simplify docs for package migration process (#8818)
## Explanation
The package migration process doc has been updated to remove some steps
that we've been skipping during recent migrations (migrating the
changelog and tags), and it has been updated to reflect changes in how
the monorepo is currently setup.
## References
N/A
## Checklist
- [x] I've updated the test suite for new or updated code as appropriate
- [x] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [x] I've communicated my changes to consumers by [updating changelogs
for packages I've
changed](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md)
- [x] I've introduced [breaking
changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md)
in this PR and have prepared draft pull requests for clients and
consumer packages to resolve them
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Low Risk**
> Documentation-only updates that adjust the recommended migration
steps; no runtime code or behavior changes.
>
> **Overview**
> Simplifies `docs/processes/package-migration-process-guide.md` by
removing guidance around migrating/porting tags and validating changelog
compare links, replacing it with a new step to **reset the migrated
package CHANGELOG** and link back to the old repo.
>
> Updates the preparation checklist to include `Oxfmt`, drops the
`module-lint` requirement reference, and renumbers/reorders PR steps
throughout the guide to reflect the streamlined process.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
7ed8f75. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Copy file name to clipboardExpand all lines: docs/processes/package-migration-process-guide.md
+17-54Lines changed: 17 additions & 54 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Package migration process guide
2
2
3
-
This document outlines the process for migrating a MetaMask library into the core monorepo. The migration target is assumed to comply with the requirements defined by [`metamask-module-template`](https://github.com/MetaMask/metamask-module-template) and [`module-lint`](https://github.com/MetaMask/module-lint).
3
+
This document outlines the process for migrating a MetaMask library into the core monorepo. The migration target is assumed to comply with the requirements defined by [`metamask-module-template`](https://github.com/MetaMask/metamask-module-template).
4
4
5
5
## Phase A: **Preparation** in the _Source Repo_
6
6
@@ -12,27 +12,25 @@ This document outlines the process for migrating a MetaMask library into the cor
### **[PR#7]** 2. Update the CHANGELOG tag diff links so that they follow the core repo's tag naming convention
71
-
72
-
- The core repo tags for non-root packages should be formatted as: `<package-name>@[version-number]`.
73
-
- For all releases following the migration, the package name should be prepended with the `@metamask/` namespace.
74
-
- Make updates to the CHANGELOG tag diff links so that they follow this naming scheme:
75
-
1. Navigate to `merged-packages/<package-name>`
76
-
2. Run this command: `../../scripts/validate-changelog.sh @metamask/<package-name>`
77
-
3. Apply the diffs outputted by the script.
78
-
- If the package has been renamed or needs to be renamed with the `@metamask/` namespace, supply two arguments to the script: `--version-before-package-rename`, `--tag-prefix-before-package-rename`.
79
-
- For further instructions on using the script, see: https://github.com/MetaMask/auto-changelog#validate.
80
-
81
-
### 3. Port tags
82
-
83
-
- Following [these instructions](./migrate-tags.md), use the `scripts/migrate-tags.sh` tool to port the source repo's release tags onto the migrated git history in core.
84
-
85
-
1. Port the tags locally.
86
-
87
-
- Use the script to ensure that the tags have the correct package name prefixes.
88
-
89
-
2. Create a fork of the core monorepo for testing, and push the ported tags to the test fork.
68
+
### **[PR#7]** 2. Reset the CHANGELOG, adding a link to the old repository
90
69
91
-
-**Do not run the script against `MetaMask/core` before testing it on a fork.**
70
+
- Create a fresh CHANGELOG file with no releases
71
+
- Add a change entry to the "Unreleased" section that explains that the package was migrated, and include a link to the old changelog in the old repository
3. From the fork, verify that the tag diff links in CHANGELOG are working.
94
-
95
-
- Note: The diff between any tag before migration and any tag after will always include the entire history of the monorepo. This is due to the nature of the process we use for git history migration, and is a WONTFIX issue.
96
-
- The correct diff can be derived using `git log --ancestry-path`, but GitHub compare links don't support --ancestry-path.
97
-
98
-
4. Push the ported tags to the core repo.
99
-
100
-
5. From the core repo, verify that the tag diff links in CHANGELOG are working.
101
-
102
-
6. Manually create tags for release commits that were never tagged in the original repo.
103
-
104
-
### **[PR#8]** 4. Remove files and directories that will be replaced by files in the monorepo root directory
74
+
### **[PR#8]** 3. Remove files and directories that will be replaced by files in the monorepo root directory
- Update `tsconfig*.json`, `typedoc.json`, `jest.config.js` to extend from the corresponding files in the root directory by copying the contents of these files from other non-root packages.
113
83
- Preserve TypeScript compiler flags and its compilation target.
@@ -116,7 +86,7 @@ This document outlines the process for migrating a MetaMask library into the cor
### **[PR#12]** 8. Update the README to reflect its new status as a non-root package in the monorepo
101
+
### **[PR#11]** 6. Update the README to reflect its new status as a non-root package in the monorepo
139
102
140
103
- Preserve the opening sentence/paragraph that introduces the package.
141
104
- Add or modify an "Installation" section (see the READMEs of other non-root packages for examples).
142
105
- Preserve the "Usage" section.
143
106
- Remove "Test", "Build" and other instructions on common development tasks.
144
107
- Add a "Contributing" section (see the READMEs of other non-root packages for examples).
145
108
146
-
## **[PR#13]** Phase C: **Integration** into the core monorepo's `packages/` directory
109
+
## **[PR#12]** Phase C: **Integration** into the core monorepo's `packages/` directory
147
110
148
111
- The following steps of "Phase C" need to happen in a single PR.
149
112
- Coordinate with the team to minimize the time that this PR stays open to avoid merge conflicts with the main branch from accumulating.
@@ -200,7 +163,7 @@ This library has now been migrated into the [core monorepo](https://github.com/m
200
163
- Optionally, add a link pointing to the discussion in this PR to provide context.
201
164
```
202
165
203
-
3.**[PR#14]** Leave a note in the source repo's README announcing the migration and pointing to core.
166
+
3.**[PR#13]** Leave a note in the source repo's README announcing the migration and pointing to core.
204
167
205
168
- This note should replace the notice added in step A-1.
206
169
@@ -228,9 +191,9 @@ This library has now been migrated into the [core monorepo](https://github.com/m
228
191
229
192
### Core
230
193
231
-
1.**[PR#15]** Add migration target to the list of packages in the README as well as the dependency graph in the README by running `yarn update-readme-content`.
194
+
1.**[PR#14]** Add migration target to the list of packages in the README as well as the dependency graph in the README by running `yarn update-readme-content`.
232
195
2. Fix downstream errors that were marked with `@ts-expect-error TODO:` during the migration process.
233
196
234
197
- If possible, perform this step before the first post-migration release of the migrated package.
235
198
236
-
3.**[PR#16]** Use the `yarn create-release-branch` tool to publish a release of core with a new version for the migrated package and any updated downstream packages.
199
+
3.**[PR#15]** Use the `yarn create-release-branch` tool to publish a release of core with a new version for the migrated package and any updated downstream packages.
0 commit comments