mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 10:26:08 +01:00 
			
		
		
		
	Merge remote-tracking branch 'origin/develop' into feature/update_electron
This commit is contained in:
		
							
								
								
									
										11
									
								
								.github/workflows/dev.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										11
									
								
								.github/workflows/dev.yml
									
									
									
									
										vendored
									
									
								
							| @@ -1,9 +1,14 @@ | ||||
| name: Dev | ||||
| on: | ||||
|   push: | ||||
|     branches: | ||||
|       - '!develop' | ||||
|       - '!feature/update*' | ||||
|     branches-ignore: | ||||
|       - 'develop' | ||||
|       - 'feature/update**' | ||||
|  | ||||
| concurrency: | ||||
|   group: ${{ github.workflow }}-${{ github.ref }} | ||||
|   cancel-in-progress: true | ||||
|  | ||||
| jobs: | ||||
|   build_docker: | ||||
|     name: Build Docker image | ||||
|   | ||||
							
								
								
									
										50
									
								
								.github/workflows/main.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										50
									
								
								.github/workflows/main.yml
									
									
									
									
										vendored
									
									
								
							| @@ -4,9 +4,15 @@ on: | ||||
|     branches: | ||||
|       - 'develop' | ||||
|       - 'feature/update*' | ||||
|  | ||||
| concurrency: | ||||
|   group: ${{ github.workflow }}-${{ github.ref }} | ||||
|   cancel-in-progress: true | ||||
|  | ||||
| env: | ||||
|   REGISTRY: ghcr.io | ||||
|   IMAGE_NAME: ${{ github.repository }} | ||||
|  | ||||
| jobs: | ||||
|   build_darwin-x64: | ||||
|     name: Build macOS x86_64 | ||||
| @@ -19,7 +25,9 @@ jobs: | ||||
|           node-version: 20 | ||||
|           cache: "npm" | ||||
|       - run: npm ci | ||||
|       - run: ./bin/build-mac-x64.sh | ||||
|       - run: | | ||||
|           npm run update-build-info | ||||
|           ./bin/build-mac-x64.sh | ||||
|       - uses: actions/upload-artifact@v4 | ||||
|         with: | ||||
|           name: trilium-mac-x64.zip | ||||
| @@ -35,7 +43,9 @@ jobs: | ||||
|           node-version: 20 | ||||
|           cache: "npm" | ||||
|       - run: npm ci | ||||
|       - run: ./bin/build-mac-arm64.sh | ||||
|       - run: | | ||||
|           npm run update-build-info | ||||
|           ./bin/build-mac-arm64.sh | ||||
|       - uses: actions/upload-artifact@v4 | ||||
|         with: | ||||
|           name: trilium-mac-arm64.zip | ||||
| @@ -51,7 +61,9 @@ jobs: | ||||
|           node-version: 20 | ||||
|           cache: "npm" | ||||
|       - run: npm ci | ||||
|       - run: ./bin/build-linux-x64.sh | ||||
|       - run: | | ||||
|           npm run update-build-info | ||||
|           ./bin/build-linux-x64.sh | ||||
|       - uses: actions/upload-artifact@v4 | ||||
|         with: | ||||
|           name: trilium-linux-x64.tar.xz | ||||
| @@ -71,7 +83,9 @@ jobs: | ||||
|           node-version: 20 | ||||
|           cache: "npm" | ||||
|       - run: npm ci | ||||
|       - run: ./bin/build-server.sh | ||||
|       - run: | | ||||
|           npm run update-build-info | ||||
|           ./bin/build-server.sh | ||||
|       - uses: actions/upload-artifact@v4 | ||||
|         with: | ||||
|           name: trilium-linux-x64-server.tar.xz | ||||
| @@ -94,11 +108,33 @@ jobs: | ||||
|           node-version: 20 | ||||
|           cache: "npm" | ||||
|       - run: npm ci | ||||
|       - run: ./bin/build-win-x64.sh | ||||
|       - run: | | ||||
|           npm run update-build-info | ||||
|           ./bin/build-win-x64.sh DONTPACK | ||||
|       - uses: actions/upload-artifact@v4 | ||||
|         with: | ||||
|           name: trilium-windows-x64.zip | ||||
|           path: dist/trilium-windows-x64-*.zip | ||||
|           name: trilium-windows-x64 | ||||
|           path: dist/trilium-windows-x64 | ||||
|   build_windows-installer: | ||||
|     name: Build Windows x86_64 (Setup) | ||||
|     runs-on: windows-latest | ||||
|     steps: | ||||
|       - uses: actions/checkout@v4 | ||||
|       - name: Set up node & dependencies | ||||
|         uses: actions/setup-node@v4 | ||||
|         with: | ||||
|           node-version: 20 | ||||
|           cache: "npm" | ||||
|       - run: npm ci | ||||
|       - name: Run installer build | ||||
|         run: | | ||||
|           npm run update-build-info | ||||
|           npm run make-electron | ||||
|       - name: Publish installer artifact | ||||
|         uses: actions/upload-artifact@v4 | ||||
|         with: | ||||
|           name: TriliumNext Notes for Windows (Setup) | ||||
|           path: out/make/squirrel.windows/x64/*.exe | ||||
|   build_docker: | ||||
|     name: Build Docker image | ||||
|     runs-on: ubuntu-latest | ||||
|   | ||||
							
								
								
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -15,3 +15,5 @@ data/ | ||||
| data-test/ | ||||
| tmp/ | ||||
| .eslintcache | ||||
|  | ||||
| out/ | ||||
| @@ -35,7 +35,7 @@ echo "Packaging linux x64 electron build" | ||||
| BUILD_DIR=./dist/trilium-linux-x64 | ||||
| rm -rf "$BUILD_DIR" | ||||
|  | ||||
| mv "./dist/Trilium Notes-linux-x64" "$BUILD_DIR" | ||||
| mv "./dist/TriliumNext Notes-linux-x64" "$BUILD_DIR" | ||||
|  | ||||
| cp images/app-icons/png/128x128.png "$BUILD_DIR"/icon.png | ||||
| cp bin/tpl/anonymize-database.sql "$BUILD_DIR"/ | ||||
|   | ||||
| @@ -21,7 +21,7 @@ BUILD_DIR=./dist/trilium-mac-arm64 | ||||
| rm -rf $BUILD_DIR | ||||
|  | ||||
| # Mac build has by default useless directory level | ||||
| mv "./dist/Trilium Notes-darwin-arm64" $BUILD_DIR | ||||
| mv "./dist/TriliumNext Notes-darwin-arm64" $BUILD_DIR | ||||
|  | ||||
| cp bin/tpl/anonymize-database.sql $BUILD_DIR/ | ||||
|  | ||||
|   | ||||
| @@ -21,7 +21,7 @@ BUILD_DIR=./dist/trilium-mac-x64 | ||||
| rm -rf $BUILD_DIR | ||||
|  | ||||
| # Mac build has by default useless directory level | ||||
| mv "./dist/Trilium Notes-darwin-x64" $BUILD_DIR | ||||
| mv "./dist/TriliumNext Notes-darwin-x64" $BUILD_DIR | ||||
|  | ||||
| cp bin/tpl/anonymize-database.sql $BUILD_DIR/ | ||||
|  | ||||
|   | ||||
| @@ -25,7 +25,7 @@ echo "Packaging windows x64 electron build" | ||||
| BUILD_DIR=./dist/trilium-windows-x64 | ||||
| rm -rf $BUILD_DIR | ||||
|  | ||||
| mv "./dist/Trilium Notes-win32-x64" $BUILD_DIR | ||||
| mv "./dist/TriliumNext Notes-win32-x64" $BUILD_DIR | ||||
|  | ||||
| cp bin/tpl/anonymize-database.sql $BUILD_DIR/ | ||||
|  | ||||
| @@ -34,9 +34,11 @@ rm -rf $BUILD_DIR/dump-db/node_modules | ||||
|  | ||||
| cp bin/tpl/trilium-{portable,no-cert-check,safe-mode}.bat $BUILD_DIR/ | ||||
|  | ||||
| echo "Zipping windows x64 electron distribution..." | ||||
| VERSION=`jq -r ".version" package.json` | ||||
| if [ "$1" != "DONTPACK" ] | ||||
| then | ||||
|   echo "Zipping windows x64 electron distribution..." | ||||
|   VERSION=`jq -r ".version" package.json` | ||||
|  | ||||
| cd dist | ||||
|  | ||||
| zip -r9 trilium-windows-x64-${VERSION}.zip trilium-windows-x64 | ||||
|   cd dist | ||||
|   zip -r9 trilium-windows-x64-${VERSION}.zip trilium-windows-x64 | ||||
| fi | ||||
| @@ -35,27 +35,36 @@ for f in 'package.json' 'package-lock.json' 'README.md' 'LICENSE' 'config-sample | ||||
|     cp "$f" "$DIR"/ | ||||
| done | ||||
|  | ||||
| # Patch package.json main | ||||
| sed -i 's/.\/dist\/electron.js/electron.js/g' "$DIR/package.json" | ||||
|  | ||||
| script_dir=$(realpath $(dirname $0)) | ||||
| cp -Rv "$script_dir/../build/src" "$DIR" | ||||
| cp -R "$script_dir/../build/src" "$DIR" | ||||
| cp "$script_dir/../build/electron.js" "$DIR" | ||||
|  | ||||
| # run in subshell (so we return to original dir) | ||||
| (cd $DIR && npm install --only=prod) | ||||
| (cd $DIR && npm run switch-electron) | ||||
| (cd $DIR && npm install --omit=dev) | ||||
|  | ||||
| if [[ -d "$DIR"/node_modules ]]; then | ||||
| # cleanup of useless files in dependencies | ||||
|     for d in 'image-q/demo' 'better-sqlite3/Release' 'better-sqlite3/deps/sqlite3.tar.gz' '@jimp/plugin-print/fonts' 'jimp/browser' 'jimp/fonts'; do | ||||
|         [[ -e "$DIR"/node_modules/"$d" ]] && rm -rv "$DIR"/node_modules/"$d" | ||||
|     # cleanup of useless files in dependencies | ||||
|     for d in 'image-q/demo' \ | ||||
|         '@excalidraw/excalidraw/dist/excalidraw-assets-dev' '@excalidraw/excalidraw/dist/excalidraw.development.js' '@excalidraw/excalidraw/dist/excalidraw-with-preact.development.js' \ | ||||
|         'mermaid/dist/mermaid.js' \ | ||||
|         'boxicons/svg' 'boxicons/node_modules/react'/* \ | ||||
|         'better-sqlite3/Release' 'better-sqlite3/deps/sqlite3.tar.gz' 'better-sqlite3/deps/sqlite3' \ | ||||
|         '@jimp/plugin-print/fonts' 'jimp/browser' 'jimp/fonts'; do | ||||
|         [[ -e "$DIR"/node_modules/"$d" ]] && rm -r "$DIR"/node_modules/"$d" | ||||
|     done | ||||
|  | ||||
| # delete all tests (there are often large images as test file for jimp etc.) | ||||
|     for d in 'test' 'docs' 'demo'; do | ||||
|         find "$DIR"/node_modules -name "$d" -exec rm -rf {} \; | ||||
|     # delete all tests (there are often large images as test file for jimp etc.) | ||||
|     for d in 'test' 'docs' 'demo' 'example'; do | ||||
|         find "$DIR"/node_modules -name "$d" -exec rm -rf {} + | ||||
|     done | ||||
| fi | ||||
|  | ||||
| find $DIR/libraries -name "*.map" -type f -delete | ||||
| find $DIR/node_modules -name "*.map" -type f -delete | ||||
| find $DIR -name "*.ts" -type f -delete | ||||
|  | ||||
| d="$DIR"/src/public | ||||
| [[ -d "$d"/app-dist ]] || mkdir -pv "$d"/app-dist | ||||
|   | ||||
| @@ -32,7 +32,7 @@ mv package.json.tmp package.json | ||||
|  | ||||
| git add package.json | ||||
|  | ||||
| echo 'export = { buildDate:"'`date --iso-8601=seconds`'", buildRevision: "'`git log -1 --format="%H"`'" };' > src/services/build.ts | ||||
| npm run update-build-info | ||||
|  | ||||
| git add src/services/build.ts | ||||
|  | ||||
| @@ -65,7 +65,9 @@ if [[ $TAG == *"beta"* ]]; then | ||||
|   EXTRA=--prerelease | ||||
| fi | ||||
|  | ||||
| echo "$GITHUB_CLI_AUTH_TOKEN" | gh auth login --with-token | ||||
| if [ ! -z "$GITHUB_CLI_AUTH_TOKEN" ]; then | ||||
|   echo "$GITHUB_CLI_AUTH_TOKEN" | gh auth login --with-token | ||||
| fi | ||||
|  | ||||
| gh release create "$TAG" \ | ||||
|     --title "$TAG release" \ | ||||
|   | ||||
							
								
								
									
										25
									
								
								bin/update-build-info.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								bin/update-build-info.ts
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,25 @@ | ||||
| import child_process from "child_process"; | ||||
| import fs from "fs"; | ||||
|  | ||||
| function getBuildDate() { | ||||
|     const now = new Date(); | ||||
|     now.setMilliseconds(0); | ||||
|     return now | ||||
|         .toISOString() | ||||
|         .replace(".000", ""); | ||||
| } | ||||
|  | ||||
| function getGitRevision() { | ||||
|     return child_process.execSync('git log -1 --format="%H"') | ||||
|         .toString("utf-8") | ||||
|         .trimEnd(); | ||||
| } | ||||
|  | ||||
| const output = `\ | ||||
| export = { | ||||
|     buildDate: "${getBuildDate()}", | ||||
|     buildRevision: "${getGitRevision()}" | ||||
| }; | ||||
| `; | ||||
|  | ||||
| fs.writeFileSync("src/services/build.ts", output); | ||||
| @@ -6,6 +6,11 @@ import appIconService = require("./src/services/app_icon"); | ||||
| import windowService = require("./src/services/window"); | ||||
| import tray = require("./src/services/tray"); | ||||
|  | ||||
| // Prevent Trilium starting twice on first install and on uninstall for the Windows installer. | ||||
| if (require('electron-squirrel-startup')) { | ||||
|   process.exit(0); | ||||
| } | ||||
|  | ||||
| // Adds debug features like hotkeys for triggering dev tools and reload | ||||
| require("electron-debug")(); | ||||
|  | ||||
|   | ||||
							
								
								
									
										23
									
								
								forge.config.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								forge.config.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,23 @@ | ||||
| module.exports = { | ||||
|   packagerConfig: { | ||||
|     asar: true, | ||||
|     // icon will break once we add .dmg support, since the .ico & .icns have to be in same dir (see https://www.electronforge.io/guides/create-and-add-icons#windows-and-macos) | ||||
|     icon: "./images/app-icons/win/icon" | ||||
|   }, | ||||
|   rebuildConfig: {}, | ||||
|   makers: [ | ||||
|     { | ||||
|       name: '@electron-forge/maker-squirrel', | ||||
|       config: { | ||||
|         setupIcon: "./images/app-icons/win/icon.ico", | ||||
|         loadingGif: "./images/app-icons/win/setup-banner.gif" | ||||
|       } | ||||
|     } | ||||
|   ], | ||||
|   plugins: [ | ||||
|     { | ||||
|       name: '@electron-forge/plugin-auto-unpack-natives', | ||||
|       config: {}, | ||||
|     }, | ||||
|   ], | ||||
| }; | ||||
							
								
								
									
										
											BIN
										
									
								
								images/app-icons/win/setup-banner.gif
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								images/app-icons/win/setup-banner.gif
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 8.5 KiB | 
							
								
								
									
										
											BIN
										
									
								
								images/app-icons/win/setup-banner.xcf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								images/app-icons/win/setup-banner.xcf
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										13430
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										13430
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										71
									
								
								package.json
									
									
									
									
									
								
							
							
						
						
									
										71
									
								
								package.json
									
									
									
									
									
								
							| @@ -1,23 +1,29 @@ | ||||
| { | ||||
|   "name": "trilium", | ||||
|   "productName": "Trilium Notes", | ||||
|   "description": "Trilium Notes", | ||||
|   "version": "0.90.0-beta", | ||||
|   "productName": "TriliumNext Notes", | ||||
|   "description": "Build your personal knowledge base with TriliumNext Notes", | ||||
|   "version": "0.90.1-beta", | ||||
|   "license": "AGPL-3.0-only", | ||||
|   "main": "electron.js", | ||||
|   "main": "./dist/electron.js", | ||||
|   "author": { | ||||
|     "name": "TriliumNext Notes Teams", | ||||
|     "email": "contact@eliandoran.me", | ||||
|     "url": "https://github.com/TriliumNext/Notes" | ||||
|   }, | ||||
|   "copyright": "", | ||||
|   "bin": { | ||||
|     "trilium": "src/www.js" | ||||
|   }, | ||||
|   "repository": { | ||||
|     "type": "git", | ||||
|     "url": "https://github.com/zadam/trilium.git" | ||||
|     "url": "https://github.com/TriliumNext/Notes.git" | ||||
|   }, | ||||
|   "scripts": { | ||||
|     "start-server": "cross-env TRILIUM_SAFE_MODE=1 TRILIUM_DATA_DIR=./data TRILIUM_ENV=dev TRILIUM_SYNC_SERVER_HOST=http://tsyncserver:4000 nodemon src/www.ts", | ||||
|     "start-server-no-dir": "cross-env TRILIUM_SAFE_MODE=1 TRILIUM_ENV=dev TRILIUM_SYNC_SERVER_HOST=http://tsyncserver:4000 nodemon src/www.ts", | ||||
|     "qstart-server": "npm run qswitch-server && TRILIUM_SAFE_MODE=1 TRILIUM_DATA_DIR=./data TRILIUM_ENV=dev TRILIUM_SYNC_SERVER_HOST=http://tsyncserver:4000 nodemon src/www.ts", | ||||
|     "start-electron": "rimraf ./dist && tsc && ts-node ./bin/copy-dist.ts && cross-env TRILIUM_SAFE_MODE=1 TRILIUM_DATA_DIR=./data TRILIUM_SYNC_SERVER_HOST=http://tsyncserver:4000 TRILIUM_ENV=dev electron ./dist/electron.js --inspect=5858 .", | ||||
|     "start-electron-no-dir": "rimraf ./dist && tsc && ts-node ./bin/copy-dist.ts && cross-env TRILIUM_SAFE_MODE=1 TRILIUM_ENV=dev electron ./dist/electron.js --inspect=5858 .", | ||||
|     "start-electron": "npm run prepare-dist && cross-env TRILIUM_SAFE_MODE=1 TRILIUM_DATA_DIR=./data TRILIUM_SYNC_SERVER_HOST=http://tsyncserver:4000 TRILIUM_ENV=dev electron ./dist/electron.js --inspect=5858 .", | ||||
|     "start-electron-no-dir": "npm run prepare-dist && cross-env TRILIUM_SAFE_MODE=1 TRILIUM_ENV=dev electron ./dist/electron.js --inspect=5858 .", | ||||
|     "qstart-electron": "npm run qswitch-electron && TRILIUM_SAFE_MODE=1 TRILIUM_DATA_DIR=./data TRILIUM_SYNC_SERVER_HOST=http://tsyncserver:4000 TRILIUM_ENV=dev electron --inspect=5858 .", | ||||
|     "start-test-server": "npm run qswitch-server; rimraf ./data-test; cross-env TRILIUM_SAFE_MODE=1 TRILIUM_DATA_DIR=./data-test TRILIUM_SYNC_SERVER_HOST=http://tsyncserver:4000 TRILIUM_ENV=dev TRILIUM_PORT=9999 ts-node src/www.ts", | ||||
|     "switch-server": "rimraf ./node_modules/better-sqlite3 && npm install", | ||||
| @@ -31,15 +37,19 @@ | ||||
|     "test-jasmine": "cross-env TRILIUM_DATA_DIR=./data-test ts-node ./node_modules/jasmine/bin/jasmine", | ||||
|     "test-es6": "ts-node -r esm spec-es6/attribute_parser.spec.ts", | ||||
|     "test": "npm run test-jasmine && npm run test-es6", | ||||
|     "postinstall": "rimraf ./node_modules/canvas" | ||||
|     "start-electron-forge": "npm run prepare-dist && electron-forge start", | ||||
|     "make-electron": "npm run webpack && npm run prepare-dist && electron-forge make", | ||||
|     "package-electron": "electron-forge package", | ||||
|     "prepare-dist": "rimraf ./dist && tsc && ts-node ./bin/copy-dist.ts", | ||||
|     "update-build-info": "ts-node bin/update-build-info.ts" | ||||
|   }, | ||||
|   "dependencies": { | ||||
|     "@braintree/sanitize-url": "6.0.4", | ||||
|     "@braintree/sanitize-url": "^7.1.0", | ||||
|     "@electron/remote": "2.1.2", | ||||
|     "@excalidraw/excalidraw": "^0.17.6", | ||||
|     "archiver": "7.0.0", | ||||
|     "async-mutex": "0.4.1", | ||||
|     "axios": "1.6.7", | ||||
|     "archiver": "^7.0.1", | ||||
|     "async-mutex": "^0.5.0", | ||||
|     "axios": "^1.7.2", | ||||
|     "better-sqlite3": "8.5.0", | ||||
|     "boxicons": "2.1.4", | ||||
|     "chokidar": "3.6.0", | ||||
| @@ -47,17 +57,18 @@ | ||||
|     "compression": "1.7.4", | ||||
|     "cookie-parser": "1.4.6", | ||||
|     "csurf": "1.11.0", | ||||
|     "dayjs": "1.11.10", | ||||
|     "dayjs": "^1.11.12", | ||||
|     "dayjs-plugin-utc": "0.1.2", | ||||
|     "debounce": "1.2.1", | ||||
|     "ejs": "3.1.9", | ||||
|     "debounce": "^2.1.0", | ||||
|     "ejs": "^3.1.10", | ||||
|     "electron-debug": "3.2.0", | ||||
|     "electron-dl": "3.5.2", | ||||
|     "electron-squirrel-startup": "^1.0.0", | ||||
|     "electron-window-state": "5.0.3", | ||||
|     "escape-html": "1.0.3", | ||||
|     "express": "4.18.3", | ||||
|     "express": "^4.19.2", | ||||
|     "express-partial-content": "1.0.2", | ||||
|     "express-rate-limit": "7.2.0", | ||||
|     "express-rate-limit": "^7.3.1", | ||||
|     "express-session": "1.18.0", | ||||
|     "force-graph": "1.43.5", | ||||
|     "fs-extra": "11.2.0", | ||||
| @@ -65,18 +76,18 @@ | ||||
|     "html": "1.0.0", | ||||
|     "html2plaintext": "2.1.4", | ||||
|     "http-proxy-agent": "7.0.2", | ||||
|     "https-proxy-agent": "7.0.4", | ||||
|     "https-proxy-agent": "^7.0.5", | ||||
|     "image-type": "4.1.0", | ||||
|     "ini": "3.0.1", | ||||
|     "ini": "^4.1.3", | ||||
|     "is-animated": "2.0.2", | ||||
|     "is-svg": "4.3.2", | ||||
|     "jimp": "0.22.12", | ||||
|     "joplin-turndown-plugin-gfm": "1.0.12", | ||||
|     "jquery": "3.7.1", | ||||
|     "jquery-hotkeys": "0.2.2", | ||||
|     "jsdom": "24.0.0", | ||||
|     "jsdom": "^24.1.0", | ||||
|     "katex": "^0.16.11", | ||||
|     "marked": "12.0.0", | ||||
|     "marked": "^13.0.2", | ||||
|     "mermaid": "^10.9.1", | ||||
|     "mime-types": "2.1.35", | ||||
|     "multer": "1.4.5-lts.1", | ||||
| @@ -88,12 +99,11 @@ | ||||
|     "react": "^18.3.1", | ||||
|     "react-dom": "^18.3.1", | ||||
|     "request": "2.88.2", | ||||
|     "rimraf": "^6.0.1", | ||||
|     "safe-compare": "1.1.4", | ||||
|     "sanitize-filename": "1.6.3", | ||||
|     "sanitize-html": "2.12.1", | ||||
|     "sax": "1.3.0", | ||||
|     "semver": "7.6.0", | ||||
|     "sanitize-html": "^2.13.0", | ||||
|     "sax": "^1.4.1", | ||||
|     "semver": "^7.6.3", | ||||
|     "serve-favicon": "2.5.0", | ||||
|     "session-file-store": "1.5.0", | ||||
|     "split.js": "1.6.5", | ||||
| @@ -101,13 +111,16 @@ | ||||
|     "striptags": "3.2.0", | ||||
|     "tmp": "0.2.3", | ||||
|     "tree-kill": "1.2.2", | ||||
|     "turndown": "7.1.2", | ||||
|     "turndown": "^7.2.0", | ||||
|     "unescape": "1.0.1", | ||||
|     "ws": "8.16.0", | ||||
|     "ws": "^8.18.0", | ||||
|     "xml2js": "0.6.2", | ||||
|     "yauzl": "3.1.2" | ||||
|     "yauzl": "^3.1.3" | ||||
|   }, | ||||
|   "devDependencies": { | ||||
|     "@electron-forge/cli": "^6.4.2", | ||||
|     "@electron-forge/maker-squirrel": "^6.4.2", | ||||
|     "@electron-forge/plugin-auto-unpack-natives": "^6.4.2", | ||||
|     "@types/archiver": "^6.0.2", | ||||
|     "@types/better-sqlite3": "^7.6.9", | ||||
|     "@types/cls-hooked": "^4.3.8", | ||||
| @@ -137,7 +150,6 @@ | ||||
|     "@types/xml2js": "^0.4.14", | ||||
|     "cross-env": "7.0.3", | ||||
|     "electron": "^31.2.1", | ||||
|     "electron-builder": "24.13.3", | ||||
|     "electron-packager": "17.1.2", | ||||
|     "electron-rebuild": "3.2.9", | ||||
|     "esm": "3.2.25", | ||||
| @@ -146,6 +158,7 @@ | ||||
|     "lorem-ipsum": "2.0.8", | ||||
|     "nodemon": "^3.1.4", | ||||
|     "rcedit": "4.0.1", | ||||
|     "rimraf": "^6.0.1", | ||||
|     "ts-node": "^10.9.2", | ||||
|     "tslib": "^2.6.2", | ||||
|     "typescript": "^5.3.3", | ||||
|   | ||||
| @@ -5,7 +5,6 @@ import { JSDOM } from "jsdom"; | ||||
| import BNote = require('../../becca/entities/bnote'); | ||||
| import BAttribute = require('../../becca/entities/battribute'); | ||||
| import { Request } from 'express'; | ||||
| import ValidationError = require('../../errors/validation_error'); | ||||
|  | ||||
| function buildDescendantCountMap(noteIdsToCount: string[]) { | ||||
|     if (!Array.isArray(noteIdsToCount)) { | ||||
|   | ||||
| @@ -1 +1,4 @@ | ||||
| export = { buildDate:"2024-07-14T22:32:45+03:00", buildRevision: "b811f3d399aed7e740bd8e92ef7edc7d15de7038" }; | ||||
| export = { | ||||
|     buildDate: "2024-07-21T10:25:01Z", | ||||
|     buildRevision: "715a952148ae6e83fda0886f5ceec8dc329972ae" | ||||
| }; | ||||
|   | ||||
| @@ -41,15 +41,13 @@ function updateEntities(entityChanges: EntityChangeRecord[], instanceId: string) | ||||
|             atLeastOnePullApplied = true; | ||||
|         } | ||||
|  | ||||
|         if (entity) { | ||||
|             updateEntity(entityChange, entity, instanceId, updateContext); | ||||
|         } | ||||
|         updateEntity(entityChange, entity, instanceId, updateContext); | ||||
|     } | ||||
|  | ||||
|     logUpdateContext(updateContext); | ||||
| } | ||||
|  | ||||
| function updateEntity(remoteEC: EntityChange, remoteEntityRow: EntityRow, instanceId: string, updateContext: UpdateContext) { | ||||
| function updateEntity(remoteEC: EntityChange, remoteEntityRow: EntityRow | undefined, instanceId: string, updateContext: UpdateContext) { | ||||
|     if (!remoteEntityRow && remoteEC.entityName === 'options') { | ||||
|         return; // can be undefined for options with isSynced=false | ||||
|     } | ||||
| @@ -74,7 +72,7 @@ function updateEntity(remoteEC: EntityChange, remoteEntityRow: EntityRow, instan | ||||
|     } | ||||
| } | ||||
|  | ||||
| function updateNormalEntity(remoteEC: EntityChange, remoteEntityRow: EntityRow, instanceId: string, updateContext: UpdateContext) { | ||||
| function updateNormalEntity(remoteEC: EntityChange, remoteEntityRow: EntityRow | undefined, instanceId: string, updateContext: UpdateContext) { | ||||
|     const localEC = sql.getRow<EntityChange | undefined>(`SELECT * FROM entity_changes WHERE entityName = ? AND entityId = ?`, [remoteEC.entityName, remoteEC.entityId]); | ||||
|     const localECIsOlderOrSameAsRemote = ( | ||||
|             localEC && localEC.utcDateChanged && remoteEC.utcDateChanged && | ||||
| @@ -139,7 +137,7 @@ function preProcessContent(remoteEC: EntityChange, remoteEntityRow: EntityRow) { | ||||
|     } | ||||
| } | ||||
|  | ||||
| function updateNoteReordering(remoteEC: EntityChange, remoteEntityRow: EntityRow, instanceId: string) { | ||||
| function updateNoteReordering(remoteEC: EntityChange, remoteEntityRow: EntityRow | undefined, instanceId: string) { | ||||
|     if (!remoteEntityRow) { | ||||
|         throw new Error(`Empty note_reordering body for: ${JSON.stringify(remoteEC)}`); | ||||
|     } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user