This is a Mono repository contains a set of useful libraries/helpers in TypeScript.
it including the following packages:
- @rightcapital/exceptions: This library provides a set of standard Exceptions (API Reference)
- @rightcapital/date-helpers: A utility class providing various date formatting and parsing methods in TypeScript. (API Reference)
- @rightcapital/color-helpers: Color science related helpers (API Reference)
If you are confused about Develop and README.md, please see the document How to Develop (to be done)
- After you have finished your develop. Please run
git add
command with the files you have changed. - Please run
pnpm -w commit
command to commit your changes, it will help you to create a commit that follows the Conventional Commits specification(<- which is enforced in our repository).
Tips:
If you feels that
pnpm -w commit
is too long to type, you can add an alias to your shell config file, or make use of reverse-search of your shell(similar feature could be found on most interactive shells).Commands start with
pnpm -w
are executed from the root of the workspace, you can use them anywhere in the workspace, they have the same effect.
-
Ensure there are no uncommitted changes in your working directory. If there are, please follow the steps in Adding new changes to commit them.
-
Run
pnpm -w change
.- This command walks you through a couple of questions and will generate the appropriate change file in the /change directory.
- The generated file will be checked into the repo automatically for you.
- One of the niceties of using this utility to generate change files is that it will check whether or not you even need a change file or not.
- Also, it will try to pull in recent commit messages to speed up change file generation .
-
Run
git push
command is used to upload local repository content to a remote repository.
Install ALL dependencies for all sub projects
# on the root of the workspace
$ pnpm install
$ pnpm -w create:library <package-name>
$ pnpm add lodash -w
$ pnpm add -D @types/lodash -w
We prefer to use jest
as test platform. and if you wanna run all tests for all packages.
$ pnpm -w test # in anywhere inside the workspace
# if you wanna test individual package. just run
$ pnpm test # in the root of the packages
to support TypeScript for jest you need:
$ pnpm add -D jest @types/jest -w
and put config file:
packages\[your-package]\jest.config.js
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.ts$',
};
When the PR is merged into the main
branch, it will trigger the GitHub action to publish the package to the npm registry.
We don't need to run the publish
command locally.