@o3r/schematics 9.1.0-alpha.22 → 9.1.0-alpha.23

Sign up to get free protection for your applications and to get access to all the features.
Files changed (207) hide show
  1. package/package.json +5 -5
  2. package/src/utility/index.d.ts +1 -0
  3. package/src/utility/index.d.ts.map +1 -1
  4. package/src/utility/index.js +1 -0
  5. package/src/utility/index.js.map +1 -1
  6. package/src/utility/logo.d.ts +5 -0
  7. package/src/utility/logo.d.ts.map +1 -0
  8. package/src/utility/logo.js +51 -0
  9. package/src/utility/logo.js.map +1 -0
  10. package/index.d.ts +0 -7
  11. package/index.d.ts.map +0 -1
  12. package/index.js +0 -10
  13. package/index.js.map +0 -1
  14. package/interfaces/angular-workspace.d.ts +0 -62
  15. package/interfaces/angular-workspace.d.ts.map +0 -1
  16. package/interfaces/angular-workspace.js +0 -3
  17. package/interfaces/angular-workspace.js.map +0 -1
  18. package/interfaces/index.d.ts +0 -3
  19. package/interfaces/index.d.ts.map +0 -1
  20. package/interfaces/index.js +0 -6
  21. package/interfaces/index.js.map +0 -1
  22. package/interfaces/schematic-option.d.ts +0 -5
  23. package/interfaces/schematic-option.d.ts.map +0 -1
  24. package/interfaces/schematic-option.js +0 -3
  25. package/interfaces/schematic-option.js.map +0 -1
  26. package/modules/index.d.ts +0 -3
  27. package/modules/index.d.ts.map +0 -1
  28. package/modules/index.js +0 -6
  29. package/modules/index.js.map +0 -1
  30. package/modules/modules.constants.d.ts +0 -34
  31. package/modules/modules.constants.d.ts.map +0 -1
  32. package/modules/modules.constants.js +0 -12
  33. package/modules/modules.constants.js.map +0 -1
  34. package/modules/modules.helpers.d.ts +0 -60
  35. package/modules/modules.helpers.d.ts.map +0 -1
  36. package/modules/modules.helpers.js +0 -165
  37. package/modules/modules.helpers.js.map +0 -1
  38. package/public_api.d.ts +0 -2
  39. package/public_api.d.ts.map +0 -1
  40. package/public_api.js +0 -5
  41. package/public_api.js.map +0 -1
  42. package/rule-factories/add-imports/index.d.ts +0 -12
  43. package/rule-factories/add-imports/index.d.ts.map +0 -1
  44. package/rule-factories/add-imports/index.js +0 -26
  45. package/rule-factories/add-imports/index.js.map +0 -1
  46. package/rule-factories/check-packages-peers/index.d.ts +0 -8
  47. package/rule-factories/check-packages-peers/index.d.ts.map +0 -1
  48. package/rule-factories/check-packages-peers/index.js +0 -106
  49. package/rule-factories/check-packages-peers/index.js.map +0 -1
  50. package/rule-factories/eslint-fix/index.d.ts +0 -28
  51. package/rule-factories/eslint-fix/index.d.ts.map +0 -1
  52. package/rule-factories/eslint-fix/index.js +0 -71
  53. package/rule-factories/eslint-fix/index.js.map +0 -1
  54. package/rule-factories/index.d.ts +0 -9
  55. package/rule-factories/index.d.ts.map +0 -1
  56. package/rule-factories/index.js +0 -12
  57. package/rule-factories/index.js.map +0 -1
  58. package/rule-factories/interfaces.d.ts +0 -6
  59. package/rule-factories/interfaces.d.ts.map +0 -1
  60. package/rule-factories/interfaces.js +0 -3
  61. package/rule-factories/interfaces.js.map +0 -1
  62. package/rule-factories/ng-add/index.d.ts +0 -38
  63. package/rule-factories/ng-add/index.d.ts.map +0 -1
  64. package/rule-factories/ng-add/index.js +0 -174
  65. package/rule-factories/ng-add/index.js.map +0 -1
  66. package/rule-factories/remove-packages/index.d.ts +0 -9
  67. package/rule-factories/remove-packages/index.d.ts.map +0 -1
  68. package/rule-factories/remove-packages/index.js +0 -29
  69. package/rule-factories/remove-packages/index.js.map +0 -1
  70. package/rule-factories/update-imports/index.d.ts +0 -5
  71. package/rule-factories/update-imports/index.d.ts.map +0 -1
  72. package/rule-factories/update-imports/index.js +0 -8
  73. package/rule-factories/update-imports/index.js.map +0 -1
  74. package/rule-factories/update-imports/list-of-vars.d.ts +0 -15
  75. package/rule-factories/update-imports/list-of-vars.d.ts.map +0 -1
  76. package/rule-factories/update-imports/list-of-vars.js +0 -44
  77. package/rule-factories/update-imports/list-of-vars.js.map +0 -1
  78. package/rule-factories/update-imports/update-imports-with-scope.d.ts +0 -12
  79. package/rule-factories/update-imports/update-imports-with-scope.d.ts.map +0 -1
  80. package/rule-factories/update-imports/update-imports-with-scope.js +0 -34
  81. package/rule-factories/update-imports/update-imports-with-scope.js.map +0 -1
  82. package/rule-factories/update-imports/update-ts-imports.d.ts +0 -11
  83. package/rule-factories/update-imports/update-ts-imports.d.ts.map +0 -1
  84. package/rule-factories/update-imports/update-ts-imports.js +0 -32
  85. package/rule-factories/update-imports/update-ts-imports.js.map +0 -1
  86. package/rule-factories/update-imports/v7-to-v8-map-object.d.ts +0 -8
  87. package/rule-factories/update-imports/v7-to-v8-map-object.d.ts.map +0 -1
  88. package/rule-factories/update-imports/v7-to-v8-map-object.js +0 -2049
  89. package/rule-factories/update-imports/v7-to-v8-map-object.js.map +0 -1
  90. package/rule-factories/vscode-extensions/index.d.ts +0 -8
  91. package/rule-factories/vscode-extensions/index.d.ts.map +0 -1
  92. package/rule-factories/vscode-extensions/index.js +0 -26
  93. package/rule-factories/vscode-extensions/index.js.map +0 -1
  94. package/rules/index.d.ts +0 -2
  95. package/rules/index.d.ts.map +0 -1
  96. package/rules/index.js +0 -5
  97. package/rules/index.js.map +0 -1
  98. package/rules/install.d.ts +0 -9
  99. package/rules/install.d.ts.map +0 -1
  100. package/rules/install.js +0 -21
  101. package/rules/install.js.map +0 -1
  102. package/schematics/ng-add/index.js.map +0 -1
  103. package/schematics/ng-add/schema.js.map +0 -1
  104. package/tasks/eslint/index.d.ts +0 -10
  105. package/tasks/eslint/index.d.ts.map +0 -1
  106. package/tasks/eslint/index.js +0 -29
  107. package/tasks/eslint/index.js.map +0 -1
  108. package/tasks/index.d.ts +0 -5
  109. package/tasks/index.d.ts.map +0 -1
  110. package/tasks/index.js +0 -8
  111. package/tasks/index.js.map +0 -1
  112. package/tasks/link/index.d.ts +0 -10
  113. package/tasks/link/index.d.ts.map +0 -1
  114. package/tasks/link/index.js +0 -26
  115. package/tasks/link/index.js.map +0 -1
  116. package/tasks/ng-add/index.d.ts +0 -30
  117. package/tasks/ng-add/index.d.ts.map +0 -1
  118. package/tasks/ng-add/index.js +0 -30
  119. package/tasks/ng-add/index.js.map +0 -1
  120. package/tasks/package-manager/add-dev-dependency.d.ts +0 -24
  121. package/tasks/package-manager/add-dev-dependency.d.ts.map +0 -1
  122. package/tasks/package-manager/add-dev-dependency.js +0 -34
  123. package/tasks/package-manager/add-dev-dependency.js.map +0 -1
  124. package/tasks/package-manager/index.d.ts +0 -4
  125. package/tasks/package-manager/index.d.ts.map +0 -1
  126. package/tasks/package-manager/index.js +0 -7
  127. package/tasks/package-manager/index.js.map +0 -1
  128. package/tasks/package-manager/interfaces.d.ts +0 -14
  129. package/tasks/package-manager/interfaces.d.ts.map +0 -1
  130. package/tasks/package-manager/interfaces.js +0 -3
  131. package/tasks/package-manager/interfaces.js.map +0 -1
  132. package/tasks/package-manager/npm-install.d.ts +0 -24
  133. package/tasks/package-manager/npm-install.d.ts.map +0 -1
  134. package/tasks/package-manager/npm-install.js +0 -35
  135. package/tasks/package-manager/npm-install.js.map +0 -1
  136. package/utility/ast.d.ts +0 -142
  137. package/utility/ast.d.ts.map +0 -1
  138. package/utility/ast.js +0 -325
  139. package/utility/ast.js.map +0 -1
  140. package/utility/collection.d.ts +0 -10
  141. package/utility/collection.d.ts.map +0 -1
  142. package/utility/collection.js +0 -20
  143. package/utility/collection.js.map +0 -1
  144. package/utility/component.d.ts +0 -46
  145. package/utility/component.d.ts.map +0 -1
  146. package/utility/component.js +0 -104
  147. package/utility/component.js.map +0 -1
  148. package/utility/dependencies.d.ts +0 -18
  149. package/utility/dependencies.d.ts.map +0 -1
  150. package/utility/dependencies.js +0 -31
  151. package/utility/dependencies.js.map +0 -1
  152. package/utility/file-info.d.ts +0 -23
  153. package/utility/file-info.d.ts.map +0 -1
  154. package/utility/file-info.js +0 -36
  155. package/utility/file-info.js.map +0 -1
  156. package/utility/generation.d.ts +0 -22
  157. package/utility/generation.d.ts.map +0 -1
  158. package/utility/generation.js +0 -67
  159. package/utility/generation.js.map +0 -1
  160. package/utility/gitignore.d.ts +0 -12
  161. package/utility/gitignore.d.ts.map +0 -1
  162. package/utility/gitignore.js +0 -28
  163. package/utility/gitignore.js.map +0 -1
  164. package/utility/index.d.ts +0 -18
  165. package/utility/index.d.ts.map +0 -1
  166. package/utility/index.js +0 -21
  167. package/utility/index.js.map +0 -1
  168. package/utility/loaders.d.ts +0 -122
  169. package/utility/loaders.d.ts.map +0 -1
  170. package/utility/loaders.js +0 -222
  171. package/utility/loaders.js.map +0 -1
  172. package/utility/matching-peers.d.ts +0 -24
  173. package/utility/matching-peers.d.ts.map +0 -1
  174. package/utility/matching-peers.js +0 -41
  175. package/utility/matching-peers.js.map +0 -1
  176. package/utility/modules.d.ts +0 -73
  177. package/utility/modules.d.ts.map +0 -1
  178. package/utility/modules.js +0 -201
  179. package/utility/modules.js.map +0 -1
  180. package/utility/monorepo.d.ts +0 -17
  181. package/utility/monorepo.d.ts.map +0 -1
  182. package/utility/monorepo.js +0 -30
  183. package/utility/monorepo.js.map +0 -1
  184. package/utility/package-manager-runner.d.ts +0 -43
  185. package/utility/package-manager-runner.d.ts.map +0 -1
  186. package/utility/package-manager-runner.js +0 -61
  187. package/utility/package-manager-runner.js.map +0 -1
  188. package/utility/package-version.d.ts +0 -17
  189. package/utility/package-version.d.ts.map +0 -1
  190. package/utility/package-version.js +0 -34
  191. package/utility/package-version.js.map +0 -1
  192. package/utility/routes.d.ts +0 -40
  193. package/utility/routes.d.ts.map +0 -1
  194. package/utility/routes.js +0 -103
  195. package/utility/routes.js.map +0 -1
  196. package/utility/sub-entry.d.ts +0 -18
  197. package/utility/sub-entry.d.ts.map +0 -1
  198. package/utility/sub-entry.js +0 -51
  199. package/utility/sub-entry.js.map +0 -1
  200. package/utility/template-property.helper.d.ts +0 -101
  201. package/utility/template-property.helper.d.ts.map +0 -1
  202. package/utility/template-property.helper.js +0 -175
  203. package/utility/template-property.helper.js.map +0 -1
  204. package/utility/update-imports.d.ts +0 -25
  205. package/utility/update-imports.d.ts.map +0 -1
  206. package/utility/update-imports.js +0 -86
  207. package/utility/update-imports.js.map +0 -1
@@ -1,175 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getLibraryNameFromPath = exports.getComponentConfigKey = exports.getComponentFixtureName = exports.getComponentContextName = exports.getComponentTranslationName = exports.getComponentConfigName = exports.getKebabCaseBlockName = exports.getComponentBlockName = exports.getComponentName = exports.getComponentAnalyticsName = exports.getComponentModuleName = exports.getComponentSelectorWithoutSuffix = exports.getComponentFileName = exports.getComponentFolderName = exports.getInputComponentName = void 0;
4
- const core_1 = require("@angular-devkit/core");
5
- /**
6
- * Returns all elements from the provided component name path
7
- *
8
- * @param componentName
9
- */
10
- function getComponentModuleItems(componentName) {
11
- return (componentName || '').split('\\/');
12
- }
13
- /**
14
- * Returns the component name as the last element of the provided component name path
15
- *
16
- * @param componentName
17
- */
18
- function getInputComponentName(componentName) {
19
- const componentModuleItems = getComponentModuleItems(componentName);
20
- return componentModuleItems[componentModuleItems.length - 1];
21
- }
22
- exports.getInputComponentName = getInputComponentName;
23
- /**
24
- * returns the component folder name
25
- *
26
- * @param componentName
27
- */
28
- function getComponentFolderName(componentName) {
29
- const inputComponentName = getInputComponentName(componentName);
30
- return core_1.strings.dasherize(inputComponentName).replace(/\s/g, '');
31
- }
32
- exports.getComponentFolderName = getComponentFolderName;
33
- /**
34
- * Returns the component file name
35
- *
36
- * @param componentName
37
- * @param componentStructureDef
38
- */
39
- function getComponentFileName(componentName, componentStructureDef) {
40
- const componentFolderName = getComponentFolderName(componentName);
41
- return componentStructureDef ? `${componentFolderName}-${core_1.strings.camelize(componentStructureDef)}` : componentFolderName;
42
- }
43
- exports.getComponentFileName = getComponentFileName;
44
- /**
45
- * Returns the component selector without suffix
46
- *
47
- * @param componentName
48
- * @param prefix
49
- */
50
- function getComponentSelectorWithoutSuffix(componentName, prefix) {
51
- const selector = getComponentFolderName(componentName);
52
- return prefix ? `${prefix.toLowerCase()}-${selector}` : selector; // o3r-air-offer : air-offer
53
- }
54
- exports.getComponentSelectorWithoutSuffix = getComponentSelectorWithoutSuffix;
55
- /**
56
- * Returns the component module name (e.g. AirOfferModule)
57
- *
58
- * @param componentName
59
- * @param componentStructureDef
60
- */
61
- function getComponentModuleName(componentName, componentStructureDef) {
62
- const inputComponentName = getInputComponentName(componentName);
63
- return `${core_1.strings.classify(inputComponentName)}${core_1.strings.classify(componentStructureDef)}Module`;
64
- }
65
- exports.getComponentModuleName = getComponentModuleName;
66
- /**
67
- * Returns the component analytics name (e.g. AirOfferAnalytics)
68
- *
69
- * @param componentName
70
- * @param componentStructureDef
71
- */
72
- function getComponentAnalyticsName(componentName, componentStructureDef) {
73
- const inputComponentName = getInputComponentName(componentName);
74
- return `${core_1.strings.classify(inputComponentName)}${core_1.strings.classify(componentStructureDef)}Analytics`;
75
- }
76
- exports.getComponentAnalyticsName = getComponentAnalyticsName;
77
- /**
78
- * Returns the component name (e.g. AirOfferComponent)
79
- *
80
- * @param componentName
81
- * @param componentStructureDef
82
- */
83
- function getComponentName(componentName, componentStructureDef) {
84
- const inputComponentName = getInputComponentName(componentName);
85
- return `${core_1.strings.classify(inputComponentName)}${core_1.strings.classify(componentStructureDef)}Component`;
86
- }
87
- exports.getComponentName = getComponentName;
88
- /**
89
- * Returns the component block name (e.g. AirOffer)
90
- *
91
- * @param componentName
92
- */
93
- function getComponentBlockName(componentName) {
94
- const inputComponentName = getInputComponentName(componentName);
95
- return core_1.strings.classify(inputComponentName);
96
- }
97
- exports.getComponentBlockName = getComponentBlockName;
98
- /**
99
- * Return the component in kebab-case (e.g. air-offer)
100
- *
101
- * @param blockName
102
- */
103
- function getKebabCaseBlockName(blockName) {
104
- return core_1.strings.dasherize(blockName);
105
- }
106
- exports.getKebabCaseBlockName = getKebabCaseBlockName;
107
- /**
108
- * Returns the component config name (e.g. AirOfferConfig)
109
- *
110
- * @param componentName
111
- * @param componentStructureDef
112
- */
113
- function getComponentConfigName(componentName, componentStructureDef) {
114
- const inputComponentName = getInputComponentName(componentName);
115
- return `${core_1.strings.classify(inputComponentName)}${core_1.strings.classify(componentStructureDef)}Config`;
116
- }
117
- exports.getComponentConfigName = getComponentConfigName;
118
- /**
119
- * Returns the component translation name (e.g. AirOfferTranslation)
120
- *
121
- * @param componentName
122
- * @param componentStructureDef
123
- */
124
- function getComponentTranslationName(componentName, componentStructureDef) {
125
- const inputComponentName = getInputComponentName(componentName);
126
- return `${core_1.strings.classify(inputComponentName)}${core_1.strings.classify(componentStructureDef)}Translation`;
127
- }
128
- exports.getComponentTranslationName = getComponentTranslationName;
129
- /**
130
- * Returns the component context name (e.g. AirOfferContext)
131
- *
132
- * @param componentName
133
- * @param componentStructureDef
134
- */
135
- function getComponentContextName(componentName, componentStructureDef) {
136
- const inputComponentName = getInputComponentName(componentName);
137
- return `${core_1.strings.classify(inputComponentName)}${core_1.strings.classify(componentStructureDef)}Context`;
138
- }
139
- exports.getComponentContextName = getComponentContextName;
140
- /**
141
- * Returns the component fixture name (e.g. AirOfferFixture)
142
- *
143
- * @param componentName
144
- * @param componentStructureDef
145
- */
146
- function getComponentFixtureName(componentName, componentStructureDef) {
147
- const inputComponentName = getInputComponentName(componentName);
148
- return `${core_1.strings.classify(inputComponentName)}${core_1.strings.classify(componentStructureDef)}Fixture`;
149
- }
150
- exports.getComponentFixtureName = getComponentFixtureName;
151
- /**
152
- * Returns the component config key name (e.g. AIR_OFFER_CONT or AIR_OFFER_PRES)
153
- *
154
- * @param componentName
155
- * @param componentStructureDef
156
- */
157
- function getComponentConfigKey(componentName, componentStructureDef) {
158
- const componentFileName = getComponentFileName(componentName, componentStructureDef);
159
- return `${core_1.strings.underscore(componentFileName).toUpperCase()}`;
160
- }
161
- exports.getComponentConfigKey = getComponentConfigKey;
162
- /**
163
- * Return the library name from path in a monorepos
164
- *
165
- * @param path
166
- */
167
- function getLibraryNameFromPath(path) {
168
- if (!path) {
169
- return null;
170
- }
171
- const libNameRes = /@[^@/]+\/[^/]+/.exec(path.replace(/\\/g, '/'));
172
- return libNameRes && libNameRes[0];
173
- }
174
- exports.getLibraryNameFromPath = getLibraryNameFromPath;
175
- //# sourceMappingURL=template-property.helper.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"template-property.helper.js","sourceRoot":"","sources":["../../src/utility/template-property.helper.ts"],"names":[],"mappings":";;;AAAA,+CAA6C;AAE7C;;;;GAIG;AACH,SAAS,uBAAuB,CAAC,aAAqB;IACpD,OAAO,CAAC,aAAa,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAC5C,CAAC;AAED;;;;GAIG;AACH,SAAgB,qBAAqB,CAAC,aAAqB;IACzD,MAAM,oBAAoB,GAAG,uBAAuB,CAAC,aAAa,CAAC,CAAC;IACpE,OAAO,oBAAoB,CAAC,oBAAoB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AAC/D,CAAC;AAHD,sDAGC;AAED;;;;GAIG;AACH,SAAgB,sBAAsB,CAAC,aAAqB;IAC1D,MAAM,kBAAkB,GAAG,qBAAqB,CAAC,aAAa,CAAC,CAAC;IAChE,OAAO,cAAO,CAAC,SAAS,CAAC,kBAAkB,CAAE,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AACnE,CAAC;AAHD,wDAGC;AAED;;;;;GAKG;AACH,SAAgB,oBAAoB,CAAC,aAAqB,EAAE,qBAA6B;IACvF,MAAM,mBAAmB,GAAG,sBAAsB,CAAC,aAAa,CAAC,CAAC;IAClE,OAAO,qBAAqB,CAAC,CAAC,CAAC,GAAG,mBAAmB,IAAI,cAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAC,EAAE,CAAC,CAAC,CAAC,mBAAmB,CAAC;AAC3H,CAAC;AAHD,oDAGC;AAED;;;;;GAKG;AACH,SAAgB,iCAAiC,CAAC,aAAqB,EAAE,MAAqB;IAC5F,MAAM,QAAQ,GAAG,sBAAsB,CAAC,aAAa,CAAC,CAAC;IACvD,OAAO,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,WAAW,EAAE,IAAI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AE,EAAE,CAAC;AAClE,CAAC;AAHD,sDAGC;AAED;;;;GAIG;AACH,SAAgB,sBAAsB,CAAC,IAA+B;IACpE,IAAI,CAAC,IAAI,EAAE;QACT,OAAO,IAAI,CAAC;KACb;IACD,MAAM,UAAU,GAAG,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC;IACnE,OAAO,UAAU,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC;AACrC,CAAC;AAND,wDAMC"}
@@ -1,25 +0,0 @@
1
- import * as ts from 'typescript';
2
- import { logging } from '@angular-devkit/core';
3
- import type { Tree } from '@angular-devkit/schematics';
4
- /** Map containing all import changes in otter packages */
5
- export interface ImportsMapping {
6
- [packageName: string]: {
7
- [importName: string]: {
8
- newPackage: string;
9
- newValue?: string;
10
- };
11
- };
12
- }
13
- /**
14
- * Update the imports of a given file according to replace mapping
15
- *
16
- * @param logger Logger to report messages
17
- * @param tree File System tree
18
- * @param sourceFile Source file to analyze
19
- * @param importsRegexp Regexp of the imports to replace
20
- * @param renamePackagesRegexp Regexp of the packages to replace
21
- * @param mapImports Map of the import to replace
22
- * @param renamedPackages Map of the import package to replace
23
- */
24
- export declare function updateImportsInFile(logger: logging.LoggerApi, tree: Tree, sourceFile: ts.SourceFile, importsRegexp: RegExp, renamePackagesRegexp: RegExp, mapImports?: ImportsMapping, renamedPackages?: Record<string, string>): number;
25
- //# sourceMappingURL=update-imports.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-imports.d.ts","sourceRoot":"","sources":["../../src/utility/update-imports.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAavD,0DAA0D;AAC1D,MAAM,WAAW,cAAc;IAC7B,CAAC,WAAW,EAAE,MAAM,GAAG;QAAE,CAAC,UAAU,EAAE,MAAM,GAAG;YAAE,UAAU,EAAE,MAAM,CAAC;YAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAC;CAC5F;AAGD;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,OAAO,CAAC,SAAS,EACzB,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,EAAE,CAAC,UAAU,EACzB,aAAa,EAAE,MAAM,EACrB,oBAAoB,EAAE,MAAM,EAC5B,UAAU,GAAE,cAAmB,EAC/B,eAAe,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,UAkF7C"}
@@ -1,86 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateImportsInFile = void 0;
4
- const ts = require("typescript");
5
- const ast_utils_1 = require("@schematics/angular/utility/ast-utils");
6
- /**
7
- * Update the imports of a given file according to replace mapping
8
- *
9
- * @param logger Logger to report messages
10
- * @param tree File System tree
11
- * @param sourceFile Source file to analyze
12
- * @param importsRegexp Regexp of the imports to replace
13
- * @param renamePackagesRegexp Regexp of the packages to replace
14
- * @param mapImports Map of the import to replace
15
- * @param renamedPackages Map of the import package to replace
16
- */
17
- function updateImportsInFile(logger, tree, sourceFile, importsRegexp, renamePackagesRegexp, mapImports = {}, renamedPackages = {}) {
18
- const oldImportedSymbolsPerPackage = {};
19
- const unResolvedImports = [];
20
- const importNodes = [];
21
- // First we look for all imports lines targeting an Otter package for which we know a mapping
22
- (0, ast_utils_1.findNodes)(sourceFile, ts.SyntaxKind.ImportDeclaration).map((nodeImp) => {
23
- const imp = nodeImp;
24
- const importFrom = imp.moduleSpecifier.getText().replace(/['"]/g, '');
25
- const renamePackageMatch = importFrom.match(renamePackagesRegexp);
26
- const otterPackage = renamePackageMatch ? renamePackageMatch[0] : importFrom.match(importsRegexp)?.[0];
27
- // If the import matched an Otter package
28
- if (otterPackage) {
29
- if (!oldImportedSymbolsPerPackage[otterPackage]) {
30
- oldImportedSymbolsPerPackage[otterPackage] = [];
31
- }
32
- // We store the import line to be able to remove it afterwards
33
- importNodes.push(imp);
34
- // We retrieve all the symbols listed in the import statement
35
- const namedImport = imp.importClause && imp.importClause.getChildAt(0);
36
- const imports = namedImport && ts.isNamedImports(namedImport) ?
37
- namedImport.elements.map((element) => ({ symbol: element.getText(), location: importFrom })) :
38
- [];
39
- // And associate them to the Otter package
40
- oldImportedSymbolsPerPackage[otterPackage].push(...imports);
41
- }
42
- });
43
- // If did not capture any interesting import line, do nothing
44
- if (importNodes.length === 0) {
45
- return 0;
46
- }
47
- // Iterate over the imports and look into the renamed packages and into the map to see the import new module
48
- // If no mapping is found, we keep the original import location
49
- const resolvedImports = Object.entries(oldImportedSymbolsPerPackage).reduce((acc, [oldPackageName, importsFromOldPackage]) => {
50
- importsFromOldPackage.forEach((importSymbol) => {
51
- let newPackageNameImport;
52
- if (Object.keys(renamedPackages).indexOf(oldPackageName) > 0) {
53
- newPackageNameImport = importSymbol.location.replace(oldPackageName, renamedPackages[oldPackageName]);
54
- }
55
- else {
56
- newPackageNameImport = mapImports[oldPackageName]?.[importSymbol.symbol]?.newPackage;
57
- }
58
- const importFrom = newPackageNameImport || importSymbol.location;
59
- if (!newPackageNameImport) {
60
- unResolvedImports.push(importSymbol);
61
- }
62
- if (!acc[importFrom]) {
63
- acc[importFrom] = [];
64
- }
65
- const newNameForExportedValue = mapImports[oldPackageName]?.[importSymbol.symbol]?.newValue;
66
- acc[importFrom].push(newNameForExportedValue || importSymbol.symbol);
67
- });
68
- return acc;
69
- }, {});
70
- // Remove captured imports
71
- const fileWithoutImports = tree.read(sourceFile.fileName).toString()
72
- .replace(new RegExp(`(${importNodes.map((node) => node.getText()).join('|')})[\\n\\r]*`, 'g'), '');
73
- // Add the computed imports at the top of the file
74
- const fileWithNewImports = Object.entries(resolvedImports)
75
- .map(([importFrom, imports]) => `import {${imports.join(', ')}} from '${importFrom}';`)
76
- .join('\n') + '\n' + fileWithoutImports;
77
- tree.overwrite(sourceFile.fileName, fileWithNewImports);
78
- // Log details about imports for which we could not find an associated sub-entry
79
- if (unResolvedImports.length > 0) {
80
- logger.warn(`Some imports in file ${sourceFile.fileName} could not be resolved:`);
81
- unResolvedImports.forEach((unResolvedImport) => logger.warn(` |-- symbol "${unResolvedImport.symbol}" from module "${unResolvedImport.location}"`));
82
- }
83
- return unResolvedImports.length;
84
- }
85
- exports.updateImportsInFile = updateImportsInFile;
86
- //# sourceMappingURL=update-imports.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-imports.js","sourceRoot":"","sources":["../../src/utility/update-imports.ts"],"names":[],"mappings":";;;AAAA,iCAAiC;AAEjC,qEAAkE;AAoBlE;;;;;;;;;;GAUG;AACH,SAAgB,mBAAmB,CACjC,MAAyB,EACzB,IAAU,EACV,UAAyB,EACzB,aAAqB,EACrB,oBAA4B,EAC5B,aAA6B,EAAE,EAC/B,kBAA0C,EAAE;IAE5C,MAAM,4BAA4B,GAAsC,EAAE,CAAC;IAC3E,MAAM,iBAAiB,GAAsB,EAAE,CAAC;IAChD,MAAM,WAAW,GAA2B,EAAE,CAAC;IAE/C,6FAA6F;IAC7F,IAAA,qBAAS,EAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;QACrE,MAAM,GAAG,GAAG,OAA+B,CAAC;QAC5C,MAAM,UAAU,GAAG,GAAG,CAAC,eAAe,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QAEtE,MAAM,kBAAkB,GAAG,UAAU,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;QAElE,MAAM,YAAY,GAAG,kBAAkB,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,aAAa,CAAC,EAAE,CAAC,C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