脚手架 新的 上诉人 一个命令中的应用程序或模块包.
说明
@appweaver/create 生成一个用于节点或 Bun 的准备运行的 Appweaver 项目: 源版式, 配置文件
每个环境、种子管理员用户、测试设置、选定AI代理的代理技能文件以及可选
模块(Redis、队列、调度器、邮件、模板、地方、多克文件)。 这也创造了
模块软件包,向 npm 发布的驱动器和特性.
使用量
npm create @appweaver <name> [description] -- [options]
npx @appweaver/create <name> [description] [options]
npm create @appweaver MyApp "My awesome API" -- --database postgresql --add redis queue docker
npx @appweaver/create MyApp "My awesome API" --all --exclude scheduler
npx @appweaver/create Reports "Nightly reports" --add scheduler --exclude web # a database worker, no server
npx @appweaver/create Calculator "A calculator" --exclude data web # the core application alone
npm 后通过选项 -- 页:1 create-appweaver 二进制, npx 直接带走.
| 旗帜 | 说明 | 默认 |
|---|---|---|
--add <modules...> | 用空格或逗号分隔到默认的模块 | data web |
--all | 添加每个模块 | 虚假 |
--exclude <modules...> | 退出默认模块或 --all,按空格或逗号 | 无 |
-o, --output-dir <dir> | 输出目录( 用于当前工作目录 ) | 项目名称 |
--database <type> | sqlite, (中文(简体) ), postgresql, (中文(简体) ), mysql, (中文(简体) ), sqlserver数据库 data | sqlite |
--host <host> | 服务器的主机名或 IP 地址 web 约束 | 0.0.0.0 |
--port <port> | 服务器的端口编号 web 监听 | 5000 |
--bun | 使用 Bun 作为程序运行时间 | 节点 |
--agent <agent> | claude, (中文(简体) ), codex, (中文(简体) ), junie, (中文(简体) ), cursor, (中文(简体) ), copilot, (中文(简体) ), opencode, (中文(简体) ), kiro, (中文(简体) ), pi, (中文(简体) ), none | claude |
--no-install | 跳过依赖关系的安装 | 安装 |
基础项目仅取决于 @appweaver/cli, (中文(简体) ), @appweaver/common, (中文(简体) ), @appweaver/core 和类型框,最小值
没有数据库或服务器的应用程序,以及 data 财务报告和审定财务报表 web 默认情况下将添加到其中,生成一个网页 API.
--exclude 退出任何模块, 包括默认模块和不包含模块 --all数字 : --exclude web 保存数据库
没有服务器, --exclude data web 仅核心应用程序web 需求 data因此排除 data 独自一人
(拒绝)。 一个模块安装其软件包,同时添加一个新增软件包所需的模块:
| 模块 | 添加数 | 没有它 |
|---|---|---|
data (默认) | @appweaver/data, (中文(简体) ), @appweaver/sharp普丽斯玛, database/,生成的类型,测试数据库 | 没有数据库 |
web (默认) | @appweaver/web时,需要 data,服务器配置 User 授权资源、其管理者 public/ | 没有 HTTP 服务器, 没有认证模型 |
redis | @appweaver/redis, Redis连接, Redis服务 docker-compose.yml | 内存、缓存和速率限制 |
queue | @appweaver/bullmq时,需要 redis | 模拟队列 |
scheduler | @appweaver/cron | 已禁用调度器 |
mailer | @appweaver/nodemailer,账户电子邮件模板 templates,其文本与 locales | 邮件已禁用 |
templates | @appweaver/handlebars 财务报告和审定财务报表 templates/ | 无模板引擎 |
locales | locales/en.json,没有邮件的空 | 编入模板的英文文本 |
docker | Dockerfile, (中文(简体) ), .dockerignore, (中文(简体) ), docker-compose.yml, (中文(简体) ), start.sh | 无 Docker 文件 |
现有项目的模块与 weaver CLI,来自同一模板:
npx weaver module list
npx weaver module add templates locales
npx weaver module remove docker
与 data,创建第一个迁移并生成数据库:
cd my-app
npx weaver migration new init
npm run seed
npm run dev
模块软件包
npm create @appweaver module <package> [description] -- [options]
npm create @appweaver module @acme/appweaver-gcs "Google Cloud Storage driver" -- --contract storage
npx @appweaver/create module @acme/appweaver-audit
| 旗帜 | 说明 | 默认 |
|---|---|---|
-o, --output-dir <dir> | 输出目录 | 包名,不含其范围 |
--contract <contract> | 其司机的合同规定: storage, (中文(简体) ), mailer, (中文(简体) ), none 特性 | none |
软件包是一个模块,通过安装它而启用: package.json 拥有 appweaver.module 区域
appweaver-module 关键词,与 @appweaver/common 财务报告和审定财务报表 @appweaver/core 作为同伴的依赖关系。 它拿着货单
(单位:千美元)src/module.ts),一个配置部分(src/config.ts),或是一个驾驶班(GcsStorage, (中文(简体) ), <Name>Mailer带有
测试运行合同套件 @appweaver/testing,或特性模块的启动代码(src/main.ts),与
typeScript 和 Jest 设置。 简称,没有范围和 appweaver- 前缀( e)gcs),名称是
提供方及其配置部分storage.gcs 用于存储驱动器).
cd appweaver-gcs
npm install
npm test
npm publish
申请后加入 weaver module add @acme/appweaver-gcs。 。 。 .
文档
许可证
苍蝇是 麻省理工学院执照。 。 。 .