@xyo-network/manifest 5.1.21 → 5.1.23
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/manifest",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.23",
|
|
4
4
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
5
5
|
"homepage": "https://xyo.network",
|
|
6
6
|
"bugs": {
|
|
@@ -33,19 +33,22 @@
|
|
|
33
33
|
"types": "dist/neutral/index.d.ts",
|
|
34
34
|
"files": [
|
|
35
35
|
"dist",
|
|
36
|
-
"src"
|
|
36
|
+
"src",
|
|
37
|
+
"!**/*.bench.*",
|
|
38
|
+
"!**/*.spec.*",
|
|
39
|
+
"!**/*.test.*"
|
|
37
40
|
],
|
|
38
41
|
"dependencies": {
|
|
39
|
-
"@xyo-network/manifest-model": "~5.1.
|
|
40
|
-
"@xyo-network/manifest-wrapper": "~5.1.
|
|
42
|
+
"@xyo-network/manifest-model": "~5.1.23",
|
|
43
|
+
"@xyo-network/manifest-wrapper": "~5.1.23"
|
|
41
44
|
},
|
|
42
45
|
"devDependencies": {
|
|
43
46
|
"@xylabs/ts-scripts-yarn3": "~7.2.8",
|
|
44
47
|
"@xylabs/tsconfig": "~7.2.8",
|
|
45
|
-
"@xylabs/vitest-extended": "~5.0.
|
|
48
|
+
"@xylabs/vitest-extended": "~5.0.33",
|
|
46
49
|
"ajv": "~8.17.1",
|
|
47
50
|
"typescript": "~5.9.3",
|
|
48
|
-
"vitest": "~4.0.
|
|
51
|
+
"vitest": "~4.0.9"
|
|
49
52
|
},
|
|
50
53
|
"publishConfig": {
|
|
51
54
|
"access": "public"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"manifest-schemas.spec.d.ts","sourceRoot":"","sources":["../../../src/spec/manifest-schemas.spec.ts"],"names":[],"mappings":"AACA,OAAO,yBAAyB,CAAA"}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
/* eslint-disable import-x/no-internal-modules */
|
|
2
|
-
import '@xylabs/vitest-extended'
|
|
3
|
-
|
|
4
|
-
import type { ValidateFunction } from 'ajv'
|
|
5
|
-
import { Ajv } from 'ajv'
|
|
6
|
-
import {
|
|
7
|
-
beforeEach,
|
|
8
|
-
describe, expect, it,
|
|
9
|
-
} from 'vitest'
|
|
10
|
-
|
|
11
|
-
import dappPackageManifestSchemaCompiled from '../compilations/dapp-package-manifest-schema.json' with { type: 'json' }
|
|
12
|
-
import packageManifestSchemaCompiled from '../compilations/schema.json' with { type: 'json' }
|
|
13
|
-
import dappPackageManifestSchema from '../dapp-package-manifest-schema.json' with { type: 'json' }
|
|
14
|
-
import packageManifestSchema from '../schema.json' with { type: 'json' }
|
|
15
|
-
import sharedDefinitions from '../shared/definitions-schema.json' with { type: 'json' }
|
|
16
|
-
import {
|
|
17
|
-
invalidDappPackageManifestSchema, invalidPackageManifestSchema, validDappPackageManifestSchema, validPackageManifestSchema,
|
|
18
|
-
} from './cases/index.ts'
|
|
19
|
-
|
|
20
|
-
const cases = [
|
|
21
|
-
{
|
|
22
|
-
describeName: 'PackageManifestSchema',
|
|
23
|
-
expectedErrorCount: 4,
|
|
24
|
-
invalidCase: invalidPackageManifestSchema,
|
|
25
|
-
schemaToTest: packageManifestSchema,
|
|
26
|
-
validCase: validPackageManifestSchema,
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
compiled: true,
|
|
30
|
-
describeName: 'CompiledPackageManifestSchema',
|
|
31
|
-
expectedErrorCount: 4,
|
|
32
|
-
invalidCase: invalidPackageManifestSchema,
|
|
33
|
-
schemaToTest: packageManifestSchemaCompiled,
|
|
34
|
-
validCase: validPackageManifestSchema,
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
describeName: 'DappPackageManifestSchema',
|
|
38
|
-
expectedErrorCount: 4,
|
|
39
|
-
invalidCase: invalidDappPackageManifestSchema,
|
|
40
|
-
schemaToTest: dappPackageManifestSchema,
|
|
41
|
-
validCase: validDappPackageManifestSchema,
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
compiled: true,
|
|
45
|
-
describeName: 'CompiledDappPackageManifestSchema',
|
|
46
|
-
expectedErrorCount: 4,
|
|
47
|
-
invalidCase: invalidDappPackageManifestSchema,
|
|
48
|
-
schemaToTest: dappPackageManifestSchemaCompiled,
|
|
49
|
-
validCase: validDappPackageManifestSchema,
|
|
50
|
-
},
|
|
51
|
-
]
|
|
52
|
-
|
|
53
|
-
describe.each(cases)('ManifestSchemas', ({
|
|
54
|
-
compiled, describeName, expectedErrorCount, validCase, invalidCase, schemaToTest,
|
|
55
|
-
}) => {
|
|
56
|
-
describe(describeName, () => {
|
|
57
|
-
let validate: ValidateFunction | undefined
|
|
58
|
-
|
|
59
|
-
beforeEach(() => {
|
|
60
|
-
const ajvSchemaOptions = compiled ? {} : { schemas: [sharedDefinitions] }
|
|
61
|
-
const ajv = new Ajv({
|
|
62
|
-
allErrors: true, strict: true, ...ajvSchemaOptions,
|
|
63
|
-
})
|
|
64
|
-
// see if you can export the super set
|
|
65
|
-
validate = ajv.compile(schemaToTest)
|
|
66
|
-
// validate.schema
|
|
67
|
-
})
|
|
68
|
-
it('valid schema', () => {
|
|
69
|
-
if (validate) {
|
|
70
|
-
const valid = validate(validCase)
|
|
71
|
-
// console.log(validate?.errors)
|
|
72
|
-
expect(valid).toBe(true)
|
|
73
|
-
} else {
|
|
74
|
-
throw new Error('Schema did not compile successfully')
|
|
75
|
-
}
|
|
76
|
-
})
|
|
77
|
-
it('invalid schema', () => {
|
|
78
|
-
if (validate) {
|
|
79
|
-
const valid = validate(invalidCase)
|
|
80
|
-
// console.log(describeName, validate?.errors)
|
|
81
|
-
expect(valid).toBe(false)
|
|
82
|
-
expect(validate.errors?.length).toBe(expectedErrorCount)
|
|
83
|
-
} else {
|
|
84
|
-
throw new Error('Schema did not compile successfully')
|
|
85
|
-
}
|
|
86
|
-
})
|
|
87
|
-
})
|
|
88
|
-
})
|