@vzn/vx 0.0.551 → 0.0.552

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 +9 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vzn/vx",
3
- "version": "0.0.551",
3
+ "version": "0.0.552",
4
4
  "description": "The fastest task runner and build cache for JavaScript monorepos.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -21,10 +21,10 @@
21
21
  "node": ">=18"
22
22
  },
23
23
  "optionalDependencies": {
24
- "@vzn/vx-linux-x64": "0.0.551",
25
- "@vzn/vx-linux-arm64": "0.0.551",
26
- "@vzn/vx-darwin-x64": "0.0.551",
27
- "@vzn/vx-darwin-arm64": "0.0.551"
24
+ "@vzn/vx-linux-x64": "0.0.552",
25
+ "@vzn/vx-linux-arm64": "0.0.552",
26
+ "@vzn/vx-darwin-x64": "0.0.552",
27
+ "@vzn/vx-darwin-arm64": "0.0.552"
28
28
  },
29
29
  "dependencies": {
30
30
  "@anthropic-ai/sandbox-runtime": "^0.0.76"
package/src/cli/init.ts CHANGED
@@ -53,6 +53,12 @@ export function parseInitArgs(args: readonly string[]): InitArgs {
53
53
  return { ...out, error: `unknown flag: ${a}${flagHint('init', a)}${seeHelp('init')}` }
54
54
  else return { ...out, error: `unexpected argument: ${a}${seeHelp('init')}` }
55
55
  }
56
+ if (out.plugin !== undefined && out.mjs) {
57
+ return {
58
+ ...out,
59
+ error: '--mjs does not combine with --plugin: the plugin templates are TypeScript',
60
+ }
61
+ }
56
62
  return out
57
63
  }
58
64
 
@@ -139,9 +145,11 @@ async function scaffoldPlugin(seam: string, args: InitArgs): Promise<number> {
139
145
  for (const [rel, text] of files) await Bun.write(path.join(root, rel), text)
140
146
  }
141
147
  const factory = /^export function (\w+)/m.exec(template.plugin)![1]!
148
+ const workspaceFile =
149
+ WORKSPACE_CONFIG_FILENAMES.find((n) => existsSync(path.join(root, n))) ?? 'vx.workspace.ts'
142
150
  process.stdout.write(
143
151
  `${args.dry ? 'would write' : 'wrote'} ${files.map(([rel]) => rel).join(' and ')}\n` +
144
- `Declare it in vx.workspace.ts: import { ${factory} } from './plugins/${seam}.ts', then plugins: [${factory}(…)]\n` +
152
+ `Declare it in ${workspaceFile}: import { ${factory} } from './plugins/${seam}.ts', then plugins: [${factory}(…)]\n` +
145
153
  `Test it: bun test plugins/${seam}.test.ts (needs @vzn/vx installed)\n`,
146
154
  )
147
155
  return 0