From bdc829198cc8cd0c7cabcd3e4cd5b408e16243a4 Mon Sep 17 00:00:00 2001 From: Panagiotis Papadopoulos Date: Mon, 10 Mar 2025 07:15:43 +0100 Subject: [PATCH 01/92] chore(share): use safeExtractMessageAndStackFromError to get rid of "any" in try/catch blocks --- src/share/routes.spec.ts | 6 ++++-- src/share/routes.ts | 7 ++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/share/routes.spec.ts b/src/share/routes.spec.ts index 86e1927bd..5072bb297 100644 --- a/src/share/routes.spec.ts +++ b/src/share/routes.spec.ts @@ -2,6 +2,7 @@ import { beforeAll, beforeEach, describe, expect, it } from "vitest"; import supertest from "supertest"; import { initializeTranslations } from "../services/i18n.js"; import type { Application, Request, Response, NextFunction } from "express"; +import { safeExtractMessageAndStackFromError } from "../services/utils.js"; let app: Application; @@ -11,8 +12,9 @@ describe("Share API test", () => { beforeAll(async () => { initializeTranslations(); app = (await import("../app.js")).default; - app.use((err: any, req: Request, res: Response, next: NextFunction) => { - if (err.message.includes("Cannot set headers after they are sent to the client")) { + app.use((err: unknown, req: Request, res: Response, next: NextFunction) => { + const [errMessage] = safeExtractMessageAndStackFromError(err) + if (errMessage.includes("Cannot set headers after they are sent to the client")) { cannotSetHeadersCount++; } diff --git a/src/share/routes.ts b/src/share/routes.ts index 3c6db87d5..db7e62f40 100644 --- a/src/share/routes.ts +++ b/src/share/routes.ts @@ -15,7 +15,7 @@ import log from "../services/log.js"; import type SNote from "./shaca/entities/snote.js"; import type SBranch from "./shaca/entities/sbranch.js"; import type SAttachment from "./shaca/entities/sattachment.js"; -import utils from "../services/utils.js"; +import utils, { safeExtractMessageAndStackFromError } from "../services/utils.js"; import options from "../services/options.js"; function getSharedSubTreeRoot(note: SNote): { note?: SNote; branch?: SBranch } { @@ -183,8 +183,9 @@ function register(router: Router) { res.send(ejsResult); useDefaultView = false; // Rendering went okay, don't use default view } - } catch (e: any) { - log.error(`Rendering user provided share template (${templateId}) threw exception ${e.message} with stacktrace: ${e.stack}`); + } catch (e: unknown) { + const [errMessage, errStack] = safeExtractMessageAndStackFromError(e); + log.error(`Rendering user provided share template (${templateId}) threw exception ${errMessage} with stacktrace: ${errStack}`); } } } From c2b75a642186720906d1bae5154602416f458b41 Mon Sep 17 00:00:00 2001 From: Panagiotis Papadopoulos Date: Mon, 10 Mar 2025 07:33:20 +0100 Subject: [PATCH 02/92] chore(share): fix @typescript-eslint/no-unused-vars for "next" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit alternative solution, since they are unused and it is the last argument → remove it. We can still go that route later on though, if we agree upon it. --- src/share/routes.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/share/routes.ts b/src/share/routes.ts index db7e62f40..90018ddab 100644 --- a/src/share/routes.ts +++ b/src/share/routes.ts @@ -195,7 +195,7 @@ function register(router: Router) { } } - router.get("/share/", (req, res, next) => { + router.get("/share/", (req, res, _next) => { if (req.path.substr(-1) !== "/") { res.redirect("../share/"); return; @@ -211,7 +211,7 @@ function register(router: Router) { renderNote(shaca.shareRootNote, req, res); }); - router.get("/share/:shareId", (req, res, next) => { + router.get("/share/:shareId", (req, res, _next) => { shacaLoader.ensureLoad(); const { shareId } = req.params; @@ -221,7 +221,7 @@ function register(router: Router) { renderNote(note, req, res); }); - router.get("/share/api/notes/:noteId", (req, res, next) => { + router.get("/share/api/notes/:noteId", (req, res, _next) => { shacaLoader.ensureLoad(); let note: SNote | boolean; @@ -234,7 +234,7 @@ function register(router: Router) { res.json(note.getPojo()); }); - router.get("/share/api/notes/:noteId/download", (req, res, next) => { + router.get("/share/api/notes/:noteId/download", (req, res, _next) => { shacaLoader.ensureLoad(); let note: SNote | boolean; @@ -256,7 +256,7 @@ function register(router: Router) { }); // :filename is not used by trilium, but instead used for "save as" to assign a human-readable filename - router.get("/share/api/images/:noteId/:filename", (req, res, next) => { + router.get("/share/api/images/:noteId/:filename", (req, res, _next) => { shacaLoader.ensureLoad(); let image: SNote | boolean; @@ -282,7 +282,7 @@ function register(router: Router) { }); // :filename is not used by trilium, but instead used for "save as" to assign a human-readable filename - router.get("/share/api/attachments/:attachmentId/image/:filename", (req, res, next) => { + router.get("/share/api/attachments/:attachmentId/image/:filename", (req, res, _next) => { shacaLoader.ensureLoad(); let attachment: SAttachment | boolean; @@ -300,7 +300,7 @@ function register(router: Router) { } }); - router.get("/share/api/attachments/:attachmentId/download", (req, res, next) => { + router.get("/share/api/attachments/:attachmentId/download", (req, res, _next) => { shacaLoader.ensureLoad(); let attachment: SAttachment | boolean; @@ -322,7 +322,7 @@ function register(router: Router) { }); // used for PDF viewing - router.get("/share/api/notes/:noteId/view", (req, res, next) => { + router.get("/share/api/notes/:noteId/view", (req, res, _next) => { shacaLoader.ensureLoad(); let note: SNote | boolean; @@ -340,7 +340,7 @@ function register(router: Router) { }); // Used for searching, require noteId so we know the subTreeRoot - router.get("/share/api/notes", (req, res, next) => { + router.get("/share/api/notes", (req, res, _next) => { shacaLoader.ensureLoad(); const ancestorNoteId = req.query.ancestorNoteId ?? "_share"; From cd9d90323ccedc7fbdd866eff50da23d34b8768d Mon Sep 17 00:00:00 2001 From: Panagiotis Papadopoulos Date: Mon, 10 Mar 2025 07:34:43 +0100 Subject: [PATCH 03/92] chore(share): fix @typescript-eslint/no-unused-vars for unused note variable there's no need to assign a variable, if we never use the value outside of the if check --- src/share/routes.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/share/routes.ts b/src/share/routes.ts index 90018ddab..932adfaac 100644 --- a/src/share/routes.ts +++ b/src/share/routes.ts @@ -344,7 +344,6 @@ function register(router: Router) { shacaLoader.ensureLoad(); const ancestorNoteId = req.query.ancestorNoteId ?? "_share"; - let note; if (typeof ancestorNoteId !== "string") { res.status(400).json({ message: "'ancestorNoteId' parameter is mandatory." }); @@ -352,7 +351,7 @@ function register(router: Router) { } // This will automatically return if no ancestorNoteId is provided and there is no shareIndex - if (!(note = checkNoteAccess(ancestorNoteId, req, res))) { + if (!checkNoteAccess(ancestorNoteId, req, res)) { return; } From c2aae454562a4b4f7313530bef14d9f93db2a7b3 Mon Sep 17 00:00:00 2001 From: Panagiotis Papadopoulos Date: Mon, 10 Mar 2025 08:10:44 +0100 Subject: [PATCH 04/92] chore(share): fix no-unused-vars and prefer-const lint issues --- src/share/shaca/entities/sattachment.ts | 2 +- src/share/shaca/entities/snote.ts | 4 ++-- src/share/shaca/shaca_loader.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/share/shaca/entities/sattachment.ts b/src/share/shaca/entities/sattachment.ts index 612ba81f3..e8d1e50d9 100644 --- a/src/share/shaca/entities/sattachment.ts +++ b/src/share/shaca/entities/sattachment.ts @@ -47,7 +47,7 @@ class SAttachment extends AbstractShacaEntity { } } - let content = row.content; + const content = row.content; if (this.hasStringContent()) { return content === null ? "" : content.toString("utf-8"); diff --git a/src/share/shaca/entities/snote.ts b/src/share/shaca/entities/snote.ts index b9e1a8b23..e4ba17d0c 100644 --- a/src/share/shaca/entities/snote.ts +++ b/src/share/shaca/entities/snote.ts @@ -105,7 +105,7 @@ class SNote extends AbstractShacaEntity { } } - let content = row.content; + const content = row.content; if (this.hasStringContent()) { return content === null ? "" : content.toString("utf-8"); @@ -212,7 +212,7 @@ class SNote extends AbstractShacaEntity { /** * @throws Error in case of invalid JSON */ - getJsonContent(): any | null { + getJsonContent(): unknown | null { const content = this.getContent(); if (typeof content !== "string" || !content || !content.trim()) { diff --git a/src/share/shaca/shaca_loader.ts b/src/share/shaca/shaca_loader.ts index 474f5be37..93783e7a0 100644 --- a/src/share/shaca/shaca_loader.ts +++ b/src/share/shaca/shaca_loader.ts @@ -93,7 +93,7 @@ function ensureLoad() { eventService.subscribe( [eventService.ENTITY_CREATED, eventService.ENTITY_CHANGED, eventService.ENTITY_DELETED, eventService.ENTITY_CHANGE_SYNCED, eventService.ENTITY_DELETE_SYNCED], - ({ entityName, entity }) => { + ({ _entityName, _entity }) => { shaca.reset(); } ); From 2a5ac80c05928971cc5e2facd727920c5133d7e5 Mon Sep 17 00:00:00 2001 From: Panagiotis Papadopoulos Date: Mon, 10 Mar 2025 08:12:07 +0100 Subject: [PATCH 05/92] chore(utils/safeExtractMessageAndStackFromError): add explicit return type to have it as a named tuple --- src/services/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/utils.ts b/src/services/utils.ts index 3cb84d3a1..dfaffec98 100644 --- a/src/services/utils.ts +++ b/src/services/utils.ts @@ -363,7 +363,7 @@ export function processStringOrBuffer(data: string | Buffer | null) { } } -export function safeExtractMessageAndStackFromError(err: unknown) { +export function safeExtractMessageAndStackFromError(err: unknown): [errMessage: string, errStack: string | undefined] { return (err instanceof Error) ? [err.message, err.stack] as const : ["Unknown Error", undefined] as const; } From a5a66a12e2ce7d6efe8d1908e3631849c29ccba7 Mon Sep 17 00:00:00 2001 From: Panagiotis Papadopoulos Date: Mon, 10 Mar 2025 19:30:32 +0100 Subject: [PATCH 06/92] chore(share): fix tsc nagging about svg not existing on unknown JSON and TS without using a validation library like zod, is really a bit of a pain in the backside... --- src/share/routes.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/share/routes.ts b/src/share/routes.ts index 932adfaac..a2dbb6e0d 100644 --- a/src/share/routes.ts +++ b/src/share/routes.ts @@ -115,7 +115,14 @@ function renderImageAttachment(image: SNote, res: Response, attachmentName: stri svgString = content; } else { // backwards compatibility, before attachments, the SVG was stored in the main note content as a separate key - const contentSvg = image.getJsonContentSafely()?.svg; + const possibleSvgContent = image.getJsonContentSafely(); + + const contentSvg = (typeof possibleSvgContent === "object" + && possibleSvgContent !== null + && "svg" in possibleSvgContent + && typeof possibleSvgContent.svg === "string") + ? possibleSvgContent.svg + : null; if (contentSvg) { svgString = contentSvg; From ae1ef555224663f964dc8ee1f32502aa88471b46 Mon Sep 17 00:00:00 2001 From: Panagiotis Papadopoulos Date: Sat, 15 Mar 2025 12:27:02 +0100 Subject: [PATCH 07/92] chore(share): remove unused "_next" addresses https://github.com/TriliumNext/Notes/pull/1384#discussion_r1989044764 --- src/share/routes.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/share/routes.ts b/src/share/routes.ts index a2dbb6e0d..03de585a8 100644 --- a/src/share/routes.ts +++ b/src/share/routes.ts @@ -202,7 +202,7 @@ function register(router: Router) { } } - router.get("/share/", (req, res, _next) => { + router.get("/share/", (req, res) => { if (req.path.substr(-1) !== "/") { res.redirect("../share/"); return; @@ -218,7 +218,7 @@ function register(router: Router) { renderNote(shaca.shareRootNote, req, res); }); - router.get("/share/:shareId", (req, res, _next) => { + router.get("/share/:shareId", (req, res) => { shacaLoader.ensureLoad(); const { shareId } = req.params; @@ -228,7 +228,7 @@ function register(router: Router) { renderNote(note, req, res); }); - router.get("/share/api/notes/:noteId", (req, res, _next) => { + router.get("/share/api/notes/:noteId", (req, res) => { shacaLoader.ensureLoad(); let note: SNote | boolean; @@ -241,7 +241,7 @@ function register(router: Router) { res.json(note.getPojo()); }); - router.get("/share/api/notes/:noteId/download", (req, res, _next) => { + router.get("/share/api/notes/:noteId/download", (req, res) => { shacaLoader.ensureLoad(); let note: SNote | boolean; @@ -263,7 +263,7 @@ function register(router: Router) { }); // :filename is not used by trilium, but instead used for "save as" to assign a human-readable filename - router.get("/share/api/images/:noteId/:filename", (req, res, _next) => { + router.get("/share/api/images/:noteId/:filename", (req, res) => { shacaLoader.ensureLoad(); let image: SNote | boolean; @@ -289,7 +289,7 @@ function register(router: Router) { }); // :filename is not used by trilium, but instead used for "save as" to assign a human-readable filename - router.get("/share/api/attachments/:attachmentId/image/:filename", (req, res, _next) => { + router.get("/share/api/attachments/:attachmentId/image/:filename", (req, res) => { shacaLoader.ensureLoad(); let attachment: SAttachment | boolean; @@ -307,7 +307,7 @@ function register(router: Router) { } }); - router.get("/share/api/attachments/:attachmentId/download", (req, res, _next) => { + router.get("/share/api/attachments/:attachmentId/download", (req, res) => { shacaLoader.ensureLoad(); let attachment: SAttachment | boolean; @@ -329,7 +329,7 @@ function register(router: Router) { }); // used for PDF viewing - router.get("/share/api/notes/:noteId/view", (req, res, _next) => { + router.get("/share/api/notes/:noteId/view", (req, res) => { shacaLoader.ensureLoad(); let note: SNote | boolean; @@ -347,7 +347,7 @@ function register(router: Router) { }); // Used for searching, require noteId so we know the subTreeRoot - router.get("/share/api/notes", (req, res, _next) => { + router.get("/share/api/notes", (req, res) => { shacaLoader.ensureLoad(); const ancestorNoteId = req.query.ancestorNoteId ?? "_share"; From 73305a5327071cfe85eaad9f6aa9b4828b0729da Mon Sep 17 00:00:00 2001 From: Panagiotis Papadopoulos Date: Sat, 15 Mar 2025 12:31:33 +0100 Subject: [PATCH 08/92] chore(share): remove unused args addresses https://github.com/TriliumNext/Notes/pull/1384#discussion_r1989045491 --- src/share/shaca/shaca_loader.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/share/shaca/shaca_loader.ts b/src/share/shaca/shaca_loader.ts index 93783e7a0..c0834cb8b 100644 --- a/src/share/shaca/shaca_loader.ts +++ b/src/share/shaca/shaca_loader.ts @@ -93,7 +93,7 @@ function ensureLoad() { eventService.subscribe( [eventService.ENTITY_CREATED, eventService.ENTITY_CHANGED, eventService.ENTITY_DELETED, eventService.ENTITY_CHANGE_SYNCED, eventService.ENTITY_DELETE_SYNCED], - ({ _entityName, _entity }) => { + () => { shaca.reset(); } ); From 5f26a503afdeb5047560a8fe435f4870e425e4d0 Mon Sep 17 00:00:00 2001 From: Joel Shprentz Date: Thu, 20 Mar 2025 22:59:20 +0000 Subject: [PATCH 09/92] In month note title patterns, replace {isoMonth} with e.g. "2025-03" for March 2025. --- .../User Guide/Advanced Usage/Advanced Showcases/Day Notes.md | 3 ++- .../Advanced Usage/Advanced Showcases/Day Notes.html | 4 +++- src/services/date_notes.ts | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/User Guide/User Guide/Advanced Usage/Advanced Showcases/Day Notes.md b/docs/User Guide/User Guide/Advanced Usage/Advanced Showcases/Day Notes.md index 87b9bad27..d117ee8a9 100644 --- a/docs/User Guide/User Guide/Advanced Usage/Advanced Showcases/Day Notes.md +++ b/docs/User Guide/User Guide/Advanced Usage/Advanced Showcases/Day Notes.md @@ -43,6 +43,7 @@ It's possible to customize the title of generated date notes by defining a `#dat It is also possible to customize the title of generated month notes through the `#monthPattern` attribute, much like `#datePattern`. The options are: +* `{isoDate}` results in an ISO 8061 formatted month (e.g. "2025-03" for March 2025) * `{monthNumberPadded}` results in a number like `09` for September, and `11` for November * `{month}` results in the full month name (e.g. `September` or `October`) * `{shortMonth3}` is replaced with the first 3 letters of the month, e.g. Jan, Feb, etc. @@ -56,4 +57,4 @@ Trilium has some special support for day notes in the form of [backend Script AP Day (and year, month) notes are created with a label - e.g. `#dateNote="2018-08-16"` this can then be used by other scripts to add new notes to day note etc. -Journal also has relation `child:child:child:template=Day template` (see \[\[attribute inheritance\]\]) which effectively adds \[\[template\]\] to day notes (grand-grand-grand children of Journal). \ No newline at end of file +Journal also has relation `child:child:child:template=Day template` (see \[\[attribute inheritance\]\]) which effectively adds \[\[template\]\] to day notes (grand-grand-grand children of Journal). diff --git a/src/public/app/doc_notes/en/User Guide/User Guide/Advanced Usage/Advanced Showcases/Day Notes.html b/src/public/app/doc_notes/en/User Guide/User Guide/Advanced Usage/Advanced Showcases/Day Notes.html index 266223fd5..75ee23976 100644 --- a/src/public/app/doc_notes/en/User Guide/User Guide/Advanced Usage/Advanced Showcases/Day Notes.html +++ b/src/public/app/doc_notes/en/User Guide/User Guide/Advanced Usage/Advanced Showcases/Day Notes.html @@ -76,6 +76,8 @@ the #monthPattern attribute, much like #datePattern. The options are:

    +
  • {isoMonth} results in an ISO 8061 formatted month (e.g. + "2025-03" for March 2025)
  • {monthNumberPadded} results in a number like 09 for September, and 11 for November
  • {month} results in the full month name (e.g. September or October)
  • @@ -98,4 +100,4 @@ - \ No newline at end of file + diff --git a/src/services/date_notes.ts b/src/services/date_notes.ts index 5e8710b86..1324de89b 100644 --- a/src/services/date_notes.ts +++ b/src/services/date_notes.ts @@ -111,6 +111,7 @@ function getMonthNoteTitle(rootNote: BNote, monthNumber: string, dateObj: Date) return pattern .replace(/{shortMonth3}/g, monthName.slice(0, 3)) .replace(/{shortMonth4}/g, monthName.slice(0, 4)) + .replace(/{isoMonth}/g, dateUtils.utcDateStr(dateObj).slice(0, 7)) .replace(/{monthNumberPadded}/g, monthNumber) .replace(/{month}/g, monthName); } From c1e8542f744c5211bd7b77d50fe88c2627465b28 Mon Sep 17 00:00:00 2001 From: Joel Shprentz Date: Fri, 21 Mar 2025 00:59:45 +0000 Subject: [PATCH 10/92] Correct placeholder name in documentation --- .../User Guide/Advanced Usage/Advanced Showcases/Day Notes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/User Guide/User Guide/Advanced Usage/Advanced Showcases/Day Notes.md b/docs/User Guide/User Guide/Advanced Usage/Advanced Showcases/Day Notes.md index d117ee8a9..4b3bc103f 100644 --- a/docs/User Guide/User Guide/Advanced Usage/Advanced Showcases/Day Notes.md +++ b/docs/User Guide/User Guide/Advanced Usage/Advanced Showcases/Day Notes.md @@ -43,7 +43,7 @@ It's possible to customize the title of generated date notes by defining a `#dat It is also possible to customize the title of generated month notes through the `#monthPattern` attribute, much like `#datePattern`. The options are: -* `{isoDate}` results in an ISO 8061 formatted month (e.g. "2025-03" for March 2025) +* `{isoMonth}` results in an ISO 8061 formatted month (e.g. "2025-03" for March 2025) * `{monthNumberPadded}` results in a number like `09` for September, and `11` for November * `{month}` results in the full month name (e.g. `September` or `October`) * `{shortMonth3}` is replaced with the first 3 letters of the month, e.g. Jan, Feb, etc. From e8242e87fbdb5b428dbdd380b98e5aa6239badc0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 22 Mar 2025 01:58:47 +0000 Subject: [PATCH 11/92] chore(deps): update dependency @types/node to v22.13.11 --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9473a968c..ebbfa9de5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -142,7 +142,7 @@ "@types/leaflet-gpx": "1.3.7", "@types/mime-types": "2.1.4", "@types/multer": "1.4.12", - "@types/node": "22.13.10", + "@types/node": "22.13.11", "@types/react": "18.3.19", "@types/react-dom": "18.3.5", "@types/safe-compare": "1.1.2", @@ -5925,9 +5925,9 @@ } }, "node_modules/@types/node": { - "version": "22.13.10", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.10.tgz", - "integrity": "sha512-I6LPUvlRH+O6VRUqYOcMudhaIdUVWfsjnZavnsraHvpBwaEyMN29ry+0UVJhImYL16xsscu0aske3yA+uPOWfw==", + "version": "22.13.11", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.11.tgz", + "integrity": "sha512-iEUCUJoU0i3VnrCmgoWCXttklWcvoCIx4jzcP22fioIVSdTmjgoEvmAO/QPw6TcS9k5FrNgn4w7q5lGOd1CT5g==", "license": "MIT", "dependencies": { "undici-types": "~6.20.0" diff --git a/package.json b/package.json index 91c0b329a..06af2832b 100644 --- a/package.json +++ b/package.json @@ -199,7 +199,7 @@ "@types/leaflet-gpx": "1.3.7", "@types/mime-types": "2.1.4", "@types/multer": "1.4.12", - "@types/node": "22.13.10", + "@types/node": "22.13.11", "@types/react": "18.3.19", "@types/react-dom": "18.3.5", "@types/safe-compare": "1.1.2", From cc9b0987b22b6e69d32e25a354d8852c1abe0dda Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 22 Mar 2025 01:58:58 +0000 Subject: [PATCH 12/92] chore(deps): update eslint monorepo to v9.23.0 --- package-lock.json | 34 +++++++++++++++++----------------- package.json | 4 ++-- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9473a968c..f71d61da4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -109,7 +109,7 @@ "@electron-forge/maker-zip": "7.7.0", "@electron-forge/plugin-auto-unpack-natives": "7.7.0", "@electron/rebuild": "3.7.1", - "@eslint/js": "9.22.0", + "@eslint/js": "9.23.0", "@fullcalendar/core": "6.1.15", "@fullcalendar/daygrid": "6.1.15", "@fullcalendar/interaction": "6.1.15", @@ -165,7 +165,7 @@ "cross-env": "7.0.3", "css-loader": "7.1.2", "electron": "35.0.3", - "eslint": "9.22.0", + "eslint": "9.23.0", "esm": "3.2.25", "globals": "16.0.0", "happy-dom": "17.4.4", @@ -2207,9 +2207,9 @@ } }, "node_modules/@eslint/config-helpers": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.1.0.tgz", - "integrity": "sha512-kLrdPDJE1ckPo94kmPPf9Hfd0DU0Jw6oKYrhe+pwSC0iTUInmTa+w6fw8sGgcfkFJGNdWOUeOaDM4quW4a7OkA==", + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.2.0.tgz", + "integrity": "sha512-yJLLmLexii32mGrhW29qvU3QBVTu0GUmEf/J4XsBtVhp4JkIUFN/BjWqTF63yRvGApIDpZm5fa97LtYtINmfeQ==", "dev": true, "license": "Apache-2.0", "engines": { @@ -2230,9 +2230,9 @@ } }, "node_modules/@eslint/eslintrc": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.0.tgz", - "integrity": "sha512-yaVPAiNAalnCZedKLdR21GOGILMLKPyqSLWaAjQFvYA2i/ciDi8ArYVr69Anohb6cH2Ukhqti4aFnYyPm8wdwQ==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.1.tgz", + "integrity": "sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==", "dev": true, "license": "MIT", "dependencies": { @@ -2291,9 +2291,9 @@ "license": "MIT" }, "node_modules/@eslint/js": { - "version": "9.22.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.22.0.tgz", - "integrity": "sha512-vLFajx9o8d1/oL2ZkpMYbkLv8nDB6yaIwFNt7nI4+I80U/z03SxmfOMsLbvWr3p7C+Wnoh//aOu2pQW8cS0HCQ==", + "version": "9.23.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.23.0.tgz", + "integrity": "sha512-35MJ8vCPU0ZMxo7zfev2pypqTwWTofFZO6m4KAtdoFhRpLJUpHTZZ+KB3C7Hb1d7bULYwO4lJXGCi5Se+8OMbw==", "dev": true, "license": "MIT", "engines": { @@ -11192,19 +11192,19 @@ } }, "node_modules/eslint": { - "version": "9.22.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.22.0.tgz", - "integrity": "sha512-9V/QURhsRN40xuHXWjV64yvrzMjcz7ZyNoF2jJFmy9j/SLk0u1OLSZgXi28MrXjymnjEGSR80WCdab3RGMDveQ==", + "version": "9.23.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.23.0.tgz", + "integrity": "sha512-jV7AbNoFPAY1EkFYpLq5bslU9NLNO8xnEeQXwErNibVryjk67wHVmddTBilc5srIttJDBrB0eMHKZBFbSIABCw==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.12.1", "@eslint/config-array": "^0.19.2", - "@eslint/config-helpers": "^0.1.0", + "@eslint/config-helpers": "^0.2.0", "@eslint/core": "^0.12.0", - "@eslint/eslintrc": "^3.3.0", - "@eslint/js": "9.22.0", + "@eslint/eslintrc": "^3.3.1", + "@eslint/js": "9.23.0", "@eslint/plugin-kit": "^0.2.7", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", diff --git a/package.json b/package.json index 91c0b329a..736b29e7c 100644 --- a/package.json +++ b/package.json @@ -166,7 +166,7 @@ "@electron-forge/maker-zip": "7.7.0", "@electron-forge/plugin-auto-unpack-natives": "7.7.0", "@electron/rebuild": "3.7.1", - "@eslint/js": "9.22.0", + "@eslint/js": "9.23.0", "@fullcalendar/core": "6.1.15", "@fullcalendar/daygrid": "6.1.15", "@fullcalendar/interaction": "6.1.15", @@ -222,7 +222,7 @@ "cross-env": "7.0.3", "css-loader": "7.1.2", "electron": "35.0.3", - "eslint": "9.22.0", + "eslint": "9.23.0", "esm": "3.2.25", "globals": "16.0.0", "happy-dom": "17.4.4", From 88e0aec3d6073e9006215cb880208107dbc2d793 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 22 Mar 2025 01:59:08 +0000 Subject: [PATCH 13/92] fix(deps): update dependency eslint-linter-browserify to v9.23.0 --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9473a968c..edfdb1731 100644 --- a/package-lock.json +++ b/package-lock.json @@ -39,7 +39,7 @@ "electron-squirrel-startup": "1.0.1", "electron-window-state": "5.0.3", "escape-html": "1.0.3", - "eslint-linter-browserify": "9.22.0", + "eslint-linter-browserify": "9.23.0", "express": "4.21.2", "express-rate-limit": "7.5.0", "express-session": "1.18.1", @@ -11253,9 +11253,9 @@ } }, "node_modules/eslint-linter-browserify": { - "version": "9.22.0", - "resolved": "https://registry.npmjs.org/eslint-linter-browserify/-/eslint-linter-browserify-9.22.0.tgz", - "integrity": "sha512-b70x+ilh1XkugEZZvGJ6LNPE1+jxjsn4KIdj1OBMBGbzYj7l2lr3N/Y4NHKhFxq2a4v/J8WqojIOvy0AFDmrXw==", + "version": "9.23.0", + "resolved": "https://registry.npmjs.org/eslint-linter-browserify/-/eslint-linter-browserify-9.23.0.tgz", + "integrity": "sha512-5dpvA43y3psh58cl5HILg0Fk82KUP30YqCMQw17mt5H3kG16G3YfQgSE+sKV/6U3fT/SBitFrQA9PX0BZ7xUBQ==", "license": "MIT" }, "node_modules/eslint-scope": { diff --git a/package.json b/package.json index 91c0b329a..5ef203494 100644 --- a/package.json +++ b/package.json @@ -99,7 +99,7 @@ "electron-squirrel-startup": "1.0.1", "electron-window-state": "5.0.3", "escape-html": "1.0.3", - "eslint-linter-browserify": "9.22.0", + "eslint-linter-browserify": "9.23.0", "express": "4.21.2", "express-rate-limit": "7.5.0", "express-session": "1.18.1", From 007817bbdb625913a27620aa9f1940d64648825a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 22 Mar 2025 01:59:15 +0000 Subject: [PATCH 14/92] chore(deps): update apple-actions/import-codesign-certs action to v4 --- .github/actions/build-electron/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/build-electron/action.yml b/.github/actions/build-electron/action.yml index 51b022bed..547cd4c08 100644 --- a/.github/actions/build-electron/action.yml +++ b/.github/actions/build-electron/action.yml @@ -18,7 +18,7 @@ runs: # Certificate setup - name: Import Apple certificates if: inputs.os == 'macos' - uses: apple-actions/import-codesign-certs@v3 + uses: apple-actions/import-codesign-certs@v4 with: p12-file-base64: ${{ env.APPLE_APP_CERTIFICATE_BASE64 }} p12-password: ${{ env.APPLE_APP_CERTIFICATE_PASSWORD }} @@ -27,7 +27,7 @@ runs: - name: Install Installer certificate if: inputs.os == 'macos' - uses: apple-actions/import-codesign-certs@v3 + uses: apple-actions/import-codesign-certs@v4 with: p12-file-base64: ${{ env.APPLE_INSTALLER_CERTIFICATE_BASE64 }} p12-password: ${{ env.APPLE_INSTALLER_CERTIFICATE_PASSWORD }} From 67bfeda3d9512d6e90c81f265b1945b47f46bdfc Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 22 Mar 2025 16:33:00 +0200 Subject: [PATCH 15/92] chore(svg_export): change icon --- src/public/app/widgets/floating_buttons/svg_export_button.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/public/app/widgets/floating_buttons/svg_export_button.ts b/src/public/app/widgets/floating_buttons/svg_export_button.ts index 92fa33f41..a54954646 100644 --- a/src/public/app/widgets/floating_buttons/svg_export_button.ts +++ b/src/public/app/widgets/floating_buttons/svg_export_button.ts @@ -5,7 +5,7 @@ const TPL = ` `; From ab4e9db86468750a8f03f1dcaad43afaa0578b37 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 22 Mar 2025 16:35:07 +0200 Subject: [PATCH 16/92] feat(mindmap): add PNG export --- .../app/widgets/floating_buttons/png_export_button.ts | 2 +- src/public/app/widgets/type_widgets/mind_map.ts | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/public/app/widgets/floating_buttons/png_export_button.ts b/src/public/app/widgets/floating_buttons/png_export_button.ts index c1a04bed9..a0597c5d3 100644 --- a/src/public/app/widgets/floating_buttons/png_export_button.ts +++ b/src/public/app/widgets/floating_buttons/png_export_button.ts @@ -11,7 +11,7 @@ const TPL = ` export default class PngExportButton extends NoteContextAwareWidget { isEnabled() { - return super.isEnabled() && ["mermaid"].includes(this.note?.type ?? "") && this.note?.isContentAvailable() && this.noteContext?.viewScope?.viewMode === "default"; + return super.isEnabled() && ["mermaid", "mindMap"].includes(this.note?.type ?? "") && this.note?.isContentAvailable() && this.noteContext?.viewScope?.viewMode === "default"; } doRender() { diff --git a/src/public/app/widgets/type_widgets/mind_map.ts b/src/public/app/widgets/type_widgets/mind_map.ts index 9a9d82fb3..e48722a3a 100644 --- a/src/public/app/widgets/type_widgets/mind_map.ts +++ b/src/public/app/widgets/type_widgets/mind_map.ts @@ -276,4 +276,14 @@ export default class MindMapWidget extends TypeWidget { const svg = await this.renderSvg(); utils.downloadSvg(this.note.title, svg); } + + async exportPngEvent({ ntxId }: EventData<"exportPng">) { + if (!this.isNoteContext(ntxId) || this.note?.type !== "mindMap") { + return; + } + + const svg = await this.renderSvg(); + utils.downloadSvgAsPng(this.note.title, svg); + } + } From ccb98d69fa181929302601e459a0e9b8d76c31a0 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 22 Mar 2025 16:47:01 +0200 Subject: [PATCH 17/92] fix(mindmap): pane resizer not always working --- .../abstract_split_type_widget.ts | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/src/public/app/widgets/type_widgets/abstract_split_type_widget.ts b/src/public/app/widgets/type_widgets/abstract_split_type_widget.ts index c05ed2d7c..8dbb3e8e4 100644 --- a/src/public/app/widgets/type_widgets/abstract_split_type_widget.ts +++ b/src/public/app/widgets/type_widgets/abstract_split_type_widget.ts @@ -165,8 +165,7 @@ export default abstract class AbstractSplitTypeWidget extends TypeWidget { } cleanup(): void { - this.splitInstance?.destroy(); - this.splitInstance = undefined; + this.#destroyResizer(); } async doRefresh(note: FNote | null | undefined) { @@ -189,17 +188,19 @@ export default abstract class AbstractSplitTypeWidget extends TypeWidget { // Vertical vs horizontal layout const layoutOrientation = (!utils.isMobile() ? options.get("splitEditorOrientation") ?? "horizontal" : "vertical"); - if (this.layoutOrientation === layoutOrientation && this.isReadOnly === isReadOnly) { - return; + if (this.layoutOrientation !== layoutOrientation || this.isReadOnly !== isReadOnly) { + this.$widget + .toggleClass("split-horizontal", !isReadOnly && layoutOrientation === "horizontal") + .toggleClass("split-vertical", !isReadOnly && layoutOrientation === "vertical") + .toggleClass("split-read-only", isReadOnly); + this.layoutOrientation = layoutOrientation as ("horizontal" | "vertical"); + this.isReadOnly = isReadOnly; + this.#destroyResizer(); } - this.$widget - .toggleClass("split-horizontal", !isReadOnly && layoutOrientation === "horizontal") - .toggleClass("split-vertical", !isReadOnly && layoutOrientation === "vertical") - .toggleClass("split-read-only", isReadOnly); - this.layoutOrientation = layoutOrientation as ("horizontal" | "vertical"); - this.isReadOnly = isReadOnly; - this.#setupResizer(); + if (!this.splitInstance) { + this.#setupResizer(); + } } #setupResizer() { @@ -226,6 +227,11 @@ export default abstract class AbstractSplitTypeWidget extends TypeWidget { } } + #destroyResizer() { + this.splitInstance?.destroy(); + this.splitInstance = undefined; + } + /** * Called upon when the split between the preview and content pane is initialized. Can be used to add additional listeners if needed. */ From 81e250f5c56b9a6310dc0b5bed7c81de9a3b7981 Mon Sep 17 00:00:00 2001 From: hasecilu Date: Sat, 22 Mar 2025 09:54:22 -0600 Subject: [PATCH 18/92] chore(i18n): update Spanish translation --- src/public/translations/es/translation.json | 44 ++++++++++++++++++--- translations/es/server.json | 3 +- 2 files changed, 40 insertions(+), 7 deletions(-) diff --git a/src/public/translations/es/translation.json b/src/public/translations/es/translation.json index 82823b59a..cd6961264 100644 --- a/src/public/translations/es/translation.json +++ b/src/public/translations/es/translation.json @@ -744,7 +744,8 @@ "basic_properties": { "note_type": "Tipo de nota", "editable": "Editable", - "basic_properties": "Propiedades básicas" + "basic_properties": "Propiedades básicas", + "language": "Idioma" }, "book_properties": { "view_type": "Tipo de vista", @@ -1090,6 +1091,7 @@ "title": "Ancho del contenido", "default_description": "Trilium limita de forma predeterminada el ancho máximo del contenido para mejorar la legibilidad de ventanas maximizadas en pantallas anchas.", "max_width_label": "Ancho máximo del contenido en píxeles", + "max_width_unit": "píxeles", "apply_changes_description": "Para aplicar cambios en el ancho del contenido, haga clic en", "reload_button": "recargar la interfaz", "reload_description": "cambios desde las opciones de apariencia" @@ -1127,7 +1129,11 @@ "code_auto_read_only_size": { "title": "Tamaño automático de solo lectura", "description": "El tamaño de nota de solo lectura automático es el tamaño después del cual las notas se mostrarán en modo de solo lectura (por razones de rendimiento).", - "label": "Tamaño automático de solo lectura (notas de código)" + "label": "Tamaño automático de solo lectura (notas de código)", + "unit": "caracteres" + }, + "code-editor-options": { + "title": "Editor" }, "code_mime_types": { "title": "Tipos MIME disponibles en el menú desplegable" @@ -1146,6 +1152,7 @@ "download_images_description": "El HTML pegado puede contener referencias a imágenes en línea; Trilium encontrará esas referencias y descargará las imágenes para que estén disponibles sin conexión.", "enable_image_compression": "Habilitar la compresión de imágenes", "max_image_dimensions": "Ancho/alto máximo de una imagen en píxeles (la imagen cambiará de tamaño si excede esta configuración).", + "max_image_dimensions_unit": "píxeles", "jpeg_quality_description": "Calidad JPEG (10 - peor calidad, 100 - mejor calidad, se recomienda 50 - 85)" }, "attachment_erasure_timeout": { @@ -1177,6 +1184,7 @@ "note_revisions_snapshot_limit_title": "Límite de respaldos de revisiones de nota", "note_revisions_snapshot_limit_description": "El límite de número de respaldos de revisiones de notas se refiere al número máximo de revisiones que pueden guardarse para cada nota. Donde -1 significa sin límite, 0 significa borrar todas las revisiones. Puede establecer el máximo de revisiones para una sola nota a través de la etiqueta #versioningLimit.", "snapshot_number_limit_label": "Número límite de respaldos de revisiones de nota:", + "snapshot_number_limit_unit": "respaldos", "erase_excess_revision_snapshots": "Eliminar el exceso de respaldos de revisiones ahora", "erase_excess_revision_snapshots_prompt": "El exceso de respaldos de revisiones han sido eliminadas." }, @@ -1219,13 +1227,15 @@ "table_of_contents": { "title": "Tabla de contenido", "description": "La tabla de contenido aparecerá en las notas de texto cuando la nota tenga más de un número definido de títulos. Puede personalizar este número:", + "unit": "títulos", "disable_info": "También puede utilizar esta opción para desactivar la TDC (TOC) de forma efectiva estableciendo un número muy alto.", "shortcut_info": "Puede configurar un atajo de teclado para alternar rápidamente el panel derecho (incluido el TDC) en Opciones -> Atajos (nombre 'toggleRightPane')." }, "text_auto_read_only_size": { "title": "Tamaño para modo de solo lectura automático", "description": "El tamaño de nota de solo lectura automático es el tamaño después del cual las notas se mostrarán en modo de solo lectura (por razones de rendimiento).", - "label": "Tamaño para modo de solo lectura automático (notas de texto)" + "label": "Tamaño para modo de solo lectura automático (notas de texto)", + "unit": "caracteres" }, "i18n": { "title": "Localización", @@ -1302,7 +1312,7 @@ "shortcuts": { "keyboard_shortcuts": "Atajos de teclado", "multiple_shortcuts": "Varios atajos para la misma acción se pueden separar mediante comas.", - "electron_documentation": "Véa documentation de Electron para los modificadores y códigos de tecla disponibles.", + "electron_documentation": "Véa la documentación de Electron para los modificadores y códigos de tecla disponibles.", "type_text_to_filter": "Escriba texto para filtrar los accesos directos...", "action_name": "Nombre de la acción", "shortcuts": "Atajos", @@ -1326,6 +1336,7 @@ "config_title": "Configuración de sincronización", "server_address": "Dirección de la instancia del servidor", "timeout": "Tiempo de espera de sincronización (milisegundos)", + "timeout_unit": "milisegundos", "proxy_label": "Sincronizar servidor proxy (opcional)", "note": "Nota", "note_description": "Si deja la configuración del proxy en blanco, se utilizará el proxy del sistema (se aplica únicamente a la compilación de escritorio/electron).", @@ -1421,8 +1432,7 @@ "widget": "Widget", "confirm-change": "No es recomendado cambiar el tipo de nota cuando el contenido de la nota no está vacío. ¿Desea continuar de cualquier manera?", "geo-map": "Mapa Geo", - "beta-feature": "Beta", - "task-list": "Lista de tareas" + "beta-feature": "Beta" }, "protect_note": { "toggle-on": "Proteger la nota", @@ -1679,5 +1689,27 @@ "tomorrow": "Mañana", "yesterday": "Ayer" } + }, + "content_widget": { + "unknown_widget": "Widget desconocido para \"{{id}}\"." + }, + "note_language": { + "not_set": "No establecido", + "configure-languages": "Configurar idiomas..." + }, + "content_language": { + "title": "Contenido de idiomas", + "description": "Seleccione uno o más idiomas que deben aparecer en la selección del idioma en la sección Propiedades Básicas de una nota de texto de solo lectura o editable. Esto permitirá características tales como corrección de ortografía o soporte de derecha a izquierda." + }, + "switch_layout_button": { + "title_vertical": "Mover el panel de edición hacia abajo", + "title_horizontal": "Mover el panel de edición a la izquierda" + }, + "toggle_read_only_button": { + "unlock-editing": "Desbloquear la edición", + "lock-editing": "Bloquear la edición" + }, + "png_export_button": { + "button_title": "Exportar diagrama como PNG" } } diff --git a/translations/es/server.json b/translations/es/server.json index 6320aab0c..ecfdba3b7 100644 --- a/translations/es/server.json +++ b/translations/es/server.json @@ -244,7 +244,8 @@ "other": "Otros", "advanced-title": "Avanzado", "visible-launchers-title": "Lanzadores visibles", - "user-guide": "Guía de Usuario" + "user-guide": "Guía de Usuario", + "localization": "Idioma y Región" }, "notes": { "new-note": "Nueva nota", From 27875c46223b2f73422d9cdd626e24b2e1c562fd Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 23 Mar 2025 12:10:11 +0200 Subject: [PATCH 19/92] fix(e2e): broken after change in Mermaid --- e2e/note_types/mermaid.spec.ts | 2 +- e2e/support/app.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/e2e/note_types/mermaid.spec.ts b/e2e/note_types/mermaid.spec.ts index f7a0dd401..f64a447d7 100644 --- a/e2e/note_types/mermaid.spec.ts +++ b/e2e/note_types/mermaid.spec.ts @@ -63,7 +63,7 @@ async function testAriaSnapshot({ page, context, noteTitle, snapshot }: AriaTest await app.goto(); await app.goToNoteInNewTab(noteTitle); - const svgData = app.currentNoteSplit.locator(".mermaid-render svg"); + const svgData = app.currentNoteSplit.locator(".render-container svg"); await expect(svgData).toBeVisible(); await expect(svgData).toMatchAriaSnapshot(snapshot); } diff --git a/e2e/support/app.ts b/e2e/support/app.ts index 55f36a7ff..b526638d9 100644 --- a/e2e/support/app.ts +++ b/e2e/support/app.ts @@ -54,6 +54,7 @@ export default class App { async goToNoteInNewTab(noteTitle: string) { const autocomplete = this.currentNoteSplit.locator(".note-autocomplete"); await autocomplete.fill(noteTitle); + await expect(this.currentNoteSplit.locator(".note-detail-empty-results")).toContainText(noteTitle); await autocomplete.press("ArrowDown"); await autocomplete.press("Enter"); } From f341bb3547b5f477f31460c960ae11755b5bafed Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 23 Mar 2025 12:29:13 +0200 Subject: [PATCH 20/92] feat(ci): trigger nightly without publish on build-electron change --- .github/workflows/nightly.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 1a7437423..0ab203be0 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -5,6 +5,9 @@ on: - cron: "0 2 * * *" # run at 2 AM UTC # This can be used to allow manually triggering nightlies from the web interface workflow_dispatch: + pull_request: + paths: + - .github/actions/build-electron/* env: GITHUB_UPLOAD_URL: https://uploads.github.com/repos/TriliumNext/Notes/releases/179589950/assets{?name,label} GITHUB_RELEASE_ID: 179589950 @@ -56,6 +59,7 @@ jobs: - name: Publish release uses: softprops/action-gh-release@v2 + if: ${{ github.event_name != 'pull_request' }} with: make_latest: false prerelease: true @@ -88,6 +92,7 @@ jobs: - name: Publish release uses: softprops/action-gh-release@v2 + if: ${{ github.event_name != 'pull_request' }} with: make_latest: false prerelease: true From 3173062f484a6dcbff16c571be4b45a4e656d8cf Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 23 Mar 2025 12:29:34 +0200 Subject: [PATCH 21/92] Revert "chore(deps): update apple-actions/import-codesign-certs action to v4" --- .github/actions/build-electron/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/build-electron/action.yml b/.github/actions/build-electron/action.yml index 547cd4c08..51b022bed 100644 --- a/.github/actions/build-electron/action.yml +++ b/.github/actions/build-electron/action.yml @@ -18,7 +18,7 @@ runs: # Certificate setup - name: Import Apple certificates if: inputs.os == 'macos' - uses: apple-actions/import-codesign-certs@v4 + uses: apple-actions/import-codesign-certs@v3 with: p12-file-base64: ${{ env.APPLE_APP_CERTIFICATE_BASE64 }} p12-password: ${{ env.APPLE_APP_CERTIFICATE_PASSWORD }} @@ -27,7 +27,7 @@ runs: - name: Install Installer certificate if: inputs.os == 'macos' - uses: apple-actions/import-codesign-certs@v4 + uses: apple-actions/import-codesign-certs@v3 with: p12-file-base64: ${{ env.APPLE_INSTALLER_CERTIFICATE_BASE64 }} p12-password: ${{ env.APPLE_INSTALLER_CERTIFICATE_PASSWORD }} From 6aee38337e8dbda5ad27baa4841aa473d7ad7aa0 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 23 Mar 2025 20:03:24 +0200 Subject: [PATCH 22/92] fix(mobile): width on tablet view --- src/public/app/layouts/mobile_layout.ts | 6 +----- src/public/stylesheets/style.css | 10 ++++++++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/public/app/layouts/mobile_layout.ts b/src/public/app/layouts/mobile_layout.ts index ed3d76665..db4db49bc 100644 --- a/src/public/app/layouts/mobile_layout.ts +++ b/src/public/app/layouts/mobile_layout.ts @@ -130,7 +130,7 @@ export default class MobileLayout { .id("mobile-rest-container") .child( new SidebarContainer("tree", "column") - .class("d-sm-flex d-md-flex d-lg-flex d-xl-flex col-12 col-sm-5 col-md-4 col-lg-3 col-xl-3") + .class("d-md-flex d-lg-flex d-xl-flex col-12 col-sm-5 col-md-4 col-lg-3 col-xl-3") .id("mobile-sidebar-wrapper") .css("max-height", "100%") .css("padding-left", "0") @@ -142,10 +142,6 @@ export default class MobileLayout { new ScreenContainer("detail", "column") .id("detail-container") .class("d-sm-flex d-md-flex d-lg-flex d-xl-flex col-12 col-sm-7 col-md-8 col-lg-9") - .css("padding-left", "0") - .css("padding-right", "0") - .css("max-height", "100%") - .css("position", "relative") .child( new FlexContainer("row") .contentSized() diff --git a/src/public/stylesheets/style.css b/src/public/stylesheets/style.css index 4f34130e2..c2091531a 100644 --- a/src/public/stylesheets/style.css +++ b/src/public/stylesheets/style.css @@ -1315,6 +1315,12 @@ body:not(.mobile) #launcher-pane.horizontal .dropdown-submenu > .dropdown-menu { } /* Mobile, phone mode */ + +#detail-container { + max-height: 100%; + position: relative; +} + @media (max-width: 991px) { body.mobile #launcher-pane .dropdown.global-menu > .dropdown-menu.show, body.mobile #launcher-container .dropdown > .dropdown-menu.show { @@ -1354,6 +1360,10 @@ body:not(.mobile) #launcher-pane.horizontal .dropdown-submenu > .dropdown-menu { z-index: 2000; } + #detail-container { + width: 100%; + } + #mobile-sidebar-container.show #mobile-sidebar-wrapper { transform: translateX(0); } From 89efc55d52742ecae9964d063474d436eefce727 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 23 Mar 2025 21:00:37 +0200 Subject: [PATCH 23/92] chore(ci): trigger windows only for now --- .github/workflows/nightly.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 0ab203be0..4cebdf8c3 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -8,6 +8,7 @@ on: pull_request: paths: - .github/actions/build-electron/* + push: env: GITHUB_UPLOAD_URL: https://uploads.github.com/repos/TriliumNext/Notes/releases/179589950/assets{?name,label} GITHUB_RELEASE_ID: 179589950 @@ -19,14 +20,8 @@ jobs: strategy: fail-fast: false matrix: - arch: [x64, arm64] + arch: [x64] os: - - name: macos - image: macos-latest - extension: [dmg, zip] - - name: linux - image: ubuntu-latest - extension: [deb, rpm, zip, flatpak] - name: windows image: windows-latest extension: [exe, zip] From d77b3a07e2ab531e9d4ca65c700dca44ef32a7d3 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 23 Mar 2025 21:02:16 +0200 Subject: [PATCH 24/92] chore(ci): remove unnecessary shell --- .github/workflows/nightly.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 4cebdf8c3..03e0bbf55 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -33,7 +33,6 @@ jobs: with: node-version: 20 - name: Install dependencies - shell: bash run: npm ci - name: Update nightly version run: npm run chore:ci-update-nightly-version From c50a67f36b01bcb8e8f5f05ca3a7a54ee6cc1542 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 23 Mar 2025 21:02:37 +0200 Subject: [PATCH 25/92] chore(ci): remove server build temporarily --- .github/workflows/nightly.yml | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 03e0bbf55..0a2b88baa 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -62,36 +62,3 @@ jobs: files: upload/*.* tag_name: nightly name: Nightly Build - - nightly-server: - name: Deploy server nightly - strategy: - fail-fast: false - matrix: - arch: [x64, arm64] - include: - - arch: x64 - runs-on: ubuntu-latest - - arch: arm64 - runs-on: ubuntu-24.04-arm - runs-on: ${{ matrix.runs-on }} - steps: - - uses: actions/checkout@v4 - - - name: Run the build - uses: ./.github/actions/build-server - with: - os: linux - arch: ${{ matrix.arch }} - - - name: Publish release - uses: softprops/action-gh-release@v2 - if: ${{ github.event_name != 'pull_request' }} - with: - make_latest: false - prerelease: true - draft: false - fail_on_unmatched_files: true - files: upload/*.* - tag_name: nightly - name: Nightly Build From 98013bc725e1085e763865bea2ac30b614f4c2bb Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 23 Mar 2025 21:10:55 +0200 Subject: [PATCH 26/92] chore(ci): use cmd --- .github/actions/build-electron/action.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/actions/build-electron/action.yml b/.github/actions/build-electron/action.yml index 51b022bed..2c168c7ac 100644 --- a/.github/actions/build-electron/action.yml +++ b/.github/actions/build-electron/action.yml @@ -38,21 +38,21 @@ runs: - name: Verify certificates if: inputs.os == 'macos' - shell: bash + shell: cmd run: | echo "Available signing identities:" security find-identity -v -p codesigning build.keychain - name: Set up Python and other macOS dependencies if: ${{ inputs.os == 'macos' }} - shell: bash + shell: cmd run: | brew install python-setuptools brew install create-dmg - name: Install dependencies for RPM and Flatpak package building if: ${{ inputs.os == 'linux' }} - shell: bash + shell: cmd run: | sudo apt-get update && sudo apt-get install rpm flatpak-builder elfutils flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo @@ -62,16 +62,16 @@ runs: # Build setup - name: Install dependencies - shell: bash + shell: cmd run: npm ci - name: Update build info - shell: bash + shell: cmd run: npm run chore:update-build-info # Critical debugging configuration - name: Run electron-forge build with enhanced logging - shell: bash + shell: cmd env: # Pass through required environment variables for signing and notarization APPLE_TEAM_ID: ${{ env.APPLE_TEAM_ID }} @@ -94,7 +94,7 @@ runs: # Add DMG signing step - name: Sign DMG if: inputs.os == 'macos' - shell: bash + shell: cmd run: | echo "Signing DMG file..." dmg_file=$(find ./dist -name "*.dmg" -print -quit) @@ -119,7 +119,7 @@ runs: - name: Verify code signing if: inputs.os == 'macos' - shell: bash + shell: cmd run: | echo "Verifying code signing for all artifacts..." @@ -167,7 +167,7 @@ runs: fi - name: Prepare artifacts - shell: bash + shell: cmd run: | mkdir -p upload From c477e728ea21a47935bd41fad6b1080597a1406f Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 23 Mar 2025 21:14:51 +0200 Subject: [PATCH 27/92] chore(ci): define forge platform at workflow level --- .github/actions/build-electron/action.yml | 13 +++---------- .github/workflows/nightly.yml | 1 + 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/.github/actions/build-electron/action.yml b/.github/actions/build-electron/action.yml index 2c168c7ac..fb41ac392 100644 --- a/.github/actions/build-electron/action.yml +++ b/.github/actions/build-electron/action.yml @@ -11,6 +11,8 @@ inputs: extension: description: "Platform specific extensions to copy in the output: dmg, deb, rpm, exe, zip" required: true + forge_platform: + required: true runs: using: composite @@ -78,18 +80,9 @@ runs: APPLE_ID: ${{ env.APPLE_ID }} APPLE_ID_PASSWORD: ${{ env.APPLE_ID_PASSWORD }} run: | - # Map OS names to Electron Forge platform names - if [ "${{ inputs.os }}" = "macos" ]; then - PLATFORM="darwin" - elif [ "${{ inputs.os }}" = "windows" ]; then - PLATFORM="win32" - else - PLATFORM="${{ inputs.os }}" - fi - npm run electron-forge:make -- \ --arch=${{ inputs.arch }} \ - --platform=$PLATFORM + --platform=${{ inputs.forge_platform }} # Add DMG signing step - name: Sign DMG diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 0a2b88baa..eda9e3107 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -25,6 +25,7 @@ jobs: - name: windows image: windows-latest extension: [exe, zip] + forge_platform: win32 runs-on: ${{ matrix.os.image }} steps: - uses: actions/checkout@v4 From a13c9790bd1dacb9bbade104e6e4f8d4ac5125fe Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 23 Mar 2025 21:31:42 +0200 Subject: [PATCH 28/92] chore(ci): try running npm i at build step --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9fdf6cd2e..ba91c45b6 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "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 nix-shell -p electron_33 --run \"electron ./electron-docs-main.ts .\"", "electron-forge:prepare": "npm run build:prepare-dist && cp -r node_modules ./build", "electron-forge:start": "npm run electron-forge:prepare && cd ./build && electron-forge start", - "electron-forge:make": "npm run electron-forge:prepare && cd ./build && electron-forge make", + "electron-forge:make": "cd .\\build && npm i && electron-forge make", "electron-forge:package": "npm run electron-forge:prepare && cd ./build && electron-forge package", "docs:build-backend": "rimraf ./docs/backend_api && typedoc ./docs/backend_api src/becca/entities/*.ts src/services/backend_script_api.ts src/services/sql.ts", "docs:build-frontend": "rimraf ./docs/frontend_api && jsdoc -c jsdoc-conf.json -d ./docs/frontend_api src/public/app/entities/*.js src/public/app/services/frontend_script_api.js src/public/app/widgets/basic_widget.js src/public/app/widgets/note_context_aware_widget.js src/public/app/widgets/right_panel_widget.js", From 9358f90b4877a52a640fc7c24cd68bb3a346a858 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 23 Mar 2025 21:41:27 +0200 Subject: [PATCH 29/92] chore(ci): revert change --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ba91c45b6..9fdf6cd2e 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "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 nix-shell -p electron_33 --run \"electron ./electron-docs-main.ts .\"", "electron-forge:prepare": "npm run build:prepare-dist && cp -r node_modules ./build", "electron-forge:start": "npm run electron-forge:prepare && cd ./build && electron-forge start", - "electron-forge:make": "cd .\\build && npm i && electron-forge make", + "electron-forge:make": "npm run electron-forge:prepare && cd ./build && electron-forge make", "electron-forge:package": "npm run electron-forge:prepare && cd ./build && electron-forge package", "docs:build-backend": "rimraf ./docs/backend_api && typedoc ./docs/backend_api src/becca/entities/*.ts src/services/backend_script_api.ts src/services/sql.ts", "docs:build-frontend": "rimraf ./docs/frontend_api && jsdoc -c jsdoc-conf.json -d ./docs/frontend_api src/public/app/entities/*.js src/public/app/services/frontend_script_api.js src/public/app/widgets/basic_widget.js src/public/app/widgets/note_context_aware_widget.js src/public/app/widgets/right_panel_widget.js", From d128e9df25a8bafc9c74d154ffc7855f854b7ebd Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 23 Mar 2025 21:48:40 +0200 Subject: [PATCH 30/92] chore(ci): run with debug --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 9fdf6cd2e..4f746677b 100644 --- a/package.json +++ b/package.json @@ -38,16 +38,16 @@ "electron:switch": "electron-rebuild", "docs:edit": "cross-env NODE_OPTIONS=\"--import tsx\" TRILIUM_DATA_DIR=./data-docs TRILIUM_ENV=dev 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 nix-shell -p electron_33 --run \"electron ./electron-docs-main.ts .\"", - "electron-forge:prepare": "npm run build:prepare-dist && cp -r node_modules ./build", + "electron-forge:prepare": "npm run build:prepare-dist", "electron-forge:start": "npm run electron-forge:prepare && cd ./build && electron-forge start", - "electron-forge:make": "npm run electron-forge:prepare && cd ./build && electron-forge make", + "electron-forge:make": "npm run electron-forge:prepare && cd ./build && cross-env DEBUG=electron-forge:* electron-forge make", "electron-forge:package": "npm run electron-forge:prepare && cd ./build && electron-forge package", "docs:build-backend": "rimraf ./docs/backend_api && typedoc ./docs/backend_api src/becca/entities/*.ts src/services/backend_script_api.ts src/services/sql.ts", "docs:build-frontend": "rimraf ./docs/frontend_api && jsdoc -c jsdoc-conf.json -d ./docs/frontend_api src/public/app/entities/*.js src/public/app/services/frontend_script_api.js src/public/app/widgets/basic_widget.js src/public/app/widgets/note_context_aware_widget.js src/public/app/widgets/right_panel_widget.js", "docs:build": "npm run docs:build-backend && npm run docs:build-frontend", "build:webpack": "tsx node_modules/webpack/bin/webpack.js -c webpack.config.ts --progress", "build:ts": "tsc -p tsconfig.build.json", - "build:clean": "rimraf ./dist ./build", + "build:clean": "rimraf ./dist", "build:prepare-dist": "npm run build:clean && npm run build:ts && npm run build:webpack && tsx ./bin/copy-dist.ts", "test": "npm run client:test && npm run server:test", "server:test": "cross-env TRILIUM_ENV=dev TRILIUM_DATA_DIR=./integration-tests/db TRILIUM_INTEGRATION_TEST=memory vitest", From ab927ad88531f080c592b98947b5daec21085d1e Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 23 Mar 2025 21:55:48 +0200 Subject: [PATCH 31/92] chore(ci): set up npm ci again --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4f746677b..282d7c109 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "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 nix-shell -p electron_33 --run \"electron ./electron-docs-main.ts .\"", "electron-forge:prepare": "npm run build:prepare-dist", "electron-forge:start": "npm run electron-forge:prepare && cd ./build && electron-forge start", - "electron-forge:make": "npm run electron-forge:prepare && cd ./build && cross-env DEBUG=electron-forge:* electron-forge make", + "electron-forge:make": "npm run electron-forge:prepare && cd ./build && npm ci && cross-env DEBUG=electron-forge:* electron-forge make", "electron-forge:package": "npm run electron-forge:prepare && cd ./build && electron-forge package", "docs:build-backend": "rimraf ./docs/backend_api && typedoc ./docs/backend_api src/becca/entities/*.ts src/services/backend_script_api.ts src/services/sql.ts", "docs:build-frontend": "rimraf ./docs/frontend_api && jsdoc -c jsdoc-conf.json -d ./docs/frontend_api src/public/app/entities/*.js src/public/app/services/frontend_script_api.js src/public/app/widgets/basic_widget.js src/public/app/widgets/note_context_aware_widget.js src/public/app/widgets/right_panel_widget.js", From b4dc493a5fcf21744a1abf121d4022da8e9b2f1e Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 23 Mar 2025 22:12:31 +0200 Subject: [PATCH 32/92] chore(ci): use different way of specifying app dir --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 282d7c109..ab24d0216 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "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 nix-shell -p electron_33 --run \"electron ./electron-docs-main.ts .\"", "electron-forge:prepare": "npm run build:prepare-dist", "electron-forge:start": "npm run electron-forge:prepare && cd ./build && electron-forge start", - "electron-forge:make": "npm run electron-forge:prepare && cd ./build && npm ci && cross-env DEBUG=electron-forge:* electron-forge make", + "electron-forge:make": "npm run electron-forge:prepare && npm ci && cross-env DEBUG=electron-forge:* electron-forge make --app-path=./build", "electron-forge:package": "npm run electron-forge:prepare && cd ./build && electron-forge package", "docs:build-backend": "rimraf ./docs/backend_api && typedoc ./docs/backend_api src/becca/entities/*.ts src/services/backend_script_api.ts src/services/sql.ts", "docs:build-frontend": "rimraf ./docs/frontend_api && jsdoc -c jsdoc-conf.json -d ./docs/frontend_api src/public/app/entities/*.js src/public/app/services/frontend_script_api.js src/public/app/widgets/basic_widget.js src/public/app/widgets/note_context_aware_widget.js src/public/app/widgets/right_panel_widget.js", From 8e2a95b5c4bffaa414c0f05940a60504c91e52e8 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 23 Mar 2025 22:41:26 +0200 Subject: [PATCH 33/92] chore(ci): use different way of specifying app dir pt. 2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ab24d0216..3acb9b455 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "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 nix-shell -p electron_33 --run \"electron ./electron-docs-main.ts .\"", "electron-forge:prepare": "npm run build:prepare-dist", "electron-forge:start": "npm run electron-forge:prepare && cd ./build && electron-forge start", - "electron-forge:make": "npm run electron-forge:prepare && npm ci && cross-env DEBUG=electron-forge:* electron-forge make --app-path=./build", + "electron-forge:make": "npm run electron-forge:prepare && npm ci && cross-env DEBUG=electron-forge:* electron-forge make ./build", "electron-forge:package": "npm run electron-forge:prepare && cd ./build && electron-forge package", "docs:build-backend": "rimraf ./docs/backend_api && typedoc ./docs/backend_api src/becca/entities/*.ts src/services/backend_script_api.ts src/services/sql.ts", "docs:build-frontend": "rimraf ./docs/frontend_api && jsdoc -c jsdoc-conf.json -d ./docs/frontend_api src/public/app/entities/*.js src/public/app/services/frontend_script_api.js src/public/app/widgets/basic_widget.js src/public/app/widgets/note_context_aware_widget.js src/public/app/widgets/right_panel_widget.js", From a709f68af90e230c79b1139d5fca59c47aadc647 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 23 Mar 2025 22:47:59 +0200 Subject: [PATCH 34/92] chore(ci): set up node modules --- bin/copy-dist.ts | 1 + package.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/copy-dist.ts b/bin/copy-dist.ts index 2c071142c..4e4808137 100644 --- a/bin/copy-dist.ts +++ b/bin/copy-dist.ts @@ -21,6 +21,7 @@ function copyNodeModuleFileOrFolder(source: string) { try { const assetsToCopy = new Set([ + "./node_modules", "./images", "./libraries", "./translations", diff --git a/package.json b/package.json index 3acb9b455..a5a02d1f2 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "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 nix-shell -p electron_33 --run \"electron ./electron-docs-main.ts .\"", "electron-forge:prepare": "npm run build:prepare-dist", "electron-forge:start": "npm run electron-forge:prepare && cd ./build && electron-forge start", - "electron-forge:make": "npm run electron-forge:prepare && npm ci && cross-env DEBUG=electron-forge:* electron-forge make ./build", + "electron-forge:make": "npm run electron-forge:prepare && cross-env DEBUG=electron-forge:* electron-forge make ./build", "electron-forge:package": "npm run electron-forge:prepare && cd ./build && electron-forge package", "docs:build-backend": "rimraf ./docs/backend_api && typedoc ./docs/backend_api src/becca/entities/*.ts src/services/backend_script_api.ts src/services/sql.ts", "docs:build-frontend": "rimraf ./docs/frontend_api && jsdoc -c jsdoc-conf.json -d ./docs/frontend_api src/public/app/entities/*.js src/public/app/services/frontend_script_api.js src/public/app/widgets/basic_widget.js src/public/app/widgets/note_context_aware_widget.js src/public/app/widgets/right_panel_widget.js", From fae9a1f796d083653e7c7b4cc225a9571351c124 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 23 Mar 2025 23:06:41 +0200 Subject: [PATCH 35/92] chore(ci): use electron-forge hook for gathering artifacts --- .github/actions/build-electron/action.yml | 46 ----------------------- forge.config.cjs | 15 +++++++- 2 files changed, 14 insertions(+), 47 deletions(-) diff --git a/.github/actions/build-electron/action.yml b/.github/actions/build-electron/action.yml index fb41ac392..5a4aa11a2 100644 --- a/.github/actions/build-electron/action.yml +++ b/.github/actions/build-electron/action.yml @@ -158,49 +158,3 @@ runs: echo "Found ZIP: $zip_file" echo "Note: ZIP files are not code signed, but their contents should be" fi - - - name: Prepare artifacts - shell: cmd - run: | - mkdir -p upload - - if [ "${{ inputs.os }}" = "macos" ]; then - # For macOS, we need to look in specific directories based on the maker - echo "Collecting macOS artifacts..." - - # Look for DMG files recursively - echo "Looking for DMG files..." - dmg_file=$(find ./dist -name "*.dmg" -print -quit) - if [ -n "$dmg_file" ]; then - echo "Found DMG: $dmg_file" - cp "$dmg_file" "upload/TriliumNextNotes-${{ github.ref_name }}-macos-${{ inputs.arch }}.dmg" - else - echo "Warning: No DMG file found" - fi - - # Look for ZIP files recursively - echo "Looking for ZIP files..." - zip_file=$(find ./dist -name "*.zip" -print -quit) - if [ -n "$zip_file" ]; then - echo "Found ZIP: $zip_file" - cp "$zip_file" "upload/TriliumNextNotes-${{ github.ref_name }}-macos-${{ inputs.arch }}.zip" - else - echo "Warning: No ZIP file found" - fi - else - # For other platforms, use the existing logic but with better error handling - echo "Collecting artifacts for ${{ inputs.os }}..." - for ext in ${{ inputs.extension }}; do - echo "Looking for .$ext files..." - file=$(find ./dist -name "*.$ext" -print -quit) - if [ -n "$file" ]; then - echo "Found $file for extension $ext" - cp "$file" "upload/TriliumNextNotes-${{ github.ref_name }}-${{ inputs.os }}-${{ inputs.arch }}.$ext" - else - echo "Warning: No file found with extension .$ext" - fi - done - fi - - echo "Final contents of upload directory:" - ls -la upload/ diff --git a/forge.config.cjs b/forge.config.cjs index dabcd7ca4..7cd50d44d 100644 --- a/forge.config.cjs +++ b/forge.config.cjs @@ -129,7 +129,20 @@ module.exports = { name: "@electron-forge/plugin-auto-unpack-natives", config: {} } - ] + ], + hooks: { + postMake(_, makeResults) { + const outputDir = path.join(__dirname, "upload"); + fs.mkdirp(outputDir); + for (const makeResult of makeResults) { + for (const artifactPath of makeResult.artifacts) { + const outputPath = path.join(outputDir, path.basename(artifactPath)); + console.log(`[Artifact] ${artifactPath} -> ${outputPath}`); + fs.copyFile(artifactPath, outputPath); + } + } + } + } }; function getExtraResourcesForPlatform() { From 5d2ea4337c69538c330c621321a6f86c0f7b144f Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 23 Mar 2025 23:08:02 +0200 Subject: [PATCH 36/92] fix(ci): use right directory for artifact gathering --- forge.config.cjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/forge.config.cjs b/forge.config.cjs index 7cd50d44d..463a6a19f 100644 --- a/forge.config.cjs +++ b/forge.config.cjs @@ -132,7 +132,7 @@ module.exports = { ], hooks: { postMake(_, makeResults) { - const outputDir = path.join(__dirname, "upload"); + const outputDir = path.join(__dirname, "..", "upload"); fs.mkdirp(outputDir); for (const makeResult of makeResults) { for (const artifactPath of makeResult.artifacts) { From dd26762b1f588e145a8a3732b3f9b7a5eeb9677e Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 23 Mar 2025 23:17:54 +0200 Subject: [PATCH 37/92] feat(ci): upload test artifacts for nightly build --- .github/workflows/nightly.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index eda9e3107..959c0807a 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -63,3 +63,10 @@ jobs: files: upload/*.* tag_name: nightly name: Nightly Build + + - name: Publish artifacts + uses: actions/upload-artifact@v4 + if: ${{ github.event_name == 'pull_request' }} + with: + name: TriliumNextNotes ${{ matrix.os.name }} ${{ matrix.arch }}.zip + path: upload From ad0f84468192e7be3455da0a928d230a30b41ffc Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 23 Mar 2025 23:20:13 +0200 Subject: [PATCH 38/92] chore(ci): use signing runner --- .github/workflows/nightly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 959c0807a..5bfe3aa29 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -23,7 +23,7 @@ jobs: arch: [x64] os: - name: windows - image: windows-latest + image: win-signing extension: [exe, zip] forge_platform: win32 runs-on: ${{ matrix.os.image }} From 40f4fdab4761d25f89034f23b64d099a7d539e2e Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 23 Mar 2025 23:22:22 +0200 Subject: [PATCH 39/92] feat(ci): set up signing hook --- bin/copy-dist.ts | 1 + bin/electron-forge/sign-windows.cjs | 8 ++++++++ forge.config.cjs | 3 +++ 3 files changed, 12 insertions(+) create mode 100644 bin/electron-forge/sign-windows.cjs diff --git a/bin/copy-dist.ts b/bin/copy-dist.ts index 4e4808137..eaa79808e 100644 --- a/bin/copy-dist.ts +++ b/bin/copy-dist.ts @@ -34,6 +34,7 @@ try { "./forge.config.cjs", "./bin/tpl/", "./bin/electron-forge/desktop.ejs", + "./bin/electron-forge/sign-windows.cjs", "./src/views/", "./src/etapi/etapi.openapi.yaml", "./src/routes/api/openapi.json", diff --git a/bin/electron-forge/sign-windows.cjs b/bin/electron-forge/sign-windows.cjs new file mode 100644 index 000000000..446a6279e --- /dev/null +++ b/bin/electron-forge/sign-windows.cjs @@ -0,0 +1,8 @@ +const child_process = require("child_process"); +const SIGN_EXECUTABLE = "C:\\ev_signer_trilium\\ev_signer_trilium.exe"; + +module.exports = function (filePath) { + const command = `${SIGN_EXECUTABLE} --executable "${filePath}"`; + console.log(`> ${command}`); + child_process.execSync(command); +} \ No newline at end of file diff --git a/forge.config.cjs b/forge.config.cjs index 463a6a19f..288826f8a 100644 --- a/forge.config.cjs +++ b/forge.config.cjs @@ -26,6 +26,9 @@ module.exports = { appleIdPassword: process.env.APPLE_ID_PASSWORD, teamId: process.env.APPLE_TEAM_ID }, + windowsSign: { + hookModulePath: "bin\\sign-windows.cjs" + }, extraResource: [ // All resources should stay in Resources directory for macOS ...(process.platform === "darwin" ? [] : extraResourcesForPlatform), From cb7de2430d153640a317061ca83390f5590f49e1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 24 Mar 2025 01:55:27 +0000 Subject: [PATCH 40/92] chore(deps): update dependency @types/leaflet to v1.9.17 --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index bba90d9f9..24b1755ef 100644 --- a/package-lock.json +++ b/package-lock.json @@ -138,7 +138,7 @@ "@types/jquery": "3.5.32", "@types/js-yaml": "4.0.9", "@types/jsdom": "21.1.7", - "@types/leaflet": "1.9.16", + "@types/leaflet": "1.9.17", "@types/leaflet-gpx": "1.3.7", "@types/mime-types": "2.1.4", "@types/multer": "1.4.12", @@ -5820,9 +5820,9 @@ } }, "node_modules/@types/leaflet": { - "version": "1.9.16", - "resolved": "https://registry.npmjs.org/@types/leaflet/-/leaflet-1.9.16.tgz", - "integrity": "sha512-wzZoyySUxkgMZ0ihJ7IaUIblG8Rdc8AbbZKLneyn+QjYsj5q1QU7TEKYqwTr10BGSzY5LI7tJk9Ifo+mEjdFRw==", + "version": "1.9.17", + "resolved": "https://registry.npmjs.org/@types/leaflet/-/leaflet-1.9.17.tgz", + "integrity": "sha512-IJ4K6t7I3Fh5qXbQ1uwL3CFVbCi6haW9+53oLWgdKlLP7EaS21byWFJxxqOx9y8I0AP0actXSJLVMbyvxhkUTA==", "dev": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 9fdf6cd2e..2f7f8d0e8 100644 --- a/package.json +++ b/package.json @@ -195,7 +195,7 @@ "@types/jquery": "3.5.32", "@types/js-yaml": "4.0.9", "@types/jsdom": "21.1.7", - "@types/leaflet": "1.9.16", + "@types/leaflet": "1.9.17", "@types/leaflet-gpx": "1.3.7", "@types/mime-types": "2.1.4", "@types/multer": "1.4.12", From 728d2ccfafac38b6ddd64f7b2c932c2e7718d6ad Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 24 Mar 2025 01:55:36 +0000 Subject: [PATCH 41/92] chore(deps): update dependency rollup to v4.37.0 --- .../turndown-plugin-gfm/package-lock.json | 173 ++++++++++-------- 1 file changed, 94 insertions(+), 79 deletions(-) diff --git a/packages/turndown-plugin-gfm/package-lock.json b/packages/turndown-plugin-gfm/package-lock.json index c06650f50..840349a44 100644 --- a/packages/turndown-plugin-gfm/package-lock.json +++ b/packages/turndown-plugin-gfm/package-lock.json @@ -163,9 +163,9 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.36.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.36.0.tgz", - "integrity": "sha512-jgrXjjcEwN6XpZXL0HUeOVGfjXhPyxAbbhD0BlXUB+abTOpbPiN5Wb3kOT7yb+uEtATNYF5x5gIfwutmuBA26w==", + "version": "4.37.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.37.0.tgz", + "integrity": "sha512-l7StVw6WAa8l3vA1ov80jyetOAEo1FtHvZDbzXDO/02Sq/QVvqlHkYoFwDJPIMj0GKiistsBudfx5tGFnwYWDQ==", "cpu": [ "arm" ], @@ -177,9 +177,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.36.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.36.0.tgz", - "integrity": "sha512-NyfuLvdPdNUfUNeYKUwPwKsE5SXa2J6bCt2LdB/N+AxShnkpiczi3tcLJrm5mA+eqpy0HmaIY9F6XCa32N5yzg==", + "version": "4.37.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.37.0.tgz", + "integrity": "sha512-6U3SlVyMxezt8Y+/iEBcbp945uZjJwjZimu76xoG7tO1av9VO691z8PkhzQ85ith2I8R2RddEPeSfcbyPfD4hA==", "cpu": [ "arm64" ], @@ -191,9 +191,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.36.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.36.0.tgz", - "integrity": "sha512-JQ1Jk5G4bGrD4pWJQzWsD8I1n1mgPXq33+/vP4sk8j/z/C2siRuxZtaUA7yMTf71TCZTZl/4e1bfzwUmFb3+rw==", + "version": "4.37.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.37.0.tgz", + "integrity": "sha512-+iTQ5YHuGmPt10NTzEyMPbayiNTcOZDWsbxZYR1ZnmLnZxG17ivrPSWFO9j6GalY0+gV3Jtwrrs12DBscxnlYA==", "cpu": [ "arm64" ], @@ -205,9 +205,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.36.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.36.0.tgz", - "integrity": "sha512-6c6wMZa1lrtiRsbDziCmjE53YbTkxMYhhnWnSW8R/yqsM7a6mSJ3uAVT0t8Y/DGt7gxUWYuFM4bwWk9XCJrFKA==", + "version": "4.37.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.37.0.tgz", + "integrity": "sha512-m8W2UbxLDcmRKVjgl5J/k4B8d7qX2EcJve3Sut7YGrQoPtCIQGPH5AMzuFvYRWZi0FVS0zEY4c8uttPfX6bwYQ==", "cpu": [ "x64" ], @@ -219,9 +219,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.36.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.36.0.tgz", - "integrity": "sha512-KXVsijKeJXOl8QzXTsA+sHVDsFOmMCdBRgFmBb+mfEb/7geR7+C8ypAml4fquUt14ZyVXaw2o1FWhqAfOvA4sg==", + "version": "4.37.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.37.0.tgz", + "integrity": "sha512-FOMXGmH15OmtQWEt174v9P1JqqhlgYge/bUjIbiVD1nI1NeJ30HYT9SJlZMqdo1uQFyt9cz748F1BHghWaDnVA==", "cpu": [ "arm64" ], @@ -233,9 +233,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.36.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.36.0.tgz", - "integrity": "sha512-dVeWq1ebbvByI+ndz4IJcD4a09RJgRYmLccwlQ8bPd4olz3Y213uf1iwvc7ZaxNn2ab7bjc08PrtBgMu6nb4pQ==", + "version": "4.37.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.37.0.tgz", + "integrity": "sha512-SZMxNttjPKvV14Hjck5t70xS3l63sbVwl98g3FlVVx2YIDmfUIy29jQrsw06ewEYQ8lQSuY9mpAPlmgRD2iSsA==", "cpu": [ "x64" ], @@ -247,9 +247,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.36.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.36.0.tgz", - "integrity": "sha512-bvXVU42mOVcF4le6XSjscdXjqx8okv4n5vmwgzcmtvFdifQ5U4dXFYaCB87namDRKlUL9ybVtLQ9ztnawaSzvg==", + "version": "4.37.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.37.0.tgz", + "integrity": "sha512-hhAALKJPidCwZcj+g+iN+38SIOkhK2a9bqtJR+EtyxrKKSt1ynCBeqrQy31z0oWU6thRZzdx53hVgEbRkuI19w==", "cpu": [ "arm" ], @@ -261,9 +261,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.36.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.36.0.tgz", - "integrity": "sha512-JFIQrDJYrxOnyDQGYkqnNBtjDwTgbasdbUiQvcU8JmGDfValfH1lNpng+4FWlhaVIR4KPkeddYjsVVbmJYvDcg==", + "version": "4.37.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.37.0.tgz", + "integrity": "sha512-jUb/kmn/Gd8epbHKEqkRAxq5c2EwRt0DqhSGWjPFxLeFvldFdHQs/n8lQ9x85oAeVb6bHcS8irhTJX2FCOd8Ag==", "cpu": [ "arm" ], @@ -275,9 +275,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.36.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.36.0.tgz", - "integrity": "sha512-KqjYVh3oM1bj//5X7k79PSCZ6CvaVzb7Qs7VMWS+SlWB5M8p3FqufLP9VNp4CazJ0CsPDLwVD9r3vX7Ci4J56A==", + "version": "4.37.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.37.0.tgz", + "integrity": "sha512-oNrJxcQT9IcbcmKlkF+Yz2tmOxZgG9D9GRq+1OE6XCQwCVwxixYAa38Z8qqPzQvzt1FCfmrHX03E0pWoXm1DqA==", "cpu": [ "arm64" ], @@ -289,9 +289,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.36.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.36.0.tgz", - "integrity": "sha512-QiGnhScND+mAAtfHqeT+cB1S9yFnNQ/EwCg5yE3MzoaZZnIV0RV9O5alJAoJKX/sBONVKeZdMfO8QSaWEygMhw==", + "version": "4.37.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.37.0.tgz", + "integrity": "sha512-pfxLBMls+28Ey2enpX3JvjEjaJMBX5XlPCZNGxj4kdJyHduPBXtxYeb8alo0a7bqOoWZW2uKynhHxF/MWoHaGQ==", "cpu": [ "arm64" ], @@ -303,9 +303,9 @@ ] }, "node_modules/@rollup/rollup-linux-loongarch64-gnu": { - "version": "4.36.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.36.0.tgz", - "integrity": "sha512-1ZPyEDWF8phd4FQtTzMh8FQwqzvIjLsl6/84gzUxnMNFBtExBtpL51H67mV9xipuxl1AEAerRBgBwFNpkw8+Lg==", + "version": "4.37.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.37.0.tgz", + "integrity": "sha512-yCE0NnutTC/7IGUq/PUHmoeZbIwq3KRh02e9SfFh7Vmc1Z7atuJRYWhRME5fKgT8aS20mwi1RyChA23qSyRGpA==", "cpu": [ "loong64" ], @@ -317,9 +317,9 @@ ] }, "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.36.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.36.0.tgz", - "integrity": "sha512-VMPMEIUpPFKpPI9GZMhJrtu8rxnp6mJR3ZzQPykq4xc2GmdHj3Q4cA+7avMyegXy4n1v+Qynr9fR88BmyO74tg==", + "version": "4.37.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.37.0.tgz", + "integrity": "sha512-NxcICptHk06E2Lh3a4Pu+2PEdZ6ahNHuK7o6Np9zcWkrBMuv21j10SQDJW3C9Yf/A/P7cutWoC/DptNLVsZ0VQ==", "cpu": [ "ppc64" ], @@ -331,9 +331,23 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.36.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.36.0.tgz", - "integrity": "sha512-ttE6ayb/kHwNRJGYLpuAvB7SMtOeQnVXEIpMtAvx3kepFQeowVED0n1K9nAdraHUPJ5hydEMxBpIR7o4nrm8uA==", + "version": "4.37.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.37.0.tgz", + "integrity": "sha512-PpWwHMPCVpFZLTfLq7EWJWvrmEuLdGn1GMYcm5MV7PaRgwCEYJAwiN94uBuZev0/J/hFIIJCsYw4nLmXA9J7Pw==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-musl": { + "version": "4.37.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.37.0.tgz", + "integrity": "sha512-DTNwl6a3CfhGTAOYZ4KtYbdS8b+275LSLqJVJIrPa5/JuIufWWZ/QFvkxp52gpmguN95eujrM68ZG+zVxa8zHA==", "cpu": [ "riscv64" ], @@ -345,9 +359,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.36.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.36.0.tgz", - "integrity": "sha512-4a5gf2jpS0AIe7uBjxDeUMNcFmaRTbNv7NxI5xOCs4lhzsVyGR/0qBXduPnoWf6dGC365saTiwag8hP1imTgag==", + "version": "4.37.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.37.0.tgz", + "integrity": "sha512-hZDDU5fgWvDdHFuExN1gBOhCuzo/8TMpidfOR+1cPZJflcEzXdCy1LjnklQdW8/Et9sryOPJAKAQRw8Jq7Tg+A==", "cpu": [ "s390x" ], @@ -359,9 +373,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.36.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.36.0.tgz", - "integrity": "sha512-5KtoW8UWmwFKQ96aQL3LlRXX16IMwyzMq/jSSVIIyAANiE1doaQsx/KRyhAvpHlPjPiSU/AYX/8m+lQ9VToxFQ==", + "version": "4.37.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.37.0.tgz", + "integrity": "sha512-pKivGpgJM5g8dwj0ywBwe/HeVAUSuVVJhUTa/URXjxvoyTT/AxsLTAbkHkDHG7qQxLoW2s3apEIl26uUe08LVQ==", "cpu": [ "x64" ], @@ -373,9 +387,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.36.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.36.0.tgz", - "integrity": "sha512-sycrYZPrv2ag4OCvaN5js+f01eoZ2U+RmT5as8vhxiFz+kxwlHrsxOwKPSA8WyS+Wc6Epid9QeI/IkQ9NkgYyQ==", + "version": "4.37.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.37.0.tgz", + "integrity": "sha512-E2lPrLKE8sQbY/2bEkVTGDEk4/49UYRVWgj90MY8yPjpnGBQ+Xi1Qnr7b7UIWw1NOggdFQFOLZ8+5CzCiz143w==", "cpu": [ "x64" ], @@ -387,9 +401,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.36.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.36.0.tgz", - "integrity": "sha512-qbqt4N7tokFwwSVlWDsjfoHgviS3n/vZ8LK0h1uLG9TYIRuUTJC88E1xb3LM2iqZ/WTqNQjYrtmtGmrmmawB6A==", + "version": "4.37.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.37.0.tgz", + "integrity": "sha512-Jm7biMazjNzTU4PrQtr7VS8ibeys9Pn29/1bm4ph7CP2kf21950LgN+BaE2mJ1QujnvOc6p54eWWiVvn05SOBg==", "cpu": [ "arm64" ], @@ -401,9 +415,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.36.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.36.0.tgz", - "integrity": "sha512-t+RY0JuRamIocMuQcfwYSOkmdX9dtkr1PbhKW42AMvaDQa+jOdpUYysroTF/nuPpAaQMWp7ye+ndlmmthieJrQ==", + "version": "4.37.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.37.0.tgz", + "integrity": "sha512-e3/1SFm1OjefWICB2Ucstg2dxYDkDTZGDYgwufcbsxTHyqQps1UQf33dFEChBNmeSsTOyrjw2JJq0zbG5GF6RA==", "cpu": [ "ia32" ], @@ -415,9 +429,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.36.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.36.0.tgz", - "integrity": "sha512-aRXd7tRZkWLqGbChgcMMDEHjOKudo1kChb1Jt1IfR8cY/KIpgNviLeJy5FUb9IpSuQj8dU2fAYNMPW/hLKOSTw==", + "version": "4.37.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.37.0.tgz", + "integrity": "sha512-LWbXUBwn/bcLx2sSsqy7pK5o+Nr+VCoRoAohfJ5C/aBio9nfJmGQqHAhU6pwxV/RmyTk5AqdySma7uwWGlmeuA==", "cpu": [ "x64" ], @@ -4944,9 +4958,9 @@ } }, "node_modules/rollup": { - "version": "4.36.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.36.0.tgz", - "integrity": "sha512-zwATAXNQxUcd40zgtQG0ZafcRK4g004WtEl7kbuhTWPvf07PsfohXl39jVUvPF7jvNAIkKPQ2XrsDlWuxBd++Q==", + "version": "4.37.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.37.0.tgz", + "integrity": "sha512-iAtQy/L4QFU+rTJ1YUjXqJOJzuwEghqWzCEYD2FEghT7Gsy1VdABntrO4CLopA5IkflTyqNiLNwPcOJ3S7UKLg==", "dev": true, "license": "MIT", "dependencies": { @@ -4960,25 +4974,26 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.36.0", - "@rollup/rollup-android-arm64": "4.36.0", - "@rollup/rollup-darwin-arm64": "4.36.0", - "@rollup/rollup-darwin-x64": "4.36.0", - "@rollup/rollup-freebsd-arm64": "4.36.0", - "@rollup/rollup-freebsd-x64": "4.36.0", - "@rollup/rollup-linux-arm-gnueabihf": "4.36.0", - "@rollup/rollup-linux-arm-musleabihf": "4.36.0", - "@rollup/rollup-linux-arm64-gnu": "4.36.0", - "@rollup/rollup-linux-arm64-musl": "4.36.0", - "@rollup/rollup-linux-loongarch64-gnu": "4.36.0", - "@rollup/rollup-linux-powerpc64le-gnu": "4.36.0", - "@rollup/rollup-linux-riscv64-gnu": "4.36.0", - "@rollup/rollup-linux-s390x-gnu": "4.36.0", - "@rollup/rollup-linux-x64-gnu": "4.36.0", - "@rollup/rollup-linux-x64-musl": "4.36.0", - "@rollup/rollup-win32-arm64-msvc": "4.36.0", - "@rollup/rollup-win32-ia32-msvc": "4.36.0", - "@rollup/rollup-win32-x64-msvc": "4.36.0", + "@rollup/rollup-android-arm-eabi": "4.37.0", + "@rollup/rollup-android-arm64": "4.37.0", + "@rollup/rollup-darwin-arm64": "4.37.0", + "@rollup/rollup-darwin-x64": "4.37.0", + "@rollup/rollup-freebsd-arm64": "4.37.0", + "@rollup/rollup-freebsd-x64": "4.37.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.37.0", + "@rollup/rollup-linux-arm-musleabihf": "4.37.0", + "@rollup/rollup-linux-arm64-gnu": "4.37.0", + "@rollup/rollup-linux-arm64-musl": "4.37.0", + "@rollup/rollup-linux-loongarch64-gnu": "4.37.0", + "@rollup/rollup-linux-powerpc64le-gnu": "4.37.0", + "@rollup/rollup-linux-riscv64-gnu": "4.37.0", + "@rollup/rollup-linux-riscv64-musl": "4.37.0", + "@rollup/rollup-linux-s390x-gnu": "4.37.0", + "@rollup/rollup-linux-x64-gnu": "4.37.0", + "@rollup/rollup-linux-x64-musl": "4.37.0", + "@rollup/rollup-win32-arm64-msvc": "4.37.0", + "@rollup/rollup-win32-ia32-msvc": "4.37.0", + "@rollup/rollup-win32-x64-msvc": "4.37.0", "fsevents": "~2.3.2" } }, From ad8b5c7c9d9445d61cc0a5f3568c8d25e155cfba Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Mon, 24 Mar 2025 08:59:46 +0200 Subject: [PATCH 42/92] fix(ci): path for hook module script --- forge.config.cjs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/forge.config.cjs b/forge.config.cjs index 288826f8a..0524d71fa 100644 --- a/forge.config.cjs +++ b/forge.config.cjs @@ -2,11 +2,12 @@ const path = require("path"); const fs = require("fs-extra"); const APP_NAME = "TriliumNext Notes"; +const BIN_PATH = path.normalize("./bin/electron-forge"); const extraResourcesForPlatform = getExtraResourcesForPlatform(); const baseLinuxMakerConfigOptions = { icon: "./images/app-icons/png/128x128.png", - desktopTemplate: path.resolve("./bin/electron-forge/desktop.ejs"), + desktopTemplate: path.resolve(path.join(BIN_PATH, desktop.ejs)), categories: ["Office", "Utility"] }; @@ -27,7 +28,7 @@ module.exports = { teamId: process.env.APPLE_TEAM_ID }, windowsSign: { - hookModulePath: "bin\\sign-windows.cjs" + hookModulePath: path.join(BIN_PATH, "sign-windows.cjs") }, extraResource: [ // All resources should stay in Resources directory for macOS From bfdb3e2add46f6ea23d9a5ac386c4f62c1eb9c58 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Mon, 24 Mar 2025 09:00:30 +0200 Subject: [PATCH 43/92] fix(ci): double trigger for nightly --- .github/workflows/nightly.yml | 1 - forge.config.cjs | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 5bfe3aa29..326c88fe6 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -8,7 +8,6 @@ on: pull_request: paths: - .github/actions/build-electron/* - push: env: GITHUB_UPLOAD_URL: https://uploads.github.com/repos/TriliumNext/Notes/releases/179589950/assets{?name,label} GITHUB_RELEASE_ID: 179589950 diff --git a/forge.config.cjs b/forge.config.cjs index 0524d71fa..153567017 100644 --- a/forge.config.cjs +++ b/forge.config.cjs @@ -7,7 +7,7 @@ const BIN_PATH = path.normalize("./bin/electron-forge"); const extraResourcesForPlatform = getExtraResourcesForPlatform(); const baseLinuxMakerConfigOptions = { icon: "./images/app-icons/png/128x128.png", - desktopTemplate: path.resolve(path.join(BIN_PATH, desktop.ejs)), + desktopTemplate: path.resolve(path.join(BIN_PATH, "desktop.ejs")), categories: ["Office", "Utility"] }; From 58e9c7e389183be2e86467af039ff10551017cc2 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Mon, 24 Mar 2025 11:21:31 +0200 Subject: [PATCH 44/92] feat(ci): pass signing to squirrel --- forge.config.cjs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/forge.config.cjs b/forge.config.cjs index 153567017..a78f92f6c 100644 --- a/forge.config.cjs +++ b/forge.config.cjs @@ -109,7 +109,10 @@ module.exports = { config: { iconUrl: "https://raw.githubusercontent.com/TriliumNext/Notes/develop/images/app-icons/icon.ico", setupIcon: "./images/app-icons/win/setup.ico", - loadingGif: "./images/app-icons/win/setup-banner.gif" + loadingGif: "./images/app-icons/win/setup-banner.gif", + windowsSign: { + hookModulePath: path.join(BIN_PATH, "sign-windows.cjs") + } } }, { From 10d8cd95a631a641b9ea54aae6605c8d53d4c384 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Mon, 24 Mar 2025 12:05:34 +0200 Subject: [PATCH 45/92] chore(ci): enable windows installer logs --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a5a02d1f2..25118877c 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "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 nix-shell -p electron_33 --run \"electron ./electron-docs-main.ts .\"", "electron-forge:prepare": "npm run build:prepare-dist", "electron-forge:start": "npm run electron-forge:prepare && cd ./build && electron-forge start", - "electron-forge:make": "npm run electron-forge:prepare && cross-env DEBUG=electron-forge:* electron-forge make ./build", + "electron-forge:make": "npm run electron-forge:prepare && cross-env DEBUG=electron-forge:*,electron-windows-installer:* electron-forge make ./build", "electron-forge:package": "npm run electron-forge:prepare && cd ./build && electron-forge package", "docs:build-backend": "rimraf ./docs/backend_api && typedoc ./docs/backend_api src/becca/entities/*.ts src/services/backend_script_api.ts src/services/sql.ts", "docs:build-frontend": "rimraf ./docs/frontend_api && jsdoc -c jsdoc-conf.json -d ./docs/frontend_api src/public/app/entities/*.js src/public/app/services/frontend_script_api.js src/public/app/widgets/basic_widget.js src/public/app/widgets/note_context_aware_widget.js src/public/app/widgets/right_panel_widget.js", From 6f54ac7446df7f1fe5174ea1c2fc81ce58d883f8 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Mon, 24 Mar 2025 12:05:46 +0200 Subject: [PATCH 46/92] chore(ci): change signing log --- bin/electron-forge/sign-windows.cjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/electron-forge/sign-windows.cjs b/bin/electron-forge/sign-windows.cjs index 446a6279e..0862cdfaa 100644 --- a/bin/electron-forge/sign-windows.cjs +++ b/bin/electron-forge/sign-windows.cjs @@ -3,6 +3,6 @@ const SIGN_EXECUTABLE = "C:\\ev_signer_trilium\\ev_signer_trilium.exe"; module.exports = function (filePath) { const command = `${SIGN_EXECUTABLE} --executable "${filePath}"`; - console.log(`> ${command}`); + console.log(`[Sign] ${command}`); child_process.execSync(command); } \ No newline at end of file From 53860c488557eaf1c0503dbcf03ae74f025410f3 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Mon, 24 Mar 2025 12:15:15 +0200 Subject: [PATCH 47/92] chore(ci): try to use basic sign tool config --- forge.config.cjs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/forge.config.cjs b/forge.config.cjs index a78f92f6c..30a90834c 100644 --- a/forge.config.cjs +++ b/forge.config.cjs @@ -110,9 +110,8 @@ module.exports = { iconUrl: "https://raw.githubusercontent.com/TriliumNext/Notes/develop/images/app-icons/icon.ico", setupIcon: "./images/app-icons/win/setup.ico", loadingGif: "./images/app-icons/win/setup-banner.gif", - windowsSign: { - hookModulePath: path.join(BIN_PATH, "sign-windows.cjs") - } + signToolPath: "C:\\ev_signer_trilium\\ev_signer_trilium.exe", + signWithParams: "" } }, { From d5a8387c06f3dc63d4be7cfb15e17388720d4db1 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Mon, 24 Mar 2025 12:41:38 +0200 Subject: [PATCH 48/92] Revert "chore(ci): try to use basic sign tool config" This reverts commit 53860c488557eaf1c0503dbcf03ae74f025410f3. --- forge.config.cjs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/forge.config.cjs b/forge.config.cjs index 30a90834c..a78f92f6c 100644 --- a/forge.config.cjs +++ b/forge.config.cjs @@ -110,8 +110,9 @@ module.exports = { iconUrl: "https://raw.githubusercontent.com/TriliumNext/Notes/develop/images/app-icons/icon.ico", setupIcon: "./images/app-icons/win/setup.ico", loadingGif: "./images/app-icons/win/setup-banner.gif", - signToolPath: "C:\\ev_signer_trilium\\ev_signer_trilium.exe", - signWithParams: "" + windowsSign: { + hookModulePath: path.join(BIN_PATH, "sign-windows.cjs") + } } }, { From 18a5a55384aa55cd46db029a2d7f3022dc63f451 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Mon, 24 Mar 2025 12:42:01 +0200 Subject: [PATCH 49/92] chore(ci): remove debug logs --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 25118877c..92ed50fb3 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "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 nix-shell -p electron_33 --run \"electron ./electron-docs-main.ts .\"", "electron-forge:prepare": "npm run build:prepare-dist", "electron-forge:start": "npm run electron-forge:prepare && cd ./build && electron-forge start", - "electron-forge:make": "npm run electron-forge:prepare && cross-env DEBUG=electron-forge:*,electron-windows-installer:* electron-forge make ./build", + "electron-forge:make": "npm run electron-forge:prepare && cross-env electron-forge make ./build", "electron-forge:package": "npm run electron-forge:prepare && cd ./build && electron-forge package", "docs:build-backend": "rimraf ./docs/backend_api && typedoc ./docs/backend_api src/becca/entities/*.ts src/services/backend_script_api.ts src/services/sql.ts", "docs:build-frontend": "rimraf ./docs/frontend_api && jsdoc -c jsdoc-conf.json -d ./docs/frontend_api src/public/app/entities/*.js src/public/app/services/frontend_script_api.js src/public/app/widgets/basic_widget.js src/public/app/widgets/note_context_aware_widget.js src/public/app/widgets/right_panel_widget.js", From 308632ea516e46b65d3f0998bf412ab3750782c7 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Mon, 24 Mar 2025 13:30:37 +0200 Subject: [PATCH 50/92] chore(ci): re-enable Windows signing logs --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 92ed50fb3..2dbb59fda 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "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 nix-shell -p electron_33 --run \"electron ./electron-docs-main.ts .\"", "electron-forge:prepare": "npm run build:prepare-dist", "electron-forge:start": "npm run electron-forge:prepare && cd ./build && electron-forge start", - "electron-forge:make": "npm run electron-forge:prepare && cross-env electron-forge make ./build", + "electron-forge:make": "npm run electron-forge:prepare && cross-env DEBUG=electron-windows-installer:* electron-forge make ./build", "electron-forge:package": "npm run electron-forge:prepare && cd ./build && electron-forge package", "docs:build-backend": "rimraf ./docs/backend_api && typedoc ./docs/backend_api src/becca/entities/*.ts src/services/backend_script_api.ts src/services/sql.ts", "docs:build-frontend": "rimraf ./docs/frontend_api && jsdoc -c jsdoc-conf.json -d ./docs/frontend_api src/public/app/entities/*.js src/public/app/services/frontend_script_api.js src/public/app/widgets/basic_widget.js src/public/app/widgets/note_context_aware_widget.js src/public/app/widgets/right_panel_widget.js", From d4e8d9e942b6f054b735b4a8b844f72ec664ed4f Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Mon, 24 Mar 2025 16:55:39 +0200 Subject: [PATCH 51/92] fix(docker): missing sign windows script --- .dockerignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.dockerignore b/.dockerignore index a4e242a99..2ceb847c9 100644 --- a/.dockerignore +++ b/.dockerignore @@ -34,6 +34,7 @@ npm-debug.log # exceptions !/bin/copy-dist.ts +!/bin/electron-forge/sign-windows.cjs # temporary exception to make copy-dist inside Docker build not fail # TriliumNextTODO: make copy-dist *not* requiring to copy this file for builds other than electron-forge From 3413c5e40104eadaec650d0960aa1c1e11facc45 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Mon, 24 Mar 2025 16:55:47 +0200 Subject: [PATCH 52/92] fix(nightly): double .zip in name --- .github/workflows/nightly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 326c88fe6..cf8b894e8 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -67,5 +67,5 @@ jobs: uses: actions/upload-artifact@v4 if: ${{ github.event_name == 'pull_request' }} with: - name: TriliumNextNotes ${{ matrix.os.name }} ${{ matrix.arch }}.zip + name: TriliumNextNotes ${{ matrix.os.name }} ${{ matrix.arch }} path: upload From 34043a8a70206af7262d6a87027d1c6df7e7f406 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Mon, 24 Mar 2025 17:00:37 +0200 Subject: [PATCH 53/92] feat(signing): use environment variables for the executable path --- .github/actions/build-electron/action.yml | 1 + .github/workflows/nightly.yml | 1 + bin/electron-forge/sign-windows.cjs | 10 ++++++++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/actions/build-electron/action.yml b/.github/actions/build-electron/action.yml index 5a4aa11a2..4f8f0bea2 100644 --- a/.github/actions/build-electron/action.yml +++ b/.github/actions/build-electron/action.yml @@ -79,6 +79,7 @@ runs: APPLE_TEAM_ID: ${{ env.APPLE_TEAM_ID }} APPLE_ID: ${{ env.APPLE_ID }} APPLE_ID_PASSWORD: ${{ env.APPLE_ID_PASSWORD }} + WINDOWS_SIGN_EXECUTABLE: ${{ env.WINDOWS_SIGN_EXECUTABLE }} run: | npm run electron-forge:make -- \ --arch=${{ inputs.arch }} \ diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index cf8b894e8..1b947391f 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -50,6 +50,7 @@ jobs: APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} APPLE_ID: ${{ secrets.APPLE_ID }} APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }} + WINDOWS_SIGN_EXECUTABLE: ${{ vars.WINDOWS_SIGN_EXECUTABLE }} - name: Publish release uses: softprops/action-gh-release@v2 diff --git a/bin/electron-forge/sign-windows.cjs b/bin/electron-forge/sign-windows.cjs index 0862cdfaa..527a27dc6 100644 --- a/bin/electron-forge/sign-windows.cjs +++ b/bin/electron-forge/sign-windows.cjs @@ -1,8 +1,14 @@ const child_process = require("child_process"); -const SIGN_EXECUTABLE = "C:\\ev_signer_trilium\\ev_signer_trilium.exe"; module.exports = function (filePath) { - const command = `${SIGN_EXECUTABLE} --executable "${filePath}"`; + const { WINDOWS_SIGN_EXECUTABLE } = process.env; + + if (!WINDOWS_SIGN_EXECUTABLE) { + console.warn("[Sign] Skip signing due to missing environment variable."); + return; + } + + const command = `${WINDOWS_SIGN_EXECUTABLE} --executable "${filePath}"`; console.log(`[Sign] ${command}`); child_process.execSync(command); } \ No newline at end of file From 8cc7d02f369aac286b1d8802eeee4d2873b585af Mon Sep 17 00:00:00 2001 From: Adorian Doran Date: Mon, 24 Mar 2025 17:00:52 +0200 Subject: [PATCH 54/92] client: add a CSS class to facilitate identifying visible widgets --- src/public/app/widgets/basic_widget.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/public/app/widgets/basic_widget.ts b/src/public/app/widgets/basic_widget.ts index 46d3b06b9..4e7c36760 100644 --- a/src/public/app/widgets/basic_widget.ts +++ b/src/public/app/widgets/basic_widget.ts @@ -206,7 +206,8 @@ export class TypedBasicWidget> extends TypedCompon doRender() {} toggleInt(show: boolean | null | undefined) { - this.$widget.toggleClass("hidden-int", !show); + this.$widget.toggleClass("hidden-int", !show) + .toggleClass("visible", !!show); } isHiddenInt() { @@ -214,7 +215,8 @@ export class TypedBasicWidget> extends TypedCompon } toggleExt(show: boolean) { - this.$widget.toggleClass("hidden-ext", !show); + this.$widget.toggleClass("hidden-ext", !show) + .toggleClass("visible", !!show); } isHiddenExt() { From 9aaada3f6e43c2d4a970fafbf76dc1d093c5bd3a Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Mon, 24 Mar 2025 17:04:22 +0200 Subject: [PATCH 55/92] refactor(forge): deduplicate windows signing configuration --- forge.config.cjs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/forge.config.cjs b/forge.config.cjs index a78f92f6c..2e381386f 100644 --- a/forge.config.cjs +++ b/forge.config.cjs @@ -10,6 +10,9 @@ const baseLinuxMakerConfigOptions = { desktopTemplate: path.resolve(path.join(BIN_PATH, "desktop.ejs")), categories: ["Office", "Utility"] }; +const windowsSignConfiguration = { + hookModulePath: path.join(BIN_PATH, "sign-windows.cjs") +} module.exports = { // we run electron-forge inside the ./build folder, @@ -27,9 +30,7 @@ module.exports = { appleIdPassword: process.env.APPLE_ID_PASSWORD, teamId: process.env.APPLE_TEAM_ID }, - windowsSign: { - hookModulePath: path.join(BIN_PATH, "sign-windows.cjs") - }, + windowsSign: windowsSignConfiguration, extraResource: [ // All resources should stay in Resources directory for macOS ...(process.platform === "darwin" ? [] : extraResourcesForPlatform), @@ -110,9 +111,7 @@ module.exports = { iconUrl: "https://raw.githubusercontent.com/TriliumNext/Notes/develop/images/app-icons/icon.ico", setupIcon: "./images/app-icons/win/setup.ico", loadingGif: "./images/app-icons/win/setup-banner.gif", - windowsSign: { - hookModulePath: path.join(BIN_PATH, "sign-windows.cjs") - } + windowsSign: windowsSignConfiguration } }, { From 283b8e9bc802ff6b285232491dce14cfe7718797 Mon Sep 17 00:00:00 2001 From: Adorian Doran Date: Mon, 24 Mar 2025 17:05:09 +0200 Subject: [PATCH 56/92] style(next)/floating buttons/backlink counter: fix the dropdown not showing up --- .../floating_buttons/floating_buttons.ts | 16 ++++++++++++++++ .../widgets/floating_buttons/zpetne_odkazy.ts | 5 +++-- src/public/stylesheets/theme-next/shell.css | 18 ++++++++++++++---- 3 files changed, 33 insertions(+), 6 deletions(-) diff --git a/src/public/app/widgets/floating_buttons/floating_buttons.ts b/src/public/app/widgets/floating_buttons/floating_buttons.ts index 6fa8727fe..c7bf9b343 100644 --- a/src/public/app/widgets/floating_buttons/floating_buttons.ts +++ b/src/public/app/widgets/floating_buttons/floating_buttons.ts @@ -3,6 +3,14 @@ import { t } from "../../services/i18n.js"; import type FNote from "../../entities/fnote.js"; import type BasicWidget from "../basic_widget.js"; +/* + * Note: + * + * For floating button widgets that require content to overflow, the has-overflow CSS class should + * be applied to the root element of the widget. Additionally, this root element may need to + * properly handle rounded corners, as defined by the --border-radius CSS variable. + */ + const TPL = `
    `; From e408cc5b1039420c780092bf7784b6459ebfe905 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Tue, 25 Mar 2025 21:40:35 +0200 Subject: [PATCH 90/92] feat(settings/i18n): hide formatting locale on non-electron --- src/public/app/widgets/type_widgets/options/i18n/i18n.ts | 2 +- src/public/stylesheets/style.css | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/public/app/widgets/type_widgets/options/i18n/i18n.ts b/src/public/app/widgets/type_widgets/options/i18n/i18n.ts index 000517090..65186524d 100644 --- a/src/public/app/widgets/type_widgets/options/i18n/i18n.ts +++ b/src/public/app/widgets/type_widgets/options/i18n/i18n.ts @@ -15,7 +15,7 @@ const TPL = ` -
    +
    diff --git a/src/public/stylesheets/style.css b/src/public/stylesheets/style.css index 742757e59..1cfcd6c90 100644 --- a/src/public/stylesheets/style.css +++ b/src/public/stylesheets/style.css @@ -49,7 +49,8 @@ body { --tab-bar-height: 40px; } -body.mobile .desktop-only { +body.mobile .desktop-only, +body:not(.electron) .electron-only { display: none !important; } From 03fd34eeb02a82c32d3de28ef436ac6d4a87a200 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Tue, 25 Mar 2025 21:48:02 +0200 Subject: [PATCH 91/92] feat(settings/i18n): dedicated restart button --- .../app/widgets/type_widgets/options/i18n/i18n.ts | 11 +++++++++-- src/public/translations/en/translation.json | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/public/app/widgets/type_widgets/options/i18n/i18n.ts b/src/public/app/widgets/type_widgets/options/i18n/i18n.ts index 65186524d..e4324393d 100644 --- a/src/public/app/widgets/type_widgets/options/i18n/i18n.ts +++ b/src/public/app/widgets/type_widgets/options/i18n/i18n.ts @@ -34,6 +34,10 @@ const TPL = `
    + +
    + +
    `; @@ -72,20 +80,19 @@ export default class LocalizationOptions extends OptionsWidget { this.$localeSelect.on("change", async () => { const newLocale = this.$localeSelect.val(); await server.put(`options/locale/${newLocale}`); - utils.reloadFrontendApp("locale change"); }); this.$formattingLocaleSelect = this.$widget.find(".formatting-locale-select"); this.$formattingLocaleSelect.on("change", async () => { const newLocale = this.$formattingLocaleSelect.val(); await server.put(`options/formattingLocale/${newLocale}`); - utils.restartDesktopApp(); }); this.$widget.find(`input[name="first-day-of-week"]`).on("change", () => { const firstDayOfWeek = String(this.$widget.find(`input[name="first-day-of-week"]:checked`).val()); this.updateOption("firstDayOfWeek", firstDayOfWeek); }); + this.$widget.find(".restart-app-button").on("click", utils.restartDesktopApp); } async optionsLoaded(options: OptionMap) { diff --git a/src/public/translations/en/translation.json b/src/public/translations/en/translation.json index 2355f0fa7..998d9f2dc 100644 --- a/src/public/translations/en/translation.json +++ b/src/public/translations/en/translation.json @@ -1243,7 +1243,7 @@ "first-day-of-the-week": "First day of the week", "sunday": "Sunday", "monday": "Monday", - "formatting-locale": "Formats (date, numbers)" + "formatting-locale": "Date & number format" }, "backup": { "automatic_backup": "Automatic backup", From 5148ce64aefb17a185cac6d4cb0b937c4f2ac55f Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Tue, 25 Mar 2025 21:51:40 +0200 Subject: [PATCH 92/92] chore(i18n): translate missing Romanian messages --- src/public/translations/ro/translation.json | 31 +++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/src/public/translations/ro/translation.json b/src/public/translations/ro/translation.json index 171d091fe..590cb04f0 100644 --- a/src/public/translations/ro/translation.json +++ b/src/public/translations/ro/translation.json @@ -267,7 +267,8 @@ "basic_properties": { "basic_properties": "Proprietăți de bază", "editable": "Editabil", - "note_type": "Tipul notiței" + "note_type": "Tipul notiței", + "language": "Limbă" }, "book": { "no_children_help": "Această notiță de tip Carte nu are nicio subnotiță așadar nu este nimic de afișat. Vedeți wiki pentru detalii." @@ -678,7 +679,8 @@ "language": "Limbă", "monday": "Luni", "sunday": "Duminică", - "title": "Localizare" + "title": "Localizare", + "formatting-locale": "Format dată și numere" }, "image_properties": { "copy_reference_to_clipboard": "Copiază referință în clipboard", @@ -1692,5 +1694,30 @@ }, "content_widget": { "unknown_widget": "Nu s-a putut găsi widget-ul corespunzător pentru „{{id}}”." + }, + "code-editor-options": { + "title": "Editor" + }, + "content_language": { + "description": "Selectați una sau mai multe limbi ce vor apărea în selecția limbii din cadrul secțiunii „Proprietăți de bază” pentru notițele de tip text (editabile sau doar în citire).", + "title": "Limbi pentru conținutul notițelor" + }, + "hidden-subtree": { + "localization": "Limbă și regiune" + }, + "note_language": { + "configure-languages": "Configurează limbile...", + "not_set": "Nedefinită" + }, + "png_export_button": { + "button_title": "Exportă diagrama ca PNG" + }, + "switch_layout_button": { + "title_horizontal": "Mută panoul de editare la stânga", + "title_vertical": "Mută panoul de editare în jos" + }, + "toggle_read_only_button": { + "lock-editing": "Blochează editarea", + "unlock-editing": "Deblochează editarea" } }