diff --git a/.github/workflows/js-ci.yml b/.github/workflows/js-ci.yml new file mode 100644 index 0000000..4df39ad --- /dev/null +++ b/.github/workflows/js-ci.yml @@ -0,0 +1,27 @@ +name: "JS CI" + +on: + push: + branches: + - 'main' + pull_request: + branches: + - '*' + +permissions: + contents: read + +jobs: + js-ci: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Run npm install + run: npm install + + - name: Run npm build + run: npm run build + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/package-lock.json b/package-lock.json index bd328c4..ae018db 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,6 +15,7 @@ "vuex": "^4.1.0" }, "devDependencies": { + "@codecov/vite-plugin": "^0.0.1-beta.4", "@rushstack/eslint-patch": "^1.7.2", "@vitejs/plugin-vue": "^5.0.4", "@vue/eslint-config-prettier": "^9.0.0", @@ -471,6 +472,36 @@ "node": ">=6.9.0" } }, + "node_modules/@codecov/bundler-plugin-core": { + "version": "0.0.1-beta.4", + "resolved": "https://registry.npmjs.org/@codecov/bundler-plugin-core/-/bundler-plugin-core-0.0.1-beta.4.tgz", + "integrity": "sha512-rxPmTCoO/G/KcbQCQECenVfTpWSkuNTEJL4v37zetQ4Wr1ydh2dt+53uK9Hp1s8C+ogEjpMPG8X8bHK4tp+y/g==", + "dev": true, + "dependencies": { + "chalk": "4.1.2", + "semver": "^7.5.4", + "unplugin": "^1.6.0", + "zod": "^3.22.4" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@codecov/vite-plugin": { + "version": "0.0.1-beta.4", + "resolved": "https://registry.npmjs.org/@codecov/vite-plugin/-/vite-plugin-0.0.1-beta.4.tgz", + "integrity": "sha512-95rXTingy+egViC+RwQ4E8hpA+5zJMWyZy7m367Hi7s7j9gwcspYD3EUPImFFXb8OH9DiEkly8o/RVWKq7MV1w==", + "dev": true, + "dependencies": { + "@codecov/bundler-plugin-core": "^0.0.1-beta.4" + }, + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "vite": "4.x || 5.x" + } + }, "node_modules/@esbuild/aix-ppc64": { "version": "0.19.12", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.19.12.tgz", @@ -4224,6 +4255,21 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/unplugin": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/unplugin/-/unplugin-1.9.0.tgz", + "integrity": "sha512-14PslvMY3gNbXnQtNIRB566Q057L5Fe7f5LDEamxVi0QQVxoz5hrveBwwZLcKyHtZ09ysmipxRRj5Lv+BGz2Iw==", + "dev": true, + "dependencies": { + "acorn": "^8.11.3", + "chokidar": "^3.6.0", + "webpack-sources": "^3.2.3", + "webpack-virtual-modules": "^0.6.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/update-browserslist-db": { "version": "1.0.13", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz", @@ -4413,6 +4459,12 @@ "node": ">=10.13.0" } }, + "node_modules/webpack-virtual-modules": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/webpack-virtual-modules/-/webpack-virtual-modules-0.6.1.tgz", + "integrity": "sha512-poXpCylU7ExuvZK8z+On3kX+S8o/2dQ/SVYueKA0D4WEMXROXgY8Ez50/bQEUmvoSMMrWcrJqCHuhAbsiwg7Dg==", + "dev": true + }, "node_modules/whatwg-url": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", @@ -4572,6 +4624,15 @@ "funding": { "url": "https://github.com/sponsors/sindresorhus" } + }, + "node_modules/zod": { + "version": "3.22.4", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.22.4.tgz", + "integrity": "sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } } } } diff --git a/package.json b/package.json index ed4bfbf..046a110 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "vuex": "^4.1.0" }, "devDependencies": { + "@codecov/vite-plugin": "^0.0.1-beta.4", "@rushstack/eslint-patch": "^1.7.2", "@vitejs/plugin-vue": "^5.0.4", "@vue/eslint-config-prettier": "^9.0.0", diff --git a/vite.config.js b/vite.config.js index 4888e7a..cee221c 100644 --- a/vite.config.js +++ b/vite.config.js @@ -3,6 +3,7 @@ import { fileURLToPath, URL } from 'node:url'; import { defineConfig, loadEnv } from "vite"; import vue from '@vitejs/plugin-vue'; import { sentryVitePlugin } from '@sentry/vite-plugin'; +import { codecovVitePlugin } from "@codecov/vite-plugin"; // https://vitejs.dev/config/ export default defineConfig(({ mode }) => { @@ -22,6 +23,11 @@ export default defineConfig(({ mode }) => { release: env.RELEASE, telemetry: false }), + codecovVitePlugin({ + enableBundleAnalysis: process.env.CODECOV_TOKEN !== undefined, + bundleName: "gib-potato", + uploadToken: process.env.CODECOV_TOKEN, + }), ], build: { sourcemap: true,