Thank you for considering contributing to pnetwork! We appreciate your interest in making our project better. By participating, you not only help improve the project but also become a part of the open-source community.
Please take a moment to review this document to understand how you can contribute.
There are several ways to contribute to [Your Project Name], and we welcome all types of contributions, including bug reports, feature requests, code contributions, documentation improvements, and more. Here's a general outline of the steps to get started:
-
Clone the Repository:
Clone your forked repository to your local machine using the following command (replace
<your-username>
with your GitHub username):git clone https://github.com/pnetwork-association//pnetwork.git
-
Create a branch:
Create a new branch for your work with a descriptive name. For example:
git checkout -b feat/new-feature
-
Make Changes:
Ensure your changes are properly tested. If your contribution involves code, write tests to cover your changes. Follow Basic tutorial.
-
Commit Your Changes:
Create a changeset for the modified packages:
npx changeset # if the version needs to be bumped # or npx changeset --empty # if version does not need to be bumped (e.g. you modified tests)
Commit your changes with a clear and concise commit message (follow commitlint convention):
git commit -m "feat: your feature description"
-
Push Your Changes:
Push your changes to your fork on GitHub:
git push origin feature/new-feature
-
Create a Pull Request:
Go to the original repository and create a Pull Request (PR) to merge your changes to
develop
. Provide a detailed description of your changes in the PR. Make sure to reference any related issues. -
Review and Discuss:
Participate in discussions and make necessary changes based on feedback from maintainers and other contributors.
-
Wait for Approval:
Once your PR is approved, it will be merged into the project.
The monorepo has been created using the Nx package-based model reference. What follows are a concise summary of the basic commands needed in order to create new features and should be seen as a reference.
npm install -g nx
To add/remove a project, just add/remove the folder to packages/
and then, at the root:
npm install
Add the dependency in the package's package.json
file:
"dependencies": {
"ptokens-utils": "*",
}
Then, at the project's root:
npm install
nx run-many --target=test
nx run ptokens-btc-syncer:test
nx lint ptokens-utils
Note: Every script in the project should be run as a Nx task in order to work properly, as module dependencies are installed in the monorepo's root, not in the project anymore.
For JS source code, linting is governed by Google gts
.
Just add the following JSON to a new project:
{
"extends": ["../../.eslintrc.json"]
}
If you need a new rule to add, please ask the team's opinion about it first in order to select the best option for everyone.
Please follow the Convertional commit standard
when committing to any project in this repo, with this rule on top of that:
commit-type(<project-name>): <commit-text> [(<file|folder|context>)]
feat(ptokens-utils): add superpowers (fly.js)
refactor(ptokens-listener): rename this into that
Note: [(<file|folder|context>)]
can be used when applicable,
on a set of files it's better omitting it.
Create a new branch having the pattern
<feat|chore|refactor|fix>/<component-name>/<branch-name>
- feat/ptokens-utils/add-superpowers
- chore/ptokens-listener/rename-file
- fix/ptokens-constants/wrong-type
An image can be built in the following ways:
- From the monorepo's root
nx run ptokens-utils:docker-build
- From the project's root
nx docker-build
- Or all the projects images together
nx run-many --target=docker-build
We avoid using Nx caching for the docker-build
task since caching is already done by the Docker
build itself.
If you want to change this, you can add the docker-build
task to cacheableOperations
list in the
nx.json
file.
Tests can't find some modules/functions even if they have been installed correctly through npm i
at the root's monorepo
Solution: Check that the project don't have the node_modules
folder, if so delete it and the tests should
run again.