feat(config): add global productAttributes and contentAttributes sections#152
Open
mariobrgomes wants to merge 3 commits intomainfrom
Open
feat(config): add global productAttributes and contentAttributes sections#152mariobrgomes wants to merge 3 commits intomainfrom
mariobrgomes wants to merge 3 commits intomainfrom
Conversation
…ions - Add productAttributes and contentAttributes config sections for shared attribute definitions - Implement AttributeCache for O(1) attribute lookup during deployment - Add preflight validation rejecting inline attribute definitions with migration guidance - Enhance introspect to separate attributes by type (PRODUCT_TYPE vs PAGE_TYPE) - Add "did you mean?" suggestions using Levenshtein distance for typos - Extend diff engine with "Product Attributes" and "Content Attributes" entity types - Deprecate legacy 'attributes' section with backward compatibility Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 3fb2c70 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Member
|
Let's make sure to add it to |
Keep main's refactored method extraction (displayDeploymentResult, displayCleanupSuggestions, saveAndPruneReport, etc.) while preserving PR's attributeCache in DeploymentContext and runPreflightValidation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
09cb4c5 to
f6fca44
Compare
Critical fixes: - Pass attributeCache to pageTypesStage (was missing, causing perf regression and silent validation skip) - Include legacy attributes in StageAggregateError success count Important fixes: - Remove Console() instantiation from validateNoInlineAttributeDefinitions; let caller handle presentation - Add logger.warn to empty catch blocks in deploy.ts - Pass entity name to resolveReferencedAttributesWithCache in PageTypeService for actionable error messages - Log warning when API returns null for attribute resolution in both services - Add productAttributes/contentAttributes to ConfigurationSection union and AVAILABLE_SECTIONS for --include/--exclude support - Add UnsupportedInputTypeError handling to retrieveWithoutSaving - Replace unsafe `as FullAttribute` cast with fullAttributeSchema.parse() Type design improvements: - WrongSectionResult: boolean discriminant → discriminated union - AttributeValidationResult: boolean discriminant → discriminated union - CachedAttribute.inputType: string → AttributeInputType union - isInlineAttributeDefinition: boolean return → type predicate Test coverage (+13 tests): - validateAttributeReference: 7 tests (valid, wrong section, not found, Levenshtein suggestions) - PageTypeService cache path: 3 tests (cache hit, miss, null API) - ProductTypeService cache path: 3 tests (cache hit, miss, null API) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add new
productAttributesandcontentAttributesconfig sections that allow defining shared attributes once and referencing them across product types and model types.Key Changes
productAttributesfor PRODUCT_TYPE attributes,contentAttributesfor PAGE_TYPE attributesattributessection still works with deprecation warningExample Config
Test plan
🤖 Generated with Claude Code