qa360 2.0.1 → 2.0.2

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.
@@ -9,10 +9,13 @@
9
9
  import { existsSync, readFileSync, writeFileSync, readdirSync } from 'fs';
10
10
  import { join, dirname } from 'path';
11
11
  import { fileURLToPath } from 'url';
12
+ import { createRequire } from 'module';
12
13
  import chalk from 'chalk';
13
- import inquirer from 'inquirer';
14
14
  const __filename = fileURLToPath(import.meta.url);
15
15
  const __dirname = dirname(__filename);
16
+ // Use createRequire for CommonJS module inquirer
17
+ const require = createRequire(import.meta.url);
18
+ const inquirer = require('inquirer');
16
19
  /**
17
20
  * Get path to examples directory
18
21
  */
@@ -9,9 +9,12 @@
9
9
  */
10
10
  import { existsSync, writeFileSync, mkdirSync } from 'fs';
11
11
  import { join, resolve } from 'path';
12
+ import { createRequire } from 'module';
12
13
  import chalk from 'chalk';
13
- import inquirer from 'inquirer';
14
14
  import { dump } from 'js-yaml';
15
+ // Use createRequire for CommonJS module inquirer
16
+ const require = createRequire(import.meta.url);
17
+ const inquirer = require('inquirer');
15
18
  /**
16
19
  * Available templates
17
20
  */
@@ -84,10 +84,11 @@ export function findPackFile(packArg) {
84
84
  return path;
85
85
  }
86
86
  }
87
- throw new Error('No pack file found. Create one with:\n' +
88
- ' qa360 ask "test my API at https://api.example.com"\n' +
89
- 'Or specify a path:\n' +
90
- ' qa360 run path/to/pack.yaml');
87
+ throw new Error('No pack file found in current directory.\n\n' +
88
+ 'To get started:\n' +
89
+ ' 1. Copy an example: qa360 examples copy api-basic\n' +
90
+ ' 2. Or create interactively: qa360 init\n' +
91
+ ' 3. Or specify a path: qa360 run path/to/pack.yaml');
91
92
  }
92
93
  /**
93
94
  * Display run results summary
@@ -95,12 +95,12 @@ sloCommand
95
95
  ? [tracker.calculateSLOResult(options.id)]
96
96
  : tracker.calculateAllResults();
97
97
  if (options.json) {
98
- console.log(JSON.stringify(results.filter(r => r), null, 2));
98
+ console.log(JSON.stringify(results.filter((r) => r != null), null, 2));
99
99
  return;
100
100
  }
101
101
  console.log('\nšŸ“Š SLO Status Report\n');
102
102
  console.log(`Generated: ${new Date().toISOString()}\n`);
103
- for (const result of results.filter(r => r)) {
103
+ for (const result of results.filter((r) => r != null)) {
104
104
  if (!result)
105
105
  continue;
106
106
  const status = result.status === 'healthy' ? 'āœ… Healthy' : result.status === 'warning' ? 'āš ļø Warning' : 'āŒ Breached';
@@ -127,7 +127,7 @@ sloCommand
127
127
  ? ((slo => slo ? [slo] : [])(tracker.getSLO(options.id)))
128
128
  : tracker.getAllSLOs();
129
129
  if (options.json) {
130
- console.log(JSON.stringify(slos.map(s => ({
130
+ console.log(JSON.stringify(slos.map((s) => ({
131
131
  id: s.id,
132
132
  name: s.name,
133
133
  errorBudget: s.errorBudget
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qa360",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "QA360 Proof CLI - Quality as Cryptographic Proof",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",