diff --git a/apps/admin-js/vite.config.ts b/apps/admin-js/vite.config.ts index 23ce0944..b46ed744 100644 --- a/apps/admin-js/vite.config.ts +++ b/apps/admin-js/vite.config.ts @@ -1,7 +1,10 @@ +import isCi from 'is-ci'; import {type BaseElementNode, type Node} from '@vue/compiler-core'; import vue from '@vitejs/plugin-vue'; import {createViteConfig} from '@myparcel-pdk/build-vite'; import {isOfType} from '@myparcel/ts-utils'; +import {codecovVitePlugin} from '@codecov/vite-plugin'; +import {name} from './package.json'; const PROP_TYPE_DIRECTIVE = 7; @@ -17,6 +20,12 @@ const stripDirective = (name: string) => (node: Node) => { export default createViteConfig((env) => ({ plugins: [ + codecovVitePlugin({ + enableBundleAnalysis: isCi && process.env.CODECOV_TOKEN !== undefined, + bundleName: name, + uploadToken: process.env.CODECOV_TOKEN, + }), + vue({ template: { compilerOptions: { diff --git a/apps/checkout-js/vite.config.ts b/apps/checkout-js/vite.config.ts index 21762c5e..4d070bab 100644 --- a/apps/checkout-js/vite.config.ts +++ b/apps/checkout-js/vite.config.ts @@ -1,3 +1,14 @@ +import isCi from 'is-ci'; import {createViteConfig} from '@myparcel-pdk/build-vite'; +import {codecovVitePlugin} from '@codecov/vite-plugin'; +import {name} from './package.json'; -export default createViteConfig(); +export default createViteConfig({ + plugins: [ + codecovVitePlugin({ + enableBundleAnalysis: isCi && process.env.CODECOV_TOKEN !== undefined, + bundleName: name, + uploadToken: process.env.CODECOV_TOKEN, + }), + ], +}); diff --git a/libs/build-vite/package.json b/libs/build-vite/package.json index a614adc0..1817d75b 100755 --- a/libs/build-vite/package.json +++ b/libs/build-vite/package.json @@ -16,6 +16,7 @@ "lint:fix": "run ws:lint:fix \"$(pwd)\"" }, "dependencies": { + "@codecov/vite-plugin": "^1.2.0", "@vitejs/plugin-vue": "^5.0.0", "@vitest/coverage-v8": "^1.0.0", "happy-dom": "^14.0.0", diff --git a/package.json b/package.json index e73abb08..d79d1834 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "clean": "nx run-many -t clean --parallel=99", "lint": "nx affected -t lint --output-style=stream", "lint:fix": "nx affected -t lint:fix --output-style=stream", - "prepare": "echo 'prepare' && (is-ci || husky install)", + "prepare": "is-ci || husky", "serve": "run build:dev --output-style=stream npx concurrently yarn:watch yarn:serve:demo", "serve:demo": "npx -q concurrently yarn:serve:demo:frontend yarn:serve:demo:backend", "serve:demo:backend": "nx serve @myparcel-pdk/backend-demo", @@ -61,12 +61,14 @@ "@myparcel-eslint/eslint-config-prettier-typescript": "^1.2.0", "@myparcel-eslint/eslint-config-prettier-typescript-vue": "^1.2.0", "@myparcel/prettier-config": "^1.1.0", + "@types/is-ci": "^3", "@vue/tsconfig": "^0.5.0", "array.prototype.flatmap": "^1.3.1", "conventional-changelog-conventionalcommits": "^7.0.0", "eslint": "^8.34.0", "eslint-plugin-sort-exports": "^0.9.0", "husky": "^9.0.0", + "is-ci": "^3.0.1", "lint-staged": "^15.0.0", "monodeploy": "^5.0.0", "nodemon": "^3.0.0", diff --git a/yarn.lock b/yarn.lock index d692ccd4..600bacd9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -22,6 +22,54 @@ __metadata: languageName: node linkType: hard +"@actions/core@npm:^1.10.1": + version: 1.11.1 + resolution: "@actions/core@npm:1.11.1" + dependencies: + "@actions/exec": "npm:^1.1.1" + "@actions/http-client": "npm:^2.0.1" + checksum: 10c0/9aa30b397d8d0dbc74e69fe46b23fb105cab989beb420c57eacbfc51c6804abe8da0f46973ca9f639d532ea4c096d0f4d37da0223fbe94f304fa3c5f53537c30 + languageName: node + linkType: hard + +"@actions/exec@npm:^1.1.1": + version: 1.1.1 + resolution: "@actions/exec@npm:1.1.1" + dependencies: + "@actions/io": "npm:^1.0.1" + checksum: 10c0/4a09f6bdbe50ce68b5cf8a7254d176230d6a74bccf6ecc3857feee209a8c950ba9adec87cc5ecceb04110182d1c17117234e45557d72fde6229b7fd3a395322a + languageName: node + linkType: hard + +"@actions/github@npm:^6.0.0": + version: 6.0.0 + resolution: "@actions/github@npm:6.0.0" + dependencies: + "@actions/http-client": "npm:^2.2.0" + "@octokit/core": "npm:^5.0.1" + "@octokit/plugin-paginate-rest": "npm:^9.0.0" + "@octokit/plugin-rest-endpoint-methods": "npm:^10.0.0" + checksum: 10c0/6f86f564e6ec5873c69ff23bed308cef5f964dbdb559c5415c1ba479517bf18352713a2a757c27f8f67a3d675fdd78446cf142b27762489f697edf9c58e72378 + languageName: node + linkType: hard + +"@actions/http-client@npm:^2.0.1, @actions/http-client@npm:^2.2.0": + version: 2.2.3 + resolution: "@actions/http-client@npm:2.2.3" + dependencies: + tunnel: "npm:^0.0.6" + undici: "npm:^5.25.4" + checksum: 10c0/13141b66a42aa4afd8c50f7479e13a5cdb5084ccb3c73ec48894b8029743389a3d2bf8cdc18e23fb70cd33995740526dd308815613907571e897c3aa1e5eada6 + languageName: node + linkType: hard + +"@actions/io@npm:^1.0.1": + version: 1.1.3 + resolution: "@actions/io@npm:1.1.3" + checksum: 10c0/5b8751918e5bf0bebd923ba917fb1c0e294401e7ff0037f32c92a4efa4215550df1f6633c63fd4efb2bdaae8711e69b9e36925857db1f38935ff62a5c92ec29e + languageName: node + linkType: hard + "@algolia/cache-browser-local-storage@npm:4.23.3": version: 4.23.3 resolution: "@algolia/cache-browser-local-storage@npm:4.23.3" @@ -968,6 +1016,32 @@ __metadata: languageName: node linkType: hard +"@codecov/bundler-plugin-core@npm:^1.2.0": + version: 1.2.0 + resolution: "@codecov/bundler-plugin-core@npm:1.2.0" + dependencies: + "@actions/core": "npm:^1.10.1" + "@actions/github": "npm:^6.0.0" + chalk: "npm:4.1.2" + semver: "npm:^7.5.4" + unplugin: "npm:^1.10.1" + zod: "npm:^3.22.4" + checksum: 10c0/96b1e3676fb944f8727db71b5190a6a97e56621af0a8e4d7dfb4a16a3fa7fef6d439e4cac51a05705609ef5e97a46ceec8c3ff104a61cd9fcab42b567a28dec4 + languageName: node + linkType: hard + +"@codecov/vite-plugin@npm:^1.2.0": + version: 1.2.0 + resolution: "@codecov/vite-plugin@npm:1.2.0" + dependencies: + "@codecov/bundler-plugin-core": "npm:^1.2.0" + unplugin: "npm:^1.10.1" + peerDependencies: + vite: 4.x || 5.x + checksum: 10c0/188c7c789ed6b3c5563d52365d59640ad8efcc897ad82549dd8aaa707194925b3934a879763693fdce7e58e27b08029aba35f36e0c843d77fc219ec1423a1950 + languageName: node + linkType: hard + "@edielemoine/google-docs-importer@npm:^2.2.0": version: 2.2.0 resolution: "@edielemoine/google-docs-importer@npm:2.2.0" @@ -2180,6 +2254,7 @@ __metadata: version: 0.0.0-use.local resolution: "@myparcel-pdk/build-vite@workspace:libs/build-vite" dependencies: + "@codecov/vite-plugin": "npm:^1.2.0" "@myparcel/ts-utils": "npm:^1.9.0" "@vitejs/plugin-vue": "npm:^5.0.0" "@vitest/coverage-v8": "npm:^1.0.0" @@ -2294,12 +2369,14 @@ __metadata: "@myparcel-eslint/eslint-config-prettier-typescript": "npm:^1.2.0" "@myparcel-eslint/eslint-config-prettier-typescript-vue": "npm:^1.2.0" "@myparcel/prettier-config": "npm:^1.1.0" + "@types/is-ci": "npm:^3" "@vue/tsconfig": "npm:^0.5.0" array.prototype.flatmap: "npm:^1.3.1" conventional-changelog-conventionalcommits: "npm:^7.0.0" eslint: "npm:^8.34.0" eslint-plugin-sort-exports: "npm:^0.9.0" husky: "npm:^9.0.0" + is-ci: "npm:^3.0.1" lint-staged: "npm:^15.0.0" monodeploy: "npm:^5.0.0" nodemon: "npm:^3.0.0" @@ -2640,6 +2717,28 @@ __metadata: languageName: node linkType: hard +"@octokit/plugin-paginate-rest@npm:^9.0.0": + version: 9.2.1 + resolution: "@octokit/plugin-paginate-rest@npm:9.2.1" + dependencies: + "@octokit/types": "npm:^12.6.0" + peerDependencies: + "@octokit/core": 5 + checksum: 10c0/1dc55032a9e0c3e6440080a319975c9e4f189913fbc8870a48048d0c712473ea3d902ba247a37a46d45d502859b2728731a0d285107e4b0fa628d380f87163b4 + languageName: node + linkType: hard + +"@octokit/plugin-rest-endpoint-methods@npm:^10.0.0": + version: 10.4.1 + resolution: "@octokit/plugin-rest-endpoint-methods@npm:10.4.1" + dependencies: + "@octokit/types": "npm:^12.6.0" + peerDependencies: + "@octokit/core": 5 + checksum: 10c0/4b8f64c0f7fa12464546ad312a5289c2a799967e01e90e2c4923ec6e9604cf212dcb50d9795c9a688867f973c9c529c5950368564c560406c652bcd298f090af + languageName: node + linkType: hard + "@octokit/plugin-throttling@npm:^8.1.2": version: 8.2.0 resolution: "@octokit/plugin-throttling@npm:8.2.0" @@ -2675,7 +2774,7 @@ __metadata: languageName: node linkType: hard -"@octokit/types@npm:^12.2.0": +"@octokit/types@npm:^12.2.0, @octokit/types@npm:^12.6.0": version: 12.6.0 resolution: "@octokit/types@npm:12.6.0" dependencies: @@ -4053,6 +4152,15 @@ __metadata: languageName: node linkType: hard +"@types/is-ci@npm:^3": + version: 3.0.4 + resolution: "@types/is-ci@npm:3.0.4" + dependencies: + ci-info: "npm:^3.1.0" + checksum: 10c0/80a3d444d06af53b32429ef9e70184adf12bd98a2f851d8c050aecf7b4abfdab9671abc317785be834d41cad98331992040147ef382bacc2b2a441fee1549a3e + languageName: node + linkType: hard + "@types/istanbul-lib-coverage@npm:^2.0.1": version: 2.0.6 resolution: "@types/istanbul-lib-coverage@npm:2.0.6" @@ -5432,6 +5540,15 @@ __metadata: languageName: node linkType: hard +"acorn@npm:^8.12.1": + version: 8.12.1 + resolution: "acorn@npm:8.12.1" + bin: + acorn: bin/acorn + checksum: 10c0/51fb26cd678f914e13287e886da2d7021f8c2bc0ccc95e03d3e0447ee278dd3b40b9c57dc222acd5881adcf26f3edc40901a4953403232129e3876793cd17386 + languageName: node + linkType: hard + "adm-zip@npm:^0.5.5": version: 0.5.12 resolution: "adm-zip@npm:0.5.12" @@ -6340,6 +6457,16 @@ __metadata: languageName: node linkType: hard +"chalk@npm:4.1.2, chalk@npm:^4.0.0, chalk@npm:^4.1.0, chalk@npm:^4.1.1, chalk@npm:^4.1.2": + version: 4.1.2 + resolution: "chalk@npm:4.1.2" + dependencies: + ansi-styles: "npm:^4.1.0" + supports-color: "npm:^7.1.0" + checksum: 10c0/4a3fef5cc34975c898ffe77141450f679721df9dde00f6c304353fa9c8b571929123b26a0e4617bde5018977eb655b31970c297b91b63ee83bb82aeb04666880 + languageName: node + linkType: hard + "chalk@npm:5.3.0, chalk@npm:^5.2.0, chalk@npm:^5.3.0": version: 5.3.0 resolution: "chalk@npm:5.3.0" @@ -6368,16 +6495,6 @@ __metadata: languageName: node linkType: hard -"chalk@npm:^4.0.0, chalk@npm:^4.1.0, chalk@npm:^4.1.1, chalk@npm:^4.1.2": - version: 4.1.2 - resolution: "chalk@npm:4.1.2" - dependencies: - ansi-styles: "npm:^4.1.0" - supports-color: "npm:^7.1.0" - checksum: 10c0/4a3fef5cc34975c898ffe77141450f679721df9dde00f6c304353fa9c8b571929123b26a0e4617bde5018977eb655b31970c297b91b63ee83bb82aeb04666880 - languageName: node - linkType: hard - "chardet@npm:^0.7.0": version: 0.7.0 resolution: "chardet@npm:0.7.0" @@ -6453,7 +6570,7 @@ __metadata: languageName: node linkType: hard -"ci-info@npm:^3.2.0, ci-info@npm:^3.8.0": +"ci-info@npm:^3.1.0, ci-info@npm:^3.2.0, ci-info@npm:^3.8.0": version: 3.9.0 resolution: "ci-info@npm:3.9.0" checksum: 10c0/6f0109e36e111684291d46123d491bc4e7b7a1934c3a20dea28cba89f1d4a03acd892f5f6a81ed3855c38647e285a150e3c9ba062e38943bef57fee6c1554c3a @@ -9998,6 +10115,17 @@ __metadata: languageName: node linkType: hard +"is-ci@npm:^3.0.1": + version: 3.0.1 + resolution: "is-ci@npm:3.0.1" + dependencies: + ci-info: "npm:^3.2.0" + bin: + is-ci: bin.js + checksum: 10c0/0e81caa62f4520d4088a5bef6d6337d773828a88610346c4b1119fb50c842587ed8bef1e5d9a656835a599e7209405b5761ddf2339668f2d0f4e889a92fe6051 + languageName: node + linkType: hard + "is-core-module@npm:^2.1.0, is-core-module@npm:^2.13.0": version: 2.13.1 resolution: "is-core-module@npm:2.13.1" @@ -15233,7 +15361,7 @@ __metadata: languageName: node linkType: hard -"undici@npm:^5.28.2": +"undici@npm:^5.25.4, undici@npm:^5.28.2": version: 5.28.4 resolution: "undici@npm:5.28.4" dependencies: @@ -15350,6 +15478,21 @@ __metadata: languageName: node linkType: hard +"unplugin@npm:^1.10.1": + version: 1.14.1 + resolution: "unplugin@npm:1.14.1" + dependencies: + acorn: "npm:^8.12.1" + webpack-virtual-modules: "npm:^0.6.2" + peerDependencies: + webpack-sources: ^3 + peerDependenciesMeta: + webpack-sources: + optional: true + checksum: 10c0/a74342b8f0cbbdc7b1da1f78f1898c0c915e3f67b22281fcd61a5495a585f4a1fd0fc270a7e59643a41c138c94c852cb69ea17af72965fb15f86f18ee76c2ed1 + languageName: node + linkType: hard + "unstorage@npm:^1.10.2": version: 1.10.2 resolution: "unstorage@npm:1.10.2" @@ -15887,6 +16030,13 @@ __metadata: languageName: node linkType: hard +"webpack-virtual-modules@npm:^0.6.2": + version: 0.6.2 + resolution: "webpack-virtual-modules@npm:0.6.2" + checksum: 10c0/5ffbddf0e84bf1562ff86cf6fcf039c74edf09d78358a6904a09bbd4484e8bb6812dc385fe14330b715031892dcd8423f7a88278b57c9f5002c84c2860179add + languageName: node + linkType: hard + "whatwg-mimetype@npm:^3.0.0": version: 3.0.0 resolution: "whatwg-mimetype@npm:3.0.0" @@ -16261,3 +16411,10 @@ __metadata: checksum: 10c0/50f2fb30327fb9d09879abf7ae2493705313adf403e794b030151aaae00009162419d60d0519e807673ec04d442e140c8879ca14314df0a0192de3b233e8f28b languageName: node linkType: hard + +"zod@npm:^3.22.4": + version: 3.23.8 + resolution: "zod@npm:3.23.8" + checksum: 10c0/8f14c87d6b1b53c944c25ce7a28616896319d95bc46a9660fe441adc0ed0a81253b02b5abdaeffedbeb23bdd25a0bf1c29d2c12dd919aef6447652dd295e3e69 + languageName: node + linkType: hard