@emeryld/manager 0.7.5 → 0.7.7

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.
@@ -83,10 +83,13 @@ function resolveFormatScript(pkg, scripts, dependencies) {
83
83
  isDefault: true,
84
84
  };
85
85
  }
86
+ const fallbackArgs = ['run', 'format'];
86
87
  return {
87
88
  label: 'format',
88
- description: `No format/fmt script found for ${pkg.name}`,
89
- available: false,
89
+ description: `No format/fmt script found for ${pkg.name}; ${commandDescription(fallbackArgs)} can be added as a fallback.`,
90
+ args: fallbackArgs,
91
+ available: true,
92
+ isDefault: true,
90
93
  };
91
94
  }
92
95
  function resolveTypecheckScript(pkg, scripts, dependencies) {
@@ -103,10 +106,13 @@ function resolveTypecheckScript(pkg, scripts, dependencies) {
103
106
  isDefault: true,
104
107
  };
105
108
  }
109
+ const fallbackArgs = ['run', 'typecheck'];
106
110
  return {
107
111
  label: 'typecheck',
108
- description: `No typecheck/check script found for ${pkg.name}`,
109
- available: false,
112
+ description: `No typecheck/check script found for ${pkg.name}; ${commandDescription(fallbackArgs)} is the default.`,
113
+ args: fallbackArgs,
114
+ available: true,
115
+ isDefault: true,
110
116
  };
111
117
  }
112
118
  function resolveLintScript(pkg, scripts, dependencies) {
@@ -123,10 +129,13 @@ function resolveLintScript(pkg, scripts, dependencies) {
123
129
  isDefault: true,
124
130
  };
125
131
  }
132
+ const fallbackArgs = ['run', 'lint'];
126
133
  return {
127
134
  label: 'lint',
128
- description: `No lint script found for ${pkg.name}`,
129
- available: false,
135
+ description: `No lint script found for ${pkg.name}; ${commandDescription(fallbackArgs)} is the default.`,
136
+ args: fallbackArgs,
137
+ available: true,
138
+ isDefault: true,
130
139
  };
131
140
  }
132
141
  function resolveDevScript(pkg, scripts, dependencies, kind) {
@@ -138,40 +147,55 @@ function resolveDevScript(pkg, scripts, dependencies, kind) {
138
147
  const direct = resolveRunScript(scripts, devCandidates);
139
148
  if (direct)
140
149
  return direct;
141
- if (dependencies.has('next')) {
142
- const args = ['exec', 'next', 'dev'];
143
- return {
144
- label: 'next dev',
145
- description: commandDescription(args),
146
- args,
147
- available: true,
148
- isDefault: true,
149
- };
150
- }
151
- if (dependencies.has('vite')) {
152
- const args = ['exec', 'vite', 'dev'];
153
- return {
154
- label: 'vite dev',
155
- description: commandDescription(args),
156
- args,
157
- available: true,
158
- isDefault: true,
159
- };
160
- }
161
- if (dependencies.has('expo')) {
162
- const args = ['exec', 'expo', 'start'];
163
- return {
164
- label: 'expo start',
165
- description: commandDescription(args),
166
- args,
167
- available: true,
168
- isDefault: true,
169
- };
170
- }
150
+ const fallback = resolveDevFallback(pkg, dependencies);
151
+ if (fallback)
152
+ return fallback;
153
+ const fallbackArgs = ['run', 'dev'];
171
154
  return {
172
155
  label: 'dev',
173
- description: `No dev/start script found for ${pkg.name}`,
174
- available: false,
156
+ description: `No dev/start script found for ${pkg.name}; ${commandDescription(fallbackArgs)} is the default.`,
157
+ args: fallbackArgs,
158
+ available: true,
159
+ isDefault: true,
160
+ };
161
+ }
162
+ const DEV_FALLBACKS = [
163
+ {
164
+ label: 'expo start',
165
+ args: ['exec', 'expo', 'start'],
166
+ test: (pkg, deps) => deps.has('expo') || deps.has('@expo/cli'),
167
+ },
168
+ {
169
+ label: 'next dev',
170
+ args: ['exec', 'next', 'dev'],
171
+ test: (pkg, deps) => deps.has('next'),
172
+ },
173
+ {
174
+ label: 'vite dev',
175
+ args: ['exec', 'vite', 'dev'],
176
+ test: (pkg, deps) => deps.has('vite'),
177
+ },
178
+ {
179
+ label: 'react-scripts start',
180
+ args: ['exec', 'react-scripts', 'start'],
181
+ test: (pkg, deps) => deps.has('react-scripts'),
182
+ },
183
+ {
184
+ label: 'remix dev',
185
+ args: ['exec', '@remix-run/dev', 'dev'],
186
+ test: (pkg, deps) => deps.has('@remix-run/dev'),
187
+ },
188
+ ];
189
+ function resolveDevFallback(pkg, dependencies) {
190
+ const fallback = DEV_FALLBACKS.find((entry) => entry.test(pkg, dependencies));
191
+ if (!fallback)
192
+ return undefined;
193
+ return {
194
+ label: fallback.label,
195
+ description: commandDescription(fallback.args),
196
+ args: fallback.args,
197
+ available: true,
198
+ isDefault: true,
175
199
  };
176
200
  }
177
201
  function resolveBaseScript(pkg, key, scripts, dependencies, kind) {
@@ -214,10 +238,9 @@ export function getPackageModule(pkg, dependencies = collectDependencies(pkg)) {
214
238
  const pkgType = pkg.json?.type?.toLowerCase();
215
239
  const isModule = pkgType === 'module';
216
240
  const label = isModule ? 'ESM' : 'Node';
217
- const labelColorizer = isModule ? colors.yellow : colors.cyan;
218
241
  return {
219
242
  label,
220
- colorize: labelColorizer,
243
+ colorize: KIND_COLOR_MAP.library,
221
244
  kind: 'library',
222
245
  kindColorize: KIND_COLOR_MAP.library,
223
246
  };
@@ -283,11 +306,9 @@ export function getPackageMarker(pkg, dependencies = collectDependencies(pkg)) {
283
306
  kindColorize: KIND_COLOR_MAP.cli,
284
307
  };
285
308
  }
286
- const isModule = pkgType === 'module';
287
- const labelColorizer = isModule ? colors.yellow : colors.cyan;
288
309
  return {
289
310
  label: 'Library',
290
- colorize: labelColorizer,
311
+ colorize: KIND_COLOR_MAP.library,
291
312
  kind: 'library',
292
313
  kindColorize: KIND_COLOR_MAP.library,
293
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 ?? pkg.relativeDir ?? pkg.dirName,
175
+ description: pkg.json?.description ?? '',
181
176
  handler: async () => {
182
177
  const step = await runStepLoop([pkg], packages);
183
178
  onStepComplete?.(step);
package/dist/packages.js CHANGED
@@ -32,7 +32,7 @@ export async function loadPackages() {
32
32
  const raw = await readFile(pkgJsonPath, 'utf8');
33
33
  const json = JSON.parse(raw);
34
34
  const pkgName = json.name?.trim() ?? entry.name;
35
- const relativePath = normalizeManifestPath(path.relative(rootDir, pkgDir));
35
+ const relativePath = normalizeManifestPath(rootDir, path.relative(rootDir, pkgDir));
36
36
  const meta = byPath.get(relativePath.toLowerCase()) ??
37
37
  byName.get((pkgName ?? '').toLowerCase());
38
38
  const color = (meta?.color ?? colorFromSeed(pkgName));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emeryld/manager",
3
- "version": "0.7.5",
3
+ "version": "0.7.7",
4
4
  "description": "Interactive manager for pnpm monorepos (update/test/build/publish).",
5
5
  "license": "MIT",
6
6
  "type": "module",