@kevisual/cli 0.0.65 → 0.0.67

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/envision.js CHANGED
@@ -40643,8 +40643,8 @@ InitEnv.init();
40643
40643
  var version = useContextKey("version", () => {
40644
40644
  let version2 = "0.0.64";
40645
40645
  try {
40646
- if ("0.0.65")
40647
- version2 = "0.0.65";
40646
+ if ("0.0.67")
40647
+ version2 = "0.0.67";
40648
40648
  } catch (e) {}
40649
40649
  return version2;
40650
40650
  });
@@ -46838,13 +46838,7 @@ var command2 = new Command("deploy").description("把前端文件传到服务器
46838
46838
  if (id && showBackend) {
46839
46839
  console.log(`
46840
46840
  `);
46841
- const pkKey = pkgInfo?.app?.key || pkgInfo?.appKey;
46842
- console.log(source_default.blue("服务端应用部署: "), "envision pack-deploy", id, "-k <key>");
46843
- if (pkKey) {
46844
- console.log(`
46845
- `);
46846
- console.log(source_default.blue("命令推荐: "), "envision pack-deploy", id, `-k ${pkKey} -f`);
46847
- }
46841
+ console.log(source_default.blue("服务端应用部署: "), "envision pack-deploy", id);
46848
46842
  console.log(`
46849
46843
  `);
46850
46844
  }
@@ -47753,17 +47747,6 @@ var packCommand = new Command("pack").description("打包应用, 使用 package.
47753
47747
  });
47754
47748
  var packDeployCommand = new Command("pack-deploy").argument("<id>", "id").option("-k, --key <key>", "fileKey, 服务器的部署文件夹的列表").option("-f --force", "force").option("-i, --install ", "install dependencies").action(async (id, opts) => {
47755
47749
  let { force, key, install: install2 } = opts || {};
47756
- if (!key) {
47757
- const answers = await dist_default12.prompt([
47758
- {
47759
- type: "input",
47760
- name: "key",
47761
- message: "Enter your deploy to services fileKey:",
47762
- when: () => !key
47763
- }
47764
- ]);
47765
- key = answers.key || key;
47766
- }
47767
47750
  const res = await deployLoadFn2(id, key, force, install2);
47768
47751
  });
47769
47752
  program.addCommand(packDeployCommand);
@@ -48321,8 +48304,9 @@ var getRunFilePath = () => {
48321
48304
  if (isJs) {
48322
48305
  const dir = path9.dirname(runFilePath);
48323
48306
  distDir = path9.relative(dir, "../dist");
48307
+ } else {
48308
+ distDir = path9.resolve(process.cwd(), "dist");
48324
48309
  }
48325
- distDir = path9.resolve(process.cwd(), "dist");
48326
48310
  return distDir;
48327
48311
  };
48328
48312
  var distFiles = ["assistant-server.js", "assistant.js", "envision.js"];
@@ -48369,7 +48353,12 @@ var downloadNewDistFiles = async (distDir) => {
48369
48353
  console.error("Error downloading files:", error);
48370
48354
  });
48371
48355
  };
48372
- var getVersion = async () => {
48356
+ var getVersion = async (force) => {
48357
+ const runFilePath = getRunFilePath();
48358
+ if (force) {
48359
+ await downloadNewDistFiles(runFilePath);
48360
+ return;
48361
+ }
48373
48362
  const baseURL3 = getConfig().baseURL || "https://kevisual.cn";
48374
48363
  const file = "package.json";
48375
48364
  const url = `${baseURL3}/root/cli/${file}`;
@@ -48379,20 +48368,20 @@ var getVersion = async () => {
48379
48368
  const latestVersion = json.version;
48380
48369
  const version2 = useContextKey("version");
48381
48370
  if (import_semver.default.lt(version2, latestVersion)) {
48382
- console.log("当前版本:", version2);
48383
- console.log("最新版本:", latestVersion);
48384
- downloadNewDistFiles(getRunFilePath());
48371
+ console.log("当前版本:", version2, "最新版本:", latestVersion, "正在更新...");
48372
+ downloadNewDistFiles(runFilePath);
48385
48373
  } else {
48386
48374
  console.log("已经是最新版本", version2);
48387
48375
  }
48388
48376
  };
48389
- var update = new Command("update").option("-g --global", "update global").option("-n --npm", "use npm to update", false).description("update cli").action((opts) => {
48377
+ var update = new Command("update").option("-g --global", "update global").option("-n --npm", "use npm to update", false).option("-f --force", "force update", false).description("update cli").action((opts) => {
48390
48378
  try {
48391
48379
  if (opts.npm) {
48392
48380
  const cmd = opts.global ? "npm install -g @kevisual/envision-cli" : "npm install -D @kevisual/envision-cli";
48393
48381
  execSync(cmd, { stdio: "inherit", encoding: "utf-8" });
48394
48382
  } else {
48395
- getVersion();
48383
+ const force = opts.force ? true : false;
48384
+ getVersion(force);
48396
48385
  }
48397
48386
  } catch (error) {
48398
48387
  console.error("Error updating CLI:", error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kevisual/cli",
3
- "version": "0.0.65",
3
+ "version": "0.0.67",
4
4
  "description": "envision 命令行工具",
5
5
  "type": "module",
6
6
  "basename": "/root/cli",
@@ -67,7 +67,7 @@
67
67
  "inquirer": "^13.0.1",
68
68
  "jsonwebtoken": "^9.0.2",
69
69
  "tar": "^7.5.2",
70
- "zustand": "^5.0.8"
70
+ "zustand": "^5.0.9"
71
71
  },
72
72
  "engines": {
73
73
  "node": ">=22.0.0"