@coze-arch/cli 0.0.35 → 0.0.36-alpha.844e20
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 +11 -0
- package/docs/deploy.md +168 -0
- package/lib/__templates__/phaser/.coze +13 -0
- package/lib/__templates__/phaser/README.md +37 -0
- package/lib/__templates__/phaser/_gitignore +22 -0
- package/lib/__templates__/phaser/_npmrc +14 -0
- package/lib/__templates__/phaser/assets/image_sequence/coze-game-loading/frame_0001.png +0 -0
- package/lib/__templates__/phaser/assets/image_sequence/coze-game-loading/frame_0002.png +0 -0
- package/lib/__templates__/phaser/assets/image_sequence/coze-game-loading/frame_0003.png +0 -0
- package/lib/__templates__/phaser/assets/image_sequence/coze-game-loading/frame_0004.png +0 -0
- package/lib/__templates__/phaser/assets/image_sequence/coze-game-loading/frame_0005.png +0 -0
- package/lib/__templates__/phaser/assets/image_sequence/coze-game-loading/frame_0006.png +0 -0
- package/lib/__templates__/phaser/assets/image_sequence/coze-game-loading/frame_0007.png +0 -0
- package/lib/__templates__/phaser/assets/image_sequence/coze-game-loading/frame_0008.png +0 -0
- package/lib/__templates__/phaser/assets/image_sequence/coze-game-loading/frame_0009.png +0 -0
- package/lib/__templates__/phaser/assets/image_sequence/coze-game-loading/frame_0010.png +0 -0
- package/lib/__templates__/phaser/assets/image_sequence/coze-game-loading/frame_0011.png +0 -0
- package/lib/__templates__/phaser/assets/image_sequence/coze-game-loading/frame_0012.png +0 -0
- package/lib/__templates__/phaser/assets/image_sequence/coze-game-loading/frame_0013.png +0 -0
- package/lib/__templates__/phaser/assets/image_sequence/coze-game-loading/frame_0014.png +0 -0
- package/lib/__templates__/phaser/assets/image_sequence/coze-game-loading/frame_0015.png +0 -0
- package/lib/__templates__/phaser/assets/image_sequence/coze-game-loading/frame_0016.png +0 -0
- package/lib/__templates__/phaser/assets/image_sequence/coze-game-loading/frame_0017.png +0 -0
- package/lib/__templates__/phaser/assets/image_sequence/coze-game-loading/frame_0018.png +0 -0
- package/lib/__templates__/phaser/assets/image_sequence/coze-game-loading/frame_0019.png +0 -0
- package/lib/__templates__/phaser/assets/image_sequence/coze-game-loading/frame_0020.png +0 -0
- package/lib/__templates__/phaser/assets/image_sequence/coze-game-loading/frame_0021.png +0 -0
- package/lib/__templates__/phaser/assets/image_sequence/coze-game-loading/frame_0022.png +0 -0
- package/lib/__templates__/phaser/assets/image_sequence/coze-game-loading/frame_0023.png +0 -0
- package/lib/__templates__/phaser/assets/image_sequence/coze-game-loading/frame_0024.png +0 -0
- package/lib/__templates__/phaser/assets/image_sequence/coze-game-loading/manifest.json +11 -0
- package/lib/__templates__/phaser/debug-runtime/flow-graph.json +20 -0
- package/lib/__templates__/phaser/index.html +12 -0
- package/lib/__templates__/phaser/package.json +31 -0
- package/lib/__templates__/phaser/pnpm-lock.yaml +661 -0
- package/lib/__templates__/phaser/scripts/build.sh +8 -0
- package/lib/__templates__/phaser/scripts/dev.sh +11 -0
- package/lib/__templates__/phaser/scripts/prepare.sh +7 -0
- package/lib/__templates__/phaser/scripts/start.sh +11 -0
- package/lib/__templates__/phaser/scripts/validate.sh +7 -0
- package/lib/__templates__/phaser/src/assets.ts +15 -0
- package/lib/__templates__/phaser/src/global.d.ts +36 -0
- package/lib/__templates__/phaser/src/main.ts +28 -0
- package/lib/__templates__/phaser/src/scene/BootScene.ts +209 -0
- package/lib/__templates__/phaser/src/scene/DevLoadingScene.ts +66 -0
- package/lib/__templates__/phaser/src/style.css +28 -0
- package/lib/__templates__/phaser/src/types.ts +32 -0
- package/lib/__templates__/phaser/src/utils/asset-loader.ts +319 -0
- package/lib/__templates__/phaser/src/utils/index.ts +2 -0
- package/lib/__templates__/phaser/src/utils/mark-editable.ts +6 -0
- package/lib/__templates__/phaser/template.config.js +43 -0
- package/lib/__templates__/phaser/tsconfig.json +23 -0
- package/lib/__templates__/phaser/vite.config.ts +96 -0
- package/lib/__templates__/templates.json +25 -0
- package/lib/cli.js +3335 -196
- package/lib/deploy/package-project.js +220 -0
- package/lib/deploy/package-project.py +165 -0
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -19,6 +19,17 @@ rush update
|
|
|
19
19
|
|
|
20
20
|
## 使用
|
|
21
21
|
|
|
22
|
+
### 部署应用
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
coze-dev deploy auth login
|
|
26
|
+
coze-dev deploy code deploy --source-root . --yes --wait
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
完整命令、参数和示例见 [部署命令文档](./docs/deploy.md)。部署命令与其它
|
|
30
|
+
`coze-dev` 能力共享 `~/.coze/cli/config.json` 登录态,也支持通过
|
|
31
|
+
`COZE_API_TOKEN` 提供固定运行时凭证。
|
|
32
|
+
|
|
22
33
|
### 初始化项目
|
|
23
34
|
|
|
24
35
|
```bash
|
package/docs/deploy.md
ADDED
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
# coze-dev deploy
|
|
2
|
+
|
|
3
|
+
`coze-dev` 内置的部署命令,复用主 Coze CLI 保存在
|
|
4
|
+
`~/.coze/cli/config.json` 中的登录状态。
|
|
5
|
+
|
|
6
|
+
## 安装与运行
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
npm install -g @coze-arch/cli
|
|
10
|
+
coze-dev deploy auth login
|
|
11
|
+
coze-dev deploy auth status
|
|
12
|
+
coze-dev deploy doctor
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
默认输出 JSON,可通过 `--format text` 切换为文本输出。
|
|
16
|
+
|
|
17
|
+
首次部署不需要手动查找 `space_id` 或 `project_id`。当 `.coze [project]` 没有
|
|
18
|
+
`project_id` 时,CLI 会复用已配置的 Space;如果尚未配置,会查询当前账号
|
|
19
|
+
可用的 Space、自动选择第一个并保存,然后根据 `.coze` 的
|
|
20
|
+
`[project].project_type` 创建当前源码目录专属的普通编程 Project。
|
|
21
|
+
映射与部署服务端对 `.coze` 的解析保持一致:`agent`→Agent、`workflow`/`automation`→Automation、
|
|
22
|
+
`app`→App、`skill`→Skill、`web`/`backend`→GeneralWeb、`miniapp`/`miniprogram`→WechatMiniProgram;
|
|
23
|
+
其他值或未声明 `project_type` 时创建通用 General Project。不会复用共享的 CLIBilling Project。
|
|
24
|
+
|
|
25
|
+
> Project 类型不只是元信息:它决定注入运行时的 `COZE_PROJECT_TYPE`、是否为该 Project 开通
|
|
26
|
+
> Postgres、以及流量网关是否强制入站鉴权。类型建错时部署照样成功,但服务可能起不来 —— 例如
|
|
27
|
+
> agent 模板靠 `COZE_PROJECT_TYPE` 选择要加载的图,并在启动时读取 `PGDATABASE_URL`。
|
|
28
|
+
> 类型在创建 Project 时一次性确定,之后再改 `.coze project_type` 不会改变已有 Project 的类型。
|
|
29
|
+
|
|
30
|
+
指定 PPE 泳道时,增加全局参数 `--lane`。CLI 会为所有部署 API 请求发送
|
|
31
|
+
`x-tt-env` 和 `x-use-ppe: 1`,该参数只对当前命令生效:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
coze-dev deploy --lane ppe_deploy code app list
|
|
35
|
+
coze-dev deploy --lane ppe_deploy code deploy --source-root .
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## 命令
|
|
39
|
+
|
|
40
|
+
```text
|
|
41
|
+
coze-dev deploy context show
|
|
42
|
+
coze-dev deploy auth login|status|logout
|
|
43
|
+
coze-dev deploy context use --space-id <space_id>
|
|
44
|
+
coze-dev deploy doctor
|
|
45
|
+
coze-dev deploy code app list [--page-size <n>] [--page-token <token>] [--all]
|
|
46
|
+
coze-dev deploy code app show --app-id <app_id>
|
|
47
|
+
coze-dev deploy code app rename <name> --app-id <app_id> --yes
|
|
48
|
+
coze-dev deploy code app delete --app-id <app_id> --yes
|
|
49
|
+
coze-dev deploy code app analytics|metrics --app-id <app_id> [--time-range <range>]
|
|
50
|
+
coze-dev deploy code app usage --app-id <app_id> --bill-month <YYYY-MM>
|
|
51
|
+
coze-dev deploy [--lane <ppe_lane>] code deploy [--source-root <directory>] [--app-id <app_id>] [--application-type <type>] [--name <name>] [--connector-id <id>]
|
|
52
|
+
coze-dev deploy code deploy status|list|online|rollback-check|cancel|rollback|stop|resume|pause
|
|
53
|
+
coze-dev deploy code deploy logs|log-count|count|build-log|config
|
|
54
|
+
coze-dev deploy code domain list [--unit-type dev|prod]
|
|
55
|
+
coze-dev deploy code domain add <domain>
|
|
56
|
+
coze-dev deploy code domain set-prefix <prefix> --app-id <app_id> --yes
|
|
57
|
+
coze-dev deploy code mini-program status|bind|submit-code|unbind
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
`code app list` 是真分页:一次只返回一页(`--page-size` 默认 20、上限 100),`has_more` 为真时用返回的 `next_page_token` 取下一页;要一次拿到名下全部应用用 `--all`,它会自己翻到底。
|
|
61
|
+
|
|
62
|
+
部署确认阶段不传 `--yes`;确认后使用相同参数增加 `--yes`,需要等待终态时再增加
|
|
63
|
+
`--wait`。CLI 会为每次请求自动生成一个 40 位十六进制源码快照 ID,用于兼容 V2 接口的
|
|
64
|
+
`commit_hash` 字段,用户无需指定。该 ID 不代表 Git commit;源码目录无需由 Git 管理,
|
|
65
|
+
打包时始终读取目录的最新内容。CLI 会把当前源码目录专属的 `project_id` 和唯一 `app_id`
|
|
66
|
+
写入 `.coze [project]`,ID 使用引号包裹的十进制字符串。后续类型一致时自动复用该
|
|
67
|
+
Application;类型不一致时创建新 Application、覆盖 `app_id` 并提示。也可用 `--project-id`
|
|
68
|
+
或 `--app-id` 显式指定已有资源,显式指定时不会额外创建 Project。
|
|
69
|
+
|
|
70
|
+
首次部署的应用名称可通过 `--name` 指定;显式参数优先于 `.coze` 的
|
|
71
|
+
`[project].name`。Pages 部署没有 `.coze` 时,CLI 会先生成最小配置再写入绑定。
|
|
72
|
+
|
|
73
|
+
```toml
|
|
74
|
+
[project]
|
|
75
|
+
name = "Phaser 游戏"
|
|
76
|
+
project_type = "web"
|
|
77
|
+
project_id = "987654321"
|
|
78
|
+
app_id = "123456789"
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Pages 首次部署没有 `app_id`,必须显式指定交付类型。Pages 将
|
|
82
|
+
`--source-root` 视为项目根目录:根目录已有 `index.html` 时直接打包;否则读取 `.coze`,
|
|
83
|
+
要求 `project.template = "nextjs"` 且 `deploy.build` 为非空命令数组。CLI 不在本地安装
|
|
84
|
+
依赖或执行 Pages 构建,只上传源码;Deploy 服务在 Sandbox 中注入 Next.js 静态导出配置,
|
|
85
|
+
执行 `deploy.build`,并要求最终产出 `out/index.html`:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
coze-dev deploy code deploy --source-root . --application-type pages
|
|
89
|
+
coze-dev deploy code deploy --source-root . --application-type pages --yes --wait
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
创建成功后 CLI 会把 Pages Application 写入 `.coze`;后续可继续传
|
|
93
|
+
`--application-type pages` 自动复用,或显式传 `--app-id`。
|
|
94
|
+
|
|
95
|
+
V2 接口的所有参数均通过 POST JSON body 发送,不会放入 URL。确认非 Pages 部署后,CLI
|
|
96
|
+
会执行 `.coze` 中可选的 `dev.pack` 命令,将
|
|
97
|
+
本地部署内容打成无根目录的 `tar.gz`,再通过 `source_package_base64` 上传。Pages 部署
|
|
98
|
+
统一上传源码根目录:已有 `index.html` 时服务端跳过构建,没有时由服务端按 Snapshot 中的
|
|
99
|
+
`.coze deploy.build` 构建。打包由 CLI 自带的 Node.js 脚本执行,并排除 `.coze`、`.env`、
|
|
100
|
+
`.git`、`.venv`、`.codegraph`、`node_modules`、`.next`、`site-packages` 和 `__pycache__`。
|
|
101
|
+
`scripts/package-project.py` 仍随源码和 npm 包保留,仅作为 Python 参考备份与行为对照,
|
|
102
|
+
生产打包链路不会调用 Python。
|
|
103
|
+
|
|
104
|
+
服务和小程序部署会读取源码根目录的 `.env` 并加密上传;`COZE_` 前缀为平台保留,CLI
|
|
105
|
+
会过滤这类变量,避免覆盖部署运行时由平台注入的配置。
|
|
106
|
+
|
|
107
|
+
本地环境变量可通过以下命令管理,默认操作当前目录的 `.env`,也可通过
|
|
108
|
+
`--source-root` 指定项目目录;这些命令不会请求部署服务:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
coze-dev deploy code env list
|
|
112
|
+
coze-dev deploy code env set API_KEY "secret value"
|
|
113
|
+
coze-dev deploy code env delete API_KEY
|
|
114
|
+
coze-dev deploy code env list --source-root ./projects/example
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
`env set` 和 `env delete` 不允许操作 `COZE_` 前缀的保留变量。
|
|
118
|
+
|
|
119
|
+
小程序部署可重复指定渠道:微信为 `10000127`,抖音为 `10000126`:
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
coze-dev deploy code deploy --source-root . --application-type mini_program \
|
|
123
|
+
--connector-id 10000127 --yes --wait
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
绑定小程序 AppID 时,默认从源码目录 `.coze [project]` 读取该目录的 `project_id`:
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
coze-dev deploy code mini-program bind \
|
|
130
|
+
--platform wechat \
|
|
131
|
+
--mini-app-id wx123 \
|
|
132
|
+
--redirect-url https://code.coze.cn/coding/auth/callback/miniprogram
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
返回 `bind_status=1` 时,打开 `need_authorize_data.auth_url` 完成授权。回调页会自动
|
|
136
|
+
提交授权码;无回调页的调用方也可使用 `mini-program submit-code` 手动提交。
|
|
137
|
+
|
|
138
|
+
`code deploy status` 和 `list` 会返回 `deploy_detail[].deploy_log_key`。只有一个日志
|
|
139
|
+
key 时,`code deploy build-log --deploy-id <id>` 会自动解析;存在多个 key 时按错误
|
|
140
|
+
详情中的 `available_keys` 选择一个并传 `--key`。
|
|
141
|
+
|
|
142
|
+
应用维度的管理和观测命令均支持 `--app-id`;省略时从当前目录的 `.coze [project]` 读取:
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
coze-dev deploy code app rename "新应用名称" --app-id <app_id> --yes
|
|
146
|
+
coze-dev deploy code deploy online --app-id <app_id>
|
|
147
|
+
coze-dev deploy code deploy rollback-check --app-id <app_id> --deploy-id <history_id>
|
|
148
|
+
coze-dev deploy code deploy log-count --app-id <app_id>
|
|
149
|
+
coze-dev deploy code deploy count --app-id <app_id>
|
|
150
|
+
coze-dev deploy code app metrics --app-id <app_id> --time-range week
|
|
151
|
+
coze-dev deploy code app usage --app-id <app_id> --bill-month 2026-08
|
|
152
|
+
coze-dev deploy code domain list --app-id <app_id> --unit-type dev
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
`domain list` 默认查询 Prod 域名;传 `--unit-type dev` 查询开发态预览域名。
|
|
156
|
+
审核 Unit 是内部流水线槽位,不支持从 CLI 查询。
|
|
157
|
+
|
|
158
|
+
`code domain set-prefix` 改的是**系统分配的默认域名**(`<prefix>.coze.site`)里的 prefix,
|
|
159
|
+
后缀不变;`code domain add` 加进来的自定义域名不受影响 —— 那类域名服务端只有 create/delete,
|
|
160
|
+
域名串本身改不了。改完旧默认域名立刻不再指向本应用,已经发出去的链接会失效,所以必须传 `--yes`。
|
|
161
|
+
前缀的长度、保留词、是否被占用由服务端判定,CLI 只拦形态明显不合法的值(大写、首尾连字符等)。
|
|
162
|
+
这是**权益能力**:账号没有对应权益时服务端会直接拒绝。
|
|
163
|
+
|
|
164
|
+
`code app delete` 删除应用,终态不可撤销,必须传 `--yes`。服务端**只接受已停服的应用**:
|
|
165
|
+
仍在服务时会返回一条带当前状态的错误,先跑 `code deploy stop --yes` 再删。CLI 不会替你先停 ——
|
|
166
|
+
停服会真的把线上服务摘掉,那一步要由你自己确认。删除会一并停掉该应用名下的部署单元、
|
|
167
|
+
软删它的域名并清理残留的函数;已删除的应用再删一次是幂等成功。删完记得把 `.coze [project]`
|
|
168
|
+
里的 `app_id` 去掉,否则同目录下一次 `code deploy` 会打到这个已删除的应用上被服务端拒。
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
requires = ["nodejs-24"]
|
|
3
|
+
project_type = "game"
|
|
4
|
+
game_type = "phaser"
|
|
5
|
+
|
|
6
|
+
[dev]
|
|
7
|
+
build = ["bash", "./scripts/prepare.sh"]
|
|
8
|
+
run = ["bash", "./scripts/dev.sh"]
|
|
9
|
+
validate = ["bash", "./scripts/validate.sh"]
|
|
10
|
+
|
|
11
|
+
[deploy]
|
|
12
|
+
build = ["bash", "./scripts/build.sh"]
|
|
13
|
+
run = ["bash", "./scripts/start.sh"]
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# <%= appName %>
|
|
2
|
+
|
|
3
|
+
这是一个基于 Phaser、Vite 和 TypeScript 的 2D 游戏项目,由扣子编程 CLI 创建。
|
|
4
|
+
|
|
5
|
+
## 快速开始
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
coze-dev dev
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
开发服务器默认运行在 [http://127.0.0.1:<%= port %>](http://127.0.0.1:<%= port %>)。
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
coze-dev validate # TypeScript 类型检查
|
|
15
|
+
coze-dev build # 生产构建
|
|
16
|
+
coze-dev start # 预览生产构建
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## 文件结构
|
|
20
|
+
|
|
21
|
+
```text
|
|
22
|
+
├── assets/ # 图片、序列帧、视频和音频
|
|
23
|
+
├── debug-runtime/ # 调试 Flow
|
|
24
|
+
├── src/assets.ts # 素材 key 与路径
|
|
25
|
+
├── src/main.ts # 游戏入口
|
|
26
|
+
├── src/scene/BootScene.ts # 启动与全量加载
|
|
27
|
+
├── src/utils/asset-loader.ts # 批量和单素材加载
|
|
28
|
+
├── src/types.ts # 类型定义
|
|
29
|
+
└── vite.config.ts # Bridge 注入与素材目录映射
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
- 素材按类型放在 `assets/`,并登记到 `src/assets.ts` 对应的分类表。
|
|
33
|
+
- 序列帧只登记文件夹;Loader 从 `manifest.json` 读取帧数和帧率。
|
|
34
|
+
- `BootScene` 加载游戏素材;运行时可用 `loadAsset(this, key)` 单独加载。
|
|
35
|
+
- 开发和生产都使用稳定的 `assets/...` 路径,生产构建原样复制素材目录。
|
|
36
|
+
|
|
37
|
+
`IMAGES`、`IMAGE_SEQUENCES`、`VIDEOS` 和 `AUDIOS` 是四个素材分类表。
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
loglevel=error
|
|
2
|
+
registry=https://registry.npmmirror.com
|
|
3
|
+
|
|
4
|
+
strictStorePkgContentCheck=false
|
|
5
|
+
verifyStoreIntegrity=false
|
|
6
|
+
network-concurrency=16
|
|
7
|
+
fetch-retries=3
|
|
8
|
+
fetch-timeout=60000
|
|
9
|
+
strict-peer-dependencies=false
|
|
10
|
+
auto-install-peers=true
|
|
11
|
+
lockfile=true
|
|
12
|
+
prefer-frozen-lockfile=true
|
|
13
|
+
resolution-mode=highest
|
|
14
|
+
update-notifier=false
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": 1,
|
|
3
|
+
"graphs": [
|
|
4
|
+
{
|
|
5
|
+
"id": "main",
|
|
6
|
+
"label": "主流程",
|
|
7
|
+
"nodes": [
|
|
8
|
+
{
|
|
9
|
+
"id": "start",
|
|
10
|
+
"label": "开始游戏",
|
|
11
|
+
"input_schema": {
|
|
12
|
+
"type": "object",
|
|
13
|
+
"properties": {}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"transitions": []
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="zh-CN">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title><%= appName %></title>
|
|
7
|
+
</head>
|
|
8
|
+
<body>
|
|
9
|
+
<main id="game" aria-label="Phaser game canvas"></main>
|
|
10
|
+
<script type="module" src="/src/main.ts"></script>
|
|
11
|
+
</body>
|
|
12
|
+
</html>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "<%= appName %>",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Phaser 3 game with Vite and TypeScript",
|
|
5
|
+
"private": true,
|
|
6
|
+
"type": "module",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "pnpm typecheck && vite build",
|
|
9
|
+
"dev": "vite",
|
|
10
|
+
"preinstall": "npx only-allow pnpm",
|
|
11
|
+
"preview": "vite preview",
|
|
12
|
+
"start": "vite preview",
|
|
13
|
+
"typecheck": "tsc --noEmit",
|
|
14
|
+
"validate": "pnpm typecheck"
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"phaser": "^3.90.0"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@types/node": "^24.0.0",
|
|
21
|
+
"@types/serve-static": "^2.2.0",
|
|
22
|
+
"only-allow": "^1.2.2",
|
|
23
|
+
"serve-static": "^2.2.1",
|
|
24
|
+
"typescript": "^5.9.3",
|
|
25
|
+
"vite": "^8.2.0"
|
|
26
|
+
},
|
|
27
|
+
"packageManager": "pnpm@9.0.0",
|
|
28
|
+
"engines": {
|
|
29
|
+
"pnpm": ">=9.0.0"
|
|
30
|
+
}
|
|
31
|
+
}
|