@simon_he/pi 0.0.83 → 0.0.84

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
@@ -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.84";
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 {
package/dist/index.js CHANGED
@@ -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.84";
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 {
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.84",
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": {