Skip to content

Build your personal knowledge base with Trilium Notes

feat(ci): introduce RelativeCI for the client

Elian Doranc8b3cdf01b28
diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml
index 2e8c786ce9..be719993fa 100644
--- a/.github/workflows/dev.yml
+++ b/.github/workflows/dev.yml
@@ -74,7 +74,14 @@ jobs:
run: pnpm install --frozen-lockfile
- name: Update build info
run: pnpm run chore:update-build-info
- - name: Trigger build
+ - name: Trigger client build
+ run: pnpm nx run client:build
+ - name: Send client bundle stats to RelativeCI
+ uses: relative-ci/agent-action@v3
+ with:
+ webpackStatsFile: ./apps/client/dist/webpack-stats.json
+ key: ${{ secrets.RELATIVE_CI_CLIENT_KEY }}
+ - name: Trigger server build
run: pnpm nx run server:build
- uses: docker/setup-buildx-action@v3
- uses: docker/build-push-action@v6
diff --git a/apps/client/vite.config.mts b/apps/client/vite.config.mts
index 839c245783..3c701eebed 100644
--- a/apps/client/vite.config.mts
+++ b/apps/client/vite.config.mts
@@ -3,6 +3,7 @@ import { join, resolve } from 'path';
import { defineConfig } from 'vite';
import { viteStaticCopy } from 'vite-plugin-static-copy'
import asset_path from './src/asset_path';
+import webpackStatsPlugin from 'rollup-plugin-webpack-stats';
const assets = [ "assets", "stylesheets", "libraries", "fonts", "translations" ];
@@ -33,7 +34,8 @@ export default defineConfig(() => ({
dest: "",
}
]
- })
+ }),
+ webpackStatsPlugin()
],
resolve: {
alias: [
diff --git a/apps/server/package.json b/apps/server/package.json
index abb9a19ef6..77ef988596 100644
--- a/apps/server/package.json
+++ b/apps/server/package.json
@@ -282,7 +282,10 @@
{
"glob": "**/*",
"input": "apps/client/dist",
- "output": "public"
+ "output": "public",
+ "ignore": [
+ "webpack-stats.json"
+ ]
},
{
"glob": "**/*",
diff --git a/package.json b/package.json
index 4029ac7dbd..2d20435b1a 100644
--- a/package.json
+++ b/package.json
@@ -55,6 +55,7 @@
"jsonc-eslint-parser": "^2.1.0",
"nx": "21.1.3",
"react-refresh": "^0.17.0",
+ "rollup-plugin-webpack-stats": "2.0.7",
"tslib": "^2.3.0",
"tsx": "4.19.4",
"typescript": "~5.8.0",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 0e44320662..b704572935 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -123,6 +123,9 @@ importers:
react-refresh:
specifier: ^0.17.0
version: 0.17.0
+ rollup-plugin-webpack-stats:
+ specifier: 2.0.7
tslib:
specifier: ^2.3.0
version: 2.8.1
@@ -10957,6 +10960,18 @@ packages:
resolution: {integrity: sha512-IXgzBWvWQwE6PrDI05OvmXUIruQTcoMDzRsOd5CDvHCVLcLHMTSYvOK5Cm46kWqlV3yAbuSpBZdJ5oP5OUoStg==}
+ resolution: {integrity: sha512-rpz+EIdA9rQfkK/RiiMde0H8r/yCU4ilQJVZNFO6o1pU1H+pTMhu5Nlkm4+7J95+J98n0T5gxQPwyi/sxCRQXw==}
+ engines: {node: '>=18'}
+ peerDependencies:
+ rollup: ^3.0.0 || ^4.0.0
+ vite: ^5.0.0 || ^6.0.0
+ peerDependenciesMeta:
+ rollup:
+ optional: true
+ vite:
+ optional: true
+
resolution: {integrity: sha512-A2K2sao84OsTmDxXG83JTCdXWrmgvQkkI38XDat46rdtpGMRm9tSYqeCdlwwGDJF4kKIafhV1mUidqu8MxUGig==}
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
@@ -10969,6 +10984,18 @@ packages:
peerDependencies:
rollup: ^3.0.0||^4.0.0
+ resolution: {integrity: sha512-aAd/4GrnsDuwFIlPJpIJ/wcu6msiza5lNZIrfWXmskwLSEx9GhJlKFYU3HHgl5XHLgdF45ajCrV8X0k3EV4ztw==}
+ engines: {node: '>=18'}
+ peerDependencies:
+ rollup: ^3.0.0 || ^4.0.0
+ vite: ^5.0.0 || ^6.0.0
+ peerDependenciesMeta:
+ rollup:
+ optional: true
+ vite:
+ optional: true
+
resolution: {integrity: sha512-Noe455xmA96nnqH5piFtLobsGbCij7Tu+tb3c1vYjNbTkfzGqXqQXG3wJaYXkRZuQ0vEYN4bhwg7QnIrqB5B+w==}
engines: {node: '>=18.0.0', npm: '>=8.0.0'}
@@ -25217,6 +25244,11 @@ snapshots:
+ optionalDependencies:
+ rollup: 4.40.0
+
dependencies:
'@rollup/pluginutils': 4.2.1
@@ -25244,6 +25276,13 @@ snapshots:
'@rollup/pluginutils': 5.1.4([email protected])
rollup: 4.40.0
+ dependencies:
+ optionalDependencies:
+ rollup: 4.40.0
+
dependencies:
'@types/estree': 1.0.7