@itwin/imodel-transformer 0.4.18-fedguidopt.6 → 1.0.1-dev.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/lib/cjs/Algo.d.ts.map +1 -1
- package/lib/cjs/Algo.js +3 -4
- package/lib/cjs/Algo.js.map +1 -1
- package/lib/cjs/BigMap.d.ts.map +1 -1
- package/lib/cjs/BigMap.js +1 -1
- package/lib/cjs/BigMap.js.map +1 -1
- package/lib/cjs/BranchProvenanceInitializer.d.ts.map +1 -1
- package/lib/cjs/BranchProvenanceInitializer.js +15 -4
- package/lib/cjs/BranchProvenanceInitializer.js.map +1 -1
- package/lib/cjs/DetachedExportElementAspectsStrategy.d.ts.map +1 -1
- package/lib/cjs/DetachedExportElementAspectsStrategy.js +12 -5
- package/lib/cjs/DetachedExportElementAspectsStrategy.js.map +1 -1
- package/lib/cjs/ECReferenceTypesCache.d.ts.map +1 -1
- package/lib/cjs/ECReferenceTypesCache.js +32 -18
- package/lib/cjs/ECReferenceTypesCache.js.map +1 -1
- package/lib/cjs/ECSqlReaderAsyncIterableIteratorAdapter.d.ts +1 -1
- package/lib/cjs/ECSqlReaderAsyncIterableIteratorAdapter.d.ts.map +1 -1
- package/lib/cjs/ECSqlReaderAsyncIterableIteratorAdapter.js +7 -5
- package/lib/cjs/ECSqlReaderAsyncIterableIteratorAdapter.js.map +1 -1
- package/lib/cjs/ElementCascadingDeleter.d.ts +3 -3
- package/lib/cjs/ElementCascadingDeleter.d.ts.map +1 -1
- package/lib/cjs/ElementCascadingDeleter.js +9 -7
- package/lib/cjs/ElementCascadingDeleter.js.map +1 -1
- package/lib/cjs/EntityMap.d.ts.map +1 -1
- package/lib/cjs/EntityMap.js.map +1 -1
- package/lib/cjs/EntityUnifier.d.ts +5 -0
- package/lib/cjs/EntityUnifier.d.ts.map +1 -1
- package/lib/cjs/EntityUnifier.js +22 -35
- package/lib/cjs/EntityUnifier.js.map +1 -1
- package/lib/cjs/ExportElementAspectsStrategy.d.ts.map +1 -1
- package/lib/cjs/ExportElementAspectsStrategy.js +5 -4
- package/lib/cjs/ExportElementAspectsStrategy.js.map +1 -1
- package/lib/cjs/ExportElementAspectsWithElementsStrategy.d.ts.map +1 -1
- package/lib/cjs/ExportElementAspectsWithElementsStrategy.js +9 -5
- package/lib/cjs/ExportElementAspectsWithElementsStrategy.js.map +1 -1
- package/lib/cjs/IModelCloneContext.d.ts.map +1 -1
- package/lib/cjs/IModelCloneContext.js +23 -12
- package/lib/cjs/IModelCloneContext.js.map +1 -1
- package/lib/cjs/IModelExporter.d.ts +68 -25
- package/lib/cjs/IModelExporter.d.ts.map +1 -1
- package/lib/cjs/IModelExporter.js +241 -123
- package/lib/cjs/IModelExporter.js.map +1 -1
- package/lib/cjs/IModelImporter.d.ts +13 -22
- package/lib/cjs/IModelImporter.d.ts.map +1 -1
- package/lib/cjs/IModelImporter.js +80 -62
- package/lib/cjs/IModelImporter.js.map +1 -1
- package/lib/cjs/IModelTransformer.d.ts +126 -44
- package/lib/cjs/IModelTransformer.d.ts.map +1 -1
- package/lib/cjs/IModelTransformer.js +706 -535
- package/lib/cjs/IModelTransformer.js.map +1 -1
- package/lib/cjs/PendingReferenceMap.d.ts.map +1 -1
- package/lib/cjs/PendingReferenceMap.js +12 -6
- package/lib/cjs/PendingReferenceMap.js.map +1 -1
- package/lib/cjs/TransformerLoggerCategory.d.ts +2 -2
- package/lib/cjs/TransformerLoggerCategory.d.ts.map +1 -1
- package/lib/cjs/TransformerLoggerCategory.js +5 -5
- package/lib/cjs/TransformerLoggerCategory.js.map +1 -1
- package/lib/cjs/transformer.d.ts.map +1 -1
- package/lib/cjs/transformer.js +14 -10
- package/lib/cjs/transformer.js.map +1 -1
- package/package.json +20 -17
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PendingReferenceMap.d.ts","sourceRoot":"","sources":["../../src/PendingReferenceMap.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,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,GAAG,EAAE,gBAAgB,GAAG,OAAO;IAQtC,GAAG,CAAC,GAAG,EAAE,gBAAgB,GAAG,CAAC,GAAG,SAAS;IAIzC,GAAG,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO;IAInC,GAAG,CAAC,GAAG,EAAE,gBAAgB,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI;IAYjD,IAAW,IAAI,IAAI,MAAM,CAExB;IAED,IAAW,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,MAAM,CAExC;CACF"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*---------------------------------------------------------------------------------------------
|
|
3
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
-
*--------------------------------------------------------------------------------------------*/
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
6
|
/** @packageDocumentation
|
|
7
7
|
* @module Utils
|
|
8
8
|
*/
|
|
@@ -53,7 +53,9 @@ class PendingReferenceMap {
|
|
|
53
53
|
return referencers;
|
|
54
54
|
}
|
|
55
55
|
/// Map implementation
|
|
56
|
-
clear() {
|
|
56
|
+
clear() {
|
|
57
|
+
this._map.clear();
|
|
58
|
+
}
|
|
57
59
|
delete(ref) {
|
|
58
60
|
const deleteResult = this._map.delete(PendingReference.toKey(ref));
|
|
59
61
|
const referencedKey = ref.referenced;
|
|
@@ -79,8 +81,12 @@ class PendingReferenceMap {
|
|
|
79
81
|
referencers.add(ref.referencer);
|
|
80
82
|
return this;
|
|
81
83
|
}
|
|
82
|
-
get size() {
|
|
83
|
-
|
|
84
|
+
get size() {
|
|
85
|
+
return this._map.size;
|
|
86
|
+
}
|
|
87
|
+
get [Symbol.toStringTag]() {
|
|
88
|
+
return "PendingReferenceMap";
|
|
89
|
+
}
|
|
84
90
|
}
|
|
85
91
|
exports.PendingReferenceMap = PendingReferenceMap;
|
|
86
92
|
//# sourceMappingURL=PendingReferenceMap.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PendingReferenceMap.js","sourceRoot":"","sources":["../../src/PendingReferenceMap.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"PendingReferenceMap.js","sourceRoot":"","sources":["../../src/PendingReferenceMap.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAGH,sDAAuE;AACvE,qCAAkC;AAClC,2CAAmD;AAWnD,IAAiB,gBAAgB,CAuBhC;AAvBD,WAAiB,gBAAgB;IAC/B,SAAgB,IAAI,CAClB,UAA4C,EAC5C,UAA4C;QAE5C,IAAI,OAAO,UAAU,KAAK,QAAQ;YAChC,UAAU,GAAG,+BAAgB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACjD,IAAI,OAAO,UAAU,KAAK,QAAQ;YAChC,UAAU,GAAG,+BAAgB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACjD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC;IACpC,CAAC;IATe,qBAAI,OASnB,CAAA;IAED,SAAgB,KAAK,CAAC,KAAuB;QAC3C,OAAO,GAAG,KAAK,CAAC,UAAU,OAAO,KAAK,CAAC,UAAU,EAAE,CAAC;IACtD,CAAC;IAFe,sBAAK,QAEpB,CAAA;IAED,SAAgB,OAAO,CAAC,GAAW;QACjC,MAAM,CAAC,UAAU,EAAE,UAAU,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,MAAM,CAGhD,CAAC;QACF,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC;IACpC,CAAC;IANe,wBAAO,UAMtB,CAAA;AACH,CAAC,EAvBgB,gBAAgB,gCAAhB,gBAAgB,QAuBhC;AAED;;;GAGG;AACH,MAAa,mBAAmB;IAAhC;QACU,SA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AAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;IACpD,CAAC;IAEM,GAAG,CAAC,GAAqB,EAAE,KAAQ;QACxC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;QAClD,MAAM,aAAa,GAAG,GAAG,CAAC,UAAU,CAAC;QACrC,IAAI,WAAW,GAAG,IAAI,CAAC,wBAAwB,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;QACxE,IAAI,WAAW,KAAK,SAAS,EAAE;YAC7B,WAAW,GAAG,IAAI,GAAG,EAAE,CAAC;YACxB,IAAI,CAAC,wBAAwB,CAAC,QAAQ,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;SACpE;QACD,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QAChC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;IACxB,CAAC;IAED,IAAW,CAAC,MAAM,CAAC,WAAW,CAAC;QAC7B,OAAO,qBAAqB,CAAC;IAC/B,CAAC;CACF;AA5DD,kDA4DC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Utils\n */\n\nimport { EntityReference } from \"@itwin/core-common\";\nimport { ConcreteEntity, EntityReferences } from \"@itwin/core-backend\";\nimport { BigMap } from \"./BigMap\";\nimport { EntityKey, EntityMap } from \"./EntityMap\";\n\n/**\n * A reference relationships from an element, \"referencer\", to an element or its submodel, \"referenced\"\n * @internal\n */\nexport interface PendingReference {\n referencer: EntityReference;\n referenced: EntityReference;\n}\n\nexport namespace PendingReference {\n export function from(\n referencer: ConcreteEntity | EntityReference,\n referenced: ConcreteEntity | EntityReference\n ): PendingReference {\n if (typeof referencer !== \"string\")\n referencer = EntityReferences.from(referencer);\n if (typeof referenced !== \"string\")\n referenced = EntityReferences.from(referenced);\n return { referencer, referenced };\n }\n\n export function toKey(props: PendingReference): string {\n return `${props.referencer}\\x00${props.referenced}`;\n }\n\n export function fromKey(key: string): PendingReference {\n const [referencer, referenced] = key.split(\"\\x00\") as [\n EntityReference,\n EntityReference,\n ];\n return { referencer, referenced };\n }\n}\n\n/**\n * a map that supports using PendingReferences objects as structural keys,\n * as well as getting a list of referencers from a referencee (called referenced)\n */\nexport class PendingReferenceMap<T> {\n private _map = new BigMap<T>();\n private _referencedToReferencers = new EntityMap<Set<EntityReference>>();\n\n public getReferencers(referenced: ConcreteEntity): Set<EntityReference> {\n const referencedKey = EntityMap.makeKey(referenced);\n return this.getReferencersByEntityKey(referencedKey);\n }\n\n public getReferencersByEntityKey(\n referenced: EntityKey\n ): Set<EntityReference> {\n let referencers = this._referencedToReferencers.getByKey(referenced);\n if (referencers === undefined) {\n referencers = new Set();\n this._referencedToReferencers.setByKey(referenced, referencers);\n }\n return referencers;\n }\n\n /// Map implementation\n public clear(): void {\n this._map.clear();\n }\n\n public delete(ref: PendingReference): boolean {\n const deleteResult = this._map.delete(PendingReference.toKey(ref));\n const referencedKey = ref.referenced;\n const referencers = this._referencedToReferencers.getByKey(referencedKey);\n if (referencers !== undefined) referencers.delete(ref.referencer);\n return deleteResult;\n }\n\n public get(ref: PendingReference): T | undefined {\n return this._map.get(PendingReference.toKey(ref));\n }\n\n public has(ref: PendingReference): boolean {\n return this._map.has(PendingReference.toKey(ref));\n }\n\n public set(ref: PendingReference, value: T): this {\n this._map.set(PendingReference.toKey(ref), value);\n const referencedKey = ref.referenced;\n let referencers = this._referencedToReferencers.getByKey(referencedKey);\n if (referencers === undefined) {\n referencers = new Set();\n this._referencedToReferencers.setByKey(referencedKey, referencers);\n }\n referencers.add(ref.referencer);\n return this;\n }\n\n public get size(): number {\n return this._map.size;\n }\n\n public get [Symbol.toStringTag](): string {\n return \"PendingReferenceMap\";\n }\n}\n"]}
|
|
@@ -20,8 +20,8 @@ export declare enum TransformerLoggerCategory {
|
|
|
20
20
|
*/
|
|
21
21
|
IModelTransformer = "core-backend.IModelTransformer",
|
|
22
22
|
/** The logger category used by the [IModelCloneContext]($transformer) class.
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
* @beta
|
|
24
|
+
*/
|
|
25
25
|
IModelCloneContext = "core-backend.IModelCloneContext"
|
|
26
26
|
}
|
|
27
27
|
//# sourceMappingURL=TransformerLoggerCategory.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransformerLoggerCategory.d.ts","sourceRoot":"","sources":["../../src/TransformerLoggerCategory.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH;;;;GAIG;AACH,oBAAY,yBAAyB;IACnC;;OAEG;IACH,cAAc,gCAAgC;IAE9C;;OAEG;IACH,cAAc,gCAAgC;IAE9C;;OAEG;IACH,iBAAiB,mCAAmC;IAEpD;;
|
|
1
|
+
{"version":3,"file":"TransformerLoggerCategory.d.ts","sourceRoot":"","sources":["../../src/TransformerLoggerCategory.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH;;;;GAIG;AACH,oBAAY,yBAAyB;IACnC;;OAEG;IACH,cAAc,gCAAgC;IAE9C;;OAEG;IACH,cAAc,gCAAgC;IAE9C;;OAEG;IACH,iBAAiB,mCAAmC;IAEpD;;OAEG;IACH,kBAAkB,oCAAoC;CACvD"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*---------------------------------------------------------------------------------------------
|
|
3
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
-
*--------------------------------------------------------------------------------------------*/
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
6
|
/** @packageDocumentation
|
|
7
7
|
* @module Logging
|
|
8
8
|
*/
|
|
@@ -28,8 +28,8 @@ var TransformerLoggerCategory;
|
|
|
28
28
|
*/
|
|
29
29
|
TransformerLoggerCategory["IModelTransformer"] = "core-backend.IModelTransformer";
|
|
30
30
|
/** The logger category used by the [IModelCloneContext]($transformer) class.
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
* @beta
|
|
32
|
+
*/
|
|
33
33
|
TransformerLoggerCategory["IModelCloneContext"] = "core-backend.IModelCloneContext";
|
|
34
34
|
})(TransformerLoggerCategory || (exports.TransformerLoggerCategory = TransformerLoggerCategory = {}));
|
|
35
35
|
//# sourceMappingURL=TransformerLoggerCategory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransformerLoggerCategory.js","sourceRoot":"","sources":["../../src/TransformerLoggerCategory.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"TransformerLoggerCategory.js","sourceRoot":"","sources":["../../src/TransformerLoggerCategory.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH;;;;GAIG;AACH,IAAY,yBAoBX;AApBD,WAAY,yBAAyB;IACnC;;OAEG;IACH,2EAA8C,CAAA;IAE9C;;OAEG;IACH,2EAA8C,CAAA;IAE9C;;OAEG;IACH,iFAAoD,CAAA;IAEpD;;OAEG;IACH,mFAAsD,CAAA;AACxD,CAAC,EApBW,yBAAyB,yCAAzB,yBAAyB,QAoBpC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Logging\n */\n\n/** Logger categories used by this package\n * @note All logger categories in this package start with the `core-backend` prefix.\n * @see [Logger]($bentley)\n * @public\n */\nexport enum TransformerLoggerCategory {\n /** The logger category used by the [IModelExporter]($transformer) class.\n * @beta\n */\n IModelExporter = \"core-backend.IModelExporter\",\n\n /** The logger category used by the [IModelImporter]($transformer) class.\n * @beta\n */\n IModelImporter = \"core-backend.IModelImporter\",\n\n /** The logger category used by the [IModelTransformer]($transformer) class.\n * @beta\n */\n IModelTransformer = \"core-backend.IModelTransformer\",\n\n /** The logger category used by the [IModelCloneContext]($transformer) class.\n * @beta\n */\n IModelCloneContext = \"core-backend.IModelCloneContext\",\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformer.d.ts","sourceRoot":"","sources":["../../src/transformer.ts"],"names":[],"mappings":"AAIA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"transformer.d.ts","sourceRoot":"","sources":["../../src/transformer.ts"],"names":[],"mappings":"AAIA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,+BAA+B,CAAC;AAiF9C;;;;;;GAMG;AACH;;;;GAIG;AACH;;;GAGG;AACH;;;GAGG"}
|
package/lib/cjs/transformer.js
CHANGED
|
@@ -15,9 +15,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
/*---------------------------------------------------------------------------------------------
|
|
18
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
19
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
20
|
-
*--------------------------------------------------------------------------------------------*/
|
|
18
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
19
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
20
|
+
*--------------------------------------------------------------------------------------------*/
|
|
21
21
|
__exportStar(require("./TransformerLoggerCategory"), exports);
|
|
22
22
|
__exportStar(require("./IModelExporter"), exports);
|
|
23
23
|
__exportStar(require("./IModelImporter"), exports);
|
|
@@ -27,21 +27,25 @@ const semver = require("semver");
|
|
|
27
27
|
const package_json_1 = require("@itwin/core-backend/package.json");
|
|
28
28
|
// must use an untyped require to not hoist src into lib/cjs, also the compiled output will be in 'lib/cjs', not 'src' so use `../..` to reach package.json
|
|
29
29
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
30
|
-
const { version: ourVersion, name: ourName, peerDependencies } = require("../../package.json");
|
|
30
|
+
const { version: ourVersion, name: ourName, peerDependencies, } = require("../../package.json");
|
|
31
31
|
const ourITwinCoreBackendDepRange = peerDependencies["@itwin/core-backend"];
|
|
32
32
|
const noStrictDepCheckEnvVar = "TRANSFORMER_NO_STRICT_DEP_CHECK";
|
|
33
33
|
const suggestEnvVarName = "SUGGEST_TRANSFORMER_VERSIONS";
|
|
34
|
-
if (process.env[noStrictDepCheckEnvVar] !== "1" &&
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
if (process.env[noStrictDepCheckEnvVar] !== "1" &&
|
|
35
|
+
!semver.satisfies(package_json_1.version, ourITwinCoreBackendDepRange)) {
|
|
36
|
+
const errHeader = `${ourName}@${ourVersion} only supports @itwin/core-backend@${ourITwinCoreBackendDepRange}, ` +
|
|
37
|
+
`but @itwin/core-backend${package_json_1.version} was resolved when looking for the peer dependency.\n` +
|
|
38
|
+
`If you know exactly what you are doing, you can disable this check by setting ${noStrictDepCheckEnvVar}=1 in the environment\n`;
|
|
38
39
|
if (process.env[suggestEnvVarName]) {
|
|
39
40
|
// let's not import https except in this case
|
|
40
41
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
41
42
|
const https = require("https");
|
|
42
43
|
https.get(`https://registry.npmjs.org/${ourName}`, async (resp) => {
|
|
43
44
|
const chunks = [];
|
|
44
|
-
const packumentSrc = await new Promise((r) => resp
|
|
45
|
+
const packumentSrc = await new Promise((r) => resp
|
|
46
|
+
.setEncoding("utf8")
|
|
47
|
+
.on("data", (d) => chunks.push(d))
|
|
48
|
+
.on("end", () => r(chunks.join(""))));
|
|
45
49
|
const packumentJson = JSON.parse(packumentSrc);
|
|
46
50
|
const isTaglessVersion = (version) => version.includes("-");
|
|
47
51
|
const latestFirstApplicableVersions = Object.entries(packumentJson.versions)
|
|
@@ -52,7 +56,7 @@ if (process.env[noStrictDepCheckEnvVar] !== "1" && !semver.satisfies(package_jso
|
|
|
52
56
|
throw Error([
|
|
53
57
|
errHeader,
|
|
54
58
|
`You have ${suggestEnvVarName}=1 set in the environment, so we suggest one of the following versions.`,
|
|
55
|
-
|
|
59
|
+
"Be aware that older versions may be missing bug fixes.",
|
|
56
60
|
...latestFirstApplicableVersions,
|
|
57
61
|
].join("\n"));
|
|
58
62
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformer.js","sourceRoot":"","sources":["../../src/transformer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA
|
|
1
|
+
{"version":3,"file":"transformer.js","sourceRoot":"","sources":["../../src/transformer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG,8DAA4C;AAC5C,mDAAiC;AACjC,mDAAiC;AACjC,sDAAoC;AACpC,gEAA8C;AAE9C,iCAAiC;AACjC,mEAAsF;AAEtF,2JAA2J;AAC3J,8DAA8D;AAC9D,MAAM,EACJ,OAAO,EAAE,UAAU,EACnB,IAAI,EAAE,OAAO,EACb,gBAAgB,GACjB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAElC,MAAM,2BAA2B,GAAG,gBAAgB,CAAC,qBAAqB,CAAC,CAAC;AAE5E,MAAM,sBAAsB,GAAG,iCAAiC,CAAC;AACjE,MAAM,iBAAiB,GAAG,8BAA8B,CAAC;AAEzD,IACE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AgB,EAAE,CAAC,qBAAqB,CAAC,IAAI,EAAE,CAClD,CACF;iBACA,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;iBACf,MAAM,CAAC,gBAAgB,CAAC;iBACxB,OAAO,EAAE,CAAC;YAEb,MAAM,KAAK,CACT;gBACE,SAAS;gBACT,YAAY,iBAAiB,yEAAyE;gBACtG,wDAAwD;gBACxD,GAAG,6BAA6B;aACjC,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;QACJ,CAAC,CAAC,CAAC;KACJ;SAAM;QACL,MAAM,KAAK,CACT,GAAG,SAAS,+CAA+C,iBAAiB,yCAAyC,CACtH,CAAC;KACH;CACF;AAED;;;;;;GAMG;AACH;;;;GAIG;AACH;;;GAGG;AACH;;;GAGG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nexport * from \"./TransformerLoggerCategory\";\nexport * from \"./IModelExporter\";\nexport * from \"./IModelImporter\";\nexport * from \"./IModelTransformer\";\nexport * from \"./BranchProvenanceInitializer\";\n\nimport * as semver from \"semver\";\nimport { version as iTwinCoreBackendVersion } from \"@itwin/core-backend/package.json\";\n\n// must use an untyped require to not hoist src into lib/cjs, also the compiled output will be in 'lib/cjs', not 'src' so use `../..` to reach package.json\n// eslint-disable-next-line @typescript-eslint/no-var-requires\nconst {\n version: ourVersion,\n name: ourName,\n peerDependencies,\n} = require(\"../../package.json\");\n\nconst ourITwinCoreBackendDepRange = peerDependencies[\"@itwin/core-backend\"];\n\nconst noStrictDepCheckEnvVar = \"TRANSFORMER_NO_STRICT_DEP_CHECK\";\nconst suggestEnvVarName = \"SUGGEST_TRANSFORMER_VERSIONS\";\n\nif (\n process.env[noStrictDepCheckEnvVar] !== \"1\" &&\n !semver.satisfies(iTwinCoreBackendVersion, ourITwinCoreBackendDepRange)\n) {\n const errHeader =\n `${ourName}@${ourVersion} only supports @itwin/core-backend@${ourITwinCoreBackendDepRange}, ` +\n `but @itwin/core-backend${iTwinCoreBackendVersion} was resolved when looking for the peer dependency.\\n` +\n `If you know exactly what you are doing, you can disable this check by setting ${noStrictDepCheckEnvVar}=1 in the environment\\n`;\n\n if (process.env[suggestEnvVarName]) {\n // let's not import https except in this case\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const https = require(\"https\") as typeof import(\"https\");\n https.get(`https://registry.npmjs.org/${ourName}`, async (resp) => {\n const chunks: string[] = [];\n const packumentSrc = await new Promise<string>((r) =>\n resp\n .setEncoding(\"utf8\")\n .on(\"data\", (d) => chunks.push(d))\n .on(\"end\", () => r(chunks.join(\"\")))\n );\n interface PackumentSubset {\n versions: Record<\n string,\n {\n peerDependencies?: {\n \"@itwin/core-backend\": string; // eslint-disable-line @typescript-eslint/naming-convention\n };\n }\n >;\n }\n\n const packumentJson = JSON.parse(packumentSrc) as PackumentSubset;\n const isTaglessVersion = (version: string) => version.includes(\"-\");\n const latestFirstApplicableVersions = Object.entries(\n packumentJson.versions\n )\n .filter(([, v]) =>\n semver.satisfies(\n iTwinCoreBackendVersion,\n v.peerDependencies?.[\"@itwin/core-backend\"] ?? \"\"\n )\n )\n .map(([k]) => k)\n .filter(isTaglessVersion)\n .reverse();\n\n throw Error(\n [\n errHeader,\n `You have ${suggestEnvVarName}=1 set in the environment, so we suggest one of the following versions.`,\n \"Be aware that older versions may be missing bug fixes.\",\n ...latestFirstApplicableVersions,\n ].join(\"\\n\")\n );\n });\n } else {\n throw Error(\n `${errHeader}You can rerun with the environment variable ${suggestEnvVarName}=1 to have this error suggest a version`\n );\n }\n}\n\n/** @docs-package-description\n * The @itwin/imodel-transformer package contains classes that [backend code]($docs/learning/backend/index.md) can use to\n * traverse iModels, as well as *transform* an iModel into another existing or empty one, by exporting elements from one during\n * traversal and importing them into another.\n *\n * You can read further in [iModelTransformation and Data Exchange]($docs/learning/transformer/index.md) here.\n */\n/**\n * @docs-group-description iModels\n * Classes for working with [iModels]($docs/learning/iModels.md).\n * See [the learning article]($docs/learning/backend/index.md).\n */\n/**\n * @docs-group-description Utils\n * Miscellaneous utility classes.\n */\n/**\n * @docs-group-description Logging\n * Logger categories used by this package.\n */\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/imodel-transformer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.1-dev.0",
|
|
4
4
|
"description": "API for exporting an iModel's parts and also importing them into another iModel",
|
|
5
5
|
"main": "lib/cjs/transformer.js",
|
|
6
6
|
"typings": "lib/cjs/transformer",
|
|
@@ -24,8 +24,9 @@
|
|
|
24
24
|
"lint": "eslint -f visualstudio --quiet \"./src/**/*.ts\" 1>&2",
|
|
25
25
|
"lint:no-tests": "eslint -f visualstudio --quiet \"./src/*.ts\" 1>&2",
|
|
26
26
|
"lint:fix": "eslint --fix -f visualstudio --quiet \"./src/**/*.ts\" 1>&2",
|
|
27
|
+
"format": "prettier \"./src/**/*.ts\" --write",
|
|
27
28
|
"lint:with-warnings": "eslint -f visualstudio \"./src/**/*.ts\" 1>&2",
|
|
28
|
-
"test": "mocha \"lib/cjs/test/**/*.test.js\" --timeout
|
|
29
|
+
"test": "mocha \"lib/cjs/test/**/*.test.js\" --timeout 0 --reporter-option maxDiffSize=0 --require source-map-support/register",
|
|
29
30
|
"no-internal-report": "no-internal-report src/**/*.ts"
|
|
30
31
|
},
|
|
31
32
|
"repository": {
|
|
@@ -53,26 +54,26 @@
|
|
|
53
54
|
"You can find a script to see the latest @itwin/imodel-transformer version for your iTwin.js version in the README"
|
|
54
55
|
],
|
|
55
56
|
"peerDependencies": {
|
|
56
|
-
"@itwin/core-backend": "^
|
|
57
|
-
"@itwin/core-bentley": "^
|
|
58
|
-
"@itwin/core-common": "^
|
|
59
|
-
"@itwin/core-geometry": "^
|
|
60
|
-
"@itwin/core-quantity": "^
|
|
61
|
-
"@itwin/ecschema-metadata": "^
|
|
57
|
+
"@itwin/core-backend": "^4.3.3",
|
|
58
|
+
"@itwin/core-bentley": "^4.3.3",
|
|
59
|
+
"@itwin/core-common": "^4.3.3",
|
|
60
|
+
"@itwin/core-geometry": "^4.3.3",
|
|
61
|
+
"@itwin/core-quantity": "^4.3.3",
|
|
62
|
+
"@itwin/ecschema-metadata": "^4.3.3"
|
|
62
63
|
},
|
|
63
64
|
"//devDependencies": [
|
|
64
65
|
"NOTE: All peerDependencies should also be listed as devDependencies since peerDependencies are not considered by npm install",
|
|
65
66
|
"NOTE: All tools used by scripts in this package must be listed as devDependencies"
|
|
66
67
|
],
|
|
67
68
|
"devDependencies": {
|
|
68
|
-
"@itwin/build-tools": "4.
|
|
69
|
-
"@itwin/core-backend": "^
|
|
70
|
-
"@itwin/core-bentley": "^
|
|
71
|
-
"@itwin/core-common": "^
|
|
72
|
-
"@itwin/core-geometry": "^
|
|
73
|
-
"@itwin/core-quantity": "^
|
|
74
|
-
"@itwin/ecschema-metadata": "^
|
|
75
|
-
"@itwin/eslint-plugin": "
|
|
69
|
+
"@itwin/build-tools": "^4.3.3",
|
|
70
|
+
"@itwin/core-backend": "^4.3.3",
|
|
71
|
+
"@itwin/core-bentley": "^4.3.3",
|
|
72
|
+
"@itwin/core-common": "^4.3.3",
|
|
73
|
+
"@itwin/core-geometry": "^4.3.3",
|
|
74
|
+
"@itwin/core-quantity": "^4.3.3",
|
|
75
|
+
"@itwin/ecschema-metadata": "^4.3.3",
|
|
76
|
+
"@itwin/eslint-plugin": "4.0.0-dev.48",
|
|
76
77
|
"@types/chai": "4.3.1",
|
|
77
78
|
"@types/chai-as-promised": "^7.1.5",
|
|
78
79
|
"@types/mocha": "^8.2.3",
|
|
@@ -83,7 +84,9 @@
|
|
|
83
84
|
"chai-as-promised": "^7.1.1",
|
|
84
85
|
"cpx2": "^3.0.2",
|
|
85
86
|
"cross-env": "^5.2.1",
|
|
86
|
-
"eslint": "^
|
|
87
|
+
"eslint": "^8.36.0",
|
|
88
|
+
"eslint-config-prettier": "^9.1.0",
|
|
89
|
+
"prettier": "^3.1.1",
|
|
87
90
|
"js-base64": "^3.7.5",
|
|
88
91
|
"mocha": "^10.2.0",
|
|
89
92
|
"npm-run-all": "^4.1.5",
|