@simon_he/pi 0.1.16 → 0.1.18

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.16";
49
+ var version = "0.1.18";
50
50
 
51
51
  // src/help.ts
52
52
  var isZh = import_node_process.default.env.PI_Lang === "zh";
@@ -131,7 +131,7 @@ async function detectNode() {
131
131
  let pkg;
132
132
  try {
133
133
  pkg = await (0, import_node4.getPkg)();
134
- } catch (_) {
134
+ } catch {
135
135
  const cwd = import_node_process3.default.cwd();
136
136
  console.log(import_picocolors2.default.red(`\u5F53\u524D\u76EE\u5F55: ${cwd} \u6CA1\u6709package.json\u6587\u4EF6`));
137
137
  import_node_process3.default.exit(1);
@@ -236,7 +236,7 @@ async function getParams(params) {
236
236
  default:
237
237
  return params;
238
238
  }
239
- } catch (_) {
239
+ } catch {
240
240
  console.log(
241
241
  import_picocolors3.default.red(
242
242
  `${isZh2 ? "package.json\u5E76\u4E0D\u5B58\u5728,\u5728\u4EE5\u4E0B\u76EE\u5F55\u4E2D:" : "package.json has not been found in"} ${import_node_process4.default.cwd()}`
@@ -319,7 +319,11 @@ async function pi(params, pkg, executor = "ni") {
319
319
  }
320
320
  const newParams = isLatest ? "" : await getParams(params);
321
321
  const runSockets = executor.split(" ")[0] === "npm" ? ` --max-sockets=${maxSockets}` : "";
322
- console.log(import_picocolors4.default.green(isLatest ? params.map((p) => `${executor} ${p}`).join(" & ") : `${executor}${newParams ? ` ${newParams}` : runSockets}`));
322
+ console.log(
323
+ import_picocolors4.default.green(
324
+ isLatest ? params.map((p) => `${executor} ${p}`).join(" & ") : `${executor}${newParams ? ` ${newParams}` : runSockets}`
325
+ )
326
+ );
323
327
  let { status, result } = await (0, import_node6.useNodeWorker)({
324
328
  params: isLatest ? params.map((p) => `${executor} ${p}`).join(" & ") : `${executor}${newParams ? ` ${newParams}` : runSockets}`,
325
329
  stdio,
@@ -387,7 +391,9 @@ async function pil(params) {
387
391
  const { dependencies = {}, devDependencies = {} } = await (0, import_node7.getPkg)();
388
392
  if (!params) {
389
393
  const deps = [
390
- ...Object.keys(dependencies).map((key) => `${key}: ${dependencies[key].replace(/([><~])/g, "\\$1")}`),
394
+ ...Object.keys(dependencies).map(
395
+ (key) => `${key}: ${dependencies[key].replace(/([><~])/g, "\\$1")}`
396
+ ),
391
397
  ...Object.keys(devDependencies).map(
392
398
  (key) => `${key}: ${devDependencies[key].replace(/([><~])/g, "\\$1")}`
393
399
  )
@@ -395,7 +401,7 @@ async function pil(params) {
395
401
  const { result: choose, status } = await (0, import_node7.jsShell)(
396
402
  `echo ${deps.join(
397
403
  ","
398
- )} | sed "s/,/\\n/g" | gum filter --no-limit --strict=false --placeholder=" \u{1F914}${import_node_process6.default.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."}"`,
404
+ )} | sed "s/,/\\n/g" | gum filter --no-limit --placeholder=" \u{1F914}${import_node_process6.default.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."}"`,
399
405
  {
400
406
  stdio: ["inherit", "pipe", "inherit"]
401
407
  }
@@ -435,7 +441,9 @@ async function pil(params) {
435
441
  group[flag] = [];
436
442
  group[flag].push(pkg);
437
443
  }
438
- const cmds = Object.entries(group).map(([flag, pkgs]) => `${pkgs.join(" ")} ${flag}`);
444
+ const cmds = Object.entries(group).map(
445
+ ([flag, pkgs]) => `${pkgs.join(" ")} ${flag}`
446
+ );
439
447
  return await pi(cmds, latestPkgname.replace(/@latest/g, ""), "pil");
440
448
  }
441
449
 
package/dist/index.js CHANGED
@@ -6,8 +6,8 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
6
6
  });
7
7
 
8
8
  // src/index.ts
9
- import path2 from "node:path";
10
- import process9 from "node:process";
9
+ import path2 from "path";
10
+ import process9 from "process";
11
11
  import { ccommand as ccommand3 } from "ccommand";
12
12
  import fg from "fast-glob";
13
13
  import { isWin, spaceFormat } from "lazy-js-utils";
@@ -21,11 +21,11 @@ import {
21
21
  import color3 from "picocolors";
22
22
 
23
23
  // src/help.ts
24
- import process from "node:process";
24
+ import process from "process";
25
25
  import { jsShell } from "lazy-js-utils/node";
26
26
 
27
27
  // package.json
28
- var version = "0.1.16";
28
+ var version = "0.1.18";
29
29
 
30
30
  // src/help.ts
31
31
  var isZh = process.env.PI_Lang === "zh";
@@ -48,7 +48,7 @@ async function help(argv) {
48
48
  }
49
49
 
50
50
  // src/installDeps.ts
51
- import process2 from "node:process";
51
+ import process2 from "process";
52
52
  import { isInstallPkg, jsShell as jsShell2 } from "lazy-js-utils/node";
53
53
  import color from "picocolors";
54
54
  async function installDeps() {
@@ -97,20 +97,20 @@ function pa() {
97
97
  }
98
98
 
99
99
  // src/pi.ts
100
- import { log } from "node:console";
101
- import process5 from "node:process";
100
+ import { log } from "console";
101
+ import process5 from "process";
102
102
  import { getPkgTool as getPkgTool2, jsShell as jsShell6, useNodeWorker } from "lazy-js-utils/node";
103
103
  import colors3 from "picocolors";
104
104
 
105
105
  // src/detectNode.ts
106
- import process3 from "node:process";
106
+ import process3 from "process";
107
107
  import { getPkg, jsShell as jsShell4 } from "lazy-js-utils/node";
108
108
  import colors from "picocolors";
109
109
  async function detectNode() {
110
110
  let pkg;
111
111
  try {
112
112
  pkg = await getPkg();
113
- } catch (_) {
113
+ } catch {
114
114
  const cwd = process3.cwd();
115
115
  console.log(colors.red(`\u5F53\u524D\u76EE\u5F55: ${cwd} \u6CA1\u6709package.json\u6587\u4EF6`));
116
116
  process3.exit(1);
@@ -144,8 +144,8 @@ no" | gum filter --placeholder=" \u5F53\u524Dnode\u7248\u672C\u4E0D\u6EE1\u8DB3
144
144
  }
145
145
 
146
146
  // src/utils.ts
147
- import path from "node:path";
148
- import process4 from "node:process";
147
+ import path from "path";
148
+ import process4 from "process";
149
149
  import { isFile } from "lazy-js-utils";
150
150
  import { getPkg as getPkg2, getPkgTool, jsShell as jsShell5 } from "lazy-js-utils/node";
151
151
  import colors2 from "picocolors";
@@ -215,7 +215,7 @@ async function getParams(params) {
215
215
  default:
216
216
  return params;
217
217
  }
218
- } catch (_) {
218
+ } catch {
219
219
  console.log(
220
220
  colors2.red(
221
221
  `${isZh2 ? "package.json\u5E76\u4E0D\u5B58\u5728,\u5728\u4EE5\u4E0B\u76EE\u5F55\u4E2D:" : "package.json has not been found in"} ${process4.cwd()}`
@@ -298,7 +298,11 @@ async function pi(params, pkg, executor = "ni") {
298
298
  }
299
299
  const newParams = isLatest ? "" : await getParams(params);
300
300
  const runSockets = executor.split(" ")[0] === "npm" ? ` --max-sockets=${maxSockets}` : "";
301
- console.log(colors3.green(isLatest ? params.map((p) => `${executor} ${p}`).join(" & ") : `${executor}${newParams ? ` ${newParams}` : runSockets}`));
301
+ console.log(
302
+ colors3.green(
303
+ isLatest ? params.map((p) => `${executor} ${p}`).join(" & ") : `${executor}${newParams ? ` ${newParams}` : runSockets}`
304
+ )
305
+ );
302
306
  let { status, result } = await useNodeWorker({
303
307
  params: isLatest ? params.map((p) => `${executor} ${p}`).join(" & ") : `${executor}${newParams ? ` ${newParams}` : runSockets}`,
304
308
  stdio,
@@ -359,14 +363,16 @@ function pfind(params) {
359
363
  }
360
364
 
361
365
  // src/pil.ts
362
- import process6 from "node:process";
366
+ import process6 from "process";
363
367
  import { getPkg as getPkg3, jsShell as jsShell7 } from "lazy-js-utils/node";
364
368
  import pc from "picocolors";
365
369
  async function pil(params) {
366
370
  const { dependencies = {}, devDependencies = {} } = await getPkg3();
367
371
  if (!params) {
368
372
  const deps = [
369
- ...Object.keys(dependencies).map((key) => `${key}: ${dependencies[key].replace(/([><~])/g, "\\$1")}`),
373
+ ...Object.keys(dependencies).map(
374
+ (key) => `${key}: ${dependencies[key].replace(/([><~])/g, "\\$1")}`
375
+ ),
370
376
  ...Object.keys(devDependencies).map(
371
377
  (key) => `${key}: ${devDependencies[key].replace(/([><~])/g, "\\$1")}`
372
378
  )
@@ -374,7 +380,7 @@ async function pil(params) {
374
380
  const { result: choose, status } = await jsShell7(
375
381
  `echo ${deps.join(
376
382
  ","
377
- )} | sed "s/,/\\n/g" | gum filter --no-limit --strict=false --placeholder=" \u{1F914}${process6.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."}"`,
383
+ )} | sed "s/,/\\n/g" | gum filter --no-limit --placeholder=" \u{1F914}${process6.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."}"`,
378
384
  {
379
385
  stdio: ["inherit", "pipe", "inherit"]
380
386
  }
@@ -414,7 +420,9 @@ async function pil(params) {
414
420
  group[flag] = [];
415
421
  group[flag].push(pkg);
416
422
  }
417
- const cmds = Object.entries(group).map(([flag, pkgs]) => `${pkgs.join(" ")} ${flag}`);
423
+ const cmds = Object.entries(group).map(
424
+ ([flag, pkgs]) => `${pkgs.join(" ")} ${flag}`
425
+ );
418
426
  return await pi(cmds, latestPkgname.replace(/@latest/g, ""), "pil");
419
427
  }
420
428
 
@@ -438,7 +446,7 @@ async function pinit() {
438
446
  }
439
447
 
440
448
  // src/pio.ts
441
- import process7 from "node:process";
449
+ import process7 from "process";
442
450
  import { useNodeWorker as useNodeWorker2 } from "lazy-js-utils/node";
443
451
  import color2 from "picocolors";
444
452
  async function pio(params, pkg, executor = "ni") {
@@ -484,7 +492,7 @@ function pu() {
484
492
  }
485
493
 
486
494
  // src/pui.ts
487
- import process8 from "node:process";
495
+ import process8 from "process";
488
496
  import { getPkg as getPkg4, jsShell as jsShell11, useNodeWorker as useNodeWorker3 } from "lazy-js-utils/node";
489
497
  import colors4 from "picocolors";
490
498
  var isZh4 = process8.env.PI_Lang === "zh";
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@simon_he/pi",
3
3
  "type": "module",
4
- "version": "0.1.16",
5
- "packageManager": "pnpm@10.12.1",
4
+ "version": "0.1.18",
5
+ "packageManager": "pnpm@10.15.1",
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,24 +90,24 @@
90
90
  "test": "vitest"
91
91
  },
92
92
  "dependencies": {
93
- "ccommand": "^1.0.84",
93
+ "ccommand": "^1.0.87",
94
94
  "fast-glob": "^3.3.3",
95
- "lazy-js-utils": "^0.1.44",
95
+ "lazy-js-utils": "^0.1.47",
96
96
  "ora": "^8.2.0",
97
97
  "picocolors": "^1.1.1",
98
98
  "semver": "^7.7.2"
99
99
  },
100
100
  "devDependencies": {
101
- "@antfu/eslint-config": "^4.14.1",
102
- "@types/node": "^22.15.31",
103
- "bumpp": "^10.1.1",
104
- "eslint": "^9.28.0",
101
+ "@antfu/eslint-config": "^4.19.0",
102
+ "@types/node": "^22.18.1",
103
+ "bumpp": "^10.2.3",
104
+ "eslint": "^9.35.0",
105
105
  "lint-staged": "^13.3.0",
106
106
  "prettier": "^2.8.8",
107
107
  "tsup": "^8.5.0",
108
- "tsx": "^4.20.1",
109
- "typescript": "^5.8.3",
110
- "vitest": "^3.2.3"
108
+ "tsx": "^4.20.5",
109
+ "typescript": "^5.9.2",
110
+ "vitest": "^3.2.4"
111
111
  },
112
112
  "lint-staged": {
113
113
  "*.{vue,js,ts,jsx,tsx,md,json}": "eslint . --fix"