@chain-registry/workflows 1.37.1 → 1.39.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/build.d.ts +4 -3
- package/build.js +8 -6
- package/esm/build.js +8 -6
- package/package.json +4 -4
package/build.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { JSONSchemaPatchOperation } from 'json-schema-patch';
|
|
2
|
+
import { BooleanFunction, TransformFunction } from 'json-schema-patch/types/utils';
|
|
1
3
|
import { JSONStringifyOptions } from 'strfy-js';
|
|
2
4
|
import { JSONSchemaContent, Registry } from './registry';
|
|
3
|
-
import { JSONSchemaPatchOperation } from 'json-schema-patch';
|
|
4
5
|
export interface RegistryBuilderOptions {
|
|
5
6
|
assetList: JSONStringifyOptions;
|
|
6
7
|
chain: JSONStringifyOptions;
|
|
@@ -16,7 +17,7 @@ export declare class RegistryBuilder {
|
|
|
16
17
|
private registry;
|
|
17
18
|
constructor(registry: Registry, options?: RegistryBuilderOptions);
|
|
18
19
|
writeFile(outDir: string, info: JSONSchemaContent<any>, options: JSONStringifyOptions): void;
|
|
19
|
-
writeSchema(outDir: string, info: JSONSchemaContent<any>, ops: JSONSchemaPatchOperation[]): void;
|
|
20
|
-
buildSchemas(outDir: string): void;
|
|
20
|
+
writeSchema(outDir: string, info: JSONSchemaContent<any>, ops: JSONSchemaPatchOperation[], transformer: TransformFunction, transformTest: BooleanFunction): void;
|
|
21
|
+
buildSchemas(outDir: string, transformer: TransformFunction, transformTest: BooleanFunction): void;
|
|
21
22
|
build(outDir: string): void;
|
|
22
23
|
}
|
package/build.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RegistryBuilder = void 0;
|
|
4
4
|
const fs_1 = require("fs");
|
|
5
|
+
const json_schema_patch_1 = require("json-schema-patch");
|
|
5
6
|
const mkdirp_1 = require("mkdirp");
|
|
6
7
|
const path_1 = require("path");
|
|
7
8
|
const strfy_js_1 = require("strfy-js");
|
|
8
|
-
const json_schema_patch_1 = require("json-schema-patch");
|
|
9
9
|
class RegistryBuilder {
|
|
10
10
|
options;
|
|
11
11
|
registry;
|
|
@@ -19,18 +19,20 @@ class RegistryBuilder {
|
|
|
19
19
|
(0, mkdirp_1.sync)((0, path_1.dirname)(file));
|
|
20
20
|
(0, fs_1.writeFileSync)(file, str);
|
|
21
21
|
}
|
|
22
|
-
writeSchema(outDir, info, ops) {
|
|
22
|
+
writeSchema(outDir, info, ops, transformer, transformTest) {
|
|
23
23
|
const patcher = new json_schema_patch_1.JSONSchemaPatch(info.content);
|
|
24
24
|
ops.forEach(patcher.prepareOperation.bind(patcher));
|
|
25
|
+
patcher.transform(transformer.bind(patcher), transformTest);
|
|
26
|
+
// @ts-ignore
|
|
25
27
|
patcher.applyPatch();
|
|
26
28
|
const file = (0, path_1.join)(outDir, info.path.replace(this.registry.basePath, ''));
|
|
27
29
|
(0, mkdirp_1.sync)((0, path_1.dirname)(file));
|
|
28
30
|
(0, fs_1.writeFileSync)(file, JSON.stringify(patcher.schema, null, 2));
|
|
29
31
|
}
|
|
30
|
-
buildSchemas(outDir) {
|
|
31
|
-
this.writeSchema(outDir, this.registry.schemaMappings.AssetList, this.options.ops.assetList);
|
|
32
|
-
this.writeSchema(outDir, this.registry.schemaMappings.Chain, this.options.ops.chain);
|
|
33
|
-
this.writeSchema(outDir, this.registry.schemaMappings.IBCData, this.options.ops.ibcData);
|
|
32
|
+
buildSchemas(outDir, transformer, transformTest) {
|
|
33
|
+
this.writeSchema(outDir, this.registry.schemaMappings.AssetList, this.options.ops.assetList, transformer, transformTest);
|
|
34
|
+
this.writeSchema(outDir, this.registry.schemaMappings.Chain, this.options.ops.chain, transformer, transformTest);
|
|
35
|
+
this.writeSchema(outDir, this.registry.schemaMappings.IBCData, this.options.ops.ibcData, transformer, transformTest);
|
|
34
36
|
}
|
|
35
37
|
build(outDir) {
|
|
36
38
|
this.registry.dataMappings.AssetList.forEach(info => {
|
package/esm/build.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { writeFileSync } from 'fs';
|
|
2
|
+
import { JSONSchemaPatch } from 'json-schema-patch';
|
|
2
3
|
import { sync as mkdirp } from 'mkdirp';
|
|
3
4
|
import { dirname, join } from 'path';
|
|
4
5
|
import { jsonStringify } from 'strfy-js';
|
|
5
|
-
import { JSONSchemaPatch } from 'json-schema-patch';
|
|
6
6
|
export class RegistryBuilder {
|
|
7
7
|
options;
|
|
8
8
|
registry;
|
|
@@ -16,18 +16,20 @@ export class RegistryBuilder {
|
|
|
16
16
|
mkdirp(dirname(file));
|
|
17
17
|
writeFileSync(file, str);
|
|
18
18
|
}
|
|
19
|
-
writeSchema(outDir, info, ops) {
|
|
19
|
+
writeSchema(outDir, info, ops, transformer, transformTest) {
|
|
20
20
|
const patcher = new JSONSchemaPatch(info.content);
|
|
21
21
|
ops.forEach(patcher.prepareOperation.bind(patcher));
|
|
22
|
+
patcher.transform(transformer.bind(patcher), transformTest);
|
|
23
|
+
// @ts-ignore
|
|
22
24
|
patcher.applyPatch();
|
|
23
25
|
const file = join(outDir, info.path.replace(this.registry.basePath, ''));
|
|
24
26
|
mkdirp(dirname(file));
|
|
25
27
|
writeFileSync(file, JSON.stringify(patcher.schema, null, 2));
|
|
26
28
|
}
|
|
27
|
-
buildSchemas(outDir) {
|
|
28
|
-
this.writeSchema(outDir, this.registry.schemaMappings.AssetList, this.options.ops.assetList);
|
|
29
|
-
this.writeSchema(outDir, this.registry.schemaMappings.Chain, this.options.ops.chain);
|
|
30
|
-
this.writeSchema(outDir, this.registry.schemaMappings.IBCData, this.options.ops.ibcData);
|
|
29
|
+
buildSchemas(outDir, transformer, transformTest) {
|
|
30
|
+
this.writeSchema(outDir, this.registry.schemaMappings.AssetList, this.options.ops.assetList, transformer, transformTest);
|
|
31
|
+
this.writeSchema(outDir, this.registry.schemaMappings.Chain, this.options.ops.chain, transformer, transformTest);
|
|
32
|
+
this.writeSchema(outDir, this.registry.schemaMappings.IBCData, this.options.ops.ibcData, transformer, transformTest);
|
|
31
33
|
}
|
|
32
34
|
build(outDir) {
|
|
33
35
|
this.registry.dataMappings.AssetList.forEach(info => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chain-registry/workflows",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.39.0",
|
|
4
4
|
"description": "Chain Registry Workflows",
|
|
5
5
|
"author": "Dan Lynch <pyramation@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/cosmology-tech/chain-registry",
|
|
@@ -31,14 +31,14 @@
|
|
|
31
31
|
"@types/sha.js": "^2.4.0"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@chain-registry/interfaces": "^0.
|
|
34
|
+
"@chain-registry/interfaces": "^0.38.0",
|
|
35
35
|
"ajv": "^8.12.0",
|
|
36
36
|
"ajv-formats": "^3.0.1",
|
|
37
37
|
"bignumber.js": "9.1.2",
|
|
38
38
|
"chalk": "^4.1.0",
|
|
39
39
|
"file-ts": "^0.7.15",
|
|
40
40
|
"glob": "^7.1.4",
|
|
41
|
-
"json-schema-patch": "0.
|
|
41
|
+
"json-schema-patch": "1.0.1",
|
|
42
42
|
"minimatch": "^9.0.4",
|
|
43
43
|
"mkdirp": "3.0.1",
|
|
44
44
|
"schema-typescript": "^0.5.0",
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"cosmos",
|
|
51
51
|
"interchain"
|
|
52
52
|
],
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "3792a95ef16974f5e0de0703fe92d1fce6d494e9"
|
|
54
54
|
}
|