@simon_he/pi 0.1.7 → 0.1.9

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.7";
49
+ var version = "0.1.9";
50
50
 
51
51
  // src/help.ts
52
52
  var isZh = import_node_process.default.env.PI_Lang === "zh";
@@ -299,6 +299,7 @@ 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;
302
303
  const { PI_DEFAULT, PI_MaxSockets: sockets } = import_node_process5.default.env;
303
304
  const pkgTool = await (0, import_node6.getPkgTool)();
304
305
  const maxSockets = sockets || 4;
@@ -306,14 +307,15 @@ async function pi(params, pkg, executor = "ni") {
306
307
  if (pkgTool === "npm") {
307
308
  if (PI_DEFAULT) {
308
309
  executor = `${PI_DEFAULT} ${install}`;
310
+ loading_status = await loading(text);
309
311
  } else {
310
312
  stdio = "inherit";
311
313
  executor = "ni";
312
314
  }
313
315
  } else {
314
316
  executor = `${pkgTool} ${install}`;
317
+ loading_status = await loading(text);
315
318
  }
316
- const loading_status = await loading(text);
317
319
  const runSockets = executor.split(" ")[0] === "npm" ? ` --max-sockets=${maxSockets}` : "";
318
320
  let { status, result } = await (0, import_node6.useNodeWorker)({
319
321
  params: `${executor}${newParams ? ` ${newParams}` : runSockets}`,
@@ -336,6 +338,8 @@ async function pi(params, pkg, executor = "ni") {
336
338
  status = newStatus;
337
339
  result = newResult;
338
340
  }
341
+ if (stdio === "inherit")
342
+ loading_status = await loading("");
339
343
  const end = Date.now();
340
344
  const costTime = (end - start) / 1e3;
341
345
  successMsg += import_picocolors4.default.blue(` ---- \u23F0\uFF1A${costTime}s`);
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.7";
28
+ var version = "0.1.9";
29
29
 
30
30
  // src/help.ts
31
31
  var isZh = process.env.PI_Lang === "zh";
@@ -278,6 +278,7 @@ 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;
281
282
  const { PI_DEFAULT, PI_MaxSockets: sockets } = process5.env;
282
283
  const pkgTool = await getPkgTool2();
283
284
  const maxSockets = sockets || 4;
@@ -285,14 +286,15 @@ async function pi(params, pkg, executor = "ni") {
285
286
  if (pkgTool === "npm") {
286
287
  if (PI_DEFAULT) {
287
288
  executor = `${PI_DEFAULT} ${install}`;
289
+ loading_status = await loading(text);
288
290
  } else {
289
291
  stdio = "inherit";
290
292
  executor = "ni";
291
293
  }
292
294
  } else {
293
295
  executor = `${pkgTool} ${install}`;
296
+ loading_status = await loading(text);
294
297
  }
295
- const loading_status = await loading(text);
296
298
  const runSockets = executor.split(" ")[0] === "npm" ? ` --max-sockets=${maxSockets}` : "";
297
299
  let { status, result } = await useNodeWorker({
298
300
  params: `${executor}${newParams ? ` ${newParams}` : runSockets}`,
@@ -315,6 +317,8 @@ async function pi(params, pkg, executor = "ni") {
315
317
  status = newStatus;
316
318
  result = newResult;
317
319
  }
320
+ if (stdio === "inherit")
321
+ loading_status = await loading("");
318
322
  const end = Date.now();
319
323
  const costTime = (end - start) / 1e3;
320
324
  successMsg += colors3.blue(` ---- \u23F0\uFF1A${costTime}s`);
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@simon_he/pi",
3
3
  "type": "module",
4
- "version": "0.1.7",
5
- "packageManager": "pnpm@10.6.5",
4
+ "version": "0.1.9",
5
+ "packageManager": "pnpm@10.7.0",
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",
@@ -90,17 +90,17 @@
90
90
  "test": "vitest"
91
91
  },
92
92
  "dependencies": {
93
- "ccommand": "^1.0.80",
93
+ "ccommand": "^1.0.82",
94
94
  "fast-glob": "^3.3.3",
95
95
  "lazy-js-utils": "^0.1.37",
96
- "ora": "^8.0.0",
96
+ "ora": "^8.2.0",
97
97
  "picocolors": "^1.1.1",
98
98
  "semver": "^7.7.1"
99
99
  },
100
100
  "devDependencies": {
101
101
  "@antfu/eslint-config": "^4.11.0",
102
- "@types/node": "^22.0.0",
103
- "bumpp": "^10.0.0",
102
+ "@types/node": "^22.13.14",
103
+ "bumpp": "^10.1.0",
104
104
  "eslint": "^9.23.0",
105
105
  "lint-staged": "^13.3.0",
106
106
  "prettier": "^2.8.8",
@@ -109,10 +109,6 @@
109
109
  "typescript": "^4.9.5",
110
110
  "vitest": "^3.0.9"
111
111
  },
112
- "overrides": {
113
- "glob": "^11.0.0",
114
- "inflight": "npm:@isaacs/inflight@^1.0.0"
115
- },
116
112
  "lint-staged": {
117
113
  "*.{vue,js,ts,jsx,tsx,md,json}": "eslint . --fix"
118
114
  }