From c67b9f04a02867499555e2a02b789e5ac55ebb85 Mon Sep 17 00:00:00 2001 From: shahondin1624 Date: Sun, 12 Apr 2026 16:10:06 +0200 Subject: [PATCH] chore: bump version to 0.2.5 and add webpack content hash for cache busting Version bump across info.xml, webpack.config.js, and main.js. Webpack now outputs content-hashed filenames and templates/index.php dynamically resolves them. Makefile cleans stale JS bundles before rebuilding. Co-Authored-By: Claude Opus 4.6 (1M context) --- Makefile | 1 + appinfo/info.xml | 2 +- src/main.js | 2 +- templates/index.php | 13 ++++++++++++- webpack.config.js | 4 ++-- 5 files changed, 17 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 5a2a8f3..5c00bc0 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,7 @@ deps: # Build frontend build: deps + rm -f js/mitgliederverwaltung-main-*.js js/mitgliederverwaltung-main-*.js.LICENSE.txt npx webpack --node-env production --progress # Start containers (detached) diff --git a/appinfo/info.xml b/appinfo/info.xml index f61a35e..b3a817d 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -5,7 +5,7 @@ Mitgliederverwaltung Mitgliederverwaltung für Pfadfindervereine - 0.2.0 + 0.2.5 agpl shahondin1624 Mitgliederverwaltung diff --git a/src/main.js b/src/main.js index bb29102..027bf6d 100644 --- a/src/main.js +++ b/src/main.js @@ -31,7 +31,7 @@ app.use(router) // @nextcloud/vue v9 reads appName/appVersion via Vue's inject(), // not via webpack DefinePlugin globals. app.provide('appName', 'mitgliederverwaltung') -app.provide('appVersion', '0.2.0') +app.provide('appVersion', '0.2.5') app.mount('#mitgliederverwaltung') diff --git a/templates/index.php b/templates/index.php index b2f20a5..1a9d0e8 100644 --- a/templates/index.php +++ b/templates/index.php @@ -5,7 +5,18 @@ declare(strict_types=1); use OCP\Util; $appId = OCA\Mitgliederverwaltung\AppInfo\Application::APP_ID; -Util::addScript($appId, $appId . '-main'); + +// Find the hashed JS filename (mitgliederverwaltung-main-.js) +$jsDir = __DIR__ . '/../js'; +$jsFiles = glob($jsDir . '/mitgliederverwaltung-main-*.js'); +if (!empty($jsFiles)) { + // Use the filename without extension as the script name + $scriptName = basename(end($jsFiles), '.js'); + Util::addScript($appId, $scriptName); +} else { + // Fallback for development + Util::addScript($appId, $appId . '-main'); +} ?> diff --git a/webpack.config.js b/webpack.config.js index 106545a..36551d7 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -9,7 +9,7 @@ module.exports = { output: { path: path.resolve(__dirname, 'js'), publicPath: '/custom_apps/mitgliederverwaltung/js/', - filename: '[name].js', + filename: '[name]-[contenthash].js', chunkFilename: '[name]-[contenthash].js', }, module: { @@ -41,7 +41,7 @@ module.exports = { new VueLoaderPlugin(), new webpack.DefinePlugin({ appName: JSON.stringify('mitgliederverwaltung'), - appVersion: JSON.stringify('0.2.0'), + appVersion: JSON.stringify('0.2.5'), }), new webpack.optimize.LimitChunkCountPlugin({ maxChunks: 1,