@vzn/vx-lockfile 0.0.611 → 0.0.613

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-lockfile",
3
- "version": "0.0.611",
3
+ "version": "0.0.613",
4
4
  "license": "MIT",
5
5
  "description": "Lockfile plugins for vx — pnpm(), bun(), npm(), yarn(): each keys every task on its project's own resolved dependency closure from the package manager's lockfile, so a lockfile change re-keys only the projects it reaches; --affected follows the same answer; `vx prune` cuts the workspace and the lockfile to a Docker subset.",
6
6
  "keywords": [
@@ -37,7 +37,7 @@
37
37
  "access": "public"
38
38
  },
39
39
  "peerDependencies": {
40
- "@vzn/vx": "^0.0.611"
40
+ "@vzn/vx": "^0.0.613"
41
41
  },
42
42
  "repository": {
43
43
  "type": "git",
package/src/index.ts CHANGED
@@ -18,6 +18,7 @@
18
18
  import { createRequire } from 'node:module'
19
19
  import {
20
20
  refuseUnknownOptions,
21
+ UserError,
21
22
  type PluginCommand,
22
23
  type PluginOptionKinds,
23
24
  definePlugin,
@@ -91,8 +92,8 @@ const CONFLICT = /^(?:<{7}|={7}|>{7})(?: |$)/m
91
92
  function plugin(manager: Manager, options: LockfileOptions): VxPlugin {
92
93
  const scope = options.scope ?? 'project'
93
94
  if (scope !== 'project' && scope !== 'workspace') {
94
- throw new Error(
95
- `@vzn/vx-lockfile: ${manager.name}() scope must be 'project' or 'workspace', not ${JSON.stringify(scope)}`,
95
+ throw new UserError(
96
+ `${manager.name}() scope must be 'project' or 'workspace', not ${JSON.stringify(scope)}`,
96
97
  )
97
98
  }
98
99
  // The parsers name their own file, so prefixing unconditionally said it
package/src/prune.ts CHANGED
@@ -84,6 +84,10 @@ function parseArgs(argv: readonly string[]): Args | null {
84
84
  const v = a === '--out-dir' ? argv[++i] : a.slice('--out-dir='.length)
85
85
  if (v === undefined || v === '')
86
86
  throw new UserError(`vx prune: --out-dir needs a path\n${USAGE}`)
87
+ // `--out-dir --docker` wrote to a directory named `--docker` and lost
88
+ // docker mode; a path that starts with '-' is spelt `--out-dir=-x`.
89
+ if (a === '--out-dir' && v.startsWith('-'))
90
+ throw new UserError(`vx prune: --out-dir needs a path, got the flag ${v}\n${USAGE}`)
87
91
  outDir = v
88
92
  } else if (a.startsWith('-')) throw new UserError(`vx prune: unknown flag ${a}\n${USAGE}`)
89
93
  else projects.push(a)