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.
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(astro): Exposes extra APIs for script and testing #12052
base: main
Are you sure you want to change the base?
feat(astro): Exposes extra APIs for script and testing #12052
Changes from 3 commits
3a73ea9
6da3161
b842f99
7cac830
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the usecase for exporting this? I'm not too comfortable with exposing this yet since the validation doesn't take in account of
--verbose
and--silent
(or log level in the future) and it always logs to the console when it shouldn't in tests, so it requires some more refactor.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's one of the APIs necessary to implement testing properly. Otherwise, we'd need to re-implement the transformations fone in the schema.
It is mentioned at the end of the proposal:
I don't see anywhere in the code where it would log anything. It creates a Zod schema and parses using it. None of the
refine
,superRefine
andtransform
functions in the schema has any logs, they just add possible issues which will be reported as an error to the caller not as logs.Are you perhaps thinking of
resolveConfig
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yeah it's
resolveConfig
that's logging the error, notvalidateConfig
. But in that case, wouldn'tresolveConfig
be more useful as it mimics whatdev()
andbuild()
loads for the astro config?validateConfig()
only handles the validation part.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer to keep this internal still. I imagine for external libraries this shouldn't have a significant impact if not used since it only mattered for Astro having tons of tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Astro has around 2,000 tests. For companies requiring high reliability, it is not uncommon to have very exhaustive testing on libraries (at least for the companies I know that fit that description, including mine).
Multiple of our libraries for Next have over 10k tests each. Libraries for Astro (which we are working on) won't be any less tested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't related to the number of test, but the number of builds for tests. Astro has many builds to test different permutations of all features and I doubt the same is needed for external libraries. Even so, Astro's test suite is due for some fixtures reduction because some fixtures could be combined, so in practice this option isn't really encouraged.