feat(sveltekit): Add Support for SvelteKit SDK setup#251
Merged
Conversation
|
753065f to
f37bfe4
Compare
adds the creation of Sentry CLI config files to the SvelteKit SDK setup
Add basic SDK setup code generation to the wizard. During SDK setup, we distinguish between two cases for each SvelteKit (client and server) hook file: * If no hook file exists, we can just copy our hooks file template with the complete instrumentation. Great! 🎉 * If there is a pre-existing hooks file, we partially merge it with a Sentry import and init call and request additional manual intervention from the user
To respect custom hooks file locations that users can specifiy in `svelte.config.js`, we import the svelte config and use these custom paths if they're available. Otherwise, we fall back to the default paths.
…#257) Replace the "old" init call injection approach with using magicast to modify the file
…oks (#259) Add our handlers to the `handle` and `handleError` hooks in the SveltKit hooks files. Uses magicast and advanced AST manipulation to merge user-defined handlers with ours.
Converts the CLI appearance to use the `clack` library. Rewriting the flow to the new NextJS wizard flow.
0135845 to
4dea9d3
Compare
Update the usage of `sentryHandle` in the wizard after the breaking change in 7.50.0 where we converted it to a factory function.
4dea9d3 to
a3fe2df
Compare
Add the creation of a sample SvelteKit route with a page and an API route to send example frontend and backend errors (+ a transaction) to Sentry.
lforst
approved these changes
May 3, 2023
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR adds full support for setting up the SvelteKit SDK with the wizard:
This includes:
hooks.(client|server).(js|ts)vite.config.(js|ts)svelte.config.jscloses #244