Thanks for you interest to contribute to pdfmake-wrapper. In this document we will describe the steps of contributing and what it is allowed to send to your pull request. Here the guidelines to follow:
- Don't push either to master or develop
- Don't update either the package.json or package-lock.json
- Don't create a pull request to master (use develop branch instead)
- Don't update scripts/create-package-json-lib.js file
This repo is using conventional commit, please read about that to follow this convention. You can read it here.
Consider reading this if you will work on a new feature or a bug fix before making code changes.
Before adding a new feature to this library, you need to open a new discussion on Github using the Contributing category to discuss about that and make sure whether the feature is aligned with the project.
If the feature was approved and you work on it, you will need to add test cases and docs (details/examples) about it. Remember to add interfaces if the feature need it.
When fixing a bug/issue, please add the issue number in the commit to close the issue (more about closing issues here). Here an example:
git commit -m "fix(<scope>): my description
close #1234"
# OR
git commit -m "fix(<scope>): my description
Your body message
close #1234"
-
Fork the pdfmake-wrapper repo.
-
Clone your forked repo.
git clone https://github.com/<your-username>/pdfmake-wrapper.git
-
Move to develop branch (this is the development branch).
git checkout develop
-
Create a new branch based on develop.
git checkout -b my-new-branch
-
Make your changes, write your code, improve the docs or fix something. Read this rules to make changes.
-
Commit your changes (this will run the tests and a linter to verify if your commit message follows the commit convention). if you are fixing a bug/issue, create your commit as mention here.
-
Push your branch with the new changes to your fork.
git push origin my-new-branch
-
Create a pull request to develop branch.
-
Wait for merging.
- .github/: Contains all github related, for example the workflows.
- .husky/: Contains git hooks to verify commits and run tests.
- docs/: Documentation related.
- src/: Contains the source code.
- test/: Contains the test cases in the same order as src folder structure.
If you added a new feature and you want to test your changes generating a PDF document, you will need to build the project and link the build result to test it. Here are the steps to follow.
Build the project, this will create a dist/ folder.
npm run build
go to dist/ folder.
cd dist/
link the project, this will install pdfmake-wrapper as a global npm package. Read more about link command here.
npm link
Then you can install it in any project you want to test your changes. for example, you can create a new project (angular/react/vue/etc..)and install pdfmake-wrapper in it.
# move to your new project
cd <your project>
# and then install the lib
npm link pdfmake-wrapper
Once installed, you can use it.
Once you finished to test the library, you can uninstall it running unlink npm command.
inside the project where you tested the library, run:
npm unlink pdfmake-wrapper
Then go to pdfmake-wrapper project inside dist/ folder and run:
npm unlink
This will remove the package.