From 31856c8c28689da0557b9c3df5db55de924a0122 Mon Sep 17 00:00:00 2001 From: Dave Bitter Date: Wed, 1 Jun 2022 10:29:21 +0200 Subject: [PATCH] feat(article): add manypkg article --- content/articles/quickBits.md | 219 ++++++++++++++++++---------- public/img/quick-bits/mono-repo.jpg | Bin 0 -> 187275 bytes src/components/Article/Article.tsx | 135 +++++++++++------ src/styles/common/_grid.scss | 4 - 4 files changed, 232 insertions(+), 126 deletions(-) create mode 100644 public/img/quick-bits/mono-repo.jpg diff --git a/content/articles/quickBits.md b/content/articles/quickBits.md index 43e87f3..f0dc7bf 100644 --- a/content/articles/quickBits.md +++ b/content/articles/quickBits.md @@ -1,5 +1,66 @@ --- items: + - type: quick-bits + body: >- + As a reference, the mono-repo might look something like this: + + ``` + + packages/ + + ├── foo-pkg + + │ └── package.json + + ├── bar-pkg + + │ └── package.json + + ├── baz-pkg + + │ └── package.json + + └── qux-pkg + └── package.json + + + ``` + + ## `manypkg check` + + In its essence, [Manypkg](https://github.com/Thinkmill/manypkg) is a linter for `package.json` files in Yarn, Bolt or pnpm mono-repos. You can use it to automate these chores. Simply run `yarn add @manypkg/cli` and you can run the following commands in your pre-commit hooks and pipelines: + + I use this to check whether all `package.json` files are alphabetically sorted, there are internal and external mismatches between packages, there are invalid dev and peer dependency relationships, invalid package names and more. You can have a look at the checks [here](https://github.com/Thinkmill/manypkg#checks). + + ## `manypkg fix` + + This will run the check and try to automatically resolve the issues it finds. Usually, it’s a wise idea to run this command in your pre-commit hook. That way, your pipeline won’t fail mid-way because of a minor issue. + + ## `manypkg run