@rigour-labs/cli 2.14.0 → 2.16.0

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/dist/cli.js CHANGED
@@ -49,6 +49,7 @@ program
49
49
  .option('--ci', 'CI mode (minimal output, non-zero exit on fail)')
50
50
  .option('--json', 'Output report in JSON format')
51
51
  .option('-i, --interactive', 'Run in interactive mode with rich output')
52
+ .option('-c, --config <path>', 'Path to custom rigour.yml configuration')
52
53
  .addHelpText('after', `
53
54
  Examples:
54
55
  $ rigour check # Run standard check
@@ -2,5 +2,6 @@ export interface CheckOptions {
2
2
  ci?: boolean;
3
3
  json?: boolean;
4
4
  interactive?: boolean;
5
+ config?: string;
5
6
  }
6
7
  export declare function checkCommand(cwd: string, files?: string[], options?: CheckOptions): Promise<void>;
@@ -28,13 +28,13 @@ async function logStudioEvent(cwd, event) {
28
28
  }
29
29
  }
30
30
  export async function checkCommand(cwd, files = [], options = {}) {
31
- const configPath = path.join(cwd, 'rigour.yml');
31
+ const configPath = options.config ? path.resolve(cwd, options.config) : path.join(cwd, 'rigour.yml');
32
32
  if (!(await fs.pathExists(configPath))) {
33
33
  if (options.json) {
34
- console.log(JSON.stringify({ error: 'CONFIG_ERROR', message: 'rigour.yml not found' }));
34
+ console.log(JSON.stringify({ error: 'CONFIG_ERROR', message: `Config file not found: ${configPath}` }));
35
35
  }
36
36
  else if (!options.ci) {
37
- console.error(chalk.red('Error: rigour.yml not found. Run `rigour init` first.'));
37
+ console.error(chalk.red(`Error: Config file not found at ${configPath}. Run \`rigour init\` first or provide a valid path.`));
38
38
  }
39
39
  process.exit(EXIT_CONFIG_ERROR);
40
40
  }
@@ -73,10 +73,13 @@ export async function checkCommand(cwd, files = [], options = {}) {
73
73
  const fixPacketPath = path.join(cwd, 'rigour-fix-packet.json');
74
74
  await fs.writeJson(fixPacketPath, fixPacket, { spaces: 2 });
75
75
  }
76
- // JSON output mode
76
+ // JSON output mode - use stdout.write for large outputs to avoid truncation
77
77
  if (options.json) {
78
- console.log(JSON.stringify(report, null, 2));
79
- process.exit(report.status === 'PASS' ? EXIT_PASS : EXIT_FAIL);
78
+ const jsonOutput = JSON.stringify(report, null, 2);
79
+ process.stdout.write(jsonOutput + '\n', () => {
80
+ process.exit(report.status === 'PASS' ? EXIT_PASS : EXIT_FAIL);
81
+ });
82
+ return; // Wait for write callback
80
83
  }
81
84
  // CI mode: minimal output
82
85
  if (options.ci) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rigour-labs/cli",
3
- "version": "2.14.0",
3
+ "version": "2.16.0",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "rigour": "dist/cli.js"
@@ -28,7 +28,7 @@
28
28
  "inquirer": "9.2.16",
29
29
  "ora": "^8.0.1",
30
30
  "yaml": "^2.8.2",
31
- "@rigour-labs/core": "2.14.0"
31
+ "@rigour-labs/core": "2.16.0"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/fs-extra": "^11.0.4",