Skip to content

Latest commit

 

History

History
30 lines (27 loc) · 1.66 KB

DEVELOPMENT.md

File metadata and controls

30 lines (27 loc) · 1.66 KB

Development notes

Compiling

  • Do not compile on a per project bases
  • Instead, run one command from the root to build everything: yarn build (use yarn build -v to get logged output)
  • To watch files: yarn watch
  • To clean all lib files and then build from scratch: yarn clean

Testing

  • To test everything, package by package: yarn workspaces run test
  • To run all tests together: yarn test:all
  • To get coverage per package: yarn workspaces run coverage
  • To run all tests together for coverage (note: server coverage report will be in the server package, coverage for everything else will be in coverage in the root): yarn coverage:all

Adding monorepo dependencies

Say I want to add @twokeys/addons to the package @twokeys/common-hi (assuming both are in the packages dir):@

  1. Add "@twokeys/addons": "^1.0.0" as an entry to common-hi's `package.json
  2. Add a TS reference. Under references in commom-hi's tsconfig.json add this:
{
	"path": "../addons",
	"prepend": false
}
  1. This way, when common-hi is compiled, addons is automatically compiled first

Creating a new package

  1. Copy the contents of misc/template to a new package dir (e.g package/@twokeys/a-package)
  2. Change the package name and description in package.json and README.md
  3. In the package's tsconfig.json under the tsBuildInfoFile entry, change package to whatever the name of the package (minus the scope) is, e.g "tsBuildInfoFile": "../../../.build-cache/a-package.tsbuildinfo"
  4. Add a new references under tsconfig.json in the root of the repo to the package path, e.g { "path": "./packages/@twokeys/a-package", "prepend": false }