generated from florian-lefebvre/astro-integration-template
-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: add support for subtyping and extra integration fields (#98)
Co-authored-by: Florian Lefebvre <[email protected]> Co-authored-by: Bryce Russell <[email protected]>
- Loading branch information
1 parent
aabfbca
commit 29d6305
Showing
22 changed files
with
470 additions
and
499 deletions.
There are no files selected for viewing
This file contains 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,28 @@ | ||
--- | ||
"astro-integration-kit": minor | ||
--- | ||
|
||
Updates `defineIntegration` `setup` returned object shape to allow extra properties | ||
|
||
Previously the return of the `setup` function passed to `defineIntegration` was the Astro hooks defined by the integration, and would be set as the `hooks` property in the final integration object. | ||
|
||
Now, the expected return of `setup` is the properties of the integration object itself: | ||
|
||
```ts title="my-integration.ts" ins={7,11} | ||
import { defineIntegration } from "astro-integration-kit"; | ||
|
||
export default defineIntegration({ | ||
name: "my-integration", | ||
setup({ name }) { | ||
return { | ||
hooks: { | ||
"astro:config:setup": () => { | ||
// ... | ||
}, | ||
}, | ||
}; | ||
}, | ||
}); | ||
``` | ||
|
||
If you are using the `withPlugins` utility, you don't need to do anything since that utility now returns the updated shape. |
This file contains 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 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 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 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 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 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 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
Oops, something went wrong.