Skip to content
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

feat: generator schema migration #373

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

cristianoventura
Copy link
Collaborator

@cristianoventura cristianoventura commented Dec 4, 2024

Description

This PR adds migrations to the generator schema, ensuring that changes to its structure remain backward-compatible. This allows the generator to work properly even when the schema is updated.

The pattern adopted in this PR is based on the settings migration #371.

How to Test

  • make changes to the latest version of the schema /schemas/generator/v1/index.ts such as renaming a property.
  • change the migrate function in /schemas/generator/v0/index.ts to return the new schema.
  • make appropriate changes to the remaining implementation so the new schema is used. This may require changing the slices and several other parts of the code.
  • ensure the generator JSON file has version: '0' and all old properties before testing.
  • open the old generator file and check that options were migrated.

Checklist

  • I have performed a self-review of my code.
  • I have added tests for my changes.
  • I have run linter locally (npm run lint) and all checks pass.
  • I have run tests locally (npm test) and all tests pass.
  • I have commented on my code, particularly in hard-to-understand areas.

Screenshots (if appropriate):

Related PR(s)/Issue(s)

Resolves #370

@cristianoventura cristianoventura self-assigned this Dec 4, 2024
@cristianoventura cristianoventura requested a review from a team as a code owner December 4, 2024 16:41
@cristianoventura cristianoventura requested review from going-confetti, Llandy3d and allansson and removed request for a team December 4, 2024 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generator schema migration
1 participant