@coze-arch/cli 0.0.35 → 0.0.36-alpha.b293fc
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/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 +1 -1
- package/package.json +1 -1
|
@@ -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.15.9",
|
|
28
|
+
"engines": {
|
|
29
|
+
"pnpm": ">=9.0.0"
|
|
30
|
+
}
|
|
31
|
+
}
|