@vlandoss/run-run 0.1.5-git-5823ad3.0 → 0.2.0

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/dist/main.mjs CHANGED
@@ -255,6 +255,7 @@ var ToolService = class {
255
255
  });
256
256
  });
257
257
  #run(shell, args) {
258
+ if (!args) return shell.$`${this.#bin}`;
258
259
  return shell.$`${this.#bin} ${typeof args === "string" ? args : args.join(" ")}`;
259
260
  }
260
261
  #getPreferLocal() {
@@ -283,6 +284,9 @@ var TsdownService = class extends ToolService {
283
284
  shellService
284
285
  });
285
286
  }
287
+ async buildLib() {
288
+ await this.exec();
289
+ }
286
290
  };
287
291
  //#endregion
288
292
  //#region src/program/commands/doctor.ts
@@ -304,9 +308,9 @@ function createDoctorSubcommand(service) {
304
308
  //#region src/program/commands/build-lib.ts
305
309
  function createBuildLibCommand(ctx) {
306
310
  const tsdownService = new TsdownService(ctx.shell);
307
- return createCommand("build:lib").summary(`build a ts library 🏗️ (${TOOL_LABELS.TSDOWN})`).description("Compiles TypeScript code into JavaScript and generates type declaration files, making it ready for distribution.").addCommand(createDoctorSubcommand(tsdownService)).action(async function buildAction() {
308
- await ctx.shell.$`tsdown`;
309
- }).addHelpText("afterAll", `\nUnder the hood, this command uses the ${TOOL_LABELS.TSDOWN} CLI to build the project.`);
311
+ return createCommand("build:lib").summary(`build a ts library 🏗️ (${tsdownService.ui})`).description("Compiles TypeScript code into JavaScript and generates type declaration files, making it ready for distribution.").addCommand(createDoctorSubcommand(tsdownService)).action(async function buildAction() {
312
+ await tsdownService.buildLib();
313
+ }).addHelpText("afterAll", `\nUnder the hood, this command uses the ${tsdownService.ui} CLI to build the project.`);
310
314
  }
311
315
  //#endregion
312
316
  //#region src/program/commands/clean.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vlandoss/run-run",
3
- "version": "0.1.5-git-5823ad3.0",
3
+ "version": "0.2.0",
4
4
  "description": "The CLI toolbox to fullstack common scripts in Variable Land",
5
5
  "homepage": "https://github.com/variableland/dx/tree/main/packages/run-run#readme",
6
6
  "bugs": {
@@ -58,8 +58,8 @@
58
58
  "rimraf": "6.1.3",
59
59
  "tsdown": "0.21.10",
60
60
  "typescript": "6.0.3",
61
- "@vlandoss/clibuddy": "0.1.2-git-5823ad3.0",
62
- "@vlandoss/loggy": "0.1.1"
61
+ "@vlandoss/loggy": "0.1.1",
62
+ "@vlandoss/clibuddy": "0.2.0"
63
63
  },
64
64
  "publishConfig": {
65
65
  "access": "public"
@@ -1,5 +1,4 @@
1
1
  import { createCommand } from "commander";
2
- import { TOOL_LABELS } from "#src/program/ui.ts";
3
2
  import type { Context } from "#src/services/ctx.ts";
4
3
  import { TsdownService } from "#src/services/tsdown.ts";
5
4
  import { createDoctorSubcommand } from "./doctor.ts";
@@ -8,13 +7,13 @@ export function createBuildLibCommand(ctx: Context) {
8
7
  const tsdownService = new TsdownService(ctx.shell);
9
8
 
10
9
  return createCommand("build:lib")
11
- .summary(`build a ts library 🏗️ (${TOOL_LABELS.TSDOWN})`)
10
+ .summary(`build a ts library 🏗️ (${tsdownService.ui})`)
12
11
  .description(
13
12
  "Compiles TypeScript code into JavaScript and generates type declaration files, making it ready for distribution.",
14
13
  )
15
14
  .addCommand(createDoctorSubcommand(tsdownService))
16
15
  .action(async function buildAction() {
17
- await ctx.shell.$`tsdown`;
16
+ await tsdownService.buildLib();
18
17
  })
19
- .addHelpText("afterAll", `\nUnder the hood, this command uses the ${TOOL_LABELS.TSDOWN} CLI to build the project.`);
18
+ .addHelpText("afterAll", `\nUnder the hood, this command uses the ${tsdownService.ui} CLI to build the project.`);
20
19
  }
@@ -23,7 +23,7 @@ export abstract class ToolService {
23
23
 
24
24
  getBinDir?(): string;
25
25
 
26
- async exec(args: string | string[]) {
26
+ async exec(args?: string | string[]) {
27
27
  const shell = this.#shell();
28
28
  return this.#run(shell, args);
29
29
  }
@@ -46,7 +46,11 @@ export abstract class ToolService {
46
46
  });
47
47
  });
48
48
 
49
- #run(shell: ShellService, args: string | string[]) {
49
+ #run(shell: ShellService, args?: string | string[]) {
50
+ if (!args) {
51
+ return shell.$`${this.#bin}`;
52
+ }
53
+
50
54
  return shell.$`${this.#bin} ${typeof args === "string" ? args : args.join(" ")}`;
51
55
  }
52
56
 
@@ -6,4 +6,8 @@ export class TsdownService extends ToolService {
6
6
  constructor(shellService: ShellService) {
7
7
  super({ bin: "tsdown", ui: TOOL_LABELS.TSDOWN, shellService });
8
8
  }
9
+
10
+ async buildLib() {
11
+ await this.exec();
12
+ }
9
13
  }