@rigour-labs/cli 2.13.0 → 2.15.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
  }
@@ -144,6 +144,22 @@ async function setupApiAndLaunch(apiPort, studioPort, eventsPath, cwd, studioPro
144
144
  res.end('Not found');
145
145
  }
146
146
  }
147
+ else if (url.pathname === '/api/info') {
148
+ try {
149
+ const pkgPath = path.join(cwd, 'package.json');
150
+ const pkg = await fs.pathExists(pkgPath) ? await fs.readJson(pkgPath) : {};
151
+ res.writeHead(200, { 'Content-Type': 'application/json' });
152
+ res.end(JSON.stringify({
153
+ name: pkg.name || path.basename(cwd),
154
+ path: cwd,
155
+ version: pkg.version || '0.0.0'
156
+ }));
157
+ }
158
+ catch (e) {
159
+ res.writeHead(500);
160
+ res.end(e.message);
161
+ }
162
+ }
147
163
  else if (url.pathname === '/api/tree') {
148
164
  try {
149
165
  const getTree = async (dir) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rigour-labs/cli",
3
- "version": "2.13.0",
3
+ "version": "2.15.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.13.0"
31
+ "@rigour-labs/core": "2.15.0"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/fs-extra": "^11.0.4",