@adep/cli 0.2.2 → 0.3.0
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/LICENSE +58 -0
- package/dist/index.js +8004 -241
- package/dist/vite.js +59 -22
- package/dist/worker-entry.js +42 -20
- package/package.json +10 -2
- package/templates/app-mobile/README.md +1 -1
package/dist/vite.js
CHANGED
|
@@ -2006,6 +2006,11 @@ function assertStoragePrefix(prefix) {
|
|
|
2006
2006
|
}
|
|
2007
2007
|
return prefix ?? "";
|
|
2008
2008
|
}
|
|
2009
|
+
var DEV_STORAGE_SEGMENT = ".env-dev/";
|
|
2010
|
+
function isDevSegmentHidden(relPath, prefix) {
|
|
2011
|
+
if (prefix !== void 0 && prefix !== "" && prefix.startsWith(DEV_STORAGE_SEGMENT)) return false;
|
|
2012
|
+
return relPath.startsWith(DEV_STORAGE_SEGMENT);
|
|
2013
|
+
}
|
|
2009
2014
|
|
|
2010
2015
|
// packages/runtime/src/storage/hmac-sha256.ts
|
|
2011
2016
|
var K = new Uint32Array([
|
|
@@ -2434,8 +2439,7 @@ function createLocalStorageDriver(options) {
|
|
|
2434
2439
|
await Promise.all(tasks);
|
|
2435
2440
|
};
|
|
2436
2441
|
await walk(root, "");
|
|
2437
|
-
metas.
|
|
2438
|
-
return metas;
|
|
2442
|
+
return metas.filter((meta) => !isDevSegmentHidden(meta.path, prefix)).toSorted((a, b) => a.path < b.path ? -1 : a.path > b.path ? 1 : 0);
|
|
2439
2443
|
},
|
|
2440
2444
|
async usage(projectId) {
|
|
2441
2445
|
return totalSize(projectId);
|
|
@@ -3416,6 +3420,17 @@ var StateObjectRuntime = class {
|
|
|
3416
3420
|
evictAll() {
|
|
3417
3421
|
this.instances.clear();
|
|
3418
3422
|
}
|
|
3423
|
+
/**
|
|
3424
|
+
* 先落盘再释放(CORE-079 惰性驱逐):逐实例 `flush()` 持久化后清空内存驻留,
|
|
3425
|
+
* 类型注册表保留(runtime 对象本身可复用;驱逐方通常直接丢弃整个 runtime)。
|
|
3426
|
+
* 任一实例 flush 抛错则**整体上抛且不清空**——调用方据此放弃驱逐,绝不静默丢未落盘状态。
|
|
3427
|
+
*/
|
|
3428
|
+
async dispose() {
|
|
3429
|
+
for (const inst of this.instances.values()) {
|
|
3430
|
+
await this.flush(inst);
|
|
3431
|
+
}
|
|
3432
|
+
this.instances.clear();
|
|
3433
|
+
}
|
|
3419
3434
|
};
|
|
3420
3435
|
|
|
3421
3436
|
// packages/runtime/src/state-objects/backend.ts
|
|
@@ -4017,6 +4032,48 @@ function createSandboxFetch(options) {
|
|
|
4017
4032
|
};
|
|
4018
4033
|
}
|
|
4019
4034
|
|
|
4035
|
+
// packages/runtime/src/functions/runtime/flat-rpc-proxy.ts
|
|
4036
|
+
var IMPLICIT_PROTOCOL_KEYS = /* @__PURE__ */ new Set([
|
|
4037
|
+
"then",
|
|
4038
|
+
"catch",
|
|
4039
|
+
"finally",
|
|
4040
|
+
"toJSON",
|
|
4041
|
+
"toString",
|
|
4042
|
+
"valueOf",
|
|
4043
|
+
"constructor",
|
|
4044
|
+
"__proto__",
|
|
4045
|
+
"inspect"
|
|
4046
|
+
]);
|
|
4047
|
+
function isImplicitProtocolKey(key) {
|
|
4048
|
+
return IMPLICIT_PROTOCOL_KEYS.has(key);
|
|
4049
|
+
}
|
|
4050
|
+
function createFlatRpcProxy(dispatch) {
|
|
4051
|
+
return new Proxy(
|
|
4052
|
+
{},
|
|
4053
|
+
{
|
|
4054
|
+
get(_target, method) {
|
|
4055
|
+
if (typeof method !== "string") return void 0;
|
|
4056
|
+
if (isImplicitProtocolKey(method)) return Reflect.get(Object.prototype, method);
|
|
4057
|
+
return (...args) => dispatch(method, args);
|
|
4058
|
+
}
|
|
4059
|
+
}
|
|
4060
|
+
);
|
|
4061
|
+
}
|
|
4062
|
+
|
|
4063
|
+
// packages/runtime/src/functions/runtime/rpc-client.ts
|
|
4064
|
+
function isRpcCapability(value) {
|
|
4065
|
+
return typeof value === "object" && value !== null && value[RPC_CAPABILITY_KEY] === true;
|
|
4066
|
+
}
|
|
4067
|
+
function createRpcClient(capability, port, pending, nextId) {
|
|
4068
|
+
return createFlatRpcProxy((method, args) => {
|
|
4069
|
+
const id = nextId();
|
|
4070
|
+
return new Promise((resolve5, reject) => {
|
|
4071
|
+
pending.set(id, { resolve: resolve5, reject });
|
|
4072
|
+
port.postMessage({ type: "rpc", id, capability, method, args });
|
|
4073
|
+
});
|
|
4074
|
+
});
|
|
4075
|
+
}
|
|
4076
|
+
|
|
4020
4077
|
// packages/runtime/src/functions/runtime/rpc-wire.ts
|
|
4021
4078
|
function wireRpcResponses(port, pending) {
|
|
4022
4079
|
port.on?.((message) => {
|
|
@@ -4107,26 +4164,6 @@ function escapeRegExp(text) {
|
|
|
4107
4164
|
}
|
|
4108
4165
|
|
|
4109
4166
|
// packages/runtime/src/functions/runtime/worker-entry.ts
|
|
4110
|
-
function isRpcCapability(value) {
|
|
4111
|
-
return typeof value === "object" && value !== null && value[RPC_CAPABILITY_KEY] === true;
|
|
4112
|
-
}
|
|
4113
|
-
function createRpcClient(capability, port, pending, nextId) {
|
|
4114
|
-
return new Proxy(
|
|
4115
|
-
{},
|
|
4116
|
-
{
|
|
4117
|
-
get(_target, method) {
|
|
4118
|
-
if (typeof method !== "string") return void 0;
|
|
4119
|
-
return (...args) => {
|
|
4120
|
-
const id = nextId();
|
|
4121
|
-
return new Promise((resolve5, reject) => {
|
|
4122
|
-
pending.set(id, { resolve: resolve5, reject });
|
|
4123
|
-
port.postMessage({ type: "rpc", id, capability, method, args });
|
|
4124
|
-
});
|
|
4125
|
-
};
|
|
4126
|
-
}
|
|
4127
|
-
}
|
|
4128
|
-
);
|
|
4129
|
-
}
|
|
4130
4167
|
function errorMessageOf2(error) {
|
|
4131
4168
|
if (error instanceof Error) return error.message;
|
|
4132
4169
|
if (typeof error === "object" && error !== null && "message" in error) {
|
package/dist/worker-entry.js
CHANGED
|
@@ -434,6 +434,48 @@ var DB_RPC = {
|
|
|
434
434
|
chain: "chain"
|
|
435
435
|
};
|
|
436
436
|
|
|
437
|
+
// packages/runtime/src/functions/runtime/flat-rpc-proxy.ts
|
|
438
|
+
var IMPLICIT_PROTOCOL_KEYS = /* @__PURE__ */ new Set([
|
|
439
|
+
"then",
|
|
440
|
+
"catch",
|
|
441
|
+
"finally",
|
|
442
|
+
"toJSON",
|
|
443
|
+
"toString",
|
|
444
|
+
"valueOf",
|
|
445
|
+
"constructor",
|
|
446
|
+
"__proto__",
|
|
447
|
+
"inspect"
|
|
448
|
+
]);
|
|
449
|
+
function isImplicitProtocolKey(key) {
|
|
450
|
+
return IMPLICIT_PROTOCOL_KEYS.has(key);
|
|
451
|
+
}
|
|
452
|
+
function createFlatRpcProxy(dispatch) {
|
|
453
|
+
return new Proxy(
|
|
454
|
+
{},
|
|
455
|
+
{
|
|
456
|
+
get(_target, method) {
|
|
457
|
+
if (typeof method !== "string") return void 0;
|
|
458
|
+
if (isImplicitProtocolKey(method)) return Reflect.get(Object.prototype, method);
|
|
459
|
+
return (...args) => dispatch(method, args);
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
);
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
// packages/runtime/src/functions/runtime/rpc-client.ts
|
|
466
|
+
function isRpcCapability(value) {
|
|
467
|
+
return typeof value === "object" && value !== null && value[RPC_CAPABILITY_KEY] === true;
|
|
468
|
+
}
|
|
469
|
+
function createRpcClient(capability, port, pending, nextId) {
|
|
470
|
+
return createFlatRpcProxy((method, args) => {
|
|
471
|
+
const id = nextId();
|
|
472
|
+
return new Promise((resolve, reject) => {
|
|
473
|
+
pending.set(id, { resolve, reject });
|
|
474
|
+
port.postMessage({ type: "rpc", id, capability, method, args });
|
|
475
|
+
});
|
|
476
|
+
});
|
|
477
|
+
}
|
|
478
|
+
|
|
437
479
|
// packages/runtime/src/functions/runtime/rpc-wire.ts
|
|
438
480
|
function wireRpcResponses(port, pending) {
|
|
439
481
|
port.on?.((message) => {
|
|
@@ -533,26 +575,6 @@ function escapeRegExp(text) {
|
|
|
533
575
|
}
|
|
534
576
|
|
|
535
577
|
// packages/runtime/src/functions/runtime/worker-entry.ts
|
|
536
|
-
function isRpcCapability(value) {
|
|
537
|
-
return typeof value === "object" && value !== null && value[RPC_CAPABILITY_KEY] === true;
|
|
538
|
-
}
|
|
539
|
-
function createRpcClient(capability, port, pending, nextId) {
|
|
540
|
-
return new Proxy(
|
|
541
|
-
{},
|
|
542
|
-
{
|
|
543
|
-
get(_target, method) {
|
|
544
|
-
if (typeof method !== "string") return void 0;
|
|
545
|
-
return (...args) => {
|
|
546
|
-
const id = nextId();
|
|
547
|
-
return new Promise((resolve, reject) => {
|
|
548
|
-
pending.set(id, { resolve, reject });
|
|
549
|
-
port.postMessage({ type: "rpc", id, capability, method, args });
|
|
550
|
-
});
|
|
551
|
-
};
|
|
552
|
-
}
|
|
553
|
-
}
|
|
554
|
-
);
|
|
555
|
-
}
|
|
556
578
|
function errorMessageOf2(error) {
|
|
557
579
|
if (error instanceof Error) return error.message;
|
|
558
580
|
if (typeof error === "object" && error !== null && "message" in error) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adep/cli",
|
|
3
|
-
"
|
|
3
|
+
"license": "MIT",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "git+https://gitcode.com/yunqiang_wu/ai-yunke.git"
|
|
7
|
+
},
|
|
8
|
+
"homepage": "https://adep.jajabjbj.top",
|
|
9
|
+
"bugs": "https://gitcode.com/yunqiang_wu/ai-yunke/issues",
|
|
10
|
+
"version": "0.3.0",
|
|
4
11
|
"type": "module",
|
|
5
12
|
"description": "`adep` 命令行工具包位:登录 / 初始化 / 本地调试 / 部署 / 数据库维护 / 云存储 / 静态托管 / 微前端组件(widget),实现见任务单 CLI-001 ~ CLI-003 与 FE-002;子路径 `@adep/cli/vite` 提供云函数 vite 插件(CLI-014)",
|
|
6
13
|
"bin": {
|
|
@@ -21,10 +28,11 @@
|
|
|
21
28
|
"dependencies": {
|
|
22
29
|
"commander": "14.0.2",
|
|
23
30
|
"esbuild": "0.25.12",
|
|
31
|
+
"yaml": "2.9.1",
|
|
24
32
|
"zod": "^4.4.3",
|
|
25
33
|
"@adep/cf-compat": "0.1.1",
|
|
26
|
-
"@adep/runtime": "0.3.2",
|
|
27
34
|
"@adep/crypto": "0.1.0",
|
|
35
|
+
"@adep/runtime": "0.3.2",
|
|
28
36
|
"@adep/vite-plugin": "0.1.8"
|
|
29
37
|
},
|
|
30
38
|
"devDependencies": {
|