- All folders in this repo under the
packagesfolders are self-contained packages - They are organized in groups. The directory structure is
packages/<group>/<package> - Each package is self-contained and should be built and published separately from the others
- The packages do not share configuration. Each package has their own lint/typescript/playwright/whatever configuration.
- This repo does not use package hoisting and linking like it is done in pnpm/yarn/npm workspace. There are no workspaces.
- If package B depends on package A, and you want to change A to support something in B, you cannot
modify A and B at the same time and assume that B "sees" the changes in A.
- What you should do is change A, test it, publish A, then do the same for B.
- To edit a package, just edit the files
- All packages in this repo are npm packages, and all are ESM package
- They have a
package.jsonin the root of the package - They have an
srcfolder for the source code of the package - They have a
testfolder for the tests of the package - If they generate code from
src, it is always in adistfolder
- All packages use pnpm
- To install, use
pnpm install - To publish a change in a package, you:
- Edit the source code
- Write the tests
- Then build the package
- Then test what you wrote using the tests (or manually if you cannot write a test)
- Continue iterating till the tests pass
- Publish the package
- Note that you can never
- To build a package, run
pnpm build - What it does is run all
build:*scripts in thepackage.json
- To test a package, run
pnpm test - Most of the times, you need to build the package before running the tests
- What it does is run all the
test:*scripts in thepackage.json - Sometimes we want to run a specific test file and not all of them:
- To do that, use the specific
test:*script - For example, for a specific playwright test, use
pnpm test:playwright <specific-test-file> - Or to run all playwright tests, just use
pnpm test:playwright - The same is for Node tests -
pnpm test:nodeorpnpm test:node <specific-test-file>
- To do that, use the specific
- To publish a package, run
pnpm publish