@devexpress/analytics-core-cli 23.2.1-alpha-23254-1700 → 23.2.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devexpress/analytics-core-cli",
3
- "version": "23.2.1-alpha-23254-1700",
3
+ "version": "23.2.3",
4
4
  "homepage": "https://www.devexpress.com/",
5
5
  "bugs": "https://www.devexpress.com/support/",
6
6
  "author": "Developer Express Inc.",
@@ -16,7 +16,7 @@
16
16
  "inquirer": "^8.0.0"
17
17
  },
18
18
  "peerDependencies": {
19
- "@devexpress/analytics-core": "23.2.1-alpha-23254-1700"
19
+ "@devexpress/analytics-core": "23.2.3"
20
20
  },
21
21
  "peerDependenciesMeta": {
22
22
  "@devexpress/analytics-core": {
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * DevExpress Analytics CLI (utils\_processBindings.js)
3
- * Version: 23.2.1-alpha-23254-1700
4
- * Build date: Sep 11, 2023
3
+ * Version: 23.2.3
4
+ * Build date: Dec 1, 2023
5
5
  * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED
6
6
  * License: https://www.devexpress.com/Support/EULAs/universal.xml
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * DevExpress Analytics CLI (utils\processBindings.js)
3
- * Version: 23.2.1-alpha-23254-1700
4
- * Build date: Sep 11, 2023
3
+ * Version: 23.2.3
4
+ * Build date: Dec 1, 2023
5
5
  * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED
6
6
  * License: https://www.devexpress.com/Support/EULAs/universal.xml
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * DevExpress Analytics CLI (utils\theme-builder.js)
3
- * Version: 23.2.1-alpha-23254-1700
4
- * Build date: Sep 11, 2023
3
+ * Version: 23.2.3
4
+ * Build date: Dec 1, 2023
5
5
  * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED
6
6
  * License: https://www.devexpress.com/Support/EULAs/universal.xml
7
7
  */
@@ -1,19 +1,18 @@
1
1
  /**
2
2
  * DevExpress Analytics CLI (utils\typeResolver.js)
3
- * Version: 23.2.1-alpha-23254-1700
4
- * Build date: Sep 11, 2023
3
+ * Version: 23.2.3
4
+ * Build date: Dec 1, 2023
5
5
  * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED
6
6
  * License: https://www.devexpress.com/Support/EULAs/universal.xml
7
7
  */
8
8
  const ts = require('typescript');
9
9
  const fs = require('fs');
10
10
 
11
-
12
- function resolveTypingsInFile(filePath) {
11
+ function resolveTypingsInFile(filePath, typeReplacements) {
13
12
  const compilerOptions = {};
14
13
  const compilerHost = ts.createCompilerHost(compilerOptions);
15
14
  const program = ts.createProgram([filePath], compilerOptions, compilerHost);
16
-
15
+
17
16
  const sourceFile = program.getSourceFile(filePath);
18
17
  const renameAllAddIdentifiersToRenamedAdd = (context) => (rootNode) => {
19
18
  const visit = (node) => {
@@ -22,6 +21,8 @@ function resolveTypingsInFile(filePath) {
22
21
  const imports = {};
23
22
  fillImports(node, imports);
24
23
  newNode = replaceTypes(node, imports, context);
24
+ if(typeReplacements)
25
+ newNode = processNodeRecoursive(newNode, typeReplacements, context);
25
26
  } else {
26
27
  newNode = ts.visitEachChild(node, visit, context);
27
28
  }
@@ -40,6 +41,39 @@ function resolveTypingsInFile(filePath) {
40
41
  fs.writeFileSync(filePath, updatedCode, 'utf-8');
41
42
  }
42
43
 
44
+ function processNodeRecoursive(node, typeReplacements, context) {
45
+ var typesToReplace = Object.keys(typeReplacements);
46
+ if(ts.isModuleDeclaration(node)) {
47
+ if(node.body && ts.isModuleBlock(node.body)) {
48
+ for(const statement of node.body.statements) {
49
+ const typeName = statement.name?.escapedText;
50
+ if(typeName && ts.isTypeAliasDeclaration(statement) && typesToReplace.indexOf(typeName) != -1) {
51
+ const newTypeString = typeReplacements[typeName];
52
+ const newTypeNode = ts.factory.createTypeReferenceNode(newTypeString, []);
53
+
54
+ //in case of some artifacts or side effects use createTypeAliasDeclaration from newTypeNode instead of updateTypeAliasDeclaration
55
+ const newPropStatement = ts.factory.updateTypeAliasDeclaration(
56
+ statement,
57
+ statement.decorators,
58
+ statement.modifiers,
59
+ statement.name,
60
+ statement.typeParameters,
61
+ newTypeNode
62
+ );
63
+
64
+ node.body = ts.factory.updateModuleBlock(node.body, [
65
+ ...node.body.statements.filter((x) => x !== statement),
66
+ newPropStatement,
67
+ ]);
68
+ }
69
+ }
70
+ } else {
71
+ node.body = processNodeRecoursive(node.body, typeReplacements, context);
72
+ }
73
+ }
74
+ return node;
75
+ }
76
+
43
77
  function fillImports(node, imports) {
44
78
  if(ts.isImportEqualsDeclaration(node)) {
45
79
  let name = node.name.escapedText;
@@ -81,5 +115,5 @@ function getFullTypeName(node) {
81
115
  }
82
116
 
83
117
  module.exports = {
84
- resolveTypingsInFile: resolveTypingsInFile
118
+ resolveTypingsInFile: resolveTypingsInFile
85
119
  }