@simon_he/pi 0.0.74 → 0.0.76

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
@@ -7230,7 +7230,7 @@ function getLatestVersion(pkg) {
7230
7230
  var import_lazy_js_utils2 = require("lazy-js-utils");
7231
7231
 
7232
7232
  // package.json
7233
- var version = "0.0.74";
7233
+ var version = "0.0.76";
7234
7234
 
7235
7235
  // src/help.ts
7236
7236
  var isZh2 = process.env.PI_Lang === "zh";
@@ -7373,7 +7373,7 @@ var import_lazy_js_utils7 = require("lazy-js-utils");
7373
7373
  var import_picocolors4 = __toESM(require_picocolors(), 1);
7374
7374
  async function pil(params) {
7375
7375
  if (!params) {
7376
- const { dependencies, devDependencies } = await (0, import_lazy_js_utils7.getPkg)();
7376
+ const { dependencies = {}, devDependencies = {} } = await (0, import_lazy_js_utils7.getPkg)();
7377
7377
  const deps = [
7378
7378
  ...Object.keys(dependencies).map((key) => `${key}: ${dependencies[key]}`),
7379
7379
  ...Object.keys(devDependencies).map(
@@ -7383,7 +7383,7 @@ async function pil(params) {
7383
7383
  const { result: choose, status } = (0, import_lazy_js_utils7.jsShell)(
7384
7384
  `echo ${deps.join(
7385
7385
  ","
7386
- )} | sed "s/,/\\n/g" | gum filter --placeholder=" \u{1F914}${process.env.PI_Lang === "zh" ? "\u8BF7\u9009\u62E9\u4E00\u4E2A\u4F9D\u8D56\u83B7\u53D6\u6700\u65B0\u7248\u672C" : "Please select a dependency to get the latest version."}"`,
7386
+ )} | sed "s/,/\\n/g" | gum filter --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."}"`,
7387
7387
  "pipe"
7388
7388
  );
7389
7389
  if (status === 130) {
@@ -7464,6 +7464,28 @@ var import_picocolors5 = __toESM(require_picocolors(), 1);
7464
7464
  var isZh4 = process.env.PI_Lang === "zh";
7465
7465
  async function pui(params, pkg) {
7466
7466
  const text = `${isZh4 ? "\u6B63\u5728\u4E3A\u60A8\u5378\u8F7D" : "Uninstalling"} ${pkg} ...`;
7467
+ if (!params) {
7468
+ const { dependencies = {}, devDependencies = {} } = await (0, import_lazy_js_utils11.getPkg)();
7469
+ const deps = [
7470
+ ...Object.keys(dependencies).map((key) => `${key}: ${dependencies[key]}`),
7471
+ ...Object.keys(devDependencies).map(
7472
+ (key) => `${key}: ${devDependencies[key]}`
7473
+ )
7474
+ ];
7475
+ const { result: choose, status: status2 } = (0, import_lazy_js_utils11.jsShell)(
7476
+ `echo ${deps.join(
7477
+ ","
7478
+ )} | 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."}"`,
7479
+ "pipe"
7480
+ );
7481
+ if (status2 === 130) {
7482
+ console.log(import_picocolors5.default.dim("\u5DF2\u53D6\u6D88"));
7483
+ process.exit(0);
7484
+ } else if (status2 !== 0) {
7485
+ throw new Error(choose);
7486
+ }
7487
+ pkg = params = choose.split(": ")[0];
7488
+ }
7467
7489
  const start = Date.now();
7468
7490
  let successMsg = isZh4 ? `${pkg}\u5378\u8F7D\u6210\u529F! \u{1F60A}` : `UnInstalled ${pkg} successfully! \u{1F60A}`;
7469
7491
  const failMsg = isZh4 ? `${pkg}\u5378\u8F7D\u5931\u8D25 \u{1F62D}` : `Failed to uninstall ${pkg} \u{1F62D}`;
package/dist/index.js CHANGED
@@ -5659,7 +5659,7 @@ import {
5659
5659
  isGo,
5660
5660
  isRust,
5661
5661
  isWin,
5662
- jsShell as jsShell11,
5662
+ jsShell as jsShell12,
5663
5663
  spaceFormat,
5664
5664
  useNodeWorker as useNodeWorker4
5665
5665
  } from "lazy-js-utils";
@@ -7234,7 +7234,7 @@ function getLatestVersion(pkg) {
7234
7234
  import { jsShell as jsShell2 } from "lazy-js-utils";
7235
7235
 
7236
7236
  // package.json
7237
- var version = "0.0.74";
7237
+ var version = "0.0.76";
7238
7238
 
7239
7239
  // src/help.ts
7240
7240
  var isZh2 = process.env.PI_Lang === "zh";
@@ -7377,7 +7377,7 @@ var import_picocolors4 = __toESM(require_picocolors(), 1);
7377
7377
  import { getPkg as getPkg2, jsShell as jsShell7 } from "lazy-js-utils";
7378
7378
  async function pil(params) {
7379
7379
  if (!params) {
7380
- const { dependencies, devDependencies } = await getPkg2();
7380
+ const { dependencies = {}, devDependencies = {} } = await getPkg2();
7381
7381
  const deps = [
7382
7382
  ...Object.keys(dependencies).map((key) => `${key}: ${dependencies[key]}`),
7383
7383
  ...Object.keys(devDependencies).map(
@@ -7387,7 +7387,7 @@ async function pil(params) {
7387
7387
  const { result: choose, status } = jsShell7(
7388
7388
  `echo ${deps.join(
7389
7389
  ","
7390
- )} | sed "s/,/\\n/g" | gum filter --placeholder=" \u{1F914}${process.env.PI_Lang === "zh" ? "\u8BF7\u9009\u62E9\u4E00\u4E2A\u4F9D\u8D56\u83B7\u53D6\u6700\u65B0\u7248\u672C" : "Please select a dependency to get the latest version."}"`,
7390
+ )} | sed "s/,/\\n/g" | gum filter --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."}"`,
7391
7391
  "pipe"
7392
7392
  );
7393
7393
  if (status === 130) {
@@ -7464,10 +7464,32 @@ function pu() {
7464
7464
 
7465
7465
  // src/pui.ts
7466
7466
  var import_picocolors5 = __toESM(require_picocolors(), 1);
7467
- import { useNodeWorker as useNodeWorker2 } from "lazy-js-utils";
7467
+ import { getPkg as getPkg3, jsShell as jsShell11, useNodeWorker as useNodeWorker2 } from "lazy-js-utils";
7468
7468
  var isZh4 = process.env.PI_Lang === "zh";
7469
7469
  async function pui(params, pkg) {
7470
7470
  const text = `${isZh4 ? "\u6B63\u5728\u4E3A\u60A8\u5378\u8F7D" : "Uninstalling"} ${pkg} ...`;
7471
+ if (!params) {
7472
+ const { dependencies = {}, devDependencies = {} } = await getPkg3();
7473
+ const deps = [
7474
+ ...Object.keys(dependencies).map((key) => `${key}: ${dependencies[key]}`),
7475
+ ...Object.keys(devDependencies).map(
7476
+ (key) => `${key}: ${devDependencies[key]}`
7477
+ )
7478
+ ];
7479
+ const { result: choose, status: status2 } = jsShell11(
7480
+ `echo ${deps.join(
7481
+ ","
7482
+ )} | 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."}"`,
7483
+ "pipe"
7484
+ );
7485
+ if (status2 === 130) {
7486
+ console.log(import_picocolors5.default.dim("\u5DF2\u53D6\u6D88"));
7487
+ process.exit(0);
7488
+ } else if (status2 !== 0) {
7489
+ throw new Error(choose);
7490
+ }
7491
+ pkg = params = choose.split(": ")[0];
7492
+ }
7471
7493
  const start = Date.now();
7472
7494
  let successMsg = isZh4 ? `${pkg}\u5378\u8F7D\u6210\u529F! \u{1F60A}` : `UnInstalled ${pkg} successfully! \u{1F60A}`;
7473
7495
  const failMsg = isZh4 ? `${pkg}\u5378\u8F7D\u5931\u8D25 \u{1F62D}` : `Failed to uninstall ${pkg} \u{1F62D}`;
@@ -7583,11 +7605,11 @@ async function setup() {
7583
7605
  console.log(import_picocolors7.default.red("No such file"));
7584
7606
  process11.exit(1);
7585
7607
  }
7586
- jsShell11(`go run ${target}`);
7608
+ jsShell12(`go run ${target}`);
7587
7609
  } else if (exec === "pinit") {
7588
- jsShell11(`go mod init ${params}`);
7610
+ jsShell12(`go mod init ${params}`);
7589
7611
  } else if (exec === "pbuild") {
7590
- jsShell11(`go build ${params}`);
7612
+ jsShell12(`go build ${params}`);
7591
7613
  } else {
7592
7614
  console.log(
7593
7615
  import_picocolors7.default.red(
@@ -7629,11 +7651,11 @@ async function setup() {
7629
7651
  );
7630
7652
  }
7631
7653
  } else if (exec === "prun") {
7632
- jsShell11(`cargo run ${params}`);
7654
+ jsShell12(`cargo run ${params}`);
7633
7655
  } else if (exec === "pinit") {
7634
- jsShell11(`cargo init ${params}`);
7656
+ jsShell12(`cargo init ${params}`);
7635
7657
  } else if (exec === "pbuild") {
7636
- jsShell11(`cargo build ${params}`);
7658
+ jsShell12(`cargo build ${params}`);
7637
7659
  } else {
7638
7660
  console.log(
7639
7661
  import_picocolors7.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.74",
4
+ "version": "0.0.76",
5
5
  "description": "",
6
6
  "author": "Simon He",
7
7
  "license": "MIT",
@@ -71,7 +71,6 @@
71
71
  "@types/node": "^18.11.15",
72
72
  "bumpp": "^8.2.1",
73
73
  "eslint": "^8.29.0",
74
- "esno": "^0.16.3",
75
74
  "lint-staged": "^13.1.0",
76
75
  "ora": "^6.1.2",
77
76
  "picocolors": "^1.0.0",