Skip to content

Build your personal knowledge base with Trilium Notes

chore(release): update version in package.json

Elian Doran6b64c4daaaec
diff --git a/apps/client/package.json b/apps/client/package.json
index 1abafc9941..57b66c524c 100644
--- a/apps/client/package.json
+++ b/apps/client/package.json
@@ -1,6 +1,6 @@
{
"name": "@triliumnext/client",
- "version": "0.0.1",
+ "version": "0.94.0",
"description": "JQuery-based client for TriliumNext, used for both web and desktop (via Electron)",
"private": true,
"license": "AGPL-3.0-only",
@@ -63,4 +63,4 @@
"nx": {
"name": "client"
}
-}
+}
\ No newline at end of file
diff --git a/apps/server/package.json b/apps/server/package.json
index 91aaeb659b..e5253c4833 100644
--- a/apps/server/package.json
+++ b/apps/server/package.json
@@ -1,9 +1,9 @@
{
"name": "@triliumnext/server",
- "version": "0.0.1",
+ "version": "0.94.0",
"description": "Desktop client for TriliumNext, embedding both the client and the server.",
"private": true,
- "dependencies": {
+ "dependencies": {
"better-sqlite3": "11.9.1",
"jquery.fancytree": "2.38.5",
"jquery-hotkeys": "0.2.2",
@@ -11,7 +11,7 @@
},
"devDependencies": {
"@electron/remote": "2.1.2",
- "@excalidraw/excalidraw": "0.18.0",
+ "@excalidraw/excalidraw": "0.18.0",
"@types/archiver": "6.0.3",
"@types/better-sqlite3": "7.6.13",
"@types/cheerio": "0.22.35",
@@ -47,7 +47,7 @@
"boxicons": "2.1.4",
"codemirror": "5.65.19",
"express-http-proxy": "2.1.1",
- "jquery": "3.7.1",
+ "jquery": "3.7.1",
"katex": "0.16.22",
"normalize.css": "8.0.1",
"@anthropic-ai/sdk": "0.39.0",
@@ -149,11 +149,15 @@
}
},
"package": {
- "dependsOn": [ "build" ],
+ "dependsOn": [
+ "build"
+ ],
"command": "bash apps/server/scripts/build-server.sh"
},
"start-prod": {
- "dependsOn": [ "build" ],
+ "dependsOn": [
+ "build"
+ ],
"command": "node apps/server/dist/main.js"
},
"docker-build": {
@@ -191,4 +195,4 @@
}
}
}
-}
+}
\ No newline at end of file
diff --git a/package.json b/package.json
index 2abe363aec..451237663a 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@triliumnext/source",
- "version": "0.0.0",
+ "version": "0.94.0",
"description": "Build your personal knowledge base with TriliumNext Notes",
"directories": {
"doc": "docs"
@@ -13,6 +13,7 @@
"electron:build": "nx build desktop",
"chore:ci-update-nightly-version": "tsx ./scripts/update-nightly-version.ts",
"chore:update-build-info": "tsx ./scripts/update-build-info.ts",
+ "chore:update-version": "tsx ./scripts/update-version.ts",
"test": "pnpm nx run-many -t test"
},
"private": true,
diff --git a/packages/commons/package.json b/packages/commons/package.json
index a4635b3a00..09312903b8 100644
--- a/packages/commons/package.json
+++ b/packages/commons/package.json
@@ -1,6 +1,6 @@
{
"name": "@triliumnext/commons",
- "version": "0.0.1",
+ "version": "0.94.0",
"description": "Shared library between the clients (e.g. browser, Electron) and the server, mostly for type definitions and utility methods.",
"private": true,
"type": "module",
@@ -44,4 +44,4 @@
"dependencies": {
"@swc/helpers": "~0.5.11"
}
-}
+}
\ No newline at end of file
diff --git a/scripts/update-version.ts b/scripts/update-version.ts
new file mode 100644
index 0000000000..b84d835dd8
--- /dev/null
+++ b/scripts/update-version.ts
@@ -0,0 +1,40 @@
+/**
+ * @module
+ *
+ * This script synchronizes the `package.json` version of the monorepo (root `package.json`)
+ * into the apps, so that it is properly displayed.
+ */
+
+import { fileURLToPath } from "url";
+import { dirname, join } from "path";
+import fs from "fs";
+
+function patchPackageJson(packageJsonPath: string, version: string) {
+ // Read the version from package.json and process it.
+ const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf-8"));
+
+ // Write the adjusted version back in.
+ packageJson.version = version;
+ const formattedJson = JSON.stringify(packageJson, null, 2);
+ fs.writeFileSync(packageJsonPath, formattedJson);
+}
+
+function getVersion(packageJsonPath: string) {
+ const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf-8"));
+ return packageJson.version;
+}
+
+function main() {
+ const scriptDir = dirname(fileURLToPath(import.meta.url));
+ const version = getVersion(join(scriptDir, "..", "package.json"));
+
+ for (const appName of ["server", "client"]) {
+ patchPackageJson(join(scriptDir, "..", "apps", appName, "package.json"), version);
+ }
+
+ for (const packageName of ["commons"]) {
+ patchPackageJson(join(scriptDir, "..", "packages", packageName, "package.json"), version);
+ }
+}
+
+main();