-
Notifications
You must be signed in to change notification settings - Fork 9
Dx1/cleanup cell brand detection #2015
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 issue found across 14 files
Prompt for AI agents (all 1 issues)
Understand the root cause of the following 1 issues and fix them.
<file name="packages/utils/src/typescript/cell-brand.ts">
<violation number="1" location="packages/utils/src/typescript/cell-brand.ts:51">
extractWrapperTypeReference never inspects union types, so a branded wrapper like `Cell<T> | undefined` falls through and returns `undefined`, even though getCellBrand already found the CELL_BRAND. Optional or nullable cells are therefore treated as non-cells, breaking schema/transformer logic that relies on wrapper info.</violation>
</file>
React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.
| return prop; | ||
| } | ||
| } | ||
| return undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extractWrapperTypeReference never inspects union types, so a branded wrapper like Cell<T> | undefined falls through and returns undefined, even though getCellBrand already found the CELL_BRAND. Optional or nullable cells are therefore treated as non-cells, breaking schema/transformer logic that relies on wrapper info.
Prompt for AI agents
Address the following comment on packages/utils/src/typescript/cell-brand.ts at line 51:
<comment>extractWrapperTypeReference never inspects union types, so a branded wrapper like `Cell<T> | undefined` falls through and returns `undefined`, even though getCellBrand already found the CELL_BRAND. Optional or nullable cells are therefore treated as non-cells, breaking schema/transformer logic that relies on wrapper info.</comment>
<file context>
@@ -0,0 +1,219 @@
+ return prop;
+ }
+ }
+ return undefined;
+}
+
</file context>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No issues found across 1 file
24f8fc9 to
5879f1d
Compare
5879f1d to
f39b87f
Compare
Clean up various parts of the schema-generator and ts-transformers package in light of new CELL_BRAND mechanism
Summary by cubic
Centralized CELL_BRAND detection in @commontools/schema-generator/cell-brand and updated schema-generator and ts-transformers to use it. Wrapper detection now relies on brands for Cell/Stream/OpaqueRef, supports brand variants, and correctly handles unions (optional/nullable).
New Features
Refactors
Written for commit 6a66c46. Summary will update automatically on new commits.