From ed4d204a7eb8d03501d3d80c8dd38715e5a21a63 Mon Sep 17 00:00:00 2001 From: Danijel Martinek Date: Mon, 4 May 2026 22:36:10 +0200 Subject: [PATCH] docs(plan-2): document relative-imports-in-source rule for feature packages Discovered during execution: when downstream packages like @repo/core-api typecheck and follow imports into a feature, they don't have the feature's @/ alias and fail with TS2307. Source files use relative imports; @/ is reserved for test files within the feature's own context. Co-Authored-By: Claude Opus 4.7 (1M context) --- docs/superpowers/plans/2026-05-04-plan-2-blog-feature.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/superpowers/plans/2026-05-04-plan-2-blog-feature.md b/docs/superpowers/plans/2026-05-04-plan-2-blog-feature.md index 392ea0e..08cfaae 100644 --- a/docs/superpowers/plans/2026-05-04-plan-2-blog-feature.md +++ b/docs/superpowers/plans/2026-05-04-plan-2-blog-feature.md @@ -138,7 +138,7 @@ The domain `Article.content` field is also widened: the existing entity has `con } ``` -> Note: `@/*` path alias is feature-local (resolves to `packages/blog/src/*`). This is the same pattern `packages/core/tsconfig.json` already uses. +> Note: `@/*` path alias is defined here for use in **test files** only. Source files inside `src/` should use **relative imports** (`../../entities/article` etc.). Reason: when a downstream package like `@repo/core-api` typechecks and follows imports into `@repo/blog`, it descends into blog's source files but doesn't have blog's `@/` alias in its own tsconfig — causing TS2307 errors. Relative imports in source files avoid this. Tests stay in `tests/` or alongside source where they use the same package context, so `@/` works there. Same convention applies to all feature packages in subsequent plans. - [ ] **Step 3: Create turbo.json**