diff --git a/.changeset/clibuddy-tinyexec.md b/.changeset/clibuddy-tinyexec.md deleted file mode 100644 index 1ee1f0a..0000000 --- a/.changeset/clibuddy-tinyexec.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -"@vlandoss/clibuddy": minor ---- - -**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 `$ ` 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: ""` to avoid `node_modules/.bin/` shim loops. diff --git a/.changeset/run-run-shell-migration.md b/.changeset/run-run-shell-migration.md deleted file mode 100644 index 3df1f0d..0000000 --- a/.changeset/run-run-shell-migration.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -"@vlandoss/run-run": patch ---- - -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 `$ ` 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/` shims that run-run itself publishes (`tools/biome` etc.), which would otherwise loop back through `rr tools ` 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. diff --git a/.changeset/vland-init-prompts-and-git-fix.md b/.changeset/vland-init-prompts-and-git-fix.md deleted file mode 100644 index d3cccf1..0000000 --- a/.changeset/vland-init-prompts-and-git-fix.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"@vlandoss/vland": minor ---- - -`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. diff --git a/packages/clibuddy/CHANGELOG.md b/packages/clibuddy/CHANGELOG.md index c428379..1f1344b 100644 --- a/packages/clibuddy/CHANGELOG.md +++ b/packages/clibuddy/CHANGELOG.md @@ -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 `$ ` 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: ""` to avoid `node_modules/.bin/` shim loops. + ## 0.5.0 ### Minor Changes diff --git a/packages/clibuddy/package.json b/packages/clibuddy/package.json index db64b79..6f9bfc8 100644 --- a/packages/clibuddy/package.json +++ b/packages/clibuddy/package.json @@ -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": { diff --git a/packages/run-run/CHANGELOG.md b/packages/run-run/CHANGELOG.md index aa19db5..300494e 100644 --- a/packages/run-run/CHANGELOG.md +++ b/packages/run-run/CHANGELOG.md @@ -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 `$ ` 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/` shims that run-run itself publishes (`tools/biome` etc.), which would otherwise loop back through `rr tools ` 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 diff --git a/packages/run-run/package.json b/packages/run-run/package.json index 6e5bd60..d094db9 100644 --- a/packages/run-run/package.json +++ b/packages/run-run/package.json @@ -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": { diff --git a/packages/vland/CHANGELOG.md b/packages/vland/CHANGELOG.md index 298147e..84d422a 100644 --- a/packages/vland/CHANGELOG.md +++ b/packages/vland/CHANGELOG.md @@ -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 diff --git a/packages/vland/package.json b/packages/vland/package.json index c6cb01f..64b7df2 100644 --- a/packages/vland/package.json +++ b/packages/vland/package.json @@ -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": {