Skip to content

Commit c9424d6

Browse files
committed
Merge remote-tracking branch 'origin/main' into renovate/major-vitest-monorepo
2 parents 2154a5e + 362f0b2 commit c9424d6

File tree

366 files changed

+13383
-10592
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

366 files changed

+13383
-10592
lines changed

.github/workflows/main-docker.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,10 @@ jobs:
155155
- name: Update build info
156156
run: pnpm run chore:update-build-info
157157

158+
- name: Update nightly version
159+
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
160+
run: pnpm run chore:ci-update-nightly-version
161+
158162
- name: Run the TypeScript build
159163
run: pnpm run server:build
160164

.github/workflows/nightly.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
- name: Install dependencies
5858
run: pnpm install --frozen-lockfile
5959
- name: Update nightly version
60-
run: npm run chore:ci-update-nightly-version
60+
run: pnpm run chore:ci-update-nightly-version
6161
- name: Run the build
6262
uses: ./.github/actions/build-electron
6363
with:
@@ -77,7 +77,7 @@ jobs:
7777
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGN_KEY }}
7878

7979
- name: Publish release
80-
uses: softprops/[email protected].1
80+
uses: softprops/[email protected].2
8181
if: ${{ github.event_name != 'pull_request' }}
8282
with:
8383
make_latest: false
@@ -118,7 +118,7 @@ jobs:
118118
arch: ${{ matrix.arch }}
119119

120120
- name: Publish release
121-
uses: softprops/[email protected].1
121+
uses: softprops/[email protected].2
122122
if: ${{ github.event_name != 'pull_request' }}
123123
with:
124124
make_latest: false

.github/workflows/playwright.yml

Lines changed: 50 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches:
66
- main
7+
- hotfix
78
paths-ignore:
89
- "apps/website/**"
910
pull_request:
@@ -13,8 +14,24 @@ permissions:
1314
contents: read
1415

1516
jobs:
16-
main:
17-
runs-on: ubuntu-latest
17+
e2e:
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
include:
22+
- name: linux-x64
23+
os: ubuntu-22.04
24+
arch: x64
25+
- name: linux-arm64
26+
os: ubuntu-24.04-arm
27+
arch: arm64
28+
runs-on: ${{ matrix.os }}
29+
name: E2E tests on ${{ matrix.name }}
30+
env:
31+
TRILIUM_DOCKER: 1
32+
TRILIUM_PORT: 8082
33+
TRILIUM_DATA_DIR: "${{ github.workspace }}/apps/server/spec/db"
34+
TRILIUM_INTEGRATION_TEST: memory
1835
steps:
1936
- uses: actions/checkout@v5
2037
with:
@@ -29,13 +46,42 @@ jobs:
2946

3047
- name: Install dependencies
3148
run: pnpm install --frozen-lockfile
32-
- run: pnpm exec playwright install --with-deps
3349

34-
- run: pnpm --filter server-e2e e2e
50+
- name: Install Playwright browsers
51+
run: pnpm exec playwright install --with-deps
52+
53+
- name: Build the server
54+
uses: ./.github/actions/build-server
55+
with:
56+
os: linux
57+
arch: ${{ matrix.arch }}
58+
59+
- name: Unpack and start the server
60+
run: |
61+
version=$(node --eval "console.log(require('./package.json').version)")
62+
file=$(find ./upload -name '*.tar.xz' -print -quit)
63+
name=$(basename "$file" .tar.xz)
64+
mkdir -p ./server-dist
65+
tar -xvf "$file" -C ./server-dist
66+
server_dir="./server-dist/TriliumNotes-Server-$version-linux-${{ matrix.arch }}"
67+
if [ ! -d "$server_dir" ]; then
68+
echo Missing dir.
69+
exit 1
70+
fi
71+
cd "$server_dir"
72+
"./trilium.sh" &
73+
sleep 10
74+
75+
- name: Server end-to-end tests
76+
run: pnpm --filter server-e2e e2e
3577

3678
- name: Upload test report
3779
if: failure()
3880
uses: actions/upload-artifact@v5
3981
with:
4082
name: e2e report
4183
path: apps/server-e2e/test-output
84+
85+
- name: Kill the server
86+
if: always()
87+
run: pkill -f trilium || true

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ jobs:
127127
path: upload
128128

129129
- name: Publish stable release
130-
uses: softprops/[email protected].1
130+
uses: softprops/[email protected].2
131131
with:
132132
draft: false
133133
body_path: docs/Release Notes/Release Notes/${{ github.ref_name }}.md

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
24.11.0
1+
24.11.1

_regroup/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@
3838
"@playwright/test": "1.56.1",
3939
"@stylistic/eslint-plugin": "5.5.0",
4040
"@types/express": "5.0.5",
41-
"@types/node": "24.10.0",
42-
"@types/yargs": "17.0.34",
43-
"@vitest/coverage-v8": "4.0.6",
41+
"@types/node": "24.10.1",
42+
"@types/yargs": "17.0.35",
43+
"@vitest/coverage-v8": "3.2.4",
4444
"eslint": "9.39.1",
4545
"eslint-plugin-simple-import-sort": "12.1.1",
4646
"esm": "3.2.25",
4747
"jsdoc": "4.0.5",
4848
"lorem-ipsum": "2.0.8",
49-
"rcedit": "4.0.1",
49+
"rcedit": "5.0.1",
5050
"rimraf": "6.1.0",
5151
"tslib": "2.8.1"
5252
},

apps/build-docs/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
"keywords": [],
1010
"author": "Elian Doran <[email protected]>",
1111
"license": "AGPL-3.0-only",
12-
"packageManager": "pnpm@10.20.0",
12+
"packageManager": "pnpm@10.22.0",
1313
"devDependencies": {
14-
"@redocly/cli": "2.11.0",
14+
"@redocly/cli": "2.11.1",
1515
"archiver": "7.0.1",
1616
"fs-extra": "11.3.2",
1717
"react": "19.2.0",

apps/client/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@triliumnext/client",
3-
"version": "0.99.3",
3+
"version": "0.99.5",
44
"description": "JQuery-based client for TriliumNext, used for both web and desktop (via Electron)",
55
"private": true,
66
"license": "AGPL-3.0-only",
@@ -25,7 +25,7 @@
2525
"@fullcalendar/timegrid": "6.1.19",
2626
"@maplibre/maplibre-gl-leaflet": "0.1.3",
2727
"@mermaid-js/layout-elk": "0.2.0",
28-
"@mind-elixir/node-menu": "5.0.0",
28+
"@mind-elixir/node-menu": "5.0.1",
2929
"@popperjs/core": "2.11.8",
3030
"@triliumnext/ckeditor5": "workspace:*",
3131
"@triliumnext/codemirror": "workspace:*",
@@ -36,14 +36,14 @@
3636
"autocomplete.js": "0.38.1",
3737
"bootstrap": "5.3.8",
3838
"boxicons": "2.1.4",
39-
"color": "5.0.2",
39+
"color": "5.0.3",
4040
"dayjs": "1.11.19",
4141
"dayjs-plugin-utc": "0.1.2",
4242
"debounce": "3.0.0",
4343
"draggabilly": "3.0.0",
4444
"force-graph": "1.51.0",
4545
"globals": "16.5.0",
46-
"i18next": "25.6.0",
46+
"i18next": "25.6.2",
4747
"i18next-http-backend": "3.0.2",
4848
"jquery": "3.7.1",
4949
"jquery.fancytree": "2.38.5",
@@ -53,13 +53,13 @@
5353
"leaflet": "1.9.4",
5454
"leaflet-gpx": "2.2.0",
5555
"mark.js": "8.11.1",
56-
"marked": "16.4.1",
56+
"marked": "16.4.2",
5757
"mermaid": "11.12.1",
58-
"mind-elixir": "5.3.4",
58+
"mind-elixir": "5.3.6",
5959
"normalize.css": "8.0.1",
6060
"panzoom": "9.4.3",
6161
"preact": "10.27.2",
62-
"react-i18next": "16.2.4",
62+
"react-i18next": "16.3.3",
6363
"reveal.js": "5.2.1",
6464
"svg-pan-zoom": "3.6.2",
6565
"tabulator-tables": "6.3.1",

apps/client/src/components/app_context.ts

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,13 @@ import MainTreeExecutors from "./main_tree_executors.js";
1313
import toast from "../services/toast.js";
1414
import ShortcutComponent from "./shortcut_component.js";
1515
import { t, initLocale } from "../services/i18n.js";
16-
import type NoteDetailWidget from "../widgets/note_detail.js";
1716
import type { ResolveOptions } from "../widgets/dialogs/delete_notes.js";
1817
import type { PromptDialogOptions } from "../widgets/dialogs/prompt.js";
1918
import type { ConfirmWithMessageOptions, ConfirmWithTitleOptions } from "../widgets/dialogs/confirm.js";
2019
import type LoadResults from "../services/load_results.js";
2120
import type { Attribute } from "../services/attribute_parser.js";
2221
import type NoteTreeWidget from "../widgets/note_tree.js";
2322
import type { default as NoteContext, GetTextEditorCallback } from "./note_context.js";
24-
import type TypeWidget from "../widgets/type_widgets/type_widget.js";
25-
import type EditableTextTypeWidget from "../widgets/type_widgets/editable_text.js";
2623
import type { NativeImage, TouchBar } from "electron";
2724
import TouchBarComponent from "./touch_bar.js";
2825
import type { CKTextEditor } from "@triliumnext/ckeditor5";
@@ -33,6 +30,10 @@ import { ColumnComponent } from "tabulator-tables";
3330
import { ChooseNoteTypeCallback } from "../widgets/dialogs/note_type_chooser.jsx";
3431
import type RootContainer from "../widgets/containers/root_container.js";
3532
import { SqlExecuteResults } from "@triliumnext/commons";
33+
import { AddLinkOpts } from "../widgets/dialogs/add_link.jsx";
34+
import { IncludeNoteOpts } from "../widgets/dialogs/include_note.jsx";
35+
import { ReactWrappedWidget } from "../widgets/basic_widget.js";
36+
import type { MarkdownImportOpts } from "../widgets/dialogs/markdown_import.jsx";
3637

3738
interface Layout {
3839
getRootWidget: (appContext: AppContext) => RootContainer;
@@ -199,7 +200,7 @@ export type CommandMappings = {
199200
resetLauncher: ContextMenuCommandData;
200201

201202
executeInActiveNoteDetailWidget: CommandData & {
202-
callback: (value: NoteDetailWidget | PromiseLike<NoteDetailWidget>) => void;
203+
callback: (value: ReactWrappedWidget) => void;
203204
};
204205
executeWithTextEditor: CommandData &
205206
ExecuteCommandData<CKTextEditor> & {
@@ -211,7 +212,7 @@ export type CommandMappings = {
211212
* Generally should not be invoked manually, as it is used by {@link NoteContext.getContentElement}.
212213
*/
213214
executeWithContentElement: CommandData & ExecuteCommandData<JQuery<HTMLElement>>;
214-
executeWithTypeWidget: CommandData & ExecuteCommandData<TypeWidget | null>;
215+
executeWithTypeWidget: CommandData & ExecuteCommandData<ReactWrappedWidget | null>;
215216
addTextToActiveEditor: CommandData & {
216217
text: string;
217218
};
@@ -221,9 +222,9 @@ export type CommandMappings = {
221222
showPasswordNotSet: CommandData;
222223
showProtectedSessionPasswordDialog: CommandData;
223224
showUploadAttachmentsDialog: CommandData & { noteId: string };
224-
showIncludeNoteDialog: CommandData & { textTypeWidget: EditableTextTypeWidget };
225-
showAddLinkDialog: CommandData & { textTypeWidget: EditableTextTypeWidget, text: string };
226-
showPasteMarkdownDialog: CommandData & { textTypeWidget: EditableTextTypeWidget };
225+
showIncludeNoteDialog: CommandData & IncludeNoteOpts;
226+
showAddLinkDialog: CommandData & AddLinkOpts;
227+
showPasteMarkdownDialog: CommandData & MarkdownImportOpts;
227228
closeProtectedSessionPasswordDialog: CommandData;
228229
copyImageReferenceToClipboard: CommandData;
229230
copyImageToClipboard: CommandData;
@@ -328,6 +329,7 @@ export type CommandMappings = {
328329
exportAsPdf: CommandData;
329330
openNoteExternally: CommandData;
330331
openNoteCustom: CommandData;
332+
openNoteOnServer: CommandData;
331333
renderActiveNote: CommandData;
332334
unhoist: CommandData;
333335
reloadFrontendApp: CommandData;
@@ -485,20 +487,19 @@ type EventMappings = {
485487
relationMapResetZoomIn: { ntxId: string | null | undefined };
486488
relationMapResetZoomOut: { ntxId: string | null | undefined };
487489
activeNoteChanged: {};
488-
showAddLinkDialog: {
489-
textTypeWidget: EditableTextTypeWidget;
490-
text: string;
491-
};
492-
showIncludeDialog: {
493-
textTypeWidget: EditableTextTypeWidget;
494-
};
490+
showAddLinkDialog: AddLinkOpts;
491+
showIncludeDialog: IncludeNoteOpts;
495492
openBulkActionsDialog: {
496493
selectedOrActiveNoteIds: string[];
497494
};
498495
cloneNoteIdsTo: {
499496
noteIds: string[];
500497
};
501498
refreshData: { ntxId: string | null | undefined };
499+
contentSafeMarginChanged: {
500+
top: number;
501+
noteContext: NoteContext;
502+
}
502503
};
503504

504505
export type EventListener<T extends EventNames> = {
@@ -666,6 +667,10 @@ export class AppContext extends Component {
666667
this.beforeUnloadListeners.push(obj);
667668
}
668669
}
670+
671+
removeBeforeUnloadListener(listener: (() => boolean)) {
672+
this.beforeUnloadListeners = this.beforeUnloadListeners.filter(l => l !== listener);
673+
}
669674
}
670675

671676
const appContext = new AppContext(window.glob.isMainWindow);

apps/client/src/components/note_context.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ import hoistedNoteService from "../services/hoisted_note.js";
99
import options from "../services/options.js";
1010
import type { ViewScope } from "../services/link.js";
1111
import type FNote from "../entities/fnote.js";
12-
import type TypeWidget from "../widgets/type_widgets/type_widget.js";
1312
import type { CKTextEditor } from "@triliumnext/ckeditor5";
1413
import type CodeMirror from "@triliumnext/codemirror";
1514
import { closeActiveDialog } from "../services/dialog.js";
15+
import { ReactWrappedWidget } from "../widgets/basic_widget.js";
1616

1717
export interface SetNoteOpts {
1818
triggerSwitchEvent?: unknown;
@@ -397,7 +397,7 @@ class NoteContext extends Component implements EventListener<"entitiesReloaded">
397397

398398
async getTypeWidget() {
399399
return this.timeout(
400-
new Promise<TypeWidget | null>((resolve) =>
400+
new Promise<ReactWrappedWidget | null>((resolve) =>
401401
appContext.triggerCommand("executeWithTypeWidget", {
402402
resolve,
403403
ntxId: this.ntxId

0 commit comments

Comments
 (0)