@chain-registry/cli 1.28.0 → 1.29.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/README.md CHANGED
@@ -71,8 +71,10 @@ chain-registry validate
71
71
 
72
72
  Options:
73
73
 
74
- - `--outputDir`: Directory to output the generated TypeScript files.
75
- - `--registryDir`: Path to the chain registry directory.
74
+ - `--registryDir`: Path to the chain registry directory (required).
75
+ - `--useStrict`: Enables strict mode in the schema validation process, ensuring that only explicitly permitted properties are present in the data (default: false).
76
+ - `--allErrors`: Configures the validator to return all errors found during validation instead of stopping at the first error (default: true).
77
+ - `--useDefaults`: Applies default values defined in the schema during validation, filling in missing data as needed (default: true).
76
78
 
77
79
  ### Codegen
78
80
 
@@ -8,7 +8,29 @@ const commands = async (argv, prompter, _options) => {
8
8
  {
9
9
  type: 'text',
10
10
  name: 'registryDir',
11
- message: 'provide a registryDir:'
11
+ message: 'provide a registryDir:',
12
+ required: true,
13
+ },
14
+ {
15
+ type: 'confirm',
16
+ name: 'useStrict',
17
+ required: true,
18
+ useDefault: true,
19
+ default: false
20
+ },
21
+ {
22
+ type: 'confirm',
23
+ name: 'allErrors',
24
+ required: true,
25
+ useDefault: true,
26
+ default: true
27
+ },
28
+ {
29
+ type: 'confirm',
30
+ name: 'useDefaults',
31
+ required: true,
32
+ useDefault: true,
33
+ default: true
12
34
  }
13
35
  ]);
14
36
  if (!(0, fs_1.existsSync)(argv.registryDir)) {
@@ -16,7 +38,11 @@ const commands = async (argv, prompter, _options) => {
16
38
  throw new Error('bad registry path!');
17
39
  }
18
40
  const registry = new workflows_1.Registry(argv.registryDir);
19
- const validator = new workflows_1.SchemaValidator(registry);
41
+ const validator = new workflows_1.SchemaValidator(registry, {
42
+ allErrors,
43
+ useDefaults,
44
+ useStrict
45
+ });
20
46
  validator.validateAllData(true);
21
47
  return argv;
22
48
  };
@@ -5,7 +5,29 @@ export const commands = async (argv, prompter, _options) => {
5
5
  {
6
6
  type: 'text',
7
7
  name: 'registryDir',
8
- message: 'provide a registryDir:'
8
+ message: 'provide a registryDir:',
9
+ required: true,
10
+ },
11
+ {
12
+ type: 'confirm',
13
+ name: 'useStrict',
14
+ required: true,
15
+ useDefault: true,
16
+ default: false
17
+ },
18
+ {
19
+ type: 'confirm',
20
+ name: 'allErrors',
21
+ required: true,
22
+ useDefault: true,
23
+ default: true
24
+ },
25
+ {
26
+ type: 'confirm',
27
+ name: 'useDefaults',
28
+ required: true,
29
+ useDefault: true,
30
+ default: true
9
31
  }
10
32
  ]);
11
33
  if (!existsSync(argv.registryDir)) {
@@ -13,7 +35,11 @@ export const commands = async (argv, prompter, _options) => {
13
35
  throw new Error('bad registry path!');
14
36
  }
15
37
  const registry = new Registry(argv.registryDir);
16
- const validator = new SchemaValidator(registry);
38
+ const validator = new SchemaValidator(registry, {
39
+ allErrors,
40
+ useDefaults,
41
+ useStrict
42
+ });
17
43
  validator.validateAllData(true);
18
44
  return argv;
19
45
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chain-registry/cli",
3
- "version": "1.28.0",
3
+ "version": "1.29.0",
4
4
  "description": "Chain Registry CLI",
5
5
  "author": "Dan Lynch <pyramation@gmail.com>",
6
6
  "homepage": "https://github.com/cosmology-tech/chain-registry",
@@ -33,8 +33,8 @@
33
33
  "test:watch": "jest --watch"
34
34
  },
35
35
  "dependencies": {
36
- "@chain-registry/interfaces": "^0.27.0",
37
- "@chain-registry/workflows": "^1.28.0",
36
+ "@chain-registry/interfaces": "^0.28.0",
37
+ "@chain-registry/workflows": "^1.29.0",
38
38
  "chalk": "^4.1.0",
39
39
  "deepmerge": "^4.3.1",
40
40
  "inquirerer": "1.8.0",
@@ -50,5 +50,5 @@
50
50
  "devDependencies": {
51
51
  "strfy-js": "^2.2.2"
52
52
  },
53
- "gitHead": "7478b00e390b053976e2a5f502d9b407e861c69d"
53
+ "gitHead": "df00cf702adec71eeaf5238046cc39e88a305f49"
54
54
  }