Skip to content

Latest commit

 

History

History
114 lines (76 loc) · 4.39 KB

README.md

File metadata and controls

114 lines (76 loc) · 4.39 KB

RightCapital Frontend Libraries Mono repository

made by RightCapital GitHub Workflow Status (with event) Conventional Commits RightCapital frontend style guide

Introduction

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)

Development

If you are confused about Develop and README.md, please see the document How to Develop (to be done)

Adding new changes

  1. After you have finished your develop. Please run git add command with the files you have changed.
  2. 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.

Releasing changes

  1. Ensure there are no uncommitted changes in your working directory. If there are, please follow the steps in Adding new changes to commit them.

  2. 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 .
  3. Run git push command is used to upload local repository content to a remote repository.

bootstrap

Install ALL dependencies for all sub projects

# on the root of the workspace
$ pnpm install

Add new package

$ pnpm -w create:library <package-name>

Add new dependency package to root workspace

$ pnpm add lodash -w

$ pnpm add -D @types/lodash -w

Test

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$',
};

Publish

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.

Refs