-
Notifications
You must be signed in to change notification settings - Fork 25
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 pnpm + turborepo #612
Changes from 27 commits
2010335
104e662
122b805
4b43449
d2529cd
1346fc0
8b6a598
43d997c
99fc764
3877542
0eba20a
b67f623
3be9c5c
d8f2df5
3cbd15a
1c2740b
50a8188
c9cdadd
b6a5afd
06a6f5e
8c05322
5af5356
b74715d
84b6524
0b21671
de0306f
8c40536
543a71a
313c262
2b12d66
99dfe0b
c929efa
4bb2227
b00ee32
383cc25
d142420
09c59d0
a356fe2
ce0486e
9003758
b898c56
1b9f07d
fec1752
b789fa8
9b2f2df
3c0f6ec
df8879a
41fb554
37929ba
8d7ff09
40869d4
560a704
4147992
ec1658e
8d7d9a9
0bae786
24d52b3
0b0603c
2889dee
6cc7006
faa0dc1
141b7c4
2a1f9d9
9d86029
4355fb9
b02b14c
18b3fed
64c311b
1e71a88
2341f50
87eadab
e3bb850
ddeec43
7614718
f911149
6ad5295
b91e8aa
3703e5d
c5ca178
fefe1c9
87bd27b
6b15ec2
ac15185
4bcc097
8b8edbe
a60f90c
3e03dbb
d4d66f0
70fea7a
46195c1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
module.exports = { | ||
glennreyes marked this conversation as resolved.
Show resolved
Hide resolved
|
||
versionGroups: [ | ||
{ | ||
label: 'Internal packages that have inconsistent version usage', | ||
packages: ['**'], | ||
dependencies: [ | ||
'@kadena/chainweb-node-client', | ||
'@kadena/client', | ||
'@kadena/fonts', | ||
'@kadena/pactjs-cli', | ||
'@kadena-dev/eslint-plugin', | ||
], | ||
isIgnored: true, // Toggle flag or or remove group to see inconsistencies | ||
}, | ||
{ | ||
label: 'Internal dev packages are pinned to `workspace:*`', | ||
packages: ['**'], | ||
dependencies: ['@kadena-dev/*', '@kadena/types'], | ||
dependencyTypes: ['dev'], | ||
pinVersion: 'workspace:*', | ||
}, | ||
{ | ||
label: 'Internal production packages are pinned to `workspace:*`', | ||
packages: ['**'], | ||
dependencies: ['kadena.js', '@kadena/*'], | ||
dependencyTypes: ['prod'], | ||
pinVersion: 'workspace:*', | ||
}, | ||
{ | ||
label: | ||
'Types and internal dev packages are banned from dependencies (only allowed in devDependencies)', | ||
packages: ['**'], | ||
dependencies: ['@types/*', '*/types', '@kadena-dev/*'], | ||
dependencyTypes: ['prod'], | ||
isBanned: true, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. syncpack requires a bit of configuration, but is actually pretty powerful and has some advantages over the Rush solution:
This PR contains quite some fixes detected by syncpack. |
||
}, | ||
], | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,56 +12,40 @@ Do you want to file a bug? Please [open a new issue][1]. | |
|
||
## Development | ||
|
||
[Install Node.js][2] if you haven't already. Then install Rush: | ||
|
||
```bash | ||
npm install --global @microsoft/rush | ||
``` | ||
[Install Node.js][2] if you haven't already. | ||
|
||
As an external contributor, you will need to fork the repo before you can | ||
contribute. Then you can clone the repository and install dependencies: | ||
|
||
```bash | ||
git clone git@github.com:kadena-community/kadena.js.git | ||
cd kadena.js | ||
rush install | ||
rush build | ||
pnpm install | ||
pnpm build | ||
``` | ||
|
||
Make sure to read some of the Rush documentation, specifically the "Developer | ||
tutorials" such as: | ||
|
||
- [Getting started as a developer][3] | ||
- [Everyday Rush commands][4] | ||
- [Other helpful commands][5] | ||
|
||
### Switch branches | ||
|
||
Depending on the changes, you may need to invoke the following commands when | ||
switching branches to keep everything in check: | ||
|
||
```bash | ||
rush update | ||
rush build -t <package name> | ||
pnpm install | ||
pnpm build --filter <package name> | ||
``` | ||
|
||
## Tests | ||
|
||
```bash | ||
rush test # Run all tests | ||
rushx test # Run only tests inside a package directory | ||
rushx test -w # Keep running tests during development | ||
pnpm test # Run all tests, or inside package directory | ||
pnpm run test --watch # Keep running tests during development | ||
``` | ||
|
||
## Making a Pull Request | ||
|
||
Before making a pull request, please discuss your ideas first. | ||
|
||
Make sure to update the changelog before it gets merged: | ||
|
||
```bash | ||
rush change | ||
``` | ||
TODO | ||
|
||
## Conventions | ||
|
||
|
@@ -82,13 +66,11 @@ to coding standards. We try to automate and auto-fix as much as possible using | |
the following commands: | ||
|
||
```bash | ||
rush build # Compile & build all packages (using TypeScript) | ||
rush lint # Lint (and fix) all packages (using ESLint) | ||
rush format # Format all packages (using Prettier) | ||
pnpm build # Compile & build all packages (using TypeScript) | ||
pnpm lint # Lint (and fix) all packages (using ESLint) | ||
pnpm format # Format all packages (using Prettier) | ||
``` | ||
|
||
Use `rushx` instead of `rush` to do the same for only the current package. | ||
|
||
For everything else, please discuss. | ||
|
||
## Workflow | ||
|
@@ -97,14 +79,6 @@ You are expected to install your own workflow the way you like it. For example, | |
some developers like to auto-format code "on save", others before they commit or | ||
push their changes. That's why this repository does not auto-install Git hooks. | ||
|
||
If you want to make sure you don't forget to update the changelog before you | ||
push code, here's an example to install a Git hook for that: | ||
|
||
```bash | ||
echo "rush change --verify" > .git/hooks/pre-push | ||
chmod +x .git/hooks/pre-push | ||
``` | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. changesets will take care of this, it's awesome. If you forget to run |
||
## Publishing Packages | ||
|
||
To publish a new version of updated packages, please make sure you: | ||
|
@@ -113,18 +87,7 @@ To publish a new version of updated packages, please make sure you: | |
- have push rights to this repository's `main` branch | ||
- are on a clean `main` branch | ||
|
||
Follow these steps to publish the updated packages: | ||
|
||
- Build and test from root | ||
- Bump the version | ||
- Publish updated packages | ||
|
||
```bash | ||
rush build | ||
rush test | ||
rush version --bump -b main | ||
rush publish --apply --publish --include-all --add-commit-details --set-access-level public --target-branch main | ||
``` | ||
TODO | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's pick this up later on (w/ changesets). Noticed much of publishing we do is pretty manual so not much harm done by removing this process atm I guess. |
||
|
||
[1]: https://github.com/kadena-community/kadena.js/issues/new/choose | ||
[2]: https://nodejs.org/en/download/package-manager | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm missing a notion to add a changelog. How can a user add a changelog to the PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is handled in another PR: #712