@kevisual/cli 0.0.66 → 0.0.68
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 +31 -8
- package/dist/assistant.js +8 -7
- package/dist/envision.js +3 -20
- package/package.json +2 -2
package/dist/assistant-server.js
CHANGED
|
@@ -66407,7 +66407,6 @@ class HttpsPem {
|
|
|
66407
66407
|
if (config2.https) {
|
|
66408
66408
|
const httpsType = config2.https?.type || "https";
|
|
66409
66409
|
if (httpsType !== "https") {
|
|
66410
|
-
console.log(chalk2.yellow("当前配置文件 https.type 不是 https, 不使用证书"));
|
|
66411
66410
|
return;
|
|
66412
66411
|
}
|
|
66413
66412
|
this.isHttps = true;
|
|
@@ -67104,7 +67103,7 @@ var wsProxy = (server, config2) => {
|
|
|
67104
67103
|
wssApp.upgrade(request, socket, head);
|
|
67105
67104
|
});
|
|
67106
67105
|
};
|
|
67107
|
-
// ../node_modules/.pnpm/@kevisual+local-app-manager@0.1.
|
|
67106
|
+
// ../node_modules/.pnpm/@kevisual+local-app-manager@0.1.29_supports-color@10.2.2/node_modules/@kevisual/local-app-manager/dist/manager.mjs
|
|
67108
67107
|
var exports_manager = {};
|
|
67109
67108
|
__export(exports_manager, {
|
|
67110
67109
|
onAppShowInfo: () => onAppShowInfo,
|
|
@@ -67181,7 +67180,7 @@ var getConfigFile = (opts) => {
|
|
|
67181
67180
|
return "";
|
|
67182
67181
|
};
|
|
67183
67182
|
|
|
67184
|
-
// ../node_modules/.pnpm/@kevisual+local-app-manager@0.1.
|
|
67183
|
+
// ../node_modules/.pnpm/@kevisual+local-app-manager@0.1.29_supports-color@10.2.2/node_modules/@kevisual/local-app-manager/dist/manager.mjs
|
|
67185
67184
|
import path$1 from "node:path";
|
|
67186
67185
|
import fs$4 from "node:fs";
|
|
67187
67186
|
import { fork } from "node:child_process";
|
|
@@ -74114,7 +74113,9 @@ var installAppFromKey = async (key, _appPath) => {
|
|
|
74114
74113
|
var getAppPathKeys = async (_appPath) => {
|
|
74115
74114
|
const directory = path$1.resolve(_appPath);
|
|
74116
74115
|
const root3 = directory;
|
|
74117
|
-
const
|
|
74116
|
+
const path1 = path$1.join(directory, "*/package.json");
|
|
74117
|
+
const path22 = path$1.join(directory, "*/*/package.json");
|
|
74118
|
+
const appsPackages = await glob([path1, path22], {
|
|
74118
74119
|
cwd: root3,
|
|
74119
74120
|
onlyFiles: true,
|
|
74120
74121
|
absolute: false,
|
|
@@ -74136,7 +74137,7 @@ var clearMicroApp = (link) => {
|
|
|
74136
74137
|
console.error(`Failed to unload module ${link}:`, error2);
|
|
74137
74138
|
}
|
|
74138
74139
|
};
|
|
74139
|
-
// ../node_modules/.pnpm/@kevisual+local-app-manager@0.1.
|
|
74140
|
+
// ../node_modules/.pnpm/@kevisual+local-app-manager@0.1.29_supports-color@10.2.2/node_modules/@kevisual/local-app-manager/dist/pm2.mjs
|
|
74140
74141
|
import pm22 from "pm2";
|
|
74141
74142
|
import { promisify as promisify2 } from "node:util";
|
|
74142
74143
|
var disconnect = promisify2(pm22.disconnect).bind(pm22);
|
|
@@ -80491,7 +80492,7 @@ app.route({
|
|
|
80491
80492
|
// src/routes/index.ts
|
|
80492
80493
|
import os4 from "node:os";
|
|
80493
80494
|
|
|
80494
|
-
// ../node_modules/.pnpm/lru-cache@11.2.
|
|
80495
|
+
// ../node_modules/.pnpm/lru-cache@11.2.4/node_modules/lru-cache/dist/esm/index.js
|
|
80495
80496
|
var defaultPerf = typeof performance === "object" && performance && typeof performance.now === "function" ? performance : Date;
|
|
80496
80497
|
var warned = new Set;
|
|
80497
80498
|
var PROCESS = typeof process === "object" && !!process ? process : {};
|
|
@@ -80615,6 +80616,7 @@ class LRUCache {
|
|
|
80615
80616
|
#sizes;
|
|
80616
80617
|
#starts;
|
|
80617
80618
|
#ttls;
|
|
80619
|
+
#autopurgeTimers;
|
|
80618
80620
|
#hasDispose;
|
|
80619
80621
|
#hasFetchMethod;
|
|
80620
80622
|
#hasDisposeAfter;
|
|
@@ -80623,6 +80625,7 @@ class LRUCache {
|
|
|
80623
80625
|
return {
|
|
80624
80626
|
starts: c.#starts,
|
|
80625
80627
|
ttls: c.#ttls,
|
|
80628
|
+
autopurgeTimers: c.#autopurgeTimers,
|
|
80626
80629
|
sizes: c.#sizes,
|
|
80627
80630
|
keyMap: c.#keyMap,
|
|
80628
80631
|
keyList: c.#keyList,
|
|
@@ -80783,10 +80786,16 @@ class LRUCache {
|
|
|
80783
80786
|
const starts = new ZeroArray(this.#max);
|
|
80784
80787
|
this.#ttls = ttls;
|
|
80785
80788
|
this.#starts = starts;
|
|
80789
|
+
const purgeTimers = this.ttlAutopurge ? new Array(this.#max) : undefined;
|
|
80790
|
+
this.#autopurgeTimers = purgeTimers;
|
|
80786
80791
|
this.#setItemTTL = (index, ttl, start3 = this.#perf.now()) => {
|
|
80787
80792
|
starts[index] = ttl !== 0 ? start3 : 0;
|
|
80788
80793
|
ttls[index] = ttl;
|
|
80789
|
-
if (
|
|
80794
|
+
if (purgeTimers?.[index]) {
|
|
80795
|
+
clearTimeout(purgeTimers[index]);
|
|
80796
|
+
purgeTimers[index] = undefined;
|
|
80797
|
+
}
|
|
80798
|
+
if (ttl !== 0 && purgeTimers) {
|
|
80790
80799
|
const t = setTimeout(() => {
|
|
80791
80800
|
if (this.#isStale(index)) {
|
|
80792
80801
|
this.#delete(this.#keyList[index], "expire");
|
|
@@ -80795,6 +80804,7 @@ class LRUCache {
|
|
|
80795
80804
|
if (t.unref) {
|
|
80796
80805
|
t.unref();
|
|
80797
80806
|
}
|
|
80807
|
+
purgeTimers[index] = t;
|
|
80798
80808
|
}
|
|
80799
80809
|
};
|
|
80800
80810
|
this.#updateItemAge = (index) => {
|
|
@@ -81207,6 +81217,10 @@ class LRUCache {
|
|
|
81207
81217
|
}
|
|
81208
81218
|
}
|
|
81209
81219
|
this.#removeItemSize(head);
|
|
81220
|
+
if (this.#autopurgeTimers?.[head]) {
|
|
81221
|
+
clearTimeout(this.#autopurgeTimers[head]);
|
|
81222
|
+
this.#autopurgeTimers[head] = undefined;
|
|
81223
|
+
}
|
|
81210
81224
|
if (free) {
|
|
81211
81225
|
this.#keyList[head] = undefined;
|
|
81212
81226
|
this.#valList[head] = undefined;
|
|
@@ -81541,6 +81555,10 @@ class LRUCache {
|
|
|
81541
81555
|
if (this.#size !== 0) {
|
|
81542
81556
|
const index = this.#keyMap.get(k);
|
|
81543
81557
|
if (index !== undefined) {
|
|
81558
|
+
if (this.#autopurgeTimers?.[index]) {
|
|
81559
|
+
clearTimeout(this.#autopurgeTimers?.[index]);
|
|
81560
|
+
this.#autopurgeTimers[index] = undefined;
|
|
81561
|
+
}
|
|
81544
81562
|
deleted = true;
|
|
81545
81563
|
if (this.#size === 1) {
|
|
81546
81564
|
this.#clear(reason);
|
|
@@ -81608,6 +81626,11 @@ class LRUCache {
|
|
|
81608
81626
|
if (this.#ttls && this.#starts) {
|
|
81609
81627
|
this.#ttls.fill(0);
|
|
81610
81628
|
this.#starts.fill(0);
|
|
81629
|
+
for (const t of this.#autopurgeTimers ?? []) {
|
|
81630
|
+
if (t !== undefined)
|
|
81631
|
+
clearTimeout(t);
|
|
81632
|
+
}
|
|
81633
|
+
this.#autopurgeTimers?.fill(undefined);
|
|
81611
81634
|
}
|
|
81612
81635
|
if (this.#sizes) {
|
|
81613
81636
|
this.#sizes.fill(0);
|
|
@@ -81939,7 +81962,7 @@ program.description("启动服务").option("-d, --daemon", "是否以守护进
|
|
|
81939
81962
|
console.log("启动服务", source_default.green(assistantConfig2.configDir));
|
|
81940
81963
|
const config3 = assistantConfig2.getCacheAssistantConfig();
|
|
81941
81964
|
const listenPort = options.port || config3?.server?.port;
|
|
81942
|
-
const listenPath = config3?.server?.path || "
|
|
81965
|
+
const listenPath = config3?.server?.path || "::";
|
|
81943
81966
|
const server = await runServer(listenPort, listenPath);
|
|
81944
81967
|
} else {
|
|
81945
81968
|
console.log("请使用 -s 参数启动服务");
|
package/dist/assistant.js
CHANGED
|
@@ -41648,7 +41648,7 @@ var import_websocket_server = __toESM(require_websocket_server(), 1);
|
|
|
41648
41648
|
var wss = new import_websocket_server.default({
|
|
41649
41649
|
noServer: true
|
|
41650
41650
|
});
|
|
41651
|
-
// ../node_modules/.pnpm/@kevisual+local-app-manager@0.1.
|
|
41651
|
+
// ../node_modules/.pnpm/@kevisual+local-app-manager@0.1.29_supports-color@10.2.2/node_modules/@kevisual/local-app-manager/dist/manager.mjs
|
|
41652
41652
|
var exports_manager = {};
|
|
41653
41653
|
__export(exports_manager, {
|
|
41654
41654
|
onAppShowInfo: () => onAppShowInfo,
|
|
@@ -41725,7 +41725,7 @@ var getConfigFile = (opts) => {
|
|
|
41725
41725
|
return "";
|
|
41726
41726
|
};
|
|
41727
41727
|
|
|
41728
|
-
// ../node_modules/.pnpm/@kevisual+local-app-manager@0.1.
|
|
41728
|
+
// ../node_modules/.pnpm/@kevisual+local-app-manager@0.1.29_supports-color@10.2.2/node_modules/@kevisual/local-app-manager/dist/manager.mjs
|
|
41729
41729
|
import path$1 from "node:path";
|
|
41730
41730
|
import fs$4 from "node:fs";
|
|
41731
41731
|
import { fork } from "node:child_process";
|
|
@@ -48658,7 +48658,9 @@ var installAppFromKey = async (key, _appPath) => {
|
|
|
48658
48658
|
var getAppPathKeys = async (_appPath) => {
|
|
48659
48659
|
const directory = path$1.resolve(_appPath);
|
|
48660
48660
|
const root2 = directory;
|
|
48661
|
-
const
|
|
48661
|
+
const path1 = path$1.join(directory, "*/package.json");
|
|
48662
|
+
const path22 = path$1.join(directory, "*/*/package.json");
|
|
48663
|
+
const appsPackages = await glob([path1, path22], {
|
|
48662
48664
|
cwd: root2,
|
|
48663
48665
|
onlyFiles: true,
|
|
48664
48666
|
absolute: false,
|
|
@@ -48680,7 +48682,7 @@ var clearMicroApp = (link) => {
|
|
|
48680
48682
|
console.error(`Failed to unload module ${link}:`, error2);
|
|
48681
48683
|
}
|
|
48682
48684
|
};
|
|
48683
|
-
// ../node_modules/.pnpm/@kevisual+local-app-manager@0.1.
|
|
48685
|
+
// ../node_modules/.pnpm/@kevisual+local-app-manager@0.1.29_supports-color@10.2.2/node_modules/@kevisual/local-app-manager/dist/pm2.mjs
|
|
48684
48686
|
import pm22 from "pm2";
|
|
48685
48687
|
import { promisify as promisify2 } from "node:util";
|
|
48686
48688
|
var disconnect = promisify2(pm22.disconnect).bind(pm22);
|
|
@@ -48984,8 +48986,8 @@ var assistantConfig2 = new AssistantConfig({
|
|
|
48984
48986
|
import fs7 from "fs";
|
|
48985
48987
|
var version = "0.0.1";
|
|
48986
48988
|
try {
|
|
48987
|
-
if ("0.0.
|
|
48988
|
-
version = "0.0.
|
|
48989
|
+
if ("0.0.6")
|
|
48990
|
+
version = "0.0.6";
|
|
48989
48991
|
} catch (e) {}
|
|
48990
48992
|
program.name("asst").description("A CLI tool with envison").version(version, "-v, --version", "output the current version");
|
|
48991
48993
|
var ls = new Command("ls").description("List files in the current directory").action(() => {
|
|
@@ -66249,7 +66251,6 @@ class HttpsPem {
|
|
|
66249
66251
|
if (config2.https) {
|
|
66250
66252
|
const httpsType = config2.https?.type || "https";
|
|
66251
66253
|
if (httpsType !== "https") {
|
|
66252
|
-
console.log(chalk2.yellow("当前配置文件 https.type 不是 https, 不使用证书"));
|
|
66253
66254
|
return;
|
|
66254
66255
|
}
|
|
66255
66256
|
this.isHttps = true;
|
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.68")
|
|
40647
|
+
version2 = "0.0.68";
|
|
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
|
-
|
|
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);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kevisual/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.68",
|
|
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.
|
|
70
|
+
"zustand": "^5.0.9"
|
|
71
71
|
},
|
|
72
72
|
"engines": {
|
|
73
73
|
"node": ">=22.0.0"
|