This repository contains utility packages for Digabi codebase.
- Typescript only
- Good unit test coverage
- If a devDependency is needed in all packages, add it to the root level package.json. Otherwise it should go in the packages own package.json
- Let’s keep dependencies to a minimum and only add them when they’re truly needed. Try to avoid pulling in a large library just for a single function.
No strict naming conventions. Package name should reflect the context and functionality. Feel free to add -utils ending if you feel like the package
is only an extension/helper and it could be confusing to name it only based on the context.
__tests__contains unit tests for package. Each package should have unit tests that cover the usage.srccontains actual code
- Copy an existing package under
packages/as a template and modify relevant parts.- Try
crypto-utilsor2faas pretty minimal examples.
- Try
- Add an entry for your package to
.github/workflows/publish.yml. - Run
just new-package foobarwherefoobaris the package's name.- The prefix
@digabi/will be added automatically.
- The prefix
- Sign into npmjs.com and navigate to the new package's settings.
- Setup "Trusted publisher".
- Set "publishing access" to "require two-factor authentication and disallow tokens".
- Ensure connection works by creating a new version with
publish.yml.
Publishing should be done only via github actions by triggering the Publish new version workflow.
- Go to https://github.com/digabi/node-packages/actions/workflows/publish.yml and choose
Run workflow. - If you want to create a pre release from a feature branch, select that as the branch to run workflow from.
- Select package to update
- Select what kind of version bump would you like to do. If doing a
pretype release, the version will be tagged with the branch name for examplefeature-add-sort-function. If normal release then it will be tagged aslatest.