Add {{todo}}
to your project:
npm i {{todo}}
import {{todo}} from '{{todo}}';
- Change all the
{{todo}}
occurrences to the name of your package. - Change the
package.json
"name"
to match your package. - Change the
package.json
"repository"
to match your repository. - Change the
package.json
"author"
to match your name. - Change the
package.json
"keywords"
to match your package. - Change the
package.json
"description"
to match your package. - Start coding in the
src
folder. - Remove this section from the
README.md
file.
npm install # to install all dependencies
npm run test # to run tests
npm run test -- --watch # to develop while running tests
npm run typecheck # to check types in the project
npm run lint # to run eslint
npm run fix # to fix eslint errors
npm run format # to run prettier
npm run build # create a build in the dist folder
Husky and lint-staged are set up to run before every commit, so you don't have to worry about formatting or linting.
We are using GitHub Actions to build & publish the package to NPM. The workflow is triggered
manually from the GitHub Actions tab. There you will be able to select a npm version update type
(patch
, minor
, major
) and a release type (rc
, beta
, alpha
).
The GitHub Action does the version update, tagging, and committing as part of the workflow. The way
the version number is retrieved from the package.json
after updating it is specific for
non-workspace projects. If you are using a workspace project, you will need to update the GitHub
Workflow configuration differently.
# get a bare npm version without quotes
# non-workspace
npm pkg get version | tr -d '"'
# workspace
npm pkg get version | jq -r '.[]'
Dev builds (with the -dev.{commit}
postfix) are published to the @next
tag, and trigger
automatically on every push to the main
branch (e.g. when a PR is merged).
npm run build
npm publish