@simon_he/pi 0.0.7 → 0.0.8

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,49 +1,51 @@
1
1
  <span ><p align="center">![kv](/assets/pi.png)</p></span>
2
+ <p align="center"> English | <a href="./README_zh.md">简体中文</a></p>
3
+ <p align="center"><a href="https://www.npmjs.com/package/@simon_he/pi"><img src="https://img.shields.io/npm/v/@simon_he/pi?color=3fb883&amp;label=" alt="NPM version"></a>
2
4
 
3
- ## PI
4
- 一个带有自定义loading样式的smart包管理器,让你安装依赖时更加美观:)
5
+ ## :lollipop: PI
6
+ A smart package manager with a custom loading style, which makes you install dependencies more beautifully :)
5
7
 
6
- ## 聪明的包管理器
7
- - 支持 go mod 的依赖安装、卸载、执行和打包
8
- - 支持 Cargo 的依赖安装、卸载、执行和打包
9
- - 支持 npm 的依赖安装、卸载和执行
10
- - 支持 pnpm 的依赖安装、卸载和执行
11
- - 支持 yarn 的依赖安装、卸载和执行
8
+ ## :rocket: Smart package manager
9
+ - Supports dependency installation, uninstallation, execution and packaging of go mod
10
+ - Supports Cargo's dependency installation, uninstallation, execution and packaging
11
+ - Support npm dependency installation, uninstallation and execution
12
+ - Support pnpm dependency installation, uninstallation and execution
13
+ - Support yarn dependency installation, uninstallation and execution
12
14
 
13
15
 
14
16
  https://user-images.githubusercontent.com/57086651/203143603-9e78f686-399e-4c3d-ae53-56638501b276.mov
15
17
 
16
18
 
17
- ## 安装
19
+ ## :gear: Install
18
20
  ```
19
21
  npm i -g @simon_he/pi
20
22
  ```
21
23
 
22
- ## 使用
24
+ ## :open_hands: Usage
23
25
  ```
24
- # 根据当前目录的环境去分析使用哪种包管理器,go、rust、pnpm、yarn、npm
25
- # 安装依赖
26
+ # According to the environment of the current directory to analyze which package manager to use,go、rust、pnpm、yarn、npm
27
+ # Install dependencies
26
28
  pi xxx
27
- # 卸载依赖
29
+ # Uninstall dependencies
28
30
  pui xxx
29
- # 执行命令
31
+ # Execute command
30
32
  prun
31
- # 初始化
33
+ # Initialization
32
34
  pinit
33
- # 打包 - 针对cargo go
35
+ # build - for cargo, go
34
36
  pbuild
35
37
  ```
36
38
 
37
- ## 自定义配置
38
- 可以在.zshrc配置loading样式,如下:
39
+ ## :bulb: Custom configuration
40
+ You can configure the loading style in .zshrc, as follows:
39
41
  ```
40
- export PI_COLOR=red # loading样式颜色
41
- export PI_SPINNER=star # loading样式
42
+ export PI_COLOR=red # loadingstyle color
43
+ export PI_SPINNER=star # loadingstyle
42
44
  ```
43
- - 样式的种类70+,来源于[cli-spinners](https://jsfiddle.net/sindresorhus/2eLtsbey/embedded/result/),可自行选择将名字填入PI_SPINNER中。
44
- - 颜色可选值:'black' | 'red' | 'green' | 'yellow' | 'blue' | 'magenta' | 'cyan' | 'white' | 'gray', 填入PI_COLOR
45
+ - 70+ types of styles, from[cli-spinners](https://jsfiddle.net/sindresorhus/2eLtsbey/embedded/result/),You can choose to fill in the name in PI_SPINNER.
46
+ - Color options: 'black' | 'red' | 'green' | 'yellow' | 'blue' | 'magenta' | 'cyan' | 'white' | 'gray', Fill in PI_COLOR.
45
47
 
46
- ## 依赖
48
+ ## :battery: Dependency
47
49
  - [@antfu/ni](https://github.com/antfu/ni)
48
50
  - [ora](https://github.com/sindresorhus/ora)
49
51
  - [ccommand](https://github.com/Simon-He95/ccommand)
package/dist/index.cjs CHANGED
@@ -14,16 +14,16 @@ const path__default = /*#__PURE__*/_interopDefaultLegacy(path);
14
14
  const process__default = /*#__PURE__*/_interopDefaultLegacy(process);
15
15
  const ora__default = /*#__PURE__*/_interopDefaultLegacy(ora);
16
16
 
17
- const version = "0.0.7";
17
+ const version = "0.0.8";
18
18
 
19
19
  const __filename$1 = url$1.fileURLToPath((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('index.cjs', document.baseURI).href)));
20
20
  const __dirname$1 = path__default.dirname(__filename$1);
21
21
  const url = path__default.resolve(__dirname$1, "./seprateThread.mjs");
22
22
  async function pi(params, pkg) {
23
23
  const text = pkg ? `Installing ${pkg} ...
24
- ` : "\u6B63\u5728\u66F4\u65B0\u4F9D\u8D56...\n";
25
- const successMsg = pkg ? `Installed ${pkg} successfully! \u{1F60A}` : "\u66F4\u65B0\u4F9D\u8D56\u6210\u529F! \u{1F60A}";
26
- const failMsg = pkg ? `Failed to install ${pkg} , v\u621150 \u{1F62D}` : "\u66F4\u65B0\u4F9D\u8D56\u5931\u8D25! \u{1F62D}";
24
+ ` : "Updating dependency ...\n";
25
+ const successMsg = pkg ? `Installed ${pkg} successfully! \u{1F60A}` : "Updated dependency successfully! \u{1F60A}";
26
+ const failMsg = pkg ? `Failed to install ${pkg} \u{1F62D}` : "Failed to update dependency! \u{1F62D}";
27
27
  const loading_status = await loading(text);
28
28
  const { status } = await simonJsTool.useNodeWorker(url, `ni ${params}`);
29
29
  if (status === 0)
@@ -38,7 +38,7 @@ async function pui(params, pkg) {
38
38
  const successMsg = `unInstalled ${pkg} successfully! \u{1F60A}`;
39
39
  const failMsg = `Failed to uninstall ${pkg} \u{1F62D}`;
40
40
  if (!pkg) {
41
- console.log("\u8BF7\u8F93\u5165\u8981\u5378\u8F7D\u7684\u5305\u540D");
41
+ console.log("Need to specify an uninstall package name");
42
42
  process__default.exit(1);
43
43
  }
44
44
  const loading_status = await loading(text);
@@ -53,7 +53,7 @@ function prun(params) {
53
53
  simonJsTool.jsShell(`ccommand ${params}`);
54
54
  }
55
55
  function pinit() {
56
- console.log("\u6B63\u5728\u521D\u59CB\u5316\u9879\u76EE...");
56
+ console.log("Initializing project...");
57
57
  switch (simonJsTool.getPkgTool()) {
58
58
  case "npm":
59
59
  simonJsTool.jsShell("npm init -y");
@@ -89,7 +89,7 @@ async function installDeps() {
89
89
  function returnVersion(argv) {
90
90
  const arg = argv[0];
91
91
  if (arg === "-v" || arg === "--version") {
92
- simonJsTool.jsShell(`gum style --foreground 212 --border-foreground 212 --border double --align center --width 50 --margin "1 2" --padding "2 4" 'pi version:${version}' '\u8BF7\u4E3A\u6211\u7684\u52AA\u529B\u70B9\u4E2Astar\u{1F31F}'`);
92
+ simonJsTool.jsShell(`gum style --foreground 212 --border-foreground 212 --border double --align center --width 50 --margin "1 2" --padding "2 4" 'pi version:${version}' 'Please give me a \u{1F31F} for my efforts'`);
93
93
  process__default.exit(0);
94
94
  } else if (arg === "-h" || arg === "--help") {
95
95
  simonJsTool.jsShell(`gum style --foreground 212 --border-foreground 212 --border double --align center --width 50 --margin "1 2" --padding "1 1" 'PI Commands:' 'pi: install package' 'pui: uninstall package' 'prun: run package script' 'pinit: package init' 'pbuild: go build | cargo build'`);
@@ -150,7 +150,7 @@ async function runner() {
150
150
  } else if (exec === "pbuild") {
151
151
  simonJsTool.jsShell(`go build ${params}`);
152
152
  } else {
153
- console.log("go mod \u9879\u76EE\u6682\u4E0D\u652F\u6301\u5176\u4ED6\u547D\u4EE4");
153
+ console.log("The commands is not supported");
154
154
  }
155
155
  process__default.exit();
156
156
  }
@@ -178,12 +178,12 @@ async function runner() {
178
178
  } else if (exec === "pbuild") {
179
179
  simonJsTool.jsShell(`cargo build ${params}`);
180
180
  } else {
181
- console.log("Cargo \u9879\u76EE\u6682\u4E0D\u652F\u6301\u5176\u4ED6\u547D\u4EE4");
181
+ console.log("The commands is not supported");
182
182
  }
183
183
  process__default.exit();
184
184
  }
185
185
  if (!runMap[exec]) {
186
- console.log("\u547D\u4EE4\u4E0D\u5B58\u5728,\u8BF7\u6267\u884Cpi -h\u67E5\u770B\u5E2E\u52A9");
186
+ console.log("The command does not exist, please execute pi -h to view the help");
187
187
  return;
188
188
  }
189
189
  const pkg = argv.filter((v) => !v.startsWith("-")).join(" ");
package/dist/index.mjs CHANGED
@@ -4,16 +4,16 @@ import { fileURLToPath } from 'url';
4
4
  import { useNodeWorker, jsShell, getPkgTool } from 'simon-js-tool';
5
5
  import ora from 'ora';
6
6
 
7
- const version = "0.0.7";
7
+ const version = "0.0.8";
8
8
 
9
9
  const __filename = fileURLToPath(import.meta.url);
10
10
  const __dirname = path.dirname(__filename);
11
11
  const url = path.resolve(__dirname, "./seprateThread.mjs");
12
12
  async function pi(params, pkg) {
13
13
  const text = pkg ? `Installing ${pkg} ...
14
- ` : "\u6B63\u5728\u66F4\u65B0\u4F9D\u8D56...\n";
15
- const successMsg = pkg ? `Installed ${pkg} successfully! \u{1F60A}` : "\u66F4\u65B0\u4F9D\u8D56\u6210\u529F! \u{1F60A}";
16
- const failMsg = pkg ? `Failed to install ${pkg} , v\u621150 \u{1F62D}` : "\u66F4\u65B0\u4F9D\u8D56\u5931\u8D25! \u{1F62D}";
14
+ ` : "Updating dependency ...\n";
15
+ const successMsg = pkg ? `Installed ${pkg} successfully! \u{1F60A}` : "Updated dependency successfully! \u{1F60A}";
16
+ const failMsg = pkg ? `Failed to install ${pkg} \u{1F62D}` : "Failed to update dependency! \u{1F62D}";
17
17
  const loading_status = await loading(text);
18
18
  const { status } = await useNodeWorker(url, `ni ${params}`);
19
19
  if (status === 0)
@@ -28,7 +28,7 @@ async function pui(params, pkg) {
28
28
  const successMsg = `unInstalled ${pkg} successfully! \u{1F60A}`;
29
29
  const failMsg = `Failed to uninstall ${pkg} \u{1F62D}`;
30
30
  if (!pkg) {
31
- console.log("\u8BF7\u8F93\u5165\u8981\u5378\u8F7D\u7684\u5305\u540D");
31
+ console.log("Need to specify an uninstall package name");
32
32
  process.exit(1);
33
33
  }
34
34
  const loading_status = await loading(text);
@@ -43,7 +43,7 @@ function prun(params) {
43
43
  jsShell(`ccommand ${params}`);
44
44
  }
45
45
  function pinit() {
46
- console.log("\u6B63\u5728\u521D\u59CB\u5316\u9879\u76EE...");
46
+ console.log("Initializing project...");
47
47
  switch (getPkgTool()) {
48
48
  case "npm":
49
49
  jsShell("npm init -y");
@@ -79,7 +79,7 @@ async function installDeps() {
79
79
  function returnVersion(argv) {
80
80
  const arg = argv[0];
81
81
  if (arg === "-v" || arg === "--version") {
82
- jsShell(`gum style --foreground 212 --border-foreground 212 --border double --align center --width 50 --margin "1 2" --padding "2 4" 'pi version:${version}' '\u8BF7\u4E3A\u6211\u7684\u52AA\u529B\u70B9\u4E2Astar\u{1F31F}'`);
82
+ jsShell(`gum style --foreground 212 --border-foreground 212 --border double --align center --width 50 --margin "1 2" --padding "2 4" 'pi version:${version}' 'Please give me a \u{1F31F} for my efforts'`);
83
83
  process.exit(0);
84
84
  } else if (arg === "-h" || arg === "--help") {
85
85
  jsShell(`gum style --foreground 212 --border-foreground 212 --border double --align center --width 50 --margin "1 2" --padding "1 1" 'PI Commands:' 'pi: install package' 'pui: uninstall package' 'prun: run package script' 'pinit: package init' 'pbuild: go build | cargo build'`);
@@ -140,7 +140,7 @@ async function runner() {
140
140
  } else if (exec === "pbuild") {
141
141
  jsShell(`go build ${params}`);
142
142
  } else {
143
- console.log("go mod \u9879\u76EE\u6682\u4E0D\u652F\u6301\u5176\u4ED6\u547D\u4EE4");
143
+ console.log("The commands is not supported");
144
144
  }
145
145
  process.exit();
146
146
  }
@@ -168,12 +168,12 @@ async function runner() {
168
168
  } else if (exec === "pbuild") {
169
169
  jsShell(`cargo build ${params}`);
170
170
  } else {
171
- console.log("Cargo \u9879\u76EE\u6682\u4E0D\u652F\u6301\u5176\u4ED6\u547D\u4EE4");
171
+ console.log("The commands is not supported");
172
172
  }
173
173
  process.exit();
174
174
  }
175
175
  if (!runMap[exec]) {
176
- console.log("\u547D\u4EE4\u4E0D\u5B58\u5728,\u8BF7\u6267\u884Cpi -h\u67E5\u770B\u5E2E\u52A9");
176
+ console.log("The command does not exist, please execute pi -h to view the help");
177
177
  return;
178
178
  }
179
179
  const pkg = argv.filter((v) => !v.startsWith("-")).join(" ");
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@simon_he/pi",
3
3
  "type": "module",
4
- "version": "0.0.7",
4
+ "version": "0.0.8",
5
5
  "packageManager": "pnpm@7.2.1",
6
6
  "description": "",
7
7
  "author": "Simon He",