@bentley/app-schema-validator 0.2.193 → 1.0.1

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/bin/index.js CHANGED
@@ -27,7 +27,7 @@ async function validate() {
27
27
  }
28
28
 
29
29
  if (!program.installerDir || !program.baseSchemaRefDir || !program.output) {
30
- console.log(chalk.default.red("Invalid input. For help use the '-h' option."));
30
+ console.log(chalk.red("Invalid input. For help use the '-h' option."));
31
31
  process.exit(1);
32
32
  }
33
33
 
@@ -4,7 +4,8 @@
4
4
  * Licensed under the MIT License. See LICENSE.md in the project root for license terms.
5
5
  *--------------------------------------------------------------------------------------------*/
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.generateAppSchemaDirectoryList = exports.verifyAppSchemas = void 0;
7
+ exports.verifyAppSchemas = verifyAppSchemas;
8
+ exports.generateAppSchemaDirectoryList = generateAppSchemaDirectoryList;
8
9
  const fs = require("fs");
9
10
  const path = require("path");
10
11
  const chalk = require("chalk");
@@ -37,7 +38,6 @@ async function verifyAppSchemas(appDirectory, baseSchemaRefDir, output) {
37
38
  }
38
39
  return results;
39
40
  }
40
- exports.verifyAppSchemas = verifyAppSchemas;
41
41
  /**
42
42
  * Apply all validations
43
43
  * @param schemaDir Directory where schema is located
@@ -58,7 +58,7 @@ async function applyValidations(schemaDir, schemaFile, appSchemaDirs, releasedSc
58
58
  await (0, imodel_schema_validator_1.validateSchema)(name, version, appSchemaPath, releasedSchemaDirectories, validationResult, output);
59
59
  releasedSchemaDirectories = fixReleasedSchemaDirectories(schemaDir, releasedSchemaDirectories);
60
60
  if ((0, imodel_schema_validator_1.isDynamicSchema)(appSchemaPath)) {
61
- console.log(chalk.default.grey(`Skipping difference audit for ${name} ${version}.
61
+ console.log(chalk.grey(`Skipping difference audit for ${name} ${version}.
62
62
  The schema is a dynamic schema and released versions of dynamic schemas are not saved.`));
63
63
  Reporter_1.Reporter.writeToLogFile(name, version, `Skipping difference audit for ${name}.${version}.
64
64
  The schema is a dynamic schema and released versions of dynamic schemas are not saved.\n`, output);
@@ -77,12 +77,12 @@ async function applyValidations(schemaDir, schemaFile, appSchemaDirs, releasedSc
77
77
  }
78
78
  if (!releasedSchemaPath) {
79
79
  if ((0, imodel_schema_validator_1.isDynamicSchema)(appSchemaPath)) {
80
- console.log(chalk.default.grey("Skipping difference audit for ", name, version, ". No released schema found."));
80
+ console.log(chalk.grey("Skipping difference audit for ", name, version, ". No released schema found."));
81
81
  Reporter_1.Reporter.writeToLogFile(name, version, `Skipping difference audit for ${name}.${version}. No released schema found.\n`, output);
82
82
  validationResult.comparer = imodel_schema_validator_1.iModelValidationResultTypes.Skipped;
83
83
  }
84
84
  else {
85
- console.log(chalk.default.grey("Skipping difference audit for ", name, version, ". No released schema found."));
85
+ console.log(chalk.grey("Skipping difference audit for ", name, version, ". No released schema found."));
86
86
  Reporter_1.Reporter.writeToLogFile(name, version, `Skipping difference audit for ${name}.${version}. No released schema found.\n`, output);
87
87
  validationResult.comparer = imodel_schema_validator_1.iModelValidationResultTypes.NotFound;
88
88
  }
@@ -127,5 +127,4 @@ async function generateAppSchemaDirectoryList(appDirectory) {
127
127
  const schemaPaths = (await readdirp.promise(appDirectory, filter)).map((entry) => path.dirname(entry.fullPath));
128
128
  return Array.from(new Set(schemaPaths).keys());
129
129
  }
130
- exports.generateAppSchemaDirectoryList = generateAppSchemaDirectoryList;
131
130
  //# sourceMappingURL=AppSchemaValidator.js.map
package/lib/utils.js CHANGED
@@ -4,7 +4,9 @@
4
4
  * Licensed under the MIT License. See LICENSE.md in the project root for license terms.
5
5
  *--------------------------------------------------------------------------------------------*/
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.shouldExcludeSchema = exports.getExcludeSchemaList = exports.generateSchemaDirectoryLists = void 0;
7
+ exports.generateSchemaDirectoryLists = generateSchemaDirectoryLists;
8
+ exports.getExcludeSchemaList = getExcludeSchemaList;
9
+ exports.shouldExcludeSchema = shouldExcludeSchema;
8
10
  const fs = require("fs");
9
11
  const path = require("path");
10
12
  const readdirp = require("readdirp");
@@ -18,7 +20,6 @@ async function generateSchemaDirectoryLists(schemaDirectory) {
18
20
  const allSchemaDirs = (await readdirp.promise(schemaDirectory, filter)).map((schemaPath) => path.dirname(schemaPath.fullPath));
19
21
  return Array.from(new Set(allSchemaDirs.filter((schemaDir) => /released/i.test(schemaDir))).keys());
20
22
  }
21
- exports.generateSchemaDirectoryLists = generateSchemaDirectoryLists;
22
23
  /**
23
24
  * Provides a list of schemas to exclude from validation
24
25
  */
@@ -32,7 +33,6 @@ async function getExcludeSchemaList() {
32
33
  const schemas = JSON.parse(rawdata);
33
34
  return schemas;
34
35
  }
35
- exports.getExcludeSchemaList = getExcludeSchemaList;
36
36
  /**
37
37
  * Checks if a schema should be excluded from validation
38
38
  * @param schemaFle Schema file
@@ -50,5 +50,4 @@ async function shouldExcludeSchema(schemaFle, excludeList) {
50
50
  return true;
51
51
  return false;
52
52
  }
53
- exports.shouldExcludeSchema = shouldExcludeSchema;
54
53
  //# sourceMappingURL=utils.js.map
package/package.json CHANGED
@@ -11,30 +11,30 @@
11
11
  "name": "Bentley Systems, Inc.",
12
12
  "url": "http://www.bentley.com"
13
13
  },
14
- "version": "0.2.193",
14
+ "version": "1.0.1",
15
15
  "bin": {
16
16
  "app-schema-validator": "./bin/index.js"
17
17
  },
18
18
  "dependencies": {
19
- "@itwin/ecschema-locaters": "4.10.10",
20
- "@itwin/ecschema-metadata": "4.10.10",
21
- "@bentley/imodel-schema-validator": "0.2.193",
22
- "chalk": "^2.4.1",
19
+ "@itwin/ecschema-locaters": "5.2.0-dev.19",
20
+ "@itwin/ecschema-metadata": "5.2.0-dev.19",
21
+ "@bentley/imodel-schema-validator": "1.0.1",
22
+ "chalk": "^3.0.0",
23
23
  "commander": "^2.19.0",
24
24
  "readdirp": "^3.0.0",
25
- "rimraf": "^3.0.2"
25
+ "rimraf": "^6.0.1"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@itwin/eslint-plugin": "^4.0.2",
29
- "@itwin/build-tools": "4.10.10",
30
- "@types/node": "~18.16.20",
29
+ "@itwin/build-tools": "5.2.0-dev.19",
30
+ "@types/node": "~20.17.0",
31
31
  "@types/chai": "4.3.1",
32
32
  "@types/mocha": "^10.0.6",
33
- "cpx2": "^3.0.0",
34
- "typescript": "~5.3.3",
33
+ "cpx2": "^8.0.0",
34
+ "typescript": "~5.6.2",
35
35
  "chai": "^4.3.10",
36
- "mocha": "^10.2.0",
37
- "nyc": "^15.1.0",
36
+ "mocha": "^11.1.0",
37
+ "nyc": "^17.1.0",
38
38
  "eslint": "^8.56.0"
39
39
  },
40
40
  "scripts": {