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",
|
2025-04-18 13:03:01 +03:00
|
|
|
"scripts": {
|
2025-03-18 09:01:14 +02:00
|
|
|
"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-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-19 00:45:39 +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-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",
|
2025-04-22 09:36:32 +03:00
|
|
|
"electron:switch": "electron-rebuild",
|
2025-04-18 17:45:32 +03:00
|
|
|
"docs:build": "typedoc",
|
2025-04-18 16:55:43 +03:00
|
|
|
"test": "npm run client:test && npm run server:test",
|
2025-02-26 20:23:52 +02:00
|
|
|
"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",
|
2025-04-28 22:58:00 +03:00
|
|
|
"test:integration-mem-db": "cross-env nodemon src/main.ts",
|
2025-02-14 08:56:45 +01:00
|
|
|
"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-04-18 16:46:34 +03:00
|
|
|
"dev:linter-fix": "eslint . --fix",
|
2025-02-14 09:00:42 +01:00
|
|
|
"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
|
|
|
},
|
2025-04-19 01:08:44 +03:00
|
|
|
"devDependencies": {
|
2025-05-03 00:24:47 +00:00
|
|
|
"@playwright/test": "1.52.0",
|
2025-06-05 09:18:08 +00:00
|
|
|
"@stylistic/eslint-plugin": "4.4.1",
|
2025-04-18 12:29:40 +03:00
|
|
|
"@types/express": "5.0.1",
|
2025-06-06 06:14:50 +00:00
|
|
|
"@types/node": "22.15.30",
|
2024-12-07 12:39:32 +02:00
|
|
|
"@types/yargs": "17.0.33",
|
2025-06-06 01:31:34 +00:00
|
|
|
"@vitest/coverage-v8": "3.2.2",
|
2025-06-01 01:50:41 +00:00
|
|
|
"eslint": "9.28.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",
|
2024-12-11 00:28:40 +00:00
|
|
|
"jsdoc": "4.0.4",
|
2025-04-18 13:03:01 +03:00
|
|
|
"lorem-ipsum": "2.0.8",
|
2024-07-15 21:15:22 +03:00
|
|
|
"rcedit": "4.0.1",
|
2025-04-18 12:24:41 +03:00
|
|
|
"rimraf": "6.0.1",
|
2025-04-18 13:03:01 +03:00
|
|
|
"tslib": "2.8.1",
|
2025-05-29 01:37:42 +00:00
|
|
|
"typedoc": "0.28.5",
|
2025-04-18 12:09:56 +03:00
|
|
|
"typedoc-plugin-missing-exports": "4.0.0"
|
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
|
|
|
}
|