From 6b6e464ca5230ad7c9baf0885755f4c590ad5d4c Mon Sep 17 00:00:00 2001 From: yousefed Date: Fri, 14 Jul 2023 05:04:37 +0200 Subject: [PATCH 1/2] bundle stats --- .github/workflows/build.yaml | 5 +++++ .github/workflows/relative-ci.yaml | 17 +++++++++++++++ package-lock.json | 33 ++++++++++++++++++++++++------ packages/editor/package.json | 3 ++- packages/editor/vite.config.ts | 3 ++- 5 files changed, 53 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/relative-ci.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 7d392775a..5e054e0d1 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -144,6 +144,11 @@ jobs: path: packages/editor/playwright-report/ retention-days: 30 + # Upload webpack-stats.json to use on relative-ci.yaml workflow + - name: Upload webpack stats artifact + uses: relative-ci/agent-upload-artifact-action@v1 + with: + webpackStatsFile: ./packages/editor/dist/webpack-stats.json # - name: Upload to coveralls # uses: coverallsapp/github-action@master # with: diff --git a/.github/workflows/relative-ci.yaml b/.github/workflows/relative-ci.yaml new file mode 100644 index 000000000..92600e4de --- /dev/null +++ b/.github/workflows/relative-ci.yaml @@ -0,0 +1,17 @@ +name: RelativeCI + +on: + workflow_run: + workflows: ["Build"] + types: + - completed + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Send bundle stats and build information to RelativeCI + uses: relative-ci/agent-action@v2 + with: + key: ${{ secrets.RELATIVE_CI_KEY }} + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/package-lock.json b/package-lock.json index d2adb3e49..da2ab9dff 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18606,6 +18606,18 @@ "rollup-plugin-inject": "^3.0.0" } }, + "node_modules/rollup-plugin-webpack-stats": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-webpack-stats/-/rollup-plugin-webpack-stats-0.2.0.tgz", + "integrity": "sha512-WDQ9ra6qWjeH/7D3q7lY/r5i9/HPt8OlZvvoQzS7Jdarh2v5+Fgw1BdAU2pBW0LB26J+vNYwdEdyJnkBhbQ2PQ==", + "dev": true, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "rollup": "^3.0.0" + } + }, "node_modules/rollup-pluginutils": { "version": "2.8.2", "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz", @@ -22389,6 +22401,7 @@ "rimraf": "^3.0.2", "rollup-plugin-node-polyfills": "^0.2.1", "rollup-plugin-polyfill-node": "^0.12.0", + "rollup-plugin-webpack-stats": "^0.2.0", "vite": "^4.4.2", "vitest": "^0.33.0" } @@ -28871,6 +28884,7 @@ "rimraf": "^3.0.2", "rollup-plugin-node-polyfills": "^0.2.1", "rollup-plugin-polyfill-node": "^0.12.0", + "rollup-plugin-webpack-stats": "^0.2.0", "semver": "^7.3.5", "simple-peer": "^9.11.1", "speakingurl": "^14.0.1", @@ -29895,7 +29909,7 @@ "resolved": "https://registry.npmjs.org/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz", "integrity": "sha512-iMIqiko6ooLrTh1joXodJK5X9xeEALT1kM5G3ZLhD3hszxBdIEd5C75U834D9mLcINgD4OyZf5uQXjkuYydWvA==", "requires": { - "@types/react": "*", + "@types/react": "^18.0.25", "hoist-non-react-statics": "^3.3.0" } }, @@ -30063,7 +30077,7 @@ "integrity": "sha512-7FkurKcS1k0FHZEtdbbgN8Oc6b+stGSfZYjQGicofJ0j4U0qIn/jaSvnP2pLwZKiai3/17xqqxkkrxTgN8UNbQ==", "requires": { "@types/hoist-non-react-statics": "^3.3.0", - "@types/react": "*", + "@types/react": "^18.0.25", "hoist-non-react-statics": "^3.3.0", "redux": "^4.0.0" } @@ -30074,8 +30088,8 @@ "integrity": "sha512-uCPRMPshd96BwHuT7oCrFduiv5d6km3VwmtW7rVl9g4XetS3VoJ9nZo540LiwtQgaFcW96POwaxQDZDAyYaepg==", "requires": { "@emotion/serialize": "^1.0.0", - "@types/react": "*", - "@types/react-dom": "*", + "@types/react": "^18.0.25", + "@types/react-dom": "^18.0.9", "@types/react-transition-group": "*" }, "dependencies": { @@ -30113,7 +30127,7 @@ "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.5.tgz", "integrity": "sha512-juKD/eiSM3/xZYzjuzH6ZwpP+/lejltmiS3QEzV/vmb/Q8+HfDmxu+Baga8UEMGBqV88Nbg4l2hY/K2DkyaLLA==", "requires": { - "@types/react": "*" + "@types/react": "^18.0.25" } }, "@types/retry": { @@ -38021,7 +38035,7 @@ "@formatjs/intl-displaynames": "5.4.3", "@formatjs/intl-listformat": "6.5.3", "@types/hoist-non-react-statics": "^3.3.1", - "@types/react": "16 || 17 || 18", + "@types/react": "^18.0.25", "hoist-non-react-statics": "^3.3.2", "intl-messageformat": "9.13.0", "tslib": "^2.1.0" @@ -38758,6 +38772,13 @@ "rollup-plugin-inject": "^3.0.0" } }, + "rollup-plugin-webpack-stats": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-webpack-stats/-/rollup-plugin-webpack-stats-0.2.0.tgz", + "integrity": "sha512-WDQ9ra6qWjeH/7D3q7lY/r5i9/HPt8OlZvvoQzS7Jdarh2v5+Fgw1BdAU2pBW0LB26J+vNYwdEdyJnkBhbQ2PQ==", + "dev": true, + "requires": {} + }, "rollup-pluginutils": { "version": "2.8.2", "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz", diff --git a/packages/editor/package.json b/packages/editor/package.json index e1323ac47..cbe78380e 100644 --- a/packages/editor/package.json +++ b/packages/editor/package.json @@ -173,6 +173,7 @@ "rollup-plugin-node-polyfills": "^0.2.1", "rollup-plugin-polyfill-node": "^0.12.0", "vite": "^4.4.2", - "vitest": "^0.33.0" + "vitest": "^0.33.0", + "rollup-plugin-webpack-stats": "^0.2.0" } } diff --git a/packages/editor/vite.config.ts b/packages/editor/vite.config.ts index c41663f16..e6232e0a0 100644 --- a/packages/editor/vite.config.ts +++ b/packages/editor/vite.config.ts @@ -1,6 +1,7 @@ import react from "@vitejs/plugin-react"; import history from "connect-history-api-fallback"; import nodePolyfills from "rollup-plugin-polyfill-node"; +import { webpackStats } from "rollup-plugin-webpack-stats"; import { ViteDevServer } from "vite"; import { defineConfig } from "vitest/config"; @@ -34,7 +35,7 @@ export default defineConfig({ // global: "globalThis", // breaks some modules work because of https://github.com/vitejs/vite/issues/6295, done in index.tsx instead // process & buffer are added to global scope in index.host.tsx }, - plugins: [react(), redirectAll()], + plugins: [react(), redirectAll(), webpackStats()], resolve: { alias: { buffer: "rollup-plugin-node-polyfills/polyfills/buffer-es6", From acf018aa25ade012ba1cc22abe713a8753d04d7b Mon Sep 17 00:00:00 2001 From: yousefed Date: Fri, 14 Jul 2023 05:51:00 +0200 Subject: [PATCH 2/2] fix --- .github/workflows/relative-ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/relative-ci.yaml b/.github/workflows/relative-ci.yaml index 92600e4de..d85fa03b7 100644 --- a/.github/workflows/relative-ci.yaml +++ b/.github/workflows/relative-ci.yaml @@ -2,7 +2,7 @@ name: RelativeCI on: workflow_run: - workflows: ["Build"] + workflows: ["build"] types: - completed