@vzn/vx 0.0.239 → 0.0.241

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.
Files changed (2) hide show
  1. package/package.json +5 -5
  2. package/src/cli/init.ts +16 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vzn/vx",
3
- "version": "0.0.239",
3
+ "version": "0.0.241",
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.239",
21
- "@vzn/vx-linux-arm64": "0.0.239",
22
- "@vzn/vx-darwin-x64": "0.0.239",
23
- "@vzn/vx-darwin-arm64": "0.0.239"
20
+ "@vzn/vx-linux-x64": "0.0.241",
21
+ "@vzn/vx-linux-arm64": "0.0.241",
22
+ "@vzn/vx-darwin-x64": "0.0.241",
23
+ "@vzn/vx-darwin-arm64": "0.0.241"
24
24
  },
25
25
  "dependencies": {
26
26
  "@anthropic-ai/sandbox-runtime": "^0.0.76"
package/src/cli/init.ts CHANGED
@@ -263,7 +263,22 @@ export function adoptionNext(root: string, runner: 'turbo' | 'nx', source: strin
263
263
  const vx = process.env['npm_config_user_agent'] === undefined ? 'vx' : `${EXEC[pm]} vx`
264
264
  const task = firstTask(path.join(root, source), runner)
265
265
  const run = `${vx} run ${task} --all`
266
- return missing.length === 0 ? run : `${INSTALL[pm]} ${missing.join(' ')} && ${run}`
266
+ if (missing.length === 0) return run
267
+ // Yarn 1 refuses `add` at a workspace root without `-W`; Berry has no such
268
+ // flag and refuses it. A Berry lockfile carries `__metadata`.
269
+ const install =
270
+ pm === 'yarn' && !readText(path.join(root, 'yarn.lock')).includes('__metadata:')
271
+ ? `${INSTALL.yarn} -W`
272
+ : INSTALL[pm]
273
+ return `${install} ${missing.join(' ')} && ${run}`
274
+ }
275
+
276
+ function readText(file: string): string {
277
+ try {
278
+ return readFileSync(file, 'utf8')
279
+ } catch {
280
+ return ''
281
+ }
267
282
  }
268
283
 
269
284
  /** `build` when the runner's config names it, else the first task it names. */