@initx-plugin/utils 0.0.5 → 0.0.7

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/index.d.mts CHANGED
@@ -1,3 +1,7 @@
1
+ import * as execa from 'execa';
2
+
3
+ declare function c(command: string, options?: string[]): Promise<execa.Result<{}> | undefined>;
4
+
1
5
  declare const log: {
2
6
  success: (msg: string) => void;
3
7
  info: (msg: string) => void;
@@ -5,4 +9,4 @@ declare const log: {
5
9
  error: (msg: string) => void;
6
10
  };
7
11
 
8
- export { log };
12
+ export { c, log };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,7 @@
1
+ import * as execa from 'execa';
2
+
3
+ declare function c(command: string, options?: string[]): Promise<execa.Result<{}> | undefined>;
4
+
1
5
  declare const log: {
2
6
  success: (msg: string) => void;
3
7
  info: (msg: string) => void;
@@ -5,4 +9,4 @@ declare const log: {
5
9
  error: (msg: string) => void;
6
10
  };
7
11
 
8
- export { log };
12
+ export { c, log };
package/dist/index.mjs CHANGED
@@ -1,10 +1,18 @@
1
- import c from 'picocolors';
1
+ import { execa } from 'execa';
2
+ import c$1 from 'picocolors';
3
+
4
+ async function c(command, options) {
5
+ try {
6
+ return await execa(command, options);
7
+ } catch (e) {
8
+ }
9
+ }
2
10
 
3
11
  const log = {
4
- success: (msg) => console.log(`${c.bgGreen(c.black(" SUCCESS "))} ${msg}`),
5
- info: (msg) => console.log(`${c.bgBlue(c.white(" INFO "))} ${msg}`),
6
- warn: (msg) => console.log(`${c.bgYellow(c.black(" WARN "))} ${msg}`),
7
- error: (msg) => console.log(`${c.bgRed(c.white(" ERROR "))} ${msg}`)
12
+ success: (msg) => console.log(`${c$1.bgGreen(c$1.black(" SUCCESS "))} ${msg}`),
13
+ info: (msg) => console.log(`${c$1.bgBlue(c$1.white(" INFO "))} ${msg}`),
14
+ warn: (msg) => console.log(`${c$1.bgYellow(c$1.black(" WARN "))} ${msg}`),
15
+ error: (msg) => console.log(`${c$1.bgRed(c$1.white(" ERROR "))} ${msg}`)
8
16
  };
9
17
 
10
- export { log };
18
+ export { c, log };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@initx-plugin/utils",
3
3
  "type": "module",
4
- "version": "0.0.5",
4
+ "version": "0.0.7",
5
5
  "description": "More convenient initialization tool",
6
6
  "author": "imba97",
7
7
  "license": "MIT",
@@ -23,6 +23,7 @@
23
23
  "dist"
24
24
  ],
25
25
  "dependencies": {
26
+ "execa": "^9.4.1",
26
27
  "picocolors": "^1.1.1"
27
28
  },
28
29
  "scripts": {