Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 0 additions & 29 deletions .changeset/clibuddy-tinyexec.md

This file was deleted.

14 changes: 0 additions & 14 deletions .changeset/run-run-shell-migration.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changeset/vland-init-prompts-and-git-fix.md

This file was deleted.

30 changes: 30 additions & 0 deletions packages/clibuddy/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@
# @vlandoss/clibuddy

## 0.6.0

### Minor Changes

- [#210](https://github.com/variableland/dx/pull/210) [`7d7e673`](https://github.com/variableland/dx/commit/7d7e673e34974740b6b09c8385e9f91ad9af8ea8) Thanks [@rqbazan](https://github.com/rqbazan)! - **Breaking:** Replace `zx` with `tinyexec` and redesign `ShellService` around array-based exec.

The previous tagged-template API (`shell.$\`...\``) and its surrounding helpers (`quote`, `isRaw`, `defaultQuote`, `getPreferLocal`, `localBaseBinPath`, `mute()`, `quiet()`, `isProcessOutput`, `./test-helpers`export) are gone. They duplicated zx internals, introduced a quoting bug for whitespace strings, and surfaced inconsistent`node_modules/.bin` resolution.

New surface:

- `shell.run(cmd, args, opts?)` — streams stdio to the terminal and prints `$ <cmd> <args>` in verbose mode. Throws `NonZeroExitError` on non-zero exit by default.
- `shell.runCaptured(cmd, args, opts?)` — silent, returns the captured `Output { stdout, stderr, exitCode }`. Same throw-by-default semantics.
- `shell.at(cwd)` / `shell.child(opts)` — child shells with merged options.
- `RunOptions`: `cwd`, `env`, `verbose`, `throwOnError`, `shell` (pass-through `shell: true` for `&&`/pipes), `stdin`, `display` (override the verbose-printed name without affecting what's spawned).
- `resolvePackageBin(pkg, { from, binName? })` — async resolver that returns the absolute path to an installed package's binary, tolerating restrictive `exports` maps (oxlint) and packages without `main`/`exports` at all (`@biomejs/biome`). Memoised per `(pkg, from, binName)`.
- `isNonZeroExitError(value)` — replaces `isProcessOutput`.

`tinyexec` automatically prepends every parent `node_modules/.bin` to `PATH`, so `localBaseBinPath` / `getPreferLocal` are no longer needed.

New dependencies: `tinyexec` (replaces `zx`), `memoize` (for `resolvePackageBin`).

**Migration**

- `await shell.$\`git init\``→`await shell.run("git", ["init"])`
- `await shell.$\`git config\`.nothrow()`→`await shell.runCaptured("git", ["config", ...], { throwOnError: false })`
- `shell.mute()` → call `runCaptured` instead (silent by default).
- `createShellService({ localBaseBinPath: [dir] })` → drop the option; tinyexec walks up automatically.
- `isProcessOutput(err)` → `isNonZeroExitError(err)`.
- Tools wrapping a npm package (e.g. biome, tsdown) should resolve the bin path via `resolvePackageBin` and pass it as the `cmd` with `display: "<friendly-name>"` to avoid `node_modules/.bin/<name>` shim loops.

## 0.5.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/clibuddy/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vlandoss/clibuddy",
"version": "0.5.0",
"version": "0.6.0",
"description": "A helper library to create CLIs in Variable Land",
"homepage": "https://github.com/variableland/dx/tree/main/packages/clibuddy#readme",
"bugs": {
Expand Down
18 changes: 18 additions & 0 deletions packages/run-run/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# @vlandoss/run-run

## 0.5.3

### Patch Changes

- [#210](https://github.com/variableland/dx/pull/210) [`7d7e673`](https://github.com/variableland/dx/commit/7d7e673e34974740b6b09c8385e9f91ad9af8ea8) Thanks [@rqbazan](https://github.com/rqbazan)! - Internal migration to the new tinyexec-backed `ShellService` (see `@vlandoss/clibuddy`).

- `ToolService.exec` now accepts only `string[]` (the `string` overload that silently word-split on spaces is gone). All tool services (`biome`, `oxlint`, `oxfmt`, `tsdown`, `tsc`) build their flags as arrays so each flag survives as its own argv entry.
- Bin resolution moves into the base `ToolService`: subclasses declare `{ pkg, bin?, ui }` in the constructor and the base resolves the absolute path via `resolvePackageBin` (memoised). The verbose `$ <bin> <args>` line is preserved via the `display` option so users still see `$ biome check ...` instead of an absolute resolved path. Resolving to the absolute path bypasses the `node_modules/.bin/<bin>` shims that run-run itself publishes (`tools/biome` etc.), which would otherwise loop back through `rr tools <bin>` indefinitely.
- `tscheck` runs `pretsc` / `pretypecheck` package scripts through `shell: true` so they can use `&&`, pipes, and env-var substitution.
- Bump `tsdown` from `0.21.10` to `0.22.0`. `tsdown@0.21.x` depends on `unrun@^0.2.37`, which pnpm resolved to `0.2.38` — whose published tarball is missing `dist/`, producing `WARN Failed to create bin … unrun` on every install. `tsdown@0.22.0` dropped `unrun` from `dependencies` (now an optional peer), erradicating the warning.

Tests reorganised into one e2e file per command (`cli`, `jsc`, `lint`, `format`, `tsc`, `build-lib`). Each spawns the real `rr` binary against a temp fixture (`makeFixture` helper) and asserts on observable output, so we no longer rely on a `clibuddy/test-helpers` mock.

End-user CLI behaviour is unchanged.

- Updated dependencies [[`7d7e673`](https://github.com/variableland/dx/commit/7d7e673e34974740b6b09c8385e9f91ad9af8ea8)]:
- @vlandoss/clibuddy@0.6.0

## 0.5.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/run-run/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vlandoss/run-run",
"version": "0.5.2",
"version": "0.5.3",
"description": "The CLI toolbox to fullstack common scripts in Variable Land",
"homepage": "https://github.com/variableland/dx/tree/main/packages/run-run#readme",
"bugs": {
Expand Down
13 changes: 13 additions & 0 deletions packages/vland/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# @vlandoss/vland

## 0.2.0

### Minor Changes

- [#210](https://github.com/variableland/dx/pull/210) [`7d7e673`](https://github.com/variableland/dx/commit/7d7e673e34974740b6b09c8385e9f91ad9af8ea8) Thanks [@rqbazan](https://github.com/rqbazan)! - `vland init` now prompts (default-yes) for installing dependencies and initialising a git repository when those flags aren't passed on the CLI. Use `--install` / `--no-install` and `--git` / `--no-git` to skip the prompts; in non-interactive contexts both default to `true`.

Also fixes the git initialisation step: the commit message was being split on whitespace by the underlying shell layer, producing errors like `pathspec 'initial' did not match any file(s)` and leaving the repo half-initialised. The migration to `tinyexec` (via `@vlandoss/clibuddy`) makes each argv entry survive as a separate token, so the canonical first commit `chore: initial commit from vland` now lands cleanly.

### Patch Changes

- Updated dependencies [[`7d7e673`](https://github.com/variableland/dx/commit/7d7e673e34974740b6b09c8385e9f91ad9af8ea8)]:
- @vlandoss/clibuddy@0.6.0

## 0.1.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/vland/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vlandoss/vland",
"version": "0.1.1",
"version": "0.2.0",
"description": "The CLI to init a new project in Variable Land",
"homepage": "https://github.com/variableland/dx/tree/main/packages/vland#readme",
"bugs": {
Expand Down