@emeryld/manager 0.7.8 → 0.7.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/packages/manifest-utils.js +10 -12
- package/package.json +1 -1
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
import { readdir, readFile } from 'node:fs/promises';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { pathToFileURL } from 'node:url';
|
|
4
|
-
const
|
|
4
|
+
const PACKAGE_COLOR_INDEX_TABLE = [
|
|
5
5
|
'blue',
|
|
6
|
-
'brightBlue',
|
|
7
|
-
'cyan',
|
|
8
|
-
'brightCyan',
|
|
9
6
|
'green',
|
|
10
|
-
'
|
|
7
|
+
'yellow',
|
|
11
8
|
'magenta',
|
|
12
|
-
'brightMagenta',
|
|
13
9
|
'red',
|
|
14
|
-
'
|
|
15
|
-
'
|
|
16
|
-
'
|
|
17
|
-
'
|
|
18
|
-
'brightWhite',
|
|
10
|
+
'cyan',
|
|
11
|
+
'brightBlue',
|
|
12
|
+
'brightGreen',
|
|
13
|
+
'brightMagenta',
|
|
19
14
|
];
|
|
15
|
+
// indexes 0-8 map to the same nine package colors
|
|
16
|
+
const DEFAULT_COLOR_PALETTE = PACKAGE_COLOR_INDEX_TABLE;
|
|
20
17
|
const IGNORED_DIRS = new Set([
|
|
21
18
|
'node_modules',
|
|
22
19
|
'.git',
|
|
@@ -138,7 +135,8 @@ export function colorFromSeed(seed) {
|
|
|
138
135
|
for (let i = 0; i < normalized.length; i++) {
|
|
139
136
|
hash = (hash * 31 + normalized.charCodeAt(i)) >>> 0;
|
|
140
137
|
}
|
|
141
|
-
|
|
138
|
+
const index = hash % PACKAGE_COLOR_INDEX_TABLE.length;
|
|
139
|
+
return PACKAGE_COLOR_INDEX_TABLE[index];
|
|
142
140
|
}
|
|
143
141
|
function isManifestMissing(error) {
|
|
144
142
|
if (typeof error !== 'object' || error === null)
|