mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-03 20:06:08 +01:00 
			
		
		
		
	fix(client): integrate autocomplete into client
This commit is contained in:
		@@ -24,6 +24,7 @@
 | 
			
		||||
    "@triliumnext/ckeditor5": "workspace:*",
 | 
			
		||||
    "@triliumnext/codemirror": "workspace:*",
 | 
			
		||||
    "@triliumnext/commons": "workspace:*",
 | 
			
		||||
    "autocomplete.js": "0.38.1",
 | 
			
		||||
    "bootstrap": "5.3.6",
 | 
			
		||||
    "boxicons": "2.1.4",
 | 
			
		||||
    "dayjs": "1.11.13",
 | 
			
		||||
 
 | 
			
		||||
@@ -12,6 +12,7 @@ import type ElectronRemote from "@electron/remote";
 | 
			
		||||
import type Electron from "electron";
 | 
			
		||||
import "./stylesheets/bootstrap.scss";
 | 
			
		||||
import "boxicons";
 | 
			
		||||
import "autocomplete.js/index_jquery.js";
 | 
			
		||||
 | 
			
		||||
await appContext.earlyInit();
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -3,6 +3,7 @@ import noteAutocompleteService from "./services/note_autocomplete.js";
 | 
			
		||||
import glob from "./services/glob.js";
 | 
			
		||||
import "./stylesheets/bootstrap.scss";
 | 
			
		||||
import "boxicons";
 | 
			
		||||
import "autocomplete.js/index_jquery.js";
 | 
			
		||||
 | 
			
		||||
glob.setupGlobs();
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -42,7 +42,6 @@
 | 
			
		||||
    "@types/turndown": "5.0.5",
 | 
			
		||||
    "@types/ws": "8.18.1",
 | 
			
		||||
    "@types/xml2js": "0.4.14",
 | 
			
		||||
    "autocomplete.js": "0.38.1",
 | 
			
		||||
    "express-http-proxy": "2.1.1",
 | 
			
		||||
    "jquery": "3.7.1",
 | 
			
		||||
    "katex": "0.16.22",
 | 
			
		||||
 
 | 
			
		||||
@@ -4,7 +4,6 @@ import { fileURLToPath } from "url";
 | 
			
		||||
import express from "express";
 | 
			
		||||
import { getResourceDir, isDev } from "../services/utils.js";
 | 
			
		||||
import type serveStatic from "serve-static";
 | 
			
		||||
import proxy from "express-http-proxy";
 | 
			
		||||
import contentCss from "@triliumnext/ckeditor5/content.css";
 | 
			
		||||
 | 
			
		||||
const persistentCacheStatic = (root: string, options?: serveStatic.ServeStaticOptions<express.Response<unknown, Record<string, unknown>>>) => {
 | 
			
		||||
@@ -59,16 +58,10 @@ async function register(app: express.Application) {
 | 
			
		||||
    app.use(`/node_modules/katex/dist/`, express.static(path.join(nodeModulesDir, "katex/dist/")));
 | 
			
		||||
    app.use(`/${assetPath}/node_modules/katex/dist/`, persistentCacheStatic(path.join(nodeModulesDir, "katex/dist/")));
 | 
			
		||||
 | 
			
		||||
    app.use(`/${assetPath}/node_modules/boxicons/css/`, persistentCacheStatic(path.join(nodeModulesDir, "boxicons/css/")));
 | 
			
		||||
    app.use(`/${assetPath}/node_modules/boxicons/fonts/`, persistentCacheStatic(path.join(nodeModulesDir, "boxicons/fonts/")));
 | 
			
		||||
 | 
			
		||||
    app.use(`/${assetPath}/node_modules/jquery/dist/`, persistentCacheStatic(path.join(nodeModulesDir, "jquery/dist/")));
 | 
			
		||||
 | 
			
		||||
    app.use(`/${assetPath}/node_modules/jquery-hotkeys/`, persistentCacheStatic(path.join(nodeModulesDir, "jquery-hotkeys/")));
 | 
			
		||||
 | 
			
		||||
    // Deprecated, https://www.npmjs.com/package/autocomplete.js?activeTab=readme
 | 
			
		||||
    app.use(`/${assetPath}/node_modules/autocomplete.js/dist/`, persistentCacheStatic(path.join(nodeModulesDir, "autocomplete.js/dist/")));
 | 
			
		||||
 | 
			
		||||
    app.use(`/${assetPath}/node_modules/normalize.css/`, persistentCacheStatic(path.join(nodeModulesDir, "normalize.css/")));
 | 
			
		||||
 | 
			
		||||
    app.use(`/${assetPath}/node_modules/jquery.fancytree/dist/`, persistentCacheStatic(path.join(nodeModulesDir, "jquery.fancytree/dist/")));
 | 
			
		||||
 
 | 
			
		||||
@@ -17,7 +17,6 @@ function buildFilesToCopy() {
 | 
			
		||||
    "katex/dist",
 | 
			
		||||
    "jquery/dist",
 | 
			
		||||
    "jquery-hotkeys",
 | 
			
		||||
    "autocomplete.js/dist",
 | 
			
		||||
    "normalize.css/normalize.css",
 | 
			
		||||
    "jquery.fancytree/dist",
 | 
			
		||||
    "@highlightjs/cdn-assets",
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										6
									
								
								pnpm-lock.yaml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										6
									
								
								pnpm-lock.yaml
									
									
									
										generated
									
									
									
								
							@@ -209,6 +209,9 @@ importers:
 | 
			
		||||
      '@triliumnext/commons':
 | 
			
		||||
        specifier: workspace:*
 | 
			
		||||
        version: link:../../packages/commons
 | 
			
		||||
      autocomplete.js:
 | 
			
		||||
        specifier: 0.38.1
 | 
			
		||||
        version: 0.38.1
 | 
			
		||||
      bootstrap:
 | 
			
		||||
        specifier: 5.3.6
 | 
			
		||||
        version: 5.3.6(@popperjs/core@2.11.8)
 | 
			
		||||
@@ -599,9 +602,6 @@ importers:
 | 
			
		||||
      async-mutex:
 | 
			
		||||
        specifier: 0.5.0
 | 
			
		||||
        version: 0.5.0
 | 
			
		||||
      autocomplete.js:
 | 
			
		||||
        specifier: 0.38.1
 | 
			
		||||
        version: 0.38.1
 | 
			
		||||
      axios:
 | 
			
		||||
        specifier: 1.9.0
 | 
			
		||||
        version: 1.9.0(debug@4.4.1)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user