Skip to content

Build your personal knowledge base with Trilium Notes

chore(deps): drop colors and the unused chalk dependency

Elian Doranbe819d1f6ae4
diff --git a/apps/db-compare/package.json b/apps/db-compare/package.json
index d7797bfbd9..0356c3558d 100644
--- a/apps/db-compare/package.json
+++ b/apps/db-compare/package.json
@@ -5,8 +5,8 @@
"description": "Tool to compare content of Trilium databases. Useful for debugging sync problems.",
"dependencies": {
"better-sqlite3": "12.10.0",
- "colors": "1.4.0",
- "diff": "9.0.0"
+ "diff": "9.0.0",
+ "picocolors": "1.1.1"
},
"devDependencies": {
"@types/better-sqlite3": "7.6.13",
diff --git a/apps/db-compare/src/compare.ts b/apps/db-compare/src/compare.ts
index aed5bd218b..a1076cb3ef 100644
--- a/apps/db-compare/src/compare.ts
+++ b/apps/db-compare/src/compare.ts
@@ -1,8 +1,7 @@
-import "colors";
-
import Database, { type Database as DatabaseType } from "better-sqlite3";
import * as jsDiff from "diff";
import path from "path";
+import pc from "picocolors";
import { compareTable, COMPARISONS, type TableComparison } from "./comparator.js";
@@ -10,11 +9,10 @@ function printDiff(one: string, two: string) {
const diff = jsDiff.diffChars(one, two);
diff.forEach((part) => {
- // green for additions, red for deletions
- // grey for common parts
- const color = part.added ? "green" :
- part.removed ? "red" : "grey";
- process.stderr.write(part.value[color]);
+ // green for additions, red for deletions, grey for common parts
+ const colorize = part.added ? pc.green :
+ part.removed ? pc.red : pc.gray;
+ process.stderr.write(colorize(part.value));
});
console.log("");
diff --git a/package.json b/package.json
index 1bdbe40973..fa4496a90e 100644
--- a/package.json
+++ b/package.json
@@ -63,7 +63,6 @@
"@vitest/browser-webdriverio": "4.1.7",
"@vitest/coverage-v8": "4.1.7",
"@vitest/ui": "4.1.7",
- "chalk": "5.6.2",
"cross-env": "10.1.0",
"dpdm": "4.2.0",
"esbuild": "0.28.0",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 4078725de5..60cc32823d 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -112,9 +112,6 @@ importers:
'@vitest/ui':
specifier: 4.1.7
version: 4.1.7([email protected])
- chalk:
- specifier: 5.6.2
- version: 5.6.2
cross-env:
specifier: 10.1.0
version: 10.1.0
@@ -426,12 +423,12 @@ importers:
better-sqlite3:
specifier: 12.10.0
version: 12.10.0
- colors:
- specifier: 1.4.0
- version: 1.4.0
diff:
specifier: 9.0.0
version: 9.0.0
+ picocolors:
+ specifier: 1.1.1
+ version: 1.1.1
devDependencies:
'@types/better-sqlite3':
specifier: 7.6.13
@@ -7322,10 +7319,6 @@ packages:
resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==}
- resolution: {integrity: sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==}
- engines: {node: '>=0.1.90'}
-
resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==}
engines: {node: '>= 0.8'}
@@ -21601,8 +21594,6 @@ snapshots:
-
dependencies:
delayed-stream: 1.0.0