Skip to content

Build your personal knowledge base with Trilium Notes

chore: fix typecheck

Elian Doranf849c4b31517
diff --git a/apps/server/src/services/icon_packs.ts b/apps/server/src/services/icon_packs.ts
index 5c757aecfe..cbaa2a8757 100644
--- a/apps/server/src/services/icon_packs.ts
+++ b/apps/server/src/services/icon_packs.ts
@@ -2,7 +2,7 @@ import { IconRegistry } from "@triliumnext/commons";
import type BAttachment from "../becca/entities/battachment";
import type BNote from "../becca/entities/bnote";
-import boxiconsManifest from "./icon_pack_boxicons-v2.json";
+import boxiconsManifest from "./icon_pack_boxicons-v2.json" with { type: "json" };
import log from "./log";
import search from "./search/services/search";
import { safeExtractMessageAndStackFromError } from "./utils";
diff --git a/apps/server/tsconfig.app.json b/apps/server/tsconfig.app.json
index eb7f102aa4..79dd0b7709 100644
--- a/apps/server/tsconfig.app.json
+++ b/apps/server/tsconfig.app.json
@@ -14,6 +14,7 @@
},
"include": [
"src/**/*.ts",
+ "src/**/*.json",
"package.json"
],
"exclude": [
diff --git a/apps/server/tsconfig.spec.json b/apps/server/tsconfig.spec.json
index 4f8607e4b0..b3905c4f73 100644
--- a/apps/server/tsconfig.spec.json
+++ b/apps/server/tsconfig.spec.json
@@ -28,6 +28,7 @@
"src/**/*.spec.jsx",
"src/**/*.d.ts",
"src/**/*.ts",
+ "src/**/*.json",
"package.json"
]
}
diff --git a/scripts/icon-packs/boxicons-v2.ts b/scripts/icon-packs/boxicons-v2.ts
deleted file mode 100644
index 602445cc19..0000000000
--- a/scripts/icon-packs/boxicons-v2.ts
+++ /dev/null
@@ -1,37 +0,0 @@
-import { readFileSync, writeFileSync } from "fs";
-import { join } from "path";
-
-import iconList from "../../apps/client/src/widgets/icon_list";
-
-function readMappingsFromCss() {
- const cssPath = join(__dirname, "../../node_modules/boxicons/css/boxicons.css");
- const cssContent = readFileSync(cssPath, "utf-8");
- const mappings: Record<string, string> = {};
- const regex = /\.(bx.*?):before.*?\n.*?content:.*?"(.*?)"/g;
- let match;
- while ((match = regex.exec(cssContent)) !== null) {
- mappings[match[1]] = String.fromCharCode(parseInt(match[2].substring(1), 16));
- }
- return mappings;
-}
-
-const mappings = readMappingsFromCss();
-
-const icons = {};
-for (const icon of iconList.icons) {
- if (!icon.className) continue;
- const className = icon.className.substring(3); // remove 'bx-' prefix
- if (className === "bx-empty") continue;
-
- icons[className] = {
- glyph: mappings[className],
- terms: [ icon.name, ...(icon.term || []) ]
- };
-}
-
-const manifest = {
- prefix: "bx",
- icons
-};
-
-writeFileSync(join(__dirname, "../../apps/server/src/services/icon_pack_boxicons-v2.json"), JSON.stringify(manifest, null, 2));