Skip to content

A modern, self-hosted backup solution for secure, encrypted backups across local and cloud storage.

fix: incorrect version number in the ui.

towfiqi8aa8cea6bcde
diff --git a/backend/scripts/build-pkg.js b/backend/scripts/build-pkg.js
index cc172bd..1100700 100644
--- a/backend/scripts/build-pkg.js
+++ b/backend/scripts/build-pkg.js
@@ -1,5 +1,7 @@
import { build } from 'esbuild';
-import packageJson from '../package.json' with { type: 'json' };
+// Read version from root package.json (monorepo source of truth)
+import rootPackageJson from '../../package.json' with { type: 'json' };
+import backendPackageJson from '../package.json' with { type: 'json' };
import { readFile } from 'fs/promises';
import { extname, join } from 'path';
import { createRequire } from 'module';
@@ -47,7 +49,7 @@ console.log('--- Starting Pluton Executable Build Process (esbuild) ---');
// 1. Set the environment variables
process.env.NODE_ENV = 'production';
-process.env.APP_VERSION = packageJson.version;
+process.env.APP_VERSION = rootPackageJson.version;
console.log(`Setting NODE_ENV=${process.env.NODE_ENV}`);
console.log(`Setting APP_VERSION=${process.env.APP_VERSION}`);
@@ -59,7 +61,7 @@ try {
// Get dependencies to mark as external
// We mark all dependencies as external because pkg will handle them
// or they are native modules that shouldn't be bundled
- const dependencies = Object.keys(packageJson.dependencies || {});
+ const dependencies = Object.keys(backendPackageJson.dependencies || {});
// Remove better-sqlite3 from external list because we are aliasing it
const bs3Index = dependencies.indexOf('better-sqlite3');
@@ -101,7 +103,7 @@ try {
define: {
'import.meta.url': '__import_meta_url',
'process.env.NODE_ENV': '"production"',
- 'process.env.APP_VERSION': JSON.stringify(packageJson.version),
+ 'process.env.APP_VERSION': JSON.stringify(rootPackageJson.version),
},
inject: [join(process.cwd(), 'scripts/esbuild-import-meta-url-shim.js')],
});
diff --git a/backend/scripts/build.js b/backend/scripts/build.js
index cfdb579..7eedad3 100644
--- a/backend/scripts/build.js
+++ b/backend/scripts/build.js
@@ -2,13 +2,14 @@ import { execSync } from 'child_process';
import { readdir, readFile, writeFile } from 'fs/promises';
import { join, extname } from 'path';
import { minify } from 'terser';
-import packageJson from '../package.json' with { type: 'json' };
+// Read version from root package.json (monorepo source of truth)
+import rootPackageJson from '../../package.json' with { type: 'json' };
console.log('--- Starting Pluton Build Process ---');
// 1. Set the environment variables
process.env.NODE_ENV = 'production';
-process.env.APP_VERSION = packageJson.version;
+process.env.APP_VERSION = rootPackageJson.version;
console.log(`Setting NODE_ENV=${process.env.NODE_ENV}`);
console.log(`Setting APP_VERSION=${process.env.APP_VERSION}`);
diff --git a/installers/windows/build-installer.js b/installers/windows/build-installer.js
index 4ead1ef..cd67386 100644
--- a/installers/windows/build-installer.js
+++ b/installers/windows/build-installer.js
@@ -38,11 +38,11 @@ const serviceName = outputName
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
.join("");
-// Get version from backend/package.json
-const backendPackageJson = JSON.parse(
- readFileSync(join(rootDir, "backend", "package.json"), "utf-8")
+// Get version from root package.json (monorepo source of truth)
+const rootPackageJson = JSON.parse(
+ readFileSync(join(rootDir, "package.json"), "utf-8"),
);
-const version = backendPackageJson.version || "0.0.0";
+const version = rootPackageJson.version || "0.0.0";
console.log("╔═══════════════════════════════════════════════════════════╗");
console.log("║ 🪟 Windows Installer Build Script ║");
@@ -69,15 +69,15 @@ let issContent = readFileSync(templateIssPath, "utf-8");
// Replace the #define values at the top of the file
issContent = issContent.replace(
/#define MyAppName ".*"/,
- `#define MyAppName "${displayName}"`
+ `#define MyAppName "${displayName}"`,
);
issContent = issContent.replace(
/#define MyAppVersion ".*"/,
- `#define MyAppVersion "${version}"`
+ `#define MyAppVersion "${version}"`,
);
issContent = issContent.replace(
/#define MyAppServiceName ".*"/,
- `#define MyAppServiceName "${serviceName}"`
+ `#define MyAppServiceName "${serviceName}"`,
);
// Update file paths to use the correct distribution folder
@@ -88,7 +88,7 @@ issContent = issContent.replace(/pluton-win-x64/g, distFolderName);
// Update output filename
issContent = issContent.replace(
/OutputBaseFilename=.*/,
- `OutputBaseFilename=${outputName}-setup`
+ `OutputBaseFilename=${outputName}-setup`,
);
// Write the generated .iss file
@@ -114,7 +114,7 @@ for (const path of possibleIsccPaths) {
if (!isccPath) {
console.error("❌ Inno Setup compiler (ISCC.exe) not found!");
console.error(
- " Please install Inno Setup from: https://jrsoftware.org/isdownload.php"
+ " Please install Inno Setup from: https://jrsoftware.org/isdownload.php",
);
console.error(" Expected locations:");
possibleIsccPaths.forEach((p) => console.error(` - ${p}`));
@@ -132,7 +132,7 @@ try {
});
console.log(
- "\n╔═══════════════════════════════════════════════════════════╗"
+ "\n╔═══════════════════════════════════════════════════════════╗",
);
console.log("║ ✅ Windows Installer Build Complete! ║");
console.log("╚═══════════════════════════════════════════════════════════╝");