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

fix: better logs for invalid content config #12798

Merged
merged 2 commits into from
Dec 20, 2024
Merged

Conversation

ascorbic
Copy link
Contributor

Changes

This makes a number of improvements to logging for content layer config errors:

  • warns if glob base dir doesn't exist
  • warns if glob matches no files
  • updates warning for empty collection to be more accurate in content layer era
  • logs a warning if there's an error when loading content config

Fixes #12795

Testing

Added tests

Docs

Copy link

changeset-bot bot commented Dec 20, 2024

🦋 Changeset detected

Latest commit: 37c6962

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 Dec 20, 2024
Copy link
Member

@delucis delucis left a comment

Choose a reason for hiding this comment

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

Looks good! Left a nit and one question.

.changeset/afraid-sloths-shake.md Outdated Show resolved Hide resolved
packages/astro/src/content/content-layer.ts Show resolved Hide resolved
Copy link

codspeed-hq bot commented Dec 20, 2024

CodSpeed Performance Report

Merging #12798 will not alter performance

Comparing contrent-layer-warnings (37c6962) with main (f3d8385)

Summary

✅ 4 untouched benchmarks

Co-authored-by: Chris Swithinbank <[email protected]>
@ascorbic ascorbic requested a review from delucis December 20, 2024 10:53
Copy link
Member

@delucis delucis left a comment

Choose a reason for hiding this comment

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

Thanks for the updates — LGTM!

@ematipico ematipico merged commit 7b0cb85 into main Dec 20, 2024
16 checks passed
@ematipico ematipico deleted the contrent-layer-warnings branch December 20, 2024 15:08
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.

Missing/weak validation on glob loader
3 participants