diff --git a/.github/workflows/bundle-stats.yml b/.github/workflows/bundle-stats.yml
new file mode 100644
index 00000000..b98537fe
--- /dev/null
+++ b/.github/workflows/bundle-stats.yml
@@ -0,0 +1,41 @@
+name: Comment with HTML on Commit
+
+on:
+ pull_request:
+ branches-ignore:
+ - master
+ - gh-pages
+
+jobs:
+ comment-with-bundle-stats:
+ runs-on: ubuntu-latest
+
+ steps:
+ # Checkout the repository
+ - name: Checkout Repository
+ uses: actions/checkout@v2
+
+ # Generate the HTML file
+ # Replace this with the actual command to generate your HTML
+ - name: Generate HTML
+ run: |
+ echo '
Hello, World!
' > output.html
+
+ # Read the generated HTML content
+ - name: Read HTML Content
+ id: read_html
+ run: |
+ html_content=$(cat output.html)
+ echo "::set-output name=html_content::$html_content"
+
+ - name: Create comment
+ uses: peter-evans/create-or-update-comment@v4
+ with:
+ issue-number: ${{github.event.number}}
+ body: |
+ This is a multi-line test comment
+ - With GitHub **Markdown** :sparkles:
+ - Created by [create-or-update-comment][1]
+
+ [1]: https://github.com/peter-evans/create-or-update-comment
+ reactions: '+1'
diff --git a/packages/backend/package.json b/packages/backend/package.json
index ae51ba39..02967096 100644
--- a/packages/backend/package.json
+++ b/packages/backend/package.json
@@ -43,6 +43,7 @@
"kysely-codegen": "^0.11.0",
"postgres": "^3.4.3",
"rollup-plugin-node-externals": "^7.1.1",
+ "rollup-plugin-visualizer": "^5.12.0",
"typescript": "^5.4.5",
"vitest": "^1.1.0"
}
diff --git a/packages/backend/vite.config.ts b/packages/backend/vite.config.ts
index 3d0002a9..487a1271 100644
--- a/packages/backend/vite.config.ts
+++ b/packages/backend/vite.config.ts
@@ -2,6 +2,7 @@ import { defineConfig } from 'vitest/config';
import packageJson from './package.json';
import path from 'path';
import { nodeExternals } from 'rollup-plugin-node-externals';
+import { visualizer } from 'rollup-plugin-visualizer';
const resolveXqlAliases = Object.keys(packageJson.dependencies)
.filter((dep) => dep.startsWith('@synthql/'))
@@ -30,6 +31,7 @@ export default defineConfig({
deps: true,
peerDeps: true,
}),
+ visualizer({ filename: './build/stats.html' }),
],
},
},
diff --git a/yarn.lock b/yarn.lock
index 4515297e..7350dc10 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -11091,6 +11091,16 @@ rollup-plugin-node-externals@^7.1.1:
resolved "https://registry.yarnpkg.com/rollup-plugin-node-externals/-/rollup-plugin-node-externals-7.1.1.tgz#2a61e362a842fe15406fff86823392d2f5c79599"
integrity sha512-rnIUt0zYdV05muRetoxOiFiKxrrfiyXuM/CgI+akv6NExBTaIiPkH2rCSE9JUCsjta1MXzQVAldpe5tJEszlwQ==
+rollup-plugin-visualizer@^5.12.0:
+ version "5.12.0"
+ resolved "https://registry.yarnpkg.com/rollup-plugin-visualizer/-/rollup-plugin-visualizer-5.12.0.tgz#661542191ce78ee4f378995297260d0c1efb1302"
+ integrity sha512-8/NU9jXcHRs7Nnj07PF2o4gjxmm9lXIrZ8r175bT9dK8qoLlvKTwRMArRCMgpMGlq8CTLugRvEmyMeMXIU2pNQ==
+ dependencies:
+ open "^8.4.0"
+ picomatch "^2.3.1"
+ source-map "^0.7.4"
+ yargs "^17.5.1"
+
rollup@^4.2.0:
version "4.9.2"
resolved "https://registry.npmjs.org/rollup/-/rollup-4.9.2.tgz"
@@ -11569,7 +11579,7 @@ source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.0, source-map@~0.6.1:
resolved "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz"
integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==
-source-map@^0.7.0:
+source-map@^0.7.0, source-map@^0.7.4:
version "0.7.4"
resolved "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz"
integrity sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==
@@ -13037,7 +13047,7 @@ yargs-parser@21.1.1, yargs-parser@^21.1.1:
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35"
integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==
-yargs@^17.6.2, yargs@^17.7.2:
+yargs@^17.5.1, yargs@^17.6.2, yargs@^17.7.2:
version "17.7.2"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.7.2.tgz#991df39aca675a192b816e1e0363f9d75d2aa269"
integrity sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==