@vzn/vx 0.0.148 → 0.0.150

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.148",
3
+ "version": "0.0.150",
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.148",
21
- "@vzn/vx-linux-arm64": "0.0.148",
22
- "@vzn/vx-darwin-x64": "0.0.148",
23
- "@vzn/vx-darwin-arm64": "0.0.148"
20
+ "@vzn/vx-linux-x64": "0.0.150",
21
+ "@vzn/vx-linux-arm64": "0.0.150",
22
+ "@vzn/vx-darwin-x64": "0.0.150",
23
+ "@vzn/vx-darwin-arm64": "0.0.150"
24
24
  },
25
25
  "dependencies": {
26
26
  "@anthropic-ai/sandbox-runtime": "^0.0.76"
package/src/cli/help.ts CHANGED
@@ -108,6 +108,12 @@ export function helpText(pluginCommands: readonly string[] = []): string {
108
108
  ' depends on none of them; a plain `vx run` never requires a plugin.',
109
109
  ' See the plugin guide: https://vznjs.github.io/vx/guides/plugins/',
110
110
  '',
111
+ 'Turbo and Nx spellings (for run):',
112
+ ' What turbo run / nx run-many / nx affected take works here, or is refused',
113
+ ' naming the vx spelling: -t build,test, -p app, --exclude docs, --parallel 4,',
114
+ ' and --base main, --dry-run, --skip-nx-cache. `vx build` names `vx run build`.',
115
+ ' Every flag: https://vznjs.github.io/vx/cli/#turbo-and-nx-flags',
116
+ '',
111
117
  'Argument forwarding (for run):',
112
118
  " Anything after `--` is forwarded (shell-quoted) to the task's exec",
113
119
  ' command. The forwarded args are folded into the cache key.',
@@ -3,6 +3,7 @@
3
3
  // <pattern> name glob, `*` = any characters (e.g. foo, @scope/*)
4
4
  // ./<dir> the package at <dir>, else the packages under it (relative to workspace root)
5
5
  // {<dir>} same as ./<dir>
6
+ // // the workspace-root project only (Turbo's name for the root)
6
7
  // <pattern>... pattern + its transitive workspace dependencies
7
8
  // ...<pattern> pattern + its transitive workspace dependents
8
9
  // <pattern>^... only the transitive deps of pattern (excluding the matched package)
@@ -44,6 +45,8 @@ export interface ParsedFilter {
44
45
  pathGlob?: Bun.Glob
45
46
  /** The workspace root `pathGlob` is relative to. */
46
47
  pathRoot?: string
48
+ /** `//`: the project at `matcher` itself, never the ones under it. */
49
+ exactDir?: true
47
50
  }
48
51
 
49
52
  export function parseFilter(raw: string, workspaceRoot: string): ParsedFilter {
@@ -102,6 +105,26 @@ export function parseFilter(raw: string, workspaceRoot: string): ParsedFilter {
102
105
  // with one warning line (item 1030).
103
106
  if (s === '') throw new UserError(`filter "${raw}" names no project`)
104
107
 
108
+ // `//` is Turbo's name for the root package (`--filter=//`, `//...`,
109
+ // `!//`, probed on 2.8.17). vx names the root project by its
110
+ // package.json name, so `//` is its directory, and only a project
111
+ // there: read as `.`, it would select every project when the root is
112
+ // none.
113
+ if (s === '//') {
114
+ return {
115
+ raw,
116
+ negate,
117
+ withDeps,
118
+ withDependents,
119
+ onlyDeps,
120
+ onlyDependents,
121
+ isPath: true,
122
+ matcher: path.resolve(workspaceRoot),
123
+ exactDir: true,
124
+ ...(gitSince !== undefined ? { gitSince } : {}),
125
+ }
126
+ }
127
+
105
128
  let isPath = false
106
129
  let matcher = s
107
130
  let pathGlob: Bun.Glob | undefined
@@ -164,6 +187,7 @@ function matchSelector(filter: ParsedFilter, projects: ProjectMeta[]): string[]
164
187
  // A directory that is no project keeps the "at or under" reading.
165
188
  const exact = projects.find((p) => p.dir === filter.matcher)
166
189
  if (exact !== undefined) return [exact.name]
190
+ if (filter.exactDir === true) return out
167
191
  const prefix = filter.matcher + path.sep
168
192
  for (const p of projects) {
169
193
  if (p.dir.startsWith(prefix)) out.push(p.name)