diff --git a/.changeset/eleven-deers-divide.md b/.changeset/eleven-deers-divide.md index 3dbcd675..64093b4d 100644 --- a/.changeset/eleven-deers-divide.md +++ b/.changeset/eleven-deers-divide.md @@ -1,5 +1,5 @@ --- -"@codecov/standalone-analyzer": minor +"@codecov/bundle-analyzer": minor --- -Add support for no-bundler through new Standalone Analyzer library and CLI +Add support for no-bundler through new Bundle Analyzer library and CLI diff --git a/.eslintrc.js b/.eslintrc.js index c965922e..e9968f23 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -33,7 +33,7 @@ const config = { "./packages/remix-vite-plugin/tsconfig.json", "./packages/rollup-plugin/tsconfig.json", "./packages/solidstart-plugin/tsconfig.json", - "./packages/standalone-analyzer/tsconfig.json", + "./packages/bundle-analyzer/tsconfig.json", "./packages/sveltekit-plugin/tsconfig.json", "./packages/vite-plugin/tsconfig.json", "./packages/webpack-plugin/tsconfig.json", diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 623833ca..6fae1a70 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -349,8 +349,8 @@ jobs: ROLLUP_API_URL: ${{ secrets.CODECOV_API_URL }} SOLIDSTART_UPLOAD_TOKEN: ${{ secrets.CODECOV_ORG_TOKEN }} SOLIDSTART_API_URL: ${{ secrets.CODECOV_API_URL }} - STANDALONE_UPLOAD_TOKEN: ${{ secrets.CODECOV_ORG_TOKEN }} - STANDALONE_API_URL: ${{ secrets.CODECOV_API_URL }} + BUNDLE_ANALYZER_UPLOAD_TOKEN: ${{ secrets.CODECOV_ORG_TOKEN }} + BUNDLE_ANALYZER_API_URL: ${{ secrets.CODECOV_API_URL }} SVELTEKIT_UPLOAD_TOKEN: ${{ secrets.CODECOV_ORG_TOKEN }} SVELTEKIT_API_URL: ${{ secrets.CODECOV_API_URL }} VITE_UPLOAD_TOKEN: ${{ secrets.CODECOV_ORG_TOKEN }} @@ -438,8 +438,8 @@ jobs: ROLLUP_API_URL: ${{ secrets.CODECOV_STAGING_API_URL }} SOLIDSTART_UPLOAD_TOKEN: ${{ secrets.CODECOV_ORG_TOKEN }} SOLIDSTART_API_URL: ${{ secrets.CODECOV_API_URL }} - STANDALONE_UPLOAD_TOKEN: ${{ secrets.CODECOV_ORG_TOKEN }} - STANDALONE_API_URL: ${{ secrets.CODECOV_API_URL }} + BUNDLE_ANALYZER_UPLOAD_TOKEN: ${{ secrets.CODECOV_ORG_TOKEN }} + BUNDLE_ANALYZER_API_URL: ${{ secrets.CODECOV_API_URL }} SVELTEKIT_UPLOAD_TOKEN: ${{ secrets.CODECOV_ORG_TOKEN }} SVELTEKIT_API_URL: ${{ secrets.CODECOV_API_URL }} VITE_UPLOAD_TOKEN: ${{ secrets.CODECOV_ORG_TOKEN_STAGING }} @@ -468,7 +468,7 @@ jobs: "vite-plugin", "webpack-plugin", "solidstart-plugin", - "standalone-analyzer" + "bundle-analyzer", ] steps: - name: Checkout @@ -537,7 +537,7 @@ jobs: "vite-plugin", "webpack-plugin", "solidstart-plugin", - "standalone-analyzer", + "bundle-analyzer", ] steps: - name: Checkout diff --git a/examples/standalone/cli/README.md b/examples/standalone/cli/README.md index e30a3ccd..3fa9fb77 100644 --- a/examples/standalone/cli/README.md +++ b/examples/standalone/cli/README.md @@ -1,15 +1,15 @@ -# Standalone Analyzer CLI Example +# Bundle Analyzer CLI Example -This directory includes an example calling the Codecov CLI for bundle analysis using the standalone-analyzer. +This directory includes an example calling the Codecov CLI for bundle analysis using the bundle-analyzer. To run: ``` -cd packages/standalone-analyzer +cd packages/bundle-analyzer pnpm install pnpm run build -cd examples/standalone/cli +cd examples/bundle-analyzer/cli pnpm install pnpm run build pnpm run analyze @@ -20,11 +20,11 @@ This will call the CLI. Note a Codecov API server (e.g., that at `test-api`) nee For example: ``` -pnpm standalone-analyzer ./dist --bundle-name=test-cli --upload-token=abcd --dry-run +pnpm bundle-analyzer ./dist --bundle-name=test-cli --upload-token=abcd --dry-run ``` Generates a bundle stats report and prints to console: ``` -{"version":"2","builtAt":1725365190149,"duration":7,"bundleName":"test-cli","plugin":{"name":"@codecov/standalone-analyzer","version":"0.0.1-beta.12"},"assets":[{"name":"main.js","size":511,"gzipSize":301,"normalized":"main.js"},{"name":"main.js.map","size":732,"gzipSize":null,"normalized":"main.js.map"}],"chunks":[],"modules":[]} +{"version":"2","builtAt":1725365190149,"duration":7,"bundleName":"test-cli","plugin":{"name":"@codecov/bundle-analyzer","version":"0.0.1-beta.12"},"assets":[{"name":"main.js","size":511,"gzipSize":301,"normalized":"main.js"},{"name":"main.js.map","size":732,"gzipSize":null,"normalized":"main.js.map"}],"chunks":[],"modules":[]} ``` diff --git a/examples/standalone/cli/package.json b/examples/standalone/cli/package.json index 437c366f..98b01603 100644 --- a/examples/standalone/cli/package.json +++ b/examples/standalone/cli/package.json @@ -1,5 +1,5 @@ { - "name": "@codecov/example-standalone-analyzer-cli", + "name": "@codecov/example-bundle-analyzer-cli", "version": "1.0.0", "private": true, "main": "src/main.js", @@ -18,10 +18,10 @@ }, "scripts": { "build": "rollup -c", - "analyze": "pnpm standalone-analyzer ./dist --bundle-name=test-cli --upload-token=abcd --dry-run" + "analyze": "pnpm bundle-analyzer ./dist --bundle-name=test-cli --upload-token=abcd --dry-run" }, "devDependencies": { - "@codecov/standalone-analyzer": "workspace:^", + "@codecov/bundle-analyzer": "workspace:^", "@codecov/rollup-plugin": "workspace:^", "@rollup/plugin-commonjs": "^25.0.7", "@rollup/plugin-node-resolve": "^15.2.3", diff --git a/examples/standalone/library-import-cjs/README.md b/examples/standalone/library-import-cjs/README.md index 9b96e083..478a8541 100644 --- a/examples/standalone/library-import-cjs/README.md +++ b/examples/standalone/library-import-cjs/README.md @@ -1,6 +1,6 @@ -# Standalone Analyzer Library Import (CJS) Example +# Bundle Analyzer Library Import (CJS) Example -This directory includes an example calling the standalone-analyzer exported library for bundle analysis. +This directory includes an example calling the bundle-analyzer exported library for bundle analysis. This example runs in a CJS environment. @@ -8,17 +8,17 @@ To run: ``` # build the library -cd packages/standalone-analyzer +cd packages/bundle-analyzer pnpm install pnpm run build # create an example build to analyze -cd examples/standalone/cli +cd examples/bundle-analyzer/cli pnpm install pnpm run build # run the node program -cd examples/standalone/library-import +cd examples/bundle-analyzer/library-import pnpm install pnpm run start ``` @@ -34,6 +34,6 @@ pnpm run start Generates a bundle stats report and prints to console: ``` -Dry run output: {"version":"2","builtAt":1725381817642,"duration":6,"bundleName":"my-bundle","plugin":{"name":"@codecov/standalone-analyzer","version":"0.0.1-beta.12"},"assets":[{"name":"main.js","size":511,"gzipSize":301,"normalized":"main.js"},{"name":"main.js.map","size":732,"gzipSize":null,"normalized":"main.js.map"}],"chunks":[],"modules":[]} +Dry run output: {"version":"2","builtAt":1725381817642,"duration":6,"bundleName":"my-bundle","plugin":{"name":"@codecov/bundle-analyzer","version":"0.0.1-beta.12"},"assets":[{"name":"main.js","size":511,"gzipSize":301,"normalized":"main.js"},{"name":"main.js.map","size":732,"gzipSize":null,"normalized":"main.js.map"}],"chunks":[],"modules":[]} Report successfully generated and uploaded. ``` diff --git a/examples/standalone/library-import-cjs/analyze.js b/examples/standalone/library-import-cjs/analyze.js index e6c8f22d..e40faa91 100644 --- a/examples/standalone/library-import-cjs/analyze.js +++ b/examples/standalone/library-import-cjs/analyze.js @@ -1,6 +1,6 @@ -const { createAndUploadReport } = require("@codecov/standalone-analyzer"); +const { createAndUploadReport } = require("@codecov/bundle-analyzer"); -const buildDir = "../../../examples/standalone/cli/dist"; +const buildDir = "../../../examples/bundle-analyzer/cli/dist"; const coreOpts = { dryRun: true, @@ -12,11 +12,11 @@ const coreOpts = { debug: true, }; -const standaloneOpts = { +const bundleAnalyzerOpts = { beforeReportUpload: async (original) => original, }; -createAndUploadReport(buildDir, coreOpts, standaloneOpts) +createAndUploadReport(buildDir, coreOpts, bundleAnalyzerOpts) .then((reportAsJson) => console.log(`Report successfully generated and uploaded: ${reportAsJson}`), ) diff --git a/examples/standalone/library-import-cjs/package.json b/examples/standalone/library-import-cjs/package.json index 3ca5f61f..42b09575 100644 --- a/examples/standalone/library-import-cjs/package.json +++ b/examples/standalone/library-import-cjs/package.json @@ -1,5 +1,5 @@ { - "name": "@codecov/example-standalone-analyzer-library", + "name": "@codecov/example-bundle-analyzer-library-cjs", "version": "1.0.0", "private": true, "main": "analyze.js", @@ -7,7 +7,7 @@ "start": "node analyze.js" }, "devDependencies": { - "@codecov/standalone-analyzer": "workspace:^" + "@codecov/bundle-analyzer": "workspace:^" }, "volta": { "extends": "../../package.json" diff --git a/examples/standalone/library-import-esm/README.md b/examples/standalone/library-import-esm/README.md index 5b0c9c04..42786905 100644 --- a/examples/standalone/library-import-esm/README.md +++ b/examples/standalone/library-import-esm/README.md @@ -1,6 +1,6 @@ -# Standalone Analyzer Library Import (ESM) Example +# Bundle Analyzer Library Import (ESM) Example -This directory includes an example calling the standalone-analyzer exported library for bundle analysis. +This directory includes an example calling the bundle-analyzer exported library for bundle analysis. This example runs in an ESM environment. @@ -8,17 +8,17 @@ To run: ``` # build the library -cd packages/standalone-analyzer +cd packages/bundle-analyzer pnpm install pnpm run build # create an example build to analyze -cd examples/standalone/cli +cd examples/bundle-analyzer/cli pnpm install pnpm run build # run the node program -cd examples/standalone/library-import +cd examples/bundle-analyzer/library-import pnpm install pnpm run start ``` @@ -34,6 +34,6 @@ pnpm run start Generates a bundle stats report and prints to console: ``` -Dry run output: {"version":"2","builtAt":1725381817642,"duration":6,"bundleName":"my-bundle","plugin":{"name":"@codecov/standalone-analyzer","version":"0.0.1-beta.12"},"assets":[{"name":"main.js","size":511,"gzipSize":301,"normalized":"main.js"},{"name":"main.js.map","size":732,"gzipSize":null,"normalized":"main.js.map"}],"chunks":[],"modules":[]} +Dry run output: {"version":"2","builtAt":1725381817642,"duration":6,"bundleName":"my-bundle","plugin":{"name":"@codecov/bundle-analyzer","version":"0.0.1-beta.12"},"assets":[{"name":"main.js","size":511,"gzipSize":301,"normalized":"main.js"},{"name":"main.js.map","size":732,"gzipSize":null,"normalized":"main.js.map"}],"chunks":[],"modules":[]} Report successfully generated and uploaded. ``` diff --git a/examples/standalone/library-import-esm/analyze.js b/examples/standalone/library-import-esm/analyze.js index 4caec6a4..f6e014ea 100644 --- a/examples/standalone/library-import-esm/analyze.js +++ b/examples/standalone/library-import-esm/analyze.js @@ -1,6 +1,6 @@ -import { createAndUploadReport } from "@codecov/standalone-analyzer"; +import { createAndUploadReport } from "@codecov/bundle-analyzer"; -const buildDir = "../../../examples/standalone/cli/dist"; +const buildDir = "../../../examples/bundle-analyzer/cli/dist"; const coreOpts = { dryRun: true, @@ -12,11 +12,11 @@ const coreOpts = { debug: true, }; -const standaloneOpts = { +const bundleAnalyzerOpts = { reportOverrider: async (original) => original, }; -createAndUploadReport(buildDir, coreOpts, standaloneOpts) +createAndUploadReport(buildDir, coreOpts, bundleAnalyzerOpts) .then((reportAsJson) => console.log(`Report successfully generated and uploaded: ${reportAsJson}`), ) diff --git a/examples/standalone/library-import-esm/package.json b/examples/standalone/library-import-esm/package.json index f2e84f3d..5a80f2e6 100644 --- a/examples/standalone/library-import-esm/package.json +++ b/examples/standalone/library-import-esm/package.json @@ -1,5 +1,5 @@ { - "name": "@codecov/example-standalone-analyzer-library", + "name": "@codecov/example-bundle-analyzer-library-mjs", "version": "1.0.0", "private": true, "main": "analyze.js", @@ -8,7 +8,7 @@ "start": "node analyze.js" }, "devDependencies": { - "@codecov/standalone-analyzer": "workspace:^" + "@codecov/bundle-analyzer": "workspace:^" }, "volta": { "extends": "../../package.json" diff --git a/integration-tests/fixtures/generate-bundle-stats/standalone/dotenv-vercel/__snapshots__/standalone-analyzer.test.ts.snap b/integration-tests/fixtures/generate-bundle-stats/bundle-analyzer/dotenv-vercel/__snapshots__/bundle-analyzer.test.ts.snap similarity index 57% rename from integration-tests/fixtures/generate-bundle-stats/standalone/dotenv-vercel/__snapshots__/standalone-analyzer.test.ts.snap rename to integration-tests/fixtures/generate-bundle-stats/bundle-analyzer/dotenv-vercel/__snapshots__/bundle-analyzer.test.ts.snap index d9509b22..30711ed8 100644 --- a/integration-tests/fixtures/generate-bundle-stats/standalone/dotenv-vercel/__snapshots__/standalone-analyzer.test.ts.snap +++ b/integration-tests/fixtures/generate-bundle-stats/bundle-analyzer/dotenv-vercel/__snapshots__/bundle-analyzer.test.ts.snap @@ -1,15 +1,15 @@ // Bun Snapshot v1, https://goo.gl/fbAQLP -exports[`Standalone Analyzer Integration Tests should generate a report and match the snapshot 1`] = ` +exports[`Bundle Analyzer Integration Tests should generate a report and match the snapshot 1`] = ` { "assets": ExpectArrayContaining {}, "builtAt": Any, - "bundleName": StringContaining "standalone", + "bundleName": StringContaining "bundle-analyzer", "chunks": ExpectArrayContaining {}, "duration": Any, "modules": ExpectArrayContaining {}, "plugin": { - "name": StringMatching "@codecov/standalone-analyzer", + "name": StringMatching "@codecov/bundle-analyzer", "version": Any, }, "version": "2", diff --git a/integration-tests/fixtures/generate-bundle-stats/standalone/dotenv-vercel/standalone-analyzer.test.ts b/integration-tests/fixtures/generate-bundle-stats/bundle-analyzer/dotenv-vercel/bundle-analyzer.test.ts similarity index 71% rename from integration-tests/fixtures/generate-bundle-stats/standalone/dotenv-vercel/standalone-analyzer.test.ts rename to integration-tests/fixtures/generate-bundle-stats/bundle-analyzer/dotenv-vercel/bundle-analyzer.test.ts index 12c8e23c..5e783182 100644 --- a/integration-tests/fixtures/generate-bundle-stats/standalone/dotenv-vercel/standalone-analyzer.test.ts +++ b/integration-tests/fixtures/generate-bundle-stats/bundle-analyzer/dotenv-vercel/bundle-analyzer.test.ts @@ -2,10 +2,10 @@ import { $ } from "bun"; import { describe, it, expect, afterEach, beforeEach } from "bun:test"; -const standaloneAnalyzerApp = "test-apps/standalone/dotenv-vercel"; -const BUILD_DIR = `${standaloneAnalyzerApp}/build`; +const bundleAnalyzerApp = "test-apps/bundle-analyzer/dotenv-vercel"; +const BUILD_DIR = `${bundleAnalyzerApp}/build`; -describe("Standalone Analyzer Integration Tests", () => { +describe("Bundle Analyzer Integration Tests", () => { beforeEach(async () => { await $`rm -rf ${BUILD_DIR}`; await $`mkdir -p ${BUILD_DIR}`; @@ -16,13 +16,13 @@ describe("Standalone Analyzer Integration Tests", () => { }); it("should generate a report and match the snapshot", async () => { - const id = `standalone-analyzer-${Date.now()}`; + const id = `bundle-analyzer-${Date.now()}`; const API_URL = `http://localhost:8000/test-url/${id}/200/false`; // prepare, build, and run - await $`cd ${standaloneAnalyzerApp} && pnpm run build`; + await $`cd ${bundleAnalyzerApp} && pnpm run build`; const { stdout, stderr } = - await $`cd ${standaloneAnalyzerApp} && API_URL=${API_URL} pnpm run analyze`; + await $`cd ${bundleAnalyzerApp} && API_URL=${API_URL} pnpm run analyze`; expect(stdout.toString()).toContain( "Report successfully generated and uploaded", @@ -31,7 +31,7 @@ describe("Standalone Analyzer Integration Tests", () => { // fetch stats from the server const res = await fetch( - `http://localhost:8000/get-stats-by-bundle-name/${id}/standalone`, + `http://localhost:8000/get-stats-by-bundle-name/${id}/bundle-analyzer`, ); const data = (await res.json()) as { stats: string }; const stats = JSON.parse(data.stats) as unknown; @@ -40,9 +40,9 @@ describe("Standalone Analyzer Integration Tests", () => { expect(stats).toMatchSnapshot({ builtAt: expect.any(Number), duration: expect.any(Number), - bundleName: expect.stringContaining("standalone"), + bundleName: expect.stringContaining("bundle-analyzer"), plugin: { - name: expect.stringMatching("@codecov/standalone-analyzer"), + name: expect.stringMatching("@codecov/bundle-analyzer"), version: expect.any(String), }, assets: expect.arrayContaining([ diff --git a/integration-tests/package.json b/integration-tests/package.json index 74425f3b..2605ada4 100644 --- a/integration-tests/package.json +++ b/integration-tests/package.json @@ -16,7 +16,7 @@ "test:e2e:vite": "bun test fixtures/**/vite/*", "test:e2e:webpack": "bun test fixtures/**/webpack/*", "test:e2e:solidstart": "bun test fixtures/**/solidstart/*", - "test:e2e:standalone": "bun test fixtures/**/standalone/*", + "test:e2e:bundle-analyzer": "bun test fixtures/**/bundle-analyzer/*", "type-check": "tsc --noEmit", "clean": "rm -rf node_modules", "lint": "eslint . --ext .ts,.tsx", @@ -35,7 +35,7 @@ "@codecov/remix-vite-plugin": "workspace:^", "@codecov/rollup-plugin": "workspace:^", "@codecov/solidstart-plugin": "workspace:^", - "@codecov/standalone-analyzer": "workspace:^", + "@codecov/bundle-analyzer": "workspace:^", "@codecov/sveltekit-plugin": "workspace:^", "@codecov/vite-plugin": "workspace:^", "@codecov/webpack-plugin": "workspace:^", diff --git a/integration-tests/test-apps/standalone/dotenv-vercel/.env.vault b/integration-tests/test-apps/bundle-analyzer/dotenv-vercel/.env.vault similarity index 100% rename from integration-tests/test-apps/standalone/dotenv-vercel/.env.vault rename to integration-tests/test-apps/bundle-analyzer/dotenv-vercel/.env.vault diff --git a/integration-tests/test-apps/standalone/dotenv-vercel/.gitignore b/integration-tests/test-apps/bundle-analyzer/dotenv-vercel/.gitignore similarity index 100% rename from integration-tests/test-apps/standalone/dotenv-vercel/.gitignore rename to integration-tests/test-apps/bundle-analyzer/dotenv-vercel/.gitignore diff --git a/integration-tests/test-apps/standalone/dotenv-vercel/.vercelignore b/integration-tests/test-apps/bundle-analyzer/dotenv-vercel/.vercelignore similarity index 100% rename from integration-tests/test-apps/standalone/dotenv-vercel/.vercelignore rename to integration-tests/test-apps/bundle-analyzer/dotenv-vercel/.vercelignore diff --git a/integration-tests/test-apps/bundle-analyzer/dotenv-vercel/README.md b/integration-tests/test-apps/bundle-analyzer/dotenv-vercel/README.md new file mode 100644 index 00000000..d62925c2 --- /dev/null +++ b/integration-tests/test-apps/bundle-analyzer/dotenv-vercel/README.md @@ -0,0 +1,5 @@ +# dotenv-vercel + +This directory "bundle-analyzer" contains an example app on dotenv vite vercel. It generates a build directory at `dist` which we can analyze for stats and upload to Codecov Bundle Analysis. + +Example app is from [dotenv.org/docs/frameworks/vite/vercel](https://www.dotenv.org/docs/frameworks/vite/vercel) diff --git a/integration-tests/test-apps/standalone/dotenv-vercel/analyze.js b/integration-tests/test-apps/bundle-analyzer/dotenv-vercel/analyze.js similarity index 65% rename from integration-tests/test-apps/standalone/dotenv-vercel/analyze.js rename to integration-tests/test-apps/bundle-analyzer/dotenv-vercel/analyze.js index ad1f301c..ee20f4ae 100644 --- a/integration-tests/test-apps/standalone/dotenv-vercel/analyze.js +++ b/integration-tests/test-apps/bundle-analyzer/dotenv-vercel/analyze.js @@ -1,7 +1,7 @@ -import { createAndUploadReport } from "@codecov/standalone-analyzer"; +import { createAndUploadReport } from "@codecov/bundle-analyzer"; const buildDir = - "../../../integration-tests/test-apps/standalone/dotenv-vercel/dist"; + "../../../integration-tests/test-apps/bundle-analyzer/dotenv-vercel/dist"; const apiUrl = process.env.API_URL || "https://api.codecov.io"; @@ -10,16 +10,16 @@ const coreOpts = { uploadToken: "your-upload-token", retryCount: 3, apiUrl: apiUrl, - bundleName: "standalone", + bundleName: "bundle-analyzer", enableBundleAnalysis: true, debug: true, }; -const standaloneOpts = { +const bundleAnalyzerOpts = { beforeReportUpload: async (original) => original, }; -createAndUploadReport(buildDir, coreOpts, standaloneOpts) +createAndUploadReport(buildDir, coreOpts, bundleAnalyzerOpts) .then((reportAsJson) => console.log(`Report successfully generated and uploaded: ${reportAsJson}`), ) diff --git a/integration-tests/test-apps/standalone/dotenv-vercel/index.html b/integration-tests/test-apps/bundle-analyzer/dotenv-vercel/index.html similarity index 100% rename from integration-tests/test-apps/standalone/dotenv-vercel/index.html rename to integration-tests/test-apps/bundle-analyzer/dotenv-vercel/index.html diff --git a/integration-tests/test-apps/standalone/dotenv-vercel/package.json b/integration-tests/test-apps/bundle-analyzer/dotenv-vercel/package.json similarity index 81% rename from integration-tests/test-apps/standalone/dotenv-vercel/package.json rename to integration-tests/test-apps/bundle-analyzer/dotenv-vercel/package.json index c4632b37..d41f9ac5 100644 --- a/integration-tests/test-apps/standalone/dotenv-vercel/package.json +++ b/integration-tests/test-apps/bundle-analyzer/dotenv-vercel/package.json @@ -1,5 +1,5 @@ { - "name": "test-apps-standalone-dotenv-vercel", + "name": "test-apps-bundle-dotenv-vercel", "private": true, "version": "0.0.0", "type": "module", @@ -10,7 +10,7 @@ "analyze": "node analyze.js" }, "devDependencies": { - "@codecov/standalone-analyzer": "workspace:^", + "@codecov/bundle-analyzer": "workspace:^", "dotenv": "^16.4.5", "typescript": "^5.0.2", "vite": "^4.4.5" diff --git a/integration-tests/test-apps/standalone/dotenv-vercel/src/counter.ts b/integration-tests/test-apps/bundle-analyzer/dotenv-vercel/src/counter.ts similarity index 100% rename from integration-tests/test-apps/standalone/dotenv-vercel/src/counter.ts rename to integration-tests/test-apps/bundle-analyzer/dotenv-vercel/src/counter.ts diff --git a/integration-tests/test-apps/standalone/dotenv-vercel/src/main.ts b/integration-tests/test-apps/bundle-analyzer/dotenv-vercel/src/main.ts similarity index 100% rename from integration-tests/test-apps/standalone/dotenv-vercel/src/main.ts rename to integration-tests/test-apps/bundle-analyzer/dotenv-vercel/src/main.ts diff --git a/integration-tests/test-apps/standalone/dotenv-vercel/src/style.css b/integration-tests/test-apps/bundle-analyzer/dotenv-vercel/src/style.css similarity index 100% rename from integration-tests/test-apps/standalone/dotenv-vercel/src/style.css rename to integration-tests/test-apps/bundle-analyzer/dotenv-vercel/src/style.css diff --git a/integration-tests/test-apps/standalone/dotenv-vercel/src/typescript.svg b/integration-tests/test-apps/bundle-analyzer/dotenv-vercel/src/typescript.svg similarity index 100% rename from integration-tests/test-apps/standalone/dotenv-vercel/src/typescript.svg rename to integration-tests/test-apps/bundle-analyzer/dotenv-vercel/src/typescript.svg diff --git a/integration-tests/test-apps/standalone/dotenv-vercel/src/vite-env.d.ts b/integration-tests/test-apps/bundle-analyzer/dotenv-vercel/src/vite-env.d.ts similarity index 100% rename from integration-tests/test-apps/standalone/dotenv-vercel/src/vite-env.d.ts rename to integration-tests/test-apps/bundle-analyzer/dotenv-vercel/src/vite-env.d.ts diff --git a/integration-tests/test-apps/standalone/dotenv-vercel/tsconfig.json b/integration-tests/test-apps/bundle-analyzer/dotenv-vercel/tsconfig.json similarity index 100% rename from integration-tests/test-apps/standalone/dotenv-vercel/tsconfig.json rename to integration-tests/test-apps/bundle-analyzer/dotenv-vercel/tsconfig.json diff --git a/integration-tests/test-apps/nuxt/nuxt.config.ts b/integration-tests/test-apps/nuxt/nuxt.config.ts new file mode 100644 index 00000000..a5710864 --- /dev/null +++ b/integration-tests/test-apps/nuxt/nuxt.config.ts @@ -0,0 +1,30 @@ +import { defineNuxtConfig } from "nuxt/config"; + +const config: ReturnType = defineNuxtConfig({ + buildDir: `distV3`, + ssr: true, + modules: [ + [ + "@codecov/nuxt-plugin", + { + enableBundleAnalysis: true, + bundleName: "test-nuxt-v3", + uploadToken: "test-token", + apiUrl: process.env.API_URL, + }, + ], + ], + vite: { + clearScreen: false, + build: { + sourcemap: false, + rollupOptions: { + output: { + format: "systemjs", + }, + }, + }, + }, +}); + +export default config; diff --git a/integration-tests/test-apps/nuxt/package.json b/integration-tests/test-apps/nuxt/package.json index 913bba41..95ac1101 100644 --- a/integration-tests/test-apps/nuxt/package.json +++ b/integration-tests/test-apps/nuxt/package.json @@ -9,7 +9,7 @@ "preview": "nuxt preview" }, "dependencies": { - "nuxt": "^3.11.2", + "nuxt": "^3.12.4", "vue": "^3.4.21", "vue-router": "^4.3.0" }, diff --git a/integration-tests/test-apps/standalone/dotenv-vercel/README.md b/integration-tests/test-apps/standalone/dotenv-vercel/README.md deleted file mode 100644 index df1e6001..00000000 --- a/integration-tests/test-apps/standalone/dotenv-vercel/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# dotenv-vercel - -This directory "standalone" contains an example app on dotenv vite vercel. It generates a build directory at `dist` which we can analyze for stats and upload to Codecov Bundle Analysis. - -Example app is from [dotenv.org/docs/frameworks/vite/vercel](https://www.dotenv.org/docs/frameworks/vite/vercel) diff --git a/packages/standalone-analyzer/LICENSE b/packages/standalone-analyzer/LICENSE deleted file mode 100644 index fe71fb91..00000000 --- a/packages/standalone-analyzer/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2023-2024 Codecov - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/packages/standalone-analyzer/README.md b/packages/standalone-analyzer/README.md deleted file mode 100644 index b60dc7ca..00000000 --- a/packages/standalone-analyzer/README.md +++ /dev/null @@ -1,79 +0,0 @@ -

- - Codecov by Sentry logo - -

- -# Codecov Standalone Analyzer - -> [!WARNING] -> These plugins are currently in beta and are subject to change. -> -> An importable library + CLI for Codecov bundle analysis support. -> -> The plugin does not support code coverage, see our [docs](https://docs.codecov.com/docs/quick-start) to set up coverage today! - -## Installation - -Using npm: - -```bash -npm install @codecov/standalone-analyzer --save-dev -``` - -Using yarn: - -```bash -yarn add @codecov/standalone-analyzer --dev -``` - -Using pnpm: - -```bash -pnpm add @codecov/standalone-analyzer --save-dev -``` - -## Example - -This example shows how the package can be imported as a library. - -```js -// analyze.js -import { createAndUploadReport } from "@codecov/standalone-analyzer"; - -const buildDir = "path/to/build"; - -const coreOpts = { - dryRun: false, - uploadToken: "your-upload-token", - retryCount: 3, - apiUrl: "https://localhost:3000", - bundleName: "my-bundle", // bundle identifier in Codecov - enableBundleAnalysis: true, - debug: true, -}; - -const standaloneOpts = { - beforeReportUpload: async (original) => original, -}; - -createAndUploadReport(buildDir, coreOpts, standaloneOpts) - .then((reportAsJson) => - console.log(`Report successfully generated and uploaded: ${reportAsJson}`), - ) - .catch((error) => - console.error("Failed to generate or upload report:", error), - ); -``` - -This example shows how the package can be used as a CLI. - -``` -npx @codecov/standalone-analyzer ./dist --bundle-name=test-cli --upload-token=abcd --dry-run -``` - -## More information - -- [Codecov Documentation](https://docs.codecov.com/docs) -- [Codecov Feedback](https://github.com/codecov/feedback/discussions) -- [Sentry Discord](https://discord.gg/Ww9hbqr) diff --git a/packages/standalone-analyzer/build.config.ts b/packages/standalone-analyzer/build.config.ts deleted file mode 100644 index ae0f7572..00000000 --- a/packages/standalone-analyzer/build.config.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { defineBuildConfig } from "unbuild"; -import { codecovRollupPlugin } from "codecovProdRollupPlugin"; -import packageJson from "./package.json"; - -// This file defines the Rollup configuration used by "unbuild" to bundle -// the standalone-analyzer package -export default defineBuildConfig({ - // We build with 2 entrypoints - one for the library and one for the CLI - entries: ["./src/index.ts", "./src/cli.ts"], - outDir: "dist", - declaration: "compatible", - sourcemap: true, - rollup: { - dts: { - compilerOptions: { - removeComments: false, - }, - }, - emitCJS: true, - esbuild: { - minify: true, - }, - replace: { - preventAssignment: true, - values: { - // We pull into environment variables the package version and name - // which get written to the bundle stats report - __PACKAGE_VERSION__: JSON.stringify(packageJson.version), - __PACKAGE_NAME__: JSON.stringify(packageJson.name), - }, - }, - }, - hooks: { - "rollup:options": (_ctx, opts) => { - if (process.env.PLUGIN_CODECOV_TOKEN && Array.isArray(opts.plugins)) { - // eslint-disable-next-line @typescript-eslint/no-unsafe-call - opts.plugins = [ - ...opts.plugins, - // We analyze this standalone-analyzer package's build - // using the codecov rollup plugin - codecovRollupPlugin({ - enableBundleAnalysis: - typeof process.env.PLUGIN_CODECOV_TOKEN === "string", - bundleName: packageJson.name, - uploadToken: process.env.PLUGIN_CODECOV_TOKEN, - apiUrl: process.env.PLUGIN_CODECOV_API_URL, - }), - ]; - } - }, - }, -}); diff --git a/packages/standalone-analyzer/package.json b/packages/standalone-analyzer/package.json deleted file mode 100644 index 6163ad8e..00000000 --- a/packages/standalone-analyzer/package.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "name": "@codecov/standalone-analyzer", - "version": "0.0.1-beta.12", - "description": "Official Codecov Standalone Bundle Analyzer", - "author": "Codecov", - "license": "MIT", - "keywords": [ - "Codecov", - "standalone", - "bundler", - "analyzer" - ], - "type": "module", - "bin": { - "standalone-analyzer": "./dist/cli.cjs" - }, - "exports": { - ".": { - "import": { - "types": "./dist/index.d.mts", - "default": "./dist/index.mjs" - }, - "require": { - "types": "./dist/index.d.ts", - "default": "./dist/index.cjs" - } - } - }, - "main": "./dist/index.cjs", - "module": "./dist/index.mjs", - "types": "./dist/index.d.ts", - "files": [ - "dist" - ], - "scripts": { - "type-check": "tsc --noEmit", - "build": "unbuild", - "dev": "unbuild --stub && node --watch-path=src dist/index.mjs", - "clean": "rm -rf dist node_modules", - "lint": "eslint . --ext .ts,.tsx", - "lint:fix": "pnpm lint --fix", - "format": "prettier '**/*.{cjs,mjs,ts,tsx,md,json}' --ignore-path ../.gitignore --ignore-unknown --no-error-on-unmatched-pattern --write", - "format:check": "prettier '**/*.{cjs,mjs,ts,tsx,md,json}' --ignore-path ../.gitignore --ignore-unknown --no-error-on-unmatched-pattern --check", - "test:unit": "vitest run", - "test:unit:watch": "vitest watch", - "test:unit:ci": "vitest --coverage --reporter=junit --outputFile=./standalone-analyzer.junit.xml run", - "test:unit:update": "vitest -u run", - "generate:typedoc": "typedoc --options ./typedoc.json" - }, - "dependencies": { - "@codecov/bundler-plugin-core": "workspace:^", - "yargs": "^17.7.2" - }, - "devDependencies": { - "@rollup/plugin-replace": "^5.0.5", - "@types/node": "^20.11.15", - "@types/yargs": "^17.0.33", - "@vitest/coverage-v8": "^1.5.0", - "codecovProdRollupPlugin": "npm:@codecov/rollup-plugin@0.0.1-beta.5", - "msw": "^2.1.5", - "ts-node": "^10.9.2", - "typedoc": "^0.25.12", - "typescript": "^5.3.3", - "unbuild": "^2.0.0", - "vite": "^5.2.10", - "vite-tsconfig-paths": "^4.3.2", - "vitest": "^1.5.0" - }, - "volta": { - "extends": "../../package.json" - }, - "engines": { - "node": ">=18.0.0" - } -} diff --git a/packages/standalone-analyzer/src/assets.test.ts b/packages/standalone-analyzer/src/assets.test.ts deleted file mode 100644 index da1a67f6..00000000 --- a/packages/standalone-analyzer/src/assets.test.ts +++ /dev/null @@ -1,166 +0,0 @@ -import { - describe, - it, - expect, - vi, - beforeEach, - type Mock, - afterEach, -} from "vitest"; -import path from "node:path"; -import fs from "node:fs/promises"; -import { getAssets, getAsset, listChildFilePaths } from "./assets"; -import { getCompressedSize, normalizePath } from "@codecov/bundler-plugin-core"; -import { fileURLToPath } from "url"; - -vi.mock("node:fs/promises"); -vi.mock("@codecov/bundler-plugin-core", () => ({ - getCompressedSize: vi.fn(), - normalizePath: vi.fn(), -})); - -describe("getAssets", () => { - const mockFileContents = Buffer.from("mock file content"); - const mockCompressedSize = 100; - const mockNormalizedName = "file-*.js"; - - beforeEach(() => { - vi.clearAllMocks(); - (fs.readdir as Mock).mockResolvedValue([]); - (fs.readFile as Mock).mockResolvedValue(mockFileContents); - (getCompressedSize as Mock).mockResolvedValue(mockCompressedSize); - (normalizePath as Mock).mockReturnValue(mockNormalizedName); - }); - - it("should get all assets from the build directory", async () => { - const mockFiles = [ - { name: "file1.js", isDirectory: () => false, isFile: () => true }, - { name: "file2.css", isDirectory: () => false, isFile: () => true }, - ]; - - (fs.readdir as Mock).mockResolvedValueOnce(mockFiles); - - const assets = await getAssets("path/to/build/directory"); - - expect(fs.readdir).toHaveBeenCalledTimes(1); - expect(getCompressedSize).toHaveBeenCalledTimes(mockFiles.length); - expect(normalizePath).toHaveBeenCalledTimes(mockFiles.length); - expect(assets).toEqual([ - { - name: "file1.js", - size: mockFileContents.byteLength, - gzipSize: mockCompressedSize, - normalized: mockNormalizedName, - }, - { - name: "file2.css", - size: mockFileContents.byteLength, - gzipSize: mockCompressedSize, - normalized: mockNormalizedName, - }, - ]); - }); -}); - -describe("getAsset", () => { - const mockFilePath = "/path/to/assets/file1.js"; - const mockParentPath = "/path/to/assets"; - const mockFileContents = Buffer.from("mock file content"); - const mockCompressedSize = 100; - const mockNormalizedName = "file-*.js"; - - beforeEach(() => { - vi.clearAllMocks(); - (fs.readFile as Mock).mockResolvedValue(mockFileContents); - (getCompressedSize as Mock).mockResolvedValue(mockCompressedSize); - (normalizePath as Mock).mockReturnValue(mockNormalizedName); - }); - - it("should create an asset for a given file", async () => { - const asset = await getAsset(mockFilePath, mockParentPath); - - expect(fs.readFile).toHaveBeenCalledWith(mockFilePath); - expect(getCompressedSize).toHaveBeenCalledWith({ - fileName: path.relative(mockParentPath, mockFilePath), - code: mockFileContents, - }); - expect(normalizePath).toHaveBeenCalledWith( - path.relative(mockParentPath, mockFilePath), - "", - ); - expect(asset).toEqual({ - name: path.relative(mockParentPath, mockFilePath), - size: mockFileContents.byteLength, - gzipSize: mockCompressedSize, - normalized: mockNormalizedName, - }); - }); -}); - -describe("listChildFilePaths", () => { - beforeEach(() => { - vi.clearAllMocks(); - }); - - it("should list all files in a directory recursively", async () => { - const mockFiles = [ - { name: "file1.js", isDirectory: () => false, isFile: () => true }, - { name: "subdir", isDirectory: () => true, isFile: () => false }, - ]; - const mockSubDirFiles = [ - { name: "file2.css", isDirectory: () => false, isFile: () => true }, - ]; - - (fs.readdir as Mock).mockResolvedValueOnce(mockFiles); - (fs.readdir as Mock).mockResolvedValueOnce(mockSubDirFiles); - - const filePaths = await listChildFilePaths("/path/to/directory"); - - expect(fs.readdir).toHaveBeenCalledTimes(2); - expect(filePaths).toEqual([ - path.join("/path/to/directory", "file1.js"), - path.join("/path/to/directory", "subdir", "file2.css"), - ]); - }); -}); - -describe("Module System Compatibility", () => { - let fileName: string; - let __dirname: string; - - const setCommonJSContext = () => { - // @ts-expect-error - ignore ts error for module cleanup - global.module = { exports: {} }; - fileName = __filename; - __dirname = path.dirname(fileName); - }; - - const setESModulesContext = () => { - // @ts-expect-error - ignore ts error for module cleanup - delete global.module; - fileName = fileURLToPath(import.meta.url); - __dirname = path.dirname(fileName); - }; - - afterEach(() => { - // clean up the global context after each test - // @ts-expect-error - ignore ts error for module cleanup - delete global.module; - }); - - it("should correctly set fileName and __dirname in CommonJS environment", () => { - setCommonJSContext(); - - // Assert that fileName and __dirname are correctly set for CommonJS - expect(fileName).toBe(__filename); - expect(__dirname).toBe(path.dirname(__filename)); - }); - - it("should correctly set fileName and __dirname in ESModules environment", () => { - setESModulesContext(); - - // Assert that fileName and __dirname are correctly set for ESModules - expect(fileName).toBe(fileURLToPath(import.meta.url)); - expect(__dirname).toBe(path.dirname(fileURLToPath(import.meta.url))); - }); -}); diff --git a/packages/standalone-analyzer/src/assets.ts b/packages/standalone-analyzer/src/assets.ts deleted file mode 100644 index 3122b46f..00000000 --- a/packages/standalone-analyzer/src/assets.ts +++ /dev/null @@ -1,79 +0,0 @@ -import path from "node:path"; -import fs from "node:fs/promises"; -import { - getCompressedSize, - normalizePath, - type Asset, -} from "@codecov/bundler-plugin-core"; -import { fileURLToPath } from "node:url"; - -// Resolve __dirname and __filename for both CommonJS and ESModules -let fileName: string; -let __dirname: string; -const isCommonJS = - typeof module !== "undefined" && module.exports !== undefined; -if (isCommonJS) { - fileName = __filename; - __dirname = path.dirname(fileName); -} else { - // ESModules environment - fileName = fileURLToPath(import.meta.url); - __dirname = path.dirname(fileName); -} - -/* getAssets gets all Assets to include in a bundle stats report */ -export const getAssets = async ( - buildDirectoryPath: string, -): Promise => { - const absoluteAssetsDir = path.resolve(__dirname, buildDirectoryPath); - const files = await listChildFilePaths(absoluteAssetsDir); - const assets: Asset[] = await Promise.all( - files.map((file) => getAsset(file, absoluteAssetsDir)), - ); - - return assets; -}; - -/* getAsset gets an Asset that can be included in a bundle stats report */ -export const getAsset = async ( - filePath: string, - parentPath: string, -): Promise => { - const fileName = path.relative(parentPath, filePath); - const fileContents = await fs.readFile(filePath); - const size = fileContents.byteLength; - const gzipSize = await getCompressedSize({ fileName, code: fileContents }); - - // This will replace anything "hashlike" with *. For example index-1dca144e.js --> index-*.js - const normalizedName = normalizePath(fileName, ""); - - return { - name: fileName, - size: size, - gzipSize: gzipSize, - normalized: normalizedName, - }; -}; - -/* listChildFilePaths lists the subdirectory file paths within a given directory path */ -export const listChildFilePaths = async ( - directoryPath: string, -): Promise => { - const results: string[] = []; - const list = await fs.readdir(directoryPath, { - withFileTypes: true, - }); - - for (const file of list) { - const fullPath = path.join(directoryPath, file.name); - - if (file.isDirectory()) { - const childPaths = await listChildFilePaths(fullPath); - childPaths.forEach((file) => results.push(file)); - } else if (file.isFile()) { - results.push(fullPath); - } - } - - return results; -}; diff --git a/packages/standalone-analyzer/src/cli.test.ts b/packages/standalone-analyzer/src/cli.test.ts deleted file mode 100644 index 55eb3a6d..00000000 --- a/packages/standalone-analyzer/src/cli.test.ts +++ /dev/null @@ -1,98 +0,0 @@ -import { describe, it, expect, vi, beforeAll, afterEach } from "vitest"; -import { execSync, execFileSync } from "node:child_process"; -import path from "node:path"; -import * as url from "node:url"; -import fs from "node:fs"; - -const runCLI = (args: string[]): string | undefined => { - const cliPath = path.resolve( - path.dirname(url.fileURLToPath(import.meta.url)), - "../dist/cli.cjs", - ); - - try { - const cmd = "node"; - const allArgs = [cliPath, ...args]; - return execFileSync(cmd, allArgs, { encoding: "utf-8" }); - } catch (error) { - // console.error("Full error:", error); // uncomment for debugging - if (error instanceof Error) { - return JSON.stringify(error); - } - - return "An unknown error occurred."; - } -}; - -describe("CLI script", () => { - beforeAll(() => { - // Ensure the build completes before tests - execSync("pnpm run build", { stdio: "inherit" }); - - // Verify that the build directory exists - const thisBuildPath = path.resolve( - path.dirname(url.fileURLToPath(import.meta.url)), - "../dist", - ); - - if (!fs.existsSync(thisBuildPath)) { - throw new Error( - "Build directory does not exist. Ensure build completes successfully.", - ); - } - }); - - afterEach(() => { - vi.clearAllMocks(); - }); - - it("should exit with an error if build directory path is missing", () => { - const output = runCLI([]); - expect(output).toContain("Error: The build directory path is required."); - }); - - it("should exit with an error if upload token is missing", () => { - const output = runCLI(["./build", "--bundle-name=someName"]); - expect(output).toContain( - "Error: An upload token is required. Provide it using --upload-token or set the CODECOV_UPLOAD_TOKEN environment variable.", - ); - }); - - it("should exit with success if upload token is in an env var", () => { - // Set token via env var - const originalToken = process.env.CODECOV_UPLOAD_TOKEN; - process.env.CODECOV_UPLOAD_TOKEN = "token123"; - - const output = runCLI(["./src", "--bundle-name=someName", "--dry-run"]); - - // Restore the original environment variable - process.env.CODECOV_UPLOAD_TOKEN = originalToken; - - expect(output).toContain( - `"bundleName":"someName","plugin":{"name":"@codecov/standalone-analyzer"`, - ); - }); - - it("should exit with success when valid inputs are provided", () => { - const output = runCLI([ - "./src", - "--bundle-name=someName", - "--upload-token=token123", - "--dry-run", - ]); - - expect(output).toContain( - `"bundleName":"someName","plugin":{"name":"@codecov/standalone-analyzer"`, - ); - }); - - it("should log an error message if the directory doesn't exist", () => { - const output = runCLI([ - "./doesnt-exist", - "--bundle-name=someName", - "--upload-token=token123", - ]); - - expect(output).toContain("An error occurred:"); - }); -}); diff --git a/packages/standalone-analyzer/src/cli.ts b/packages/standalone-analyzer/src/cli.ts deleted file mode 100644 index a6f23150..00000000 --- a/packages/standalone-analyzer/src/cli.ts +++ /dev/null @@ -1,106 +0,0 @@ -#!/usr/bin/env node - -import path from "node:path"; -import yargs from "yargs"; -import { hideBin } from "yargs/helpers"; -import { createAndUploadReport } from "./index.js"; -import { red, type Options } from "@codecov/bundler-plugin-core"; - -interface Argv { - buildDirectoryPath: string; - dryRun: boolean; - uploadToken?: string; - apiUrl: string; - bundleName?: string; - debug: boolean; -} - -const argv = yargs(hideBin(process.argv)) - .usage("Usage: $0 [options]") - .command( - "$0 ", - "Analyze and upload bundle report", - (yargs) => { - return yargs.positional("buildDirectoryPath", { - describe: "The path to the build directory", - type: "string", - demandOption: true, - }); - }, - ) - .options({ - "dry-run": { - alias: "d", - type: "boolean", - description: "Perform a dry run without uploading", - default: false, - }, - "upload-token": { - alias: "t", - type: "string", - description: "Specify the upload token for authentication", - }, - "api-url": { - alias: "a", - type: "string", - description: "Set the API URL", - default: "https://api.codecov.io", - }, - "bundle-name": { - alias: "n", - type: "string", - description: "Set the bundle identifier in Codecov", - demandOption: true, - }, - debug: { - alias: "v", - type: "boolean", - description: "Enable debug mode for additional logging", - default: false, - }, - }) - .strict() - .help("h") - .alias("h", "help") - .parseSync() as unknown as Argv; - -function prepareCoreOptions(): Options { - const uploadToken = argv.uploadToken ?? process.env.CODECOV_UPLOAD_TOKEN; - if (!uploadToken) { - throw new Error( - "An upload token is required. Use --upload-token or set the CODECOV_UPLOAD_TOKEN environment variable.", - ); - } - - return { - apiUrl: argv.apiUrl, - dryRun: argv.dryRun, - uploadToken, - bundleName: argv.bundleName ?? "", - debug: argv.debug, - }; -} - -async function runCli(): Promise { - const resolvedDirectoryPath = path.resolve( - process.cwd(), - argv.buildDirectoryPath, - ); - - const coreOptions = prepareCoreOptions(); - - const reportAsJson = await createAndUploadReport( - resolvedDirectoryPath, - coreOptions, - ); - - if (coreOptions.dryRun) { - // eslint-disable-next-line no-console - console.log(reportAsJson); - } -} - -runCli().catch((error) => { - red(`An error occurred: ${error}`); - process.exit(1); -}); diff --git a/packages/standalone-analyzer/src/index.test.ts b/packages/standalone-analyzer/src/index.test.ts deleted file mode 100644 index 9e78c443..00000000 --- a/packages/standalone-analyzer/src/index.test.ts +++ /dev/null @@ -1,202 +0,0 @@ -import { describe, it, expect, vi, beforeEach, type Mock } from "vitest"; -import { createAndUploadReport } from "./index"; -import { - normalizeOptions, - Output, - type Options, -} from "@codecov/bundler-plugin-core"; -import { normalizeStandaloneOptions, type StandaloneOptions } from "./options"; -import { getAssets } from "./assets"; -import packageJson from "../package.json"; - -const EXPECTED_PACKAGE_NAME = packageJson.name; -const EXPECTED_PACKAGE_VERSION = packageJson.version; - -vi.mock("@codecov/bundler-plugin-core", async () => { - const actual = await vi.importActual< - // eslint-disable-next-line @typescript-eslint/consistent-type-imports - typeof import("@codecov/bundler-plugin-core") - >("@codecov/bundler-plugin-core"); - - return { - ...actual, - normalizeOptions: vi.fn().mockImplementation((options: Options) => ({ - success: true, - options, - })), - Output: vi.fn().mockImplementation(() => ({ - start: vi.fn(), - setPlugin: vi.fn(), - end: vi.fn(), - write: vi.fn(), - bundleStatsToJson: vi.fn(), - assets: [], - chunks: [], - modules: [], - })), - }; -}); - -vi.mock("./assets", () => ({ - getAssets: vi.fn().mockResolvedValue([ - { - name: "assets/index-1dca144e.js", - size: 782, - gzipSize: 448, - normalized: "assets/index-*.js", - }, - { - name: "index.html", - size: 386, - gzipSize: 386, - normalized: "index.html", - }, - { - name: "vite.svg", - size: 1536, - gzipSize: 1536, - normalized: "vite.svg", - }, - ]), -})); - -vi.mock("./options", () => ({ - normalizeStandaloneOptions: vi - .fn() - .mockImplementation((options: Options) => ({ - beforeReportUpload: vi.fn((original: Output) => original), - ...options, - })), -})); - -describe("createAndUploadReport", () => { - let coreOptions: Options; - let standaloneOptions: StandaloneOptions; - let startHandler: Mock; - let endHandler: Mock; - let setPluginHandler: Mock; - let writeHandler: Mock; - let bundleStatsToJsonHandler: Mock; - let beforeReportUpload: Mock; - - beforeEach(() => { - vi.clearAllMocks(); - - // initialize handlers - startHandler = vi.fn(); - endHandler = vi.fn(); - setPluginHandler = vi.fn(); - writeHandler = vi.fn(); - bundleStatsToJsonHandler = vi.fn(); - - // initialize options - coreOptions = { - dryRun: false, - uploadToken: "test-token", - retryCount: 3, - apiUrl: "https://api.codecov.io", - bundleName: "my-bundle", - enableBundleAnalysis: true, - debug: true, - }; - beforeReportUpload = vi.fn().mockImplementation((original: Output) => ({ - ...original, - modified: true, - })); - standaloneOptions = { - beforeReportUpload: beforeReportUpload, - }; - - // update mock implementations for Output with the current handlers - (Output as Mock).mockImplementation(() => ({ - start: startHandler, - setPlugin: setPluginHandler, - end: endHandler, - write: writeHandler, - bundleStatsToJson: bundleStatsToJsonHandler, - assets: [], - chunks: [], - modules: [], - })); - }); - - it("should call all expected handlers for real runs", async () => { - coreOptions.dryRun = false; - - const reportAsJson = await createAndUploadReport( - "/path/to/build/directory", - coreOptions, - standaloneOptions, - ); - - expect(normalizeOptions).toHaveBeenCalledWith(coreOptions); - expect(normalizeStandaloneOptions).toHaveBeenCalledWith(standaloneOptions); - expect(getAssets).toHaveBeenCalledWith("/path/to/build/directory"); - expect(Output).toHaveBeenCalledTimes(1); - expect(startHandler).toHaveBeenCalled(); - expect(endHandler).toHaveBeenCalled(); - expect(setPluginHandler).toHaveBeenCalledWith( - EXPECTED_PACKAGE_NAME, - EXPECTED_PACKAGE_VERSION, - ); - expect(writeHandler).toHaveBeenCalled(); - expect(reportAsJson).toBeTruthy(); - }); - - it("should call all expected handlers for dry runs", async () => { - coreOptions.dryRun = true; - - const reportAsJson = await createAndUploadReport( - "/path/to/build/directory", - coreOptions, - standaloneOptions, - ); - - expect(normalizeOptions).toHaveBeenCalledWith(coreOptions); - expect(normalizeStandaloneOptions).toHaveBeenCalledWith(standaloneOptions); - expect(getAssets).toHaveBeenCalledWith("/path/to/build/directory"); - expect(Output).toHaveBeenCalledTimes(1); - expect(startHandler).toHaveBeenCalled(); - expect(endHandler).toHaveBeenCalled(); - expect(setPluginHandler).toHaveBeenCalledWith( - EXPECTED_PACKAGE_NAME, - EXPECTED_PACKAGE_VERSION, - ); - expect(writeHandler).not.toHaveBeenCalled(); - expect(reportAsJson).toBeTruthy(); - }); - - it("should handle custom beforeReportUpload", async () => { - const testFunc = vi.fn(); - beforeReportUpload.mockImplementation((original: Output) => { - testFunc(); - return { - ...original, - modified: true, - }; - }); - standaloneOptions.beforeReportUpload = beforeReportUpload; - - const reportAsJson = await createAndUploadReport( - "/path/to/build/directory", - coreOptions, - standaloneOptions, - ); - - expect(beforeReportUpload).toHaveBeenCalled(); - expect(testFunc).toHaveBeenCalled(); - expect(writeHandler).toHaveBeenCalled(); - expect(reportAsJson).toBeTruthy(); - }); - - it("should throw an error if options normalization fails", async () => { - (normalizeOptions as Mock).mockReturnValue({ - success: false, - errors: ["Invalid option"], - }); - - await expect( - createAndUploadReport("/path/to/build/directory", coreOptions), - ).rejects.toThrow("Invalid options: Invalid option"); - }); -}); diff --git a/packages/standalone-analyzer/src/index.ts b/packages/standalone-analyzer/src/index.ts deleted file mode 100644 index 95bc2a7e..00000000 --- a/packages/standalone-analyzer/src/index.ts +++ /dev/null @@ -1,91 +0,0 @@ -import { - normalizeOptions, - Output, - type Options, - type NormalizedOptions, -} from "@codecov/bundler-plugin-core"; -import { PLUGIN_NAME, PLUGIN_VERSION } from "./version"; -import { normalizeStandaloneOptions, type StandaloneOptions } from "./options"; -import { getAssets } from "./assets"; - -/** - * Generates a Codecov bundle stats report and optionally uploads it to Codecov. This function can - * be imported into your code or used via the standalone-analyzer CLI. - * - * @param {string} buildDirectoryPath - The path to the build directory containing the production - * assets for the report. Can be absolute or relative. - * @param {Options} coreOptions - Configuration options for generating and uploading the report. - * @param {StandaloneOptions} [standaloneOptions] - Optional configuration for standalone usage. - * - * @returns {Promise} A promise that resolves when the report is generated and uploaded - * (dry-runned or uploaded). - * - * @example - * const buildDir = '/path/to/build/directory'; // absolute or relative path - * const coreOpts = { - * dryRun: true, - * uploadToken: 'your-upload-token', - * retryCount: 3, - * apiUrl: 'https://api.codecov.io', - * bundleName: 'my-bundle', // bundle identifier in Codecov - * enableBundleAnalysis: true, - * debug: true, - * }; - * const standaloneOpts = { - * beforeReportUpload: async (original) => original, - * }; - * - * createAndUploadReport(buildDir, coreOpts, standaloneOpts) - * .then(() => console.log('Report successfully generated and uploaded.')) - * .catch((error) => console.error('Failed to generate or upload report:', error)); - */ -export const createAndUploadReport = async ( - buildDirectoryPath: string, - coreOptions: Options, - standaloneOptions?: StandaloneOptions, -): Promise => { - // normalize options - const standaloneOpts = normalizeStandaloneOptions(standaloneOptions); - const coreOpts = normalizeOptions(coreOptions); - if (!coreOpts.success) { - throw new Error("Invalid options: " + coreOpts.errors.join(" ")); - } - - // create report - const initialReport: Output = await makeReport( - buildDirectoryPath, - coreOpts.options, - ); - - // override report as needed (by default returns unchanged) - const finalReport = await standaloneOpts.beforeReportUpload(initialReport); - - // handle report - if (!coreOptions.dryRun) { - await finalReport.write(); - } - - return finalReport.bundleStatsToJson(); -}; - -/* makeReport creates the output bundle stats report */ -const makeReport = async ( - buildDirectoryPath: string, - normalizedCoreOptions: NormalizedOptions, -): Promise => { - // initialize report - const output: Output = new Output(normalizedCoreOptions); - output.start(); - output.setPlugin(PLUGIN_NAME, PLUGIN_VERSION); - - // handle assets - output.assets = await getAssets(buildDirectoryPath); - - // handle chunks and modules (not supported at this time) - output.chunks = []; - output.modules = []; - - // close and return report - output.end(); - return output; -}; diff --git a/packages/standalone-analyzer/src/options.test.ts b/packages/standalone-analyzer/src/options.test.ts deleted file mode 100644 index 75cd9899..00000000 --- a/packages/standalone-analyzer/src/options.test.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { describe, it, expect, vi, beforeEach } from "vitest"; -import { normalizeStandaloneOptions } from "./options"; -import { type Output } from "@codecov/bundler-plugin-core"; - -// @ts-expect-error - mock is missing some required fields for brevity -const mockOutput: Output = { - bundleStatsToJson: vi.fn().mockReturnValue('{"some": "data"}'), -}; - -describe("StandaloneOptions", () => { - beforeEach(() => { - vi.clearAllMocks(); - }); - - describe("normalizeStandaloneOptions", () => { - it("should return default options when no input is provided", () => { - const normalizedOptions = normalizeStandaloneOptions(); - expect(normalizedOptions.beforeReportUpload).toBeDefined(); - }); - - // eslint-disable-next-line @typescript-eslint/require-await - it("should merge user-provided options with default options", async () => { - const customBeforeReportUpload = vi.fn( - // eslint-disable-next-line @typescript-eslint/require-await - async (original: Output) => original, - ); - - const normalizedOptions = normalizeStandaloneOptions({ - beforeReportUpload: customBeforeReportUpload, - }); - - expect(normalizedOptions.beforeReportUpload).toBe( - customBeforeReportUpload, - ); - }); - - it("should use default beforeReportUpload if not provided", async () => { - const normalizedOptions = normalizeStandaloneOptions(); - - const overriddenOutput = - await normalizedOptions.beforeReportUpload(mockOutput); - - expect(overriddenOutput).toBe(mockOutput); - }); - }); - - describe("defaultStandaloneOptions", () => { - it("default beforeReportUpload should return the original output", async () => { - const defaultBeforeReportUpload = - normalizeStandaloneOptions().beforeReportUpload; - - const overriddenOutput = await defaultBeforeReportUpload(mockOutput); - - expect(overriddenOutput).toBe(mockOutput); - }); - }); -}); diff --git a/packages/standalone-analyzer/src/options.ts b/packages/standalone-analyzer/src/options.ts deleted file mode 100644 index 39dae880..00000000 --- a/packages/standalone-analyzer/src/options.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { type Output } from "@codecov/bundler-plugin-core"; - -/** Configuration options for the standalone analyzer. */ -export interface StandaloneOptions { - /** - * Asynchronous function to customize the report output. - * - * This function allows you to modify the report output before it is finalized. By default, it - * returns the original output without modification. - * - * @returns {Promise} A promise that resolves to the customized output. - */ - beforeReportUpload?: (original: Output) => Promise; -} - -/* defaultStandaloneOptions are default implementations for `StandaloneOptions` */ -const defaultStandaloneOptions: Required = { - // eslint-disable-next-line @typescript-eslint/require-await - beforeReportUpload: async (original: Output): Promise => original, -}; - -/* normalizeStandaloneOptions fills in missing standalone options with default values */ -export function normalizeStandaloneOptions( - options: Partial = {}, -): Required { - return { ...defaultStandaloneOptions, ...options }; -} diff --git a/packages/standalone-analyzer/src/version.ts b/packages/standalone-analyzer/src/version.ts deleted file mode 100644 index dd32fc4c..00000000 --- a/packages/standalone-analyzer/src/version.ts +++ /dev/null @@ -1,4 +0,0 @@ -// @ts-expect-error - this value gets replaced by rollup upon build -export const PLUGIN_NAME = __PACKAGE_NAME__ as string; -// @ts-expect-error - this value gets replaced by rollup upon build -export const PLUGIN_VERSION = __PACKAGE_VERSION__ as string; diff --git a/packages/standalone-analyzer/tsconfig.json b/packages/standalone-analyzer/tsconfig.json deleted file mode 100644 index 8fa41acf..00000000 --- a/packages/standalone-analyzer/tsconfig.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "baseUrl": "./", - "checkJs": true, - }, - "include": [ - "src/**/*", - "build.config.ts", - "../../reset.d.ts", - "vitest.config.ts", - ], - "exclude": ["coverage/**/*", "dist/**/*", "node_modules/**/*"], -} diff --git a/packages/standalone-analyzer/typedoc.json b/packages/standalone-analyzer/typedoc.json deleted file mode 100644 index 9f5efac9..00000000 --- a/packages/standalone-analyzer/typedoc.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "$schema": "https://typedoc.org/schema.json", - "extends": ["../../typedoc.base.json"], - "entryPoints": ["src/index.ts", "src/cli.ts", "src/options.ts"] -} diff --git a/packages/standalone-analyzer/vitest.config.ts b/packages/standalone-analyzer/vitest.config.ts deleted file mode 100644 index 756cb682..00000000 --- a/packages/standalone-analyzer/vitest.config.ts +++ /dev/null @@ -1,37 +0,0 @@ -import replace from "@rollup/plugin-replace"; -import { defineProject } from "vitest/config"; -import { config, plugins } from "../../vitest.shared"; -import "ts-node/register"; - -// This file contains vitest configuration for testing the standalone-analyzer -// package that is built using unbuild (rollup) - -const packageJson = await import("./package.json", { - assert: { type: "json" }, -}); - -const setupTsNode = { - files: ["./setup.ts"], - transformMode: { - web: [/\.tsx?$/], - }, -}; - -export default defineProject({ - ...config, - ...setupTsNode, - plugins: [ - // @ts-expect-error - using rollup plugin - { - ...replace({ - preventAssignment: true, - values: { - __PACKAGE_VERSION__: JSON.stringify(packageJson.version), - __PACKAGE_NAME__: JSON.stringify(packageJson.name), - }, - }), - enforce: "pre", - }, - ...plugins, - ], -}); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8b1f28ad..1d23c3ba 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -280,12 +280,12 @@ importers: examples/standalone/cli: devDependencies: + '@codecov/bundle-analyzer': + specifier: workspace:^ + version: link:../../../packages/bundle-analyzer '@codecov/rollup-plugin': specifier: workspace:^ version: link:../../../packages/rollup-plugin - '@codecov/standalone-analyzer': - specifier: workspace:^ - version: link:../../../packages/standalone-analyzer '@rollup/plugin-commonjs': specifier: ^25.0.7 version: 25.0.7(rollup@4.9.6) @@ -302,11 +302,17 @@ importers: specifier: ^14.2.1 version: 14.2.1 - examples/standalone/library-import: + examples/standalone/library-import-cjs: + devDependencies: + '@codecov/bundle-analyzer': + specifier: workspace:^ + version: link:../../../packages/bundle-analyzer + + examples/standalone/library-import-esm: devDependencies: - '@codecov/standalone-analyzer': + '@codecov/bundle-analyzer': specifier: workspace:^ - version: link:../../../packages/standalone-analyzer + version: link:../../../packages/bundle-analyzer examples/sveltekit: devDependencies: @@ -464,6 +470,9 @@ importers: specifier: ^2.10.2 version: 2.10.2(solid-js@1.8.19)(vite@5.2.10(@types/node@20.11.15)(sass@1.77.8)(terser@5.27.0)) devDependencies: + '@codecov/bundle-analyzer': + specifier: workspace:^ + version: link:../packages/bundle-analyzer '@codecov/bundler-plugin-core': specifier: workspace:^ version: link:../packages/bundler-plugin-core @@ -479,9 +488,6 @@ importers: '@codecov/solidstart-plugin': specifier: workspace:^ version: link:../packages/solidstart-plugin - '@codecov/standalone-analyzer': - specifier: workspace:^ - version: link:../packages/standalone-analyzer '@codecov/sveltekit-plugin': specifier: workspace:^ version: link:../packages/sveltekit-plugin @@ -565,6 +571,21 @@ importers: specifier: ^1.1.26 version: 1.1.26 + integration-tests/test-apps/bundle-analyzer/dotenv-vercel: + devDependencies: + '@codecov/bundle-analyzer': + specifier: workspace:^ + version: link:../../../../packages/bundle-analyzer + dotenv: + specifier: ^16.4.5 + version: 16.4.5 + typescript: + specifier: ^5.0.2 + version: 5.4.5 + vite: + specifier: ^4.4.5 + version: 4.5.3(@types/node@20.12.12)(sass@1.77.8)(terser@5.27.0) + integration-tests/test-apps/nextjs: dependencies: next: @@ -706,21 +727,6 @@ importers: specifier: ^2.10.2 version: 2.10.2(solid-js@1.8.19)(vite@5.2.10(@types/node@20.12.12)(sass@1.77.8)(terser@5.27.0)) - integration-tests/test-apps/standalone/dotenv-vercel: - devDependencies: - '@codecov/standalone-analyzer': - specifier: workspace:^ - version: link:../../../../packages/standalone-analyzer - dotenv: - specifier: ^16.4.5 - version: 16.4.5 - typescript: - specifier: ^5.0.2 - version: 5.4.5 - vite: - specifier: ^4.4.5 - version: 4.5.3(@types/node@20.12.12)(sass@1.77.8)(terser@5.27.0) - integration-tests/test-apps/sveltekit: devDependencies: '@codecov/sveltekit-plugin': @@ -748,6 +754,55 @@ importers: specifier: ^5.0.3 version: 5.2.10(@types/node@20.12.12)(sass@1.77.8)(terser@5.27.0) + packages/bundle-analyzer: + dependencies: + '@codecov/bundler-plugin-core': + specifier: workspace:^ + version: link:../bundler-plugin-core + yargs: + specifier: ^17.7.2 + version: 17.7.2 + devDependencies: + '@rollup/plugin-replace': + specifier: ^5.0.5 + version: 5.0.5(rollup@3.29.4) + '@types/node': + specifier: ^20.11.15 + version: 20.12.12 + '@types/yargs': + specifier: ^17.0.33 + version: 17.0.33 + '@vitest/coverage-v8': + specifier: ^1.5.0 + version: 1.5.0(vitest@1.5.0(@types/node@20.12.12)(sass@1.77.8)(terser@5.27.0)) + codecovProdRollupPlugin: + specifier: npm:@codecov/rollup-plugin@0.0.1-beta.5 + version: '@codecov/rollup-plugin@0.0.1-beta.5(rollup@3.29.4)' + msw: + specifier: ^2.1.5 + version: 2.1.5(typescript@5.4.5) + ts-node: + specifier: ^10.9.2 + version: 10.9.2(@types/node@20.12.12)(typescript@5.4.5) + typedoc: + specifier: ^0.25.12 + version: 0.25.12(typescript@5.4.5) + typescript: + specifier: ^5.3.3 + version: 5.4.5 + unbuild: + specifier: ^2.0.0 + version: 2.0.0(sass@1.77.8)(typescript@5.4.5) + vite: + specifier: ^5.2.10 + version: 5.2.10(@types/node@20.12.12)(sass@1.77.8)(terser@5.27.0) + vite-tsconfig-paths: + specifier: ^4.3.2 + version: 4.3.2(typescript@5.4.5)(vite@5.2.10(@types/node@20.12.12)(sass@1.77.8)(terser@5.27.0)) + vitest: + specifier: ^1.5.0 + version: 1.5.0(@types/node@20.12.12)(sass@1.77.8)(terser@5.27.0) + packages/bundler-plugin-core: dependencies: '@actions/github': @@ -1069,55 +1124,6 @@ importers: specifier: ^1.5.0 version: 1.5.0(@types/node@20.12.12)(sass@1.77.8)(terser@5.27.0) - packages/standalone-analyzer: - dependencies: - '@codecov/bundler-plugin-core': - specifier: workspace:^ - version: link:../bundler-plugin-core - yargs: - specifier: ^17.7.2 - version: 17.7.2 - devDependencies: - '@rollup/plugin-replace': - specifier: ^5.0.5 - version: 5.0.5(rollup@3.29.4) - '@types/node': - specifier: ^20.11.15 - version: 20.12.12 - '@types/yargs': - specifier: ^17.0.33 - version: 17.0.33 - '@vitest/coverage-v8': - specifier: ^1.5.0 - version: 1.5.0(vitest@1.5.0(@types/node@20.12.12)(sass@1.77.8)(terser@5.27.0)) - codecovProdRollupPlugin: - specifier: npm:@codecov/rollup-plugin@0.0.1-beta.5 - version: '@codecov/rollup-plugin@0.0.1-beta.5(rollup@3.29.4)' - msw: - specifier: ^2.1.5 - version: 2.1.5(typescript@5.4.5) - ts-node: - specifier: ^10.9.2 - version: 10.9.2(@types/node@20.12.12)(typescript@5.4.5) - typedoc: - specifier: ^0.25.12 - version: 0.25.12(typescript@5.4.5) - typescript: - specifier: ^5.3.3 - version: 5.4.5 - unbuild: - specifier: ^2.0.0 - version: 2.0.0(sass@1.77.8)(typescript@5.4.5) - vite: - specifier: ^5.2.10 - version: 5.2.10(@types/node@20.12.12)(sass@1.77.8)(terser@5.27.0) - vite-tsconfig-paths: - specifier: ^4.3.2 - version: 4.3.2(typescript@5.4.5)(vite@5.2.10(@types/node@20.12.12)(sass@1.77.8)(terser@5.27.0)) - vitest: - specifier: ^1.5.0 - version: 1.5.0(@types/node@20.12.12)(sass@1.77.8)(terser@5.27.0) - packages/sveltekit-plugin: dependencies: '@codecov/bundler-plugin-core': @@ -2033,8 +2039,8 @@ packages: resolution: {integrity: sha512-0CX6F+BI2s9dkUqr08KFrAIZgNFj75rdBU/DjCyYLIaV/quFjkk6T+EJ2LkZHyZTbEV4L5p97mNkUsHl2wLFAw==} engines: {node: '>=6.9.0'} - '@babel/standalone@7.24.4': - resolution: {integrity: sha512-V4uqWeedadiuiCx5P5OHYJZ1PehdMpcBccNCEptKFGPiZIY3FI5f2ClxUl4r5wZ5U+ohcQ+4KW6jX2K6xXzq4Q==} + '@babel/standalone@7.25.6': + resolution: {integrity: sha512-Kf2ZcZVqsKbtYhlA7sP0z5A3q5hmCVYMKMWRWNK/5OVwHIve3JY1djVRmIVAx8FMueLIfZGKQDIILK2w8zO4mg==} engines: {node: '>=6.9.0'} '@babel/template@7.24.0': @@ -5038,7 +5044,6 @@ packages: bun@1.1.26: resolution: {integrity: sha512-dWSewAqE7sVbYmflJxgG47dW4vmsbar7VAnQ4ao45y3ulr3n7CwdsMLFnzd28jhPRtF+rsaVK2y4OLIkP3OD4A==} - cpu: [arm64, x64] os: [darwin, linux, win32] hasBin: true @@ -11478,7 +11483,7 @@ snapshots: dependencies: regenerator-runtime: 0.14.1 - '@babel/standalone@7.24.4': {} + '@babel/standalone@7.25.6': {} '@babel/template@7.24.0': dependencies: @@ -22603,7 +22608,7 @@ snapshots: untyped@1.4.2: dependencies: '@babel/core': 7.24.4 - '@babel/standalone': 7.24.4 + '@babel/standalone': 7.25.6 '@babel/types': 7.24.9 defu: 6.1.4 jiti: 1.21.0 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index c3d31ecc..f1f7fbb5 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -10,4 +10,4 @@ packages: - "integration-tests/test-apps/remix" - "integration-tests/test-apps/sveltekit" - "integration-tests/test-apps/solidstart" - - "integration-tests/test-apps/standalone/dotenv-vercel" + - "integration-tests/test-apps/bundle-analyzer/dotenv-vercel"