@kevisual/cli 0.1.23 → 0.1.25

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
@@ -10420,7 +10420,7 @@ var require_out2 = __commonJS((exports) => {
10420
10420
  }
10421
10421
  });
10422
10422
 
10423
- // node_modules/.pnpm/reusify@1.0.4/node_modules/reusify/reusify.js
10423
+ // node_modules/.pnpm/reusify@1.1.0/node_modules/reusify/reusify.js
10424
10424
  var require_reusify = __commonJS((exports, module) => {
10425
10425
  function reusify(Constructor) {
10426
10426
  var head = new Constructor;
@@ -10448,7 +10448,7 @@ var require_reusify = __commonJS((exports, module) => {
10448
10448
  module.exports = reusify;
10449
10449
  });
10450
10450
 
10451
- // node_modules/.pnpm/fastq@1.17.1/node_modules/fastq/queue.js
10451
+ // node_modules/.pnpm/fastq@1.20.1/node_modules/fastq/queue.js
10452
10452
  var require_queue = __commonJS((exports, module) => {
10453
10453
  var reusify = require_reusify();
10454
10454
  function fastqueue(context, worker, _concurrency) {
@@ -10495,7 +10495,8 @@ var require_queue = __commonJS((exports, module) => {
10495
10495
  empty: noop,
10496
10496
  kill,
10497
10497
  killAndDrain,
10498
- error
10498
+ error,
10499
+ abort
10499
10500
  };
10500
10501
  return self2;
10501
10502
  function running() {
@@ -10615,6 +10616,28 @@ var require_queue = __commonJS((exports, module) => {
10615
10616
  self2.drain();
10616
10617
  self2.drain = noop;
10617
10618
  }
10619
+ function abort() {
10620
+ var current = queueHead;
10621
+ queueHead = null;
10622
+ queueTail = null;
10623
+ while (current) {
10624
+ var next = current.next;
10625
+ var callback = current.callback;
10626
+ var errorHandler2 = current.errorHandler;
10627
+ var val = current.value;
10628
+ var context2 = current.context;
10629
+ current.value = null;
10630
+ current.callback = noop;
10631
+ current.errorHandler = null;
10632
+ if (errorHandler2) {
10633
+ errorHandler2(new Error("abort"), val);
10634
+ }
10635
+ callback.call(context2, new Error("abort"));
10636
+ current.release(current);
10637
+ current = next;
10638
+ }
10639
+ self2.drain = noop;
10640
+ }
10618
10641
  function error(handler) {
10619
10642
  errorHandler = handler;
10620
10643
  }
@@ -10686,17 +10709,20 @@ var require_queue = __commonJS((exports, module) => {
10686
10709
  return p;
10687
10710
  }
10688
10711
  function drained() {
10689
- if (queue.idle()) {
10690
- return new Promise(function(resolve) {
10691
- resolve();
10692
- });
10693
- }
10694
- var previousDrain = queue.drain;
10695
10712
  var p = new Promise(function(resolve) {
10696
- queue.drain = function() {
10697
- previousDrain();
10698
- resolve();
10699
- };
10713
+ process.nextTick(function() {
10714
+ if (queue.idle()) {
10715
+ resolve();
10716
+ } else {
10717
+ var previousDrain = queue.drain;
10718
+ queue.drain = function() {
10719
+ if (typeof previousDrain === "function")
10720
+ previousDrain();
10721
+ resolve();
10722
+ queue.drain = previousDrain;
10723
+ };
10724
+ }
10725
+ });
10700
10726
  });
10701
10727
  return p;
10702
10728
  }
@@ -22504,8 +22530,8 @@ InitEnv.init();
22504
22530
  var version = useContextKey("version", () => {
22505
22531
  let version2 = "0.0.64";
22506
22532
  try {
22507
- if ("0.1.23")
22508
- version2 = "0.1.23";
22533
+ if ("0.1.24")
22534
+ version2 = "0.1.24";
22509
22535
  } catch (e) {}
22510
22536
  return version2;
22511
22537
  });
@@ -25949,7 +25975,7 @@ class BaseQuery {
25949
25975
  }
25950
25976
  }
25951
25977
 
25952
- // node_modules/.pnpm/@kevisual+api@0.0.64_@types+react@19.2.10_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@kevisual/api/query/query-login/login-cache.ts
25978
+ // node_modules/.pnpm/@kevisual+api@0.0.64_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@kevisual/api/query/query-login/login-cache.ts
25953
25979
  var defaultCacheData = {
25954
25980
  loginUsers: [],
25955
25981
  user: undefined,
@@ -26520,7 +26546,7 @@ class BaseLoad3 {
26520
26546
  // node_modules/.pnpm/eventemitter3@5.0.4/node_modules/eventemitter3/index.mjs
26521
26547
  var import__2 = __toESM(require_eventemitter3(), 1);
26522
26548
 
26523
- // node_modules/.pnpm/@kevisual+api@0.0.64_@types+react@19.2.10_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@kevisual/api/query/query-login/query-login.ts
26549
+ // node_modules/.pnpm/@kevisual+api@0.0.64_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@kevisual/api/query/query-login/query-login.ts
26524
26550
  class QueryLogin extends BaseQuery {
26525
26551
  cacheStore;
26526
26552
  isBrowser;
@@ -26929,7 +26955,7 @@ class QueryLogin extends BaseQuery {
26929
26955
  }
26930
26956
  }
26931
26957
 
26932
- // node_modules/.pnpm/@kevisual+api@0.0.64_@types+react@19.2.10_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@kevisual/api/query/query-login/login-node-cache.ts
26958
+ // node_modules/.pnpm/@kevisual+api@0.0.64_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@kevisual/api/query/query-login/login-node-cache.ts
26933
26959
  import { homedir } from "node:os";
26934
26960
  import { join, dirname } from "node:path";
26935
26961
  import fs4 from "node:fs";
@@ -27073,7 +27099,7 @@ class LoginNodeCache {
27073
27099
  }
27074
27100
  }
27075
27101
 
27076
- // node_modules/.pnpm/@kevisual+api@0.0.64_@types+react@19.2.10_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@kevisual/api/query/query-login/query-login-node.ts
27102
+ // node_modules/.pnpm/@kevisual+api@0.0.64_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@kevisual/api/query/query-login/query-login-node.ts
27077
27103
  var cache = new LoginNodeCache;
27078
27104
 
27079
27105
  class QueryLoginNode extends QueryLogin {
@@ -29272,15 +29298,78 @@ var parseIfJson = (str) => {
29272
29298
  return {};
29273
29299
  }
29274
29300
  };
29301
+ var publishRegistry = (options) => {
29302
+ const packageJson = path5.resolve(options.execPath, "package.json");
29303
+ let cmd = "";
29304
+ const config2 = options.config || {};
29305
+ const execPath = options.execPath;
29306
+ const registry = options.registry;
29307
+ const setEnv = options.env || {};
29308
+ switch (registry) {
29309
+ case "npm":
29310
+ cmd = "npm publish -s --registry https://registry.npmjs.org";
29311
+ break;
29312
+ case "cnb":
29313
+ cmd = "npm publish -s --registry https://npm.cnb.cool/kevisual/registry/-/packages/";
29314
+ break;
29315
+ default:
29316
+ cmd = "npm publish -s --registry https://registry.npmjs.org";
29317
+ break;
29318
+ }
29319
+ if (fileIsExist2(packageJson)) {
29320
+ const keys = Object.keys(config2).filter((key) => key.includes("NPM_TOKEN"));
29321
+ const tokenEnv = keys.reduce((prev, key) => {
29322
+ return {
29323
+ ...prev,
29324
+ [key]: config2[key]
29325
+ };
29326
+ }, {});
29327
+ const pkg = fs9.readFileSync(packageJson, "utf-8");
29328
+ const pkgJson = parseIfJson(pkg);
29329
+ const version2 = pkgJson?.version;
29330
+ if (version2 && options?.tag) {
29331
+ let tag = String(version2).split("-")[1] || "";
29332
+ if (tag) {
29333
+ if (tag.includes(".")) {
29334
+ tag = tag.split(".")[0];
29335
+ }
29336
+ cmd = `${cmd} --tag ${tag}`;
29337
+ }
29338
+ }
29339
+ console.log(chalk2.green(cmd));
29340
+ const child = spawn2(cmd, {
29341
+ shell: true,
29342
+ cwd: execPath,
29343
+ env: {
29344
+ ...process.env,
29345
+ ...tokenEnv,
29346
+ ...setEnv
29347
+ }
29348
+ });
29349
+ child.stdout.on("data", (data) => {
29350
+ console.log(chalk2.green(`${data}`));
29351
+ });
29352
+ child.stderr.on("data", (data) => {
29353
+ if (data.toString().includes("npm notice")) {
29354
+ console.log(chalk2.yellow(`notice: ${data}`));
29355
+ } else {
29356
+ console.error(`stderr: ${data}`);
29357
+ }
29358
+ });
29359
+ child.on("close", (code) => {});
29360
+ } else {
29361
+ console.error(chalk2.red("package.json not found"));
29362
+ }
29363
+ };
29275
29364
  var command5 = new Command("npm").description("npm command show publish and set .npmrc").action(async (options) => {});
29276
- var publish = new Command("publish").argument("[registry]").option("-p --proxy", "proxy").option("-t, --tag", "tag").description("publish npm").action(async (registry, options) => {
29365
+ var publish = new Command("publish").argument("[registry]").option("-p --proxy", "proxy").option("-t, --tag", "tag").option("-u, --update", "update new version").description("publish npm").action(async (registry, options) => {
29277
29366
  if (!registry) {
29278
29367
  registry = await dist_default6({
29279
29368
  message: "Select the registry to publish",
29280
29369
  choices: [
29281
29370
  {
29282
- name: "me",
29283
- value: "me"
29371
+ name: "all",
29372
+ value: "all"
29284
29373
  },
29285
29374
  {
29286
29375
  name: "npm",
@@ -29294,7 +29383,6 @@ var publish = new Command("publish").argument("[registry]").option("-p --proxy",
29294
29383
  });
29295
29384
  }
29296
29385
  const config2 = getConfig2();
29297
- let cmd = "";
29298
29386
  const execPath = process.cwd();
29299
29387
  let setEnv = {};
29300
29388
  const proxyEnv = {
@@ -29308,66 +29396,14 @@ var publish = new Command("publish").argument("[registry]").option("-p --proxy",
29308
29396
  ...proxyEnv
29309
29397
  };
29310
29398
  }
29311
- if (registry) {
29312
- const packageJson = path5.resolve(execPath, "package.json");
29313
- switch (registry) {
29314
- case "me":
29315
- cmd = "npm publish --registry https://npm.xiongxiao.me";
29316
- break;
29317
- case "npm":
29318
- cmd = "npm publish --registry https://registry.npmjs.org";
29319
- break;
29320
- case "cnb":
29321
- cmd = "npm publish --registry https://npm.cnb.cool/kevisual/registry/-/packages/";
29322
- break;
29323
- default:
29324
- cmd = "npm publish --registry https://npm.xiongxiao.me";
29325
- break;
29326
- }
29327
- if (fileIsExist2(packageJson)) {
29328
- const keys = Object.keys(config2).filter((key) => key.includes("NPM_TOKEN"));
29329
- const tokenEnv = keys.reduce((prev, key) => {
29330
- return {
29331
- ...prev,
29332
- [key]: config2[key]
29333
- };
29334
- }, {});
29335
- const pkg = fs9.readFileSync(packageJson, "utf-8");
29336
- const pkgJson = parseIfJson(pkg);
29337
- const version2 = pkgJson?.version;
29338
- if (version2 && options?.tag) {
29339
- let tag = String(version2).split("-")[1] || "";
29340
- if (tag) {
29341
- if (tag.includes(".")) {
29342
- tag = tag.split(".")[0];
29343
- }
29344
- cmd = `${cmd} --tag ${tag}`;
29345
- }
29346
- }
29347
- console.log(chalk2.green(cmd));
29348
- const child = spawn2(cmd, {
29349
- shell: true,
29350
- cwd: execPath,
29351
- env: {
29352
- ...process.env,
29353
- ...tokenEnv,
29354
- ...setEnv
29355
- }
29356
- });
29357
- child.stdout.on("data", (data) => {
29358
- console.log(chalk2.green(`${data}`));
29359
- });
29360
- child.stderr.on("data", (data) => {
29361
- if (data.toString().includes("npm notice")) {
29362
- console.log(chalk2.yellow(`notice: ${data}`));
29363
- } else {
29364
- console.error(`stderr: ${data}`);
29365
- }
29366
- });
29367
- child.on("close", (code) => {});
29368
- } else {
29369
- console.error(chalk2.red("package.json not found"));
29370
- }
29399
+ if (options?.update) {
29400
+ patchFunc({ directory: execPath });
29401
+ }
29402
+ if (registry === "all") {
29403
+ publishRegistry({ execPath, registry: "npm", config: config2, env: setEnv });
29404
+ publishRegistry({ execPath, registry: "cnb", config: config2, env: setEnv });
29405
+ } else {
29406
+ publishRegistry({ execPath, registry, tag: options?.tag, config: config2, env: setEnv });
29371
29407
  }
29372
29408
  });
29373
29409
  command5.addCommand(publish);
@@ -29382,8 +29418,7 @@ var getnpmrc = new Command("get").action(async () => {
29382
29418
  command5.addCommand(getnpmrc);
29383
29419
  var npmrc = new Command("set").description("set .npmrc").option("-f <force>").action(async (options) => {
29384
29420
  const config2 = getConfig2();
29385
- const npmrcContent = config2?.npmrc || `//npm.xiongxiao.me/:_authToken=\${ME_NPM_TOKEN}
29386
- //npm.cnb.cool/kevisual/registry/-/packages/:_authToken=\${CNB_API_KEY}
29421
+ const npmrcContent = config2?.npmrc || `/npm.cnb.cool/kevisual/registry/-/packages/:_authToken=\${CNB_API_KEY}
29387
29422
  //registry.npmjs.org/:_authToken=\${NPM_TOKEN}
29388
29423
  `;
29389
29424
  const execPath = process.cwd();
@@ -29444,8 +29479,8 @@ var install = new Command("install").option("-n, --noproxy", "no proxy").descrip
29444
29479
  }
29445
29480
  });
29446
29481
  command5.addCommand(install);
29447
- var patch = new Command("patch").description("npm patch 发布补丁版本").action(async () => {
29448
- const cwd = process.cwd();
29482
+ var patchFunc = (opts) => {
29483
+ const cwd = opts?.directory || process.cwd();
29449
29484
  const packageJson = path5.resolve(cwd, "package.json");
29450
29485
  if (fileIsExist2(packageJson)) {
29451
29486
  const pkg = fs9.readFileSync(packageJson, "utf-8");
@@ -29462,6 +29497,9 @@ var patch = new Command("patch").description("npm patch 发布补丁版本").act
29462
29497
  }
29463
29498
  }
29464
29499
  }
29500
+ };
29501
+ var patch = new Command("patch").description("npm patch 发布补丁版本").action(async () => {
29502
+ patchFunc();
29465
29503
  });
29466
29504
  command5.addCommand(patch);
29467
29505
  program.addCommand(command5);
@@ -30875,7 +30913,7 @@ var download = new Command("download").option("-d --dir <dir>", "配置目录").
30875
30913
  command8.addCommand(download);
30876
30914
  program.addCommand(command8);
30877
30915
 
30878
- // node_modules/.pnpm/@kevisual+api@0.0.64_@types+react@19.2.10_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@kevisual/api/dist/query-config.js
30916
+ // node_modules/.pnpm/@kevisual+api@0.0.64_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@kevisual/api/dist/query-config.js
30879
30917
  var isTextForContentType3 = (contentType) => {
30880
30918
  if (!contentType)
30881
30919
  return false;
@@ -31309,7 +31347,7 @@ command9.addCommand(updateCommand);
31309
31347
  command9.addCommand(deleteCommand);
31310
31348
  program.addCommand(command9);
31311
31349
 
31312
- // node_modules/.pnpm/@kevisual+api@0.0.64_@types+react@19.2.10_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@kevisual/api/dist/query-secret.js
31350
+ // node_modules/.pnpm/@kevisual+api@0.0.64_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@kevisual/api/dist/query-secret.js
31313
31351
  var isTextForContentType4 = (contentType) => {
31314
31352
  if (!contentType)
31315
31353
  return false;
@@ -34630,50 +34668,32 @@ var getJWKS = new Command("get").description("获取 JWKS 内容").option("-d ,
34630
34668
  jwksCmd.addCommand(getJWKS);
34631
34669
  program.addCommand(jwksCmd);
34632
34670
 
34633
- // node_modules/.pnpm/@kevisual+cnb@0.0.45_dotenv@17.3.1_idb-keyval@6.2.2_ioredis@5.9.3/node_modules/@kevisual/cnb/dist/keep.js
34671
+ // node_modules/.pnpm/@kevisual+cnb@0.0.46_dotenv@17.3.1/node_modules/@kevisual/cnb/dist/keep.js
34634
34672
  import { createRequire as createRequire3 } from "node:module";
34635
34673
  var __create3 = Object.create;
34636
34674
  var __getProtoOf3 = Object.getPrototypeOf;
34637
34675
  var __defProp4 = Object.defineProperty;
34638
34676
  var __getOwnPropNames3 = Object.getOwnPropertyNames;
34639
34677
  var __hasOwnProp3 = Object.prototype.hasOwnProperty;
34640
- function __accessProp2(key) {
34641
- return this[key];
34642
- }
34643
- var __toESMCache_node2;
34644
- var __toESMCache_esm2;
34645
34678
  var __toESM3 = (mod, isNodeMode, target) => {
34646
- var canCache = mod != null && typeof mod === "object";
34647
- if (canCache) {
34648
- var cache3 = isNodeMode ? __toESMCache_node2 ??= new WeakMap : __toESMCache_esm2 ??= new WeakMap;
34649
- var cached = cache3.get(mod);
34650
- if (cached)
34651
- return cached;
34652
- }
34653
34679
  target = mod != null ? __create3(__getProtoOf3(mod)) : {};
34654
34680
  const to = isNodeMode || !mod || !mod.__esModule ? __defProp4(target, "default", { value: mod, enumerable: true }) : target;
34655
34681
  for (let key of __getOwnPropNames3(mod))
34656
34682
  if (!__hasOwnProp3.call(to, key))
34657
34683
  __defProp4(to, key, {
34658
- get: __accessProp2.bind(mod, key),
34684
+ get: () => mod[key],
34659
34685
  enumerable: true
34660
34686
  });
34661
- if (canCache)
34662
- cache3.set(mod, to);
34663
34687
  return to;
34664
34688
  };
34665
34689
  var __commonJS3 = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
34666
- var __returnValue = (v) => v;
34667
- function __exportSetter(name, newValue) {
34668
- this[name] = __returnValue.bind(null, newValue);
34669
- }
34670
34690
  var __export2 = (target, all) => {
34671
34691
  for (var name in all)
34672
34692
  __defProp4(target, name, {
34673
34693
  get: all[name],
34674
34694
  enumerable: true,
34675
34695
  configurable: true,
34676
- set: __exportSetter.bind(all, name)
34696
+ set: (newValue) => all[name] = () => newValue
34677
34697
  });
34678
34698
  };
34679
34699
  var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kevisual/cli",
3
- "version": "0.1.23",
3
+ "version": "0.1.25",
4
4
  "description": "envision 命令行工具",
5
5
  "type": "module",
6
6
  "basename": "/root/cli",
@@ -47,13 +47,13 @@
47
47
  "@kevisual/context": "^0.0.8",
48
48
  "@kevisual/router": "^0.1.1",
49
49
  "@kevisual/use-config": "^1.0.30",
50
- "@opencode-ai/sdk": "^1.2.24",
50
+ "@opencode-ai/sdk": "^1.2.26",
51
51
  "@types/busboy": "^1.5.4",
52
52
  "busboy": "^1.6.0",
53
53
  "eventemitter3": "^5.0.4",
54
54
  "jose": "^6.2.1",
55
55
  "lowdb": "^7.0.1",
56
- "lru-cache": "^11.2.6",
56
+ "lru-cache": "^11.2.7",
57
57
  "micromatch": "^4.0.8",
58
58
  "nanoid": "^5.1.6",
59
59
  "pm2": "latest",
@@ -62,7 +62,7 @@
62
62
  },
63
63
  "devDependencies": {
64
64
  "@kevisual/api": "^0.0.64",
65
- "@kevisual/cnb": "^0.0.45",
65
+ "@kevisual/cnb": "^0.0.46",
66
66
  "@kevisual/dts": "^0.0.4",
67
67
  "@kevisual/load": "^0.0.6",
68
68
  "@kevisual/logger": "^0.0.4",