@stacksjs/cli 0.45.0 → 0.45.2

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
@@ -51,7 +51,7 @@ async function install() {
51
51
  try {
52
52
  const spin = spinner('Running...').start()
53
53
  setTimeout(() => {
54
- spin.text = italic('This may take a little while...')
54
+ spin.text = italic('This may take a few moments...')
55
55
  }, 5000)
56
56
  await spawn('pnpm install')
57
57
  spin.stop()
@@ -1,5 +1,6 @@
1
1
  import type { CliOptions, CommandResult, Result } from '@stacksjs/types';
2
2
  import type { Err } from '@stacksjs/error-handling';
3
+ import { ResultAsync } from '@stacksjs/error-handling';
3
4
  /**
4
5
  * Execute a command.
5
6
  *
@@ -8,7 +9,7 @@ import type { Err } from '@stacksjs/error-handling';
8
9
  * @param errorMsg The name of the error to throw if the command fails.
9
10
  * @returns The result of the command.
10
11
  */
11
- export declare function exec(command: string, options?: CliOptions): any;
12
+ export declare function exec(command: string, options?: CliOptions): ResultAsync<CommandResult<string>, Error>;
12
13
  /**
13
14
  * Run a command the Stacks way.
14
15
  *
@@ -16,7 +17,7 @@ export declare function exec(command: string, options?: CliOptions): any;
16
17
  * @param options The options to pass to the command.
17
18
  * @returns The result of the command.
18
19
  */
19
- export declare function runCommand(command: string, options?: CliOptions): Promise<any>;
20
+ export declare function runCommand(command: string, options?: CliOptions): Promise<Result<CommandResult<string>, Error>>;
20
21
  /**
21
22
  * Run many commands—the Stacks way.
22
23
  *
@@ -3,7 +3,7 @@ import { ResultAsync, err } from "@stacksjs/error-handling";
3
3
  import { projectPath } from "@stacksjs/path";
4
4
  import { italic } from "@stacksjs/cli";
5
5
  import { spawn } from "../command.mjs";
6
- import { startAnimation } from "../helpers.mjs";
6
+ import { startSpinner } from "../helpers.mjs";
7
7
  export function exec(command, options) {
8
8
  const cwd = options?.cwd || projectPath();
9
9
  const stdio = determineDebugMode(options) ? "inherit" : "ignore";
@@ -41,6 +41,6 @@ export async function runCommands(commands, options) {
41
41
  }
42
42
  function determineSpinner(options) {
43
43
  if (!determineDebugMode(options))
44
- return startAnimation();
44
+ return startSpinner(options?.spinnerText);
45
45
  return void 0;
46
46
  }
package/dist/helpers.d.ts CHANGED
@@ -7,4 +7,4 @@ export declare function intro(command: string, options?: IntroOptions): number |
7
7
  * Prints the outro message.
8
8
  */
9
9
  export declare function outro(text: string, options: OutroOptions, error?: Error | string): void;
10
- export declare function startAnimation(): import("ora").Ora;
10
+ export declare function startSpinner(text?: string): import("ora").Ora;
package/dist/helpers.mjs CHANGED
@@ -30,13 +30,15 @@ export function outro(text, options, error) {
30
30
  log.success(green(`Done in ${time}${options.useSeconds ? "s" : "ms"}`));
31
31
  }
32
32
  }
33
- export function startAnimation() {
33
+ export function startSpinner(text) {
34
+ if (!text)
35
+ text = "Executing...";
34
36
  const spin = spinner({
35
- text: "Executing..."
37
+ text
36
38
  }).start();
37
39
  setTimeout(() => {
38
- spin.text = italic("This may take a little while...");
40
+ spin.text = italic("This may take a few moments...");
39
41
  spin.spinner = "clock";
40
- }, 5e3);
42
+ }, 7500);
41
43
  return spin;
42
44
  }
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@stacksjs/cli",
3
3
  "type": "module",
4
- "version": "0.45.0",
5
- "packageManager": "pnpm@7.18.2",
4
+ "version": "0.45.2",
5
+ "packageManager": "pnpm@7.19.0",
6
6
  "description": "The simple way to create beautiful CLIs.",
7
7
  "author": "Chris Breuer",
8
8
  "license": "MIT",
@@ -41,7 +41,7 @@
41
41
  ],
42
42
  "engines": {
43
43
  "node": ">=v18.12.1",
44
- "pnpm": ">=7.18.2"
44
+ "pnpm": ">=7.19.0"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "@antfu/install-pkg": "^0.1.1",
@@ -49,16 +49,16 @@
49
49
  "execa": "^6.1.0",
50
50
  "ora": "^6.1.2",
51
51
  "prompts": "^2.4.2",
52
- "@stacksjs/config": "0.45.0",
53
- "@stacksjs/error-handling": "0.45.0",
54
- "@stacksjs/logging": "0.45.0",
55
- "@stacksjs/path": "0.45.0",
56
- "@stacksjs/types": "0.45.0"
52
+ "@stacksjs/config": "0.45.2",
53
+ "@stacksjs/error-handling": "0.45.2",
54
+ "@stacksjs/logging": "0.45.2",
55
+ "@stacksjs/path": "0.45.2",
56
+ "@stacksjs/types": "0.45.2"
57
57
  },
58
58
  "devDependencies": {
59
59
  "esno": "^0.16.3",
60
60
  "mkdist": "^1.0.0",
61
- "@stacksjs/testing": "0.45.0"
61
+ "@stacksjs/testing": "0.45.2"
62
62
  },
63
63
  "scripts": {
64
64
  "build": "mkdist -d",