You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+16-3Lines changed: 16 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,13 +14,26 @@ This is currently the only way to use `@lavamoat/allow-scripts` in monorepos.
14
14
15
15
### Building
16
16
17
-
For local development, you should run `yarn build:clean` in the project root directory.
18
-
This will always build the packages in the correct order.
17
+
Run `yarn build` to build all packages in correct order.
18
+
If you encounter any errors, try `yarn build:clean`, and if that fails, check the TypeScript configuration (see below).
19
19
20
-
You can also run `yarn build` in a workspace, although you have to ensure that the projects are built in the correct order.
20
+
You can also run `yarn build` in a specific package / workspace, although you have to ensure that its dependencies have been built.
21
21
22
22
Repository-wide watching is currently not possible due to the build processes of some packages.
23
23
24
+
#### Configuring TypeScript
25
+
26
+
The TypeScript configuration of this monorepo is brittle, and requires manual maintenance.
27
+
It uses TypeScript [project references](https://www.typescriptlang.org/docs/handbook/project-references.html) and `composite` sub-projects (i.e. monorepo package).
28
+
In short, the [root `tsconfig.json`](./tsconfig.json) must contain an empty `files` array, and `references` to each interdependent project with a `tsconfig.json` in its root directory.
29
+
Meanwhile, every sub-project must explicitly declare the relative paths to its local dependencies via its `references` array.
30
+
31
+
If building from the monorepo root suddenly starts to fail, check if the errors are referring to monorepo packages, and verify that their `tsconfig.json` files are configured correctly.
32
+
33
+
Some packages do not require a `tsconfig.json` file.
34
+
These packages must be explicitly ignored in the [TypeScript config lint script](./scripts/verify-tsconfig.mjs).
35
+
If a package is neither referenced nor ignored, linting will fail.
36
+
24
37
### Testing and Linting
25
38
26
39
Run `yarn test` and `yarn lint` in the project root directory, or in a workspace.
0 commit comments