Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to monorepo #140

Merged
merged 11 commits into from
Mar 30, 2021
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
11 changes: 10 additions & 1 deletion .circleci/scripts/deps-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,13 @@ set -e
set -u
set -o pipefail

yarn --frozen-lockfile --ignore-scripts --har
# --frozen-lockfile doesn't work in monorepos for yarn v1, so we diff ourselves
# See: https://github.com/yarnpkg/yarn/issues/4098

yarn --ignore-scripts --har

if ! git diff --quiet;
then
echo "Error: yarn install modified lockfile";
exit 1;
fi
77 changes: 75 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,76 @@
*.tgz
*.lerna_backup
*.har
dist/
build-artifacts/
./packages/**/yarn.lock

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
yarn-error.log

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
13 changes: 13 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"version": "5.0.0",
"command": {
"publish": {
"registry": "https://registry.npmjs.org"
}
},
"packages": [
"packages/*"
],
"npmClient": "yarn",
"useWorkspaces": true
}
40 changes: 5 additions & 35 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,40 +1,10 @@
{
"name": "@metamask/eslint-config",
"version": "5.0.0",
"description": "Shareable MetaMask ESLint config",
"main": "config/index.js",
"publishConfig": {
"registry": "https://registry.npmjs.org/",
"access": "public"
},
"files": [
"config/"
"name": "root",
"private": true,
"workspaces": [
"packages/base"
],
"scripts": {
"test": "eslint ."
},
"repository": {
"type": "git",
"url": "git+https://github.com/MetaMask/eslint-config.git"
},
"author": "Whymarrh Whitby <[email protected]>",
"license": "MIT",
"bugs": {
"url": "https://github.com/MetaMask/eslint-config/issues"
},
"homepage": "https://github.com/MetaMask/eslint-config#readme",
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^4.14.2",
"@typescript-eslint/parser": "^4.14.2",
"eslint": "^7.7.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-jest": "^24.1.3",
"eslint-plugin-mocha": "^8.0.0",
"eslint-plugin-node": "^11.1.0",
"typescript": "^4.0.3"
},
"peerDependencies": {
"eslint": "^7.7.0",
"eslint-plugin-import": "^2.22.0"
"lerna": "^4.0.0"
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should lerna be here as a dev dependency? 🤔

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, I think lerna recommends that you install it globally. I can either add it as a dev dep or add a note in the readme?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently not. From their README:

Let's start by installing Lerna as a dev dependency of your project with npm.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😅 56c43bc

File renamed without changes.
File renamed without changes.
21 changes: 21 additions & 0 deletions packages/base/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 MetaMask

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
40 changes: 40 additions & 0 deletions packages/base/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"name": "@metamask/eslint-config",
"version": "5.0.0",
"description": "Shareable MetaMask ESLint config",
"main": "config/index.js",
"publishConfig": {
"registry": "https://registry.npmjs.org/",
"access": "public"
},
"files": [
"config/"
],
"scripts": {
"test": "eslint ."
},
"repository": {
"type": "git",
"url": "git+https://github.com/MetaMask/eslint-config.git"
},
"author": "Whymarrh Whitby <[email protected]>",
"license": "MIT",
"bugs": {
"url": "https://github.com/MetaMask/eslint-config/issues"
},
"homepage": "https://github.com/MetaMask/eslint-config#readme",
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^4.14.2",
"@typescript-eslint/parser": "^4.14.2",
"eslint": "^7.7.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-jest": "^24.1.3",
"eslint-plugin-mocha": "^8.0.0",
"eslint-plugin-node": "^11.1.0",
"typescript": "^4.0.3"
},
"peerDependencies": {
"eslint": "^7.7.0",
"eslint-plugin-import": "^2.22.0"
}
}
Loading