Run sync as part of astro check#5823
Merged
Merged
Conversation
🦋 Changeset detectedLatest commit: f20e515 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 |
Princesseuh
approved these changes
Jan 11, 2023
Member
Princesseuh
left a comment
There was a problem hiding this comment.
Since we do this already on dev and build, might as well. If it ever becomes a problem, we could have a --no-sync flag or something similar. +1 from the astro check end of things!
bholmesdev
reviewed
Jan 11, 2023
Contributor
bholmesdev
left a comment
There was a problem hiding this comment.
Small comment but this PR checks out. Also +1 to Erika's comment on adding a --no-sync or --skip-sync flag if users request it
Co-authored-by: Ben Holmes <hey@bholmes.dev>
Shhh… we’re in prerelease mode
Merged
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.
Changes
Sites using content collections will usually need their generated types for
astro checkto pass. This PR runs thesynccommand at the start of the check script to avoid users needing to always doastro sync && astro check(especially in CI where generated types are less likely to already be present).@bholmesdev Is
astro synca safe no-op if no content collections are configured?For context: this is already an issue for #5765 where
astro checkis failing in our CI because content types aren’t generated. The other approach would be to only fix this in our CI script but given other users might run into this, I thought this combo would make most sense.Testing
No additional testing just yet. Running
pnpm test:match "check"passes but only shows two relevant tests currently.Docs
No docs needed I don’t think?