@simon_he/pi 0.1.6 → 0.1.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.cjs CHANGED
@@ -46,7 +46,7 @@ var import_node_process = __toESM(require("process"), 1);
46
46
  var import_node = require("lazy-js-utils/node");
47
47
 
48
48
  // package.json
49
- var version = "0.1.6";
49
+ var version = "0.1.7";
50
50
 
51
51
  // src/help.ts
52
52
  var isZh = import_node_process.default.env.PI_Lang === "zh";
@@ -299,7 +299,6 @@ async function pi(params, pkg, executor = "ni") {
299
299
  const failMsg = pkg ? isZh3 ? `${params} \u5B89\u88C5\u5931\u8D25 \u{1F62D}` : `Failed to install ${params} \u{1F62D}` : isZh3 ? "\u4F9D\u8D56\u66F4\u65B0\u5931\u8D25 \u{1F62D}" : "Failed to update dependency \u{1F62D}";
300
300
  const newParams = isLatest ? params : await getParams(params);
301
301
  let stdio = ["inherit", "pipe", "inherit"];
302
- let loading_status;
303
302
  const { PI_DEFAULT, PI_MaxSockets: sockets } = import_node_process5.default.env;
304
303
  const pkgTool = await (0, import_node6.getPkgTool)();
305
304
  const maxSockets = sockets || 4;
@@ -307,15 +306,14 @@ async function pi(params, pkg, executor = "ni") {
307
306
  if (pkgTool === "npm") {
308
307
  if (PI_DEFAULT) {
309
308
  executor = `${PI_DEFAULT} ${install}`;
310
- loading_status = await loading(text);
311
309
  } else {
312
310
  stdio = "inherit";
313
311
  executor = "ni";
314
312
  }
315
313
  } else {
316
314
  executor = `${pkgTool} ${install}`;
317
- loading_status = await loading(text);
318
315
  }
316
+ const loading_status = await loading(text);
319
317
  const runSockets = executor.split(" ")[0] === "npm" ? ` --max-sockets=${maxSockets}` : "";
320
318
  let { status, result } = await (0, import_node6.useNodeWorker)({
321
319
  params: `${executor}${newParams ? ` ${newParams}` : runSockets}`,
@@ -338,8 +336,6 @@ async function pi(params, pkg, executor = "ni") {
338
336
  status = newStatus;
339
337
  result = newResult;
340
338
  }
341
- if (stdio === "inherit")
342
- loading_status = await loading("");
343
339
  const end = Date.now();
344
340
  const costTime = (end - start) / 1e3;
345
341
  successMsg += import_picocolors4.default.blue(` ---- \u23F0\uFF1A${costTime}s`);
@@ -551,16 +547,27 @@ ${result}` : failMsg));
551
547
  var rootPath = import_node_process9.default.cwd();
552
548
  var runMap = {
553
549
  pi,
550
+ "pi.mjs": pi,
554
551
  pix,
552
+ "pix.mjs": pix,
555
553
  pa,
554
+ "pa.mjs": pa,
556
555
  pui,
556
+ "pui.mjs": pui,
557
557
  pu,
558
+ "pu.mjs": pu,
558
559
  pil,
560
+ "pil.mjs": pil,
559
561
  pci,
562
+ "pci.mjs": pci,
560
563
  prun,
564
+ "prun.mjs": prun,
561
565
  pinit,
566
+ "pinit.mjs": pinit,
562
567
  pfind,
563
- pio
568
+ "pfind.mjs": pfind,
569
+ pio,
570
+ "pio.mjs": pio
564
571
  };
565
572
  var isZh5 = import_node_process9.default.env.PI_Lang === "zh";
566
573
  async function setup() {
package/dist/index.js CHANGED
@@ -25,7 +25,7 @@ import process from "node:process";
25
25
  import { jsShell } from "lazy-js-utils/node";
26
26
 
27
27
  // package.json
28
- var version = "0.1.6";
28
+ var version = "0.1.7";
29
29
 
30
30
  // src/help.ts
31
31
  var isZh = process.env.PI_Lang === "zh";
@@ -278,7 +278,6 @@ async function pi(params, pkg, executor = "ni") {
278
278
  const failMsg = pkg ? isZh3 ? `${params} \u5B89\u88C5\u5931\u8D25 \u{1F62D}` : `Failed to install ${params} \u{1F62D}` : isZh3 ? "\u4F9D\u8D56\u66F4\u65B0\u5931\u8D25 \u{1F62D}" : "Failed to update dependency \u{1F62D}";
279
279
  const newParams = isLatest ? params : await getParams(params);
280
280
  let stdio = ["inherit", "pipe", "inherit"];
281
- let loading_status;
282
281
  const { PI_DEFAULT, PI_MaxSockets: sockets } = process5.env;
283
282
  const pkgTool = await getPkgTool2();
284
283
  const maxSockets = sockets || 4;
@@ -286,15 +285,14 @@ async function pi(params, pkg, executor = "ni") {
286
285
  if (pkgTool === "npm") {
287
286
  if (PI_DEFAULT) {
288
287
  executor = `${PI_DEFAULT} ${install}`;
289
- loading_status = await loading(text);
290
288
  } else {
291
289
  stdio = "inherit";
292
290
  executor = "ni";
293
291
  }
294
292
  } else {
295
293
  executor = `${pkgTool} ${install}`;
296
- loading_status = await loading(text);
297
294
  }
295
+ const loading_status = await loading(text);
298
296
  const runSockets = executor.split(" ")[0] === "npm" ? ` --max-sockets=${maxSockets}` : "";
299
297
  let { status, result } = await useNodeWorker({
300
298
  params: `${executor}${newParams ? ` ${newParams}` : runSockets}`,
@@ -317,8 +315,6 @@ async function pi(params, pkg, executor = "ni") {
317
315
  status = newStatus;
318
316
  result = newResult;
319
317
  }
320
- if (stdio === "inherit")
321
- loading_status = await loading("");
322
318
  const end = Date.now();
323
319
  const costTime = (end - start) / 1e3;
324
320
  successMsg += colors3.blue(` ---- \u23F0\uFF1A${costTime}s`);
@@ -530,16 +526,27 @@ ${result}` : failMsg));
530
526
  var rootPath = process9.cwd();
531
527
  var runMap = {
532
528
  pi,
529
+ "pi.mjs": pi,
533
530
  pix,
531
+ "pix.mjs": pix,
534
532
  pa,
533
+ "pa.mjs": pa,
535
534
  pui,
535
+ "pui.mjs": pui,
536
536
  pu,
537
+ "pu.mjs": pu,
537
538
  pil,
539
+ "pil.mjs": pil,
538
540
  pci,
541
+ "pci.mjs": pci,
539
542
  prun,
543
+ "prun.mjs": prun,
540
544
  pinit,
545
+ "pinit.mjs": pinit,
541
546
  pfind,
542
- pio
547
+ "pfind.mjs": pfind,
548
+ pio,
549
+ "pio.mjs": pio
543
550
  };
544
551
  var isZh5 = process9.env.PI_Lang === "zh";
545
552
  async function setup() {
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@simon_he/pi",
3
3
  "type": "module",
4
- "version": "0.1.6",
5
- "packageManager": "pnpm@9.15.9",
4
+ "version": "0.1.7",
5
+ "packageManager": "pnpm@10.6.5",
6
6
  "description": "An intelligent cross-platform package manager and CLI tool that autodetects project environments (Node.mjs, Go, Rust, Python) with beautiful loading animations and smart command execution.",
7
7
  "author": {
8
8
  "name": "Simon He",
@@ -93,14 +93,14 @@
93
93
  "ccommand": "^1.0.80",
94
94
  "fast-glob": "^3.3.3",
95
95
  "lazy-js-utils": "^0.1.37",
96
- "ora": "^6.3.1",
96
+ "ora": "^8.0.0",
97
97
  "picocolors": "^1.1.1",
98
98
  "semver": "^7.7.1"
99
99
  },
100
100
  "devDependencies": {
101
- "@antfu/eslint-config": "^4.10.2",
102
- "@types/node": "^18.19.81",
103
- "bumpp": "^8.2.1",
101
+ "@antfu/eslint-config": "^4.11.0",
102
+ "@types/node": "^22.0.0",
103
+ "bumpp": "^10.0.0",
104
104
  "eslint": "^9.23.0",
105
105
  "lint-staged": "^13.3.0",
106
106
  "prettier": "^2.8.8",
@@ -110,7 +110,7 @@
110
110
  "vitest": "^3.0.9"
111
111
  },
112
112
  "overrides": {
113
- "glob": "^9.3.5",
113
+ "glob": "^11.0.0",
114
114
  "inflight": "npm:@isaacs/inflight@^1.0.0"
115
115
  },
116
116
  "lint-staged": {