@emeryld/manager 0.7.5 → 0.7.6

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) {
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.6",
4
4
  "description": "Interactive manager for pnpm monorepos (update/test/build/publish).",
5
5
  "license": "MIT",
6
6
  "type": "module",