@emeryld/manager 0.7.6 → 0.7.8
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/colors-shared.js
CHANGED
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
const ansi = (code) => (text) => `\x1b[${code}m${text}\x1b[0m`;
|
|
2
2
|
export const colors = {
|
|
3
|
-
|
|
3
|
+
black: ansi(30),
|
|
4
|
+
red: ansi(31),
|
|
4
5
|
green: ansi(32),
|
|
5
6
|
yellow: ansi(33),
|
|
7
|
+
blue: ansi(34),
|
|
6
8
|
magenta: ansi(35),
|
|
7
|
-
|
|
9
|
+
cyan: ansi(36),
|
|
10
|
+
white: ansi(37),
|
|
11
|
+
gray: ansi(90),
|
|
12
|
+
brightRed: ansi(91),
|
|
13
|
+
brightGreen: ansi(92),
|
|
14
|
+
brightYellow: ansi(93),
|
|
15
|
+
brightBlue: ansi(94),
|
|
16
|
+
brightMagenta: ansi(95),
|
|
17
|
+
brightCyan: ansi(96),
|
|
18
|
+
brightWhite: ansi(97),
|
|
8
19
|
bold: ansi(1),
|
|
9
20
|
dim: ansi(2),
|
|
10
|
-
gray: ansi(90),
|
|
11
21
|
};
|
|
@@ -63,16 +63,14 @@ function formatInteractiveLines(state, selectedIndex, title, searchState) {
|
|
|
63
63
|
state.options.forEach((option, index) => {
|
|
64
64
|
const isSelected = index === selectedIndex;
|
|
65
65
|
const pointer = isSelected ? `${colors.green('➤')} ` : '';
|
|
66
|
-
const
|
|
66
|
+
const entryColorizer = option.type === 'entry' && option.entry.color
|
|
67
67
|
? getEntryColor(option.entry)
|
|
68
68
|
: colors.cyan;
|
|
69
|
-
const
|
|
69
|
+
const numberLabelColorizer = isSelected ? colors.green : entryColorizer;
|
|
70
|
+
const numberLabel = numberLabelColorizer(`${option.hotkey}`.padStart(2, ' '));
|
|
70
71
|
if (option.type === 'entry') {
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
: isSelected
|
|
74
|
-
? colors.green(option.entry.displayName)
|
|
75
|
-
: option.entry.displayName;
|
|
72
|
+
const labelColorizer = isSelected ? colors.green : entryColorizer;
|
|
73
|
+
const label = labelColorizer(option.entry.displayName);
|
|
76
74
|
const runHint = searchState?.active &&
|
|
77
75
|
searchState.hasResults &&
|
|
78
76
|
index === selectedIndex
|
|
@@ -91,7 +89,11 @@ function formatInteractiveLines(state, selectedIndex, title, searchState) {
|
|
|
91
89
|
: option.action === 'next'
|
|
92
90
|
? 'Next page'
|
|
93
91
|
: 'Back';
|
|
94
|
-
const navLabel = option.enabled
|
|
92
|
+
const navLabel = isSelected && option.enabled
|
|
93
|
+
? colors.green(baseLabel)
|
|
94
|
+
: option.enabled
|
|
95
|
+
? baseLabel
|
|
96
|
+
: colors.dim(baseLabel);
|
|
95
97
|
lines.push(`${pointer}${numberLabel}. ${icon} ${navLabel}`);
|
|
96
98
|
});
|
|
97
99
|
if (searchState?.active && !searchState.hasResults) {
|
|
@@ -238,10 +238,9 @@ export function getPackageModule(pkg, dependencies = collectDependencies(pkg)) {
|
|
|
238
238
|
const pkgType = pkg.json?.type?.toLowerCase();
|
|
239
239
|
const isModule = pkgType === 'module';
|
|
240
240
|
const label = isModule ? 'ESM' : 'Node';
|
|
241
|
-
const labelColorizer = isModule ? colors.yellow : colors.cyan;
|
|
242
241
|
return {
|
|
243
242
|
label,
|
|
244
|
-
colorize:
|
|
243
|
+
colorize: KIND_COLOR_MAP.library,
|
|
245
244
|
kind: 'library',
|
|
246
245
|
kindColorize: KIND_COLOR_MAP.library,
|
|
247
246
|
};
|
|
@@ -307,11 +306,9 @@ export function getPackageMarker(pkg, dependencies = collectDependencies(pkg)) {
|
|
|
307
306
|
kindColorize: KIND_COLOR_MAP.cli,
|
|
308
307
|
};
|
|
309
308
|
}
|
|
310
|
-
const isModule = pkgType === 'module';
|
|
311
|
-
const labelColorizer = isModule ? colors.yellow : colors.cyan;
|
|
312
309
|
return {
|
|
313
310
|
label: 'Library',
|
|
314
|
-
colorize:
|
|
311
|
+
colorize: KIND_COLOR_MAP.library,
|
|
315
312
|
kind: 'library',
|
|
316
313
|
kindColorize: KIND_COLOR_MAP.library,
|
|
317
314
|
};
|
package/dist/menu.js
CHANGED
|
@@ -155,11 +155,6 @@ export function buildPackageSelectionMenu(packages, onStepComplete) {
|
|
|
155
155
|
return;
|
|
156
156
|
tagParts.push(colorizer(`[${value}]`));
|
|
157
157
|
};
|
|
158
|
-
// const relativePath = pkg.relativeDir ?? pkg.dirName
|
|
159
|
-
// if (relativePath && relativePath !== '.') {
|
|
160
|
-
// addTag(relativePath, colors.gray)
|
|
161
|
-
// }
|
|
162
|
-
addTag(pkg.path, colors.gray);
|
|
163
158
|
addTag(pkg.relativeDir, colors.gray);
|
|
164
159
|
if (pkg.version) {
|
|
165
160
|
addTag(`v${pkg.version}`, colors.yellow);
|
|
@@ -177,7 +172,7 @@ export function buildPackageSelectionMenu(packages, onStepComplete) {
|
|
|
177
172
|
return {
|
|
178
173
|
name: `${highlightedName}${tags}${labelWord}`,
|
|
179
174
|
emoji: '',
|
|
180
|
-
description: pkg.json?.description ??
|
|
175
|
+
description: pkg.json?.description ?? '',
|
|
181
176
|
handler: async () => {
|
|
182
177
|
const step = await runStepLoop([pkg], packages);
|
|
183
178
|
onStepComplete?.(step);
|
|
@@ -1,7 +1,22 @@
|
|
|
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 DEFAULT_COLOR_PALETTE = [
|
|
4
|
+
const DEFAULT_COLOR_PALETTE = [
|
|
5
|
+
'blue',
|
|
6
|
+
'brightBlue',
|
|
7
|
+
'cyan',
|
|
8
|
+
'brightCyan',
|
|
9
|
+
'green',
|
|
10
|
+
'brightGreen',
|
|
11
|
+
'magenta',
|
|
12
|
+
'brightMagenta',
|
|
13
|
+
'red',
|
|
14
|
+
'brightRed',
|
|
15
|
+
'yellow',
|
|
16
|
+
'brightYellow',
|
|
17
|
+
'white',
|
|
18
|
+
'brightWhite',
|
|
19
|
+
];
|
|
5
20
|
const IGNORED_DIRS = new Set([
|
|
6
21
|
'node_modules',
|
|
7
22
|
'.git',
|