From f2f93d122bf0607c35eaba84adccb2fab65da578 Mon Sep 17 00:00:00 2001 From: Buck Doyle Date: Wed, 22 Jul 2026 10:39:11 -0500 Subject: [PATCH 1/2] fix: resolve @cardstack/runtime-common in npm-installed parse MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Card code that imports `@cardstack/runtime-common`, and any card whose `@model.` value type is derived through the `primitive` unique symbol, failed to type-check in a published install: runtime-common is a devDependency npm doesn't install, so the bare specifier was unresolvable and the field-value mapping collapsed to the field class. Generate runtime-common's `.d.ts` into `bundled-types/` (plain emission — no content-tag or `: any` annotation, so the `primitive`/`realmURL` `unique symbol` identities survive) and alias `@cardstack/runtime-common` + `/*` to it in the parse tsconfig. Promotes the plain-glimmer and runtime-common fixtures to the must-pass set; the decorator and positional -helper gaps remain deferred. Co-Authored-By: Claude Opus 4.8 (1M context) --- packages/boxel-cli/scripts/build-types.ts | 125 +++++++++++++++++- packages/boxel-cli/src/commands/parse.ts | 10 ++ .../boxel-cli/tests/integration/parse.test.ts | 77 ++++++----- 3 files changed, 177 insertions(+), 35 deletions(-) diff --git a/packages/boxel-cli/scripts/build-types.ts b/packages/boxel-cli/scripts/build-types.ts index fef307fb3a5..c5fabc1124d 100644 --- a/packages/boxel-cli/scripts/build-types.ts +++ b/packages/boxel-cli/scripts/build-types.ts @@ -14,6 +14,14 @@ * --declaration --emitDeclarationOnly`). * Source `.d.ts` files in `base/types` * are passed through as-is. + * - `bundled-types/runtime-common/` — auto-generated `.d.ts` for + * `packages/runtime-common`. See + * `buildRuntimeCommonDts()`. Backs the + * `@cardstack/runtime-common` path + * alias; base's `.d.ts` import its + * `primitive`/`realmURL` symbols and + * field/query types, on which card + * field-value typing depends. * - `bundled-types/host-types/` — `packages/host/types/*` ambient * `.d.ts` files, referenced via the * `'*': ['/types/*']` fallback @@ -303,8 +311,108 @@ function annotateInferredTypes(code: string): string { ); } +/** + * Generate `.d.ts` for every module in `packages/runtime-common` and + * copy them into the destination. Runtime-common is plain `.ts` (no + * `