generated from MetaMask/metamask-module-template
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate from polyrepo to monorepo (#17)
## **Description** This PR migrates the current MetaMask design system repo which is currently using the metamask-module-template and a polyrepo structure to a monorepo structure. The primary goal is to streamline the module management process by consolidating multiple repositories into a single monorepo. The `core` module serves as a reference for the files and structure required in the monorepo setup. This change will simplify dependency management and improve development efficiency across modules. <img width="444" alt="Screenshot 2024-10-08 at 2 09 12 PM" src="https://github.com/user-attachments/assets/eb1dcb2e-4eb1-45bb-833f-4fbe3295c84f"> ### Key changes: - Updated module configuration to align with the monorepo structure. - Consolidated files and dependencies into the monorepo format. - Ensured consistency with the `core` module in terms of file inclusion, structure, and build processes. ## **Related issues** Fixes: #5 ## **Manual testing steps** 1. Clone the repository and navigate to the monorepo. 2. Run all `yarn` scripts to ensure they work with the exception of `prepare-preview-build` and `publish-previews` 3. Verify that the scriptsfunction as expected within the monorepo. 4. Ensure the build passes without issues in the monorepo format. 5. Ensure no instances of "core" remain unless links to information for migrating packages ## **Screenshots/Recordings** Video showing all `yarn` scripts work from `package.json` with the exception of `prepare-preview-build` and `publish-previews` issue here: #26 https://www.loom.com/share/4f40fa33ae45472e807137d3995c212c ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) - [x] I’ve completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)). ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and/or screenshots.
- Loading branch information
1 parent
f9b3551
commit 8991031
Showing
79 changed files
with
7,759 additions
and
3,265 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
ignores: | ||
# Ignore dependencies used by Yarn binaries in `.yarn` | ||
- '@yarnpkg/*' | ||
- 'clipanion' | ||
- 'typanion' | ||
# Ignore dependencies imported implicitly by TypeScript | ||
- '@types/*' | ||
# Ignore tools (packages which we use as executables and not libraries) | ||
- '@lavamoat/allow-scripts' | ||
- '@metamask/auto-changelog' | ||
- '@metamask/create-release-branch' | ||
- 'depcheck' | ||
- 'eslint-interactive' | ||
- 'rimraf' | ||
- 'simple-git-hooks' | ||
- 'ts-node' | ||
- 'typedoc' | ||
# Ignore plugins implicitly imported by tools | ||
- 'jest-silent-reporter' | ||
- 'prettier-plugin-packagejson' | ||
# Ignore plugins we explicitly use with tools | ||
- 'babel-jest' | ||
# Ignore dependencies which plug into the NPM lifecycle | ||
- '@lavamoat/preinstall-always-fail' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
# http://editorconfig.org | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
end_of_line = lf | ||
indent_size = 2 | ||
indent_style = space | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,76 @@ | ||
module.exports = { | ||
root: true, | ||
|
||
extends: ['@metamask/eslint-config'], | ||
|
||
extends: ['@metamask/eslint-config', '@metamask/eslint-config-nodejs'], | ||
ignorePatterns: [ | ||
'!.eslintrc.js', | ||
'!jest.config.js', | ||
'node_modules', | ||
'**/dist', | ||
'**/docs', | ||
'**/coverage', | ||
'merged-packages', | ||
'scripts/create-package/package-template', | ||
], | ||
overrides: [ | ||
{ | ||
files: ['*.ts'], | ||
extends: ['@metamask/eslint-config-typescript'], | ||
files: ['*.test.{ts,js}'], | ||
extends: ['@metamask/eslint-config-jest'], | ||
}, | ||
|
||
{ | ||
files: ['*.js'], | ||
files: ['*.js', '*.cjs'], | ||
parserOptions: { | ||
sourceType: 'script', | ||
ecmaVersion: '2020', | ||
}, | ||
extends: ['@metamask/eslint-config-nodejs'], | ||
}, | ||
|
||
{ | ||
files: ['yarn.config.cjs'], | ||
files: ['*.ts'], | ||
extends: ['@metamask/eslint-config-typescript'], | ||
parserOptions: { | ||
sourceType: 'script', | ||
ecmaVersion: 2020, | ||
tsconfigRootDir: __dirname, | ||
project: ['./tsconfig.packages.json'], | ||
}, | ||
settings: { | ||
jsdoc: { | ||
mode: 'typescript', | ||
}, | ||
rules: { | ||
'@typescript-eslint/no-explicit-any': 'error', | ||
}, | ||
extends: ['@metamask/eslint-config-nodejs'], | ||
}, | ||
|
||
{ | ||
files: ['*.test.ts', '*.test.js'], | ||
extends: [ | ||
'@metamask/eslint-config-jest', | ||
'@metamask/eslint-config-nodejs', | ||
], | ||
files: ['*.d.ts'], | ||
rules: { | ||
'@typescript-eslint/naming-convention': 'warn', | ||
'import/unambiguous': 'off', | ||
}, | ||
}, | ||
{ | ||
files: ['scripts/**/*.ts'], | ||
rules: { | ||
'import/no-unassigned-import': 'off', | ||
'n/no-sync': 'off', | ||
// All scripts will have shebangs. | ||
'n/shebang': 'off', | ||
}, | ||
}, | ||
], | ||
|
||
ignorePatterns: [ | ||
'!.eslintrc.js', | ||
'!.prettierrc.js', | ||
'dist/', | ||
'docs/', | ||
'.yarn/', | ||
], | ||
rules: { | ||
camelcase: 'off', | ||
'id-length': 'off', | ||
'no-restricted-syntax': [ | ||
'error', | ||
'ForInStatement', | ||
'LabeledStatement', | ||
'WithStatement', | ||
], | ||
'jsdoc/match-description': [ | ||
'off', | ||
{ matchDescription: '^[A-Z`\\d_][\\s\\S]*[.?!`>)}]$' }, | ||
], | ||
}, | ||
settings: { | ||
'import/resolver': { | ||
typescript: {}, | ||
}, | ||
jsdoc: { | ||
mode: 'typescript', | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: 'Check for PR labels that block merging' | ||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
- labeled | ||
- unlabeled | ||
|
||
jobs: | ||
ensure-blocking-pr-labels-absent: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: read | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Use Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: '.nvmrc' | ||
- name: Install Yarn | ||
run: corepack enable | ||
- name: Restore Yarn cache | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: '.nvmrc' | ||
cache: 'yarn' | ||
- run: yarn --immutable | ||
- name: Run command | ||
uses: actions/github-script@v7 | ||
with: | ||
script: | | ||
if (context.payload.pull_request.labels.some((label) => label.name === 'DO-NOT-MERGE')) { | ||
core.setFailed( | ||
"PR cannot be merged because it contains the label 'DO-NOT-MERGE'." | ||
); | ||
} |
Oops, something went wrong.