Skip to content
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: Add BA support for SvelteKit #126

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

nicholas-codecov
Copy link
Collaborator

Description

This PR adds in direct support for SvelteKit apps through the introduction of a new plugin that is tailored for SvelteKit.

Closes #94

Code Example

// vite.config.ts
import { sveltekit } from "@sveltejs/kit/vite";
import { defineConfig } from "vite";
import { codecovSvelteKitPlugin } from "@codecov/sveltekit-plugin";

export default defineConfig({
  plugins: [
    sveltekit(),
    // Put the Codecov SvelteKit plugin after all other plugins
    codecovSvelteKitPlugin({
      enableBundleAnalysis: true,
      bundleName: "example-sveltekit-bundle",
      uploadToken: process.env.CODECOV_TOKEN,
    }),
  ],
});

Notable Changes

  • Add in new @codecov/sveltekit-plugin
  • Add in example SvelteKit app
  • Add in integration tests for new plugin
  • Small tweaks

Copy link

codecov bot commented May 1, 2024

Codecov Report

Attention: Patch coverage is 28.85906% with 106 lines in your changes are missing coverage. Please review.

Project coverage is 75.74%. Comparing base (cb90ab7) to head (74f9c25).

✅ All tests successful. No failed tests found ☺️

Files Patch % Lines
packages/sveltekit-plugin/src/index.ts 0.00% 72 Missing and 1 partial ⚠️
...t-bundle-analysis/sveltekitBundleAnalysisPlugin.ts 50.00% 21 Missing ⚠️
packages/rollup-plugin/src/index.ts 0.00% 4 Missing ⚠️
packages/vite-plugin/src/index.ts 0.00% 4 Missing ⚠️
packages/webpack-plugin/src/index.ts 0.00% 4 Missing ⚠️
Additional details and impacted files
Components Coverage Δ
Plugin core 97.40% <ø> (ø)
Rollup plugin 10.44% <0.00%> (-0.12%) ⬇️
Vite plugin 10.60% <0.00%> (-0.13%) ⬇️
Webpack plugin 26.20% <0.00%> (-0.24%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

codecov bot commented May 1, 2024

Bundle Report

Changes will decrease total bundle size by 49.2kB ⬇️

Bundle name Size Change
@codecov/sveltekit-plugin-cjs 1.3kB 1.3kB ⬆️
@codecov/sveltekit-plugin-esm 909 bytes 909 bytes ⬆️
@codecov/bundler-plugin-core-esm 33.69kB 27.13kB ⬆️
@codecov/nuxt-plugin-esm 855 bytes 0 bytes
@codecov/rollup-plugin-cjs 2.93kB 0 bytes
@codecov/webpack-plugin-esm 1.44kB 1.41kB ⬇️
@codecov/vite-plugin-esm 1.26kB 1.15kB ⬇️
@codecov/example-next-app-client-array-push 894.27kB 0 bytes
@codecov/example-vite-app-esm 150.61kB 0 bytes
@codecov/vite-plugin-cjs 2.92kB 0 bytes
@codecov/bundler-plugin-core-cjs 37.85kB 0 bytes
@codecov/rollup-plugin-esm 1.32kB 155 bytes ⬆️
@codecov/example-next-app-server-cjs 325.59kB 0 bytes
@codecov/example-next-app-edge-server-array-push 306 bytes 0 bytes
@codecov/example-rollup-app-iife 95.45kB 0 bytes
@codecov/example-webpack-app-array-push (removed) 71.19kB ⬇️
@codecov/nuxt-plugin-cjs (removed) 1.38kB ⬇️
@codecov/webpack-plugin-cjs (removed) 3.56kB ⬇️

@codecov-staging
Copy link

codecov-staging bot commented May 1, 2024

Bundle Report

Changes will increase total bundle size by 67.54kB ⬆️

Bundle name Size Change
@codecov/nuxt-plugin-cjs 1.38kB 0 bytes
@codecov/nuxt-plugin-esm 855 bytes 0 bytes
@codecov/vite-plugin-esm 2.41kB 1.3kB ⬆️
@codecov/sveltekit-plugin-esm 1.06kB 1.06kB ⬆️
@codecov/webpack-plugin-cjs 3.56kB 3.56kB ⬆️
@codecov/rollup-plugin-esm 2.4kB 0 bytes
@codecov/webpack-plugin-esm 1.44kB 156 bytes ⬆️
@codecov/example-vite-app-esm 150.61kB 0 bytes
@codecov/bundler-plugin-core-esm 33.69kB 27.13kB ⬆️
@codecov/example-next-app-server-cjs 325.59kB 0 bytes
@codecov/example-next-app-client-array-push 894.27kB 0 bytes
@codecov/example-webpack-app-array-push 71.19kB 71.19kB ⬆️
@codecov/vite-plugin-cjs 2.92kB 0 bytes
@codecov/rollup-plugin-cjs 2.93kB 0 bytes
@codecov/example-rollup-app-iife 95.45kB 0 bytes
@codecov/sveltekit-plugin-cjs 1.3kB 1.3kB ⬆️
@codecov/bundler-plugin-core-cjs (removed) 37.85kB ⬇️
@codecov/example-next-app-edge-server-array-push (removed) 306 bytes ⬇️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support SvelteKit
1 participant