@adep/cli 0.0.6 → 0.0.7
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/README.md +24 -51
- package/dist/index.js +264 -828
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# adep — AgentDeploy CLI
|
|
2
2
|
|
|
3
|
-
> 面向终端开发者的 AgentDeploy 命令行工具:**登录 / 初始化 / 本地调试 / 部署 / 数据库维护 / 云存储 / 静态托管 /
|
|
3
|
+
> 面向终端开发者的 AgentDeploy 命令行工具:**登录 / 初始化 / 本地调试 / 部署 / 数据库维护 / 云存储 / 静态托管 / 全栈工程(functions/ + web/ 前端)** 一站式闭环。
|
|
4
4
|
|
|
5
5
|
`adep` 让你在一个项目目录里完成从**脚手架 → 本地调试 → 部署上线 → 数据与资源运维**的完整流程。它复用平台运行时内核(`@adep/runtime`),本地与线上的执行语义一致,离线、不装 Docker 也能开发。
|
|
6
6
|
|
|
@@ -46,8 +46,6 @@
|
|
|
46
46
|
|
|
47
47
|
- [`adep export`](#adep-export)
|
|
48
48
|
|
|
49
|
-
- [`adep widget`](#adep-widget)
|
|
50
|
-
|
|
51
49
|
4. [配置](#配置)
|
|
52
50
|
|
|
53
51
|
- [环境变量](#环境变量)
|
|
@@ -114,25 +112,24 @@ adep --json whoami
|
|
|
114
112
|
|
|
115
113
|
### `adep init`
|
|
116
114
|
|
|
117
|
-
|
|
115
|
+
初始化项目(脚手架)。**默认 `fullstack` 模板**:生成与 Web IDE 项目**同一结构**的全栈骨架
|
|
116
|
+
(`functions/` 云函数 + `web/` 标准 Vite 前端工程 + `database/schema.sql`):
|
|
118
117
|
|
|
119
|
-
| 模板
|
|
120
|
-
|
|
|
121
|
-
| `
|
|
122
|
-
| `
|
|
123
|
-
| `
|
|
124
|
-
| `empty` | 仅项目骨架(`adep.config.ts` + 类型提示入口,不生成示例产物) |
|
|
118
|
+
| 模板 | 说明 |
|
|
119
|
+
| ----------- | ------------------------------------------------------------------------------ |
|
|
120
|
+
| `fullstack` | 全栈骨架:`functions/` + `web/`(Vite + Vue 3)+ `database/schema.sql`(默认) |
|
|
121
|
+
| `function` | 仅云函数:单个示例函数 `functions/hello.ts` |
|
|
122
|
+
| `empty` | 仅项目骨架(`adep.config.ts` + 类型提示入口,不生成示例产物) |
|
|
125
123
|
|
|
126
124
|
```bash
|
|
127
|
-
adep init my-app # 默认
|
|
128
|
-
adep init my-app -t
|
|
129
|
-
adep init my-app -t page # 单个 Page
|
|
125
|
+
adep init my-app # 默认 fullstack 模板(与 Web IDE 项目同构)
|
|
126
|
+
adep init my-app -t function # 仅云函数
|
|
130
127
|
adep init my-app -t empty # 空模板
|
|
131
128
|
adep init --list # 从平台 GET /api/v1/templates 列出可用模板
|
|
132
129
|
adep init --list -s https://platform.example.com
|
|
133
130
|
```
|
|
134
131
|
|
|
135
|
-
产物结构(`
|
|
132
|
+
产物结构(`fullstack` 模板):
|
|
136
133
|
|
|
137
134
|
```
|
|
138
135
|
my-app/
|
|
@@ -142,10 +139,20 @@ my-app/
|
|
|
142
139
|
├── functions/
|
|
143
140
|
│ ├── hello.ts # 示例函数(deploy 后经 /hello 触发)
|
|
144
141
|
│ └── README.md
|
|
142
|
+
├── web/ # 前端工程(标准 Vite + Vue 3,与 Web IDE 项目同构)
|
|
143
|
+
│ ├── index.html
|
|
144
|
+
│ ├── package.json
|
|
145
|
+
│ ├── vite.config.ts
|
|
146
|
+
│ └── src/{main.ts, App.vue}
|
|
147
|
+
├── database/
|
|
148
|
+
│ └── schema.sql # 数据库结构(占位;表由平台控制台 / adep db 管理)
|
|
145
149
|
├── README.md
|
|
146
150
|
└── .gitignore # 已忽略 node_modules/ data/ .adep/
|
|
147
151
|
```
|
|
148
152
|
|
|
153
|
+
**web/ 前端工程**:与 Web IDE 内创建的项目完全同构(同一份模板真相源),可无缝在两端切换开发;
|
|
154
|
+
本地跑前端:`cd web && npm install && npm run dev`,部署由 `adep deploy` 统一构建发布。
|
|
155
|
+
|
|
149
156
|
**类型提示**:`adep init` 产出的项目自带 `tsconfig.json` 与 `adep.d.ts`,用 VSCode 打开即可在
|
|
150
157
|
`functions/` 下获得 `AdepContext` / `ctx.cloud.*` 补全,无需本机安装 `@adep/types`。
|
|
151
158
|
函数签名写 `export default async (ctx: AdepContext) => {...}` 即可。
|
|
@@ -357,40 +364,6 @@ adep export --out ./dist-export # 指定输出目录(缺省 ./exports)
|
|
|
357
364
|
|
|
358
365
|
- `--json` 输出单个结果信封;导出失败(长任务未产出 / 自检不过)以退出码 1 + `EXPORT_FAILED` 结束,不静默给半截产物。
|
|
359
366
|
|
|
360
|
-
### `adep widget`
|
|
361
|
-
|
|
362
|
-
微前端组件(widget)的子命令组:脚手架 / 本地沙箱 / 发布。
|
|
363
|
-
|
|
364
|
-
#### `adep widget init`
|
|
365
|
-
|
|
366
|
-
```bash
|
|
367
|
-
adep widget init my-widget # 默认 vue3-ts 模板
|
|
368
|
-
adep widget init my-widget -t react-ts # 或 react-ts
|
|
369
|
-
```
|
|
370
|
-
|
|
371
|
-
widget 名称需以小写字母开头,仅含小写字母 / 数字 / 连字符。
|
|
372
|
-
|
|
373
|
-
#### `adep widget dev`
|
|
374
|
-
|
|
375
|
-
本地宿主沙箱:主题变量 + mock props + token 注入 + 热更新,默认 `http://127.0.0.1:8788`。
|
|
376
|
-
|
|
377
|
-
```bash
|
|
378
|
-
adep widget dev # 默认端口 8788
|
|
379
|
-
adep widget dev -p 9000
|
|
380
|
-
# 在浏览器打开 ?token=<...> 可注入鉴权 token
|
|
381
|
-
```
|
|
382
|
-
|
|
383
|
-
#### `adep widget publish`
|
|
384
|
-
|
|
385
|
-
按框架构建 → 上传平台静态资源 → 版本化输出 URL:
|
|
386
|
-
|
|
387
|
-
```bash
|
|
388
|
-
adep widget publish -p my-app
|
|
389
|
-
# → my-widget v0.1.0 https://my-app.platform.example.com/widgets/my-widget/0.1.0/index.js
|
|
390
|
-
```
|
|
391
|
-
|
|
392
|
-
版本取自 widget `package.json` 的 `version`(缺省 `0.1.0`);产物是单个 ESM 文件。
|
|
393
|
-
|
|
394
367
|
---
|
|
395
368
|
|
|
396
369
|
## 配置
|
|
@@ -417,7 +390,7 @@ export ADEP_HOME=~/.adep
|
|
|
417
390
|
// adep 项目配置:CLI(dev / deploy)按 default export 读取(name / functionsDir)。
|
|
418
391
|
export default {
|
|
419
392
|
name: 'my-app', // 项目名(deploy 的默认 slug)
|
|
420
|
-
template: '
|
|
393
|
+
template: 'fullstack', // 模板:empty | function | fullstack
|
|
421
394
|
}
|
|
422
395
|
```
|
|
423
396
|
|
|
@@ -469,8 +442,8 @@ adep --json deploy -p my-app
|
|
|
469
442
|
**Q:`adep deploy`** **显示** **`no changes`?**
|
|
470
443
|
这是幂等设计:本地函数内容与已发布版本一致时复用当前版本,不产生新版本。想强制更新需修改函数内容。
|
|
471
444
|
|
|
472
|
-
**Q
|
|
473
|
-
`init` 项目名:小写字母开头,仅含小写字母 / 数字 / 连字符(≤ 63
|
|
445
|
+
**Q:项目名的命名规则?**
|
|
446
|
+
`init` 项目名:小写字母开头,仅含小写字母 / 数字 / 连字符(≤ 63 字符)。
|
|
474
447
|
|
|
475
448
|
**Q:`adep db exec`** **的** **`--confirm-table`** **是做什么的?**
|
|
476
449
|
写 / 破坏性语句(DELETE / DROP / ALTER…)服务端要求二次确认目标表名,`--confirm-table users` 即输入目标表名以放行;只读查询无需该参数。
|