qa360 2.2.10 → 2.2.11
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.
Potentially problematic release.
This version of qa360 might be problematic. Click here for more details.
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import Ajv from 'ajv';
|
|
6
6
|
import addFormats from 'ajv-formats';
|
|
7
|
-
import { readFileSync } from 'fs';
|
|
7
|
+
import { readFileSync, existsSync } from 'fs';
|
|
8
8
|
import { join, dirname } from 'path';
|
|
9
9
|
import { fileURLToPath } from 'url';
|
|
10
10
|
export class PackValidator {
|
|
@@ -20,14 +20,14 @@ export class PackValidator {
|
|
|
20
20
|
// Load schema (ES modules compatible)
|
|
21
21
|
const __filename = fileURLToPath(import.meta.url);
|
|
22
22
|
const __dirname = dirname(__filename);
|
|
23
|
-
//
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
23
|
+
// Check multiple paths to handle both development and bundled npm environments
|
|
24
|
+
const path1 = join(__dirname, '../../schemas/pack.schema.json'); // dev
|
|
25
|
+
const path2 = join(__dirname, '../schemas/pack.schema.json'); // bundled
|
|
26
|
+
const path3 = join(__dirname, '../../../core/schemas/pack.schema.json'); // npm package
|
|
27
|
+
let schemaPath = existsSync(path1) ? path1 : (existsSync(path2) ? path2 : path3);
|
|
28
|
+
// Final fallback: throw error if no schema found
|
|
29
|
+
if (!existsSync(schemaPath)) {
|
|
30
|
+
throw new Error(`Schema file not found. Tried: ${path1}, ${path2}, ${path3}`);
|
|
31
31
|
}
|
|
32
32
|
this.schema = JSON.parse(readFileSync(schemaPath, 'utf8'));
|
|
33
33
|
this.ajv.addSchema(this.schema, 'pack-v1');
|
package/cli/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "qa360",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.11",
|
|
4
4
|
"description": "Transform software testing into verifiable, signed, and traceable proofs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"packageManager": "pnpm@9.12.2",
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"cli/bin",
|
|
16
16
|
"cli/README.md",
|
|
17
17
|
"core/schemas",
|
|
18
|
+
"core/dist/schemas",
|
|
18
19
|
"core/README.md",
|
|
19
20
|
"README.md",
|
|
20
21
|
"CHANGELOG.md",
|