-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
feat: move astro config validation after astro:config:setup #13482
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
Merged
Merged
Changes from 19 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
5fe1889
feat: move astro config validation after astro:config:setup
florian-lefebvre 09ba9ce
feat: superRefine
florian-lefebvre d990b07
fix: test
florian-lefebvre f0abd11
feat: update test
florian-lefebvre 27668d3
feat: update test
florian-lefebvre f7699d5
fix: test
florian-lefebvre fbaada2
Merge branch 'main' into feat/post-integrations-config-validation
florian-lefebvre d074a51
feat: feedback
florian-lefebvre de52147
Merge branch 'main' into feat/post-integrations-config-validation
florian-lefebvre 634696f
feat: improve logging
florian-lefebvre 60cffca
feat: refactor
florian-lefebvre 0a3ce47
fix: no spread
florian-lefebvre 4598ae7
feat: split schemas
florian-lefebvre a353e4a
chore: changeset
florian-lefebvre 4fb9ec1
Merge branch 'main' into feat/post-integrations-config-validation
florian-lefebvre 57c55bd
Update packages/astro/src/core/config/schemas/README.md
florian-lefebvre 3159e7b
Merge branch 'main' into feat/post-integrations-config-validation
florian-lefebvre a021476
Update packages/astro/src/integrations/hooks.ts
florian-lefebvre 0a0507e
Update packages/astro/src/core/config/schemas/README.md
florian-lefebvre f9eb6b1
Update .changeset/easy-vans-laugh.md
florian-lefebvre 01e8518
Update .changeset/easy-vans-laugh.md
florian-lefebvre e68052d
Merge branch 'main' into feat/post-integrations-config-validation
florian-lefebvre ef18425
grammar nit in changeset
sarah11918 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| 'astro': minor | ||
| --- | ||
|
|
||
| Updates when the configuration is validated to include integrations | ||
florian-lefebvre marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| From now on, Astro will validate the configuration before and after each integration `astro:config:setup` hook have run. This means `updateConfig()` calls will no longer accept invalid configuration. | ||
florian-lefebvre marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| 'astro': minor | ||
| --- | ||
|
|
||
| Improves integrations error handling | ||
|
|
||
| If an error is thrown from an integration hook, an error log will now provide information about the concerned integration and hook |
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # Config schemas | ||
|
|
||
| There are 3 zod schemas needed to validate the Astro config properly: | ||
|
|
||
| - `AstroConfigSchema` (base): a schema that matches the `AstroConfig` type | ||
| - `createRelativeSchema` (relative): a function that uses the base schema, and adds transformations relative to the project root. Transformations occur at runtime, and the paths are resolved against the `cwd` of the CLI. | ||
| - `AstroConfigRefinedSchema` (refined): a schema that handles extra validations. Due to constraints imposed by the Astro architecture, refinements can't be done on the `AstroConfig` schema because integrations deal with the output of the `AstroConfig` schema. As a result, this schema runs after parsing the user config and after every integration `astro:config:setup` hook (to make sure `updateConfig() has been called with valid config)`. |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.