@ramon-sg/runner 1.0.0 → 1.0.1

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  Lee `.agents/runner.json` y arma el comando para correr cada herramienta con Bun o Node
2
2
 
3
- Una librería sin dependencias para las herramientas de `@ramon-sg` que se corren con `bunx --bun` o `npx --yes`: guarda en el repo qué runner usar y qué versión de cada herramienta, y construye el comando exacto.
3
+ Una librería sin dependencias para las herramientas de `@ramon-sg` que se corren con `bun x --bun` o `npx --yes`: guarda en el repo qué runner usar y qué versión de cada herramienta, y construye el comando exacto.
4
4
 
5
5
  ## El archivo
6
6
 
@@ -30,10 +30,10 @@ Una librería sin dependencias para las herramientas de `@ramon-sg` que se corre
30
30
  - `writeRunnerConfig(root, config)`: escribe el archivo con formato estable y de forma atómica; lanza `TypeError` si `config` no es válida.
31
31
  - `effectiveRunner(config)`: el runner que se usa, con el valor por defecto si falta.
32
32
  - `runnerAvailable(runner)`: si ese runner está instalado en la máquina.
33
- - `chooseRunner({ ask })`: devuelve `"bun"` si `bunx` está disponible; si no, pregunta con `ask` si se pasó (`null` = el usuario eligió salir); sin `ask` devuelve `"node"` junto con `NO_BUN_WARNING`.
33
+ - `chooseRunner({ ask })`: devuelve `"bun"` si `bun` está disponible; si no, pregunta con `ask` si se pasó (`null` = el usuario eligió salir); sin `ask` devuelve `"node"` junto con `NO_BUN_WARNING`.
34
34
  - `NO_BUN_WARNING`: el aviso que acompaña a `"node"` cuando no hay Bun.
35
35
  - `setTool(config, pkg, version, { ifMissing, allowLower })`: fija la versión de una herramienta, sin bajarla salvo que se pida.
36
- - `toolCommand(runner, pkg, version, args)`: el comando como lista de argumentos.
36
+ - `toolCommand(runner, pkg, version, args)`: el comando como lista de argumentos. Con Bun usa `bun x --bun`, no `bunx`: el `bunx` del plugin de asdf es un script `bun x $@` sin comillas que parte los argumentos con espacios.
37
37
  - `toolCommandText(runner, pkg, version, args)`: el mismo comando como texto para mostrar o poner en un script.
38
38
  - `writeScripts(root, runner, scripts, owned)`: escribe los scripts de `package.json` que le pertenecen a la herramienta.
39
39
  - `checkRunner(root)`: revisa que el runner del archivo esté disponible.
package/dist/checks.js CHANGED
@@ -22,7 +22,7 @@ export function checkRunner(root) {
22
22
  if (result.config === null)
23
23
  return [check("warn", `${RUNNER_FILE} is missing`)];
24
24
  const runner = effectiveRunner(result.config);
25
- const exe = runner === "bun" ? "bunx" : "npx";
25
+ const exe = runner === "bun" ? "bun" : "npx";
26
26
  if (runnerAvailable(runner))
27
27
  return [check("ok", `runner "${runner}" (${exe} is available)`)];
28
28
  const install = runner === "bun" ? "Bun" : "Node.js (npx)";
package/dist/choose.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { Runner } from "./config.js";
2
2
  export declare const NO_BUN_WARNING = "Bun is not installed: the tools will run with Node (npx). Install Bun and set \"runner\": \"bun\" in .agents/runner.json to change it.";
3
- /** Whether the executable behind a runner (`bunx` or `npx`) is installed and runs. */
3
+ /** Whether the executable behind a runner (`bun` or `npx`) is installed and runs. */
4
4
  export declare function runnerAvailable(runner: Runner): boolean;
5
5
  /**
6
6
  * The runner for a new file: Bun when installed. Without Bun, `ask` decides
package/dist/choose.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { spawnSync } from "node:child_process";
2
2
  export const NO_BUN_WARNING = 'Bun is not installed: the tools will run with Node (npx). Install Bun and set "runner": "bun" in .agents/runner.json to change it.';
3
- /** Whether the executable behind a runner (`bunx` or `npx`) is installed and runs. */
3
+ /** Whether the executable behind a runner (`bun` or `npx`) is installed and runs. */
4
4
  export function runnerAvailable(runner) {
5
- const result = spawnSync(runner === "bun" ? "bunx" : "npx", ["--version"], {
5
+ const result = spawnSync(runner === "bun" ? "bun" : "npx", ["--version"], {
6
6
  stdio: "ignore",
7
7
  timeout: 15_000,
8
8
  });
package/dist/command.d.ts CHANGED
@@ -1,7 +1,9 @@
1
1
  import type { Runner } from "./config.js";
2
2
  /**
3
3
  * The executable and arguments that run a pinned tool with the given runner:
4
- * `bunx --bun pkg@version ...` or `npx --yes pkg@version ...`.
4
+ * `bun x --bun pkg@version ...` or `npx --yes pkg@version ...`.
5
+ * Uses `bun x` rather than `bunx`: some installs (asdf's Bun plugin) ship
6
+ * `bunx` as an unquoted `bun x $@` shell script that splits arguments.
5
7
  * Does not validate `pkg` or `version`.
6
8
  */
7
9
  export declare function toolCommand(runner: Runner, pkg: string, version: string, args?: string[]): {
package/dist/command.js CHANGED
@@ -7,13 +7,15 @@ function shellQuote(argument) {
7
7
  }
8
8
  /**
9
9
  * The executable and arguments that run a pinned tool with the given runner:
10
- * `bunx --bun pkg@version ...` or `npx --yes pkg@version ...`.
10
+ * `bun x --bun pkg@version ...` or `npx --yes pkg@version ...`.
11
+ * Uses `bun x` rather than `bunx`: some installs (asdf's Bun plugin) ship
12
+ * `bunx` as an unquoted `bun x $@` shell script that splits arguments.
11
13
  * Does not validate `pkg` or `version`.
12
14
  */
13
15
  export function toolCommand(runner, pkg, version, args = []) {
14
16
  const spec = `${pkg}@${version}`;
15
17
  return runner === "bun"
16
- ? { file: "bunx", args: ["--bun", spec, ...args] }
18
+ ? { file: "bun", args: ["x", "--bun", spec, ...args] }
17
19
  : { file: "npx", args: ["--yes", spec, ...args] };
18
20
  }
19
21
  /** The same command as one line a POSIX shell parses back into the same arguments. */
package/dist/config.d.ts CHANGED
@@ -5,7 +5,7 @@ export interface RunnerConfig {
5
5
  tools: Record<string, string>;
6
6
  extra: Record<string, unknown>;
7
7
  }
8
- export declare const SCHEMA_URL = "https://cdn.jsdelivr.net/npm/@ramon-sg/runner@1.0.0/runner.schema.json";
8
+ export declare const SCHEMA_URL = "https://cdn.jsdelivr.net/npm/@ramon-sg/runner@1.0.1/runner.schema.json";
9
9
  /** An exact semver version: release plus an optional prerelease, no build metadata. */
10
10
  export declare const SEMVER: RegExp;
11
11
  export declare const PACKAGE_NAME: RegExp;
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "1.0.0";
1
+ export declare const VERSION = "1.0.1";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = "1.0.0";
1
+ export const VERSION = "1.0.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ramon-sg/runner",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Lee `.agents/runner.json` y arma el comando para correr cada herramienta con Bun o Node",
5
5
  "license": "MIT",
6
6
  "type": "module",