Compare commits

...

15 Commits

Author SHA1 Message Date
Elian Doran
41a8424b6c Revert "chore(client/dx): disable CK premium features for now"
This reverts commit a000b8a28b.
2025-08-31 12:11:48 +03:00
Elian Doran
5bc16cfe38 chore(dx/nx): remove unnecessary mcp config 2025-08-31 12:10:11 +03:00
Elian Doran
e03fa2485c chore(dx/nx): get rid of NX daemon 2025-08-31 12:09:56 +03:00
Elian Doran
00c0860b32 chore(dx/client): get SVG imports to work locally 2025-08-31 12:03:08 +03:00
Elian Doran
e3b2e92d2d chore(dx): get rid of nx.instructions.md changes 2025-08-31 12:02:34 +03:00
Elian Doran
a000b8a28b chore(client/dx): disable CK premium features for now 2025-08-31 11:58:54 +03:00
Elian Doran
ab27d36dd3 chore(client/dx): disable CK CSS imports for now 2025-08-31 11:58:29 +03:00
Elian Doran
8fb078029c chore(client/dx): highlight.js not working 2025-08-31 11:58:11 +03:00
Elian Doran
5a29c831a1 chore(client/dx): get ckeditor imports to actually work 2025-08-31 11:57:59 +03:00
Elian Doran
a2c49711bc chore(client/dx): add source to all client-side dependencies 2025-08-31 11:41:30 +03:00
Elian Doran
509fce54f9 chore(server/dx): pathless resolution via --conditions 2025-08-31 11:13:19 +03:00
Elian Doran
39ae7dda6c chore(server/dx): get server to start using path references 2025-08-31 10:58:08 +03:00
Elian Doran
0dafb86012 chore(server/dx): remove CSS import for now 2025-08-31 10:57:16 +03:00
Elian Doran
20bdae4a84 chore(server/dx): serve source directly 2025-08-31 10:49:50 +03:00
Elian Doran
a969a3c71c chore(client/dx): get client to have no dependencies 2025-08-31 10:43:55 +03:00
39 changed files with 69 additions and 122 deletions

View File

@@ -1,40 +0,0 @@
---
applyTo: '**'
---
// This file is automatically generated by Nx Console
You are in an nx workspace using Nx 21.3.9 and pnpm as the package manager.
You have access to the Nx MCP server and the tools it provides. Use them. Follow these guidelines in order to best help the user:
# General Guidelines
- When answering questions, use the nx_workspace tool first to gain an understanding of the workspace architecture
- For questions around nx configuration, best practices or if you're unsure, use the nx_docs tool to get relevant, up-to-date docs!! Always use this instead of assuming things about nx configuration
- If the user needs help with an Nx configuration or project graph error, use the 'nx_workspace' tool to get any errors
- To help answer questions about the workspace structure or simply help with demonstrating how tasks depend on each other, use the 'nx_visualize_graph' tool
# Generation Guidelines
If the user wants to generate something, use the following flow:
- learn about the nx workspace and any specifics the user needs by using the 'nx_workspace' tool and the 'nx_project_details' tool if applicable
- get the available generators using the 'nx_generators' tool
- decide which generator to use. If no generators seem relevant, check the 'nx_available_plugins' tool to see if the user could install a plugin to help them
- get generator details using the 'nx_generator_schema' tool
- you may use the 'nx_docs' tool to learn more about a specific generator or technology if you're unsure
- decide which options to provide in order to best complete the user's request. Don't make any assumptions and keep the options minimalistic
- open the generator UI using the 'nx_open_generate_ui' tool
- wait for the user to finish the generator
- read the generator log file using the 'nx_read_generator_log' tool
- use the information provided in the log file to answer the user's question or continue with what they were doing
# Running Tasks Guidelines
If the user wants help with tasks or commands (which include keywords like "test", "build", "lint", or other similar actions), use the following flow:
- Use the 'nx_current_running_tasks_details' tool to get the list of tasks (this can include tasks that were completed, stopped or failed).
- If there are any tasks, ask the user if they would like help with a specific task then use the 'nx_current_running_task_output' tool to get the terminal output for that task/command
- Use the terminal output from 'nx_current_running_task_output' to see what's wrong and help the user fix their problem. Use the appropriate tools if necessary
- If the user would like to rerun the task or command, always use `nx run <taskId>` to rerun in the terminal. This will ensure that the task will run in the nx context and will be run the same way it originally executed
- If the task was marked as "continuous" do not offer to rerun the task. This task is already running and the user can see the output in the terminal. You can use 'nx_current_running_task_output' to get the output of the task to verify the output.

2
.gitignore vendored
View File

@@ -1,5 +1,7 @@
# See https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files for more about ignoring files.
.github/instructions/nx.instructions.md
# compiled output
dist
tmp

8
.vscode/mcp.json vendored
View File

@@ -1,8 +0,0 @@
{
"servers": {
"nx-mcp": {
"type": "http",
"url": "http://localhost:9461/mcp"
}
}
}

View File

@@ -76,9 +76,7 @@
"name": "client",
"targets": {
"serve": {
"dependsOn": [
"^build"
]
"dependsOn": []
},
"circular-deps": {
"command": "pnpx dpdm -T {projectRoot}/src/**/*.ts --tree=false --warning=false --skip-dynamic-imports=circular"

View File

@@ -41,11 +41,6 @@ export default defineConfig(() => ({
] as Plugin[],
resolve: {
alias: [
// Force the use of dist in development mode because upstream ESM is broken (some hybrid between CJS and ESM, will be improved in upcoming versions).
{
find: "@triliumnext/highlightjs",
replacement: resolve(__dirname, "node_modules/@triliumnext/highlightjs/dist")
},
{
find: "react",
replacement: "preact/compat"

View File

@@ -1,4 +1,4 @@
TRILIUM_ENV=dev
TRILIUM_DATA_DIR=./apps/server/data
TRILIUM_RESOURCE_DIR=./apps/server/dist
TRILIUM_RESOURCE_DIR=./apps/server/src
TRILIUM_PUBLIC_SERVER=http://localhost:4200

View File

@@ -116,20 +116,18 @@
],
"targets": {
"serve": {
"executor": "@nx/js:node",
"executor": "nx:run-commands",
"dependsOn": [
{
"projects": [
"client"
],
"target": "serve"
},
"build-without-client"
}
],
"continuous": true,
"options": {
"buildTarget": "server:build-without-client:development",
"runBuildTargetDependencies": false
"command": "tsx watch --conditions development {projectRoot}/src/main.ts"
}
},
"serve-nodir": {

View File

@@ -21,7 +21,6 @@ import type AttributeMeta from "../meta/attribute_meta.js";
import type BBranch from "../../becca/entities/bbranch.js";
import type { Response } from "express";
import type { NoteMetaFile } from "../meta/note_meta.js";
import cssContent from "@triliumnext/ckeditor5/content.css";
type RewriteLinksFn = (content: string, noteMeta: NoteMeta) => string;
@@ -514,8 +513,6 @@ ${markdownContent}`;
if (!cssMeta.dataFileName) {
return;
}
archive.append(cssContent, { name: cssMeta.dataFileName });
}
try {

View File

@@ -1,4 +1,3 @@
import log from "./log.js";
import path from "path";
import fs from "fs";
@@ -10,7 +9,7 @@ const ELECTRON_APP_ROOT_DIR = path.resolve(RESOURCE_DIR, "../..");
const DB_INIT_DIR = path.resolve(RESOURCE_DIR, "db");
if (!fs.existsSync(DB_INIT_DIR)) {
log.error(`Could not find DB initialization directory: ${DB_INIT_DIR}`);
console.error(`Could not find DB initialization directory: ${DB_INIT_DIR}`);
process.exit(1);
}

View File

@@ -34,9 +34,6 @@
"src/**/*.spec.jsx"
],
"references": [
{
"path": "../../packages/ckeditor5/tsconfig.lib.json"
},
{
"path": "../../packages/turndown-plugin-gfm/tsconfig.lib.json"
},

View File

@@ -3,9 +3,6 @@
"files": [],
"include": [],
"references": [
{
"path": "../../packages/ckeditor5"
},
{
"path": "../../packages/turndown-plugin-gfm"
},

View File

@@ -1,6 +1,7 @@
{
"$schema": "./node_modules/nx/schemas/nx-schema.json",
"defaultBase": "main",
"useDaemonProcess": false,
"namedInputs": {
"default": [
"{projectRoot}/**/*",

View File

@@ -11,13 +11,14 @@
"ckeditor5-package-generator"
],
"type": "module",
"source": "src/index.ts",
"main": "dist/index.ts",
"module": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js"
"import": "./src/index.ts"
},
"./*": "./dist/*",
"./browser/*": null,

View File

@@ -10,7 +10,7 @@
import { Plugin, addListToDropdown, createDropdown, ListDropdownItemDefinition, SplitButtonView, ViewModel } from 'ckeditor5';
import '../theme/blockquote.css';
import admonitionIcon from '../theme/icons/admonition.svg';
import admonitionIcon from '../theme/icons/admonition.svg?raw';
import { AdmonitionType } from './admonitioncommand.js';
import { Collection } from 'ckeditor5';

View File

@@ -1,4 +1,4 @@
import admonitionIcon from '../theme/icons/admonition.svg';
import admonitionIcon from '../theme/icons/admonition.svg?raw';
import './augmentation.js';
import "../theme/blockquote.css";

View File

@@ -1,4 +1,4 @@
declare module '*.svg' {
declare module '*.svg?raw' {
const content: string;
export default content;
}

View File

@@ -11,13 +11,14 @@
"ckeditor5-package-generator"
],
"type": "module",
"source": "src/index.ts",
"main": "dist/index.ts",
"module": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js"
"import": "./src/index.ts"
},
"./*": "./dist/*",
"./browser/*": null,

View File

@@ -6,7 +6,7 @@ import {
ELEMENTS,
TOOLBAR_COMPONENT_NAME
} from './constants.js';
import insertFootnoteIcon from '../theme/icons/insert-footnote.svg';
import insertFootnoteIcon from '../theme/icons/insert-footnote.svg?raw';
import { modelQueryElement, modelQueryElementsAll } from './utils.js';
export default class FootnoteUI extends Plugin {

View File

@@ -1,4 +1,4 @@
import insertFootnoteIcon from './../theme/icons/insert-footnote.svg';
import insertFootnoteIcon from './../theme/icons/insert-footnote.svg?raw';
import './augmentation.js';
import "../theme/footnote.css";

View File

@@ -1,4 +1,4 @@
declare module '*.svg' {
declare module '*.svg?raw' {
const content: string;
export default content;
}

View File

@@ -11,13 +11,14 @@
"ckeditor5-package-generator"
],
"type": "module",
"source": "src/index.ts",
"main": "dist/index.ts",
"module": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js"
"import": "./src/index.ts"
},
"./*": "./dist/*",
"./browser/*": null,

View File

@@ -1,4 +1,4 @@
import kbdIcon from '../theme/icons/kbd.svg';
import kbdIcon from '../theme/icons/kbd.svg?raw';
import './augmentation.js';
export { default as Kbd } from './kbd.js';

View File

@@ -1,5 +1,5 @@
import { AttributeCommand, ButtonView, Plugin } from 'ckeditor5';
import kbdIcon from '../theme/icons/kbd.svg';
import kbdIcon from '../theme/icons/kbd.svg?raw';
const KBD = 'kbd';

View File

@@ -1,4 +1,4 @@
declare module '*.svg' {
declare module '*.svg?raw' {
const content: string;
export default content;
}

View File

@@ -12,13 +12,14 @@
"katex"
],
"type": "module",
"source": "src/index.ts",
"main": "dist/index.ts",
"module": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js"
"import": "./src/index.ts"
},
"./*": "./dist/*",
"./browser/*": null,

View File

@@ -1,4 +1,4 @@
import ckeditor from './../theme/icons/math.svg';
import ckeditor from './../theme/icons/math.svg?raw';
import './augmentation.js';
import "../theme/mathform.css";

View File

@@ -1,6 +1,6 @@
import MathEditing from './mathediting.js';
import MainFormView from './ui/mainformview.js';
import mathIcon from '../theme/icons/math.svg';
import mathIcon from '../theme/icons/math.svg?raw';
import { Plugin, ClickObserver, ButtonView, ContextualBalloon, clickOutsideHandler, CKEditorError, uid } from 'ckeditor5';
import { getBalloonPositionData } from './utils.js';
import MathCommand from './mathcommand.js';
@@ -54,10 +54,10 @@ export default class MathUI extends Plugin {
this._addFormView();
this._balloon.showStack( 'main' );
requestAnimationFrame(() => {
this.formView?.mathInputView.fieldView.element?.focus();
});
});
}
private _createFormView() {

View File

@@ -1,4 +1,4 @@
declare module '*.svg' {
declare module '*.svg?raw' {
const content: string;
export default content;
}

View File

@@ -11,13 +11,14 @@
"ckeditor5-package-generator"
],
"type": "module",
"source": "src/index.ts",
"main": "dist/index.ts",
"module": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js"
"import": "./src/index.ts"
},
"./*": "./dist/*",
"./browser/*": null,

View File

@@ -1,11 +1,11 @@
import './augmentation.js';
export { default as Mermaid } from './mermaid.js';
import infoIcon from './../theme/icons/info.svg';
import insertMermaidIcon from './../theme/icons/insert.svg';
import previewModeIcon from './../theme/icons/preview-mode.svg';
import splitModeIcon from './../theme/icons/split-mode.svg';
import sourceModeIcon from './../theme/icons/source-mode.svg';
import infoIcon from './../theme/icons/info.svg?raw';
import insertMermaidIcon from './../theme/icons/insert.svg?raw';
import previewModeIcon from './../theme/icons/preview-mode.svg?raw';
import splitModeIcon from './../theme/icons/split-mode.svg?raw';
import sourceModeIcon from './../theme/icons/source-mode.svg?raw';
import "../theme/mermaid.css";
export const icons = {

View File

@@ -2,11 +2,11 @@
* @module mermaid/mermaidui
*/
import insertMermaidIcon from '../theme/icons/insert.svg';
import previewModeIcon from '../theme/icons/preview-mode.svg';
import splitModeIcon from '../theme/icons/split-mode.svg';
import sourceModeIcon from '../theme/icons/source-mode.svg';
import infoIcon from '../theme/icons/info.svg';
import insertMermaidIcon from '../theme/icons/insert.svg?raw';
import previewModeIcon from '../theme/icons/preview-mode.svg?raw';
import splitModeIcon from '../theme/icons/split-mode.svg?raw';
import sourceModeIcon from '../theme/icons/source-mode.svg?raw';
import infoIcon from '../theme/icons/info.svg?raw';
import { ButtonView, Editor, ModelElement, Locale, Observable, Plugin } from 'ckeditor5';
import InsertMermaidCommand from './commands/insertMermaidCommand.js';

View File

@@ -1,11 +1,11 @@
import { Mermaid as MermaidDll, icons } from '../src/index.js';
import Mermaid from '../src/mermaid.js';
import infoIcon from './../theme/icons/info.svg';
import insertMermaidIcon from './../theme/icons/insert.svg';
import previewModeIcon from './../theme/icons/preview-mode.svg';
import splitModeIcon from './../theme/icons/split-mode.svg';
import sourceModeIcon from './../theme/icons/source-mode.svg';
import infoIcon from './../theme/icons/info.svg?raw';
import insertMermaidIcon from './../theme/icons/insert.svg?raw';
import previewModeIcon from './../theme/icons/preview-mode.svg?raw';
import splitModeIcon from './../theme/icons/split-mode.svg?raw';
import sourceModeIcon from './../theme/icons/source-mode.svg?raw';
import { describe, it } from 'vitest';
import { expect } from 'vitest';

View File

@@ -1,4 +1,4 @@
declare module '*.svg' {
declare module '*.svg?raw' {
const content: string;
export default content;
}

View File

@@ -4,6 +4,7 @@
"version": "45.0.0",
"private": true,
"type": "module",
"source": "./src/index.ts",
"main": "./dist/index.js",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",

View File

@@ -21,10 +21,10 @@ import { Admonition } from "@triliumnext/ckeditor5-admonition";
import { Footnotes } from "@triliumnext/ckeditor5-footnotes";
import { Math, AutoformatMath } from "@triliumnext/ckeditor5-math";
import "@triliumnext/ckeditor5-mermaid/index.css";
import "@triliumnext/ckeditor5-admonition/index.css";
import "@triliumnext/ckeditor5-footnotes/index.css";
import "@triliumnext/ckeditor5-math/index.css";
// import "@triliumnext/ckeditor5-mermaid/index.css";
// import "@triliumnext/ckeditor5-admonition/index.css";
// import "@triliumnext/ckeditor5-footnotes/index.css";
// import "@triliumnext/ckeditor5-math/index.css";
import CodeBlockToolbar from "./plugins/code_block_toolbar.js";
import CodeBlockLanguageDropdown from "./plugins/code_block_language_dropdown.js";
import MoveBlockUpDownPlugin from "./plugins/move_block_updown.js";

View File

@@ -1,4 +1,4 @@
import cancelIcon from '@ckeditor/ckeditor5-core/theme/icons/cancel.svg';
import cancelIcon from '@ckeditor/ckeditor5-core/theme/icons/cancel.svg?raw';
import { ButtonView, Locale, toUnit, View } from 'ckeditor5';
const toPx = toUnit('%');

View File

@@ -3,6 +3,7 @@
"version": "0.0.1",
"private": true,
"type": "module",
"source": "./src/index.ts",
"main": "./dist/index.js",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",

View File

@@ -1,4 +1,4 @@
import hljs from "../node_modules/highlight.js/es/core.js";
import hljs from "highlight.js";
import { normalizeMimeTypeForCKEditor, type MimeType } from "@triliumnext/commons";
import syntaxDefinitions from "./syntax_highlighting.js";
import { type Theme } from "./themes.js";

View File

@@ -5,22 +5,26 @@
"emitDeclarationOnly": true,
"importHelpers": true,
"isolatedModules": true,
"lib": ["ES2023"],
"lib": [
"ES2023"
],
"module": "nodenext",
"moduleResolution": "nodenext",
"noEmitOnError": true,
"noFallthroughCasesInSwitch": true,
"noImplicitAny": false, // TODO: Re-enable it at some point.
"noImplicitOverride": false, // TODO: Re-enable it at some point.
"noImplicitReturns": false, // TODO: Re-enable it at some point.
"noUnusedLocals": false, // TODO: Re-enable it at some point.
"noImplicitAny": false,
"noImplicitOverride": false,
"noImplicitReturns": false,
"noUnusedLocals": false,
"skipLibCheck": true,
"strict": true,
"target": "es2022",
"customConditions": ["development"],
"verbatimModuleSyntax": false, // TODO: Re-enable it when migrating back to ESM.
"customConditions": [
"development"
],
"verbatimModuleSyntax": false,
"resolveJsonModule": true,
"downlevelIteration": true,
"esModuleInterop": true,
"esModuleInterop": true
}
}