Skip to content

Commit

Permalink
ref(sveltekit): Add log for successful Vite plugin insertion (#465)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lms24 authored Sep 20, 2023
1 parent 0931fdb commit b1a4d8e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Unreleased

ref(sveltekit): Add log for successful Vite plugin insertion (#465)

## 3.14.0

feat(nextjs): Add telemetry collection to NextJS wizard (#458)
Expand Down
9 changes: 6 additions & 3 deletions src/sveltekit/sdk-setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -440,14 +440,14 @@ async function modifyViteConfig(

const { org, project, url, selfHosted } = projectInfo;

const prettyViteConfigFilename = chalk.cyan(path.basename(viteConfigPath));

try {
const viteModule = parseModule(viteConfigContent);

if (hasSentryContent(viteModule.$ast as t.Program)) {
clack.log.warn(
`File ${chalk.cyan(
path.basename(viteConfigPath),
)} already contains Sentry code.
`File ${prettyViteConfigFilename} already contains Sentry code.
Skipping adding Sentry functionality to.`,
);
Sentry.setTag(`modified-vite-cfg`, 'fail');
Expand Down Expand Up @@ -490,6 +490,9 @@ Skipping adding Sentry functionality to.`,
);
Sentry.captureException('Sveltekit Vite Config Modification Fail');
}

clack.log.success(`Added Sentry code to ${prettyViteConfigFilename}`);
Sentry.setTag(`modified-vite-cfg`, 'success');
}

async function showFallbackViteCopyPasteSnippet(
Expand Down

0 comments on commit b1a4d8e

Please sign in to comment.