codecov / codecov-javascript-bundler-plugins

Set of bundler plugins that allow users to upload bundle stats to Codecov.
MIT License
4 stars 1 forks source link

feat: Add BA support for SvelteKit #126

Closed nicholas-codecov closed 1 month ago

nicholas-codecov commented 2 months ago

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

codecov[bot] commented 2 months ago

Codecov Report

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

Project coverage is 77.88%. Comparing base (ddcd055) to head (72b56fd).

:white_check_mark: All tests successful. No failed tests found.

Files Patch % Lines
packages/sveltekit-plugin/src/index.ts 0.00% 72 Missing and 1 partial :warning:
...t-bundle-analysis/sveltekitBundleAnalysisPlugin.ts 50.00% 21 Missing :warning:
packages/rollup-plugin/src/index.ts 0.00% 4 Missing :warning:
packages/vite-plugin/src/index.ts 0.00% 4 Missing :warning:
packages/webpack-plugin/src/index.ts 0.00% 4 Missing :warning:
Additional details and impacted files | [Components](https://app.codecov.io/gh/codecov/codecov-javascript-bundler-plugins/pull/126/components?src=pr&el=components&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov) | Coverage Δ | | |---|---|---| | [Plugin core](https://app.codecov.io/gh/codecov/codecov-javascript-bundler-plugins/pull/126/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov) | `97.87% <ø> (ø)` | | | [Rollup plugin](https://app.codecov.io/gh/codecov/codecov-javascript-bundler-plugins/pull/126/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov) | `10.44% <0.00%> (-0.12%)` | :arrow_down: | | [Vite plugin](https://app.codecov.io/gh/codecov/codecov-javascript-bundler-plugins/pull/126/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov) | `10.60% <0.00%> (-0.13%)` | :arrow_down: | | [Webpack plugin](https://app.codecov.io/gh/codecov/codecov-javascript-bundler-plugins/pull/126/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov) | `26.20% <0.00%> (-0.24%)` | :arrow_down: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] commented 2 months ago

Bundle Report

Changes will decrease total bundle size by 27.8kB :arrow_down:

Bundle name Size Change
@codecov/example-next-app-client-array-push 894.72kB 446 bytes :arrow_up:
@codecov/sveltekit-plugin-cjs 1.3kB 1.3kB :arrow_up:
@codecov/example-rollup-app-iife 95.45kB 0 bytes
@codecov/sveltekit-plugin-esm 909 bytes 909 bytes :arrow_up:
@codecov/bundler-plugin-core-cjs 41.95kB 0 bytes
@codecov/nuxt-plugin-cjs 1.38kB 0 bytes
@codecov/nuxt-plugin-esm 855 bytes 0 bytes
@codecov/bundler-plugin-core-esm 6.56kB 31.05kB :arrow_down:
@codecov/rollup-plugin-cjs 2.93kB 0 bytes
@codecov/vite-plugin-cjs 2.92kB 0 bytes
@codecov/webpack-plugin-cjs 3.56kB 0 bytes
@codecov/rollup-plugin-esm 1.32kB 155 bytes :arrow_up:
@codecov/vite-plugin-esm 1.26kB 153 bytes :arrow_up:
@codecov/webpack-plugin-esm 1.44kB 156 bytes :arrow_up:
@codecov/example-vite-app-esm 150.61kB 0 bytes
@codecov/example-webpack-app-array-push 71.19kB 0 bytes
@codecov/example-next-app-server-cjs 325.72kB 131 bytes :arrow_up:
@codecov/example-next-app-edge-server-array-push 306 bytes 0 bytes
codecov-staging[bot] commented 2 months ago

Bundle Report

Changes will decrease total bundle size by 210.88kB :arrow_down:

Bundle name Size Change
@codecov/rollup-plugin-cjs 2.93kB 0 bytes
@codecov/rollup-plugin-esm 1.32kB 155 bytes :arrow_up:
@codecov/bundler-plugin-core-esm 37.6kB 31.05kB :arrow_up:
@codecov/webpack-plugin-cjs 3.56kB 3.56kB :arrow_up:
@codecov/example-next-app-client-array-push 894.72kB 446 bytes :arrow_up:
@codecov/example-webpack-app-array-push 71.19kB 0 bytes
@codecov/nuxt-plugin-esm 855 bytes 0 bytes
@codecov/vite-plugin-cjs 2.92kB 0 bytes
@codecov/webpack-plugin-esm 1.44kB 156 bytes :arrow_up:
@codecov/sveltekit-plugin-esm 909 bytes 909 bytes :arrow_up:
@codecov/vite-plugin-esm 1.26kB 153 bytes :arrow_up:
@codecov/bundler-plugin-core-cjs 41.95kB 0 bytes
@codecov/example-next-app-server-cjs 325.72kB 131 bytes :arrow_up:
@codecov/example-next-app-edge-server-array-push 306 bytes 0 bytes
@codecov/example-rollup-app-iife (removed) 95.45kB :arrow_down:
@codecov/example-vite-app-esm (removed) 150.61kB :arrow_down:
@codecov/nuxt-plugin-cjs (removed) 1.38kB :arrow_down:
codecov-notifications[bot] commented 1 month ago

Codecov Report

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

:white_check_mark: All tests successful. No failed tests found.

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

:loudspeaker: Thoughts on this report? Let us know!