@vzn/vx 0.0.88 → 0.0.89
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/package.json +5 -5
- package/src/cli/select.ts +3 -1
- package/src/cli/why.ts +3 -1
- package/src/workspace/migrate-scripts.ts +12 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vzn/vx",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.89",
|
|
4
4
|
"description": "An open, extensible monorepo task runner.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
"node": ">=18"
|
|
18
18
|
},
|
|
19
19
|
"optionalDependencies": {
|
|
20
|
-
"@vzn/vx-linux-x64": "0.0.
|
|
21
|
-
"@vzn/vx-linux-arm64": "0.0.
|
|
22
|
-
"@vzn/vx-darwin-x64": "0.0.
|
|
23
|
-
"@vzn/vx-darwin-arm64": "0.0.
|
|
20
|
+
"@vzn/vx-linux-x64": "0.0.89",
|
|
21
|
+
"@vzn/vx-linux-arm64": "0.0.89",
|
|
22
|
+
"@vzn/vx-darwin-x64": "0.0.89",
|
|
23
|
+
"@vzn/vx-darwin-arm64": "0.0.89"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@anthropic-ai/sandbox-runtime": "^0.0.76"
|
package/src/cli/select.ts
CHANGED
|
@@ -353,7 +353,9 @@ export async function pickTask(
|
|
|
353
353
|
}
|
|
354
354
|
}
|
|
355
355
|
if (entries.length === 0) {
|
|
356
|
-
process.stderr.write(
|
|
356
|
+
process.stderr.write(
|
|
357
|
+
'vx run: no tasks declared in any project; declare one under `tasks` in a vx.config, or run `vx init` to write them from package.json scripts\n',
|
|
358
|
+
)
|
|
357
359
|
return null
|
|
358
360
|
}
|
|
359
361
|
const out = io.output ?? process.stdout
|
package/src/cli/why.ts
CHANGED
|
@@ -181,7 +181,9 @@ export async function whyCmd(args: readonly string[]): Promise<number> {
|
|
|
181
181
|
|
|
182
182
|
const why = whyDidThisRerun(db, runId, taskId)
|
|
183
183
|
if (!why.found) {
|
|
184
|
-
throw new UserError(
|
|
184
|
+
throw new UserError(
|
|
185
|
+
`vx why: run ${runId} has no row for ${taskId}; \`vx last --list\` shows the recorded runs, \`vx last <runId>\` what one ran`,
|
|
186
|
+
)
|
|
185
187
|
}
|
|
186
188
|
const diff = cacheKeyDiff(db, runId, taskId)
|
|
187
189
|
|
|
@@ -140,13 +140,16 @@ export function migrateScripts(metas: readonly ProjectMeta[]): MigrationPlan {
|
|
|
140
140
|
if (runnable.length === 0) continue
|
|
141
141
|
const hasBuild = names.includes('build')
|
|
142
142
|
const has = (n: string): boolean => names.includes(n)
|
|
143
|
+
// Lifecycle hooks are npm's, not tasks anyone runs by name, and a hook
|
|
144
|
+
// of a script that exists rides inside that script's command.
|
|
145
|
+
const isTask = (n: string): boolean => {
|
|
146
|
+
if (!has(n) || LIFECYCLE.test(n)) return false
|
|
147
|
+
const hookOf = /^(pre|post)(.+)$/.exec(n)
|
|
148
|
+
return hookOf === null || !has(hookOf[2]!) || LIFECYCLE.test(hookOf[2]!)
|
|
149
|
+
}
|
|
143
150
|
const tasks: GeneratedTask[] = []
|
|
144
151
|
for (const name of names) {
|
|
145
|
-
|
|
146
|
-
if (LIFECYCLE.test(name)) continue
|
|
147
|
-
// A hook of a script that exists rides inside that script's command.
|
|
148
|
-
const hookOf = /^(pre|post)(.+)$/.exec(name)
|
|
149
|
-
if (hookOf !== null && has(hookOf[2]!) && !LIFECYCLE.test(hookOf[2]!)) continue
|
|
152
|
+
if (!isTask(name)) continue
|
|
150
153
|
|
|
151
154
|
const todos: string[] = []
|
|
152
155
|
const own = scripts[name] as string
|
|
@@ -155,7 +158,10 @@ export function migrateScripts(metas: readonly ProjectMeta[]): MigrationPlan {
|
|
|
155
158
|
// package manager and never ride inside a task — `pack` stays alone.
|
|
156
159
|
const hook = (h: string): boolean => has(h) && !LIFECYCLE.test(h)
|
|
157
160
|
const hooks = [`pre${name}`, `post${name}`].filter(hook)
|
|
158
|
-
|
|
161
|
+
// A group over a script that is no task (`setup: npm run prepare`)
|
|
162
|
+
// named a task nothing defines, and the run `vx init` suggested
|
|
163
|
+
// refused the config (D-12).
|
|
164
|
+
if (delegate !== null && isTask(delegate) && delegate !== name && hooks.length === 0) {
|
|
159
165
|
// A group: no exec, the graph runs the target. `npm test` calling
|
|
160
166
|
// `vitest` through `npm run test:unit` is two tasks, not a subprocess.
|
|
161
167
|
const task: Record<string, unknown> = { dependsOn: [delegate] }
|