@simon_he/pi 0.0.83 → 0.0.85

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
@@ -5657,10 +5657,10 @@ __export(src_exports, {
5657
5657
  });
5658
5658
  module.exports = __toCommonJS(src_exports);
5659
5659
  var import_process4 = __toESM(require("process"), 1);
5660
- var import_lazy_js_utils14 = require("lazy-js-utils");
5660
+ var import_lazy_js_utils13 = require("lazy-js-utils");
5661
5661
  var import_picocolors8 = __toESM(require_picocolors(), 1);
5662
5662
  var import_fast_glob = __toESM(require("fast-glob"), 1);
5663
- var import_ccommand2 = require("ccommand");
5663
+ var import_ccommand3 = require("ccommand");
5664
5664
 
5665
5665
  // src/utils.ts
5666
5666
  var import_path = __toESM(require("path"), 1);
@@ -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.83";
6754
+ var version = "0.0.85";
6755
6755
 
6756
6756
  // src/help.ts
6757
6757
  var isZh2 = process.env.PI_Lang === "zh";
@@ -6814,7 +6814,6 @@ var import_picocolors4 = __toESM(require_picocolors(), 1);
6814
6814
  var import_process = __toESM(require("process"), 1);
6815
6815
  var import_lazy_js_utils4 = require("lazy-js-utils");
6816
6816
  var import_picocolors3 = __toESM(require_picocolors(), 1);
6817
- var semver = require("semver");
6818
6817
  async function detectNode() {
6819
6818
  var _a;
6820
6819
  let pkg;
@@ -6826,7 +6825,10 @@ async function detectNode() {
6826
6825
  import_process.default.exit(1);
6827
6826
  }
6828
6827
  if ((_a = pkg.engines) == null ? void 0 : _a.node) {
6829
- 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
+ );
6830
6832
  if (!isSafe) {
6831
6833
  const { result, status } = await (0, import_lazy_js_utils4.jsShell)(
6832
6834
  `echo "yes
@@ -6853,6 +6855,7 @@ no" | gum filter --placeholder=" \u5F53\u524Dnode\u7248\u672C\u4E0D\u6EE1\u8DB3
6853
6855
  // src/pi.ts
6854
6856
  var isZh3 = import_process2.default.env.PI_Lang === "zh";
6855
6857
  async function pi(params, pkg, executor = "ni") {
6858
+ var _a;
6856
6859
  await detectNode();
6857
6860
  const text = pkg ? `Installing ${params} ...` : "Updating dependency ...";
6858
6861
  const isLatest = executor === "pil";
@@ -6896,7 +6899,8 @@ async function pi(params, pkg, executor = "ni") {
6896
6899
  if (status === 0) {
6897
6900
  loading_status.succeed(import_picocolors4.default.green(successMsg));
6898
6901
  } else if (result && result.includes("Not Found - 404")) {
6899
- 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`;
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`;
6900
6904
  loading_status.fail(import_picocolors4.default.red(result ? `${failMsg}
6901
6905
  ${_result}` : failMsg));
6902
6906
  } else {
@@ -6926,16 +6930,16 @@ function pci(params, pkg) {
6926
6930
  }
6927
6931
 
6928
6932
  // src/pfind.ts
6929
- var import_lazy_js_utils7 = require("lazy-js-utils");
6933
+ var import_ccommand = require("ccommand");
6930
6934
  function pfind(params) {
6931
- return (0, import_lazy_js_utils7.jsShell)(`ccommand find ${params}`);
6935
+ return (0, import_ccommand.ccommand)(`find ${params}`);
6932
6936
  }
6933
6937
 
6934
6938
  // src/pil.ts
6935
- var import_lazy_js_utils8 = require("lazy-js-utils");
6939
+ var import_lazy_js_utils7 = require("lazy-js-utils");
6936
6940
  var import_picocolors5 = __toESM(require_picocolors(), 1);
6937
6941
  async function pil(params) {
6938
- const { dependencies = {}, devDependencies = {} } = await (0, import_lazy_js_utils8.getPkg)();
6942
+ const { dependencies = {}, devDependencies = {} } = await (0, import_lazy_js_utils7.getPkg)();
6939
6943
  if (!params) {
6940
6944
  const deps = [
6941
6945
  ...Object.keys(dependencies).map((key) => `${key}: ${dependencies[key]}`),
@@ -6943,7 +6947,7 @@ async function pil(params) {
6943
6947
  (key) => `${key}: ${devDependencies[key]}`
6944
6948
  )
6945
6949
  ];
6946
- const { result: choose, status } = (0, import_lazy_js_utils8.jsShell)(
6950
+ const { result: choose, status } = (0, import_lazy_js_utils7.jsShell)(
6947
6951
  `echo ${deps.join(
6948
6952
  ","
6949
6953
  )} | sed "s/,/\\n/g" | gum filter --no-limit --placeholder=" \u{1F914}${process.env.PI_Lang === "zh" ? "\u8BF7\u9009\u62E9\u4E00\u4E2A\u9700\u8981\u83B7\u53D6\u6700\u65B0\u7248\u672C\u7684\u4F9D\u8D56" : "Please select a dependency that needs to obtain the latest version."}"`,
@@ -6982,62 +6986,62 @@ async function pil(params) {
6982
6986
  }
6983
6987
 
6984
6988
  // src/pinit.ts
6985
- var import_lazy_js_utils9 = require("lazy-js-utils");
6989
+ var import_lazy_js_utils8 = require("lazy-js-utils");
6986
6990
  async function pinit() {
6987
6991
  console.log("Initializing project...");
6988
- switch (await (0, import_lazy_js_utils9.getPkgTool)()) {
6992
+ switch (await (0, import_lazy_js_utils8.getPkgTool)()) {
6989
6993
  case "npm":
6990
- (0, import_lazy_js_utils9.jsShell)("npm init -y");
6994
+ (0, import_lazy_js_utils8.jsShell)("npm init -y");
6991
6995
  return;
6992
6996
  case "yarn":
6993
- (0, import_lazy_js_utils9.jsShell)("yarn init -y");
6997
+ (0, import_lazy_js_utils8.jsShell)("yarn init -y");
6994
6998
  return;
6995
6999
  case "pnpm":
6996
- (0, import_lazy_js_utils9.jsShell)("pnpm init -y");
7000
+ (0, import_lazy_js_utils8.jsShell)("pnpm init -y");
6997
7001
  return;
6998
7002
  default:
6999
- (0, import_lazy_js_utils9.jsShell)("npm init -y");
7003
+ (0, import_lazy_js_utils8.jsShell)("npm init -y");
7000
7004
  }
7001
7005
  }
7002
7006
 
7003
7007
  // src/pix.ts
7004
- var import_lazy_js_utils10 = require("lazy-js-utils");
7008
+ var import_lazy_js_utils9 = require("lazy-js-utils");
7005
7009
  async function pix(params) {
7006
- switch (await (0, import_lazy_js_utils10.getPkgTool)()) {
7010
+ switch (await (0, import_lazy_js_utils9.getPkgTool)()) {
7007
7011
  case "bun":
7008
- return (0, import_lazy_js_utils10.jsShell)(`bunx ${params}`);
7012
+ return (0, import_lazy_js_utils9.jsShell)(`bunx ${params}`);
7009
7013
  default:
7010
- return (0, import_lazy_js_utils10.jsShell)(`npx ${params}`);
7014
+ return (0, import_lazy_js_utils9.jsShell)(`npx ${params}`);
7011
7015
  }
7012
7016
  }
7013
7017
 
7014
7018
  // src/prun.ts
7015
- var import_ccommand = require("ccommand");
7019
+ var import_ccommand2 = require("ccommand");
7016
7020
  function prun(params) {
7017
- return (0, import_ccommand.ccommand)(params);
7021
+ return (0, import_ccommand2.ccommand)(params);
7018
7022
  }
7019
7023
 
7020
7024
  // src/pu.ts
7021
- var import_lazy_js_utils11 = require("lazy-js-utils");
7025
+ var import_lazy_js_utils10 = require("lazy-js-utils");
7022
7026
  function pu() {
7023
- return (0, import_lazy_js_utils11.jsShell)("nu");
7027
+ return (0, import_lazy_js_utils10.jsShell)("nu");
7024
7028
  }
7025
7029
 
7026
7030
  // src/pui.ts
7027
- var import_lazy_js_utils12 = require("lazy-js-utils");
7031
+ var import_lazy_js_utils11 = require("lazy-js-utils");
7028
7032
  var import_picocolors6 = __toESM(require_picocolors(), 1);
7029
7033
  var isZh4 = process.env.PI_Lang === "zh";
7030
7034
  async function pui(params, pkg) {
7031
7035
  const text = `${isZh4 ? "\u6B63\u5728\u4E3A\u60A8\u5378\u8F7D" : "Uninstalling"} ${pkg} ...`;
7032
7036
  if (!params) {
7033
- const { dependencies = {}, devDependencies = {} } = await (0, import_lazy_js_utils12.getPkg)();
7037
+ const { dependencies = {}, devDependencies = {} } = await (0, import_lazy_js_utils11.getPkg)();
7034
7038
  const deps = [
7035
7039
  ...Object.keys(dependencies).map((key) => `${key}: ${dependencies[key]}`),
7036
7040
  ...Object.keys(devDependencies).map(
7037
7041
  (key) => `${key}: ${devDependencies[key]}`
7038
7042
  )
7039
7043
  ];
7040
- const { result: choose, status: status2 } = (0, import_lazy_js_utils12.jsShell)(
7044
+ const { result: choose, status: status2 } = (0, import_lazy_js_utils11.jsShell)(
7041
7045
  `echo ${deps.join(
7042
7046
  ","
7043
7047
  )} | sed "s/,/\\n/g" | gum filter --placeholder=" \u{1F914}${process.env.PI_Lang === "zh" ? "\u8BF7\u9009\u62E9\u4E00\u4E2A\u9700\u8981\u5220\u9664\u4F9D\u8D56" : "Please select a dependency to get the latest version."}"`,
@@ -7063,7 +7067,7 @@ async function pui(params, pkg) {
7063
7067
  process.exit(1);
7064
7068
  }
7065
7069
  const loading_status = await loading(text);
7066
- const { status, result } = await (0, import_lazy_js_utils12.useNodeWorker)(`nun ${params}`);
7070
+ const { status, result } = await (0, import_lazy_js_utils11.useNodeWorker)(`nun ${params}`);
7067
7071
  const end = Date.now();
7068
7072
  const costTime = (end - start) / 1e3;
7069
7073
  successMsg += import_picocolors6.default.blue(` ---- \u23F0\uFF1A${costTime}s`);
@@ -7077,14 +7081,14 @@ ${result}` : failMsg));
7077
7081
 
7078
7082
  // src/pio.ts
7079
7083
  var import_process3 = __toESM(require("process"), 1);
7080
- var import_lazy_js_utils13 = require("lazy-js-utils");
7084
+ var import_lazy_js_utils12 = require("lazy-js-utils");
7081
7085
  var import_picocolors7 = __toESM(require_picocolors(), 1);
7082
7086
  async function pio(params, pkg, executor = "ni") {
7083
7087
  const successMsg = pkg ? `Installed ${pkg} successfully! \u{1F60A}` : "Updated dependency successfully! \u{1F60A}";
7084
7088
  const failMsg = pkg ? `Failed to install ${pkg} \u{1F62D}` : "Failed to update dependency! \u{1F62D}";
7085
7089
  const offline = "--prefer-offline";
7086
7090
  const newParams = await getParams(params);
7087
- const { status, result } = await (0, import_lazy_js_utils13.useNodeWorker)({
7091
+ const { status, result } = await (0, import_lazy_js_utils12.useNodeWorker)({
7088
7092
  params: `${executor} ${newParams} ${offline}`,
7089
7093
  stdio: "inherit"
7090
7094
  });
@@ -7117,7 +7121,7 @@ var isZh5 = import_process4.default.env.PI_Lang === "zh";
7117
7121
  async function setup() {
7118
7122
  const cmd = import_process4.default.argv[1];
7119
7123
  let exec = "";
7120
- if ((0, import_lazy_js_utils14.isWin)()) {
7124
+ if ((0, import_lazy_js_utils13.isWin)()) {
7121
7125
  const last = cmd.lastIndexOf("\\") + 1;
7122
7126
  exec = cmd.slice(last, cmd.length).split(".").slice(0, -1).join(".");
7123
7127
  } else {
@@ -7126,15 +7130,15 @@ async function setup() {
7126
7130
  }
7127
7131
  const argv = import_process4.default.argv.slice(2);
7128
7132
  help(argv);
7129
- const params = (0, import_lazy_js_utils14.spaceFormat)(argv.join(" ")).trim();
7130
- if (!(0, import_lazy_js_utils14.hasPkg)(rootPath)) {
7131
- if ((0, import_lazy_js_utils14.isGo)()) {
7133
+ const params = (0, import_lazy_js_utils13.spaceFormat)(argv.join(" ")).trim();
7134
+ if (!(0, import_lazy_js_utils13.hasPkg)(rootPath)) {
7135
+ if ((0, import_lazy_js_utils13.isGo)()) {
7132
7136
  if (exec === "pi") {
7133
7137
  const loading_status = await loading(
7134
7138
  `${isZh5 ? "\u6B63\u5728\u4E3A\u60A8\u5B89\u88C5" : "Installing"} ${params} ...
7135
7139
  `
7136
7140
  );
7137
- const { status } = params ? await (0, import_lazy_js_utils14.useNodeWorker)(`go get ${params}`) : await (0, import_lazy_js_utils14.useNodeWorker)("go mod tidy");
7141
+ const { status } = params ? await (0, import_lazy_js_utils13.useNodeWorker)(`go get ${params}`) : await (0, import_lazy_js_utils13.useNodeWorker)("go mod tidy");
7138
7142
  if (status === 0) {
7139
7143
  loading_status.succeed(
7140
7144
  import_picocolors8.default.green(isZh5 ? "\u5B89\u88C5\u6210\u529F! \u{1F60A}" : "Installed successfully! \u{1F60A}")
@@ -7149,7 +7153,7 @@ async function setup() {
7149
7153
  `${isZh5 ? "\u6B63\u5728\u4E3A\u60A8\u5378\u8F7D" : "Uninstalling"} ${params} ...
7150
7154
  `
7151
7155
  );
7152
- const { status } = await (0, import_lazy_js_utils14.useNodeWorker)(`go clean ${params}`);
7156
+ const { status } = await (0, import_lazy_js_utils13.useNodeWorker)(`go clean ${params}`);
7153
7157
  if (status === 0) {
7154
7158
  loading_status.succeed(
7155
7159
  import_picocolors8.default.green(isZh5 ? "\u5378\u8F7D\u6210\u529F! \u{1F60A}" : "Uninstalled successfully! \u{1F60A}")
@@ -7162,11 +7166,11 @@ async function setup() {
7162
7166
  } else if (exec === "prun") {
7163
7167
  const match = params ? params.endsWith(".go") ? [`**/${params}`] : [`**/${params}.go`, `**/${params}/main.go`] : "main.go";
7164
7168
  const target = (await (0, import_fast_glob.default)(match))[0];
7165
- return target ? (0, import_lazy_js_utils14.jsShell)(`go run ${target}`) : (0, import_ccommand2.ccommand)(params);
7169
+ return target ? (0, import_lazy_js_utils13.jsShell)(`go run ${target}`) : (0, import_ccommand3.ccommand)(params);
7166
7170
  } else if (exec === "pinit") {
7167
- (0, import_lazy_js_utils14.jsShell)(`go mod init ${params}`);
7171
+ (0, import_lazy_js_utils13.jsShell)(`go mod init ${params}`);
7168
7172
  } else if (exec === "pbuild") {
7169
- (0, import_lazy_js_utils14.jsShell)(`go build ${params}`);
7173
+ (0, import_lazy_js_utils13.jsShell)(`go build ${params}`);
7170
7174
  } else {
7171
7175
  console.log(
7172
7176
  import_picocolors8.default.red(
@@ -7176,13 +7180,13 @@ async function setup() {
7176
7180
  }
7177
7181
  import_process4.default.exit();
7178
7182
  }
7179
- if ((0, import_lazy_js_utils14.isRust)()) {
7183
+ if ((0, import_lazy_js_utils13.isRust)()) {
7180
7184
  if (exec === "pi") {
7181
7185
  const loading_status = await loading(
7182
7186
  `${isZh5 ? "\u6B63\u5728\u4E3A\u60A8\u5B89\u88C5" : "Installing"} ${params} ...
7183
7187
  `
7184
7188
  );
7185
- const { status } = await (0, import_lazy_js_utils14.useNodeWorker)(`cargo install ${params}`);
7189
+ const { status } = await (0, import_lazy_js_utils13.useNodeWorker)(`cargo install ${params}`);
7186
7190
  if (status === 0) {
7187
7191
  loading_status.succeed(
7188
7192
  import_picocolors8.default.green(isZh5 ? "\u5B89\u88C5\u6210\u529F! \u{1F60A}" : "Installed successfully! \u{1F60A}")
@@ -7197,7 +7201,7 @@ async function setup() {
7197
7201
  `${isZh5 ? "\u6B63\u5728\u4E3A\u60A8\u5378\u8F7D" : "Uninstalling"} ${params} ...
7198
7202
  `
7199
7203
  );
7200
- const { status } = await (0, import_lazy_js_utils14.useNodeWorker)(`cargo uninstall ${params}`);
7204
+ const { status } = await (0, import_lazy_js_utils13.useNodeWorker)(`cargo uninstall ${params}`);
7201
7205
  if (status === 0) {
7202
7206
  loading_status.succeed(
7203
7207
  import_picocolors8.default.green(isZh5 ? "\u5378\u8F7D\u6210\u529F! \u{1F60A}" : "Uninstalled successfully! \u{1F60A}")
@@ -7208,11 +7212,11 @@ async function setup() {
7208
7212
  );
7209
7213
  }
7210
7214
  } else if (exec === "prun") {
7211
- (0, import_lazy_js_utils14.jsShell)(`cargo run ${params}`);
7215
+ (0, import_lazy_js_utils13.jsShell)(`cargo run ${params}`);
7212
7216
  } else if (exec === "pinit") {
7213
- (0, import_lazy_js_utils14.jsShell)(`cargo init ${params}`);
7217
+ (0, import_lazy_js_utils13.jsShell)(`cargo init ${params}`);
7214
7218
  } else if (exec === "pbuild") {
7215
- (0, import_lazy_js_utils14.jsShell)(`cargo build ${params}`);
7219
+ (0, import_lazy_js_utils13.jsShell)(`cargo build ${params}`);
7216
7220
  } else {
7217
7221
  console.log(
7218
7222
  import_picocolors8.default.red(
package/dist/index.js CHANGED
@@ -5659,12 +5659,12 @@ import {
5659
5659
  isGo,
5660
5660
  isRust,
5661
5661
  isWin,
5662
- jsShell as jsShell13,
5662
+ jsShell as jsShell12,
5663
5663
  spaceFormat,
5664
5664
  useNodeWorker as useNodeWorker4
5665
5665
  } from "lazy-js-utils";
5666
5666
  import fg from "fast-glob";
5667
- import { ccommand as ccommand2 } from "ccommand";
5667
+ import { ccommand as ccommand3 } from "ccommand";
5668
5668
 
5669
5669
  // src/utils.ts
5670
5670
  import path from "path";
@@ -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.83";
6758
+ var version = "0.0.85";
6759
6759
 
6760
6760
  // src/help.ts
6761
6761
  var isZh2 = process.env.PI_Lang === "zh";
@@ -6818,7 +6818,6 @@ import { getPkgTool as getPkgTool2, jsShell as jsShell5, useNodeWorker } from "l
6818
6818
  var import_picocolors3 = __toESM(require_picocolors(), 1);
6819
6819
  import process8 from "process";
6820
6820
  import { getPkg as getPkg2, jsShell as jsShell4 } from "lazy-js-utils";
6821
- var semver = __require("semver");
6822
6821
  async function detectNode() {
6823
6822
  var _a;
6824
6823
  let pkg;
@@ -6830,7 +6829,10 @@ async function detectNode() {
6830
6829
  process8.exit(1);
6831
6830
  }
6832
6831
  if ((_a = pkg.engines) == null ? void 0 : _a.node) {
6833
- const isSafe = semver.satisfies(process8.version, pkg.engines.node);
6832
+ const isSafe = __require("semver").satisfies(
6833
+ process8.version,
6834
+ pkg.engines.node
6835
+ );
6834
6836
  if (!isSafe) {
6835
6837
  const { result, status } = await jsShell4(
6836
6838
  `echo "yes
@@ -6857,6 +6859,7 @@ no" | gum filter --placeholder=" \u5F53\u524Dnode\u7248\u672C\u4E0D\u6EE1\u8DB3
6857
6859
  // src/pi.ts
6858
6860
  var isZh3 = process9.env.PI_Lang === "zh";
6859
6861
  async function pi(params, pkg, executor = "ni") {
6862
+ var _a;
6860
6863
  await detectNode();
6861
6864
  const text = pkg ? `Installing ${params} ...` : "Updating dependency ...";
6862
6865
  const isLatest = executor === "pil";
@@ -6900,7 +6903,8 @@ async function pi(params, pkg, executor = "ni") {
6900
6903
  if (status === 0) {
6901
6904
  loading_status.succeed(import_picocolors4.default.green(successMsg));
6902
6905
  } else if (result && result.includes("Not Found - 404")) {
6903
- 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`;
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`;
6904
6908
  loading_status.fail(import_picocolors4.default.red(result ? `${failMsg}
6905
6909
  ${_result}` : failMsg));
6906
6910
  } else {
@@ -6930,14 +6934,14 @@ function pci(params, pkg) {
6930
6934
  }
6931
6935
 
6932
6936
  // src/pfind.ts
6933
- import { jsShell as jsShell7 } from "lazy-js-utils";
6937
+ import { ccommand } from "ccommand";
6934
6938
  function pfind(params) {
6935
- return jsShell7(`ccommand find ${params}`);
6939
+ return ccommand(`find ${params}`);
6936
6940
  }
6937
6941
 
6938
6942
  // src/pil.ts
6939
6943
  var import_picocolors5 = __toESM(require_picocolors(), 1);
6940
- import { getPkg as getPkg3, jsShell as jsShell8 } from "lazy-js-utils";
6944
+ import { getPkg as getPkg3, jsShell as jsShell7 } from "lazy-js-utils";
6941
6945
  async function pil(params) {
6942
6946
  const { dependencies = {}, devDependencies = {} } = await getPkg3();
6943
6947
  if (!params) {
@@ -6947,7 +6951,7 @@ async function pil(params) {
6947
6951
  (key) => `${key}: ${devDependencies[key]}`
6948
6952
  )
6949
6953
  ];
6950
- const { result: choose, status } = jsShell8(
6954
+ const { result: choose, status } = jsShell7(
6951
6955
  `echo ${deps.join(
6952
6956
  ","
6953
6957
  )} | sed "s/,/\\n/g" | gum filter --no-limit --placeholder=" \u{1F914}${process.env.PI_Lang === "zh" ? "\u8BF7\u9009\u62E9\u4E00\u4E2A\u9700\u8981\u83B7\u53D6\u6700\u65B0\u7248\u672C\u7684\u4F9D\u8D56" : "Please select a dependency that needs to obtain the latest version."}"`,
@@ -6986,50 +6990,50 @@ async function pil(params) {
6986
6990
  }
6987
6991
 
6988
6992
  // src/pinit.ts
6989
- import { getPkgTool as getPkgTool3, jsShell as jsShell9 } from "lazy-js-utils";
6993
+ import { getPkgTool as getPkgTool3, jsShell as jsShell8 } from "lazy-js-utils";
6990
6994
  async function pinit() {
6991
6995
  console.log("Initializing project...");
6992
6996
  switch (await getPkgTool3()) {
6993
6997
  case "npm":
6994
- jsShell9("npm init -y");
6998
+ jsShell8("npm init -y");
6995
6999
  return;
6996
7000
  case "yarn":
6997
- jsShell9("yarn init -y");
7001
+ jsShell8("yarn init -y");
6998
7002
  return;
6999
7003
  case "pnpm":
7000
- jsShell9("pnpm init -y");
7004
+ jsShell8("pnpm init -y");
7001
7005
  return;
7002
7006
  default:
7003
- jsShell9("npm init -y");
7007
+ jsShell8("npm init -y");
7004
7008
  }
7005
7009
  }
7006
7010
 
7007
7011
  // src/pix.ts
7008
- import { getPkgTool as getPkgTool4, jsShell as jsShell10 } from "lazy-js-utils";
7012
+ import { getPkgTool as getPkgTool4, jsShell as jsShell9 } from "lazy-js-utils";
7009
7013
  async function pix(params) {
7010
7014
  switch (await getPkgTool4()) {
7011
7015
  case "bun":
7012
- return jsShell10(`bunx ${params}`);
7016
+ return jsShell9(`bunx ${params}`);
7013
7017
  default:
7014
- return jsShell10(`npx ${params}`);
7018
+ return jsShell9(`npx ${params}`);
7015
7019
  }
7016
7020
  }
7017
7021
 
7018
7022
  // src/prun.ts
7019
- import { ccommand } from "ccommand";
7023
+ import { ccommand as ccommand2 } from "ccommand";
7020
7024
  function prun(params) {
7021
- return ccommand(params);
7025
+ return ccommand2(params);
7022
7026
  }
7023
7027
 
7024
7028
  // src/pu.ts
7025
- import { jsShell as jsShell11 } from "lazy-js-utils";
7029
+ import { jsShell as jsShell10 } from "lazy-js-utils";
7026
7030
  function pu() {
7027
- return jsShell11("nu");
7031
+ return jsShell10("nu");
7028
7032
  }
7029
7033
 
7030
7034
  // src/pui.ts
7031
7035
  var import_picocolors6 = __toESM(require_picocolors(), 1);
7032
- import { getPkg as getPkg4, jsShell as jsShell12, useNodeWorker as useNodeWorker2 } from "lazy-js-utils";
7036
+ import { getPkg as getPkg4, jsShell as jsShell11, useNodeWorker as useNodeWorker2 } from "lazy-js-utils";
7033
7037
  var isZh4 = process.env.PI_Lang === "zh";
7034
7038
  async function pui(params, pkg) {
7035
7039
  const text = `${isZh4 ? "\u6B63\u5728\u4E3A\u60A8\u5378\u8F7D" : "Uninstalling"} ${pkg} ...`;
@@ -7041,7 +7045,7 @@ async function pui(params, pkg) {
7041
7045
  (key) => `${key}: ${devDependencies[key]}`
7042
7046
  )
7043
7047
  ];
7044
- const { result: choose, status: status2 } = jsShell12(
7048
+ const { result: choose, status: status2 } = jsShell11(
7045
7049
  `echo ${deps.join(
7046
7050
  ","
7047
7051
  )} | sed "s/,/\\n/g" | gum filter --placeholder=" \u{1F914}${process.env.PI_Lang === "zh" ? "\u8BF7\u9009\u62E9\u4E00\u4E2A\u9700\u8981\u5220\u9664\u4F9D\u8D56" : "Please select a dependency to get the latest version."}"`,
@@ -7166,11 +7170,11 @@ async function setup() {
7166
7170
  } else if (exec === "prun") {
7167
7171
  const match = params ? params.endsWith(".go") ? [`**/${params}`] : [`**/${params}.go`, `**/${params}/main.go`] : "main.go";
7168
7172
  const target = (await fg(match))[0];
7169
- return target ? jsShell13(`go run ${target}`) : ccommand2(params);
7173
+ return target ? jsShell12(`go run ${target}`) : ccommand3(params);
7170
7174
  } else if (exec === "pinit") {
7171
- jsShell13(`go mod init ${params}`);
7175
+ jsShell12(`go mod init ${params}`);
7172
7176
  } else if (exec === "pbuild") {
7173
- jsShell13(`go build ${params}`);
7177
+ jsShell12(`go build ${params}`);
7174
7178
  } else {
7175
7179
  console.log(
7176
7180
  import_picocolors8.default.red(
@@ -7212,11 +7216,11 @@ async function setup() {
7212
7216
  );
7213
7217
  }
7214
7218
  } else if (exec === "prun") {
7215
- jsShell13(`cargo run ${params}`);
7219
+ jsShell12(`cargo run ${params}`);
7216
7220
  } else if (exec === "pinit") {
7217
- jsShell13(`cargo init ${params}`);
7221
+ jsShell12(`cargo init ${params}`);
7218
7222
  } else if (exec === "pbuild") {
7219
- jsShell13(`cargo build ${params}`);
7223
+ jsShell12(`cargo build ${params}`);
7220
7224
  } else {
7221
7225
  console.log(
7222
7226
  import_picocolors8.default.red(
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@simon_he/pi",
3
3
  "type": "module",
4
- "version": "0.0.83",
4
+ "version": "0.0.85",
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": {