- Do not compile on a per project bases
- Instead, run one command from the root to build everything:
yarn build
(useyarn build -v
to get logged output) - To watch files:
yarn watch
- To clean all
lib
files and then build from scratch:yarn clean
- 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
Say I want to add @twokeys/addons
to the package @twokeys/common-hi
(assuming both are in the packages
dir):@
- Add
"@twokeys/addons": "^1.0.0"
as an entry tocommon-hi
's `package.json - Add a TS reference. Under
references
incommom-hi
'stsconfig.json
add this:
{
"path": "../addons",
"prepend": false
}
- This way, when
common-hi
is compiled,addons
is automatically compiled first
- Copy the contents of
misc/template
to a new package dir (e.gpackage/@twokeys/a-package
) - Change the package name and description in
package.json
andREADME.md
- In the package's
tsconfig.json
under thetsBuildInfoFile
entry, changepackage
to whatever the name of the package (minus the scope) is, e.g"tsBuildInfoFile": "../../../.build-cache/a-package.tsbuildinfo"
- 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 }