From b6b9ca1ab58af8231596098a749ad3551fa281b7 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 26 Apr 2025 00:42:43 +0300 Subject: [PATCH] chore(nx/forge): add strange workaround to solve node modules Here we need to ensure that there is no `node_modules` in `apps/desktop` since electron-forge will pick it up and use only that, meaning that all the hoisted dependencies available in the project root will not be accessible and it will error out. See https://github.com/pnpm/pnpm/issues/7880 for more information. --- apps/desktop/package.json | 4 ++-- package.json | 3 ++- pnpm-lock.yaml | 9 ++++++--- pnpm-workspace.yaml | 2 +- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/apps/desktop/package.json b/apps/desktop/package.json index 07ad6823e..4219fb3c2 100644 --- a/apps/desktop/package.json +++ b/apps/desktop/package.json @@ -4,8 +4,7 @@ "private": true, "main": "dist/main.js", "dependencies": { - "@electron/remote": "2.1.2", - "@triliumnext/server": "workspace:*", + "@electron/remote": "2.1.2", "better-sqlite3": "^11.9.1", "electron-debug": "4.1.0", "electron-dl": "4.0.0", @@ -13,6 +12,7 @@ }, "devDependencies": { "@types/electron-squirrel-startup": "1.0.2", + "@triliumnext/server": "workspace:*", "copy-webpack-plugin": "13.0.0", "electron": "35.1.5", "@electron/rebuild": "3.7.2", diff --git a/package.json b/package.json index 9b67bc8e2..0f0fd7c2d 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,8 @@ "typescript-eslint": "^8.19.0", "vite": "^6.0.0", "vitest": "^3.0.0", - "webpack-cli": "^5.1.4" + "webpack-cli": "^5.1.4", + "@triliumnext/server": "workspace:*" }, "license": "AGPL-3.0-only", "author": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index aa7bb8c20..b53f3a78a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -72,6 +72,9 @@ importers: '@swc/helpers': specifier: ~0.5.11 version: 0.5.17 + '@triliumnext/server': + specifier: workspace:* + version: link:apps/server '@types/express': specifier: ^4.17.21 version: 4.17.21 @@ -285,9 +288,6 @@ importers: '@electron/remote': specifier: 2.1.2 version: 2.1.2(electron@35.1.5) - '@triliumnext/server': - specifier: workspace:* - version: link:../server better-sqlite3: specifier: ^11.9.1 version: 11.9.1 @@ -328,6 +328,9 @@ importers: '@electron/rebuild': specifier: 3.7.2 version: 3.7.2 + '@triliumnext/server': + specifier: workspace:* + version: link:../server '@types/electron-squirrel-startup': specifier: 1.0.2 version: 1.0.2 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 92bbd5ba6..811cc3805 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -16,4 +16,4 @@ onlyBuiltDependencies: - electron-winstaller nodeLinker: hoisted -linkWorkspacePackages: true +symlink: false \ No newline at end of file