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
|
*/
|
package/dist/commands/init.js
CHANGED
|
@@ -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
|
*/
|
package/dist/commands/run.js
CHANGED
|
@@ -84,10 +84,11 @@ export function findPackFile(packArg) {
|
|
|
84
84
|
return path;
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
-
throw new Error('No pack file found
|
|
88
|
-
'
|
|
89
|
-
'
|
|
90
|
-
' qa360
|
|
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
|
package/dist/commands/slo.js
CHANGED
|
@@ -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
|