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

Run sync as part of astro check #5823

Merged
merged 5 commits into from
Jan 11, 2023
Merged

Run sync as part of astro check #5823

merged 5 commits into from
Jan 11, 2023

Conversation

delucis
Copy link
Member

@delucis delucis commented Jan 10, 2023

Changes

Sites using content collections will usually need their generated types for astro check to pass. This PR runs the sync command at the start of the check script to avoid users needing to always do astro sync && astro check (especially in CI where generated types are less likely to already be present).

@bholmesdev Is astro sync a safe no-op if no content collections are configured?

For context: this is already an issue for #5765 where astro check is 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?

@changeset-bot
Copy link

changeset-bot bot commented Jan 10, 2023

🦋 Changeset detected

Latest 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

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Jan 10, 2023
@github-actions github-actions bot added the semver: minor Change triggers a `minor` release label Jan 10, 2023
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is blocked because it contains a minor changeset. A reviewer will merge this at the next release if approved.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is blocked because it contains a minor changeset. A reviewer will merge this at the next release if approved.

Copy link
Member

@Princesseuh Princesseuh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!

Copy link
Contributor

@bholmesdev bholmesdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

packages/astro/src/cli/check/index.ts Outdated Show resolved Hide resolved
Co-authored-by: Ben Holmes <[email protected]>
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is blocked because it contains a minor changeset. A reviewer will merge this at the next release if approved.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is blocked because it contains a minor changeset. A reviewer will merge this at the next release if approved.

@delucis delucis dismissed GitHub Actions’s stale review January 11, 2023 16:39

Shhh… we’re in prerelease mode

@delucis delucis merged commit 1f49cdd into main Jan 11, 2023
@delucis delucis deleted the chris/sync-in-check branch January 11, 2023 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope) semver: minor Change triggers a `minor` release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants