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) <noreply@anthropic.com>
This commit is contained in:
shahondin1624
2026-04-12 16:10:06 +02:00
parent 9ed69b78ca
commit c67b9f04a0
5 changed files with 17 additions and 5 deletions
+1
View File
@@ -9,6 +9,7 @@ deps:
# Build frontend # Build frontend
build: deps build: deps
rm -f js/mitgliederverwaltung-main-*.js js/mitgliederverwaltung-main-*.js.LICENSE.txt
npx webpack --node-env production --progress npx webpack --node-env production --progress
# Start containers (detached) # Start containers (detached)
+1 -1
View File
@@ -5,7 +5,7 @@
<name>Mitgliederverwaltung</name> <name>Mitgliederverwaltung</name>
<summary>Mitgliederverwaltung für Pfadfindervereine</summary> <summary>Mitgliederverwaltung für Pfadfindervereine</summary>
<description><![CDATA[Verwaltung von Mitgliedern, Familien, Beiträgen, Lagern und mehr für Pfadfindervereine. Integriert sich in Nextcloud Kalender, Kontakte und Dateien.]]></description> <description><![CDATA[Verwaltung von Mitgliedern, Familien, Beiträgen, Lagern und mehr für Pfadfindervereine. Integriert sich in Nextcloud Kalender, Kontakte und Dateien.]]></description>
<version>0.2.0</version> <version>0.2.5</version>
<licence>agpl</licence> <licence>agpl</licence>
<author>shahondin1624</author> <author>shahondin1624</author>
<namespace>Mitgliederverwaltung</namespace> <namespace>Mitgliederverwaltung</namespace>
+1 -1
View File
@@ -31,7 +31,7 @@ app.use(router)
// @nextcloud/vue v9 reads appName/appVersion via Vue's inject(), // @nextcloud/vue v9 reads appName/appVersion via Vue's inject(),
// not via webpack DefinePlugin globals. // not via webpack DefinePlugin globals.
app.provide('appName', 'mitgliederverwaltung') app.provide('appName', 'mitgliederverwaltung')
app.provide('appVersion', '0.2.0') app.provide('appVersion', '0.2.5')
app.mount('#mitgliederverwaltung') app.mount('#mitgliederverwaltung')
+11
View File
@@ -5,7 +5,18 @@ declare(strict_types=1);
use OCP\Util; use OCP\Util;
$appId = OCA\Mitgliederverwaltung\AppInfo\Application::APP_ID; $appId = OCA\Mitgliederverwaltung\AppInfo\Application::APP_ID;
// Find the hashed JS filename (mitgliederverwaltung-main-<contenthash>.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'); Util::addScript($appId, $appId . '-main');
}
?> ?>
+2 -2
View File
@@ -9,7 +9,7 @@ module.exports = {
output: { output: {
path: path.resolve(__dirname, 'js'), path: path.resolve(__dirname, 'js'),
publicPath: '/custom_apps/mitgliederverwaltung/js/', publicPath: '/custom_apps/mitgliederverwaltung/js/',
filename: '[name].js', filename: '[name]-[contenthash].js',
chunkFilename: '[name]-[contenthash].js', chunkFilename: '[name]-[contenthash].js',
}, },
module: { module: {
@@ -41,7 +41,7 @@ module.exports = {
new VueLoaderPlugin(), new VueLoaderPlugin(),
new webpack.DefinePlugin({ new webpack.DefinePlugin({
appName: JSON.stringify('mitgliederverwaltung'), appName: JSON.stringify('mitgliederverwaltung'),
appVersion: JSON.stringify('0.2.0'), appVersion: JSON.stringify('0.2.5'),
}), }),
new webpack.optimize.LimitChunkCountPlugin({ new webpack.optimize.LimitChunkCountPlugin({
maxChunks: 1, maxChunks: 1,