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

[Content collections] Load content config with full Vite setup #6092

Merged
merged 14 commits into from
Feb 3, 2023

Conversation

bholmesdev
Copy link
Contributor

@bholmesdev bholmesdev commented Feb 1, 2023

Changes

  • Resolves Cannot resolve aliased module from src/content/config.ts #5990
  • Dev: Load content config with existing dev server, instead of creating a new one
    • Moves type generation to after dev server startup instead of before
    • Ensures [content] logs happen after server port logs, which should make them more visible
  • Build: Load config by calling the astro sync command internally, with full createVite result instead of condensed config

Testing

Ensure existing tests still pass

Docs

N/A

@changeset-bot
Copy link

changeset-bot bot commented Feb 1, 2023

🦋 Changeset detected

Latest commit: 6a7cf2b

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 Feb 1, 2023
Copy link
Contributor

@matthewp matthewp left a comment

Choose a reason for hiding this comment

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

Very clean design! Nicely done.

@bholmesdev
Copy link
Contributor Author

Circling back to that failing unit test tomorrow. I discovered the renderentry configs weren't getting loaded previously because it used an invalid config format (schema: { instead of schema: z.object({). Fixing this, it looks like the layout test fails when the config is present. The test passes if I remove the config.ts mock 🤷

@bholmesdev bholmesdev merged commit bf8d736 into main Feb 3, 2023
@bholmesdev bholmesdev deleted the fix/content-config-loading branch February 3, 2023 20:52
@astrobot-houston astrobot-houston mentioned this pull request Feb 3, 2023
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)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot resolve aliased module from src/content/config.ts
2 participants