@simon_he/pi 0.0.82 → 0.0.84

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.cjs CHANGED
@@ -5658,7 +5658,7 @@ __export(src_exports, {
5658
5658
  module.exports = __toCommonJS(src_exports);
5659
5659
  var import_process4 = __toESM(require("process"), 1);
5660
5660
  var import_lazy_js_utils14 = require("lazy-js-utils");
5661
- var import_picocolors7 = __toESM(require_picocolors(), 1);
5661
+ var import_picocolors8 = __toESM(require_picocolors(), 1);
5662
5662
  var import_fast_glob = __toESM(require("fast-glob"), 1);
5663
5663
  var import_ccommand2 = require("ccommand");
5664
5664
 
@@ -6751,7 +6751,7 @@ function getLatestVersion(pkg, isZh6 = true) {
6751
6751
  var import_lazy_js_utils2 = require("lazy-js-utils");
6752
6752
 
6753
6753
  // package.json
6754
- var version = "0.0.82";
6754
+ var version = "0.0.84";
6755
6755
 
6756
6756
  // src/help.ts
6757
6757
  var isZh2 = process.env.PI_Lang === "zh";
@@ -6808,17 +6808,27 @@ async function installDeps() {
6808
6808
  // src/pi.ts
6809
6809
  var import_process2 = __toESM(require("process"), 1);
6810
6810
  var import_lazy_js_utils5 = require("lazy-js-utils");
6811
- var import_picocolors3 = __toESM(require_picocolors(), 1);
6811
+ var import_picocolors4 = __toESM(require_picocolors(), 1);
6812
6812
 
6813
6813
  // src/detectNode.ts
6814
6814
  var import_process = __toESM(require("process"), 1);
6815
6815
  var import_lazy_js_utils4 = require("lazy-js-utils");
6816
- var semver = require("semver");
6816
+ var import_picocolors3 = __toESM(require_picocolors(), 1);
6817
6817
  async function detectNode() {
6818
6818
  var _a;
6819
- const pkg = await (0, import_lazy_js_utils4.getPkg)();
6819
+ let pkg;
6820
+ try {
6821
+ pkg = await (0, import_lazy_js_utils4.getPkg)();
6822
+ } catch (e) {
6823
+ const cwd = import_process.default.cwd();
6824
+ console.log(import_picocolors3.default.red(`\u5F53\u524D\u76EE\u5F55: ${cwd} \u6CA1\u6709package.json\u6587\u4EF6`));
6825
+ import_process.default.exit(1);
6826
+ }
6820
6827
  if ((_a = pkg.engines) == null ? void 0 : _a.node) {
6821
- const isSafe = semver.satisfies(import_process.default.version, pkg.engines.node);
6828
+ const isSafe = require("semver").satisfies(
6829
+ import_process.default.version,
6830
+ pkg.engines.node
6831
+ );
6822
6832
  if (!isSafe) {
6823
6833
  const { result, status } = await (0, import_lazy_js_utils4.jsShell)(
6824
6834
  `echo "yes
@@ -6828,13 +6838,13 @@ no" | gum filter --placeholder=" \u5F53\u524Dnode\u7248\u672C\u4E0D\u6EE1\u8DB3
6828
6838
  if (status === 0 && result === "yes") {
6829
6839
  await (0, import_lazy_js_utils4.jsShell)(
6830
6840
  `
6831
- current=$(echo $(fnm current))
6832
- registery=$(echo "$(fnm ls)" | sed 's/system//g' | sed 's/default//g' | sed 's/* //g' | sed "s/$current/* $current/g" | gum filter --placeholder=" \u8BF7\u9009\u62E9\u4E00\u4E2Anode\u7248\u672C")
6833
- registery=$(echo \${registery// /} | sed 's/*//g')
6834
- if [ $registery ]; then
6835
- fnm use \${registery% -*}
6836
- fi
6837
- `,
6841
+ current=$(echo $(fnm current))
6842
+ registery=$(echo "$(fnm ls)" | sed 's/system//g' | sed 's/default//g' | sed 's/* //g' | sed "s/$current/* $current/g" | gum filter --placeholder=" \u8BF7\u9009\u62E9\u4E00\u4E2Anode\u7248\u672C")
6843
+ registery=$(echo \${registery// /} | sed 's/*//g')
6844
+ if [ $registery ]; then
6845
+ fnm use \${registery% -*}
6846
+ fi
6847
+ `,
6838
6848
  "pipe"
6839
6849
  );
6840
6850
  }
@@ -6845,6 +6855,7 @@ no" | gum filter --placeholder=" \u5F53\u524Dnode\u7248\u672C\u4E0D\u6EE1\u8DB3
6845
6855
  // src/pi.ts
6846
6856
  var isZh3 = import_process2.default.env.PI_Lang === "zh";
6847
6857
  async function pi(params, pkg, executor = "ni") {
6858
+ var _a;
6848
6859
  await detectNode();
6849
6860
  const text = pkg ? `Installing ${params} ...` : "Updating dependency ...";
6850
6861
  const isLatest = executor === "pil";
@@ -6884,15 +6895,16 @@ async function pi(params, pkg, executor = "ni") {
6884
6895
  loading_status = await loading("");
6885
6896
  const end = Date.now();
6886
6897
  const costTime = (end - start) / 1e3;
6887
- successMsg += import_picocolors3.default.blue(` ---- \u23F0\uFF1A${costTime}s`);
6898
+ successMsg += import_picocolors4.default.blue(` ---- \u23F0\uFF1A${costTime}s`);
6888
6899
  if (status === 0) {
6889
- loading_status.succeed(import_picocolors3.default.green(successMsg));
6900
+ loading_status.succeed(import_picocolors4.default.green(successMsg));
6890
6901
  } else if (result && result.includes("Not Found - 404")) {
6891
- const _result = isZh3 ? `${pkg} \u5305\u540D\u53EF\u80FD\u6709\u8BEF\uFF0C\u5E76\u4E0D\u80FD\u5728npm\u4E2D\u641C\u7D22\u5230\uFF0C\u8BF7\u68C0\u67E5` : `${pkg} the package name may be wrong, and cannot be found in npm, please check`;
6892
- loading_status.fail(import_picocolors3.default.red(result ? `${failMsg}
6902
+ const _pkg = (_a = result.match(/\/[^\/\:]+:/)) == null ? void 0 : _a[0].slice(1, -1);
6903
+ const _result = isZh3 ? `${_pkg} \u5305\u540D\u53EF\u80FD\u6709\u8BEF\u6216\u8005\u7248\u672C\u53F7\u4E0D\u5B58\u5728\uFF0C\u5E76\u4E0D\u80FD\u5728npm\u4E2D\u641C\u7D22\u5230\uFF0C\u8BF7\u68C0\u67E5` : `${_pkg} the package name may be wrong, and cannot be found in npm, please check`;
6904
+ loading_status.fail(import_picocolors4.default.red(result ? `${failMsg}
6893
6905
  ${_result}` : failMsg));
6894
6906
  } else {
6895
- loading_status.fail(import_picocolors3.default.red(result ? `${failMsg}
6907
+ loading_status.fail(import_picocolors4.default.red(result ? `${failMsg}
6896
6908
  ${result}` : failMsg));
6897
6909
  }
6898
6910
  if (result) {
@@ -6925,7 +6937,7 @@ function pfind(params) {
6925
6937
 
6926
6938
  // src/pil.ts
6927
6939
  var import_lazy_js_utils8 = require("lazy-js-utils");
6928
- var import_picocolors4 = __toESM(require_picocolors(), 1);
6940
+ var import_picocolors5 = __toESM(require_picocolors(), 1);
6929
6941
  async function pil(params) {
6930
6942
  const { dependencies = {}, devDependencies = {} } = await (0, import_lazy_js_utils8.getPkg)();
6931
6943
  if (!params) {
@@ -6942,7 +6954,7 @@ async function pil(params) {
6942
6954
  "pipe"
6943
6955
  );
6944
6956
  if (status === 130) {
6945
- console.log(import_picocolors4.default.dim("\u5DF2\u53D6\u6D88"));
6957
+ console.log(import_picocolors5.default.dim("\u5DF2\u53D6\u6D88"));
6946
6958
  process.exit(0);
6947
6959
  } else if (status !== 0) {
6948
6960
  throw new Error(choose);
@@ -7017,7 +7029,7 @@ function pu() {
7017
7029
 
7018
7030
  // src/pui.ts
7019
7031
  var import_lazy_js_utils12 = require("lazy-js-utils");
7020
- var import_picocolors5 = __toESM(require_picocolors(), 1);
7032
+ var import_picocolors6 = __toESM(require_picocolors(), 1);
7021
7033
  var isZh4 = process.env.PI_Lang === "zh";
7022
7034
  async function pui(params, pkg) {
7023
7035
  const text = `${isZh4 ? "\u6B63\u5728\u4E3A\u60A8\u5378\u8F7D" : "Uninstalling"} ${pkg} ...`;
@@ -7036,7 +7048,7 @@ async function pui(params, pkg) {
7036
7048
  "pipe"
7037
7049
  );
7038
7050
  if (status2 === 130) {
7039
- console.log(import_picocolors5.default.dim("\u5DF2\u53D6\u6D88"));
7051
+ console.log(import_picocolors6.default.dim("\u5DF2\u53D6\u6D88"));
7040
7052
  process.exit(0);
7041
7053
  } else if (status2 !== 0) {
7042
7054
  throw new Error(choose);
@@ -7048,7 +7060,7 @@ async function pui(params, pkg) {
7048
7060
  const failMsg = isZh4 ? `${pkg}\u5378\u8F7D\u5931\u8D25 \u{1F62D}` : `Failed to uninstall ${pkg} \u{1F62D}`;
7049
7061
  if (!pkg) {
7050
7062
  console.log(
7051
- import_picocolors5.default.yellow(
7063
+ import_picocolors6.default.yellow(
7052
7064
  isZh4 ? "\u9700\u8981\u6307\u5B9A\u8981\u5378\u8F7D\u7684\u5305\u540D\uFF01" : "Need to specify an uninstall package name!"
7053
7065
  )
7054
7066
  );
@@ -7058,11 +7070,11 @@ async function pui(params, pkg) {
7058
7070
  const { status, result } = await (0, import_lazy_js_utils12.useNodeWorker)(`nun ${params}`);
7059
7071
  const end = Date.now();
7060
7072
  const costTime = (end - start) / 1e3;
7061
- successMsg += import_picocolors5.default.blue(` ---- \u23F0\uFF1A${costTime}s`);
7073
+ successMsg += import_picocolors6.default.blue(` ---- \u23F0\uFF1A${costTime}s`);
7062
7074
  if (status === 0)
7063
- loading_status.succeed(import_picocolors5.default.green(successMsg));
7075
+ loading_status.succeed(import_picocolors6.default.green(successMsg));
7064
7076
  else
7065
- loading_status.fail(import_picocolors5.default.red(result ? `${failMsg}
7077
+ loading_status.fail(import_picocolors6.default.red(result ? `${failMsg}
7066
7078
  ${result}` : failMsg));
7067
7079
  process.exit();
7068
7080
  }
@@ -7070,7 +7082,7 @@ ${result}` : failMsg));
7070
7082
  // src/pio.ts
7071
7083
  var import_process3 = __toESM(require("process"), 1);
7072
7084
  var import_lazy_js_utils13 = require("lazy-js-utils");
7073
- var import_picocolors6 = __toESM(require_picocolors(), 1);
7085
+ var import_picocolors7 = __toESM(require_picocolors(), 1);
7074
7086
  async function pio(params, pkg, executor = "ni") {
7075
7087
  const successMsg = pkg ? `Installed ${pkg} successfully! \u{1F60A}` : "Updated dependency successfully! \u{1F60A}";
7076
7088
  const failMsg = pkg ? `Failed to install ${pkg} \u{1F62D}` : "Failed to update dependency! \u{1F62D}";
@@ -7082,9 +7094,9 @@ async function pio(params, pkg, executor = "ni") {
7082
7094
  });
7083
7095
  const loading_status = await loading("");
7084
7096
  if (status === 0)
7085
- loading_status.succeed(import_picocolors6.default.green(successMsg));
7097
+ loading_status.succeed(import_picocolors7.default.green(successMsg));
7086
7098
  else
7087
- loading_status.fail(import_picocolors6.default.red(result ? `${result}
7099
+ loading_status.fail(import_picocolors7.default.red(result ? `${result}
7088
7100
 
7089
7101
  ${failMsg}` : failMsg));
7090
7102
  import_process3.default.exit();
@@ -7129,11 +7141,11 @@ async function setup() {
7129
7141
  const { status } = params ? await (0, import_lazy_js_utils14.useNodeWorker)(`go get ${params}`) : await (0, import_lazy_js_utils14.useNodeWorker)("go mod tidy");
7130
7142
  if (status === 0) {
7131
7143
  loading_status.succeed(
7132
- import_picocolors7.default.green(isZh5 ? "\u5B89\u88C5\u6210\u529F! \u{1F60A}" : "Installed successfully! \u{1F60A}")
7144
+ import_picocolors8.default.green(isZh5 ? "\u5B89\u88C5\u6210\u529F! \u{1F60A}" : "Installed successfully! \u{1F60A}")
7133
7145
  );
7134
7146
  } else {
7135
7147
  loading_status.fail(
7136
- import_picocolors7.default.red(isZh5 ? "\u5B89\u88C5\u5931\u8D25 \u{1F62D}" : "Failed to install \u{1F62D}")
7148
+ import_picocolors8.default.red(isZh5 ? "\u5B89\u88C5\u5931\u8D25 \u{1F62D}" : "Failed to install \u{1F62D}")
7137
7149
  );
7138
7150
  }
7139
7151
  } else if (exec === "pui") {
@@ -7144,11 +7156,11 @@ async function setup() {
7144
7156
  const { status } = await (0, import_lazy_js_utils14.useNodeWorker)(`go clean ${params}`);
7145
7157
  if (status === 0) {
7146
7158
  loading_status.succeed(
7147
- import_picocolors7.default.green(isZh5 ? "\u5378\u8F7D\u6210\u529F! \u{1F60A}" : "Uninstalled successfully! \u{1F60A}")
7159
+ import_picocolors8.default.green(isZh5 ? "\u5378\u8F7D\u6210\u529F! \u{1F60A}" : "Uninstalled successfully! \u{1F60A}")
7148
7160
  );
7149
7161
  } else {
7150
7162
  loading_status.fail(
7151
- import_picocolors7.default.red(isZh5 ? "\u5378\u8F7D\u5931\u8D25 \u{1F62D}" : "Failed to uninstall \u{1F62D}")
7163
+ import_picocolors8.default.red(isZh5 ? "\u5378\u8F7D\u5931\u8D25 \u{1F62D}" : "Failed to uninstall \u{1F62D}")
7152
7164
  );
7153
7165
  }
7154
7166
  } else if (exec === "prun") {
@@ -7161,7 +7173,7 @@ async function setup() {
7161
7173
  (0, import_lazy_js_utils14.jsShell)(`go build ${params}`);
7162
7174
  } else {
7163
7175
  console.log(
7164
- import_picocolors7.default.red(
7176
+ import_picocolors8.default.red(
7165
7177
  isZh5 ? "\u5F53\u524D\u6307\u4EE4\u8FD8\u4E0D\u652F\u6301" : "The commands is not supported"
7166
7178
  )
7167
7179
  );
@@ -7177,11 +7189,11 @@ async function setup() {
7177
7189
  const { status } = await (0, import_lazy_js_utils14.useNodeWorker)(`cargo install ${params}`);
7178
7190
  if (status === 0) {
7179
7191
  loading_status.succeed(
7180
- import_picocolors7.default.green(isZh5 ? "\u5B89\u88C5\u6210\u529F! \u{1F60A}" : "Installed successfully! \u{1F60A}")
7192
+ import_picocolors8.default.green(isZh5 ? "\u5B89\u88C5\u6210\u529F! \u{1F60A}" : "Installed successfully! \u{1F60A}")
7181
7193
  );
7182
7194
  } else {
7183
7195
  loading_status.fail(
7184
- import_picocolors7.default.red(isZh5 ? "\u5B89\u88C5\u5931\u8D25 \u{1F62D}" : "Failed to install \u{1F62D}")
7196
+ import_picocolors8.default.red(isZh5 ? "\u5B89\u88C5\u5931\u8D25 \u{1F62D}" : "Failed to install \u{1F62D}")
7185
7197
  );
7186
7198
  }
7187
7199
  } else if (exec === "pui") {
@@ -7192,11 +7204,11 @@ async function setup() {
7192
7204
  const { status } = await (0, import_lazy_js_utils14.useNodeWorker)(`cargo uninstall ${params}`);
7193
7205
  if (status === 0) {
7194
7206
  loading_status.succeed(
7195
- import_picocolors7.default.green(isZh5 ? "\u5378\u8F7D\u6210\u529F! \u{1F60A}" : "Uninstalled successfully! \u{1F60A}")
7207
+ import_picocolors8.default.green(isZh5 ? "\u5378\u8F7D\u6210\u529F! \u{1F60A}" : "Uninstalled successfully! \u{1F60A}")
7196
7208
  );
7197
7209
  } else {
7198
7210
  loading_status.fail(
7199
- import_picocolors7.default.red(isZh5 ? "\u5378\u8F7D\u5931\u8D25 \u{1F62D}" : "Failed to uninstall \u{1F62D}")
7211
+ import_picocolors8.default.red(isZh5 ? "\u5378\u8F7D\u5931\u8D25 \u{1F62D}" : "Failed to uninstall \u{1F62D}")
7200
7212
  );
7201
7213
  }
7202
7214
  } else if (exec === "prun") {
@@ -7207,7 +7219,7 @@ async function setup() {
7207
7219
  (0, import_lazy_js_utils14.jsShell)(`cargo build ${params}`);
7208
7220
  } else {
7209
7221
  console.log(
7210
- import_picocolors7.default.red(
7222
+ import_picocolors8.default.red(
7211
7223
  isZh5 ? "\u5F53\u524D\u6307\u4EE4\u8FD8\u4E0D\u652F\u6301" : "The commands is not supported"
7212
7224
  )
7213
7225
  );
@@ -7216,7 +7228,7 @@ async function setup() {
7216
7228
  }
7217
7229
  if (!runMap[exec]) {
7218
7230
  console.log(
7219
- import_picocolors7.default.yellow(
7231
+ import_picocolors8.default.yellow(
7220
7232
  isZh5 ? "\u547D\u4EE4\u4E0D\u5B58\u5728\uFF0C\u8BF7\u6267\u884Cpi -h\u67E5\u770B\u5E2E\u52A9" : "The command does not exist, please execute pi -h to view the help"
7221
7233
  )
7222
7234
  );
package/dist/index.js CHANGED
@@ -5652,7 +5652,7 @@ var require_bl = __commonJS({
5652
5652
  });
5653
5653
 
5654
5654
  // src/index.ts
5655
- var import_picocolors7 = __toESM(require_picocolors(), 1);
5655
+ var import_picocolors8 = __toESM(require_picocolors(), 1);
5656
5656
  import process11 from "process";
5657
5657
  import {
5658
5658
  hasPkg,
@@ -6755,7 +6755,7 @@ function getLatestVersion(pkg, isZh6 = true) {
6755
6755
  import { jsShell as jsShell2 } from "lazy-js-utils";
6756
6756
 
6757
6757
  // package.json
6758
- var version = "0.0.82";
6758
+ var version = "0.0.84";
6759
6759
 
6760
6760
  // src/help.ts
6761
6761
  var isZh2 = process.env.PI_Lang === "zh";
@@ -6810,19 +6810,29 @@ async function installDeps() {
6810
6810
  }
6811
6811
 
6812
6812
  // src/pi.ts
6813
- var import_picocolors3 = __toESM(require_picocolors(), 1);
6813
+ var import_picocolors4 = __toESM(require_picocolors(), 1);
6814
6814
  import process9 from "process";
6815
6815
  import { getPkgTool as getPkgTool2, jsShell as jsShell5, useNodeWorker } from "lazy-js-utils";
6816
6816
 
6817
6817
  // src/detectNode.ts
6818
+ var import_picocolors3 = __toESM(require_picocolors(), 1);
6818
6819
  import process8 from "process";
6819
6820
  import { getPkg as getPkg2, jsShell as jsShell4 } from "lazy-js-utils";
6820
- var semver = __require("semver");
6821
6821
  async function detectNode() {
6822
6822
  var _a;
6823
- const pkg = await getPkg2();
6823
+ let pkg;
6824
+ try {
6825
+ pkg = await getPkg2();
6826
+ } catch (e) {
6827
+ const cwd = process8.cwd();
6828
+ console.log(import_picocolors3.default.red(`\u5F53\u524D\u76EE\u5F55: ${cwd} \u6CA1\u6709package.json\u6587\u4EF6`));
6829
+ process8.exit(1);
6830
+ }
6824
6831
  if ((_a = pkg.engines) == null ? void 0 : _a.node) {
6825
- const isSafe = semver.satisfies(process8.version, pkg.engines.node);
6832
+ const isSafe = __require("semver").satisfies(
6833
+ process8.version,
6834
+ pkg.engines.node
6835
+ );
6826
6836
  if (!isSafe) {
6827
6837
  const { result, status } = await jsShell4(
6828
6838
  `echo "yes
@@ -6832,13 +6842,13 @@ no" | gum filter --placeholder=" \u5F53\u524Dnode\u7248\u672C\u4E0D\u6EE1\u8DB3
6832
6842
  if (status === 0 && result === "yes") {
6833
6843
  await jsShell4(
6834
6844
  `
6835
- current=$(echo $(fnm current))
6836
- registery=$(echo "$(fnm ls)" | sed 's/system//g' | sed 's/default//g' | sed 's/* //g' | sed "s/$current/* $current/g" | gum filter --placeholder=" \u8BF7\u9009\u62E9\u4E00\u4E2Anode\u7248\u672C")
6837
- registery=$(echo \${registery// /} | sed 's/*//g')
6838
- if [ $registery ]; then
6839
- fnm use \${registery% -*}
6840
- fi
6841
- `,
6845
+ current=$(echo $(fnm current))
6846
+ registery=$(echo "$(fnm ls)" | sed 's/system//g' | sed 's/default//g' | sed 's/* //g' | sed "s/$current/* $current/g" | gum filter --placeholder=" \u8BF7\u9009\u62E9\u4E00\u4E2Anode\u7248\u672C")
6847
+ registery=$(echo \${registery// /} | sed 's/*//g')
6848
+ if [ $registery ]; then
6849
+ fnm use \${registery% -*}
6850
+ fi
6851
+ `,
6842
6852
  "pipe"
6843
6853
  );
6844
6854
  }
@@ -6849,6 +6859,7 @@ no" | gum filter --placeholder=" \u5F53\u524Dnode\u7248\u672C\u4E0D\u6EE1\u8DB3
6849
6859
  // src/pi.ts
6850
6860
  var isZh3 = process9.env.PI_Lang === "zh";
6851
6861
  async function pi(params, pkg, executor = "ni") {
6862
+ var _a;
6852
6863
  await detectNode();
6853
6864
  const text = pkg ? `Installing ${params} ...` : "Updating dependency ...";
6854
6865
  const isLatest = executor === "pil";
@@ -6888,15 +6899,16 @@ async function pi(params, pkg, executor = "ni") {
6888
6899
  loading_status = await loading("");
6889
6900
  const end = Date.now();
6890
6901
  const costTime = (end - start) / 1e3;
6891
- successMsg += import_picocolors3.default.blue(` ---- \u23F0\uFF1A${costTime}s`);
6902
+ successMsg += import_picocolors4.default.blue(` ---- \u23F0\uFF1A${costTime}s`);
6892
6903
  if (status === 0) {
6893
- loading_status.succeed(import_picocolors3.default.green(successMsg));
6904
+ loading_status.succeed(import_picocolors4.default.green(successMsg));
6894
6905
  } else if (result && result.includes("Not Found - 404")) {
6895
- const _result = isZh3 ? `${pkg} \u5305\u540D\u53EF\u80FD\u6709\u8BEF\uFF0C\u5E76\u4E0D\u80FD\u5728npm\u4E2D\u641C\u7D22\u5230\uFF0C\u8BF7\u68C0\u67E5` : `${pkg} the package name may be wrong, and cannot be found in npm, please check`;
6896
- loading_status.fail(import_picocolors3.default.red(result ? `${failMsg}
6906
+ const _pkg = (_a = result.match(/\/[^\/\:]+:/)) == null ? void 0 : _a[0].slice(1, -1);
6907
+ const _result = isZh3 ? `${_pkg} \u5305\u540D\u53EF\u80FD\u6709\u8BEF\u6216\u8005\u7248\u672C\u53F7\u4E0D\u5B58\u5728\uFF0C\u5E76\u4E0D\u80FD\u5728npm\u4E2D\u641C\u7D22\u5230\uFF0C\u8BF7\u68C0\u67E5` : `${_pkg} the package name may be wrong, and cannot be found in npm, please check`;
6908
+ loading_status.fail(import_picocolors4.default.red(result ? `${failMsg}
6897
6909
  ${_result}` : failMsg));
6898
6910
  } else {
6899
- loading_status.fail(import_picocolors3.default.red(result ? `${failMsg}
6911
+ loading_status.fail(import_picocolors4.default.red(result ? `${failMsg}
6900
6912
  ${result}` : failMsg));
6901
6913
  }
6902
6914
  if (result) {
@@ -6928,7 +6940,7 @@ function pfind(params) {
6928
6940
  }
6929
6941
 
6930
6942
  // src/pil.ts
6931
- var import_picocolors4 = __toESM(require_picocolors(), 1);
6943
+ var import_picocolors5 = __toESM(require_picocolors(), 1);
6932
6944
  import { getPkg as getPkg3, jsShell as jsShell8 } from "lazy-js-utils";
6933
6945
  async function pil(params) {
6934
6946
  const { dependencies = {}, devDependencies = {} } = await getPkg3();
@@ -6946,7 +6958,7 @@ async function pil(params) {
6946
6958
  "pipe"
6947
6959
  );
6948
6960
  if (status === 130) {
6949
- console.log(import_picocolors4.default.dim("\u5DF2\u53D6\u6D88"));
6961
+ console.log(import_picocolors5.default.dim("\u5DF2\u53D6\u6D88"));
6950
6962
  process.exit(0);
6951
6963
  } else if (status !== 0) {
6952
6964
  throw new Error(choose);
@@ -7020,7 +7032,7 @@ function pu() {
7020
7032
  }
7021
7033
 
7022
7034
  // src/pui.ts
7023
- var import_picocolors5 = __toESM(require_picocolors(), 1);
7035
+ var import_picocolors6 = __toESM(require_picocolors(), 1);
7024
7036
  import { getPkg as getPkg4, jsShell as jsShell12, useNodeWorker as useNodeWorker2 } from "lazy-js-utils";
7025
7037
  var isZh4 = process.env.PI_Lang === "zh";
7026
7038
  async function pui(params, pkg) {
@@ -7040,7 +7052,7 @@ async function pui(params, pkg) {
7040
7052
  "pipe"
7041
7053
  );
7042
7054
  if (status2 === 130) {
7043
- console.log(import_picocolors5.default.dim("\u5DF2\u53D6\u6D88"));
7055
+ console.log(import_picocolors6.default.dim("\u5DF2\u53D6\u6D88"));
7044
7056
  process.exit(0);
7045
7057
  } else if (status2 !== 0) {
7046
7058
  throw new Error(choose);
@@ -7052,7 +7064,7 @@ async function pui(params, pkg) {
7052
7064
  const failMsg = isZh4 ? `${pkg}\u5378\u8F7D\u5931\u8D25 \u{1F62D}` : `Failed to uninstall ${pkg} \u{1F62D}`;
7053
7065
  if (!pkg) {
7054
7066
  console.log(
7055
- import_picocolors5.default.yellow(
7067
+ import_picocolors6.default.yellow(
7056
7068
  isZh4 ? "\u9700\u8981\u6307\u5B9A\u8981\u5378\u8F7D\u7684\u5305\u540D\uFF01" : "Need to specify an uninstall package name!"
7057
7069
  )
7058
7070
  );
@@ -7062,17 +7074,17 @@ async function pui(params, pkg) {
7062
7074
  const { status, result } = await useNodeWorker2(`nun ${params}`);
7063
7075
  const end = Date.now();
7064
7076
  const costTime = (end - start) / 1e3;
7065
- successMsg += import_picocolors5.default.blue(` ---- \u23F0\uFF1A${costTime}s`);
7077
+ successMsg += import_picocolors6.default.blue(` ---- \u23F0\uFF1A${costTime}s`);
7066
7078
  if (status === 0)
7067
- loading_status.succeed(import_picocolors5.default.green(successMsg));
7079
+ loading_status.succeed(import_picocolors6.default.green(successMsg));
7068
7080
  else
7069
- loading_status.fail(import_picocolors5.default.red(result ? `${failMsg}
7081
+ loading_status.fail(import_picocolors6.default.red(result ? `${failMsg}
7070
7082
  ${result}` : failMsg));
7071
7083
  process.exit();
7072
7084
  }
7073
7085
 
7074
7086
  // src/pio.ts
7075
- var import_picocolors6 = __toESM(require_picocolors(), 1);
7087
+ var import_picocolors7 = __toESM(require_picocolors(), 1);
7076
7088
  import process10 from "process";
7077
7089
  import { useNodeWorker as useNodeWorker3 } from "lazy-js-utils";
7078
7090
  async function pio(params, pkg, executor = "ni") {
@@ -7086,9 +7098,9 @@ async function pio(params, pkg, executor = "ni") {
7086
7098
  });
7087
7099
  const loading_status = await loading("");
7088
7100
  if (status === 0)
7089
- loading_status.succeed(import_picocolors6.default.green(successMsg));
7101
+ loading_status.succeed(import_picocolors7.default.green(successMsg));
7090
7102
  else
7091
- loading_status.fail(import_picocolors6.default.red(result ? `${result}
7103
+ loading_status.fail(import_picocolors7.default.red(result ? `${result}
7092
7104
 
7093
7105
  ${failMsg}` : failMsg));
7094
7106
  process10.exit();
@@ -7133,11 +7145,11 @@ async function setup() {
7133
7145
  const { status } = params ? await useNodeWorker4(`go get ${params}`) : await useNodeWorker4("go mod tidy");
7134
7146
  if (status === 0) {
7135
7147
  loading_status.succeed(
7136
- import_picocolors7.default.green(isZh5 ? "\u5B89\u88C5\u6210\u529F! \u{1F60A}" : "Installed successfully! \u{1F60A}")
7148
+ import_picocolors8.default.green(isZh5 ? "\u5B89\u88C5\u6210\u529F! \u{1F60A}" : "Installed successfully! \u{1F60A}")
7137
7149
  );
7138
7150
  } else {
7139
7151
  loading_status.fail(
7140
- import_picocolors7.default.red(isZh5 ? "\u5B89\u88C5\u5931\u8D25 \u{1F62D}" : "Failed to install \u{1F62D}")
7152
+ import_picocolors8.default.red(isZh5 ? "\u5B89\u88C5\u5931\u8D25 \u{1F62D}" : "Failed to install \u{1F62D}")
7141
7153
  );
7142
7154
  }
7143
7155
  } else if (exec === "pui") {
@@ -7148,11 +7160,11 @@ async function setup() {
7148
7160
  const { status } = await useNodeWorker4(`go clean ${params}`);
7149
7161
  if (status === 0) {
7150
7162
  loading_status.succeed(
7151
- import_picocolors7.default.green(isZh5 ? "\u5378\u8F7D\u6210\u529F! \u{1F60A}" : "Uninstalled successfully! \u{1F60A}")
7163
+ import_picocolors8.default.green(isZh5 ? "\u5378\u8F7D\u6210\u529F! \u{1F60A}" : "Uninstalled successfully! \u{1F60A}")
7152
7164
  );
7153
7165
  } else {
7154
7166
  loading_status.fail(
7155
- import_picocolors7.default.red(isZh5 ? "\u5378\u8F7D\u5931\u8D25 \u{1F62D}" : "Failed to uninstall \u{1F62D}")
7167
+ import_picocolors8.default.red(isZh5 ? "\u5378\u8F7D\u5931\u8D25 \u{1F62D}" : "Failed to uninstall \u{1F62D}")
7156
7168
  );
7157
7169
  }
7158
7170
  } else if (exec === "prun") {
@@ -7165,7 +7177,7 @@ async function setup() {
7165
7177
  jsShell13(`go build ${params}`);
7166
7178
  } else {
7167
7179
  console.log(
7168
- import_picocolors7.default.red(
7180
+ import_picocolors8.default.red(
7169
7181
  isZh5 ? "\u5F53\u524D\u6307\u4EE4\u8FD8\u4E0D\u652F\u6301" : "The commands is not supported"
7170
7182
  )
7171
7183
  );
@@ -7181,11 +7193,11 @@ async function setup() {
7181
7193
  const { status } = await useNodeWorker4(`cargo install ${params}`);
7182
7194
  if (status === 0) {
7183
7195
  loading_status.succeed(
7184
- import_picocolors7.default.green(isZh5 ? "\u5B89\u88C5\u6210\u529F! \u{1F60A}" : "Installed successfully! \u{1F60A}")
7196
+ import_picocolors8.default.green(isZh5 ? "\u5B89\u88C5\u6210\u529F! \u{1F60A}" : "Installed successfully! \u{1F60A}")
7185
7197
  );
7186
7198
  } else {
7187
7199
  loading_status.fail(
7188
- import_picocolors7.default.red(isZh5 ? "\u5B89\u88C5\u5931\u8D25 \u{1F62D}" : "Failed to install \u{1F62D}")
7200
+ import_picocolors8.default.red(isZh5 ? "\u5B89\u88C5\u5931\u8D25 \u{1F62D}" : "Failed to install \u{1F62D}")
7189
7201
  );
7190
7202
  }
7191
7203
  } else if (exec === "pui") {
@@ -7196,11 +7208,11 @@ async function setup() {
7196
7208
  const { status } = await useNodeWorker4(`cargo uninstall ${params}`);
7197
7209
  if (status === 0) {
7198
7210
  loading_status.succeed(
7199
- import_picocolors7.default.green(isZh5 ? "\u5378\u8F7D\u6210\u529F! \u{1F60A}" : "Uninstalled successfully! \u{1F60A}")
7211
+ import_picocolors8.default.green(isZh5 ? "\u5378\u8F7D\u6210\u529F! \u{1F60A}" : "Uninstalled successfully! \u{1F60A}")
7200
7212
  );
7201
7213
  } else {
7202
7214
  loading_status.fail(
7203
- import_picocolors7.default.red(isZh5 ? "\u5378\u8F7D\u5931\u8D25 \u{1F62D}" : "Failed to uninstall \u{1F62D}")
7215
+ import_picocolors8.default.red(isZh5 ? "\u5378\u8F7D\u5931\u8D25 \u{1F62D}" : "Failed to uninstall \u{1F62D}")
7204
7216
  );
7205
7217
  }
7206
7218
  } else if (exec === "prun") {
@@ -7211,7 +7223,7 @@ async function setup() {
7211
7223
  jsShell13(`cargo build ${params}`);
7212
7224
  } else {
7213
7225
  console.log(
7214
- import_picocolors7.default.red(
7226
+ import_picocolors8.default.red(
7215
7227
  isZh5 ? "\u5F53\u524D\u6307\u4EE4\u8FD8\u4E0D\u652F\u6301" : "The commands is not supported"
7216
7228
  )
7217
7229
  );
@@ -7220,7 +7232,7 @@ async function setup() {
7220
7232
  }
7221
7233
  if (!runMap[exec]) {
7222
7234
  console.log(
7223
- import_picocolors7.default.yellow(
7235
+ import_picocolors8.default.yellow(
7224
7236
  isZh5 ? "\u547D\u4EE4\u4E0D\u5B58\u5728\uFF0C\u8BF7\u6267\u884Cpi -h\u67E5\u770B\u5E2E\u52A9" : "The command does not exist, please execute pi -h to view the help"
7225
7237
  )
7226
7238
  );
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@simon_he/pi",
3
3
  "type": "module",
4
- "version": "0.0.82",
4
+ "version": "0.0.84",
5
5
  "description": "",
6
6
  "author": "Simon He",
7
7
  "license": "MIT",
@@ -17,11 +17,11 @@
17
17
  "exports": {
18
18
  ".": {
19
19
  "types": "./dist/index.d.ts",
20
- "require": "./dist/index.cjs",
20
+ "require": "./dist/index.mjs",
21
21
  "import": "./dist/index.js"
22
22
  }
23
23
  },
24
- "main": "./dist/index.cjs",
24
+ "main": "./dist/index.mjs",
25
25
  "module": "./dist/index.js",
26
26
  "types": "./dist/index.d.ts",
27
27
  "typesVersions": {
@@ -67,7 +67,7 @@
67
67
  "dependencies": {
68
68
  "ccommand": "^1.0.55",
69
69
  "fast-glob": "latest",
70
- "lazy-js-utils": "latest",
70
+ "lazy-js-utils": "^0.0.87",
71
71
  "semver": "^7.5.4"
72
72
  },
73
73
  "devDependencies": {