@emeryld/manager 0.7.2 → 0.7.4
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/menu/script-helpers.js +13 -2
- package/dist/menu.js +13 -7
- package/package.json +1 -1
|
@@ -210,6 +210,18 @@ export function makeBaseScriptEntries(pkg) {
|
|
|
210
210
|
return entries;
|
|
211
211
|
}, []);
|
|
212
212
|
}
|
|
213
|
+
export function getPackageModule(pkg, dependencies = collectDependencies(pkg)) {
|
|
214
|
+
const pkgType = pkg.json?.type?.toLowerCase();
|
|
215
|
+
const isModule = pkgType === 'module';
|
|
216
|
+
const label = isModule ? 'ESM' : 'Node';
|
|
217
|
+
const labelColorizer = isModule ? colors.yellow : colors.cyan;
|
|
218
|
+
return {
|
|
219
|
+
label,
|
|
220
|
+
colorize: labelColorizer,
|
|
221
|
+
kind: 'library',
|
|
222
|
+
kindColorize: KIND_COLOR_MAP.library,
|
|
223
|
+
};
|
|
224
|
+
}
|
|
213
225
|
export function getPackageMarker(pkg, dependencies = collectDependencies(pkg)) {
|
|
214
226
|
const normalizedDeps = new Set([...dependencies].map((dep) => String(dep).toLowerCase().trim()));
|
|
215
227
|
function findIndicator(indicators) {
|
|
@@ -272,10 +284,9 @@ export function getPackageMarker(pkg, dependencies = collectDependencies(pkg)) {
|
|
|
272
284
|
};
|
|
273
285
|
}
|
|
274
286
|
const isModule = pkgType === 'module';
|
|
275
|
-
const label = isModule ? 'ESM' : 'Node';
|
|
276
287
|
const labelColorizer = isModule ? colors.yellow : colors.cyan;
|
|
277
288
|
return {
|
|
278
|
-
label,
|
|
289
|
+
label: 'Library',
|
|
279
290
|
colorize: labelColorizer,
|
|
280
291
|
kind: 'library',
|
|
281
292
|
kindColorize: KIND_COLOR_MAP.library,
|
package/dist/menu.js
CHANGED
|
@@ -8,7 +8,7 @@ import { runHelperCli } from './helper-cli.js';
|
|
|
8
8
|
import { ensureWorkingTreeCommitted } from './preflight.js';
|
|
9
9
|
import { openDockerHelper } from './docker.js';
|
|
10
10
|
import { run } from './utils/run.js';
|
|
11
|
-
import { makeBaseScriptEntries, getPackageMarker } from './menu/script-helpers.js';
|
|
11
|
+
import { makeBaseScriptEntries, getPackageMarker, getPackageModule } from './menu/script-helpers.js';
|
|
12
12
|
function formatKindLabel(kind) {
|
|
13
13
|
if (kind === 'cli')
|
|
14
14
|
return 'CLI';
|
|
@@ -145,6 +145,7 @@ export function buildPackageSelectionMenu(packages, onStepComplete) {
|
|
|
145
145
|
const ordered = getOrderedPackages(packages);
|
|
146
146
|
const entries = ordered.map((pkg) => {
|
|
147
147
|
const marker = getPackageMarker(pkg);
|
|
148
|
+
const module = getPackageModule(pkg);
|
|
148
149
|
const primaryName = pkg.name ?? pkg.dirName;
|
|
149
150
|
const packageColorizer = colors[pkg.color ?? 'cyan'] ?? colors.cyan;
|
|
150
151
|
const highlightedName = packageColorizer(primaryName);
|
|
@@ -154,18 +155,23 @@ export function buildPackageSelectionMenu(packages, onStepComplete) {
|
|
|
154
155
|
return;
|
|
155
156
|
tagParts.push(colorizer(`[${value}]`));
|
|
156
157
|
};
|
|
157
|
-
const relativePath = pkg.relativeDir ?? pkg.dirName
|
|
158
|
-
if (relativePath && relativePath !== '.') {
|
|
159
|
-
|
|
160
|
-
}
|
|
158
|
+
// const relativePath = pkg.relativeDir ?? pkg.dirName
|
|
159
|
+
// if (relativePath && relativePath !== '.') {
|
|
160
|
+
// addTag(relativePath, colors.gray)
|
|
161
|
+
// }
|
|
162
|
+
addTag(pkg.path, colors.gray);
|
|
163
|
+
addTag(pkg.packageJsonPath, colors.gray);
|
|
161
164
|
if (pkg.version) {
|
|
162
165
|
addTag(`v${pkg.version}`, colors.yellow);
|
|
163
166
|
}
|
|
164
167
|
if (pkg.dockerfilePath) {
|
|
165
168
|
addTag('docker', colors.green);
|
|
166
169
|
}
|
|
167
|
-
|
|
168
|
-
|
|
170
|
+
if (marker) {
|
|
171
|
+
const kindLabel = formatKindLabel(marker.kind);
|
|
172
|
+
addTag(kindLabel, marker.kindColorize);
|
|
173
|
+
}
|
|
174
|
+
addTag(module.label, marker.kindColorize);
|
|
169
175
|
const labelWord = marker.label ? ` ${marker.colorize(marker.label)}` : '';
|
|
170
176
|
const tags = tagParts.length ? ` ${tagParts.join(' ')}` : '';
|
|
171
177
|
return {
|