2017-10-14 23:31:44 -04:00
|
|
|
{
|
build(electron-forge): execute electron-forge commands in our "build" output context
since we build TS and webpack ourselves and are not using any electron-forge plugins (at least at the moment) -> we should use the "build" folder as build context for electron-forge:
in comparison to running electron-forge in the root folder of the project, this avoids electron-forge from packing the source code multiple times (e.g. once as uncompiled TS, then as compiled JS, and then (partially) a third time as webpack bundled JS files), same as some of the assets.
to achieve this, we run our usual TS/Webpack build process, but then install the npm dependencies *inside* the build folder (as otherwise electron-forge would choke on the missing node_modules it and abort building).
In theory we could avoid cd-ing into the build folder, by providing the "dir" as argument to electron-forge's CLI -- BUT that wouldn't play well with our CI, where we are passing --arch and --platform options to it, which need to come *before* the dir argument.
since we now cd into the "build" folder, we also need to adjust the path in package.json "main" again
2025-03-11 22:12:37 +01:00
|
|
|
"main": "./electron-main.js",
|
2024-07-15 21:15:22 +03:00
|
|
|
"bin": {
|
2024-09-08 15:05:18 +03:00
|
|
|
"trilium": "src/main.js"
|
2024-07-15 21:15:22 +03:00
|
|
|
},
|
2024-07-18 23:59:48 +03:00
|
|
|
"type": "module",
|
2024-07-15 21:15:22 +03:00
|
|
|
"scripts": {
|
2025-03-18 09:01:14 +02:00
|
|
|
"server:start": "cross-env TRILIUM_DATA_DIR=./data TRILIUM_ENV=dev nodemon src/main.ts",
|
|
|
|
"server:start-safe": "cross-env TRILIUM_DATA_DIR=./data TRILIUM_ENV=dev nodemon src/main.ts",
|
|
|
|
"server:start-no-dir": "cross-env TRILIUM_ENV=dev nodemon src/main.ts",
|
|
|
|
"server:start-test": "npm run server:switch && rimraf ./data-test && cross-env TRILIUM_DATA_DIR=./data-test TRILIUM_ENV=dev TRILIUM_PORT=9999 nodemon src/main.ts",
|
2025-02-13 23:18:57 +01:00
|
|
|
"server:qstart": "npm run server:switch && npm run server:start",
|
|
|
|
"server:switch": "rimraf ./node_modules/better-sqlite3 && npm install",
|
2025-03-18 09:01:14 +02:00
|
|
|
"electron:start": "cross-env NODE_OPTIONS=\"--import tsx\" TRILIUM_DATA_DIR=./data TRILIUM_ENV=dev electron ./electron-main.ts --inspect=5858 .",
|
2025-04-03 20:33:12 +03:00
|
|
|
"electron:start-no-dir": "cross-env NODE_OPTIONS=\"--import tsx\" TRILIUM_ENV=dev TRILIUM_PORT=37742 electron --inspect=5858 .",
|
2025-03-18 09:01:14 +02:00
|
|
|
"electron:start-nix": "electron-rebuild --version 33.3.1 && cross-env NODE_OPTIONS=\"--import tsx\" TRILIUM_DATA_DIR=./data TRILIUM_ENV=dev nix-shell -p electron_33 --run \"electron ./electron-main.ts --inspect=5858 .\"",
|
2025-04-03 20:33:12 +03:00
|
|
|
"electron:start-nix-no-dir": "electron-rebuild --version 33.3.1 && cross-env NODE_OPTIONS=\"--import tsx\" TRILIUM_ENV=dev TRILIUM_PORT=37742 nix-shell -p electron_33 --run \"electron ./electron-main.ts --inspect=5858 .\"",
|
2025-03-18 09:01:14 +02:00
|
|
|
"electron:start-prod": "npm run build:prepare-dist && cross-env TRILIUM_DATA_DIR=./data TRILIUM_ENV=prod electron ./dist/electron-main.js --inspect=5858 .",
|
2025-02-25 20:44:10 +02:00
|
|
|
"electron:start-prod-no-dir": "npm run build:prepare-dist && cross-env TRILIUM_ENV=prod electron --inspect=5858 .",
|
2025-03-18 09:01:14 +02:00
|
|
|
"electron:start-prod-nix": "electron-rebuild --version 33.3.1 && npm run build:prepare-dist && cross-env TRILIUM_DATA_DIR=./data TRILIUM_ENV=dev nix-shell -p electron_33 --run \"electron ./dist/electron-main.js --inspect=5858 .\"",
|
2025-02-14 08:43:41 +01:00
|
|
|
"electron:start-prod-nix-no-dir": "electron-rebuild --version 33.3.1 && npm run build:prepare-dist && cross-env TRILIUM_ENV=dev nix-shell -p electron_33 --run \"electron ./dist/electron-main.js --inspect=5858 .\"",
|
2025-02-14 07:36:49 +01:00
|
|
|
"electron:qstart": "npm run electron:switch && npm run electron:start",
|
|
|
|
"electron:switch": "electron-rebuild",
|
2025-04-02 22:18:28 +03:00
|
|
|
"docs:edit": "cross-env NODE_OPTIONS=\"--import tsx\" TRILIUM_DATA_DIR=./data-docs TRILIUM_ENV=dev TRILIUM_INTEGRATION_TEST=memory-no-store TRILIUM_PORT=37741 electron ./electron-docs-main.ts .",
|
|
|
|
"docs:edit-nix": "electron-rebuild --version 33.3.1 && cross-env NODE_OPTIONS=\"--import tsx\" TRILIUM_DATA_DIR=./data-docs TRILIUM_PORT=37741 TRILIUM_ENV=dev TRILIUM_INTEGRATION_TEST=memory-no-store nix-shell -p electron_33 --run \"electron ./electron-docs-main.ts .\"",
|
2025-03-30 22:26:23 +03:00
|
|
|
"demo:edit": "cross-env NODE_OPTIONS=\"--import tsx\" TRILIUM_DATA_DIR=./data-demo TRILIUM_ENV=dev TRILIUM_INTEGRATION_TEST=memory-no-store TRILIUM_PORT=37741 electron ./electron-edit-demo.ts .",
|
2025-04-05 01:23:12 +03:00
|
|
|
"demo:edit-nix": "electron-rebuild --version 33.3.1 && cross-env NODE_OPTIONS=\"--import tsx\" TRILIUM_DATA_DIR=./data-docs TRILIUM_PORT=37741 TRILIUM_ENV=dev TRILIUM_INTEGRATION_TEST=memory-no-store nix-shell -p electron_33 --run \"electron ./electron-edit-demo.ts .\"",
|
2025-03-25 09:03:54 +01:00
|
|
|
"electron-forge:start": "npm run build:prepare-dist && cd ./build && electron-forge start",
|
|
|
|
"electron-forge:make": "npm run build:prepare-dist && cross-env DEBUG=electron-windows-installer:* electron-forge make ./build",
|
2025-04-13 13:07:12 +03:00
|
|
|
"electron-forge:package": "npm run build:prepare-dist && cd ./build && electron-forge package",
|
|
|
|
"docs:build": "typedoc",
|
2025-02-17 23:44:37 +01:00
|
|
|
"build:ts": "tsc -p tsconfig.build.json",
|
2025-02-23 17:49:37 +01:00
|
|
|
"build:clean": "rimraf ./dist ./build",
|
|
|
|
"build:prepare-dist": "npm run build:clean && npm run build:ts && npm run build:webpack && tsx ./bin/copy-dist.ts",
|
2025-02-26 19:16:00 +02:00
|
|
|
"test": "npm run client:test && npm run server:test",
|
2025-02-26 20:23:52 +02:00
|
|
|
"server:test": "cross-env TRILIUM_ENV=dev TRILIUM_DATA_DIR=./integration-tests/db TRILIUM_INTEGRATION_TEST=memory vitest",
|
|
|
|
"server:coverage": "cross-env TRILIUM_ENV=dev TRILIUM_DATA_DIR=./integration-tests/db TRILIUM_INTEGRATION_TEST=memory vitest --coverage",
|
|
|
|
"client:test": "cross-env TRILIUM_ENV=dev TRILIUM_DATA_DIR=./integration-tests/db TRILIUM_INTEGRATION_TEST=memory vitest --root src/public/app",
|
|
|
|
"client:coverage": "cross-env TRILIUM_ENV=dev TRILIUM_DATA_DIR=./integration-tests/db TRILIUM_INTEGRATION_TEST=memory vitest --root src/public/app --coverage",
|
2025-03-07 20:34:01 +02:00
|
|
|
"test:playwright": "playwright test --workers 1",
|
2025-02-14 08:56:45 +01:00
|
|
|
"test:integration-edit-db": "cross-env TRILIUM_INTEGRATION_TEST=edit TRILIUM_PORT=8081 TRILIUM_ENV=dev TRILIUM_DATA_DIR=./integration-tests/db nodemon src/main.ts",
|
|
|
|
"test:integration-mem-db": "cross-env TRILIUM_INTEGRATION_TEST=memory TRILIUM_PORT=8082 TRILIUM_DATA_DIR=./integration-tests/db nodemon src/main.ts",
|
|
|
|
"test:integration-mem-db-dev": "cross-env TRILIUM_INTEGRATION_TEST=memory TRILIUM_PORT=8082 TRILIUM_ENV=dev TRILIUM_DATA_DIR=./integration-tests/db nodemon src/main.ts",
|
2025-02-14 08:54:05 +01:00
|
|
|
"dev:watch-dist": "tsx ./bin/watch-dist.ts",
|
2025-04-02 08:37:57 +02:00
|
|
|
"dev:format-check": "eslint -c eslint.format.config.js .",
|
|
|
|
"dev:format-fix": "eslint -c eslint.format.config.js . --fix",
|
2025-03-03 22:22:01 +01:00
|
|
|
"dev:linter-check": "eslint .",
|
2025-03-01 10:28:25 +01:00
|
|
|
"dev:linter-fix": "eslint . --fix",
|
2025-02-14 08:38:18 +01:00
|
|
|
"chore:update-build-info": "tsx bin/update-build-info.ts",
|
2025-02-14 09:00:42 +01:00
|
|
|
"chore:ci-update-nightly-version": "tsx ./bin/update-nightly-version.ts",
|
|
|
|
"chore:generate-document": "cross-env nodemon ./bin/generate_document.ts 1000",
|
2025-02-15 09:02:23 +01:00
|
|
|
"chore:generate-openapi": "tsx bin/generate-openapi.js"
|
2024-07-15 21:15:22 +03:00
|
|
|
},
|
|
|
|
"dependencies": {
|
2025-04-09 21:08:30 +00:00
|
|
|
"@anthropic-ai/sdk": "0.39.0",
|
2024-12-21 01:13:09 +00:00
|
|
|
"@braintree/sanitize-url": "7.1.1",
|
2024-12-26 00:08:25 +00:00
|
|
|
"@highlightjs/cdn-assets": "11.11.1",
|
2025-01-02 20:48:44 +01:00
|
|
|
"@triliumnext/express-partial-content": "1.0.1",
|
2024-09-13 21:37:50 +03:00
|
|
|
"archiver": "7.0.1",
|
|
|
|
"async-mutex": "0.5.0",
|
|
|
|
"autocomplete.js": "0.38.1",
|
2025-03-20 02:12:59 +00:00
|
|
|
"axios": "1.8.4",
|
2025-03-18 02:55:29 +00:00
|
|
|
"better-sqlite3": "11.9.1",
|
2024-07-15 21:15:22 +03:00
|
|
|
"boxicons": "2.1.4",
|
2025-02-25 02:37:10 +00:00
|
|
|
"chardet": "2.1.0",
|
2024-12-10 23:58:26 -05:00
|
|
|
"cheerio": "1.0.0",
|
2024-12-19 00:53:10 +00:00
|
|
|
"chokidar": "4.0.3",
|
2024-07-15 21:15:22 +03:00
|
|
|
"cls-hooked": "4.2.2",
|
2025-03-21 02:40:27 +00:00
|
|
|
"codemirror": "5.65.19",
|
2025-02-11 00:34:18 +00:00
|
|
|
"compression": "1.8.0",
|
2024-10-22 19:53:22 +03:00
|
|
|
"cookie-parser": "1.4.7",
|
2024-12-28 21:33:05 +01:00
|
|
|
"csrf-csrf": "3.1.0",
|
2024-09-13 21:37:50 +03:00
|
|
|
"dayjs": "1.11.13",
|
2024-07-15 21:15:22 +03:00
|
|
|
"dayjs-plugin-utc": "0.1.2",
|
2024-09-13 21:37:50 +03:00
|
|
|
"ejs": "3.1.10",
|
2024-12-11 00:29:42 +00:00
|
|
|
"electron-debug": "4.1.0",
|
2024-09-13 21:37:50 +03:00
|
|
|
"electron-dl": "4.0.0",
|
2024-09-13 21:49:36 +03:00
|
|
|
"electron-squirrel-startup": "1.0.1",
|
2024-07-15 21:15:22 +03:00
|
|
|
"electron-window-state": "5.0.3",
|
|
|
|
"escape-html": "1.0.3",
|
2024-12-06 02:19:27 +00:00
|
|
|
"express": "4.21.2",
|
2025-03-25 22:31:07 +01:00
|
|
|
"express-openid-connect": "^2.17.1",
|
2024-12-16 00:11:57 +00:00
|
|
|
"express-rate-limit": "7.5.0",
|
2024-10-22 19:25:47 +03:00
|
|
|
"express-session": "1.18.1",
|
2025-01-16 00:57:03 +00:00
|
|
|
"fs-extra": "11.3.0",
|
2025-03-18 02:55:36 +00:00
|
|
|
"helmet": "8.1.0",
|
2024-07-15 21:15:22 +03:00
|
|
|
"html": "1.0.0",
|
|
|
|
"html2plaintext": "2.1.4",
|
|
|
|
"http-proxy-agent": "7.0.2",
|
2024-12-08 00:33:32 +00:00
|
|
|
"https-proxy-agent": "7.0.6",
|
2025-04-16 00:19:35 +00:00
|
|
|
"i18next": "25.0.0",
|
2024-11-28 17:10:37 +00:00
|
|
|
"i18next-fs-backend": "2.6.0",
|
2024-12-10 21:18:14 +00:00
|
|
|
"image-type": "5.2.0",
|
2024-09-13 21:37:50 +03:00
|
|
|
"ini": "5.0.0",
|
2024-07-15 21:15:22 +03:00
|
|
|
"is-animated": "2.0.2",
|
2024-12-10 21:07:27 +00:00
|
|
|
"is-svg": "5.1.0",
|
2024-12-07 10:24:25 +00:00
|
|
|
"jimp": "1.6.0",
|
2025-02-09 21:15:01 +00:00
|
|
|
"js-yaml": "4.1.0",
|
2025-04-14 05:44:48 +00:00
|
|
|
"jsdom": "26.1.0",
|
2025-04-10 18:12:56 +00:00
|
|
|
"katex": "0.16.22",
|
2025-04-10 01:51:23 +00:00
|
|
|
"marked": "15.0.8",
|
2025-03-28 02:43:35 +00:00
|
|
|
"mime-types": "3.0.1",
|
2025-03-21 02:40:48 +00:00
|
|
|
"multer": "1.4.5-lts.2",
|
2024-07-15 21:15:22 +03:00
|
|
|
"normalize-strings": "1.1.1",
|
2024-09-13 21:37:50 +03:00
|
|
|
"normalize.css": "8.0.1",
|
2025-04-09 20:33:55 +00:00
|
|
|
"ollama": "0.5.14",
|
2025-04-09 21:16:29 +00:00
|
|
|
"openai": "4.93.0",
|
2024-07-15 21:15:22 +03:00
|
|
|
"rand-token": "1.0.1",
|
|
|
|
"safe-compare": "1.1.4",
|
|
|
|
"sanitize-filename": "1.6.3",
|
2025-04-17 02:00:26 +00:00
|
|
|
"sanitize-html": "2.16.0",
|
2024-09-13 21:37:50 +03:00
|
|
|
"sax": "1.4.1",
|
2024-07-15 21:15:22 +03:00
|
|
|
"serve-favicon": "2.5.0",
|
|
|
|
"session-file-store": "1.5.0",
|
|
|
|
"stream-throttle": "0.1.3",
|
2025-02-22 00:50:19 +02:00
|
|
|
"strip-bom": "5.0.0",
|
2024-07-15 21:15:22 +03:00
|
|
|
"striptags": "3.2.0",
|
2025-02-09 21:15:01 +00:00
|
|
|
"swagger-ui-express": "5.0.1",
|
2025-03-25 22:31:07 +01:00
|
|
|
"time2fa": "^1.3.0",
|
2024-07-15 21:15:22 +03:00
|
|
|
"tmp": "0.2.3",
|
|
|
|
"unescape": "1.0.1",
|
2025-02-22 00:06:30 +00:00
|
|
|
"ws": "8.18.1",
|
2024-07-15 21:15:22 +03:00
|
|
|
"xml2js": "0.6.2",
|
2024-11-21 21:52:45 +00:00
|
|
|
"yauzl": "3.2.0"
|
2024-07-15 21:15:22 +03:00
|
|
|
},
|
|
|
|
"devDependencies": {
|
2025-03-30 17:04:29 +03:00
|
|
|
"@electron-forge/cli": "7.8.0",
|
|
|
|
"@electron-forge/maker-deb": "7.8.0",
|
|
|
|
"@electron-forge/maker-dmg": "7.8.0",
|
|
|
|
"@electron-forge/maker-flatpak": "7.8.0",
|
|
|
|
"@electron-forge/maker-rpm": "7.8.0",
|
|
|
|
"@electron-forge/maker-squirrel": "7.8.0",
|
|
|
|
"@electron-forge/maker-zip": "7.8.0",
|
|
|
|
"@electron-forge/plugin-auto-unpack-natives": "7.8.0",
|
2025-04-11 02:04:46 +00:00
|
|
|
"@electron/rebuild": "3.7.2",
|
2025-03-18 02:54:43 +00:00
|
|
|
"@playwright/test": "1.51.1",
|
2025-03-31 09:01:39 +02:00
|
|
|
"@stylistic/eslint-plugin": "4.2.0",
|
2024-12-14 00:24:09 +02:00
|
|
|
"@types/archiver": "6.0.3",
|
2025-04-05 00:37:44 +00:00
|
|
|
"@types/better-sqlite3": "7.6.13",
|
2024-12-11 00:17:28 -05:00
|
|
|
"@types/cheerio": "0.22.35",
|
2024-12-14 00:20:56 +02:00
|
|
|
"@types/cls-hooked": "4.3.9",
|
2024-09-13 21:37:50 +03:00
|
|
|
"@types/compression": "1.7.5",
|
2024-11-26 00:58:50 +00:00
|
|
|
"@types/cookie-parser": "1.4.8",
|
2024-09-13 21:37:50 +03:00
|
|
|
"@types/debounce": "1.2.4",
|
|
|
|
"@types/ejs": "3.1.5",
|
2024-09-13 22:46:15 +03:00
|
|
|
"@types/electron-squirrel-startup": "1.0.2",
|
2024-09-13 21:37:50 +03:00
|
|
|
"@types/escape-html": "1.0.4",
|
2025-03-20 02:11:03 +00:00
|
|
|
"@types/express": "5.0.1",
|
2024-11-27 00:47:25 +00:00
|
|
|
"@types/express-session": "1.18.1",
|
2024-12-14 09:43:01 +02:00
|
|
|
"@types/fs-extra": "11.0.4",
|
2024-09-13 21:37:50 +03:00
|
|
|
"@types/html": "1.0.4",
|
2024-09-13 21:44:35 +03:00
|
|
|
"@types/ini": "4.1.1",
|
2025-02-22 15:44:35 +01:00
|
|
|
"@types/js-yaml": "4.0.9",
|
2024-09-13 21:44:35 +03:00
|
|
|
"@types/jsdom": "21.1.7",
|
2024-09-13 21:37:50 +03:00
|
|
|
"@types/mime-types": "2.1.4",
|
|
|
|
"@types/multer": "1.4.12",
|
2025-04-12 02:14:23 +00:00
|
|
|
"@types/node": "22.14.1",
|
2024-09-13 21:37:50 +03:00
|
|
|
"@types/safe-compare": "1.1.2",
|
2025-03-29 00:39:33 +00:00
|
|
|
"@types/sanitize-html": "2.15.0",
|
2024-09-13 21:37:50 +03:00
|
|
|
"@types/sax": "1.2.7",
|
|
|
|
"@types/serve-favicon": "2.5.7",
|
|
|
|
"@types/session-file-store": "1.2.5",
|
|
|
|
"@types/stream-throttle": "0.1.4",
|
2025-03-25 02:58:33 +00:00
|
|
|
"@types/supertest": "6.0.3",
|
2025-02-22 15:44:35 +01:00
|
|
|
"@types/swagger-ui-express": "4.1.8",
|
2024-09-13 21:37:50 +03:00
|
|
|
"@types/tmp": "0.2.6",
|
|
|
|
"@types/turndown": "5.0.5",
|
2025-04-02 01:38:52 +00:00
|
|
|
"@types/ws": "8.18.1",
|
2024-09-13 21:37:50 +03:00
|
|
|
"@types/xml2js": "0.4.14",
|
2024-12-07 12:39:32 +02:00
|
|
|
"@types/yargs": "17.0.33",
|
2025-04-01 01:38:36 +00:00
|
|
|
"@vitest/coverage-v8": "3.1.1",
|
2024-07-15 21:15:22 +03:00
|
|
|
"cross-env": "7.0.3",
|
2025-04-10 01:50:34 +00:00
|
|
|
"electron": "35.1.5",
|
2025-04-05 19:45:58 +00:00
|
|
|
"eslint": "9.24.0",
|
2025-04-08 14:09:37 +02:00
|
|
|
"eslint-plugin-simple-import-sort": "12.1.1",
|
2024-07-15 21:15:22 +03:00
|
|
|
"esm": "3.2.25",
|
2025-03-08 02:45:40 +02:00
|
|
|
"globals": "16.0.0",
|
2025-03-12 02:59:14 +00:00
|
|
|
"happy-dom": "17.4.4",
|
2024-12-11 00:28:40 +00:00
|
|
|
"jsdoc": "4.0.4",
|
2024-07-15 21:15:22 +03:00
|
|
|
"lorem-ipsum": "2.0.8",
|
2024-12-14 00:21:43 +02:00
|
|
|
"nodemon": "3.1.9",
|
2024-07-15 21:15:22 +03:00
|
|
|
"rcedit": "4.0.1",
|
2024-09-13 21:37:50 +03:00
|
|
|
"rimraf": "6.0.1",
|
2025-03-21 02:40:58 +00:00
|
|
|
"supertest": "7.1.0",
|
2025-02-13 17:02:03 +01:00
|
|
|
"swagger-jsdoc": "6.2.8",
|
2024-11-02 10:23:46 +02:00
|
|
|
"tslib": "2.8.1",
|
2025-04-10 01:50:46 +00:00
|
|
|
"typedoc": "0.28.2",
|
2025-04-12 13:13:30 +03:00
|
|
|
"typedoc-plugin-missing-exports": "4.0.0",
|
2025-04-05 00:38:17 +00:00
|
|
|
"typescript": "5.8.3",
|
2025-04-18 02:28:33 +03:00
|
|
|
"typescript-eslint": "8.30.1"
|
2025-03-30 17:21:35 +03:00
|
|
|
},
|
|
|
|
"optionalDependencies": {
|
2025-03-31 09:00:15 +02:00
|
|
|
"appdmg": "0.6.6"
|
2024-07-15 21:15:22 +03:00
|
|
|
}
|
2024-05-03 21:18:20 +02:00
|
|
|
}
|