@kevisual/cli 0.0.65 → 0.0.66
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/assistant-server.js +242 -5709
- package/dist/assistant.js +123 -5592
- package/dist/envision.js +15 -9
- package/package.json +1 -1
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.
|
|
40647
|
-
version2 = "0.0.
|
|
40646
|
+
if ("0.0.66")
|
|
40647
|
+
version2 = "0.0.66";
|
|
40648
40648
|
} catch (e) {}
|
|
40649
40649
|
return version2;
|
|
40650
40650
|
});
|
|
@@ -48321,8 +48321,9 @@ var getRunFilePath = () => {
|
|
|
48321
48321
|
if (isJs) {
|
|
48322
48322
|
const dir = path9.dirname(runFilePath);
|
|
48323
48323
|
distDir = path9.relative(dir, "../dist");
|
|
48324
|
+
} else {
|
|
48325
|
+
distDir = path9.resolve(process.cwd(), "dist");
|
|
48324
48326
|
}
|
|
48325
|
-
distDir = path9.resolve(process.cwd(), "dist");
|
|
48326
48327
|
return distDir;
|
|
48327
48328
|
};
|
|
48328
48329
|
var distFiles = ["assistant-server.js", "assistant.js", "envision.js"];
|
|
@@ -48369,7 +48370,12 @@ var downloadNewDistFiles = async (distDir) => {
|
|
|
48369
48370
|
console.error("Error downloading files:", error);
|
|
48370
48371
|
});
|
|
48371
48372
|
};
|
|
48372
|
-
var getVersion = async () => {
|
|
48373
|
+
var getVersion = async (force) => {
|
|
48374
|
+
const runFilePath = getRunFilePath();
|
|
48375
|
+
if (force) {
|
|
48376
|
+
await downloadNewDistFiles(runFilePath);
|
|
48377
|
+
return;
|
|
48378
|
+
}
|
|
48373
48379
|
const baseURL3 = getConfig().baseURL || "https://kevisual.cn";
|
|
48374
48380
|
const file = "package.json";
|
|
48375
48381
|
const url = `${baseURL3}/root/cli/${file}`;
|
|
@@ -48379,20 +48385,20 @@ var getVersion = async () => {
|
|
|
48379
48385
|
const latestVersion = json.version;
|
|
48380
48386
|
const version2 = useContextKey("version");
|
|
48381
48387
|
if (import_semver.default.lt(version2, latestVersion)) {
|
|
48382
|
-
console.log("当前版本:", version2);
|
|
48383
|
-
|
|
48384
|
-
downloadNewDistFiles(getRunFilePath());
|
|
48388
|
+
console.log("当前版本:", version2, "最新版本:", latestVersion, "正在更新...");
|
|
48389
|
+
downloadNewDistFiles(runFilePath);
|
|
48385
48390
|
} else {
|
|
48386
48391
|
console.log("已经是最新版本", version2);
|
|
48387
48392
|
}
|
|
48388
48393
|
};
|
|
48389
|
-
var update = new Command("update").option("-g --global", "update global").option("-n --npm", "use npm to update", false).description("update cli").action((opts) => {
|
|
48394
|
+
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
48395
|
try {
|
|
48391
48396
|
if (opts.npm) {
|
|
48392
48397
|
const cmd = opts.global ? "npm install -g @kevisual/envision-cli" : "npm install -D @kevisual/envision-cli";
|
|
48393
48398
|
execSync(cmd, { stdio: "inherit", encoding: "utf-8" });
|
|
48394
48399
|
} else {
|
|
48395
|
-
|
|
48400
|
+
const force = opts.force ? true : false;
|
|
48401
|
+
getVersion(force);
|
|
48396
48402
|
}
|
|
48397
48403
|
} catch (error) {
|
|
48398
48404
|
console.error("Error updating CLI:", error);
|