@itwin/ecschema2ts 3.4.0-dev.9 → 3.5.0-dev.5

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.
@@ -1 +1 @@
1
- {"version":3,"file":"ecschema2ts_cli.js","sourceRoot":"","sources":["../../src/ecschema2ts_cli.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;AAE/F,+BAA+B;AAC/B,6BAA6B;AAC7B,uCAAuC;AACvC,+BAA+B;AAC/B,+BAA+B;AAE/B,qDAAyD;AACzD,gEAAyD;AAEzD,SAAS,kBAAkB,CAAC,KAAa;IACvC,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAC1B,CAAC;AAED,kBAAkB;AAClB,MAAM,OAAO,GAAG,IAAI,SAAS,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;AACrD,OAAO,CAAC,MAAM,CAAC,wBAAwB,EAAE,kBAAkB,CAAC,CAAC;AAC7D,OAAO,CAAC,MAAM,CAAC,yBAAyB,EAAE,2CAA2C,CAAC,CAAC;AACvF,OAAO,CAAC,MAAM,CAAC,6BAA6B,EAAE,kDAAkD,EAAE,kBAAkB,CAAC,CAAC;AACtH,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAE5B,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC;IAAE,OAAO,CAAC,IAAI,EAAE,CAAC;AAE9C,IAAI,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;IACrC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,8CAA8C,CAAC,CAAC,CAAC;IACvE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;CACjB;AAED,6CAA6C;AAC7C,OAAO,CAAC,GAAG,CAAC,kCAAkC,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC;AAEhE,wBAAwB;AACxB,MAAM,cAAc,GAAa,EAAE,CAAC;AACpC,IAAI,SAAS,KAAK,OAAO,CAAC,UAAU,EAAE;IACpC,KAAK,MAAM,GAAG,IAAI,OAAO,CAAC,UAAU,EAAE;QACpC,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QACpC,IAAI;YACF,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;SACxB;QAAC,OAAO,GAAQ,EAAE;YACjB,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;YAC3C,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,sBAAsB,OAAO,+BAA+B,CAAC,CAAC,CAAC;YACzF,SAAS;SACV;QAED,OAAO,CAAC,GAAG,CAAC,0BAA0B,OAAO,IAAI,CAAC,CAAC;QACnD,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;KAC9B;CACF;AAED,CAAC,KAAK,IAAI,EAAE;IACV,oCAAoC;IACpC,IAAI,YAAY,CAAC;IACjB,IAAI;QACF,MAAM,MAAM,GAAG,IAAI,sCAAqB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACzD,YAAY,GAAG,MAAM,MAAM,CAAC,iBAAiB,CAAC,IAAI,iCAAa,EAAE,EAAE,OAAO,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC;KACnG;IAAC,OAAO,GAAQ,EAAE;QACjB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,qBAAqB,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;QAC3D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;IAED,gBAAgB;IAChB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,YAAY,EAAE,CAAC,CAAC,CAAC;AAC9C,CAAC,CAAC,EAAE,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-console */\r\nimport * as path from \"path\";\r\nimport * as commander from \"commander\";\r\nimport * as chalk from \"chalk\";\r\nimport * as fs from \"fs-extra\";\r\n\r\nimport { ECSchemaToTsXmlWriter } from \"./ecschema2ts_io\";\r\nimport { SchemaContext } from \"@itwin/ecschema-metadata\";\r\n\r\nfunction commaSeparatedList(value: string): string[] {\r\n return value.split(\",\");\r\n}\r\n\r\n// Program options\r\nconst program = new commander.Command(\"ecschema2ts\");\r\nprogram.option(\"-i, --input <required>\", \"ECSchemaXml file\");\r\nprogram.option(\"-o, --output <required>\", \"Directory to put the out typescript file.\");\r\nprogram.option(\"-r, --references <optional>\", \"A comma-separated list of reference schema paths\", commaSeparatedList);\r\nprogram.parse(process.argv);\r\n\r\nif (process.argv.length === 0) program.help();\r\n\r\nif (!program.input || !program.output) {\r\n console.log(chalk.red(\"Invalid input. For help use the '-h' option.\"));\r\n process.exit(1);\r\n}\r\n\r\n// begin converting schema file to typescript\r\nconsole.log(`Creating a typescript file for ${program.input}.`);\r\n\r\n// check references path\r\nconst referencePaths: string[] = [];\r\nif (undefined !== program.references) {\r\n for (const ref of program.references) {\r\n const refPath = path.normalize(ref);\r\n try {\r\n fs.accessSync(refPath);\r\n } catch (err: any) {\r\n console.warn(chalk.yellow(err.toString()));\r\n console.warn(chalk.yellow(`The reference path ${refPath} does not exist. Skipping...`));\r\n continue;\r\n }\r\n\r\n console.log(`Adding reference path '${refPath}'.`);\r\n referencePaths.push(refPath);\r\n }\r\n}\r\n\r\n(async () => { // eslint-disable-line @typescript-eslint/no-floating-promises\r\n // convert schema file to typescript\r\n let createdFiles;\r\n try {\r\n const writer = new ECSchemaToTsXmlWriter(program.output);\r\n createdFiles = await writer.convertSchemaFile(new SchemaContext(), program.input, referencePaths);\r\n } catch (err: any) {\r\n console.log(chalk.red(`Failed to create: ${err.message}`));\r\n process.exit(1);\r\n }\r\n\r\n // output result\r\n console.log(chalk.green(`${createdFiles}`));\r\n})();\r\n"]}
1
+ {"version":3,"file":"ecschema2ts_cli.js","sourceRoot":"","sources":["../../src/ecschema2ts_cli.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;AAE/F,+BAA+B;AAC/B,6BAA6B;AAC7B,uCAAuC;AACvC,+BAA+B;AAC/B,+BAA+B;AAE/B,qDAAyD;AACzD,gEAAyD;AAEzD,SAAS,kBAAkB,CAAC,KAAa;IACvC,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAC1B,CAAC;AAED,kBAAkB;AAClB,MAAM,OAAO,GAAG,IAAI,SAAS,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;AACrD,OAAO,CAAC,MAAM,CAAC,wBAAwB,EAAE,kBAAkB,CAAC,CAAC;AAC7D,OAAO,CAAC,MAAM,CAAC,yBAAyB,EAAE,2CAA2C,CAAC,CAAC;AACvF,OAAO,CAAC,MAAM,CAAC,6BAA6B,EAAE,kDAAkD,EAAE,kBAAkB,CAAC,CAAC;AACtH,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAE5B,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC;IAC3B,OAAO,CAAC,IAAI,EAAE,CAAC;AAEjB,IAAI,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;IACrC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,8CAA8C,CAAC,CAAC,CAAC;IACvE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;CACjB;AAED,6CAA6C;AAC7C,OAAO,CAAC,GAAG,CAAC,kCAAkC,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC;AAEhE,wBAAwB;AACxB,MAAM,cAAc,GAAa,EAAE,CAAC;AACpC,IAAI,SAAS,KAAK,OAAO,CAAC,UAAU,EAAE;IACpC,KAAK,MAAM,GAAG,IAAI,OAAO,CAAC,UAAU,EAAE;QACpC,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QACpC,IAAI;YACF,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;SACxB;QAAC,OAAO,GAAQ,EAAE;YACjB,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;YAC3C,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,sBAAsB,OAAO,+BAA+B,CAAC,CAAC,CAAC;YACzF,SAAS;SACV;QAED,OAAO,CAAC,GAAG,CAAC,0BAA0B,OAAO,IAAI,CAAC,CAAC;QACnD,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;KAC9B;CACF;AAED,CAAC,KAAK,IAAI,EAAE;IACV,oCAAoC;IACpC,IAAI,YAAY,CAAC;IACjB,IAAI;QACF,MAAM,MAAM,GAAG,IAAI,sCAAqB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACzD,YAAY,GAAG,MAAM,MAAM,CAAC,iBAAiB,CAAC,IAAI,iCAAa,EAAE,EAAE,OAAO,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC;KACnG;IAAC,OAAO,GAAQ,EAAE;QACjB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,qBAAqB,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;QAC3D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;IAED,gBAAgB;IAChB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,YAAY,EAAE,CAAC,CAAC,CAAC;AAC9C,CAAC,CAAC,EAAE,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-console */\r\nimport * as path from \"path\";\r\nimport * as commander from \"commander\";\r\nimport * as chalk from \"chalk\";\r\nimport * as fs from \"fs-extra\";\r\n\r\nimport { ECSchemaToTsXmlWriter } from \"./ecschema2ts_io\";\r\nimport { SchemaContext } from \"@itwin/ecschema-metadata\";\r\n\r\nfunction commaSeparatedList(value: string): string[] {\r\n return value.split(\",\");\r\n}\r\n\r\n// Program options\r\nconst program = new commander.Command(\"ecschema2ts\");\r\nprogram.option(\"-i, --input <required>\", \"ECSchemaXml file\");\r\nprogram.option(\"-o, --output <required>\", \"Directory to put the out typescript file.\");\r\nprogram.option(\"-r, --references <optional>\", \"A comma-separated list of reference schema paths\", commaSeparatedList);\r\nprogram.parse(process.argv);\r\n\r\nif (process.argv.length === 0)\r\n program.help();\r\n\r\nif (!program.input || !program.output) {\r\n console.log(chalk.red(\"Invalid input. For help use the '-h' option.\"));\r\n process.exit(1);\r\n}\r\n\r\n// begin converting schema file to typescript\r\nconsole.log(`Creating a typescript file for ${program.input}.`);\r\n\r\n// check references path\r\nconst referencePaths: string[] = [];\r\nif (undefined !== program.references) {\r\n for (const ref of program.references) {\r\n const refPath = path.normalize(ref);\r\n try {\r\n fs.accessSync(refPath);\r\n } catch (err: any) {\r\n console.warn(chalk.yellow(err.toString()));\r\n console.warn(chalk.yellow(`The reference path ${refPath} does not exist. Skipping...`));\r\n continue;\r\n }\r\n\r\n console.log(`Adding reference path '${refPath}'.`);\r\n referencePaths.push(refPath);\r\n }\r\n}\r\n\r\n(async () => { // eslint-disable-line @typescript-eslint/no-floating-promises\r\n // convert schema file to typescript\r\n let createdFiles;\r\n try {\r\n const writer = new ECSchemaToTsXmlWriter(program.output);\r\n createdFiles = await writer.convertSchemaFile(new SchemaContext(), program.input, referencePaths);\r\n } catch (err: any) {\r\n console.log(chalk.red(`Failed to create: ${err.message}`));\r\n process.exit(1);\r\n }\r\n\r\n // output result\r\n console.log(chalk.green(`${createdFiles}`));\r\n})();\r\n"]}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@itwin/ecschema2ts",
3
3
  "description": "Command line tools that takes an ECSchema xml file and outputs a typescript module",
4
4
  "license": "MIT",
5
- "version": "3.4.0-dev.9",
5
+ "version": "3.5.0-dev.5",
6
6
  "bin": {
7
7
  "ecschema2ts": "./bin/index.js"
8
8
  },
@@ -23,13 +23,13 @@
23
23
  "url": "http://www.bentley.com"
24
24
  },
25
25
  "devDependencies": {
26
- "@itwin/build-tools": "3.4.0-dev.9",
27
- "@itwin/eslint-plugin": "3.4.0-dev.9",
26
+ "@itwin/build-tools": "3.5.0-dev.5",
27
+ "@itwin/eslint-plugin": "3.5.0-dev.5",
28
28
  "@types/chai": "4.3.1",
29
29
  "@types/chai-string": "^1.4.1",
30
30
  "@types/fs-extra": "^4.0.7",
31
31
  "@types/mocha": "^8.2.2",
32
- "@types/node": "16.11.7",
32
+ "@types/node": "16.11.59",
33
33
  "chai": "^4.1.2",
34
34
  "chai-string": "^1.5.0",
35
35
  "cpx2": "^3.0.0",
@@ -41,12 +41,12 @@
41
41
  "typescript": "~4.4.0"
42
42
  },
43
43
  "dependencies": {
44
- "@itwin/core-bentley": "3.4.0-dev.9",
45
- "@itwin/ecschema-locaters": "3.4.0-dev.9",
46
- "@itwin/ecschema-metadata": "3.4.0-dev.9",
47
- "@itwin/core-geometry": "3.4.0-dev.9",
48
- "@itwin/core-backend": "3.4.0-dev.9",
49
- "@itwin/core-common": "3.4.0-dev.9",
44
+ "@itwin/core-bentley": "3.5.0-dev.5",
45
+ "@itwin/ecschema-locaters": "3.5.0-dev.5",
46
+ "@itwin/ecschema-metadata": "3.5.0-dev.5",
47
+ "@itwin/core-geometry": "3.5.0-dev.5",
48
+ "@itwin/core-backend": "3.5.0-dev.5",
49
+ "@itwin/core-common": "3.5.0-dev.5",
50
50
  "@xmldom/xmldom": "^0.7.0",
51
51
  "chai-string": "^1.5.0",
52
52
  "chalk": "^3.0.0",