configforge 1.0.0-beta.10 → 1.0.0-beta.11
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 +56 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/dist/scripts/CLIGenerator.d.ts +109 -0
- package/dist/scripts/CLIGenerator.d.ts.map +1 -0
- package/dist/scripts/CLIGenerator.js +440 -0
- package/dist/scripts/CLIGenerator.js.map +1 -0
- package/dist/scripts/CLIUtils.d.ts +136 -0
- package/dist/scripts/CLIUtils.d.ts.map +1 -0
- package/dist/scripts/CLIUtils.js +361 -0
- package/dist/scripts/CLIUtils.js.map +1 -0
- package/dist/scripts/CommandBuilder.d.ts +72 -0
- package/dist/scripts/CommandBuilder.d.ts.map +1 -0
- package/dist/scripts/CommandBuilder.js +280 -0
- package/dist/scripts/CommandBuilder.js.map +1 -0
- package/dist/scripts/index.d.ts +23 -0
- package/dist/scripts/index.d.ts.map +1 -0
- package/dist/scripts/index.js +43 -0
- package/dist/scripts/index.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,440 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.CLIGenerator = void 0;
|
|
7
|
+
const commander_1 = require("commander");
|
|
8
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
9
|
+
const ora_1 = __importDefault(require("ora"));
|
|
10
|
+
const fs_1 = require("fs");
|
|
11
|
+
const path_1 = require("path");
|
|
12
|
+
const Forge_1 = require("../core/Forge");
|
|
13
|
+
/**
|
|
14
|
+
* CLI Generator for creating command-line interfaces for ConfigForge converters
|
|
15
|
+
*/
|
|
16
|
+
class CLIGenerator {
|
|
17
|
+
constructor(options = {}) {
|
|
18
|
+
this.profiles = new Map();
|
|
19
|
+
this.options = {
|
|
20
|
+
name: 'configforge',
|
|
21
|
+
version: '1.0.0',
|
|
22
|
+
description: 'Universal config converter with fluent API',
|
|
23
|
+
commands: [],
|
|
24
|
+
globalOptions: [],
|
|
25
|
+
...options,
|
|
26
|
+
};
|
|
27
|
+
this.program = new commander_1.Command();
|
|
28
|
+
this.profilesPath = (0, path_1.join)(process.cwd(), '.configforge-profiles.json');
|
|
29
|
+
this.loadProfiles();
|
|
30
|
+
this.setupProgram();
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Set up the main program configuration
|
|
34
|
+
*/
|
|
35
|
+
setupProgram() {
|
|
36
|
+
this.program
|
|
37
|
+
.name(this.options.name)
|
|
38
|
+
.version(this.options.version)
|
|
39
|
+
.description(this.options.description);
|
|
40
|
+
// Add global options
|
|
41
|
+
this.options.globalOptions?.forEach(option => {
|
|
42
|
+
this.program.option(option.flags, option.description, option.defaultValue);
|
|
43
|
+
});
|
|
44
|
+
// Add built-in commands
|
|
45
|
+
this.addBuiltInCommands();
|
|
46
|
+
// Add custom commands
|
|
47
|
+
this.options.commands?.forEach(command => {
|
|
48
|
+
this.addCommand(command);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Add built-in commands for common operations
|
|
53
|
+
*/
|
|
54
|
+
addBuiltInCommands() {
|
|
55
|
+
// Convert command
|
|
56
|
+
this.program
|
|
57
|
+
.command('convert')
|
|
58
|
+
.description('Convert configuration files using a converter profile or inline mappings')
|
|
59
|
+
.argument('<input>', 'Input file path')
|
|
60
|
+
.argument('[output]', 'Output file path (optional)')
|
|
61
|
+
.option('-p, --profile <name>', 'Use a saved converter profile')
|
|
62
|
+
.option('-f, --format <format>', 'Output format (json, yaml, yml)')
|
|
63
|
+
.option('--dry-run', 'Show what would be converted without writing output')
|
|
64
|
+
.option('--verbose', 'Show detailed conversion information')
|
|
65
|
+
.action(async (input, output, options) => {
|
|
66
|
+
await this.handleConvertCommand(input, output, options);
|
|
67
|
+
});
|
|
68
|
+
// Validate command
|
|
69
|
+
this.program
|
|
70
|
+
.command('validate')
|
|
71
|
+
.description('Validate configuration files against a converter profile')
|
|
72
|
+
.argument('<input>', 'Input file path')
|
|
73
|
+
.option('-p, --profile <name>', 'Use a saved converter profile for validation')
|
|
74
|
+
.option('--verbose', 'Show detailed validation information')
|
|
75
|
+
.action(async (input, options) => {
|
|
76
|
+
await this.handleValidateCommand(input, options);
|
|
77
|
+
});
|
|
78
|
+
// Profile management commands
|
|
79
|
+
const profileCmd = this.program
|
|
80
|
+
.command('profile')
|
|
81
|
+
.description('Manage converter profiles');
|
|
82
|
+
profileCmd
|
|
83
|
+
.command('list')
|
|
84
|
+
.description('List all saved converter profiles')
|
|
85
|
+
.action(() => {
|
|
86
|
+
this.handleProfileListCommand();
|
|
87
|
+
});
|
|
88
|
+
profileCmd
|
|
89
|
+
.command('save')
|
|
90
|
+
.description('Save a converter configuration as a profile')
|
|
91
|
+
.argument('<name>', 'Profile name')
|
|
92
|
+
.option('-d, --description <desc>', 'Profile description')
|
|
93
|
+
.option('-c, --config <path>', 'Path to converter configuration file')
|
|
94
|
+
.action(async (name, options) => {
|
|
95
|
+
await this.handleProfileSaveCommand(name, options);
|
|
96
|
+
});
|
|
97
|
+
profileCmd
|
|
98
|
+
.command('delete')
|
|
99
|
+
.description('Delete a converter profile')
|
|
100
|
+
.argument('<name>', 'Profile name')
|
|
101
|
+
.action(name => {
|
|
102
|
+
this.handleProfileDeleteCommand(name);
|
|
103
|
+
});
|
|
104
|
+
profileCmd
|
|
105
|
+
.command('show')
|
|
106
|
+
.description('Show details of a converter profile')
|
|
107
|
+
.argument('<name>', 'Profile name')
|
|
108
|
+
.action(name => {
|
|
109
|
+
this.handleProfileShowCommand(name);
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Add a custom command to the CLI
|
|
114
|
+
*/
|
|
115
|
+
addCommand(command) {
|
|
116
|
+
// Validate command name
|
|
117
|
+
if (!command.name ||
|
|
118
|
+
typeof command.name !== 'string' ||
|
|
119
|
+
command.name.trim() === '') {
|
|
120
|
+
console.warn('Invalid command name provided, skipping command');
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
const cmd = this.program
|
|
124
|
+
.command(command.name)
|
|
125
|
+
.description(command.description);
|
|
126
|
+
// Add command-specific options
|
|
127
|
+
command.options?.forEach(option => {
|
|
128
|
+
cmd.option(option.flags, option.description, option.defaultValue);
|
|
129
|
+
});
|
|
130
|
+
cmd.action(command.action);
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Handle the convert command
|
|
134
|
+
*/
|
|
135
|
+
async handleConvertCommand(input, output, options) {
|
|
136
|
+
const spinner = (0, ora_1.default)('Starting conversion...').start();
|
|
137
|
+
try {
|
|
138
|
+
// Check if input file exists
|
|
139
|
+
if (!(0, fs_1.existsSync)(input)) {
|
|
140
|
+
spinner.fail(chalk_1.default.red(`Input file not found: ${input}`));
|
|
141
|
+
process.exit(1);
|
|
142
|
+
}
|
|
143
|
+
let converter;
|
|
144
|
+
// Load converter from profile or create a basic one
|
|
145
|
+
if (options.profile) {
|
|
146
|
+
const profile = this.profiles.get(options.profile);
|
|
147
|
+
if (!profile) {
|
|
148
|
+
spinner.fail(chalk_1.default.red(`Profile not found: ${options.profile}`));
|
|
149
|
+
process.exit(1);
|
|
150
|
+
}
|
|
151
|
+
converter = this.deserializeConverter(profile.converter);
|
|
152
|
+
spinner.text = `Using profile: ${options.profile}`;
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
// Create a basic pass-through converter
|
|
156
|
+
converter = (0, Forge_1.forge)().from('source').to('target');
|
|
157
|
+
spinner.text = 'Using basic pass-through converter';
|
|
158
|
+
}
|
|
159
|
+
// Perform conversion
|
|
160
|
+
spinner.text = 'Converting...';
|
|
161
|
+
const result = await converter.convert(input);
|
|
162
|
+
// Handle dry run
|
|
163
|
+
if (options.dryRun) {
|
|
164
|
+
spinner.succeed(chalk_1.default.green('Dry run completed'));
|
|
165
|
+
console.log(chalk_1.default.cyan('\n📋 Conversion Preview:'));
|
|
166
|
+
result.print();
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
// Determine output path and format
|
|
170
|
+
let outputPath = output;
|
|
171
|
+
let outputFormat = options.format;
|
|
172
|
+
if (!outputPath) {
|
|
173
|
+
const inputExt = (0, path_1.extname)(input);
|
|
174
|
+
const inputBase = (0, path_1.basename)(input, inputExt);
|
|
175
|
+
outputFormat = outputFormat || 'json';
|
|
176
|
+
outputPath = (0, path_1.join)(process.cwd(), `${inputBase}.converted.${outputFormat}`);
|
|
177
|
+
}
|
|
178
|
+
else if (!outputFormat) {
|
|
179
|
+
outputFormat = (0, path_1.extname)(outputPath).slice(1) || 'json';
|
|
180
|
+
}
|
|
181
|
+
// Save result
|
|
182
|
+
spinner.text = 'Saving result...';
|
|
183
|
+
await result.save(outputPath);
|
|
184
|
+
spinner.succeed(chalk_1.default.green(`✅ Conversion completed: ${outputPath}`));
|
|
185
|
+
// Show verbose information
|
|
186
|
+
if (options.verbose) {
|
|
187
|
+
console.log(chalk_1.default.cyan('\n📊 Conversion Statistics:'));
|
|
188
|
+
console.log(chalk_1.default.gray(`Fields processed: ${result.stats.fieldsProcessed}`));
|
|
189
|
+
console.log(chalk_1.default.gray(`Fields mapped: ${result.stats.fieldsMapped}`));
|
|
190
|
+
console.log(chalk_1.default.gray(`Duration: ${result.stats.duration}ms`));
|
|
191
|
+
if (result.errors.length > 0) {
|
|
192
|
+
console.log(chalk_1.default.yellow(`\n⚠️ Errors: ${result.errors.length}`));
|
|
193
|
+
result.errors.forEach(error => {
|
|
194
|
+
console.log(chalk_1.default.red(` • ${error.message}`));
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
if (result.warnings.length > 0) {
|
|
198
|
+
console.log(chalk_1.default.yellow(`\n⚠️ Warnings: ${result.warnings.length}`));
|
|
199
|
+
result.warnings.forEach(warning => {
|
|
200
|
+
console.log(chalk_1.default.yellow(` • ${warning.message}`));
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
catch (error) {
|
|
206
|
+
spinner.fail(chalk_1.default.red('Conversion failed'));
|
|
207
|
+
console.error(chalk_1.default.red(error instanceof Error ? error.message : String(error)));
|
|
208
|
+
process.exit(1);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Handle the validate command
|
|
213
|
+
*/
|
|
214
|
+
async handleValidateCommand(input, options) {
|
|
215
|
+
const spinner = (0, ora_1.default)('Starting validation...').start();
|
|
216
|
+
try {
|
|
217
|
+
// Check if input file exists
|
|
218
|
+
if (!(0, fs_1.existsSync)(input)) {
|
|
219
|
+
spinner.fail(chalk_1.default.red(`Input file not found: ${input}`));
|
|
220
|
+
process.exit(1);
|
|
221
|
+
}
|
|
222
|
+
let converter;
|
|
223
|
+
// Load converter from profile
|
|
224
|
+
if (options.profile) {
|
|
225
|
+
const profile = this.profiles.get(options.profile);
|
|
226
|
+
if (!profile) {
|
|
227
|
+
spinner.fail(chalk_1.default.red(`Profile not found: ${options.profile}`));
|
|
228
|
+
process.exit(1);
|
|
229
|
+
}
|
|
230
|
+
converter = this.deserializeConverter(profile.converter);
|
|
231
|
+
spinner.text = `Validating with profile: ${options.profile}`;
|
|
232
|
+
}
|
|
233
|
+
else {
|
|
234
|
+
spinner.fail(chalk_1.default.red('Profile is required for validation'));
|
|
235
|
+
process.exit(1);
|
|
236
|
+
}
|
|
237
|
+
// Perform validation (conversion without output)
|
|
238
|
+
spinner.text = 'Validating...';
|
|
239
|
+
const result = await converter.convert(input);
|
|
240
|
+
if (result.errors.length === 0) {
|
|
241
|
+
spinner.succeed(chalk_1.default.green('✅ Validation passed'));
|
|
242
|
+
}
|
|
243
|
+
else {
|
|
244
|
+
spinner.fail(chalk_1.default.red(`❌ Validation failed with ${result.errors.length} errors`));
|
|
245
|
+
}
|
|
246
|
+
// Show detailed information
|
|
247
|
+
if (options.verbose || result.errors.length > 0) {
|
|
248
|
+
console.log(chalk_1.default.cyan('\n📊 Validation Results:'));
|
|
249
|
+
console.log(chalk_1.default.gray(`Fields processed: ${result.stats.fieldsProcessed}`));
|
|
250
|
+
console.log(chalk_1.default.gray(`Fields mapped: ${result.stats.fieldsMapped}`));
|
|
251
|
+
if (result.errors.length > 0) {
|
|
252
|
+
console.log(chalk_1.default.red(`\n❌ Errors (${result.errors.length}):`));
|
|
253
|
+
result.errors.forEach((error, index) => {
|
|
254
|
+
console.log(chalk_1.default.red(` ${index + 1}. ${error.message}`));
|
|
255
|
+
if (error.path) {
|
|
256
|
+
console.log(chalk_1.default.gray(` Path: ${error.path}`));
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
if (result.warnings.length > 0) {
|
|
261
|
+
console.log(chalk_1.default.yellow(`\n⚠️ Warnings (${result.warnings.length}):`));
|
|
262
|
+
result.warnings.forEach((warning, index) => {
|
|
263
|
+
console.log(chalk_1.default.yellow(` ${index + 1}. ${warning.message}`));
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
if (result.errors.length > 0) {
|
|
268
|
+
process.exit(1);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
catch (error) {
|
|
272
|
+
spinner.fail(chalk_1.default.red('Validation failed'));
|
|
273
|
+
console.error(chalk_1.default.red(error instanceof Error ? error.message : String(error)));
|
|
274
|
+
process.exit(1);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Handle profile list command
|
|
279
|
+
*/
|
|
280
|
+
handleProfileListCommand() {
|
|
281
|
+
if (this.profiles.size === 0) {
|
|
282
|
+
console.log(chalk_1.default.yellow('No profiles found.'));
|
|
283
|
+
return;
|
|
284
|
+
}
|
|
285
|
+
console.log(chalk_1.default.cyan('\n📋 Saved Profiles:'));
|
|
286
|
+
this.profiles.forEach((profile, name) => {
|
|
287
|
+
console.log(chalk_1.default.white(`\n• ${chalk_1.default.bold(name)}`));
|
|
288
|
+
if (profile.description) {
|
|
289
|
+
console.log(chalk_1.default.gray(` Description: ${profile.description}`));
|
|
290
|
+
}
|
|
291
|
+
console.log(chalk_1.default.gray(` Created: ${new Date(profile.createdAt).toLocaleDateString()}`));
|
|
292
|
+
console.log(chalk_1.default.gray(` Updated: ${new Date(profile.updatedAt).toLocaleDateString()}`));
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Handle profile save command
|
|
297
|
+
*/
|
|
298
|
+
async handleProfileSaveCommand(name, options) {
|
|
299
|
+
const spinner = (0, ora_1.default)(`Saving profile: ${name}`).start();
|
|
300
|
+
try {
|
|
301
|
+
// For now, create a basic converter configuration
|
|
302
|
+
// In a real implementation, this would load from a config file
|
|
303
|
+
const converterConfig = {
|
|
304
|
+
from: 'source',
|
|
305
|
+
to: 'target',
|
|
306
|
+
mappings: [],
|
|
307
|
+
transforms: [],
|
|
308
|
+
validators: [],
|
|
309
|
+
defaults: {},
|
|
310
|
+
};
|
|
311
|
+
const profile = {
|
|
312
|
+
name,
|
|
313
|
+
description: options.description,
|
|
314
|
+
converter: converterConfig,
|
|
315
|
+
createdAt: new Date().toISOString(),
|
|
316
|
+
updatedAt: new Date().toISOString(),
|
|
317
|
+
};
|
|
318
|
+
this.profiles.set(name, profile);
|
|
319
|
+
this.saveProfiles();
|
|
320
|
+
spinner.succeed(chalk_1.default.green(`✅ Profile saved: ${name}`));
|
|
321
|
+
}
|
|
322
|
+
catch (error) {
|
|
323
|
+
spinner.fail(chalk_1.default.red('Failed to save profile'));
|
|
324
|
+
console.error(chalk_1.default.red(error instanceof Error ? error.message : String(error)));
|
|
325
|
+
process.exit(1);
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* Handle profile delete command
|
|
330
|
+
*/
|
|
331
|
+
handleProfileDeleteCommand(name) {
|
|
332
|
+
if (!this.profiles.has(name)) {
|
|
333
|
+
console.log(chalk_1.default.red(`Profile not found: ${name}`));
|
|
334
|
+
process.exit(1);
|
|
335
|
+
}
|
|
336
|
+
this.profiles.delete(name);
|
|
337
|
+
this.saveProfiles();
|
|
338
|
+
console.log(chalk_1.default.green(`✅ Profile deleted: ${name}`));
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* Handle profile show command
|
|
342
|
+
*/
|
|
343
|
+
handleProfileShowCommand(name) {
|
|
344
|
+
const profile = this.profiles.get(name);
|
|
345
|
+
if (!profile) {
|
|
346
|
+
console.log(chalk_1.default.red(`Profile not found: ${name}`));
|
|
347
|
+
process.exit(1);
|
|
348
|
+
}
|
|
349
|
+
console.log(chalk_1.default.cyan(`\n📋 Profile: ${chalk_1.default.bold(name)}`));
|
|
350
|
+
if (profile.description) {
|
|
351
|
+
console.log(chalk_1.default.gray(`Description: ${profile.description}`));
|
|
352
|
+
}
|
|
353
|
+
console.log(chalk_1.default.gray(`Created: ${new Date(profile.createdAt).toLocaleString()}`));
|
|
354
|
+
console.log(chalk_1.default.gray(`Updated: ${new Date(profile.updatedAt).toLocaleString()}`));
|
|
355
|
+
console.log(chalk_1.default.cyan('\n🔧 Configuration:'));
|
|
356
|
+
console.log(JSON.stringify(profile.converter, null, 2));
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* Load profiles from disk
|
|
360
|
+
*/
|
|
361
|
+
loadProfiles() {
|
|
362
|
+
try {
|
|
363
|
+
if ((0, fs_1.existsSync)(this.profilesPath)) {
|
|
364
|
+
const data = (0, fs_1.readFileSync)(this.profilesPath, 'utf-8');
|
|
365
|
+
const profiles = JSON.parse(data);
|
|
366
|
+
this.profiles = new Map(Object.entries(profiles));
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
catch (error) {
|
|
370
|
+
// Ignore errors, start with empty profiles
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
/**
|
|
374
|
+
* Save profiles to disk
|
|
375
|
+
*/
|
|
376
|
+
saveProfiles() {
|
|
377
|
+
try {
|
|
378
|
+
const data = JSON.stringify(Object.fromEntries(this.profiles), null, 2);
|
|
379
|
+
(0, fs_1.writeFileSync)(this.profilesPath, data, 'utf-8');
|
|
380
|
+
}
|
|
381
|
+
catch (error) {
|
|
382
|
+
console.error(chalk_1.default.red('Failed to save profiles'));
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* Deserialize a converter from configuration
|
|
387
|
+
*/
|
|
388
|
+
deserializeConverter(config) {
|
|
389
|
+
// For now, create a basic converter
|
|
390
|
+
// In a real implementation, this would reconstruct the full converter
|
|
391
|
+
const converter = (0, Forge_1.forge)()
|
|
392
|
+
.from(config.from || 'source')
|
|
393
|
+
.to(config.to || 'target');
|
|
394
|
+
// Apply mappings, transforms, validators, etc.
|
|
395
|
+
// This is a simplified implementation
|
|
396
|
+
return converter;
|
|
397
|
+
}
|
|
398
|
+
/**
|
|
399
|
+
* Parse command line arguments and execute
|
|
400
|
+
*/
|
|
401
|
+
async parse(argv) {
|
|
402
|
+
await this.program.parseAsync(argv);
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* Get the commander program instance
|
|
406
|
+
*/
|
|
407
|
+
getProgram() {
|
|
408
|
+
return this.program;
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* Create a CLI for a specific converter
|
|
412
|
+
*/
|
|
413
|
+
static forConverter(_converter, options = {}) {
|
|
414
|
+
const cli = new CLIGenerator({
|
|
415
|
+
name: 'converter',
|
|
416
|
+
description: 'Generated CLI for ConfigForge converter',
|
|
417
|
+
...options,
|
|
418
|
+
});
|
|
419
|
+
// Add converter-specific commands
|
|
420
|
+
cli.addCommand({
|
|
421
|
+
name: 'run',
|
|
422
|
+
description: 'Run the converter on input files',
|
|
423
|
+
options: [
|
|
424
|
+
{ flags: '-o, --output <path>', description: 'Output file path' },
|
|
425
|
+
{
|
|
426
|
+
flags: '--dry-run',
|
|
427
|
+
description: 'Show preview without writing output',
|
|
428
|
+
},
|
|
429
|
+
{ flags: '--verbose', description: 'Show detailed information' },
|
|
430
|
+
],
|
|
431
|
+
action: async (_options) => {
|
|
432
|
+
// Implementation would use the provided converter
|
|
433
|
+
console.log('Running converter...');
|
|
434
|
+
},
|
|
435
|
+
});
|
|
436
|
+
return cli;
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
exports.CLIGenerator = CLIGenerator;
|
|
440
|
+
//# sourceMappingURL=CLIGenerator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CLIGenerator.js","sourceRoot":"","sources":["../../src/scripts/CLIGenerator.ts"],"names":[],"mappings":";;;;;;AAAA,yCAAoC;AACpC,kDAA0B;AAC1B,8CAAsB;AACtB,2BAA6D;AAC7D,+BAA+C;AAE/C,yCAAsC;AA2CtC;;GAEG;AACH,MAAa,YAAY;IAMvB,YAAY,UAA+B,EAAE;QAHrC,aAAQ,GAAkC,IAAI,GAAG,EAAE,CAAC;QAI1D,IAAI,CAAC,OAAO,GAAG;YACb,IAAI,EAAE,aAAa;YACnB,OAAO,EAAE,OAAO;YAChB,WAAW,EAAE,4CAA4C;YACzD,QAAQ,EAAE,EAAE;YACZ,aAAa,EAAE,EAAE;YACjB,GAAG,OAAO;SACX,CAAC;QAEF,IAAI,CAAC,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;QAC7B,IAAI,CAAC,YAAY,GAAG,IAAA,WAAI,EAAC,OAAO,CAAC,GAAG,EAAE,EAAE,4BAA4B,CAAC,CAAC;QACtE,IAAI,CAAC,YAAY,EAAE,CAAC;QACpB,IAAI,CAAC,YAAY,EAAE,CAAC;IACtB,CAAC;IAED;;OAEG;IACK,YAAY;QAClB,IAAI,CAAC,OAAO;aACT,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAK,CAAC;aACxB,OAAO,CAAC,IAAI,CAAC,OAAO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AAE,KAAK;YACX,WAAW,EAAE,kCAAkC;YAC/C,OAAO,EAAE;gBACP,EAAE,KAAK,EAAE,qBAAqB,EAAE,WAAW,EAAE,kBAAkB,EAAE;gBACjE;oBACE,KAAK,EAAE,WAAW;oBAClB,WAAW,EAAE,qCAAqC;iBACnD;gBACD,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,2BAA2B,EAAE;aACjE;YACD,MAAM,EAAE,KAAK,EAAC,QAAQ,EAAC,EAAE;gBACvB,kDAAkD;gBAClD,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;YACtC,CAAC;SACF,CAAC,CAAC;QAEH,OAAO,GAAG,CAAC;IACb,CAAC;CACF;AAvhBD,oCAuhBC"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { Ora } from 'ora';
|
|
2
|
+
/**
|
|
3
|
+
* Progress tracking for CLI operations
|
|
4
|
+
*/
|
|
5
|
+
export interface ProgressTracker {
|
|
6
|
+
total: number;
|
|
7
|
+
current: number;
|
|
8
|
+
message: string;
|
|
9
|
+
spinner?: Ora;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* CLI output formatting options
|
|
13
|
+
*/
|
|
14
|
+
export interface OutputOptions {
|
|
15
|
+
verbose?: boolean;
|
|
16
|
+
quiet?: boolean;
|
|
17
|
+
noColor?: boolean;
|
|
18
|
+
format?: 'table' | 'json' | 'yaml' | 'plain';
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* File information for CLI operations
|
|
22
|
+
*/
|
|
23
|
+
export interface FileInfo {
|
|
24
|
+
path: string;
|
|
25
|
+
exists: boolean;
|
|
26
|
+
size?: number;
|
|
27
|
+
extension: string;
|
|
28
|
+
basename: string;
|
|
29
|
+
dirname: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Utility functions for CLI operations
|
|
33
|
+
*/
|
|
34
|
+
export declare class CLIUtils {
|
|
35
|
+
/**
|
|
36
|
+
* Create a progress tracker with spinner
|
|
37
|
+
*/
|
|
38
|
+
static createProgress(message: string, total?: number): ProgressTracker;
|
|
39
|
+
/**
|
|
40
|
+
* Update progress tracker
|
|
41
|
+
*/
|
|
42
|
+
static updateProgress(tracker: ProgressTracker, current: number, message?: string): void;
|
|
43
|
+
/**
|
|
44
|
+
* Complete progress tracker with success
|
|
45
|
+
*/
|
|
46
|
+
static completeProgress(tracker: ProgressTracker, message?: string): void;
|
|
47
|
+
/**
|
|
48
|
+
* Fail progress tracker with error
|
|
49
|
+
*/
|
|
50
|
+
static failProgress(tracker: ProgressTracker, message?: string): void;
|
|
51
|
+
/**
|
|
52
|
+
* Get file information
|
|
53
|
+
*/
|
|
54
|
+
static getFileInfo(filePath: string): FileInfo;
|
|
55
|
+
/**
|
|
56
|
+
* Validate input file
|
|
57
|
+
*/
|
|
58
|
+
static validateInputFile(filePath: string): FileInfo;
|
|
59
|
+
/**
|
|
60
|
+
* Generate output file path
|
|
61
|
+
*/
|
|
62
|
+
static generateOutputPath(inputPath: string, outputPath?: string, format?: string, suffix?: string): string;
|
|
63
|
+
/**
|
|
64
|
+
* Format file size for display
|
|
65
|
+
*/
|
|
66
|
+
static formatFileSize(bytes: number): string;
|
|
67
|
+
/**
|
|
68
|
+
* Format duration for display
|
|
69
|
+
*/
|
|
70
|
+
static formatDuration(milliseconds: number): string;
|
|
71
|
+
/**
|
|
72
|
+
* Print formatted table
|
|
73
|
+
*/
|
|
74
|
+
static printTable(headers: string[], rows: string[][], options?: OutputOptions): void;
|
|
75
|
+
/**
|
|
76
|
+
* Print success message
|
|
77
|
+
*/
|
|
78
|
+
static printSuccess(message: string, options?: OutputOptions): void;
|
|
79
|
+
/**
|
|
80
|
+
* Print error message
|
|
81
|
+
*/
|
|
82
|
+
static printError(message: string, options?: OutputOptions): void;
|
|
83
|
+
/**
|
|
84
|
+
* Print warning message
|
|
85
|
+
*/
|
|
86
|
+
static printWarning(message: string, options?: OutputOptions): void;
|
|
87
|
+
/**
|
|
88
|
+
* Print info message
|
|
89
|
+
*/
|
|
90
|
+
static printInfo(message: string, options?: OutputOptions): void;
|
|
91
|
+
/**
|
|
92
|
+
* Print verbose message
|
|
93
|
+
*/
|
|
94
|
+
static printVerbose(message: string, options?: OutputOptions): void;
|
|
95
|
+
/**
|
|
96
|
+
* Print section header
|
|
97
|
+
*/
|
|
98
|
+
static printSection(title: string, options?: OutputOptions): void;
|
|
99
|
+
/**
|
|
100
|
+
* Print conversion statistics
|
|
101
|
+
*/
|
|
102
|
+
static printStats(stats: any, options?: OutputOptions): void;
|
|
103
|
+
/**
|
|
104
|
+
* Print errors and warnings
|
|
105
|
+
*/
|
|
106
|
+
static printIssues(errors: any[], warnings: any[], options?: OutputOptions): void;
|
|
107
|
+
/**
|
|
108
|
+
* Confirm action with user
|
|
109
|
+
*/
|
|
110
|
+
static confirm(_message: string, defaultValue?: boolean): Promise<boolean>;
|
|
111
|
+
/**
|
|
112
|
+
* Read JSON file safely
|
|
113
|
+
*/
|
|
114
|
+
static readJsonFile(filePath: string): any;
|
|
115
|
+
/**
|
|
116
|
+
* Write JSON file safely
|
|
117
|
+
*/
|
|
118
|
+
static writeJsonFile(filePath: string, data: any, pretty?: boolean): void;
|
|
119
|
+
/**
|
|
120
|
+
* Detect file format from extension
|
|
121
|
+
*/
|
|
122
|
+
static detectFormat(filePath: string): string;
|
|
123
|
+
/**
|
|
124
|
+
* Validate output format
|
|
125
|
+
*/
|
|
126
|
+
static validateFormat(format: string): boolean;
|
|
127
|
+
/**
|
|
128
|
+
* Create backup of file
|
|
129
|
+
*/
|
|
130
|
+
static createBackup(filePath: string): string;
|
|
131
|
+
/**
|
|
132
|
+
* Clean up temporary files
|
|
133
|
+
*/
|
|
134
|
+
static cleanup(files: string[]): void;
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=CLIUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CLIUtils.d.ts","sourceRoot":"","sources":["../../src/scripts/C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