@ducky7go/ducky-cli 0.0.1

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 (72) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +241 -0
  3. package/bin/ducky +25 -0
  4. package/dist/cli.d.ts +5 -0
  5. package/dist/cli.d.ts.map +1 -0
  6. package/dist/cli.js +19 -0
  7. package/dist/cli.js.map +1 -0
  8. package/dist/commands/nuget/index.d.ts +3 -0
  9. package/dist/commands/nuget/index.d.ts.map +1 -0
  10. package/dist/commands/nuget/index.js +23 -0
  11. package/dist/commands/nuget/index.js.map +1 -0
  12. package/dist/commands/nuget/pack.d.ts +7 -0
  13. package/dist/commands/nuget/pack.d.ts.map +1 -0
  14. package/dist/commands/nuget/pack.js +78 -0
  15. package/dist/commands/nuget/pack.js.map +1 -0
  16. package/dist/commands/nuget/push.d.ts +7 -0
  17. package/dist/commands/nuget/push.d.ts.map +1 -0
  18. package/dist/commands/nuget/push.js +110 -0
  19. package/dist/commands/nuget/push.js.map +1 -0
  20. package/dist/commands/nuget/validate.d.ts +7 -0
  21. package/dist/commands/nuget/validate.d.ts.map +1 -0
  22. package/dist/commands/nuget/validate.js +78 -0
  23. package/dist/commands/nuget/validate.js.map +1 -0
  24. package/dist/formats/index.d.ts +2 -0
  25. package/dist/formats/index.d.ts.map +1 -0
  26. package/dist/formats/index.js +6 -0
  27. package/dist/formats/index.js.map +1 -0
  28. package/dist/formats/nuget/client.d.ts +59 -0
  29. package/dist/formats/nuget/client.d.ts.map +1 -0
  30. package/dist/formats/nuget/client.js +202 -0
  31. package/dist/formats/nuget/client.js.map +1 -0
  32. package/dist/formats/nuget/collector.d.ts +36 -0
  33. package/dist/formats/nuget/collector.d.ts.map +1 -0
  34. package/dist/formats/nuget/collector.js +72 -0
  35. package/dist/formats/nuget/collector.js.map +1 -0
  36. package/dist/formats/nuget/index.d.ts +6 -0
  37. package/dist/formats/nuget/index.d.ts.map +1 -0
  38. package/dist/formats/nuget/index.js +11 -0
  39. package/dist/formats/nuget/index.js.map +1 -0
  40. package/dist/formats/nuget/nuspec.d.ts +10 -0
  41. package/dist/formats/nuget/nuspec.d.ts.map +1 -0
  42. package/dist/formats/nuget/nuspec.js +59 -0
  43. package/dist/formats/nuget/nuspec.js.map +1 -0
  44. package/dist/formats/nuget/parser.d.ts +31 -0
  45. package/dist/formats/nuget/parser.d.ts.map +1 -0
  46. package/dist/formats/nuget/parser.js +140 -0
  47. package/dist/formats/nuget/parser.js.map +1 -0
  48. package/dist/formats/nuget/validator.d.ts +19 -0
  49. package/dist/formats/nuget/validator.d.ts.map +1 -0
  50. package/dist/formats/nuget/validator.js +104 -0
  51. package/dist/formats/nuget/validator.js.map +1 -0
  52. package/dist/utils/config.d.ts +31 -0
  53. package/dist/utils/config.d.ts.map +1 -0
  54. package/dist/utils/config.js +86 -0
  55. package/dist/utils/config.js.map +1 -0
  56. package/dist/utils/errors.d.ts +43 -0
  57. package/dist/utils/errors.d.ts.map +1 -0
  58. package/dist/utils/errors.js +73 -0
  59. package/dist/utils/errors.js.map +1 -0
  60. package/dist/utils/fs.d.ts +42 -0
  61. package/dist/utils/fs.d.ts.map +1 -0
  62. package/dist/utils/fs.js +125 -0
  63. package/dist/utils/fs.js.map +1 -0
  64. package/dist/utils/index.d.ts +5 -0
  65. package/dist/utils/index.d.ts.map +1 -0
  66. package/dist/utils/index.js +5 -0
  67. package/dist/utils/index.js.map +1 -0
  68. package/dist/utils/logger.d.ts +71 -0
  69. package/dist/utils/logger.d.ts.map +1 -0
  70. package/dist/utils/logger.js +119 -0
  71. package/dist/utils/logger.js.map +1 -0
  72. package/package.json +65 -0
package/README.md ADDED
@@ -0,0 +1,241 @@
1
+ # ducky-cli
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.
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
14
+
15
+ ```bash
16
+ npm install -g ducky-cli
17
+ ```
18
+
19
+ Or use directly with npx:
20
+
21
+ ```bash
22
+ npx ducky-cli --help
23
+ ```
24
+
25
+ ## Quick Start
26
+
27
+ ### Package a Mod
28
+
29
+ ```bash
30
+ 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
+ ducky nuget push ./mods/MyMod.1.0.0.nupkg
98
+
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
104
+ ```
105
+
106
+ ### `ducky nuget validate`
107
+
108
+ Validate a mod directory against the NuGet Mod Packaging Specification.
109
+
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
160
+
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
176
+
177
+ ## Validation Rules
178
+
179
+ The tool validates mods against these rules:
180
+
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
185
+
186
+ ## Examples
187
+
188
+ ### Complete Workflow
189
+
190
+ ```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
201
+ export NUGET_API_KEY=your-api-key
202
+ ducky nuget push ./mods/MyMod.1.0.0.nupkg
203
+ ```
204
+
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
211
+ ```
212
+
213
+ ## Error Handling
214
+
215
+ The tool provides helpful error messages with suggestions:
216
+
217
+ ```
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
223
+ ```
224
+
225
+ ## Contributing
226
+
227
+ Contributions are welcome! Please read our contributing guidelines before submitting PRs.
228
+
229
+ ## License
230
+
231
+ MIT License - see LICENSE file for details
232
+
233
+ ## Related Projects
234
+
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
237
+
238
+ ## Support
239
+
240
+ - Report bugs: [GitHub Issues](https://github.com/ducky7go/ducky-cli/issues)
241
+ - Documentation: [GitHub Wiki](https://github.com/ducky7go/ducky-cli/wiki)
package/bin/ducky ADDED
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env node
2
+ import { spawn } from 'child_process';
3
+ import { fileURLToPath } from 'url';
4
+ import { dirname, join } from 'path';
5
+
6
+ const __filename = fileURLToPath(import.meta.url);
7
+ const __dirname = dirname(__filename);
8
+
9
+ // Run the CLI with tsx in development, or compiled JS in production
10
+ const isDev = process.env.NODE_ENV !== 'production';
11
+ const scriptPath = isDev
12
+ ? join(__dirname, '..', 'src', 'cli.ts')
13
+ : join(__dirname, '..', 'dist', 'cli.js');
14
+
15
+ const args = process.argv.slice(2);
16
+ const runner = isDev ? 'tsx' : 'node';
17
+
18
+ const child = spawn(runner, [scriptPath, ...args], {
19
+ stdio: 'inherit',
20
+ env: process.env,
21
+ });
22
+
23
+ child.on('exit', (code) => {
24
+ process.exit(code ?? 0);
25
+ });
package/dist/cli.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+ import { Command } from 'commander';
3
+ declare const program: Command;
4
+ export { program };
5
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +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"}
package/dist/cli.js ADDED
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env node
2
+ import { Command } from 'commander';
3
+ import { registerNuGetCommands } from './commands/nuget/index.js';
4
+ // Create the main program
5
+ const program = new Command();
6
+ program
7
+ .name('ducky')
8
+ .description('CLI tool for packaging and publishing game mods')
9
+ .version('0.1.0');
10
+ // Register format namespaces
11
+ registerNuGetCommands(program);
12
+ // Future formats can be registered here:
13
+ // registerZipCommands(program);
14
+ // registerTarCommands(program);
15
+ // Parse arguments
16
+ program.parse(process.argv);
17
+ // Export for testing
18
+ export { program };
19
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +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"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function registerNuGetCommands(program: Command): void;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/nuget/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAsB5D"}
@@ -0,0 +1,23 @@
1
+ import { Command } from 'commander';
2
+ import { nugetPackCommand } from './pack.js';
3
+ import { nugetPushCommand } from './push.js';
4
+ import { nugetValidateCommand } from './validate.js';
5
+ export function registerNuGetCommands(program) {
6
+ // Create the nuget namespace command
7
+ const nugetCommand = new Command('nuget')
8
+ .description('NuGet package format commands')
9
+ .addHelpText('beforeAll', `
10
+ NuGet commands for packaging and publishing game mods.
11
+
12
+ Examples:
13
+ $ ducky nuget pack ./mods/MyMod
14
+ $ ducky nuget push ./mods/MyMod.nupkg
15
+ $ ducky nuget validate ./mods/MyMod
16
+ `);
17
+ // Register subcommands (T19: Create command registry)
18
+ nugetCommand.addCommand(nugetPackCommand);
19
+ nugetCommand.addCommand(nugetPushCommand);
20
+ nugetCommand.addCommand(nugetValidateCommand);
21
+ program.addCommand(nugetCommand);
22
+ }
23
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/nuget/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAErD,MAAM,UAAU,qBAAqB,CAAC,OAAgB;IACpD,qCAAqC;IACrC,MAAM,YAAY,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC;SACtC,WAAW,CAAC,+BAA+B,CAAC;SAC5C,WAAW,CACV,WAAW,EACX;;;;;;;CAOL,CACI,CAAC;IAEJ,sDAAsD;IACtD,YAAY,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC;IAC1C,YAAY,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC;IAC1C,YAAY,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC;IAE9C,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;AACnC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { Command } from 'commander';
2
+ /**
3
+ * T16: Implement nuget pack command
4
+ * Creates a .nupkg package from a mod directory
5
+ */
6
+ export declare const nugetPackCommand: Command;
7
+ //# sourceMappingURL=pack.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pack.d.ts","sourceRoot":"","sources":["../../../src/commands/nuget/pack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAepC;;;GAGG;AACH,eAAO,MAAM,gBAAgB,SAuEzB,CAAC"}
@@ -0,0 +1,78 @@
1
+ import { Command } from 'commander';
2
+ import { resolve, join, basename } from 'path';
3
+ import { writeFile, mkdir } from 'fs/promises';
4
+ import { createLogger, LogLevel } from '../../utils/index.js';
5
+ import { parseInfoIni, generateNuspec, collectFilesForPackage, validateMod, } from '../../formats/nuget/index.js';
6
+ import { NuGetCliManager } from '../../formats/nuget/client.js';
7
+ import { FileSystemError, ValidationError } from '../../utils/errors.js';
8
+ const logger = createLogger();
9
+ /**
10
+ * T16: Implement nuget pack command
11
+ * Creates a .nupkg package from a mod directory
12
+ */
13
+ export const nugetPackCommand = new Command('pack')
14
+ .description('Package a mod into a .nupkg file')
15
+ .argument('<path>', 'Path to mod directory')
16
+ .option('-o, --output <path>', 'Output directory for .nupkg file')
17
+ .option('-v, --verbose', 'Enable verbose output')
18
+ .action(async (path, options) => {
19
+ try {
20
+ // Configure logger
21
+ if (options.verbose) {
22
+ logger.setLevel(LogLevel.DEBUG);
23
+ }
24
+ const modPath = resolve(path);
25
+ const outputPath = options.output ? resolve(options.output) : modPath;
26
+ logger.header('NuGet Pack');
27
+ logger.info(`Mod path: ${modPath}`);
28
+ logger.info(`Output path: ${outputPath}`);
29
+ // Parse metadata
30
+ logger.info('Parsing info.ini...');
31
+ const metadata = await parseInfoIni(modPath);
32
+ logger.success(`Parsed: ${metadata.name} v${metadata.version}`);
33
+ // Validate mod
34
+ logger.info('Validating mod...');
35
+ const validation = await validateMod(modPath, metadata);
36
+ if (!validation.valid) {
37
+ logger.error('Validation failed:');
38
+ for (const error of validation.errors) {
39
+ logger.error(error);
40
+ }
41
+ throw new ValidationError('Mod validation failed');
42
+ }
43
+ logger.success('Validation passed');
44
+ // Generate .nuspec
45
+ logger.info('Generating .nuspec file...');
46
+ const nuspecContent = generateNuspec(metadata);
47
+ const nuspecPath = join(modPath, `${metadata.name}.nuspec`);
48
+ await writeFile(nuspecPath, nuspecContent, 'utf-8');
49
+ logger.success(`Generated: ${basename(nuspecPath)}`);
50
+ // Collect files
51
+ logger.info('Collecting files...');
52
+ const files = await collectFilesForPackage({
53
+ modPath,
54
+ outputPath,
55
+ recursive: true,
56
+ });
57
+ logger.success(`Found ${files.length} files`);
58
+ // Ensure output directory exists
59
+ await mkdir(outputPath, { recursive: true });
60
+ // Pack using NuGet CLI
61
+ const client = new NuGetCliManager();
62
+ const nupkgPath = await client.pack(nuspecPath, outputPath);
63
+ logger.blank();
64
+ logger.success(`Package created: ${nupkgPath}`);
65
+ }
66
+ catch (error) {
67
+ if (error instanceof FileSystemError || error instanceof ValidationError) {
68
+ logger.error(error);
69
+ process.exit(1);
70
+ }
71
+ else if (error instanceof Error) {
72
+ logger.error(error.message);
73
+ process.exit(1);
74
+ }
75
+ throw error;
76
+ }
77
+ });
78
+ //# sourceMappingURL=pack.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pack.js","sourceRoot":"","sources":["../../../src/commands/nuget/pack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,Y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AE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAE7C,uBAAuB;QACvB,MAAM,MAAM,GAAG,IAAI,eAAe,EAAE,CAAC;QACrC,MAAM,SAAS,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;QAE5D,MAAM,CAAC,KAAK,EAAE,CAAC;QACf,MAAM,CAAC,OAAO,CAAC,oBAAoB,SAAS,EAAE,CAAC,CAAC;IAClD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,eAAe,IAAI,KAAK,YAAY,eAAe,EAAE,CAAC;YACzE,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACpB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;aAAM,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;YAClC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YAC5B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { Command } from 'commander';
2
+ /**
3
+ * T17: Implement nuget push command
4
+ * Publishes a .nupkg file to a NuGet server
5
+ */
6
+ export declare const nugetPushCommand: Command;
7
+ //# sourceMappingURL=push.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"push.d.ts","sourceRoot":"","sources":["../../../src/commands/nuget/push.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAUpC;;;GAGG;AACH,eAAO,MAAM,gBAAgB,SAgHzB,CAAC"}
@@ -0,0 +1,110 @@
1
+ import { Command } from 'commander';
2
+ import { resolve } from 'path';
3
+ import { fileExists } from '../../utils/fs.js';
4
+ import { createLogger, resolveConfig, getApiKey, getServerUrl, LogLevel } from '../../utils/index.js';
5
+ import { parseInfoIni, validateMod } from '../../formats/nuget/index.js';
6
+ import { NuGetCliManager } from '../../formats/nuget/client.js';
7
+ import { FileSystemError, ValidationError, ConfigError } from '../../utils/errors.js';
8
+ const logger = createLogger();
9
+ /**
10
+ * T17: Implement nuget push command
11
+ * Publishes a .nupkg file to a NuGet server
12
+ */
13
+ export const nugetPushCommand = new Command('push')
14
+ .description('Publish a .nupkg file to a NuGet server')
15
+ .argument('<path>', 'Path to .nupkg file or mod directory (with --pack)')
16
+ .option('-p, --pack', 'Package the mod before pushing')
17
+ .option('-s, --server <url>', 'NuGet server URL')
18
+ .option('-k, --api-key <key>', 'NuGet API key')
19
+ .option('-o, --output <path>', 'Output directory for .nupkg file (when using --pack)')
20
+ .option('-v, --verbose', 'Enable verbose output')
21
+ .action(async (path, options) => {
22
+ try {
23
+ // Configure logger
24
+ if (options.verbose) {
25
+ logger.setLevel(LogLevel.DEBUG);
26
+ }
27
+ let nupkgPath;
28
+ // If --pack flag is used, first pack the mod
29
+ if (options.pack) {
30
+ logger.header('NuGet Push (with Pack)');
31
+ const modPath = resolve(path);
32
+ const outputPath = options.output ? resolve(options.output) : modPath;
33
+ logger.info(`Mod path: ${modPath}`);
34
+ logger.info(`Output path: ${outputPath}`);
35
+ // Parse metadata
36
+ logger.info('Parsing info.ini...');
37
+ const metadata = await parseInfoIni(modPath);
38
+ logger.success(`Parsed: ${metadata.name} v${metadata.version}`);
39
+ // Validate mod
40
+ logger.info('Validating mod...');
41
+ const validation = await validateMod(modPath, metadata);
42
+ if (!validation.valid) {
43
+ logger.error('Validation failed:');
44
+ for (const error of validation.errors) {
45
+ logger.error(error);
46
+ }
47
+ throw new ValidationError('Mod validation failed');
48
+ }
49
+ logger.success('Validation passed');
50
+ // Generate .nuspec
51
+ logger.info('Generating .nuspec file...');
52
+ const { generateNuspec } = await import('../../formats/nuget/nuspec.js');
53
+ const nuspecContent = generateNuspec(metadata);
54
+ const { writeFile } = await import('fs/promises');
55
+ const { join } = await import('path');
56
+ const nuspecPath = join(modPath, `${metadata.name}.nuspec`);
57
+ await writeFile(nuspecPath, nuspecContent, 'utf-8');
58
+ logger.success('Generated .nuspec file');
59
+ // Pack using NuGet CLI
60
+ const { mkdir } = await import('fs/promises');
61
+ await mkdir(outputPath, { recursive: true });
62
+ const client = new NuGetCliManager();
63
+ nupkgPath = await client.pack(nuspecPath, outputPath);
64
+ logger.success(`Package created: ${nupkgPath}`);
65
+ }
66
+ else {
67
+ // Verify .nupkg file exists
68
+ nupkgPath = resolve(path);
69
+ if (!(await fileExists(nupkgPath))) {
70
+ throw new FileSystemError(`.nupkg file not found: ${nupkgPath}`, [
71
+ 'Check that the path is correct',
72
+ 'Use --pack flag to package a mod directory before pushing',
73
+ ]);
74
+ }
75
+ logger.header('NuGet Push');
76
+ logger.info(`Package path: ${nupkgPath}`);
77
+ }
78
+ // Load configuration
79
+ const config = resolveConfig({
80
+ server: options.server,
81
+ apiKey: options.apiKey,
82
+ verbose: options.verbose,
83
+ });
84
+ const server = getServerUrl(config);
85
+ const apiKey = getApiKey(config);
86
+ logger.info(`Server: ${server}`);
87
+ logger.info(`API Key: ${apiKey ? '***' + apiKey.slice(-4) : '(none)'}`);
88
+ // Push using NuGet CLI
89
+ logger.blank();
90
+ logger.info('Pushing package...');
91
+ const client = new NuGetCliManager();
92
+ await client.push(nupkgPath, server, apiKey);
93
+ logger.blank();
94
+ logger.success('Package pushed successfully!');
95
+ }
96
+ catch (error) {
97
+ if (error instanceof FileSystemError ||
98
+ error instanceof ValidationError ||
99
+ error instanceof ConfigError) {
100
+ logger.error(error);
101
+ process.exit(1);
102
+ }
103
+ else if (error instanceof Error) {
104
+ logger.error(error.message);
105
+ process.exit(1);
106
+ }
107
+ throw error;
108
+ }
109
+ });
110
+ //# sourceMappingURL=push.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"push.js","sourceRoot":"","sources":["../../../src/commands/nuget/push.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,W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AAY,CAAC,MAAM,CAAC,CAAC;QACpC,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;QAEjC,MAAM,CAAC,IAAI,CAAC,WAAW,MAAM,EAAE,CAAC,CAAC;QACjC,MAAM,CAAC,IAAI,CAAC,YAAY,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;QAExE,uBAAuB;QACvB,MAAM,CAAC,KAAK,EAAE,CAAC;QACf,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;QAElC,MAAM,MAAM,GAAG,IAAI,eAAe,EAAE,CAAC;QACrC,MAAM,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QAE7C,MAAM,CAAC,KAAK,EAAE,CAAC;QACf,MAAM,CAAC,OAAO,CAAC,8BAA8B,CAAC,CAAC;IACjD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IACE,KAAK,YAAY,eAAe;YAChC,KAAK,YAAY,eAAe;YAChC,KAAK,YAAY,WAAW,EAC5B,CAAC;YACD,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACpB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;aAAM,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;YAClC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YAC5B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { Command } from 'commander';
2
+ /**
3
+ * T18: Implement nuget validate command
4
+ * Validates a mod directory against the NuGet Mod Packaging Specification
5
+ */
6
+ export declare const nugetValidateCommand: Command;
7
+ //# sourceMappingURL=validate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../../src/commands/nuget/validate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQpC;;;GAGG;AACH,eAAO,MAAM,oBAAoB,SA2E7B,CAAC"}
@@ -0,0 +1,78 @@
1
+ import { Command } from 'commander';
2
+ import { resolve } from 'path';
3
+ import { createLogger, LogLevel } from '../../utils/index.js';
4
+ import { parseInfoIni, validateMod } from '../../formats/nuget/index.js';
5
+ import { FileSystemError } from '../../utils/errors.js';
6
+ const logger = createLogger();
7
+ /**
8
+ * T18: Implement nuget validate command
9
+ * Validates a mod directory against the NuGet Mod Packaging Specification
10
+ */
11
+ export const nugetValidateCommand = new Command('validate')
12
+ .description('Validate a mod directory')
13
+ .argument('<path>', 'Path to mod directory')
14
+ .option('-v, --verbose', 'Enable verbose output')
15
+ .action(async (path, options) => {
16
+ try {
17
+ // Configure logger
18
+ if (options.verbose) {
19
+ logger.setLevel(LogLevel.DEBUG);
20
+ }
21
+ const modPath = resolve(path);
22
+ logger.header('NuGet Validate');
23
+ logger.info(`Mod path: ${modPath}`);
24
+ // Parse metadata
25
+ logger.info('Parsing info.ini...');
26
+ const metadata = await parseInfoIni(modPath);
27
+ logger.success(`Parsed: ${metadata.name} v${metadata.version}`);
28
+ // Display metadata
29
+ logger.blank();
30
+ logger.info('Metadata:');
31
+ if (metadata.description) {
32
+ logger.info(` Description: ${metadata.description}`);
33
+ }
34
+ if (metadata.author) {
35
+ logger.info(` Author: ${metadata.author}`);
36
+ }
37
+ if (metadata.projectUrl) {
38
+ logger.info(` Project URL: ${metadata.projectUrl}`);
39
+ }
40
+ if (metadata.tags && metadata.tags.length > 0) {
41
+ logger.info(` Tags: ${metadata.tags.join(', ')}`);
42
+ }
43
+ // Validate mod
44
+ logger.blank();
45
+ logger.info('Running validation checks...');
46
+ const validation = await validateMod(modPath, metadata);
47
+ // Display results
48
+ logger.blank();
49
+ if (validation.valid) {
50
+ logger.success('✓ All validation checks passed!');
51
+ logger.blank();
52
+ logger.info('Your mod is ready to be packaged.');
53
+ }
54
+ else {
55
+ logger.error('Validation failed:');
56
+ logger.blank();
57
+ for (const error of validation.errors) {
58
+ logger.error(error);
59
+ logger.blank();
60
+ }
61
+ if (validation.warnings.length > 0) {
62
+ logger.warn('Warnings:');
63
+ for (const warning of validation.warnings) {
64
+ logger.warn(` • ${warning}`);
65
+ }
66
+ }
67
+ process.exit(1);
68
+ }
69
+ }
70
+ catch (error) {
71
+ if (error instanceof FileSystemError || error instanceof Error) {
72
+ logger.error(error);
73
+ process.exit(1);
74
+ }
75
+ throw error;
76
+ }
77
+ });
78
+ //# sourceMappingURL=validate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate.js","sourceRoot":"","sources":["../../../src/commands/nuget/validate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,MAAM,MAAM,GAAG,YAAY,EAAE,CAAC;AAE9B;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,OAAO,CAAC,UAAU,CAAC;KACxD,WAAW,CAAC,0BAA0B,CAAC;KACvC,QAAQ,CAAC,QAAQ,EAAE,uBAAuB,CAAC;KAC3C,MAAM,CAAC,eAAe,EAAE,uBAAuB,CAAC;KAChD,MAAM,CAAC,KAAK,EAAE,IAAY,EAAE,OAAO,EAAE,EAAE;IACtC,IAAI,CAAC;QACH,mBAAmB;QACnB,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;YACpB,MAA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