|
1 | 1 | # web-shared |
2 | 2 |
|
3 | | -Server code shared by `apps/web` and `apps/ai-gateway`. The code was moved out of |
4 | | -`apps/web/src` without changing its `@/` import specifiers. |
| 3 | +Server code shared by `apps/web` and `apps/ai-gateway`, moved out of `apps/web/src`. |
5 | 4 |
|
6 | 5 | ## Module resolution |
7 | 6 |
|
8 | | -- Consumers map `@/*` to their own `src/*` first and to `packages/web-shared/src/*` |
9 | | - second. Keep both entries in sync in every tsconfig, the web Jest config, the |
10 | | - `@kilocode/trpc` rollup resolver, and the Storybook webpack alias. |
11 | | -- A path must exist in only one of `apps/web/src` and `packages/web-shared/src`. |
12 | | - A duplicate silently shadows the web-shared file inside `apps/web`. |
| 7 | +- Import this package as `@kilocode/web-shared/<path under src>`, both from |
| 8 | + consumers and from inside this package. `@/` always means the importing app's |
| 9 | + own `src` and never resolves here. |
| 10 | +- `@kilocode/web-shared/*` maps to `packages/web-shared/src/*` in every consumer |
| 11 | + tsconfig, the web Jest config, the `@kilocode/trpc` rollup resolver, and the |
| 12 | + Storybook webpack alias. Keep those entries in sync. |
13 | 13 | - Code here, including tests and `src/tests/helpers`, must only import from this |
14 | | - package; `@/*` resolves to this package only. `pnpm --filter |
15 | | - @kilocode/web-shared typecheck` enforces that with `tsconfig.lib.json` for |
16 | | - runtime code (tests and helpers excluded) and `tsconfig.json` for everything. |
| 14 | + package. `pnpm --filter @kilocode/web-shared typecheck` enforces that with |
| 15 | + `tsconfig.lib.json` for runtime code (tests and helpers excluded) and |
| 16 | + `tsconfig.json` for everything; neither maps `@/`. |
17 | 17 | - Tests run under the `apps/web` Jest config. A test that needs `apps/web` code |
18 | 18 | belongs in `apps/web/src`, which can import from both. |
19 | 19 | - Declare every npm import in `package.json` with the same version as |
|
0 commit comments