@adep/cli 0.1.8 → 0.1.10

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.
@@ -434,6 +434,19 @@ var DB_RPC = {
434
434
  chain: "chain"
435
435
  };
436
436
 
437
+ // packages/runtime/src/functions/runtime/rpc-wire.ts
438
+ function wireRpcResponses(port, pending) {
439
+ port.on?.((message) => {
440
+ const reply = message;
441
+ if (reply?.type !== "rpc-response" || typeof reply.id !== "number") return;
442
+ const entry = pending.get(reply.id);
443
+ if (entry === void 0) return;
444
+ pending.delete(reply.id);
445
+ if (reply.ok === true) entry.resolve(reply.result);
446
+ else entry.reject(new Error(reply.error ?? "RPC \u80FD\u529B\u8C03\u7528\u5931\u8D25"));
447
+ });
448
+ }
449
+
437
450
  // packages/runtime/src/functions/runtime/chain.ts
438
451
  function isChainCapability(value) {
439
452
  if (typeof value !== "object" || value === null) return false;
@@ -514,6 +527,11 @@ function splitBareSpecifier(request) {
514
527
  return request.split("/")[0];
515
528
  }
516
529
 
530
+ // packages/runtime/src/shared/regexp.ts
531
+ function escapeRegExp(text) {
532
+ return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
533
+ }
534
+
517
535
  // packages/runtime/src/functions/runtime/worker-entry.ts
518
536
  function isRpcCapability(value) {
519
537
  return typeof value === "object" && value !== null && value[RPC_CAPABILITY_KEY] === true;
@@ -543,9 +561,6 @@ function errorMessageOf2(error) {
543
561
  }
544
562
  return String(error);
545
563
  }
546
- function escapeRegExp(text) {
547
- return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
548
- }
549
564
  function firstUserFrame(stack, files) {
550
565
  for (const key of Object.keys(files)) {
551
566
  const match = new RegExp(
@@ -604,15 +619,7 @@ function runWorker(input, port) {
604
619
  const container = createCloudContainer();
605
620
  const pending = /* @__PURE__ */ new Map();
606
621
  let rpcId = 0;
607
- port.on?.((message) => {
608
- const reply = message;
609
- if (reply?.type !== "rpc-response" || typeof reply.id !== "number") return;
610
- const entry = pending.get(reply.id);
611
- if (entry === void 0) return;
612
- pending.delete(reply.id);
613
- if (reply.ok === true) entry.resolve(reply.result);
614
- else entry.reject(new Error(reply.error ?? "RPC \u80FD\u529B\u8C03\u7528\u5931\u8D25"));
615
- });
622
+ wireRpcResponses(port, pending);
616
623
  for (const capability of input.capabilities ?? []) {
617
624
  container.register(
618
625
  capability.name,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adep/cli",
3
- "version": "0.1.8",
3
+ "version": "0.1.10",
4
4
  "type": "module",
5
5
  "description": "`adep` 命令行工具包位:登录 / 初始化 / 本地调试 / 部署 / 数据库维护 / 云存储 / 静态托管 / 微前端组件(widget),实现见任务单 CLI-001 ~ CLI-003 与 FE-002;子路径 `@adep/cli/vite` 提供云函数 vite 插件(CLI-014)",
6
6
  "bin": {
@@ -21,11 +21,11 @@
21
21
  "commander": "14.0.2",
22
22
  "esbuild": "0.25.12",
23
23
  "@adep/cf-compat": "0.1.1",
24
- "@adep/vite-plugin": "0.1.2"
24
+ "@adep/vite-plugin": "0.1.4"
25
25
  },
26
26
  "devDependencies": {
27
- "@adep/runtime": "0.2.2",
28
- "@adep/types": "0.2.2"
27
+ "@adep/runtime": "0.2.4",
28
+ "@adep/types": "0.2.3"
29
29
  },
30
30
  "scripts": {
31
31
  "test": "vitest run",