@vzn/vx 0.0.287 → 0.0.288
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/workspace/workspace.ts +31 -13
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vzn/vx",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.288",
|
|
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.288",
|
|
21
|
+
"@vzn/vx-linux-arm64": "0.0.288",
|
|
22
|
+
"@vzn/vx-darwin-x64": "0.0.288",
|
|
23
|
+
"@vzn/vx-darwin-arm64": "0.0.288"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@anthropic-ai/sandbox-runtime": "^0.0.76"
|
|
@@ -558,8 +558,7 @@ export async function listProjects(workspace: Workspace): Promise<ProjectMeta[]>
|
|
|
558
558
|
}),
|
|
559
559
|
)
|
|
560
560
|
|
|
561
|
-
const
|
|
562
|
-
const seenName = new Map<string, string>()
|
|
561
|
+
const byName = new Map<string, NonNullable<(typeof loaded)[number]>[]>()
|
|
563
562
|
for (const entry of loaded) {
|
|
564
563
|
if (entry === null) continue
|
|
565
564
|
const { dir, pkg, configPath } = entry
|
|
@@ -575,22 +574,41 @@ export async function listProjects(workspace: Workspace): Promise<ProjectMeta[]>
|
|
|
575
574
|
}
|
|
576
575
|
continue
|
|
577
576
|
}
|
|
578
|
-
const
|
|
579
|
-
if (
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
577
|
+
const group = byName.get(pkg.name)
|
|
578
|
+
if (group === undefined) byName.set(pkg.name, [entry])
|
|
579
|
+
else group.push(entry)
|
|
580
|
+
}
|
|
581
|
+
const projects: ProjectMeta[] = []
|
|
582
|
+
const shared: string[] = []
|
|
583
|
+
for (const [name, group] of byName) {
|
|
584
|
+
if (group.length === 1) {
|
|
585
|
+
const { dir, pkg, configPath } = group[0]!
|
|
586
|
+
projects.push({ name, dir, packageJson: pkg, configPath })
|
|
587
|
+
continue
|
|
588
|
+
}
|
|
589
|
+
const dirs = group.map((e) => relPosix(workspace.root, e.dir)).sort()
|
|
590
|
+
// pnpm accepts two manifests of one name (vite's playground, sveltejs/kit's
|
|
591
|
+
// test apps); vx cannot, since a project is addressed by it. Like a
|
|
592
|
+
// nameless one, a pair that declares no vx tasks is left out, so the
|
|
593
|
+
// rest of the workspace runs (vite was refused whole, 2026-10-01); one
|
|
594
|
+
// with a vx config was meant to run, and is refused with the way on.
|
|
595
|
+
if (group.some((e) => e.configPath !== null)) {
|
|
583
596
|
throw new UserError(
|
|
584
|
-
`Duplicate package name "${
|
|
585
|
-
.map((d) => relPosix(workspace.root, d))
|
|
586
|
-
.sort()
|
|
587
|
-
.join(' and ')}; ` +
|
|
597
|
+
`Duplicate package name "${name}" in workspace: ${dirs.join(' and ')}; ` +
|
|
588
598
|
'vx names a project by its package name — rename one, or leave one out with a `!` pattern in the workspace globs',
|
|
589
599
|
)
|
|
590
600
|
}
|
|
591
|
-
|
|
592
|
-
|
|
601
|
+
shared.push(`${name} (${dirs.join(', ')})`)
|
|
602
|
+
}
|
|
603
|
+
if (shared.length > 0) {
|
|
604
|
+
shared.sort()
|
|
605
|
+
const shown =
|
|
606
|
+
shared.slice(0, 2).join('; ') + (shared.length > 2 ? `; and ${shared.length - 2} more` : '')
|
|
607
|
+
process.stderr.write(
|
|
608
|
+
`vx: left out, as no project can be addressed by a name several manifests share (none has a vx config): ${shown}\n`,
|
|
609
|
+
)
|
|
593
610
|
}
|
|
611
|
+
|
|
594
612
|
// Code-unit order, not `localeCompare`: ICU collation cost 28 ms of a
|
|
595
613
|
// 300 ms warm run at 1000 projects, and a stable deterministic order is
|
|
596
614
|
// all any consumer needs.
|