-
Notifications
You must be signed in to change notification settings - Fork 1
feat: update GearData interface and add migrate function #189
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
🦋 Changeset detectedLatest commit: e2d677b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
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.
This is the final PR Bugbot will review for you during this billing cycle
Your free Bugbot reviews will reset on January 11
Details
You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
| id: meta.id, | ||
| version: 2, | ||
| }; | ||
| } |
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.
Bug: Migration doesn't provide default value for required icon field
The migrateV1ToV2 function doesn't add an icon field when migrating from V1 to V2. The icon property changed from optional (in V1) to required (in V2), and the ReadonlyGear.icon getter removed its fallback value (?? ''). When V1 data without an icon is migrated, the resulting V2 data will lack the required icon field, causing ReadonlyGear.icon to return undefined instead of a string.
Additional Locations (1)
| ...rest, | ||
| id: meta.id, | ||
| version: 2, | ||
| }; |
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.
Bug: Migration silently discards custom properties in meta object
The migrateV1ToV2 function extracts only id from the meta object and discards everything else. The old GearMetadata interface documentation stated that users could add custom properties prefixed with _ to meta. During migration, these custom properties are silently lost since only meta.id is preserved in the output.
feat: update GearData interface and add migrate function
Note
Introduce GearData v2 (top-level version/id, required icon), add migrate/getVersion utilities, validate version in ReadonlyGear, and update docs/tests/fixtures.
lib/data):GearDatav2: movemeta.version/idto top-levelversion/id; makeiconrequired; addVERSION = 2.data.version === VERSIONin constructor (throwsGearErroron mismatch).version,id; removemetausage;iconnow non-optional.getVersionandmigrate(v1→v2), with error handling; exportmigratefrom package.GearErrornow accepts{ id, name }; add messages for constructor/migration failures.ReadonlyGeartests.GearDataexample to v2 and add migration usage section.Written by Cursor Bugbot for commit e2d677b. This will update automatically on new commits. Configure here.