@ducky7go/ducky-cli 0.0.4 → 0.0.5-dev.2

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.
Files changed (61) hide show
  1. package/README.md +47 -199
  2. package/dist/cli.d.ts.map +1 -1
  3. package/dist/cli.js +2 -0
  4. package/dist/cli.js.map +1 -1
  5. package/dist/commands/steam/index.d.ts +3 -0
  6. package/dist/commands/steam/index.d.ts.map +1 -0
  7. package/dist/commands/steam/index.js +21 -0
  8. package/dist/commands/steam/index.js.map +1 -0
  9. package/dist/commands/steam/push.d.ts +3 -0
  10. package/dist/commands/steam/push.d.ts.map +1 -0
  11. package/dist/commands/steam/push.js +29 -0
  12. package/dist/commands/steam/push.js.map +1 -0
  13. package/dist/commands/steam/validate.d.ts +3 -0
  14. package/dist/commands/steam/validate.d.ts.map +1 -0
  15. package/dist/commands/steam/validate.js +47 -0
  16. package/dist/commands/steam/validate.js.map +1 -0
  17. package/dist/formats/steam/config.d.ts +23 -0
  18. package/dist/formats/steam/config.d.ts.map +1 -0
  19. package/dist/formats/steam/config.js +32 -0
  20. package/dist/formats/steam/config.js.map +1 -0
  21. package/dist/formats/steam/metadata.d.ts +45 -0
  22. package/dist/formats/steam/metadata.d.ts.map +1 -0
  23. package/dist/formats/steam/metadata.js +293 -0
  24. package/dist/formats/steam/metadata.js.map +1 -0
  25. package/dist/formats/steam/parser.d.ts +20 -0
  26. package/dist/formats/steam/parser.d.ts.map +1 -0
  27. package/dist/formats/steam/parser.js +88 -0
  28. package/dist/formats/steam/parser.js.map +1 -0
  29. package/dist/formats/steam/progress-display.d.ts +38 -0
  30. package/dist/formats/steam/progress-display.d.ts.map +1 -0
  31. package/dist/formats/steam/progress-display.js +123 -0
  32. package/dist/formats/steam/progress-display.js.map +1 -0
  33. package/dist/formats/steam/progress.d.ts +79 -0
  34. package/dist/formats/steam/progress.d.ts.map +1 -0
  35. package/dist/formats/steam/progress.js +126 -0
  36. package/dist/formats/steam/progress.js.map +1 -0
  37. package/dist/formats/steam/push-handler.d.ts +22 -0
  38. package/dist/formats/steam/push-handler.d.ts.map +1 -0
  39. package/dist/formats/steam/push-handler.js +31 -0
  40. package/dist/formats/steam/push-handler.js.map +1 -0
  41. package/dist/formats/steam/upload-standalone.d.ts +20 -0
  42. package/dist/formats/steam/upload-standalone.d.ts.map +1 -0
  43. package/dist/formats/steam/upload-standalone.js +221 -0
  44. package/dist/formats/steam/upload-standalone.js.map +1 -0
  45. package/dist/formats/steam/validator.d.ts +58 -0
  46. package/dist/formats/steam/validator.d.ts.map +1 -0
  47. package/dist/formats/steam/validator.js +136 -0
  48. package/dist/formats/steam/validator.js.map +1 -0
  49. package/dist/formats/steam/workshop.d.ts +72 -0
  50. package/dist/formats/steam/workshop.d.ts.map +1 -0
  51. package/dist/formats/steam/workshop.js +221 -0
  52. package/dist/formats/steam/workshop.js.map +1 -0
  53. package/dist/utils/errors.d.ts +24 -0
  54. package/dist/utils/errors.d.ts.map +1 -1
  55. package/dist/utils/errors.js +51 -0
  56. package/dist/utils/errors.js.map +1 -1
  57. package/dist/utils/fs.d.ts +8 -0
  58. package/dist/utils/fs.d.ts.map +1 -1
  59. package/dist/utils/fs.js +22 -0
  60. package/dist/utils/fs.js.map +1 -1
  61. package/package.json +2 -1
package/README.md CHANGED
@@ -1,241 +1,89 @@
1
1
  # ducky-cli
2
2
 
3
- A command-line tool for packaging and publishing game mods to NuGet servers. `ducky-cli` brings the functionality of `action-ducky-nuget` GitHub Action to local development environments, enabling game mod developers to package and publish their mods directly from the command line.
3
+ 用于将游戏模组打包并发布到 NuGet 服务器和 Steam 创意工坊的命令行工具。
4
4
 
5
- ## Features
6
-
7
- - **NuGet Packaging**: Create `.nupkg` packages from mod directories
8
- - **NuGet Publishing**: Publish packages to nuget.org or custom NuGet servers
9
- - **Validation**: Validate mods against the [NuGet Mod Packaging Specification v1.0](https://github.com/ducky7go/dukcy-package-spec)
10
- - **Cross-Platform**: Works on Windows, macOS, and Linux
11
- - **Namespace Design**: Organized commands for future support of other package formats
12
-
13
- ## Installation
5
+ ## 安装
14
6
 
15
7
  ```bash
16
8
  npm install -g ducky-cli
17
9
  ```
18
10
 
19
- Or use directly with npx:
11
+ 或使用 npx
20
12
 
21
13
  ```bash
22
14
  npx ducky-cli --help
23
15
  ```
24
16
 
25
- ## Quick Start
26
-
27
- ### Package a Mod
17
+ ## 快速开始
28
18
 
29
19
  ```bash
20
+ # NuGet 打包和发布
30
21
  ducky nuget pack ./mods/MyMod
31
- ```
32
-
33
- This creates a `.nupkg` file in the mod directory.
34
-
35
- ### Publish to NuGet
36
-
37
- ```bash
38
- # Set your API key
39
- export NUGET_API_KEY=your-api-key
40
-
41
- # Push a .nupkg file
42
- ducky nuget push ./mods/MyMod.1.0.0.nupkg
43
-
44
- # Or pack and push in one step
45
- ducky nuget push ./mods/MyMod --pack
46
- ```
47
-
48
- ### Validate a Mod
49
-
50
- ```bash
51
- ducky nuget validate ./mods/MyMod
52
- ```
53
-
54
- ## Commands
55
-
56
- ### `ducky nuget pack`
57
-
58
- Package a mod directory into a `.nupkg` file.
59
-
60
- ```bash
61
- ducky nuget pack <path> [options]
62
- ```
63
-
64
- **Arguments:**
65
- - `<path>` - Path to the mod directory
66
-
67
- **Options:**
68
- - `-o, --output <path>` - Output directory for the `.nupkg` file (default: same as input)
69
- - `-v, --verbose` - Enable verbose output
70
-
71
- **Example:**
72
- ```bash
73
- ducky nuget pack ./mods/MyMod -o ./output
74
- ```
75
-
76
- ### `ducky nuget push`
77
-
78
- Publish a `.nupkg` file to a NuGet server.
79
-
80
- ```bash
81
- ducky nuget push <path> [options]
82
- ```
83
-
84
- **Arguments:**
85
- - `<path>` - Path to the `.nupkg` file or mod directory (with `--pack`)
86
-
87
- **Options:**
88
- - `-p, --pack` - Package the mod before pushing
89
- - `-s, --server <url>` - NuGet server URL (default: `https://api.nuget.org/v3/index.json`)
90
- - `-k, --api-key <key>` - NuGet API key
91
- - `-o, --output <path>` - Output directory for `.nupkg` file (when using `--pack`)
92
- - `-v, --verbose` - Enable verbose output
93
-
94
- **Examples:**
95
- ```bash
96
- # Push an existing .nupkg file
97
22
  ducky nuget push ./mods/MyMod.1.0.0.nupkg
98
23
 
99
- # Pack and push in one step
100
- ducky nuget push ./mods/MyMod --pack
101
-
102
- # Use a custom NuGet server
103
- ducky nuget push ./mods/MyMod.1.0.0.nupkg --server https://my-nuget-server.com/v3/index.json
24
+ # Steam 创意工坊发布
25
+ ducky steam push ./mods/MyMod
26
+ ducky steam push ./mods/MyMod --update-description
104
27
  ```
105
28
 
106
- ### `ducky nuget validate`
29
+ ## 文档
107
30
 
108
- Validate a mod directory against the NuGet Mod Packaging Specification.
31
+ - [NuGet 文档](./docs/nuget.md) - 打包和发布到 NuGet 服务器
32
+ - [Steam 文档](./docs/steam.md) - 发布到 Steam 创意工坊
109
33
 
110
- ```bash
111
- ducky nuget validate <path> [options]
112
- ```
113
-
114
- **Arguments:**
115
- - `<path>` - Path to the mod directory
116
-
117
- **Options:**
118
- - `-v, --verbose` - Enable verbose output
119
-
120
- **Example:**
121
- ```bash
122
- ducky nuget validate ./mods/MyMod
123
- ```
124
-
125
- ## Configuration
126
-
127
- Configuration can be provided via:
128
- 1. Command-line flags (highest priority)
129
- 2. Environment variables
130
- 3. Default values (lowest priority)
131
-
132
- ### Environment Variables
133
-
134
- - `NUGET_API_KEY` - API key for NuGet authentication
135
- - `NUGET_SERVER` - Default NuGet server URL
136
- - `NUGET_VERBOSE` - Enable verbose output
137
-
138
- ## Mod Directory Structure
139
-
140
- A valid mod directory should contain:
141
-
142
- ```
143
- MyMod/
144
- ├── info.ini # Mod metadata (required)
145
- ├── MyMod.dll # Main DLL (required, name must match info.ini name field)
146
- ├── preview.png # Optional preview image
147
- └── ...other files # Any other mod files
148
- ```
149
-
150
- ### info.ini Format
151
-
152
- ```ini
153
- name=MyMod
154
- version=1.0.0
155
- description=My awesome game mod
156
- author=Your Name
157
- projectUrl=https://github.com/yourname/mymod
158
- license=MIT
159
- tags=game,mod,example
34
+ ## 功能特性
160
35
 
161
- [dependencies]
162
- OtherMod=1.0.0
163
- ```
164
-
165
- **Required fields:**
166
- - `name` - NuGet package ID (must start with letter or underscore, max 100 chars)
167
- - `version` - SemVer 2.0 version (e.g., `1.0.0`, `2.1.0-beta`)
168
-
169
- **Optional fields:**
170
- - `description` - Package description
171
- - `author` - Package author
172
- - `projectUrl` - Project URL
173
- - `license` - License identifier
174
- - `tags` - Comma-separated list of tags
175
- - `dependencies` - Comma-separated list of dependencies with optional versions
36
+ - **NuGet 打包**:从模组目录创建 `.nupkg` 包
37
+ - **NuGet 发布**:发布到 nuget.org 或自定义 NuGet 服务器
38
+ - **Steam 创意工坊发布**:支持多语言发布模组
39
+ - **验证**:按照打包规范验证模组
40
+ - **跨平台**:支持 Windows、macOS 和 Linux
176
41
 
177
- ## Validation Rules
42
+ ## 命令概览
178
43
 
179
- The tool validates mods against these rules:
44
+ | 命令 | 描述 |
45
+ |------|------|
46
+ | `ducky nuget pack <path>` | 将模组目录打包为 `.nupkg` |
47
+ | `ducky nuget push <path>` | 发布到 NuGet 服务器 |
48
+ | `ducky nuget validate <path>` | 验证 NuGet 模组 |
49
+ | `ducky steam validate <path>` | 验证 Steam 创意工坊模组 |
50
+ | `ducky steam push <path>` | 发布到 Steam 创意工坊 |
180
51
 
181
- 1. **DLL Name Matching**: At least one DLL file must have a base name matching the `name` field in `info.ini`
182
- 2. **SemVer 2.0 Version**: Version must follow semantic versioning 2.0 format
183
- 3. **Valid NuGet ID**: Package name must be a valid NuGet identifier
184
- 4. **Required Fields**: `name` and `version` fields are required
52
+ ## 配置
185
53
 
186
- ## Examples
187
-
188
- ### Complete Workflow
54
+ 通过环境变量设置:
189
55
 
190
56
  ```bash
191
- # 1. Create your mod directory with info.ini and DLL files
192
- mkdir -p ./mods/MyMod
193
-
194
- # 2. Validate your mod
195
- ducky nuget validate ./mods/MyMod
196
-
197
- # 3. Package your mod
198
- ducky nuget pack ./mods/MyMod
199
-
200
- # 4. Publish to NuGet
57
+ # NuGet
201
58
  export NUGET_API_KEY=your-api-key
202
- ducky nuget push ./mods/MyMod.1.0.0.nupkg
203
- ```
59
+ export NUGET_SERVER=https://api.nuget.org/v3/index.json
204
60
 
205
- ### Using Custom NuGet Server
206
-
207
- ```bash
208
- export NUGET_SERVER=https://my-nuget-server.com/v3/index.json
209
- export NUGET_API_KEY=your-api-key
210
- ducky nuget push ./mods/MyMod.1.0.0.nupkg
61
+ # Steam
62
+ export STEAM_APP_ID=3167020
211
63
  ```
212
64
 
213
- ## Error Handling
214
-
215
- The tool provides helpful error messages with suggestions:
65
+ ## 模组目录结构
216
66
 
217
67
  ```
218
- ✖ Invalid version format: 1.0
219
-
220
- Suggestions:
221
- Version must follow SemVer 2.0 format
222
- Examples: 1.0.0, 2.1.0-beta, 3.0.0-rc.1
68
+ MyMod/
69
+ ├── info.ini # 模组元数据(必需)
70
+ ├── MyMod.dll # 主 DLL(必需)
71
+ ├── preview.png # 预览图片(Steam 必需)
72
+ ├── description/ # 多语言描述(Steam 使用)
73
+ │ ├── en.md
74
+ │ └── zh.md
75
+ └── ...其他文件
223
76
  ```
224
77
 
225
- ## Contributing
226
-
227
- Contributions are welcome! Please read our contributing guidelines before submitting PRs.
228
-
229
- ## License
78
+ ## 许可证
230
79
 
231
- MIT License - see LICENSE file for details
80
+ MIT License - 详见 LICENSE 文件
232
81
 
233
- ## Related Projects
82
+ ## 相关项目
234
83
 
235
- - [action-ducky-nuget](https://github.com/ducky7go/action-ducky-nuget) - GitHub Action for CI/CD
236
- - [NuGet Mod Packaging Specification](https://github.com/ducky7go/dukcy-package-spec) - Specification for mod packaging
84
+ - [action-ducky-nuget](https://github.com/ducky7go/action-ducky-nuget) - CI/CD GitHub Action
85
+ - [NuGet 模组打包规范](https://github.com/ducky7go/dukcy-package-spec)
237
86
 
238
- ## Support
87
+ ## 支持
239
88
 
240
- - Report bugs: [GitHub Issues](https://github.com/ducky7go/ducky-cli/issues)
241
- - Documentation: [GitHub Wiki](https://github.com/ducky7go/ducky-cli/wiki)
89
+ - 报告问题:[GitHub Issues](https://github.com/ducky7go/ducky-cli/issues)
package/dist/cli.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,QAAA,MAAM,OAAO,SAAgB,CAAC;AAkB9B,OAAO,EAAE,OAAO,EAAE,CAAC"}
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,QAAA,MAAM,OAAO,SAAgB,CAAC;AAmB9B,OAAO,EAAE,OAAO,EAAE,CAAC"}
package/dist/cli.js CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { Command } from 'commander';
3
3
  import { registerNuGetCommands } from './commands/nuget/index.js';
4
+ import { registerSteamCommands } from './commands/steam/index.js';
4
5
  // Create the main program
5
6
  const program = new Command();
6
7
  program
@@ -9,6 +10,7 @@ program
9
10
  .version('0.1.0');
10
11
  // Register format namespaces
11
12
  registerNuGetCommands(program);
13
+ registerSteamCommands(program);
12
14
  // Future formats can be registered here:
13
15
  // registerZipCommands(program);
14
16
  // registerTarCommands(program);
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAElE,0BAA0B;AAC1B,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,OAAO,CAAC;KACb,WAAW,CAAC,iDAAiD,CAAC;KAC9D,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,6BAA6B;AAC7B,qBAAqB,CAAC,OAAO,CAAC,CAAC;AAE/B,yCAAyC;AACzC,gCAAgC;AAChC,gCAAgC;AAEhC,kBAAkB;AAClB,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAE5B,qBAAqB;AACrB,OAAO,EAAE,OAAO,EAAE,CAAC"}
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAElE,0BAA0B;AAC1B,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,OAAO,CAAC;KACb,WAAW,CAAC,iDAAiD,CAAC;KAC9D,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,6BAA6B;AAC7B,qBAAqB,CAAC,OAAO,CAAC,CAAC;AAC/B,qBAAqB,CAAC,OAAO,CAAC,CAAC;AAE/B,yCAAyC;AACzC,gCAAgC;AAChC,gCAAgC;AAEhC,kBAAkB;AAClB,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAE5B,qBAAqB;AACrB,OAAO,EAAE,OAAO,EAAE,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function registerSteamCommands(program: Command): void;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/steam/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAqB5D"}
@@ -0,0 +1,21 @@
1
+ import { Command } from 'commander';
2
+ import { steamValidateCommand } from './validate.js';
3
+ import { steamPushCommand } from './push.js';
4
+ export function registerSteamCommands(program) {
5
+ // Create the steam namespace command
6
+ const steamCommand = new Command('steam')
7
+ .description('Steam Workshop publishing commands')
8
+ .addHelpText('beforeAll', `
9
+ Steam commands for publishing game mods to Steam Workshop.
10
+
11
+ Examples:
12
+ $ ducky steam validate ./mods/MyMod
13
+ $ ducky steam push ./mods/MyMod
14
+ $ ducky steam push ./mods/MyMod --update-description --changelog "Fixed bugs"
15
+ `);
16
+ // Register subcommands
17
+ steamCommand.addCommand(steamValidateCommand);
18
+ steamCommand.addCommand(steamPushCommand);
19
+ program.addCommand(steamCommand);
20
+ }
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/steam/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE7C,MAAM,UAAU,qBAAqB,CAAC,OAAgB;IACpD,qCAAqC;IACrC,MAAM,YAAY,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC;SACtC,WAAW,CAAC,oCAAoC,CAAC;SACjD,WAAW,CACV,WAAW,EACX;;;;;;;CAOL,CACI,CAAC;IAEJ,uBAAuB;IACvB,YAAY,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC;IAC9C,YAAY,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC;IAE1C,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;AACnC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare const steamPushCommand: Command;
3
+ //# sourceMappingURL=push.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"push.d.ts","sourceRoot":"","sources":["../../../src/commands/steam/push.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,eAAO,MAAM,gBAAgB,SAyBzB,CAAC"}
@@ -0,0 +1,29 @@
1
+ import { Command } from 'commander';
2
+ import { createLogger } from '../../utils/logger.js';
3
+ import { steamPushAction } from '../../formats/steam/push-handler.js';
4
+ export const steamPushCommand = new Command('push')
5
+ .description('Push mod to Steam Workshop')
6
+ .argument('<path>', 'Path to the mod directory')
7
+ .option('--update-description', 'Update Workshop descriptions from description/*.md files', false)
8
+ .option('--changelog <note>', 'Update changelog notes for this update')
9
+ .option('--skip-tail', 'Skip appending submission footer to description and changelog', false)
10
+ .option('-v, --verbose', 'Enable verbose output', false)
11
+ .action(async (path, options) => {
12
+ const logger = createLogger({ verbose: options.verbose });
13
+ logger.header('Steam Workshop Publish');
14
+ try {
15
+ await steamPushAction(path, {
16
+ updateDescription: options.updateDescription,
17
+ changelog: options.changelog,
18
+ skipTail: options.skipTail,
19
+ logger,
20
+ });
21
+ logger.success('Mod published to Steam Workshop successfully!');
22
+ process.exit(0);
23
+ }
24
+ catch (error) {
25
+ logger.error(error);
26
+ process.exit(1);
27
+ }
28
+ });
29
+ //# sourceMappingURL=push.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"push.js","sourceRoot":"","sources":["../../../src/commands/steam/push.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAEtE,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC;KAChD,WAAW,CAAC,4BAA4B,CAAC;KACzC,QAAQ,CAAC,QAAQ,EAAE,2BAA2B,CAAC;KAC/C,MAAM,CAAC,sBAAsB,EAAE,0DAA0D,EAAE,KAAK,CAAC;KACjG,MAAM,CAAC,oBAAoB,EAAE,wCAAwC,CAAC;KACtE,MAAM,CAAC,aAAa,EAAE,+DAA+D,EAAE,KAAK,CAAC;KAC7F,MAAM,CAAC,eAAe,EAAE,uBAAuB,EAAE,KAAK,CAAC;KACvD,MAAM,CAAC,KAAK,EAAE,IAAY,EAAE,OAAgG,EAAE,EAAE;IAC/H,MAAM,MAAM,GAAG,YAAY,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;IAC1D,MAAM,CAAC,MAAM,CAAC,wBAAwB,CAAC,CAAC;IAExC,IAAI,CAAC;QACH,MAAM,eAAe,CAAC,IAAI,EAAE;YAC1B,iBAAiB,EAAE,OAAO,CAAC,iBAAiB;YAC5C,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,MAAM;SACP,CAAC,CAAC;QAEH,MAAM,CAAC,OAAO,CAAC,+CAA+C,CAAC,CAAC;QAChE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,CAAC,KAAK,CAAC,KAAuB,CAAC,CAAC;QACtC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare const steamValidateCommand: Command;
3
+ //# sourceMappingURL=validate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../../src/commands/steam/validate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,eAAO,MAAM,oBAAoB,SA6C7B,CAAC"}
@@ -0,0 +1,47 @@
1
+ import { Command } from 'commander';
2
+ import { createLogger } from '../../utils/logger.js';
3
+ import { SteamValidator } from '../../formats/steam/validator.js';
4
+ import { getSteamAppId } from '../../formats/steam/config.js';
5
+ export const steamValidateCommand = new Command('validate')
6
+ .description('Validate Steam Workshop publishing configuration')
7
+ .argument('<path>', 'Path to the mod directory')
8
+ .option('-v, --verbose', 'Enable verbose output', false)
9
+ .action(async (path, options) => {
10
+ const logger = createLogger({ verbose: options.verbose });
11
+ logger.header('Steam Workshop Validation');
12
+ try {
13
+ const validator = new SteamValidator(logger);
14
+ // Get Steam App ID
15
+ const appId = getSteamAppId();
16
+ logger.info(`Using Steam App ID: ${appId}`);
17
+ // Run validation
18
+ const result = await validator.validate(path);
19
+ // Display results
20
+ if (result.isValid) {
21
+ logger.success('All validations passed!');
22
+ logger.blank();
23
+ logger.info('Your mod is ready to publish to Steam Workshop.');
24
+ }
25
+ else {
26
+ logger.error('Validation failed:');
27
+ logger.blank();
28
+ for (const error of result.errors) {
29
+ logger.error(error.message);
30
+ if (error.suggestions && error.suggestions.length > 0) {
31
+ logger.blank();
32
+ logger.info('Suggestions:');
33
+ for (const suggestion of error.suggestions) {
34
+ console.log(` • ${suggestion}`);
35
+ }
36
+ }
37
+ logger.blank();
38
+ }
39
+ process.exit(1);
40
+ }
41
+ }
42
+ catch (error) {
43
+ logger.error(error);
44
+ process.exit(1);
45
+ }
46
+ });
47
+ //# sourceMappingURL=validate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate.js","sourceRoot":"","sources":["../../../src/commands/steam/validate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAE9D,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,OAAO,CAAC,UAAU,CAAC;KACxD,WAAW,CAAC,kDAAkD,CAAC;KAC/D,QAAQ,CAAC,QAAQ,EAAE,2BAA2B,CAAC;KAC/C,MAAM,CAAC,eAAe,EAAE,uBAAuB,EAAE,KAAK,CAAC;KACvD,MAAM,CAAC,KAAK,EAAE,IAAY,EAAE,OAA6B,EAAE,EAAE;IAC5D,MAAM,MAAM,GAAG,YAAY,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;IAC1D,MAAM,CAAC,MAAM,CAAC,2BAA2B,CAAC,CAAC;IAE3C,IAAI,CAAC;QACH,MAAM,SAAS,GAAG,IAAI,cAAc,CAAC,MAAM,CAAC,CAAC;QAE7C,mBAAmB;QACnB,MAAM,KAAK,GAAG,aAAa,EAAE,CAAC;QAC9B,MAAM,CAAC,IAAI,CAAC,uBAAuB,KAAK,EAAE,CAAC,CAAC;QAE5C,iBAAiB;QACjB,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAE9C,kBAAkB;QAClB,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACnB,MAAM,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAC;YAC1C,MAAM,CAAC,KAAK,EAAE,CAAC;YACf,MAAM,CAAC,IAAI,CAAC,iDAAiD,CAAC,CAAC;QACjE,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;YACnC,MAAM,CAAC,KAAK,EAAE,CAAC;YAEf,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;gBAClC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;gBAC5B,IAAI,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBACtD,MAAM,CAAC,KAAK,EAAE,CAAC;oBACf,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;oBAC5B,KAAK,MAAM,UAAU,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC;wBAC3C,OAAO,CAAC,GAAG,CAAC,OAAO,UAAU,EAAE,CAAC,CAAC;oBACnC,CAAC;gBACH,CAAC;gBACD,MAAM,CAAC,KAAK,EAAE,CAAC;YACjB,CAAC;YAED,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,CAAC,KAAK,CAAC,KAAuB,CAAC,CAAC;QACtC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Steam configuration
3
+ *
4
+ * App ID is fixed at 3167020 and can only be overridden via environment variable.
5
+ * It cannot be added to info.ini.
6
+ */
7
+ /**
8
+ * Get Steam App ID from environment variable or use default
9
+ * @returns Steam App ID
10
+ */
11
+ export declare function getSteamAppId(): number;
12
+ /**
13
+ * Steam configuration interface
14
+ */
15
+ export interface SteamConfig {
16
+ appId: number;
17
+ }
18
+ /**
19
+ * Get Steam configuration
20
+ * @returns Steam configuration
21
+ */
22
+ export declare function getSteamConfig(): SteamConfig;
23
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/formats/steam/config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH;;;GAGG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAUtC;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,wBAAgB,cAAc,IAAI,WAAW,CAI5C"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Steam configuration
3
+ *
4
+ * App ID is fixed at 3167020 and can only be overridden via environment variable.
5
+ * It cannot be added to info.ini.
6
+ */
7
+ const DEFAULT_STEAM_APP_ID = 3167020;
8
+ /**
9
+ * Get Steam App ID from environment variable or use default
10
+ * @returns Steam App ID
11
+ */
12
+ export function getSteamAppId() {
13
+ const envAppId = process.env.STEAM_APP_ID;
14
+ if (envAppId) {
15
+ const appId = parseInt(envAppId, 10);
16
+ if (isNaN(appId)) {
17
+ throw new Error(`Invalid STEAM_APP_ID environment variable: ${envAppId}`);
18
+ }
19
+ return appId;
20
+ }
21
+ return DEFAULT_STEAM_APP_ID;
22
+ }
23
+ /**
24
+ * Get Steam configuration
25
+ * @returns Steam configuration
26
+ */
27
+ export function getSteamConfig() {
28
+ return {
29
+ appId: getSteamAppId(),
30
+ };
31
+ }
32
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/formats/steam/config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,oBAAoB,GAAG,OAAO,CAAC;AAErC;;;GAGG;AACH,MAAM,UAAU,aAAa;IAC3B,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC;IAC1C,IAAI,QAAQ,EAAE,CAAC;QACb,MAAM,KAAK,GAAG,QAAQ,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;QACrC,IAAI,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,8CAA8C,QAAQ,EAAE,CAAC,CAAC;QAC5E,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,oBAAoB,CAAC;AAC9B,CAAC;AASD;;;GAGG;AACH,MAAM,UAAU,cAAc;IAC5B,OAAO;QACL,KAAK,EAAE,aAAa,EAAE;KACvB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Localized description
3
+ */
4
+ export interface LocalizedDescription {
5
+ language: string;
6
+ content: string;
7
+ }
8
+ /**
9
+ * Localized title
10
+ */
11
+ export interface LocalizedTitle {
12
+ language: string;
13
+ title: string;
14
+ }
15
+ /**
16
+ * Map filename to Steam language code
17
+ * @param filename - The filename without extension (e.g., "zh", "en", "japanese")
18
+ * @returns Steam language code or null if not found
19
+ */
20
+ export declare function mapFilenameToLanguage(filename: string): string | null;
21
+ /**
22
+ * Load descriptions from description/*.md files
23
+ * @param directory - Path to the mod directory
24
+ * @returns Array of localized descriptions
25
+ */
26
+ export declare function loadDescriptions(directory: string): Promise<LocalizedDescription[]>;
27
+ /**
28
+ * Load titles from description/*.md files
29
+ * @param directory - Path to the mod directory
30
+ * @param defaultTitle - The default title to use if no title is found in a file
31
+ * @returns Array of localized titles
32
+ */
33
+ export declare function loadTitles(directory: string, defaultTitle: string): Promise<LocalizedTitle[]>;
34
+ /**
35
+ * Get the primary language description and title
36
+ * Priority: english -> schinese -> first available
37
+ * @param descriptions - Array of localized descriptions
38
+ * @param titles - Array of localized titles
39
+ * @returns Primary description and title
40
+ */
41
+ export declare function getPrimaryLanguageContent(descriptions: LocalizedDescription[], titles: LocalizedTitle[]): {
42
+ description?: LocalizedDescription;
43
+ title?: LocalizedTitle;
44
+ };
45
+ //# sourceMappingURL=metadata.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../../src/formats/steam/metadata.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf;AAiID;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGrE;AAgGD;;;;GAIG;AACH,wBAAsB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAyCzF;AAED;;;;;GAKG;AACH,wBAAsB,UAAU,CAC9B,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,cAAc,EAAE,CAAC,CAyC3B;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CACvC,YAAY,EAAE,oBAAoB,EAAE,EACpC,MAAM,EAAE,cAAc,EAAE,GACvB;IAAE,WAAW,CAAC,EAAE,oBAAoB,CAAC;IAAC,KAAK,CAAC,EAAE,cAAc,CAAA;CAAE,CAoBhE"}