@travetto/cli 7.0.3 → 7.0.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/cli",
3
- "version": "7.0.3",
3
+ "version": "7.0.5",
4
4
  "type": "module",
5
5
  "description": "CLI infrastructure for Travetto framework",
6
6
  "keywords": [
@@ -29,7 +29,7 @@
29
29
  "directory": "module/cli"
30
30
  },
31
31
  "dependencies": {
32
- "@travetto/schema": "^7.0.3",
32
+ "@travetto/schema": "^7.0.4",
33
33
  "@travetto/terminal": "^7.0.3"
34
34
  },
35
35
  "travetto": {
package/src/module.ts CHANGED
@@ -60,7 +60,8 @@ export class CliModuleUtil {
60
60
  childMap.has(name) ? childMap.get(name)! : childMap.set(name, { children: new Set(), name, active: new Set() }).get(name)!;
61
61
 
62
62
  for (const mod of modules) {
63
- get(mod.name).parents = mod.parents;
63
+ get(mod.name).parents = [...mod.parents];
64
+ get(mod.name).children = new Set(mod.children);
64
65
  for (const parentModule of mod.parents) {
65
66
  const parent = get(parentModule);
66
67
  parent.children.add(mod.name); // Store child into parent
@@ -75,13 +75,14 @@ export class CliSchemaExportUtil {
75
75
  static exportSchema(cls: Class): CliCommandSchema {
76
76
  const schema = SchemaRegistryIndex.getConfig(cls);
77
77
  const config = CliCommandRegistryIndex.get(cls);
78
- const processed = Object.values(schema.fields).map(value => this.processInput(value));
78
+ const flags = Object.values(schema.fields).map(value => this.processInput(value));
79
+ const args = (schema.methods.main?.parameters ?? []).map(value => this.processInput(value));
79
80
  return {
80
81
  name: config.name,
81
82
  module: describeFunction(config.cls).module,
82
83
  description: schema.description,
83
- flags: processed.filter(value => value.flagNames && value.flagNames.length > 0),
84
- args: processed.filter(value => !value.flagNames || value.flagNames.length === 0),
84
+ flags: flags.filter(value => value.flagNames && value.flagNames.length > 0),
85
+ args,
85
86
  runTarget: config.runTarget ?? false
86
87
  };
87
88
  }
package/src/scm.ts CHANGED
@@ -48,6 +48,7 @@ export class CliScmUtil {
48
48
  */
49
49
  static async findChangedFiles(fromHash: string, toHash: string = 'HEAD'): Promise<string[]> {
50
50
  const rootPath = Runtime.workspace.path;
51
+ console.log(`Detecting changes between ${fromHash} and ${toHash}...`);
51
52
  const result = await ExecUtil.getResult(spawn('git', ['diff', '--name-only', `${fromHash}..${toHash}`, ':!**/DOC.*', ':!**/README.*'], { cwd: rootPath }), { catch: true });
52
53
  if (!result.valid) {
53
54
  throw new AppError('Unable to detect changes between', { category: 'data', details: { fromHash, toHash, output: (result.stderr || result.stdout) } });