@vzn/vx 0.0.299 → 0.0.301
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vzn/vx",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.301",
|
|
4
4
|
"description": "A fast, correct task runner and build cache for JavaScript monorepos.",
|
|
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.301",
|
|
21
|
+
"@vzn/vx-linux-arm64": "0.0.301",
|
|
22
|
+
"@vzn/vx-darwin-x64": "0.0.301",
|
|
23
|
+
"@vzn/vx-darwin-arm64": "0.0.301"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@anthropic-ai/sandbox-runtime": "^0.0.76"
|
package/src/index.ts
CHANGED
package/src/workspace/index.ts
CHANGED
|
@@ -39,6 +39,7 @@ import {
|
|
|
39
39
|
PERSISTENT_TASK_NAMES,
|
|
40
40
|
PERSISTENT_TODO,
|
|
41
41
|
cacheTodo,
|
|
42
|
+
pruneOrphanPersistentNotes,
|
|
42
43
|
} from './migration.js'
|
|
43
44
|
|
|
44
45
|
// `lint` is not here: a linter reads sources, and an edge to `build`
|
|
@@ -379,6 +380,7 @@ export function migrateScripts(
|
|
|
379
380
|
}
|
|
380
381
|
}
|
|
381
382
|
breakBuildCycles(projects, metas)
|
|
383
|
+
pruneOrphanPersistentNotes(projects, PERSISTENT_TODO)
|
|
382
384
|
return {
|
|
383
385
|
headerNotes: [
|
|
384
386
|
// Where to add one is the TODO's to say, when there is one: an Nx repo
|
|
@@ -97,6 +97,47 @@ export const PERSISTENT_TODO =
|
|
|
97
97
|
'persistent task — set persistent.readyWhen (regex matched against output) so ' +
|
|
98
98
|
'dependents unblock on readiness, and consider exec.timeout to bound the wait'
|
|
99
99
|
|
|
100
|
+
// The readiness note a persistent task carries ("add `readyWhen` to gate
|
|
101
|
+
// dependents") is moot for a task nothing depends on: no one waits for it,
|
|
102
|
+
// so there is nothing to gate. refine printed it for 375 `dev` and `start`
|
|
103
|
+
// tasks on every run, none of them anyone's dependency (item 602), and
|
|
104
|
+
// `vx init` wrote it on hoppscotch's 24 `dev`-shaped scripts. Every mapper
|
|
105
|
+
// runs this last, over the whole mapping, since a dependent may sit in
|
|
106
|
+
// another package.
|
|
107
|
+
|
|
108
|
+
/** Strips the note from every persistent task no `dependsOn` in the mapping names. */
|
|
109
|
+
export function pruneOrphanPersistentNotes(
|
|
110
|
+
projects: readonly {
|
|
111
|
+
readonly tasks: readonly {
|
|
112
|
+
readonly name: string
|
|
113
|
+
readonly todos: string[]
|
|
114
|
+
readonly task: Record<string, unknown> | null
|
|
115
|
+
}[]
|
|
116
|
+
}[],
|
|
117
|
+
note: string,
|
|
118
|
+
): void {
|
|
119
|
+
const referenced = new Set<string>()
|
|
120
|
+
for (const project of projects) {
|
|
121
|
+
for (const t of project.tasks) {
|
|
122
|
+
const deps = t.task?.['dependsOn']
|
|
123
|
+
if (!Array.isArray(deps)) continue
|
|
124
|
+
for (const d of deps) {
|
|
125
|
+
if (typeof d !== 'string') continue
|
|
126
|
+
// `^name`, `pkg#name` and `name` all name the same task.
|
|
127
|
+
const hash = d.indexOf('#')
|
|
128
|
+
referenced.add(hash === -1 ? d.replace(/^\^/, '') : d.slice(hash + 1))
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
for (const project of projects) {
|
|
133
|
+
for (const t of project.tasks) {
|
|
134
|
+
if (referenced.has(t.name)) continue
|
|
135
|
+
const at = t.todos.indexOf(note)
|
|
136
|
+
if (at !== -1) t.todos.splice(at, 1)
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
100
141
|
/** Verbatim TS expression spliced into a generated array (preset spreads). */
|
|
101
142
|
export interface RawExpr {
|
|
102
143
|
readonly raw: string
|