@lucca-front/ng 21.1.0-rc.1 → 21.1.0-rc.2

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 (256) hide show
  1. package/fesm2022/lucca-front-ng-api.mjs +45 -13
  2. package/fesm2022/lucca-front-ng-api.mjs.map +1 -1
  3. package/fesm2022/lucca-front-ng-app-layout.mjs +2 -2
  4. package/fesm2022/lucca-front-ng-app-layout.mjs.map +1 -1
  5. package/fesm2022/lucca-front-ng-box.mjs +1 -1
  6. package/fesm2022/lucca-front-ng-box.mjs.map +1 -1
  7. package/fesm2022/lucca-front-ng-breadcrumbs.mjs.map +1 -1
  8. package/fesm2022/lucca-front-ng-bubble-icon.mjs +1 -1
  9. package/fesm2022/lucca-front-ng-bubble-icon.mjs.map +1 -1
  10. package/fesm2022/lucca-front-ng-button.mjs +1 -119
  11. package/fesm2022/lucca-front-ng-button.mjs.map +1 -1
  12. package/fesm2022/lucca-front-ng-callout.mjs +13 -39
  13. package/fesm2022/lucca-front-ng-callout.mjs.map +1 -1
  14. package/fesm2022/lucca-front-ng-chip.mjs +3 -33
  15. package/fesm2022/lucca-front-ng-chip.mjs.map +1 -1
  16. package/fesm2022/lucca-front-ng-clear.mjs +2 -17
  17. package/fesm2022/lucca-front-ng-clear.mjs.map +1 -1
  18. package/fesm2022/lucca-front-ng-comment.mjs +18 -20
  19. package/fesm2022/lucca-front-ng-comment.mjs.map +1 -1
  20. package/fesm2022/lucca-front-ng-container.mjs +7 -5
  21. package/fesm2022/lucca-front-ng-container.mjs.map +1 -1
  22. package/fesm2022/lucca-front-ng-core-select-job-qualification.mjs +2 -0
  23. package/fesm2022/lucca-front-ng-core-select-job-qualification.mjs.map +1 -1
  24. package/fesm2022/lucca-front-ng-core-select-user.mjs +2 -2
  25. package/fesm2022/lucca-front-ng-core-select-user.mjs.map +1 -1
  26. package/fesm2022/lucca-front-ng-core-select.mjs +6 -6
  27. package/fesm2022/lucca-front-ng-core-select.mjs.map +1 -1
  28. package/fesm2022/lucca-front-ng-core.mjs +3 -75
  29. package/fesm2022/lucca-front-ng-core.mjs.map +1 -1
  30. package/fesm2022/lucca-front-ng-data-table.mjs +3 -3
  31. package/fesm2022/lucca-front-ng-data-table.mjs.map +1 -1
  32. package/fesm2022/lucca-front-ng-date.mjs +37 -5
  33. package/fesm2022/lucca-front-ng-date.mjs.map +1 -1
  34. package/fesm2022/lucca-front-ng-date2.mjs +20 -32
  35. package/fesm2022/lucca-front-ng-date2.mjs.map +1 -1
  36. package/fesm2022/lucca-front-ng-department.mjs +18 -2
  37. package/fesm2022/lucca-front-ng-department.mjs.map +1 -1
  38. package/fesm2022/lucca-front-ng-dialog.mjs +3 -3
  39. package/fesm2022/lucca-front-ng-dialog.mjs.map +1 -1
  40. package/fesm2022/lucca-front-ng-divider.mjs +1 -10
  41. package/fesm2022/lucca-front-ng-divider.mjs.map +1 -1
  42. package/fesm2022/lucca-front-ng-empty-state.mjs +1 -17
  43. package/fesm2022/lucca-front-ng-empty-state.mjs.map +1 -1
  44. package/fesm2022/lucca-front-ng-establishment.mjs +66 -2
  45. package/fesm2022/lucca-front-ng-establishment.mjs.map +1 -1
  46. package/fesm2022/lucca-front-ng-fancy-box.mjs +0 -12
  47. package/fesm2022/lucca-front-ng-fancy-box.mjs.map +1 -1
  48. package/fesm2022/lucca-front-ng-file-upload.mjs +1 -1
  49. package/fesm2022/lucca-front-ng-file-upload.mjs.map +1 -1
  50. package/fesm2022/lucca-front-ng-filter-pills.mjs +3 -3
  51. package/fesm2022/lucca-front-ng-filter-pills.mjs.map +1 -1
  52. package/fesm2022/lucca-front-ng-footer.mjs +0 -3
  53. package/fesm2022/lucca-front-ng-footer.mjs.map +1 -1
  54. package/fesm2022/lucca-front-ng-form-field.mjs +7 -76
  55. package/fesm2022/lucca-front-ng-form-field.mjs.map +1 -1
  56. package/fesm2022/lucca-front-ng-form-header.mjs +0 -3
  57. package/fesm2022/lucca-front-ng-form-header.mjs.map +1 -1
  58. package/fesm2022/lucca-front-ng-form.mjs +5 -19
  59. package/fesm2022/lucca-front-ng-form.mjs.map +1 -1
  60. package/fesm2022/lucca-front-ng-forms-phone-number-input.mjs +8 -9
  61. package/fesm2022/lucca-front-ng-forms-phone-number-input.mjs.map +1 -1
  62. package/fesm2022/lucca-front-ng-forms-rich-text-input.mjs +34 -51
  63. package/fesm2022/lucca-front-ng-forms-rich-text-input.mjs.map +1 -1
  64. package/fesm2022/lucca-front-ng-forms.mjs +40 -88
  65. package/fesm2022/lucca-front-ng-forms.mjs.map +1 -1
  66. package/fesm2022/lucca-front-ng-gauge.mjs +5 -28
  67. package/fesm2022/lucca-front-ng-gauge.mjs.map +1 -1
  68. package/fesm2022/lucca-front-ng-grid.mjs +3 -3
  69. package/fesm2022/lucca-front-ng-grid.mjs.map +1 -1
  70. package/fesm2022/lucca-front-ng-highlight-data.mjs +26 -31
  71. package/fesm2022/lucca-front-ng-highlight-data.mjs.map +1 -1
  72. package/fesm2022/lucca-front-ng-horizontal-navigation.mjs +0 -3
  73. package/fesm2022/lucca-front-ng-horizontal-navigation.mjs.map +1 -1
  74. package/fesm2022/lucca-front-ng-icon.mjs +1 -42
  75. package/fesm2022/lucca-front-ng-icon.mjs.map +1 -1
  76. package/fesm2022/lucca-front-ng-index-table.mjs +3 -3
  77. package/fesm2022/lucca-front-ng-index-table.mjs.map +1 -1
  78. package/fesm2022/lucca-front-ng-inline-message.mjs +0 -12
  79. package/fesm2022/lucca-front-ng-inline-message.mjs.map +1 -1
  80. package/fesm2022/lucca-front-ng-link.mjs +0 -15
  81. package/fesm2022/lucca-front-ng-link.mjs.map +1 -1
  82. package/fesm2022/lucca-front-ng-listbox.mjs +6 -18
  83. package/fesm2022/lucca-front-ng-listbox.mjs.map +1 -1
  84. package/fesm2022/lucca-front-ng-listing.mjs +8 -37
  85. package/fesm2022/lucca-front-ng-listing.mjs.map +1 -1
  86. package/fesm2022/lucca-front-ng-loading.mjs.map +1 -1
  87. package/fesm2022/lucca-front-ng-main-layout.mjs +2 -8
  88. package/fesm2022/lucca-front-ng-main-layout.mjs.map +1 -1
  89. package/fesm2022/lucca-front-ng-mobile-push.mjs +10 -18
  90. package/fesm2022/lucca-front-ng-mobile-push.mjs.map +1 -1
  91. package/fesm2022/lucca-front-ng-modal.mjs +1 -1
  92. package/fesm2022/lucca-front-ng-modal.mjs.map +1 -1
  93. package/fesm2022/lucca-front-ng-multi-select.mjs +9 -12
  94. package/fesm2022/lucca-front-ng-multi-select.mjs.map +1 -1
  95. package/fesm2022/lucca-front-ng-new-badge.mjs +0 -3
  96. package/fesm2022/lucca-front-ng-new-badge.mjs.map +1 -1
  97. package/fesm2022/lucca-front-ng-numeric-badge.mjs +1 -10
  98. package/fesm2022/lucca-front-ng-numeric-badge.mjs.map +1 -1
  99. package/fesm2022/lucca-front-ng-option.mjs +315 -203
  100. package/fesm2022/lucca-front-ng-option.mjs.map +1 -1
  101. package/fesm2022/lucca-front-ng-page-header.mjs +0 -9
  102. package/fesm2022/lucca-front-ng-page-header.mjs.map +1 -1
  103. package/fesm2022/lucca-front-ng-pagination.mjs +1 -25
  104. package/fesm2022/lucca-front-ng-pagination.mjs.map +1 -1
  105. package/fesm2022/lucca-front-ng-plg-push.mjs +1 -7
  106. package/fesm2022/lucca-front-ng-plg-push.mjs.map +1 -1
  107. package/fesm2022/lucca-front-ng-popover.mjs +33 -1
  108. package/fesm2022/lucca-front-ng-popover.mjs.map +1 -1
  109. package/fesm2022/lucca-front-ng-popover2.mjs +9 -19
  110. package/fesm2022/lucca-front-ng-popover2.mjs.map +1 -1
  111. package/fesm2022/lucca-front-ng-progress-bar.mjs +5 -12
  112. package/fesm2022/lucca-front-ng-progress-bar.mjs.map +1 -1
  113. package/fesm2022/lucca-front-ng-read-more.mjs +1 -16
  114. package/fesm2022/lucca-front-ng-read-more.mjs.map +1 -1
  115. package/fesm2022/lucca-front-ng-resource-card.mjs +7 -7
  116. package/fesm2022/lucca-front-ng-resource-card.mjs.map +1 -1
  117. package/fesm2022/lucca-front-ng-scroll-box.mjs +2 -5
  118. package/fesm2022/lucca-front-ng-scroll-box.mjs.map +1 -1
  119. package/fesm2022/lucca-front-ng-segmented-control-tabs.mjs +3 -9
  120. package/fesm2022/lucca-front-ng-segmented-control-tabs.mjs.map +1 -1
  121. package/fesm2022/lucca-front-ng-segmented-control.mjs +1 -16
  122. package/fesm2022/lucca-front-ng-segmented-control.mjs.map +1 -1
  123. package/fesm2022/lucca-front-ng-simple-select.mjs +6 -21
  124. package/fesm2022/lucca-front-ng-simple-select.mjs.map +1 -1
  125. package/fesm2022/lucca-front-ng-skeleton.mjs +12 -63
  126. package/fesm2022/lucca-front-ng-skeleton.mjs.map +1 -1
  127. package/fesm2022/lucca-front-ng-sortable-list.mjs +1 -25
  128. package/fesm2022/lucca-front-ng-sortable-list.mjs.map +1 -1
  129. package/fesm2022/lucca-front-ng-status-badge.mjs +0 -12
  130. package/fesm2022/lucca-front-ng-status-badge.mjs.map +1 -1
  131. package/fesm2022/lucca-front-ng-tag.mjs +1 -7
  132. package/fesm2022/lucca-front-ng-tag.mjs.map +1 -1
  133. package/fesm2022/lucca-front-ng-time.mjs +16 -55
  134. package/fesm2022/lucca-front-ng-time.mjs.map +1 -1
  135. package/fesm2022/lucca-front-ng-tooltip.mjs +22 -6
  136. package/fesm2022/lucca-front-ng-tooltip.mjs.map +1 -1
  137. package/fesm2022/lucca-front-ng-user-popover.mjs +1 -1
  138. package/fesm2022/lucca-front-ng-user-popover.mjs.map +1 -1
  139. package/fesm2022/lucca-front-ng-user.mjs +25 -9
  140. package/fesm2022/lucca-front-ng-user.mjs.map +1 -1
  141. package/fesm2022/lucca-front-ng-vertical-navigation.mjs +2 -32
  142. package/fesm2022/lucca-front-ng-vertical-navigation.mjs.map +1 -1
  143. package/package.json +5 -7
  144. package/schematics/action-icon/index.js +5 -4
  145. package/schematics/action-icon/migration.js +4 -3
  146. package/schematics/action-icon/migration.spec.js +8 -8
  147. package/schematics/alignment-utilities/index.js +4 -3
  148. package/schematics/alignment-utilities/migration.spec.js +8 -8
  149. package/schematics/cdn-urls/index.js +4 -3
  150. package/schematics/cdn-urls/migration.js +9 -7
  151. package/schematics/cdn-urls/migration.spec.js +8 -8
  152. package/schematics/class-prefix/index.js +4 -3
  153. package/schematics/class-prefix/migration.spec.js +8 -8
  154. package/schematics/collection.json +0 -10
  155. package/schematics/color-text/index.js +4 -3
  156. package/schematics/color-text/migration.spec.js +8 -8
  157. package/schematics/component-path/index.js +4 -3
  158. package/schematics/component-path/migration.spec.js +8 -8
  159. package/schematics/empty-state-title/index.js +7 -5
  160. package/schematics/empty-state-title/migration.spec.js +5 -5
  161. package/schematics/lib/schematic.utils.js +0 -5
  162. package/schematics/lu-button/index.js +4 -3
  163. package/schematics/lu-button/migration.js +11 -5
  164. package/schematics/lu-button/migration.spec.js +5 -5
  165. package/schematics/lu-icon/index.js +4 -3
  166. package/schematics/lu-icon/migration.js +14 -8
  167. package/schematics/lu-icon/migration.spec.js +5 -5
  168. package/schematics/lu-select/index.js +4 -3
  169. package/schematics/lu-select/migration.js +21 -18
  170. package/schematics/lu-select/migration.spec.js +5 -5
  171. package/schematics/lu-select/util.js +19 -17
  172. package/schematics/lu-text-input/index.js +4 -3
  173. package/schematics/lu-text-input/migration.js +28 -22
  174. package/schematics/lu-text-input/migration.spec.js +5 -5
  175. package/schematics/new-icons/index.js +6 -5
  176. package/schematics/new-icons/migration.js +16 -11
  177. package/schematics/new-icons/migration.spec.js +8 -8
  178. package/schematics/palettes/index.js +4 -3
  179. package/schematics/palettes/migration.spec.js +8 -8
  180. package/schematics/tokens-radius/index.js +4 -3
  181. package/schematics/tokens-radius/migration.spec.js +8 -8
  182. package/schematics/tokens-spacing/index.js +4 -3
  183. package/schematics/tokens-spacing/migration.spec.js +8 -8
  184. package/schematics/tokens-typo/index.js +4 -3
  185. package/schematics/tokens-typo/migration.spec.js +8 -8
  186. package/src/components/cdk/_overlay.scss +0 -5
  187. package/src/definitions/option/_option-item.scss +0 -1
  188. package/types/lucca-front-ng-api.d.ts +19 -1
  189. package/types/lucca-front-ng-breadcrumbs.d.ts +1 -1
  190. package/types/lucca-front-ng-button.d.ts +1 -61
  191. package/types/lucca-front-ng-callout.d.ts +2 -32
  192. package/types/lucca-front-ng-chip.d.ts +2 -32
  193. package/types/lucca-front-ng-clear.d.ts +5 -20
  194. package/types/lucca-front-ng-comment.d.ts +11 -19
  195. package/types/lucca-front-ng-container.d.ts +4 -4
  196. package/types/lucca-front-ng-core-select.d.ts +1 -2
  197. package/types/lucca-front-ng-core.d.ts +3 -18
  198. package/types/lucca-front-ng-date.d.ts +19 -1
  199. package/types/lucca-front-ng-date2.d.ts +1 -2
  200. package/types/lucca-front-ng-department.d.ts +10 -1
  201. package/types/lucca-front-ng-divider.d.ts +0 -10
  202. package/types/lucca-front-ng-empty-state.d.ts +0 -16
  203. package/types/lucca-front-ng-establishment.d.ts +37 -1
  204. package/types/lucca-front-ng-fancy-box.d.ts +0 -12
  205. package/types/lucca-front-ng-footer.d.ts +0 -3
  206. package/types/lucca-front-ng-form-field.d.ts +4 -34
  207. package/types/lucca-front-ng-form-header.d.ts +0 -3
  208. package/types/lucca-front-ng-form.d.ts +5 -9
  209. package/types/lucca-front-ng-forms-phone-number-input.d.ts +0 -1
  210. package/types/lucca-front-ng-forms-rich-text-input.d.ts +0 -2
  211. package/types/lucca-front-ng-forms.d.ts +4 -16
  212. package/types/lucca-front-ng-gauge.d.ts +0 -25
  213. package/types/lucca-front-ng-grid.d.ts +1 -1
  214. package/types/lucca-front-ng-highlight-data.d.ts +15 -36
  215. package/types/lucca-front-ng-horizontal-navigation.d.ts +0 -3
  216. package/types/lucca-front-ng-icon.d.ts +1 -32
  217. package/types/lucca-front-ng-inline-message.d.ts +0 -12
  218. package/types/lucca-front-ng-link.d.ts +0 -15
  219. package/types/lucca-front-ng-listbox.d.ts +4 -16
  220. package/types/lucca-front-ng-listing.d.ts +2 -33
  221. package/types/lucca-front-ng-main-layout.d.ts +0 -6
  222. package/types/lucca-front-ng-mobile-push.d.ts +0 -7
  223. package/types/lucca-front-ng-new-badge.d.ts +0 -3
  224. package/types/lucca-front-ng-numeric-badge.d.ts +0 -9
  225. package/types/lucca-front-ng-option.d.ts +141 -78
  226. package/types/lucca-front-ng-page-header.d.ts +0 -9
  227. package/types/lucca-front-ng-pagination.d.ts +0 -24
  228. package/types/lucca-front-ng-plg-push.d.ts +0 -6
  229. package/types/lucca-front-ng-popover.d.ts +20 -1
  230. package/types/lucca-front-ng-popover2.d.ts +3 -5
  231. package/types/lucca-front-ng-progress-bar.d.ts +0 -9
  232. package/types/lucca-front-ng-read-more.d.ts +1 -16
  233. package/types/lucca-front-ng-resource-card.d.ts +0 -6
  234. package/types/lucca-front-ng-scroll-box.d.ts +1 -4
  235. package/types/lucca-front-ng-segmented-control-tabs.d.ts +1 -7
  236. package/types/lucca-front-ng-segmented-control.d.ts +1 -16
  237. package/types/lucca-front-ng-skeleton.d.ts +6 -61
  238. package/types/lucca-front-ng-sortable-list.d.ts +0 -24
  239. package/types/lucca-front-ng-status-badge.d.ts +0 -12
  240. package/types/lucca-front-ng-tag.d.ts +0 -6
  241. package/types/lucca-front-ng-time.d.ts +10 -16
  242. package/types/lucca-front-ng-tooltip.d.ts +11 -2
  243. package/types/lucca-front-ng-user.d.ts +11 -2
  244. package/types/lucca-front-ng-vertical-navigation.d.ts +0 -30
  245. package/fesm2022/lucca-front-ng-text-flow.mjs +0 -20
  246. package/fesm2022/lucca-front-ng-text-flow.mjs.map +0 -1
  247. package/schematics/lib/index.js +0 -29
  248. package/schematics/lu-container/index.js +0 -23
  249. package/schematics/lu-container/migration.js +0 -116
  250. package/schematics/lu-container/migration.spec.js +0 -23
  251. package/schematics/lu-container/schema.json +0 -23
  252. package/schematics/lu-loading/index.js +0 -23
  253. package/schematics/lu-loading/migration.js +0 -136
  254. package/schematics/lu-loading/migration.spec.js +0 -23
  255. package/schematics/lu-loading/schema.json +0 -28
  256. package/types/lucca-front-ng-text-flow.d.ts +0 -8
@@ -1,23 +1,24 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const lib_1 = require("../lib");
3
+ const schematics_1 = require("../lib/schematics");
4
4
  const migration_1 = require("./migration");
5
+ const lf_schematic_context_1 = require("../lib/lf-schematic-context");
5
6
  // 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
7
  // eslint-disable-next-line @typescript-eslint/no-require-imports
7
8
  require('@angular-devkit/schematics');
8
9
  exports.default = (options) => {
9
10
  return async (tree, context) => {
10
- await lib_1.currentSchematicContext.init(context, options);
11
+ await lf_schematic_context_1.currentSchematicContext.init(context, options);
11
12
  const postCssScss = await Promise.resolve().then(() => require('../lib/local-deps/postcss-scss.js'));
12
13
  tree.visit((path, entry) => {
13
14
  if (path.includes('node_modules') || !entry) {
14
15
  return;
15
16
  }
16
17
  if (path.endsWith('.scss')) {
17
- (0, lib_1.migrateFile)(path, entry, tree, (content) => (0, migration_1.migrateScssFile)(content, postCssScss));
18
+ (0, schematics_1.migrateFile)(path, entry, tree, (content) => (0, migration_1.migrateScssFile)(content, postCssScss));
18
19
  }
19
20
  if (path.endsWith('.html')) {
20
- (0, lib_1.migrateFile)(path, entry, tree, (content) => (0, migration_1.migrateHTMLFile)(content));
21
+ (0, schematics_1.migrateFile)(path, entry, tree, (content) => (0, migration_1.migrateHTMLFile)(content));
21
22
  }
22
23
  });
23
24
  };
@@ -2,7 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.migrateScssFile = migrateScssFile;
4
4
  exports.migrateHTMLFile = migrateHTMLFile;
5
- const lib_1 = require("../lib");
5
+ const file_update_js_1 = require("../lib/file-update.js");
6
+ const html_ast_js_1 = require("../lib/html-ast.js");
6
7
  function migrateScssFile(content, postCssScss) {
7
8
  const root = postCssScss.parse(content);
8
9
  root.walkRules((rule) => {
@@ -14,8 +15,8 @@ function migrateScssFile(content, postCssScss) {
14
15
  return root.toResult({ syntax: { stringify: postCssScss.stringify } }).css;
15
16
  }
16
17
  function migrateHTMLFile(content) {
17
- return (0, lib_1.updateContent)(content, (updates) => {
18
- const htmlAst = new lib_1.HtmlAst(content);
18
+ return (0, file_update_js_1.updateContent)(content, (updates) => {
19
+ const htmlAst = new html_ast_js_1.HtmlAst(content);
19
20
  htmlAst.visitElementWithAttribute(/.*/, 'class', (_elem, attr) => {
20
21
  const classes = attr.value;
21
22
  if (classes.includes('actionIcon') && attr.valueSpan) {
@@ -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 lib_1 = require("../lib");
6
+ const migration_test_js_1 = require("../lib/migration-test.js");
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('actionIcon Migration', () => {
11
11
  it('should update files', async () => {
12
12
  // Arrange
13
- const tree = (0, lib_1.createTreeFromFiles)(testsRoot, files, '.input.');
14
- const expectedTree = (0, lib_1.createTreeFromFiles)(testsRoot, files, '.output.');
13
+ const tree = (0, migration_test_js_1.createTreeFromFiles)(testsRoot, files, '.input.');
14
+ const expectedTree = (0, migration_test_js_1.createTreeFromFiles)(testsRoot, files, '.output.');
15
15
  // Act
16
16
  try {
17
- await (0, lib_1.runSchematic)('collection', collectionPath, 'action-icon', { skipInstallation: true }, tree);
17
+ await (0, migration_test_js_1.runSchematic)('collection', collectionPath, 'action-icon', { 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, lib_1.expectTree)(tree).toMatchTree(expectedTree);
24
+ (0, migration_test_js_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('actionIcon 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, lib_1.createTreeFromFiles)(lfRoot, lfFiles, '.');
37
- const tree = (0, lib_1.createTreeFromFiles)(lfRoot, lfFiles, '.');
36
+ const treeOriginalTree = (0, migration_test_js_1.createTreeFromFiles)(lfRoot, lfFiles, '.');
37
+ const tree = (0, migration_test_js_1.createTreeFromFiles)(lfRoot, lfFiles, '.');
38
38
  // Act
39
- await (0, lib_1.runSchematic)('collection', collectionPath, 'action-icon', { skipInstallation: true }, tree);
39
+ await (0, migration_test_js_1.runSchematic)('collection', collectionPath, 'action-icon', { skipInstallation: true }, tree);
40
40
  // Assert
41
41
  tree.visit((p, entry) => {
42
42
  const original = treeOriginalTree.get(p)?.content.toString() || '';
@@ -1,13 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const lib_1 = require("../lib");
3
+ const css_mapper_1 = require("../lib/css-mapper");
4
+ const lf_schematic_context_1 = require("../lib/lf-schematic-context");
4
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)
5
6
  // eslint-disable-next-line @typescript-eslint/no-require-imports
6
7
  require('@angular-devkit/schematics');
7
8
  exports.default = (options) => {
8
9
  return async (tree, context) => {
9
- await lib_1.currentSchematicContext.init(context, options);
10
- await new lib_1.CssMapper(tree, {
10
+ await lf_schematic_context_1.currentSchematicContext.init(context, options);
11
+ await new css_mapper_1.CssMapper(tree, {
11
12
  classes: {
12
13
  'u-textLeft': 'pr-u-textAlignStart',
13
14
  'u-textCenter': 'pr-u-textAlignCenter',
@@ -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 lib_1 = require("../lib");
6
+ const migration_test_js_1 = require("../lib/migration-test.js");
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('Alignment utilities Migration', () => {
11
11
  it('should update files', async () => {
12
12
  // Arrange
13
- const tree = (0, lib_1.createTreeFromFiles)(testsRoot, files, '.input.');
14
- const expectedTree = (0, lib_1.createTreeFromFiles)(testsRoot, files, '.output.');
13
+ const tree = (0, migration_test_js_1.createTreeFromFiles)(testsRoot, files, '.input.');
14
+ const expectedTree = (0, migration_test_js_1.createTreeFromFiles)(testsRoot, files, '.output.');
15
15
  // Act
16
16
  try {
17
- await (0, lib_1.runSchematic)('collection', collectionPath, 'alignment-utilities', { skipInstallation: true }, tree);
17
+ await (0, migration_test_js_1.runSchematic)('collection', collectionPath, 'alignment-utilities', { 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, lib_1.expectTree)(tree).toMatchTree(expectedTree);
24
+ (0, migration_test_js_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('Alignment utilities 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, lib_1.createTreeFromFiles)(lfRoot, lfFiles, '.');
37
- const tree = (0, lib_1.createTreeFromFiles)(lfRoot, lfFiles, '.');
36
+ const treeOriginalTree = (0, migration_test_js_1.createTreeFromFiles)(lfRoot, lfFiles, '.');
37
+ const tree = (0, migration_test_js_1.createTreeFromFiles)(lfRoot, lfFiles, '.');
38
38
  // Act
39
- await (0, lib_1.runSchematic)('collection', collectionPath, 'alignment-utilities', { skipInstallation: true }, tree);
39
+ await (0, migration_test_js_1.runSchematic)('collection', collectionPath, 'alignment-utilities', { skipInstallation: true }, tree);
40
40
  // Assert
41
41
  tree.visit((p, entry) => {
42
42
  const original = treeOriginalTree.get(p)?.content.toString() || '';
@@ -1,19 +1,20 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const lib_1 = require("../lib");
3
+ const schematics_1 = require("../lib/schematics");
4
4
  const migration_1 = require("./migration");
5
+ const lf_schematic_context_1 = require("../lib/lf-schematic-context");
5
6
  // 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
7
  // eslint-disable-next-line @typescript-eslint/no-require-imports
7
8
  require('@angular-devkit/schematics');
8
9
  exports.default = (options) => {
9
10
  return async (tree, context) => {
10
- await lib_1.currentSchematicContext.init(context, options);
11
+ await lf_schematic_context_1.currentSchematicContext.init(context, options);
11
12
  tree.visit((path, entry) => {
12
13
  if (path.includes('node_modules') || !entry) {
13
14
  return;
14
15
  }
15
16
  if (path.endsWith('.html')) {
16
- (0, lib_1.migrateFile)(path, entry, tree, (content) => (0, migration_1.migrateHTMLFile)(content));
17
+ (0, schematics_1.migrateFile)(path, entry, tree, (content) => (0, migration_1.migrateHTMLFile)(content));
17
18
  }
18
19
  });
19
20
  };
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.migrateHTMLFile = migrateHTMLFile;
4
- const lib_1 = require("../lib");
4
+ const file_update_js_1 = require("../lib/file-update.js");
5
+ const html_ast_js_1 = require("../lib/html-ast.js");
6
+ const lf_schematic_context_1 = require("../lib/lf-schematic-context");
5
7
  const REPLACE_MAP = {
6
8
  'https://cdn.lucca.fr/development': 'https://cdn.lucca.fr/archives/development',
7
9
  'https://cdn.lucca.fr/errors': 'https://cdn.lucca.fr/archives/errors',
@@ -42,14 +44,14 @@ const REPLACE_MAP = {
42
44
  'https://cdn.lucca.fr/figgo-slack-status.png': 'https://cdn.lucca.fr/archives/figgo-slack-status.png'
43
45
  };
44
46
  function migrateHTMLFile(content) {
45
- return (0, lib_1.updateContent)(content, (updates) => {
46
- const htmlAst = new lib_1.HtmlAst(content);
47
+ return (0, file_update_js_1.updateContent)(content, (updates) => {
48
+ const htmlAst = new html_ast_js_1.HtmlAst(content);
47
49
  htmlAst.visitNodes((node) => {
48
- if (node instanceof lib_1.currentSchematicContext.angularCompiler.TmplAstElement) {
50
+ if (node instanceof lf_schematic_context_1.currentSchematicContext.angularCompiler.TmplAstElement) {
49
51
  node.attributes.forEach((attr) => {
50
52
  const match = findURLMatch(attr.value);
51
53
  if (match && attr.valueSpan) {
52
- lib_1.currentSchematicContext.logSuccess(`Replacing ${match} with ${attr.value.replace(match, REPLACE_MAP[match])}`);
54
+ lf_schematic_context_1.currentSchematicContext.logSuccess(`Replacing ${match} with ${attr.value.replace(match, REPLACE_MAP[match])}`);
53
55
  updates.push({
54
56
  position: attr.valueSpan?.start.offset,
55
57
  oldContent: attr.value,
@@ -58,10 +60,10 @@ function migrateHTMLFile(content) {
58
60
  }
59
61
  });
60
62
  node.inputs.forEach((input) => {
61
- if (input.value instanceof lib_1.currentSchematicContext.angularCompiler.ASTWithSource) {
63
+ if (input.value instanceof lf_schematic_context_1.currentSchematicContext.angularCompiler.ASTWithSource) {
62
64
  const match = findURLMatch(input.value?.source || '');
63
65
  if (input.value?.source && match) {
64
- lib_1.currentSchematicContext.logSuccess(`Replacing ${input.value.source} with ${input.value.source.replace(match, REPLACE_MAP[match])}`);
66
+ lf_schematic_context_1.currentSchematicContext.logSuccess(`Replacing ${input.value.source} with ${input.value.source.replace(match, REPLACE_MAP[match])}`);
65
67
  updates.push({
66
68
  position: input.value?.sourceSpan.start,
67
69
  oldContent: input.value.source,
@@ -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 lib_1 = require("../lib");
6
+ const migration_test_js_1 = require("../lib/migration-test.js");
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('cdnUrls Migration', () => {
11
11
  it('should update files', async () => {
12
12
  // Arrange
13
- const tree = (0, lib_1.createTreeFromFiles)(testsRoot, files, '.input.');
14
- const expectedTree = (0, lib_1.createTreeFromFiles)(testsRoot, files, '.output.');
13
+ const tree = (0, migration_test_js_1.createTreeFromFiles)(testsRoot, files, '.input.');
14
+ const expectedTree = (0, migration_test_js_1.createTreeFromFiles)(testsRoot, files, '.output.');
15
15
  // Act
16
16
  try {
17
- await (0, lib_1.runSchematic)('collection', collectionPath, 'cdn-urls', { skipInstallation: true }, tree);
17
+ await (0, migration_test_js_1.runSchematic)('collection', collectionPath, 'cdn-urls', { 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, lib_1.expectTree)(tree).toMatchTree(expectedTree);
24
+ (0, migration_test_js_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('cdnUrls 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, lib_1.createTreeFromFiles)(lfRoot, lfFiles, '.');
37
- const tree = (0, lib_1.createTreeFromFiles)(lfRoot, lfFiles, '.');
36
+ const treeOriginalTree = (0, migration_test_js_1.createTreeFromFiles)(lfRoot, lfFiles, '.');
37
+ const tree = (0, migration_test_js_1.createTreeFromFiles)(lfRoot, lfFiles, '.');
38
38
  // Act
39
- await (0, lib_1.runSchematic)('collection', collectionPath, 'cdn-urls', { skipInstallation: true }, tree);
39
+ await (0, migration_test_js_1.runSchematic)('collection', collectionPath, 'cdn-urls', { skipInstallation: true }, tree);
40
40
  // Assert
41
41
  tree.visit((p, entry) => {
42
42
  const original = treeOriginalTree.get(p)?.content.toString() || '';
@@ -1,13 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const lib_1 = require("../lib");
3
+ const css_mapper_1 = require("../lib/css-mapper");
4
+ const lf_schematic_context_1 = require("../lib/lf-schematic-context");
4
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)
5
6
  // eslint-disable-next-line @typescript-eslint/no-require-imports
6
7
  require('@angular-devkit/schematics');
7
8
  exports.default = (options) => {
8
9
  return async (tree, context) => {
9
- await lib_1.currentSchematicContext.init(context, options);
10
- await new lib_1.CssMapper(tree, {
10
+ await lf_schematic_context_1.currentSchematicContext.init(context, options);
11
+ await new css_mapper_1.CssMapper(tree, {
11
12
  classes: {
12
13
  "u-floatLeft": "pr-u-floatLeft",
13
14
  "u-floatRight": "pr-u-floatRight",
@@ -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 lib_1 = require("../lib");
6
+ const migration_test_js_1 = require("../lib/migration-test.js");
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('Class prefix Migration', () => {
11
11
  it('should update files', async () => {
12
12
  // Arrange
13
- const tree = (0, lib_1.createTreeFromFiles)(testsRoot, files, '.input.');
14
- const expectedTree = (0, lib_1.createTreeFromFiles)(testsRoot, files, '.output.');
13
+ const tree = (0, migration_test_js_1.createTreeFromFiles)(testsRoot, files, '.input.');
14
+ const expectedTree = (0, migration_test_js_1.createTreeFromFiles)(testsRoot, files, '.output.');
15
15
  // Act
16
16
  try {
17
- await (0, lib_1.runSchematic)('collection', collectionPath, 'class-prefix', { skipInstallation: true }, tree);
17
+ await (0, migration_test_js_1.runSchematic)('collection', collectionPath, 'class-prefix', { 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, lib_1.expectTree)(tree).toMatchTree(expectedTree);
24
+ (0, migration_test_js_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('Class prefix 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, lib_1.createTreeFromFiles)(lfRoot, lfFiles, '.');
37
- const tree = (0, lib_1.createTreeFromFiles)(lfRoot, lfFiles, '.');
36
+ const treeOriginalTree = (0, migration_test_js_1.createTreeFromFiles)(lfRoot, lfFiles, '.');
37
+ const tree = (0, migration_test_js_1.createTreeFromFiles)(lfRoot, lfFiles, '.');
38
38
  // Act
39
- await (0, lib_1.runSchematic)('collection', collectionPath, 'class-prefix', { skipInstallation: true }, tree);
39
+ await (0, migration_test_js_1.runSchematic)('collection', collectionPath, 'class-prefix', { skipInstallation: true }, tree);
40
40
  // Assert
41
41
  tree.visit((p, entry) => {
42
42
  const original = treeOriginalTree.get(p)?.content.toString() || '';
@@ -76,16 +76,6 @@
76
76
  "factory": "./lu-icon/index",
77
77
  "schema": "./lu-icon/schema.json"
78
78
  },
79
- "lu-loading": {
80
- "description": "Migrate HTML loading to the new lu-loading component",
81
- "factory": "./lu-loading/index",
82
- "schema": "./lu-loading/schema.json"
83
- },
84
- "lu-container": {
85
- "description": "Migrate HTML container to the new lu-container component",
86
- "factory": "./lu-container/index",
87
- "schema": "./lu-container/schema.json"
88
- },
89
79
  "lu-button": {
90
80
  "description": "Migrate CSS-only buttons to the new luButton component",
91
81
  "factory": "./lu-button/index",
@@ -1,13 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const lib_1 = require("../lib");
3
+ const css_mapper_1 = require("../lib/css-mapper");
4
+ const lf_schematic_context_1 = require("../lib/lf-schematic-context");
4
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)
5
6
  // eslint-disable-next-line @typescript-eslint/no-require-imports
6
7
  require('@angular-devkit/schematics');
7
8
  exports.default = (options) => {
8
9
  return async (tree, context) => {
9
- await lib_1.currentSchematicContext.init(context, options);
10
- await new lib_1.CssMapper(tree, {
10
+ await lf_schematic_context_1.currentSchematicContext.init(context, options);
11
+ await new css_mapper_1.CssMapper(tree, {
11
12
  classes: {
12
13
  'pr-u-textProduct': 'pr-u-colorTextProduct',
13
14
  'pr-u-textPrimary': 'pr-u-colorTextProduct',
@@ -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 lib_1 = require("../lib");
6
+ const migration_test_js_1 = require("../lib/migration-test.js");
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('Color Text Migration', () => {
11
11
  it('should update files', async () => {
12
12
  // Arrange
13
- const tree = (0, lib_1.createTreeFromFiles)(testsRoot, files, '.input.');
14
- const expectedTree = (0, lib_1.createTreeFromFiles)(testsRoot, files, '.output.');
13
+ const tree = (0, migration_test_js_1.createTreeFromFiles)(testsRoot, files, '.input.');
14
+ const expectedTree = (0, migration_test_js_1.createTreeFromFiles)(testsRoot, files, '.output.');
15
15
  // Act
16
16
  try {
17
- await (0, lib_1.runSchematic)('collection', collectionPath, 'color-text', { skipInstallation: true }, tree);
17
+ await (0, migration_test_js_1.runSchematic)('collection', collectionPath, 'color-text', { 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, lib_1.expectTree)(tree).toMatchTree(expectedTree);
24
+ (0, migration_test_js_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('Color Text 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, lib_1.createTreeFromFiles)(lfRoot, lfFiles, '.');
37
- const tree = (0, lib_1.createTreeFromFiles)(lfRoot, lfFiles, '.');
36
+ const treeOriginalTree = (0, migration_test_js_1.createTreeFromFiles)(lfRoot, lfFiles, '.');
37
+ const tree = (0, migration_test_js_1.createTreeFromFiles)(lfRoot, lfFiles, '.');
38
38
  // Act
39
- await (0, lib_1.runSchematic)('collection', collectionPath, 'color-text', { skipInstallation: true }, tree);
39
+ await (0, migration_test_js_1.runSchematic)('collection', collectionPath, 'color-text', { skipInstallation: true }, tree);
40
40
  // Assert
41
41
  tree.visit((p, entry) => {
42
42
  const original = treeOriginalTree.get(p)?.content.toString() || '';
@@ -1,13 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const lib_1 = require("../lib");
3
+ const component_mapper_1 = require("../lib/component-mapper");
4
+ const lf_schematic_context_1 = require("../lib/lf-schematic-context");
4
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)
5
6
  // eslint-disable-next-line @typescript-eslint/no-require-imports
6
7
  require('@angular-devkit/schematics');
7
8
  exports.default = (options) => {
8
9
  return async (tree, context) => {
9
- await lib_1.currentSchematicContext.init(context, options);
10
- new lib_1.ComponentMapper(tree, {
10
+ await lf_schematic_context_1.currentSchematicContext.init(context, options);
11
+ new component_mapper_1.ComponentMapper(tree, {
11
12
  paths: {
12
13
  "@lucca-front/ng/scrollBox": "@lucca-front/ng/scroll-box",
13
14
  "@lucca-front/ng/segmentedControl": "@lucca-front/ng/segmented-control",
@@ -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 lib_1 = require("../lib");
6
+ const migration_test_js_1 = require("../lib/migration-test.js");
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('Component path Migration', () => {
11
11
  it('should update files', async () => {
12
12
  // Arrange
13
- const tree = (0, lib_1.createTreeFromFiles)(testsRoot, files, '.input.');
14
- const expectedTree = (0, lib_1.createTreeFromFiles)(testsRoot, files, '.output.');
13
+ const tree = (0, migration_test_js_1.createTreeFromFiles)(testsRoot, files, '.input.');
14
+ const expectedTree = (0, migration_test_js_1.createTreeFromFiles)(testsRoot, files, '.output.');
15
15
  // Act
16
16
  try {
17
- await (0, lib_1.runSchematic)('collection', collectionPath, 'component-path', { skipInstallation: true }, tree);
17
+ await (0, migration_test_js_1.runSchematic)('collection', collectionPath, 'component-path', { 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, lib_1.expectTree)(tree).toMatchTree(expectedTree);
24
+ (0, migration_test_js_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('Component path 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, lib_1.createTreeFromFiles)(lfRoot, lfFiles, '.');
37
- const tree = (0, lib_1.createTreeFromFiles)(lfRoot, lfFiles, '.');
36
+ const treeOriginalTree = (0, migration_test_js_1.createTreeFromFiles)(lfRoot, lfFiles, '.');
37
+ const tree = (0, migration_test_js_1.createTreeFromFiles)(lfRoot, lfFiles, '.');
38
38
  // Act
39
- await (0, lib_1.runSchematic)('collection', collectionPath, 'component-path', { skipInstallation: true }, tree);
39
+ await (0, migration_test_js_1.runSchematic)('collection', collectionPath, 'component-path', { skipInstallation: true }, tree);
40
40
  // Assert
41
41
  tree.visit((p, entry) => {
42
42
  const original = treeOriginalTree.get(p)?.content.toString() || '';
@@ -1,19 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const lib_1 = require("../lib");
3
+ const angular_template_1 = require("../lib/angular-template");
4
+ const schematics_1 = require("../lib/schematics");
5
+ const lf_schematic_context_1 = require("../lib/lf-schematic-context");
4
6
  // 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)
5
7
  // eslint-disable-next-line @typescript-eslint/no-require-imports
6
8
  require('@angular-devkit/schematics');
7
9
  exports.default = (options) => {
8
10
  return async (tree, context) => {
9
- await lib_1.currentSchematicContext.init(context, options);
11
+ await lf_schematic_context_1.currentSchematicContext.init(context, options);
10
12
  tree.visit((path, entry) => {
11
13
  if (path.includes('node_modules') || !entry) {
12
14
  return;
13
15
  }
14
- (0, lib_1.migrateFile)(path, entry, tree, (content) => (0, lib_1.updateAngularTemplate)(path, content, (template) => {
15
- template = (0, lib_1.replaceComponentInputName)('lu-empty-state-page', 'title', 'heading', template);
16
- template = (0, lib_1.replaceComponentInputName)('lu-empty-state-section', 'title', 'heading', template);
16
+ (0, schematics_1.migrateFile)(path, entry, tree, (content) => (0, angular_template_1.updateAngularTemplate)(path, content, (template) => {
17
+ template = (0, angular_template_1.replaceComponentInputName)('lu-empty-state-page', 'title', 'heading', template);
18
+ template = (0, angular_template_1.replaceComponentInputName)('lu-empty-state-section', 'title', 'heading', template);
17
19
  return template;
18
20
  }));
19
21
  });
@@ -2,24 +2,24 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const fs = require("fs");
4
4
  const path = require("path");
5
- const lib_1 = require("../lib");
5
+ const migration_test_js_1 = require("../lib/migration-test.js");
6
6
  const collectionPath = path.normalize(path.join(__dirname, '..', 'migrations.json'));
7
7
  const testsRoot = path.join(__dirname, 'tests');
8
8
  const files = fs.readdirSync(testsRoot);
9
9
  describe('Empty state title migration', () => {
10
10
  it('should update files', async () => {
11
11
  // Arrange
12
- const tree = (0, lib_1.createTreeFromFiles)(testsRoot, files, '.input.');
13
- const expectedTree = (0, lib_1.createTreeFromFiles)(testsRoot, files, '.output.');
12
+ const tree = (0, migration_test_js_1.createTreeFromFiles)(testsRoot, files, '.input.');
13
+ const expectedTree = (0, migration_test_js_1.createTreeFromFiles)(testsRoot, files, '.output.');
14
14
  // Act
15
15
  try {
16
- await (0, lib_1.runSchematic)('collection', collectionPath, 'empty-state-heading', { skipInstallation: true }, tree);
16
+ await (0, migration_test_js_1.runSchematic)('collection', collectionPath, 'empty-state-heading', { skipInstallation: true }, tree);
17
17
  }
18
18
  catch (error) {
19
19
  // eslint-disable-next-line no-console
20
20
  console.log(error);
21
21
  }
22
22
  // Assert
23
- (0, lib_1.expectTree)(tree).toMatchTree(expectedTree);
23
+ (0, migration_test_js_1.expectTree)(tree).toMatchTree(expectedTree);
24
24
  });
25
25
  });
@@ -3,8 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.camelize = camelize;
4
4
  exports.pascalize = pascalize;
5
5
  exports.expand = expand;
6
- exports.isInterestingNode = isInterestingNode;
7
- const lf_schematic_context_1 = require("./lf-schematic-context");
8
6
  function camelize(str) {
9
7
  return str[0].toLowerCase() + str.slice(1);
10
8
  }
@@ -29,6 +27,3 @@ function expand(rawMapping, mappingProps) {
29
27
  return values;
30
28
  }));
31
29
  }
32
- function isInterestingNode(node) {
33
- return node instanceof lf_schematic_context_1.currentSchematicContext.angularCompiler.TmplAstElement;
34
- }
@@ -1,19 +1,20 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const typescript_1 = require("typescript");
4
- const lib_1 = require("../lib");
4
+ const lf_schematic_context_1 = require("../lib/lf-schematic-context");
5
+ const schematics_1 = require("../lib/schematics");
5
6
  const migration_1 = require("./migration");
6
7
  // 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
8
  require('@angular-devkit/schematics');
8
9
  exports.default = (options) => {
9
10
  return async (tree, context) => {
10
- await lib_1.currentSchematicContext.init(context, options);
11
+ await lf_schematic_context_1.currentSchematicContext.init(context, options);
11
12
  tree.visit((path, entry) => {
12
13
  if (path.includes('node_modules') || !entry) {
13
14
  return;
14
15
  }
15
16
  if (path.endsWith('.ts')) {
16
- (0, lib_1.migrateFile)(path, entry, tree, (content) => {
17
+ (0, schematics_1.migrateFile)(path, entry, tree, (content) => {
17
18
  const sourceFile = (0, typescript_1.createSourceFile)(path, content, typescript_1.ScriptTarget.ESNext);
18
19
  return (0, migration_1.migrateComponent)(sourceFile, path, tree);
19
20
  });