@lucca-front/ng 21.1.0-split.0 → 21.1.1-rc.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.
Files changed (274) hide show
  1. package/fesm2022/lucca-front-ng-a11y.mjs +2 -2
  2. package/fesm2022/lucca-front-ng-a11y.mjs.map +1 -1
  3. package/fesm2022/lucca-front-ng-api.mjs +13 -45
  4. package/fesm2022/lucca-front-ng-api.mjs.map +1 -1
  5. package/fesm2022/lucca-front-ng-app-layout.mjs +2 -2
  6. package/fesm2022/lucca-front-ng-app-layout.mjs.map +1 -1
  7. package/fesm2022/lucca-front-ng-box.mjs +5 -4
  8. package/fesm2022/lucca-front-ng-box.mjs.map +1 -1
  9. package/fesm2022/lucca-front-ng-breadcrumbs.mjs +2 -2
  10. package/fesm2022/lucca-front-ng-breadcrumbs.mjs.map +1 -1
  11. package/fesm2022/lucca-front-ng-bubble-icon.mjs +2 -2
  12. package/fesm2022/lucca-front-ng-bubble-illustration.mjs +6 -1
  13. package/fesm2022/lucca-front-ng-bubble-illustration.mjs.map +1 -1
  14. package/fesm2022/lucca-front-ng-callout.mjs +41 -15
  15. package/fesm2022/lucca-front-ng-callout.mjs.map +1 -1
  16. package/fesm2022/lucca-front-ng-chip.mjs +35 -5
  17. package/fesm2022/lucca-front-ng-chip.mjs.map +1 -1
  18. package/fesm2022/lucca-front-ng-clear.mjs +17 -2
  19. package/fesm2022/lucca-front-ng-clear.mjs.map +1 -1
  20. package/fesm2022/lucca-front-ng-comment.mjs +20 -18
  21. package/fesm2022/lucca-front-ng-comment.mjs.map +1 -1
  22. package/fesm2022/lucca-front-ng-container.mjs +5 -7
  23. package/fesm2022/lucca-front-ng-container.mjs.map +1 -1
  24. package/fesm2022/lucca-front-ng-core-select-job-qualification.mjs +0 -2
  25. package/fesm2022/lucca-front-ng-core-select-job-qualification.mjs.map +1 -1
  26. package/fesm2022/lucca-front-ng-core-select-user.mjs +2 -2
  27. package/fesm2022/lucca-front-ng-core-select-user.mjs.map +1 -1
  28. package/fesm2022/lucca-front-ng-core-select.mjs +12 -19
  29. package/fesm2022/lucca-front-ng-core-select.mjs.map +1 -1
  30. package/fesm2022/lucca-front-ng-data-table.mjs +5 -5
  31. package/fesm2022/lucca-front-ng-data-table.mjs.map +1 -1
  32. package/fesm2022/lucca-front-ng-date.mjs +5 -37
  33. package/fesm2022/lucca-front-ng-date.mjs.map +1 -1
  34. package/fesm2022/lucca-front-ng-date2.mjs +70 -31
  35. package/fesm2022/lucca-front-ng-date2.mjs.map +1 -1
  36. package/fesm2022/lucca-front-ng-department.mjs +2 -18
  37. package/fesm2022/lucca-front-ng-department.mjs.map +1 -1
  38. package/fesm2022/lucca-front-ng-dialog.mjs +13 -4
  39. package/fesm2022/lucca-front-ng-dialog.mjs.map +1 -1
  40. package/fesm2022/lucca-front-ng-divider.mjs +12 -3
  41. package/fesm2022/lucca-front-ng-divider.mjs.map +1 -1
  42. package/fesm2022/lucca-front-ng-dropdown.mjs +9 -8
  43. package/fesm2022/lucca-front-ng-dropdown.mjs.map +1 -1
  44. package/fesm2022/lucca-front-ng-empty-state.mjs +20 -4
  45. package/fesm2022/lucca-front-ng-empty-state.mjs.map +1 -1
  46. package/fesm2022/lucca-front-ng-establishment.mjs +2 -66
  47. package/fesm2022/lucca-front-ng-establishment.mjs.map +1 -1
  48. package/fesm2022/lucca-front-ng-fancy-box.mjs +12 -0
  49. package/fesm2022/lucca-front-ng-fancy-box.mjs.map +1 -1
  50. package/fesm2022/lucca-front-ng-file-upload.mjs +8 -8
  51. package/fesm2022/lucca-front-ng-file-upload.mjs.map +1 -1
  52. package/fesm2022/lucca-front-ng-filter-pills.mjs +4 -4
  53. package/fesm2022/lucca-front-ng-filter-pills.mjs.map +1 -1
  54. package/fesm2022/lucca-front-ng-footer.mjs +3 -0
  55. package/fesm2022/lucca-front-ng-footer.mjs.map +1 -1
  56. package/fesm2022/lucca-front-ng-form-field.mjs +81 -11
  57. package/fesm2022/lucca-front-ng-form-field.mjs.map +1 -1
  58. package/fesm2022/lucca-front-ng-form-header.mjs +3 -0
  59. package/fesm2022/lucca-front-ng-form-header.mjs.map +1 -1
  60. package/fesm2022/lucca-front-ng-form.mjs +19 -5
  61. package/fesm2022/lucca-front-ng-form.mjs.map +1 -1
  62. package/fesm2022/lucca-front-ng-forms-phone-number-input.mjs +10 -9
  63. package/fesm2022/lucca-front-ng-forms-phone-number-input.mjs.map +1 -1
  64. package/fesm2022/lucca-front-ng-forms-rich-text-input-formatters-html.mjs +15 -1
  65. package/fesm2022/lucca-front-ng-forms-rich-text-input-formatters-html.mjs.map +1 -1
  66. package/fesm2022/lucca-front-ng-forms-rich-text-input-formatters-markdown.mjs +28 -3
  67. package/fesm2022/lucca-front-ng-forms-rich-text-input-formatters-markdown.mjs.map +1 -1
  68. package/fesm2022/lucca-front-ng-forms-rich-text-input-formatters-plain-text.mjs +15 -1
  69. package/fesm2022/lucca-front-ng-forms-rich-text-input-formatters-plain-text.mjs.map +1 -1
  70. package/fesm2022/lucca-front-ng-forms-rich-text-input.mjs +53 -36
  71. package/fesm2022/lucca-front-ng-forms-rich-text-input.mjs.map +1 -1
  72. package/fesm2022/lucca-front-ng-forms.mjs +97 -48
  73. package/fesm2022/lucca-front-ng-forms.mjs.map +1 -1
  74. package/fesm2022/lucca-front-ng-gauge.mjs +28 -5
  75. package/fesm2022/lucca-front-ng-gauge.mjs.map +1 -1
  76. package/fesm2022/lucca-front-ng-grid.mjs +3 -3
  77. package/fesm2022/lucca-front-ng-grid.mjs.map +1 -1
  78. package/fesm2022/lucca-front-ng-highlight-data.mjs +31 -26
  79. package/fesm2022/lucca-front-ng-highlight-data.mjs.map +1 -1
  80. package/fesm2022/lucca-front-ng-horizontal-navigation.mjs +5 -2
  81. package/fesm2022/lucca-front-ng-horizontal-navigation.mjs.map +1 -1
  82. package/fesm2022/lucca-front-ng-index-table.mjs +5 -5
  83. package/fesm2022/lucca-front-ng-index-table.mjs.map +1 -1
  84. package/fesm2022/lucca-front-ng-inline-message.mjs +14 -2
  85. package/fesm2022/lucca-front-ng-inline-message.mjs.map +1 -1
  86. package/fesm2022/lucca-front-ng-link.mjs +17 -2
  87. package/fesm2022/lucca-front-ng-link.mjs.map +1 -1
  88. package/fesm2022/lucca-front-ng-listbox.mjs +17 -5
  89. package/fesm2022/lucca-front-ng-listbox.mjs.map +1 -1
  90. package/fesm2022/lucca-front-ng-listing.mjs +36 -7
  91. package/fesm2022/lucca-front-ng-listing.mjs.map +1 -1
  92. package/fesm2022/lucca-front-ng-loading.mjs.map +1 -1
  93. package/fesm2022/lucca-front-ng-main-layout.mjs +9 -2
  94. package/fesm2022/lucca-front-ng-main-layout.mjs.map +1 -1
  95. package/fesm2022/lucca-front-ng-mobile-push.mjs +18 -10
  96. package/fesm2022/lucca-front-ng-mobile-push.mjs.map +1 -1
  97. package/fesm2022/lucca-front-ng-modal.mjs +29 -18
  98. package/fesm2022/lucca-front-ng-modal.mjs.map +1 -1
  99. package/fesm2022/lucca-front-ng-multi-select.mjs +18 -14
  100. package/fesm2022/lucca-front-ng-multi-select.mjs.map +1 -1
  101. package/fesm2022/lucca-front-ng-new-badge.mjs +3 -0
  102. package/fesm2022/lucca-front-ng-new-badge.mjs.map +1 -1
  103. package/fesm2022/lucca-front-ng-numeric-badge.mjs +12 -3
  104. package/fesm2022/lucca-front-ng-numeric-badge.mjs.map +1 -1
  105. package/fesm2022/lucca-front-ng-option.mjs +203 -315
  106. package/fesm2022/lucca-front-ng-option.mjs.map +1 -1
  107. package/fesm2022/lucca-front-ng-page-header.mjs +11 -2
  108. package/fesm2022/lucca-front-ng-page-header.mjs.map +1 -1
  109. package/fesm2022/lucca-front-ng-pagination.mjs +24 -0
  110. package/fesm2022/lucca-front-ng-pagination.mjs.map +1 -1
  111. package/fesm2022/lucca-front-ng-plg-push.mjs +7 -1
  112. package/fesm2022/lucca-front-ng-plg-push.mjs.map +1 -1
  113. package/fesm2022/lucca-front-ng-popover.mjs +1 -33
  114. package/fesm2022/lucca-front-ng-popover.mjs.map +1 -1
  115. package/fesm2022/lucca-front-ng-popover2.mjs +23 -19
  116. package/fesm2022/lucca-front-ng-popover2.mjs.map +1 -1
  117. package/fesm2022/lucca-front-ng-progress-bar.mjs +12 -5
  118. package/fesm2022/lucca-front-ng-progress-bar.mjs.map +1 -1
  119. package/fesm2022/lucca-front-ng-read-more.mjs +18 -3
  120. package/fesm2022/lucca-front-ng-read-more.mjs.map +1 -1
  121. package/fesm2022/lucca-front-ng-resource-card.mjs +8 -8
  122. package/fesm2022/lucca-front-ng-resource-card.mjs.map +1 -1
  123. package/fesm2022/lucca-front-ng-scroll-box.mjs +7 -4
  124. package/fesm2022/lucca-front-ng-scroll-box.mjs.map +1 -1
  125. package/fesm2022/lucca-front-ng-segmented-control-tabs.mjs +11 -5
  126. package/fesm2022/lucca-front-ng-segmented-control-tabs.mjs.map +1 -1
  127. package/fesm2022/lucca-front-ng-segmented-control.mjs +18 -3
  128. package/fesm2022/lucca-front-ng-segmented-control.mjs.map +1 -1
  129. package/fesm2022/lucca-front-ng-simple-select.mjs +22 -7
  130. package/fesm2022/lucca-front-ng-simple-select.mjs.map +1 -1
  131. package/fesm2022/lucca-front-ng-skeleton.mjs +71 -20
  132. package/fesm2022/lucca-front-ng-skeleton.mjs.map +1 -1
  133. package/fesm2022/lucca-front-ng-software-icon.mjs +62 -0
  134. package/fesm2022/lucca-front-ng-software-icon.mjs.map +1 -0
  135. package/fesm2022/lucca-front-ng-sortable-list.mjs +24 -0
  136. package/fesm2022/lucca-front-ng-sortable-list.mjs.map +1 -1
  137. package/fesm2022/lucca-front-ng-status-badge.mjs +14 -2
  138. package/fesm2022/lucca-front-ng-status-badge.mjs.map +1 -1
  139. package/fesm2022/lucca-front-ng-tag.mjs +8 -2
  140. package/fesm2022/lucca-front-ng-tag.mjs.map +1 -1
  141. package/fesm2022/lucca-front-ng-text-flow.mjs +20 -0
  142. package/fesm2022/lucca-front-ng-text-flow.mjs.map +1 -0
  143. package/fesm2022/lucca-front-ng-time.mjs +60 -16
  144. package/fesm2022/lucca-front-ng-time.mjs.map +1 -1
  145. package/fesm2022/lucca-front-ng-tooltip.mjs +23 -22
  146. package/fesm2022/lucca-front-ng-tooltip.mjs.map +1 -1
  147. package/fesm2022/lucca-front-ng-user-popover.mjs +2 -2
  148. package/fesm2022/lucca-front-ng-user-popover.mjs.map +1 -1
  149. package/fesm2022/lucca-front-ng-user.mjs +11 -27
  150. package/fesm2022/lucca-front-ng-user.mjs.map +1 -1
  151. package/fesm2022/lucca-front-ng-vertical-navigation.mjs +32 -2
  152. package/fesm2022/lucca-front-ng-vertical-navigation.mjs.map +1 -1
  153. package/package.json +22 -14
  154. package/schematics/action-icon/index.js +4 -5
  155. package/schematics/action-icon/migration.js +3 -4
  156. package/schematics/action-icon/migration.spec.js +8 -8
  157. package/schematics/alignment-utilities/index.js +3 -4
  158. package/schematics/alignment-utilities/migration.spec.js +8 -8
  159. package/schematics/cdn-urls/index.js +3 -4
  160. package/schematics/cdn-urls/migration.js +8 -10
  161. package/schematics/cdn-urls/migration.spec.js +8 -8
  162. package/schematics/class-prefix/index.js +3 -4
  163. package/schematics/class-prefix/migration.spec.js +8 -8
  164. package/schematics/collection.json +10 -0
  165. package/schematics/color-text/index.js +3 -4
  166. package/schematics/color-text/migration.spec.js +8 -8
  167. package/schematics/component-path/index.js +3 -4
  168. package/schematics/component-path/migration.spec.js +8 -8
  169. package/schematics/empty-state-title/index.js +5 -7
  170. package/schematics/empty-state-title/migration.spec.js +5 -5
  171. package/schematics/lib/html-ast.js +11 -3
  172. package/schematics/lib/index.js +29 -0
  173. package/schematics/lib/schematic.utils.js +5 -0
  174. package/schematics/lu-button/index.js +3 -4
  175. package/schematics/lu-button/migration.js +5 -11
  176. package/schematics/lu-button/migration.spec.js +5 -5
  177. package/schematics/lu-container/index.js +23 -0
  178. package/schematics/lu-container/migration.js +116 -0
  179. package/schematics/lu-container/migration.spec.js +23 -0
  180. package/schematics/lu-container/schema.json +23 -0
  181. package/schematics/lu-icon/index.js +3 -4
  182. package/schematics/lu-icon/migration.js +8 -14
  183. package/schematics/lu-icon/migration.spec.js +5 -5
  184. package/schematics/lu-loading/index.js +23 -0
  185. package/schematics/lu-loading/migration.js +136 -0
  186. package/schematics/lu-loading/migration.spec.js +23 -0
  187. package/schematics/lu-loading/schema.json +28 -0
  188. package/schematics/lu-select/index.js +3 -4
  189. package/schematics/lu-select/migration.js +18 -21
  190. package/schematics/lu-select/migration.spec.js +5 -5
  191. package/schematics/lu-select/util.js +17 -19
  192. package/schematics/lu-text-input/index.js +3 -4
  193. package/schematics/lu-text-input/migration.js +22 -28
  194. package/schematics/lu-text-input/migration.spec.js +5 -5
  195. package/schematics/new-icons/index.js +5 -6
  196. package/schematics/new-icons/migration.js +11 -16
  197. package/schematics/new-icons/migration.spec.js +8 -8
  198. package/schematics/ng-add/file-content.js +6 -8
  199. package/schematics/ng-add/index.js +5 -5
  200. package/schematics/ng-add/tasks.js +22 -17
  201. package/schematics/palettes/index.js +3 -4
  202. package/schematics/palettes/migration.spec.js +8 -8
  203. package/schematics/tokens-radius/index.js +3 -4
  204. package/schematics/tokens-radius/migration.spec.js +8 -8
  205. package/schematics/tokens-spacing/index.js +3 -4
  206. package/schematics/tokens-spacing/migration.spec.js +8 -8
  207. package/schematics/tokens-typo/index.js +3 -4
  208. package/schematics/tokens-typo/migration.spec.js +8 -8
  209. package/src/components/cdk/_overlay.scss +5 -0
  210. package/src/definitions/option/_option-item.scss +1 -0
  211. package/types/lucca-front-ng-a11y.d.ts +1 -1
  212. package/types/lucca-front-ng-api.d.ts +1 -19
  213. package/types/lucca-front-ng-box.d.ts +2 -1
  214. package/types/lucca-front-ng-breadcrumbs.d.ts +1 -1
  215. package/types/lucca-front-ng-bubble-illustration.d.ts +1 -1
  216. package/types/lucca-front-ng-callout.d.ts +32 -2
  217. package/types/lucca-front-ng-chip.d.ts +32 -2
  218. package/types/lucca-front-ng-clear.d.ts +20 -5
  219. package/types/lucca-front-ng-comment.d.ts +19 -11
  220. package/types/lucca-front-ng-container.d.ts +4 -4
  221. package/types/lucca-front-ng-core-select.d.ts +3 -2
  222. package/types/lucca-front-ng-date.d.ts +1 -19
  223. package/types/lucca-front-ng-date2.d.ts +21 -18
  224. package/types/lucca-front-ng-department.d.ts +1 -10
  225. package/types/lucca-front-ng-dialog.d.ts +6 -3
  226. package/types/lucca-front-ng-divider.d.ts +10 -0
  227. package/types/lucca-front-ng-empty-state.d.ts +18 -2
  228. package/types/lucca-front-ng-establishment.d.ts +1 -37
  229. package/types/lucca-front-ng-fancy-box.d.ts +12 -0
  230. package/types/lucca-front-ng-footer.d.ts +3 -0
  231. package/types/lucca-front-ng-form-field.d.ts +36 -5
  232. package/types/lucca-front-ng-form-header.d.ts +3 -0
  233. package/types/lucca-front-ng-form.d.ts +9 -5
  234. package/types/lucca-front-ng-forms-phone-number-input.d.ts +1 -0
  235. package/types/lucca-front-ng-forms-rich-text-input-formatters-html.d.ts +7 -1
  236. package/types/lucca-front-ng-forms-rich-text-input-formatters-markdown.d.ts +11 -1
  237. package/types/lucca-front-ng-forms-rich-text-input-formatters-plain-text.d.ts +7 -1
  238. package/types/lucca-front-ng-forms-rich-text-input.d.ts +2 -0
  239. package/types/lucca-front-ng-forms.d.ts +21 -9
  240. package/types/lucca-front-ng-gauge.d.ts +25 -0
  241. package/types/lucca-front-ng-grid.d.ts +1 -1
  242. package/types/lucca-front-ng-highlight-data.d.ts +36 -15
  243. package/types/lucca-front-ng-horizontal-navigation.d.ts +3 -0
  244. package/types/lucca-front-ng-inline-message.d.ts +12 -0
  245. package/types/lucca-front-ng-link.d.ts +15 -0
  246. package/types/lucca-front-ng-listbox.d.ts +16 -4
  247. package/types/lucca-front-ng-listing.d.ts +33 -2
  248. package/types/lucca-front-ng-main-layout.d.ts +6 -0
  249. package/types/lucca-front-ng-mobile-push.d.ts +7 -0
  250. package/types/lucca-front-ng-modal.d.ts +3 -1
  251. package/types/lucca-front-ng-new-badge.d.ts +3 -0
  252. package/types/lucca-front-ng-numeric-badge.d.ts +9 -0
  253. package/types/lucca-front-ng-option.d.ts +78 -141
  254. package/types/lucca-front-ng-page-header.d.ts +9 -0
  255. package/types/lucca-front-ng-pagination.d.ts +25 -1
  256. package/types/lucca-front-ng-plg-push.d.ts +7 -1
  257. package/types/lucca-front-ng-popover.d.ts +1 -20
  258. package/types/lucca-front-ng-popover2.d.ts +7 -4
  259. package/types/lucca-front-ng-progress-bar.d.ts +9 -0
  260. package/types/lucca-front-ng-read-more.d.ts +16 -1
  261. package/types/lucca-front-ng-resource-card.d.ts +6 -0
  262. package/types/lucca-front-ng-scroll-box.d.ts +4 -1
  263. package/types/lucca-front-ng-segmented-control-tabs.d.ts +7 -1
  264. package/types/lucca-front-ng-segmented-control.d.ts +16 -1
  265. package/types/lucca-front-ng-skeleton.d.ts +61 -6
  266. package/types/lucca-front-ng-software-icon.d.ts +19 -0
  267. package/types/lucca-front-ng-sortable-list.d.ts +24 -0
  268. package/types/lucca-front-ng-status-badge.d.ts +12 -0
  269. package/types/lucca-front-ng-tag.d.ts +6 -0
  270. package/types/lucca-front-ng-text-flow.d.ts +8 -0
  271. package/types/lucca-front-ng-time.d.ts +18 -12
  272. package/types/lucca-front-ng-tooltip.d.ts +2 -11
  273. package/types/lucca-front-ng-user.d.ts +2 -11
  274. package/types/lucca-front-ng-vertical-navigation.d.ts +30 -0
@@ -1,11 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.migrateComponent = migrateComponent;
4
- const angular_template_1 = require("../lib/angular-template");
5
- const html_ast_js_1 = require("../lib/html-ast.js");
6
- const lf_schematic_context_1 = require("../lib/lf-schematic-context");
7
- const angular_component_ast_1 = require("../lib/angular-component-ast");
8
4
  const change_1 = require("@schematics/angular/utility/change");
5
+ const lib_1 = require("../lib");
9
6
  function migrateComponent(sourceFile, path, tree) {
10
7
  const textfields = findTextfields(sourceFile, path, tree);
11
8
  if (textfields.length > 0) {
@@ -24,7 +21,7 @@ function migrateComponent(sourceFile, path, tree) {
24
21
  // Let's remove everything first
25
22
  templateUpdate.remove(field.nodeOffset + field.node.startSourceSpan.start.offset, field.node.sourceSpan.toString().length);
26
23
  // Then forge the new input
27
- const textInput = `<lu-text-input ${(0, angular_component_ast_1.inputValueToHTML)('placeholder', field.inputs.placeholder)} ${(0, angular_component_ast_1.inputValueToHTML)('formControlName', field.inputs.formControlName)} ${(0, angular_component_ast_1.inputValueToHTML)('ngModel', field.inputs.ngModel)} />`.replace(/\s{2,}/, " ");
24
+ const textInput = `<lu-text-input ${(0, lib_1.inputValueToHTML)('placeholder', field.inputs.placeholder)} ${(0, lib_1.inputValueToHTML)('formControlName', field.inputs.formControlName)} ${(0, lib_1.inputValueToHTML)('ngModel', field.inputs.ngModel)} />`.replace(/\s{2,}/, " ");
28
25
  const fieldOpeningTag = `lu-form-field [label]="labelTpl"`.replace(/\s{2,}/, " ").trim();
29
26
  // TODO handle required migration from template-driven to form-driven???
30
27
  const newInput = `<${fieldOpeningTag}>
@@ -38,10 +35,10 @@ function migrateComponent(sourceFile, path, tree) {
38
35
  if (updatedStuff) {
39
36
  // Add import if needed
40
37
  (0, change_1.applyToUpdateRecorder)(tsUpdate, [
41
- (0, angular_component_ast_1.insertTSImportIfNeeded)(sourceFile, path, 'FormFieldComponent', '@lucca-front/ng/form-field'),
42
- (0, angular_component_ast_1.insertAngularImportIfNeeded)(sourceFile, path, 'FormFieldComponent'),
43
- (0, angular_component_ast_1.insertTSImportIfNeeded)(sourceFile, path, 'TextInputComponent', '@lucca-front/ng/forms'),
44
- (0, angular_component_ast_1.insertAngularImportIfNeeded)(sourceFile, path, 'TextInputComponent')
38
+ (0, lib_1.insertTSImportIfNeeded)(sourceFile, path, 'FormFieldComponent', '@lucca-front/ng/form-field'),
39
+ (0, lib_1.insertAngularImportIfNeeded)(sourceFile, path, 'FormFieldComponent'),
40
+ (0, lib_1.insertTSImportIfNeeded)(sourceFile, path, 'TextInputComponent', '@lucca-front/ng/forms'),
41
+ (0, lib_1.insertAngularImportIfNeeded)(sourceFile, path, 'TextInputComponent')
45
42
  ]);
46
43
  tree.commitUpdate(tsUpdate);
47
44
  if (!isInlineTemplate) {
@@ -53,11 +50,11 @@ function migrateComponent(sourceFile, path, tree) {
53
50
  }
54
51
  function findTextfields(sourceFile, basePath, tree) {
55
52
  const fields = [];
56
- const ngTemplates = (0, angular_template_1.extractNgTemplatesIncludingHtml)(sourceFile, tree, basePath);
53
+ const ngTemplates = (0, lib_1.extractNgTemplatesIncludingHtml)(sourceFile, tree, basePath);
57
54
  ngTemplates.forEach((template) => {
58
- const htmlAst = new html_ast_js_1.HtmlAst(template.content);
55
+ const htmlAst = new lib_1.HtmlAst(template.content);
59
56
  htmlAst.visitNodes((node) => {
60
- if (isInterestingNode(node) && node.name === "label") {
57
+ if ((0, lib_1.isInterestingNode)(node) && node.name === "label") {
61
58
  const classes = getNodeClasses(node);
62
59
  const inputs = {
63
60
  size: classes.find(c => /mod-(XS|S|M|L|XL|XXL)/.test(c))?.replace('mod-', '')
@@ -71,24 +68,24 @@ function findTextfields(sourceFile, basePath, tree) {
71
68
  classes: classes
72
69
  };
73
70
  if (classes.includes("textfield")) {
74
- if (node.children.filter(el => isInterestingNode(el) || isControlFlowNode(el)).length > 2) {
71
+ if (node.children.filter(el => (0, lib_1.isInterestingNode)(el) || isControlFlowNode(el)).length > 2) {
75
72
  field.rejection = "Field contains more than an input + label";
76
73
  }
77
74
  // Find native input and grab params from it
78
- const nativeInput = node.children.find(el => isInterestingNode(el) && el.name === "input");
75
+ const nativeInput = node.children.find(el => (0, lib_1.isInterestingNode)(el) && el.name === "input");
79
76
  if (!nativeInput) {
80
77
  field.rejection = "Field doesn't contain a native input[type=text]";
81
78
  }
82
- else if (isInterestingNode(nativeInput)) {
83
- inputs.placeholder = (0, angular_component_ast_1.getInputValue)(nativeInput, "placeholder");
84
- inputs.formControlName = (0, angular_component_ast_1.getInputValue)(nativeInput, "formControlName");
85
- inputs.ngModel = (0, angular_component_ast_1.getInputValue)(nativeInput, "ngModel");
86
- inputs.forceRequired = (0, angular_component_ast_1.getInputValue)(nativeInput, "aria-required");
79
+ else if ((0, lib_1.isInterestingNode)(nativeInput)) {
80
+ inputs.placeholder = (0, lib_1.getInputValue)(nativeInput, "placeholder");
81
+ inputs.formControlName = (0, lib_1.getInputValue)(nativeInput, "formControlName");
82
+ inputs.ngModel = (0, lib_1.getInputValue)(nativeInput, "ngModel");
83
+ inputs.forceRequired = (0, lib_1.getInputValue)(nativeInput, "aria-required");
87
84
  }
88
85
  // This is a textfield, now let's find if it has everything required for migration
89
- const visitor = new html_ast_js_1.HtmlAstVisitor(node);
86
+ const visitor = new lib_1.HtmlAstVisitor(node);
90
87
  visitor.visitElements(/span/, (el) => {
91
- if (isInterestingNode(el) && getNodeClasses(el).includes("textfield-label")) {
88
+ if ((0, lib_1.isInterestingNode)(el) && getNodeClasses(el).includes("textfield-label")) {
92
89
  field.label = template.content.slice(el.startSourceSpan.end.offset, el.endSourceSpan?.start?.offset);
93
90
  }
94
91
  });
@@ -105,12 +102,9 @@ function findTextfields(sourceFile, basePath, tree) {
105
102
  function getNodeClasses(node) {
106
103
  return (node.attributes.find(attr => attr.name === 'class')?.value || "").split(" ");
107
104
  }
108
- function isInterestingNode(node) {
109
- return node instanceof lf_schematic_context_1.currentSchematicContext.angularCompiler.TmplAstElement;
110
- }
111
105
  function isControlFlowNode(node) {
112
- return node instanceof lf_schematic_context_1.currentSchematicContext.angularCompiler.TmplAstIfBlock ||
113
- node instanceof lf_schematic_context_1.currentSchematicContext.angularCompiler.TmplAstForLoopBlock ||
114
- node instanceof lf_schematic_context_1.currentSchematicContext.angularCompiler.TmplAstSwitchBlock ||
115
- node instanceof lf_schematic_context_1.currentSchematicContext.angularCompiler.TmplAstDeferredBlock;
106
+ return node instanceof lib_1.currentSchematicContext.angularCompiler.TmplAstIfBlock ||
107
+ node instanceof lib_1.currentSchematicContext.angularCompiler.TmplAstForLoopBlock ||
108
+ node instanceof lib_1.currentSchematicContext.angularCompiler.TmplAstSwitchBlock ||
109
+ node instanceof lib_1.currentSchematicContext.angularCompiler.TmplAstDeferredBlock;
116
110
  }
@@ -1,23 +1,23 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const path = require("path");
4
- const migration_test_js_1 = require("../lib/migration-test.js");
4
+ const lib_1 = require("../lib");
5
5
  const collectionPath = path.normalize(path.join(__dirname, '..', 'collection.json'));
6
6
  const testsRoot = path.join(__dirname, 'tests');
7
7
  describe('Textfield Migration', () => {
8
8
  it('should handle basic case files', async () => {
9
9
  // Arrange
10
- const tree = (0, migration_test_js_1.createTreeFromFolder)(path.join(testsRoot, 'input'));
11
- const expectedTree = (0, migration_test_js_1.createTreeFromFolder)(path.join(testsRoot, 'output'));
10
+ const tree = (0, lib_1.createTreeFromFolder)(path.join(testsRoot, 'input'));
11
+ const expectedTree = (0, lib_1.createTreeFromFolder)(path.join(testsRoot, 'output'));
12
12
  // Act
13
13
  try {
14
- await (0, migration_test_js_1.runSchematic)('collection', collectionPath, 'lu-text-input', { skipInstallation: true }, tree);
14
+ await (0, lib_1.runSchematic)('collection', collectionPath, 'lu-text-input', { skipInstallation: true }, tree);
15
15
  }
16
16
  catch (error) {
17
17
  // eslint-disable-next-line no-console
18
18
  console.log(error);
19
19
  }
20
20
  // Assert
21
- (0, migration_test_js_1.expectTree)(tree).toMatchTree(expectedTree);
21
+ (0, lib_1.expectTree)(tree).toMatchTree(expectedTree);
22
22
  });
23
23
  });
@@ -1,14 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const schematics_js_1 = require("../lib/schematics.js");
3
+ const lib_1 = require("../lib");
4
4
  const migration_js_1 = require("./migration.js");
5
- const lf_schematic_context_1 = require("../lib/lf-schematic-context");
6
5
  // Nx need to see "@angular-devkit/schematics" in order to run this migration correctly (see https://github.com/nrwl/nx/blob/d9fed4b832bf01d1b9a44ae9e486a5e5cd2d2253/packages/nx/src/command-line/migrate/migrate.ts#L1729-L1738)
7
6
  // eslint-disable-next-line @typescript-eslint/no-require-imports
8
7
  require('@angular-devkit/schematics');
9
8
  exports.default = (options) => {
10
9
  return async (tree, context) => {
11
- await lf_schematic_context_1.currentSchematicContext.init(context, options);
10
+ await lib_1.currentSchematicContext.init(context, options);
12
11
  const postCssScss = await Promise.resolve().then(() => require('../lib/local-deps/postcss-scss.js'));
13
12
  const { postcssSelectorParser } = await Promise.resolve().then(() => require('../lib/local-deps/postcss-selector-parser.js'));
14
13
  tree.visit((path, entry) => {
@@ -16,13 +15,13 @@ exports.default = (options) => {
16
15
  return;
17
16
  }
18
17
  if (path.endsWith('.scss')) {
19
- (0, schematics_js_1.migrateFile)(path, entry, tree, (content) => (0, migration_js_1.migrateScssFile)(content, postCssScss, postcssSelectorParser));
18
+ (0, lib_1.migrateFile)(path, entry, tree, (content) => (0, migration_js_1.migrateScssFile)(content, postCssScss, postcssSelectorParser));
20
19
  }
21
20
  if (path.endsWith('.html')) {
22
- (0, schematics_js_1.migrateFile)(path, entry, tree, (content) => (0, migration_js_1.migrateHTMLFile)(content));
21
+ (0, lib_1.migrateFile)(path, entry, tree, (content) => (0, migration_js_1.migrateHTMLFile)(content));
23
22
  }
24
23
  if (path.endsWith('.ts')) {
25
- (0, schematics_js_1.migrateFile)(path, entry, tree, (content) => (0, migration_js_1.migrateTsFile)(path, content));
24
+ (0, lib_1.migrateFile)(path, entry, tree, (content) => (0, migration_js_1.migrateTsFile)(path, content));
26
25
  }
27
26
  });
28
27
  };
@@ -4,26 +4,21 @@ exports.migrateScssFile = migrateScssFile;
4
4
  exports.migrateHTMLFile = migrateHTMLFile;
5
5
  exports.migrateTsFile = migrateTsFile;
6
6
  const typescript_1 = require("typescript");
7
- const angular_template_js_1 = require("../lib/angular-template.js");
8
- const file_update_js_1 = require("../lib/file-update.js");
9
- const html_ast_js_1 = require("../lib/html-ast.js");
10
- const scss_ast_js_1 = require("../lib/scss-ast.js");
11
- const typescript_ast_js_1 = require("../lib/typescript-ast.js");
7
+ const lib_1 = require("../lib");
12
8
  const mapping_js_1 = require("./mapping.js");
13
- const lf_schematic_context_1 = require("../lib/lf-schematic-context");
14
9
  function migrateScssFile(content, postCssScss, postcssSelectorParser) {
15
10
  const root = postCssScss.parse(content);
16
- (0, scss_ast_js_1.updateCSSClassNamesInRules)(root, mapping_js_1.oldIconClassToNewIconClass, postcssSelectorParser);
11
+ (0, lib_1.updateCSSClassNamesInRules)(root, mapping_js_1.oldIconClassToNewIconClass, postcssSelectorParser);
17
12
  return root.toResult({ syntax: { stringify: postCssScss.stringify } }).css;
18
13
  }
19
14
  function migrateHTMLFile(content) {
20
- content = (0, html_ast_js_1.updateCssClassNames)(content, mapping_js_1.oldIconClassToNewIconClass);
21
- content = (0, angular_template_js_1.replaceComponentInput)('lu-icon', 'icon', mapping_js_1.oldIconToNewIcon, content);
22
- return (0, file_update_js_1.updateContent)(content, (updates) => {
23
- const htmlAst = new html_ast_js_1.HtmlAst(content);
15
+ content = (0, lib_1.updateCssClassNames)(content, mapping_js_1.oldIconClassToNewIconClass);
16
+ content = (0, lib_1.replaceComponentInput)('lu-icon', 'icon', mapping_js_1.oldIconToNewIcon, content);
17
+ return (0, lib_1.updateContent)(content, (updates) => {
18
+ const htmlAst = new lib_1.HtmlAst(content);
24
19
  htmlAst.visitElementWithAttribute(/.*/, 'class', (elem, attr) => {
25
- const legacyIconText = attr.value.includes('lucca-icon') && elem.children.find((c) => c instanceof lf_schematic_context_1.currentSchematicContext.angularCompiler.TmplAstText && mapping_js_1.oldIcons.has(c.value));
26
- if (attr.valueSpan && legacyIconText && legacyIconText instanceof lf_schematic_context_1.currentSchematicContext.angularCompiler.TmplAstText) {
20
+ const legacyIconText = attr.value.includes('lucca-icon') && elem.children.find((c) => c instanceof lib_1.currentSchematicContext.angularCompiler.TmplAstText && mapping_js_1.oldIcons.has(c.value));
21
+ if (attr.valueSpan && legacyIconText && legacyIconText instanceof lib_1.currentSchematicContext.angularCompiler.TmplAstText) {
27
22
  updates.push({
28
23
  position: legacyIconText.sourceSpan.start.offset,
29
24
  oldContent: legacyIconText.value,
@@ -39,14 +34,14 @@ function migrateHTMLFile(content) {
39
34
  });
40
35
  }
41
36
  function migrateTsFile(fileName, content) {
42
- return (0, file_update_js_1.updateContent)(content, (updates) => {
37
+ return (0, lib_1.updateContent)(content, (updates) => {
43
38
  const sourcefile = (0, typescript_1.createSourceFile)(fileName, content, typescript_1.ScriptTarget.ESNext);
44
- const templates = (0, angular_template_js_1.extractNgTemplates)(sourcefile);
39
+ const templates = (0, lib_1.extractNgTemplates)(sourcefile);
45
40
  updates.push(...templates.map((tpl) => ({
46
41
  position: tpl.offsetStart,
47
42
  oldContent: tpl.content,
48
43
  newContent: migrateHTMLFile(tpl.content)
49
44
  })));
50
- updates.push(...(0, typescript_ast_js_1.replaceStringLiterals)(sourcefile, mapping_js_1.oldIconClassToNewIconClass));
45
+ updates.push(...(0, lib_1.replaceStringLiterals)(sourcefile, mapping_js_1.oldIconClassToNewIconClass));
51
46
  });
52
47
  }
@@ -3,25 +3,25 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const fs = require("fs");
4
4
  const glob = require("glob");
5
5
  const path = require("path");
6
- const migration_test_js_1 = require("../lib/migration-test.js");
6
+ const lib_1 = require("../lib");
7
7
  const collectionPath = path.normalize(path.join(__dirname, '..', 'collection.json'));
8
8
  const testsRoot = path.join(__dirname, 'tests');
9
9
  const files = fs.readdirSync(testsRoot);
10
10
  describe('New icons Migration', () => {
11
11
  it('should update files', async () => {
12
12
  // Arrange
13
- const tree = (0, migration_test_js_1.createTreeFromFiles)(testsRoot, files, '.input.');
14
- const expectedTree = (0, migration_test_js_1.createTreeFromFiles)(testsRoot, files, '.output.');
13
+ const tree = (0, lib_1.createTreeFromFiles)(testsRoot, files, '.input.');
14
+ const expectedTree = (0, lib_1.createTreeFromFiles)(testsRoot, files, '.output.');
15
15
  // Act
16
16
  try {
17
- await (0, migration_test_js_1.runSchematic)('collection', collectionPath, 'new-icons', { skipInstallation: true }, tree);
17
+ await (0, lib_1.runSchematic)('collection', collectionPath, 'new-icons', { skipInstallation: true }, tree);
18
18
  }
19
19
  catch (error) {
20
20
  // eslint-disable-next-line no-console
21
21
  console.log(error);
22
22
  }
23
23
  // Assert
24
- (0, migration_test_js_1.expectTree)(tree).toMatchTree(expectedTree);
24
+ (0, lib_1.expectTree)(tree).toMatchTree(expectedTree);
25
25
  });
26
26
  // Use this to migrate @lucca-front/* packages
27
27
  it.skip('should migrate @lucca-front/*', async () => {
@@ -33,10 +33,10 @@ describe('New icons Migration', () => {
33
33
  ...glob.sync('packages/ng/**/*', { cwd: lfRoot, nodir: true, ignore: ['**/schematics/**'] }),
34
34
  ...glob.sync('stories/**', { cwd: lfRoot, nodir: true }),
35
35
  ];
36
- const treeOriginalTree = (0, migration_test_js_1.createTreeFromFiles)(lfRoot, lfFiles, '.');
37
- const tree = (0, migration_test_js_1.createTreeFromFiles)(lfRoot, lfFiles, '.');
36
+ const treeOriginalTree = (0, lib_1.createTreeFromFiles)(lfRoot, lfFiles, '.');
37
+ const tree = (0, lib_1.createTreeFromFiles)(lfRoot, lfFiles, '.');
38
38
  // Act
39
- await (0, migration_test_js_1.runSchematic)('collection', collectionPath, 'new-icons', { skipInstallation: true }, tree);
39
+ await (0, lib_1.runSchematic)('collection', collectionPath, 'new-icons', { skipInstallation: true }, tree);
40
40
  // Assert
41
41
  tree.visit((p, entry) => {
42
42
  const original = treeOriginalTree.get(p)?.content.toString() || '';
@@ -2,15 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.shameScss = exports.stylesScss = void 0;
4
4
  exports.stylesScss = `
5
- $noCssVar: true;
5
+ // Import styles
6
+ @forward '@lucca-front/icons/src/main';
7
+ @forward '@lucca-front/scss/src/main';
8
+ @forward '@lucca-front/ng/src/main';
6
9
 
7
- @import '~@lucca-front/scss/src/main.overridable'
8
- , '~@lucca-front/ng/src/main.overridable.scss'
9
- , 'scss/shame';
10
-
11
- :root {
12
- @include generateCSSVarsFromTheme($theme);
13
- }
10
+ // Import SCSS components
11
+ // @forward '@lucca-front/scss/src/components/button';
14
12
  `;
15
13
  exports.shameScss = `// 'My room is not messy; it is an obstable course designed to keep me fit'
16
14
  // Put here the CSS which will need a refactor, or some code that you want to see in Lucca Front.
@@ -7,13 +7,13 @@ function ngAdd() {
7
7
  return (tree, context) => {
8
8
  context.addTask(new tasks_1.NodePackageInstallTask({ packageName: '@lucca-front/icons' }));
9
9
  context.addTask(new tasks_1.NodePackageInstallTask({ packageName: '@lucca-front/scss' }));
10
+ const angularJson = (0, tasks_2.getAngularJson)(tree);
11
+ const project = (0, tasks_2.getProject)(angularJson);
10
12
  // Add LF @import and init css vars
11
- (0, tasks_2.updateStylesScss)(tree);
13
+ (0, tasks_2.updateStylesScss)(tree, project);
12
14
  // Add empty shame file
13
- (0, tasks_2.createShameScss)(tree);
14
- // Copy default palette in scss/overrides/_palettes.override.scss
15
- (0, tasks_2.createPalettesOverrideScss)(tree);
15
+ (0, tasks_2.createShameScss)(tree, project);
16
16
  // Add stylePreprocessorOptions
17
- (0, tasks_2.updateAngularJson)(tree);
17
+ (0, tasks_2.updateAngularJson)(tree, project, angularJson);
18
18
  };
19
19
  }
@@ -1,31 +1,36 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getProject = getProject;
4
+ exports.getAngularJson = getAngularJson;
3
5
  exports.updateStylesScss = updateStylesScss;
4
6
  exports.updateAngularJson = updateAngularJson;
5
- exports.createPalettesOverrideScss = createPalettesOverrideScss;
6
7
  exports.createShameScss = createShameScss;
7
8
  const file_content_1 = require("./file-content");
8
9
  const files = {
9
- globalStyles: 'src/styles.scss',
10
- shameStyles: 'src/scss/_shame.scss',
11
- palettesOverride: 'src/scss/overrides/_palettes.override.scss',
10
+ globalStyles: 'styles.scss',
11
+ shameStyles: 'scss/_shame.scss',
12
12
  };
13
- function updateStylesScss(tree) {
14
- const existingLength = tree.read(files.globalStyles)?.toString().length ?? 0;
15
- const styleUpdateRecord = tree.beginUpdate(files.globalStyles).insertRight(existingLength, file_content_1.stylesScss);
13
+ function getProject(angularJson) {
14
+ const { defaultProject, projects } = angularJson;
15
+ const project = defaultProject ?? Object.keys(projects)[0];
16
+ return projects[project];
17
+ }
18
+ function getAngularJson(tree) {
19
+ return JSON.parse(tree.read('angular.json')?.toString() ?? '{}');
20
+ }
21
+ function updateStylesScss(tree, project) {
22
+ const path = `${project.sourceRoot ?? 'src'}/${files.globalStyles}`;
23
+ const existingLength = tree.read(path)?.toString().length ?? 0;
24
+ const styleUpdateRecord = tree.beginUpdate(path).insertRight(existingLength, file_content_1.stylesScss);
16
25
  tree.commitUpdate(styleUpdateRecord);
17
26
  }
18
- function updateAngularJson(tree) {
19
- const angularJson = JSON.parse(tree.read('angular.json')?.toString() ?? '{}');
20
- const { defaultProject, projects } = angularJson;
21
- projects[defaultProject].architect.build.options.stylePreprocessorOptions = {
22
- includePaths: ['src/scss/overrides', 'src/scss', 'node_modules/@lucca-front/ng/src'],
27
+ function updateAngularJson(tree, project, angularJson) {
28
+ project.architect.build.options.stylePreprocessorOptions = {
29
+ includePaths: ['src/scss', 'node_modules'],
23
30
  };
24
31
  tree.overwrite('angular.json', JSON.stringify(angularJson, undefined, ' ') + '\n');
25
32
  }
26
- function createPalettesOverrideScss(tree) {
27
- tree.create(files.palettesOverride, tree.read('node_modules/@lucca-front/scss/src/theming/_palettes.scss') ?? '');
28
- }
29
- function createShameScss(tree) {
30
- tree.create(files.shameStyles, file_content_1.shameScss);
33
+ function createShameScss(tree, project) {
34
+ const path = `${project.sourceRoot ?? 'src'}/${files.shameStyles}`;
35
+ tree.create(path, file_content_1.shameScss);
31
36
  }
@@ -1,14 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const css_mapper_1 = require("../lib/css-mapper");
4
- const lf_schematic_context_1 = require("../lib/lf-schematic-context");
3
+ const lib_1 = require("../lib");
5
4
  // Nx need to see "@angular-devkit/schematics" in order to run this migration correctly (see https://github.com/nrwl/nx/blob/d9fed4b832bf01d1b9a44ae9e486a5e5cd2d2253/packages/nx/src/command-line/migrate/migrate.ts#L1729-L1738)
6
5
  // eslint-disable-next-line @typescript-eslint/no-require-imports
7
6
  require('@angular-devkit/schematics');
8
7
  exports.default = (options) => {
9
8
  return async (tree, context) => {
10
- await lf_schematic_context_1.currentSchematicContext.init(context, options);
11
- await new css_mapper_1.CssMapper(tree, {
9
+ await lib_1.currentSchematicContext.init(context, options);
10
+ await new lib_1.CssMapper(tree, {
12
11
  classes: {
13
12
  'palette-grey': 'palette-neutral',
14
13
  'palette-primary': 'palette-product',
@@ -3,25 +3,25 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const fs = require("fs");
4
4
  const glob = require("glob");
5
5
  const path = require("path");
6
- const migration_test_js_1 = require("../lib/migration-test.js");
6
+ const lib_1 = require("../lib");
7
7
  const collectionPath = path.normalize(path.join(__dirname, '..', 'collection.json'));
8
8
  const testsRoot = path.join(__dirname, 'tests');
9
9
  const files = fs.readdirSync(testsRoot);
10
10
  describe('Palettes Migration', () => {
11
11
  it('should update files', async () => {
12
12
  // Arrange
13
- const tree = (0, migration_test_js_1.createTreeFromFiles)(testsRoot, files, '.input.');
14
- const expectedTree = (0, migration_test_js_1.createTreeFromFiles)(testsRoot, files, '.output.');
13
+ const tree = (0, lib_1.createTreeFromFiles)(testsRoot, files, '.input.');
14
+ const expectedTree = (0, lib_1.createTreeFromFiles)(testsRoot, files, '.output.');
15
15
  // Act
16
16
  try {
17
- await (0, migration_test_js_1.runSchematic)('collection', collectionPath, 'palettes', { skipInstallation: true }, tree);
17
+ await (0, lib_1.runSchematic)('collection', collectionPath, 'palettes', { skipInstallation: true }, tree);
18
18
  }
19
19
  catch (error) {
20
20
  // eslint-disable-next-line no-console
21
21
  console.log(error);
22
22
  }
23
23
  // Assert
24
- (0, migration_test_js_1.expectTree)(tree).toMatchTree(expectedTree);
24
+ (0, lib_1.expectTree)(tree).toMatchTree(expectedTree);
25
25
  });
26
26
  // Use this to migrate @lucca-front/* packages
27
27
  it.skip('should migrate @lucca-front/*', async () => {
@@ -33,10 +33,10 @@ describe('Palettes Migration', () => {
33
33
  ...glob.sync('packages/ng/**/*', { cwd: lfRoot, nodir: true, ignore: ['**/schematics/**'] }),
34
34
  ...glob.sync('stories/**', { cwd: lfRoot, nodir: true }),
35
35
  ];
36
- const treeOriginalTree = (0, migration_test_js_1.createTreeFromFiles)(lfRoot, lfFiles, '.');
37
- const tree = (0, migration_test_js_1.createTreeFromFiles)(lfRoot, lfFiles, '.');
36
+ const treeOriginalTree = (0, lib_1.createTreeFromFiles)(lfRoot, lfFiles, '.');
37
+ const tree = (0, lib_1.createTreeFromFiles)(lfRoot, lfFiles, '.');
38
38
  // Act
39
- await (0, migration_test_js_1.runSchematic)('collection', collectionPath, 'palettes', { skipInstallation: true }, tree);
39
+ await (0, lib_1.runSchematic)('collection', collectionPath, 'palettes', { skipInstallation: true }, tree);
40
40
  // Assert
41
41
  tree.visit((p, entry) => {
42
42
  const original = treeOriginalTree.get(p)?.content.toString() || '';
@@ -1,14 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const css_mapper_1 = require("../lib/css-mapper");
4
- const lf_schematic_context_1 = require("../lib/lf-schematic-context");
3
+ const lib_1 = require("../lib");
5
4
  // Nx need to see "@angular-devkit/schematics" in order to run this migration correctly (see https://github.com/nrwl/nx/blob/d9fed4b832bf01d1b9a44ae9e486a5e5cd2d2253/packages/nx/src/command-line/migrate/migrate.ts#L1729-L1738)
6
5
  // eslint-disable-next-line @typescript-eslint/no-require-imports
7
6
  require('@angular-devkit/schematics');
8
7
  exports.default = (options) => {
9
8
  return async (tree, context) => {
10
- await lf_schematic_context_1.currentSchematicContext.init(context, options);
11
- await new css_mapper_1.CssMapper(tree, {
9
+ await lib_1.currentSchematicContext.init(context, options);
10
+ await new lib_1.CssMapper(tree, {
12
11
  classes: {},
13
12
  variables: {
14
13
  '--commons-borderRadius-M': '--pr-t-border-radius-default',
@@ -3,25 +3,25 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const fs = require("fs");
4
4
  const glob = require("glob");
5
5
  const path = require("path");
6
- const migration_test_js_1 = require("../lib/migration-test.js");
6
+ const lib_1 = require("../lib");
7
7
  const collectionPath = path.normalize(path.join(__dirname, '..', 'collection.json'));
8
8
  const testsRoot = path.join(__dirname, 'tests');
9
9
  const files = fs.readdirSync(testsRoot);
10
10
  describe('Tokens radius Migration', () => {
11
11
  it('should update files', async () => {
12
12
  // Arrange
13
- const tree = (0, migration_test_js_1.createTreeFromFiles)(testsRoot, files, '.input.');
14
- const expectedTree = (0, migration_test_js_1.createTreeFromFiles)(testsRoot, files, '.output.');
13
+ const tree = (0, lib_1.createTreeFromFiles)(testsRoot, files, '.input.');
14
+ const expectedTree = (0, lib_1.createTreeFromFiles)(testsRoot, files, '.output.');
15
15
  // Act
16
16
  try {
17
- await (0, migration_test_js_1.runSchematic)('collection', collectionPath, 'tokens-radius', { skipInstallation: true }, tree);
17
+ await (0, lib_1.runSchematic)('collection', collectionPath, 'tokens-radius', { skipInstallation: true }, tree);
18
18
  }
19
19
  catch (error) {
20
20
  // eslint-disable-next-line no-console
21
21
  console.log(error);
22
22
  }
23
23
  // Assert
24
- (0, migration_test_js_1.expectTree)(tree).toMatchTree(expectedTree);
24
+ (0, lib_1.expectTree)(tree).toMatchTree(expectedTree);
25
25
  });
26
26
  // Use this to migrate @lucca-front/* packages
27
27
  it.skip('should migrate @lucca-front/*', async () => {
@@ -33,10 +33,10 @@ describe('Tokens radius Migration', () => {
33
33
  ...glob.sync('packages/ng/**/*', { cwd: lfRoot, nodir: true, ignore: ['**/schematics/**'] }),
34
34
  ...glob.sync('stories/**', { cwd: lfRoot, nodir: true }),
35
35
  ];
36
- const treeOriginalTree = (0, migration_test_js_1.createTreeFromFiles)(lfRoot, lfFiles, '.');
37
- const tree = (0, migration_test_js_1.createTreeFromFiles)(lfRoot, lfFiles, '.');
36
+ const treeOriginalTree = (0, lib_1.createTreeFromFiles)(lfRoot, lfFiles, '.');
37
+ const tree = (0, lib_1.createTreeFromFiles)(lfRoot, lfFiles, '.');
38
38
  // Act
39
- await (0, migration_test_js_1.runSchematic)('collection', collectionPath, 'tokens-radius', { skipInstallation: true }, tree);
39
+ await (0, lib_1.runSchematic)('collection', collectionPath, 'tokens-radius', { skipInstallation: true }, tree);
40
40
  // Assert
41
41
  tree.visit((p, entry) => {
42
42
  const original = treeOriginalTree.get(p)?.content.toString() || '';
@@ -1,14 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const css_mapper_1 = require("../lib/css-mapper");
4
- const lf_schematic_context_1 = require("../lib/lf-schematic-context");
3
+ const lib_1 = require("../lib");
5
4
  // Nx need to see "@angular-devkit/schematics" in order to run this migration correctly (see https://github.com/nrwl/nx/blob/d9fed4b832bf01d1b9a44ae9e486a5e5cd2d2253/packages/nx/src/command-line/migrate/migrate.ts#L1729-L1738)
6
5
  // eslint-disable-next-line @typescript-eslint/no-require-imports
7
6
  require('@angular-devkit/schematics');
8
7
  exports.default = (options) => {
9
8
  return async (tree, context) => {
10
- await lf_schematic_context_1.currentSchematicContext.init(context, options);
11
- await new css_mapper_1.CssMapper(tree, {
9
+ await lib_1.currentSchematicContext.init(context, options);
10
+ await new lib_1.CssMapper(tree, {
12
11
  classes: {
13
12
  'u-margin{tshirt}': 'pr-u-margin{tshirt}',
14
13
  'u-marginTop{tshirt}': 'pr-u-marginTop{tshirt}',
@@ -3,25 +3,25 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const fs = require("fs");
4
4
  const glob = require("glob");
5
5
  const path = require("path");
6
- const migration_test_js_1 = require("../lib/migration-test.js");
6
+ const lib_1 = require("../lib");
7
7
  const collectionPath = path.normalize(path.join(__dirname, '..', 'collection.json'));
8
8
  const testsRoot = path.join(__dirname, 'tests');
9
9
  const files = fs.readdirSync(testsRoot);
10
10
  describe('Tokens spacing Migration', () => {
11
11
  it('should update files', async () => {
12
12
  // Arrange
13
- const tree = (0, migration_test_js_1.createTreeFromFiles)(testsRoot, files, '.input.');
14
- const expectedTree = (0, migration_test_js_1.createTreeFromFiles)(testsRoot, files, '.output.');
13
+ const tree = (0, lib_1.createTreeFromFiles)(testsRoot, files, '.input.');
14
+ const expectedTree = (0, lib_1.createTreeFromFiles)(testsRoot, files, '.output.');
15
15
  // Act
16
16
  try {
17
- await (0, migration_test_js_1.runSchematic)('collection', collectionPath, 'tokens-spacings', { skipInstallation: true }, tree);
17
+ await (0, lib_1.runSchematic)('collection', collectionPath, 'tokens-spacings', { skipInstallation: true }, tree);
18
18
  }
19
19
  catch (error) {
20
20
  // eslint-disable-next-line no-console
21
21
  console.log(error);
22
22
  }
23
23
  // Assert
24
- (0, migration_test_js_1.expectTree)(tree).toMatchTree(expectedTree);
24
+ (0, lib_1.expectTree)(tree).toMatchTree(expectedTree);
25
25
  });
26
26
  // Use this to migrate @lucca-front/* packages
27
27
  it.skip('should migrate @lucca-front/*', async () => {
@@ -33,10 +33,10 @@ describe('Tokens spacing Migration', () => {
33
33
  ...glob.sync('packages/ng/**/*', { cwd: lfRoot, nodir: true, ignore: ['**/schematics/**'] }),
34
34
  ...glob.sync('stories/**', { cwd: lfRoot, nodir: true }),
35
35
  ];
36
- const treeOriginalTree = (0, migration_test_js_1.createTreeFromFiles)(lfRoot, lfFiles, '.');
37
- const tree = (0, migration_test_js_1.createTreeFromFiles)(lfRoot, lfFiles, '.');
36
+ const treeOriginalTree = (0, lib_1.createTreeFromFiles)(lfRoot, lfFiles, '.');
37
+ const tree = (0, lib_1.createTreeFromFiles)(lfRoot, lfFiles, '.');
38
38
  // Act
39
- await (0, migration_test_js_1.runSchematic)('collection', collectionPath, 'tokens-spacings', { skipInstallation: true }, tree);
39
+ await (0, lib_1.runSchematic)('collection', collectionPath, 'tokens-spacings', { skipInstallation: true }, tree);
40
40
  // Assert
41
41
  tree.visit((p, entry) => {
42
42
  const original = treeOriginalTree.get(p)?.content.toString() || '';
@@ -1,14 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const css_mapper_1 = require("../lib/css-mapper");
4
- const lf_schematic_context_1 = require("../lib/lf-schematic-context");
3
+ const lib_1 = require("../lib");
5
4
  // Nx need to see "@angular-devkit/schematics" in order to run this migration correctly (see https://github.com/nrwl/nx/blob/d9fed4b832bf01d1b9a44ae9e486a5e5cd2d2253/packages/nx/src/command-line/migrate/migrate.ts#L1729-L1738)
6
5
  // eslint-disable-next-line @typescript-eslint/no-require-imports
7
6
  require('@angular-devkit/schematics');
8
7
  exports.default = (options) => {
9
8
  return async (tree, context) => {
10
- await lf_schematic_context_1.currentSchematicContext.init(context, options);
11
- await new css_mapper_1.CssMapper(tree, {
9
+ await lib_1.currentSchematicContext.init(context, options);
10
+ await new lib_1.CssMapper(tree, {
12
11
  classes: {},
13
12
  variables: {
14
13
  '--commons-font-family': '--pr-t-font-family',