refactor(compiler-cli): validate @content block placement

Adds validation to verify that `@content` blocks are only used as direct
children of foreign components.

Specifically:
- Defines a new compile diagnostic code `INVALID_CONTENT_PLACEMENT = 8026`.
- Updates `ForeignComponentFeatureAnalyzer` to traverse content blocks and
  report `INVALID_CONTENT_PLACEMENT` diagnostics if they are placed
  incorrectly.
- Removes the raw error thrown during ingestion in
  `packages/compiler/src/template/pipeline/src/ingest.ts`.
- Adds integration tests in `template_typecheck_spec.ts`.
This commit is contained in:
leonsenft
2026-06-04 12:15:24 -07:00
committed by Andrew Scott
parent daa47b4aad
commit 1f6e843648
5 changed files with 219 additions and 2 deletions
@@ -81,6 +81,7 @@ export enum ErrorCode {
INLINE_TYPE_CTOR_REQUIRED = 8901,
INTERPOLATED_SIGNAL_NOT_INVOKED = 8109,
INVALID_BANANA_IN_BOX = 8101,
INVALID_CONTENT_PLACEMENT = 8026,
LET_USED_BEFORE_DEFINITION = 8016,
LOCAL_COMPILATION_UNRESOLVED_CONST = 11001,
LOCAL_COMPILATION_UNSUPPORTED_EXPRESSION = 11003,