chore(release): update version in package.json

This commit is contained in:
Elian Doran 2025-05-02 21:29:19 +03:00
parent d1b945e769
commit 6b64c4daaa
No known key found for this signature in database
5 changed files with 57 additions and 12 deletions

View File

@ -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",

View File

@ -1,6 +1,6 @@
{
"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": {
@ -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": {

View File

@ -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,

View File

@ -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",

40
scripts/update-version.ts Normal file
View File

@ -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();