@rxap/layout 19.2.6 → 21.0.1-dev.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 (280) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/compodoc/changelog.html +53 -0
  3. package/compodoc/components/AppsButtonComponent.html +26 -15
  4. package/compodoc/components/LayoutComponent.html +23 -31
  5. package/compodoc/components/NavigationComponent.html +46 -89
  6. package/compodoc/components/NavigationItemComponent.html +98 -214
  7. package/compodoc/components/SettingsButtonComponent.html +46 -46
  8. package/compodoc/components/SidenavComponent.html +43 -44
  9. package/compodoc/components/SidenavToggleButtonComponent.html +15 -5
  10. package/compodoc/dependencies.html +20 -20
  11. package/compodoc/directives/SidenavFooterDirective.html +4 -74
  12. package/compodoc/directives/SidenavHeaderDirective.html +4 -74
  13. package/compodoc/injectables/LayoutService.html +24 -67
  14. package/compodoc/injectables/NavigationService.html +20 -72
  15. package/compodoc/js/search/search_index.js +2 -2
  16. package/compodoc/properties.html +1 -1
  17. package/docs/documentation.json +1916 -2607
  18. package/docs/html/assets/search.js +1 -1
  19. package/docs/html/classes/AppsButtonComponent.html +4 -10
  20. package/docs/html/classes/BaseLayoutComponent.html +2 -2
  21. package/docs/html/classes/DefaultHeaderComponent.html +2 -2
  22. package/docs/html/classes/DefaultHeaderService.html +5 -5
  23. package/docs/html/classes/ExternalAppsService.html +2 -2
  24. package/docs/html/classes/FooterComponent.html +2 -2
  25. package/docs/html/classes/FooterDirective.html +3 -3
  26. package/docs/html/classes/FooterService.html +5 -5
  27. package/docs/html/classes/HeaderComponent.html +2 -2
  28. package/docs/html/classes/HeaderDirective.html +3 -3
  29. package/docs/html/classes/HeaderService.html +5 -5
  30. package/docs/html/classes/LayoutComponent.html +2 -2
  31. package/docs/html/classes/LayoutService.html +2 -2
  32. package/docs/html/classes/LogoService.html +2 -2
  33. package/docs/html/classes/MinimalLayoutComponent.html +2 -2
  34. package/docs/html/classes/NavigationComponent.html +2 -9
  35. package/docs/html/classes/NavigationItemComponent.html +3 -19
  36. package/docs/html/classes/NavigationProgressBarComponent.html +2 -2
  37. package/docs/html/classes/NavigationService.html +3 -3
  38. package/docs/html/classes/ReleaseInfoComponent.html +2 -2
  39. package/docs/html/classes/SettingsButtonComponent.html +2 -2
  40. package/docs/html/classes/SidenavComponent.html +3 -3
  41. package/docs/html/classes/SidenavFooterDirective.html +2 -2
  42. package/docs/html/classes/SidenavHeaderDirective.html +2 -2
  43. package/docs/html/classes/SidenavToggleButtonComponent.html +2 -2
  44. package/docs/html/classes/UserProfileIconComponent.html +2 -2
  45. package/docs/html/functions/IsNavigationDividerItem.html +1 -1
  46. package/docs/html/functions/IsNavigationInsertItem.html +1 -1
  47. package/docs/html/functions/IsNavigationItem.html +1 -1
  48. package/docs/html/functions/provideExternalApps.html +1 -1
  49. package/docs/html/functions/provideLayout.html +1 -1
  50. package/docs/html/functions/withDefaultHeaderComponent.html +1 -1
  51. package/docs/html/functions/withDefaultHeaderItems.html +1 -1
  52. package/docs/html/functions/withFooterComponents.html +1 -1
  53. package/docs/html/functions/withHeaderComponents.html +1 -1
  54. package/docs/html/functions/withNavigationConfig.html +1 -1
  55. package/docs/html/functions/withNavigationInserts.html +1 -1
  56. package/docs/html/functions/withReleaseInfoModules.html +1 -1
  57. package/docs/html/functions/withSettingsMenuItems.html +1 -1
  58. package/docs/html/functions/withUserProfileDataSource.html +1 -1
  59. package/docs/html/index.html +2 -2
  60. package/docs/html/interfaces/NavigationDividerItem.html +2 -2
  61. package/docs/html/interfaces/NavigationInsertItem.html +2 -2
  62. package/docs/html/interfaces/NavigationItem.html +2 -2
  63. package/docs/html/interfaces/NavigationStatus.html +2 -2
  64. package/docs/html/interfaces/ReleaseInfoModule.html +2 -2
  65. package/docs/html/interfaces/SettingsMenuItem.html +2 -2
  66. package/docs/html/modules.html +1 -1
  67. package/docs/html/types/DefaultHeaderItemComponent.html +1 -1
  68. package/docs/html/types/ExternalApp.html +1 -1
  69. package/docs/html/types/ExtractUsernameFromProfileFn.html +1 -1
  70. package/docs/html/types/Navigation.html +1 -1
  71. package/docs/html/types/NavigationWithInserts.html +1 -1
  72. package/docs/html/types/SettingsMenuItemComponent.html +1 -1
  73. package/docs/html/variables/EXTRACT_USERNAME_FROM_PROFILE.html +1 -1
  74. package/docs/html/variables/RXAP_DEFAULT_HEADER_ITEM_COMPONENT.html +1 -1
  75. package/docs/html/variables/RXAP_EXTERNAL_APP.html +1 -1
  76. package/docs/html/variables/RXAP_EXTERNAL_APP_FILTER.html +1 -1
  77. package/docs/html/variables/RXAP_FOOTER_COMPONENT.html +1 -1
  78. package/docs/html/variables/RXAP_HEADER_COMPONENT.html +1 -1
  79. package/docs/html/variables/RXAP_LAYOUT_APPS_GRID.html +1 -1
  80. package/docs/html/variables/RXAP_LOGO_CONFIG.html +1 -1
  81. package/docs/html/variables/RXAP_LOGO_CONFIG_DEFAULTS.html +1 -1
  82. package/docs/html/variables/RXAP_NAVIGATION_CONFIG.html +1 -1
  83. package/docs/html/variables/RXAP_NAVIGATION_CONFIG_INSERTS.html +1 -1
  84. package/docs/html/variables/RXAP_NAVIGATION_LAYOUT_CONFIG_DEFAULTS.html +1 -1
  85. package/docs/html/variables/RXAP_RELEASE_INFO_MODULE.html +1 -1
  86. package/docs/html/variables/RXAP_SETTINGS_MENU_ITEM.html +1 -1
  87. package/docs/html/variables/RXAP_SETTINGS_MENU_ITEM_COMPONENT.html +1 -1
  88. package/docs/html/variables/RXAP_USER_PROFILE_DATA_SOURCE.html +1 -1
  89. package/docs/markdown/README.md +1 -1
  90. package/docs/markdown/classes/AppsButtonComponent.md +9 -33
  91. package/docs/markdown/classes/BaseLayoutComponent.md +2 -2
  92. package/docs/markdown/classes/DefaultHeaderComponent.md +10 -10
  93. package/docs/markdown/classes/DefaultHeaderService.md +6 -6
  94. package/docs/markdown/classes/ExternalAppsService.md +18 -18
  95. package/docs/markdown/classes/FooterComponent.md +5 -5
  96. package/docs/markdown/classes/FooterDirective.md +4 -4
  97. package/docs/markdown/classes/FooterService.md +6 -6
  98. package/docs/markdown/classes/HeaderComponent.md +6 -6
  99. package/docs/markdown/classes/HeaderDirective.md +4 -4
  100. package/docs/markdown/classes/HeaderService.md +6 -6
  101. package/docs/markdown/classes/LayoutComponent.md +6 -6
  102. package/docs/markdown/classes/LayoutService.md +18 -24
  103. package/docs/markdown/classes/LogoService.md +6 -6
  104. package/docs/markdown/classes/MinimalLayoutComponent.md +2 -2
  105. package/docs/markdown/classes/NavigationComponent.md +16 -50
  106. package/docs/markdown/classes/NavigationItemComponent.md +19 -117
  107. package/docs/markdown/classes/NavigationProgressBarComponent.md +4 -4
  108. package/docs/markdown/classes/NavigationService.md +16 -26
  109. package/docs/markdown/classes/ReleaseInfoComponent.md +6 -6
  110. package/docs/markdown/classes/SettingsButtonComponent.md +19 -19
  111. package/docs/markdown/classes/SidenavComponent.md +18 -18
  112. package/docs/markdown/classes/SidenavFooterDirective.md +4 -12
  113. package/docs/markdown/classes/SidenavHeaderDirective.md +4 -12
  114. package/docs/markdown/classes/SidenavToggleButtonComponent.md +5 -5
  115. package/docs/markdown/classes/UserProfileIconComponent.md +7 -7
  116. package/docs/markdown/functions/IsNavigationDividerItem.md +2 -2
  117. package/docs/markdown/functions/IsNavigationInsertItem.md +2 -2
  118. package/docs/markdown/functions/IsNavigationItem.md +2 -2
  119. package/docs/markdown/functions/provideExternalApps.md +2 -2
  120. package/docs/markdown/functions/provideLayout.md +2 -2
  121. package/docs/markdown/functions/withDefaultHeaderComponent.md +2 -2
  122. package/docs/markdown/functions/withDefaultHeaderItems.md +2 -2
  123. package/docs/markdown/functions/withFooterComponents.md +2 -2
  124. package/docs/markdown/functions/withHeaderComponents.md +2 -2
  125. package/docs/markdown/functions/withNavigationConfig.md +2 -2
  126. package/docs/markdown/functions/withNavigationInserts.md +2 -2
  127. package/docs/markdown/functions/withReleaseInfoModules.md +2 -2
  128. package/docs/markdown/functions/withSettingsMenuItems.md +2 -2
  129. package/docs/markdown/functions/withUserProfileDataSource.md +2 -2
  130. package/docs/markdown/globals.md +2 -2
  131. package/docs/markdown/interfaces/NavigationDividerItem.md +4 -4
  132. package/docs/markdown/interfaces/NavigationInsertItem.md +3 -3
  133. package/docs/markdown/interfaces/NavigationItem.md +8 -8
  134. package/docs/markdown/interfaces/NavigationStatus.md +3 -3
  135. package/docs/markdown/interfaces/ReleaseInfoModule.md +5 -5
  136. package/docs/markdown/interfaces/SettingsMenuItem.md +5 -5
  137. package/docs/markdown/type-aliases/DefaultHeaderItemComponent.md +2 -2
  138. package/docs/markdown/type-aliases/ExternalApp.md +2 -2
  139. package/docs/markdown/type-aliases/ExtractUsernameFromProfileFn.md +2 -2
  140. package/docs/markdown/type-aliases/Navigation.md +2 -2
  141. package/docs/markdown/type-aliases/NavigationWithInserts.md +2 -2
  142. package/docs/markdown/type-aliases/SettingsMenuItemComponent.md +2 -2
  143. package/docs/markdown/variables/EXTRACT_USERNAME_FROM_PROFILE.md +2 -2
  144. package/docs/markdown/variables/RXAP_DEFAULT_HEADER_ITEM_COMPONENT.md +2 -2
  145. package/docs/markdown/variables/RXAP_EXTERNAL_APP.md +2 -2
  146. package/docs/markdown/variables/RXAP_EXTERNAL_APP_FILTER.md +2 -2
  147. package/docs/markdown/variables/RXAP_FOOTER_COMPONENT.md +2 -2
  148. package/docs/markdown/variables/RXAP_HEADER_COMPONENT.md +2 -2
  149. package/docs/markdown/variables/RXAP_LAYOUT_APPS_GRID.md +2 -2
  150. package/docs/markdown/variables/RXAP_LOGO_CONFIG.md +2 -2
  151. package/docs/markdown/variables/RXAP_LOGO_CONFIG_DEFAULTS.md +2 -2
  152. package/docs/markdown/variables/RXAP_NAVIGATION_CONFIG.md +2 -2
  153. package/docs/markdown/variables/RXAP_NAVIGATION_CONFIG_INSERTS.md +2 -2
  154. package/docs/markdown/variables/RXAP_NAVIGATION_LAYOUT_CONFIG_DEFAULTS.md +2 -2
  155. package/docs/markdown/variables/RXAP_RELEASE_INFO_MODULE.md +2 -2
  156. package/docs/markdown/variables/RXAP_SETTINGS_MENU_ITEM.md +2 -2
  157. package/docs/markdown/variables/RXAP_SETTINGS_MENU_ITEM_COMPONENT.md +2 -2
  158. package/docs/markdown/variables/RXAP_USER_PROFILE_DATA_SOURCE.md +2 -2
  159. package/docs/wiki/Class.AppsButtonComponent.md +8 -32
  160. package/docs/wiki/Class.BaseLayoutComponent.md +1 -1
  161. package/docs/wiki/Class.DefaultHeaderComponent.md +9 -9
  162. package/docs/wiki/Class.DefaultHeaderService.md +5 -5
  163. package/docs/wiki/Class.ExternalAppsService.md +17 -17
  164. package/docs/wiki/Class.FooterComponent.md +4 -4
  165. package/docs/wiki/Class.FooterDirective.md +3 -3
  166. package/docs/wiki/Class.FooterService.md +5 -5
  167. package/docs/wiki/Class.HeaderComponent.md +5 -5
  168. package/docs/wiki/Class.HeaderDirective.md +3 -3
  169. package/docs/wiki/Class.HeaderService.md +5 -5
  170. package/docs/wiki/Class.LayoutComponent.md +5 -5
  171. package/docs/wiki/Class.LayoutService.md +17 -23
  172. package/docs/wiki/Class.LogoService.md +5 -5
  173. package/docs/wiki/Class.MinimalLayoutComponent.md +1 -1
  174. package/docs/wiki/Class.NavigationComponent.md +15 -49
  175. package/docs/wiki/Class.NavigationItemComponent.md +18 -116
  176. package/docs/wiki/Class.NavigationProgressBarComponent.md +3 -3
  177. package/docs/wiki/Class.NavigationService.md +15 -25
  178. package/docs/wiki/Class.ReleaseInfoComponent.md +5 -5
  179. package/docs/wiki/Class.SettingsButtonComponent.md +18 -18
  180. package/docs/wiki/Class.SidenavComponent.md +17 -17
  181. package/docs/wiki/Class.SidenavFooterDirective.md +3 -11
  182. package/docs/wiki/Class.SidenavHeaderDirective.md +3 -11
  183. package/docs/wiki/Class.SidenavToggleButtonComponent.md +4 -4
  184. package/docs/wiki/Class.UserProfileIconComponent.md +6 -6
  185. package/docs/wiki/Function.IsNavigationDividerItem.md +1 -1
  186. package/docs/wiki/Function.IsNavigationInsertItem.md +1 -1
  187. package/docs/wiki/Function.IsNavigationItem.md +1 -1
  188. package/docs/wiki/Function.provideExternalApps.md +1 -1
  189. package/docs/wiki/Function.provideLayout.md +1 -1
  190. package/docs/wiki/Function.withDefaultHeaderComponent.md +1 -1
  191. package/docs/wiki/Function.withDefaultHeaderItems.md +1 -1
  192. package/docs/wiki/Function.withFooterComponents.md +1 -1
  193. package/docs/wiki/Function.withHeaderComponents.md +1 -1
  194. package/docs/wiki/Function.withNavigationConfig.md +1 -1
  195. package/docs/wiki/Function.withNavigationInserts.md +1 -1
  196. package/docs/wiki/Function.withReleaseInfoModules.md +1 -1
  197. package/docs/wiki/Function.withSettingsMenuItems.md +1 -1
  198. package/docs/wiki/Function.withUserProfileDataSource.md +1 -1
  199. package/docs/wiki/Interface.NavigationDividerItem.md +3 -3
  200. package/docs/wiki/Interface.NavigationInsertItem.md +2 -2
  201. package/docs/wiki/Interface.NavigationItem.md +7 -7
  202. package/docs/wiki/Interface.NavigationStatus.md +2 -2
  203. package/docs/wiki/Interface.ReleaseInfoModule.md +4 -4
  204. package/docs/wiki/Interface.SettingsMenuItem.md +4 -4
  205. package/docs/wiki/TypeAlias.DefaultHeaderItemComponent.md +1 -1
  206. package/docs/wiki/TypeAlias.ExternalApp.md +1 -1
  207. package/docs/wiki/TypeAlias.ExtractUsernameFromProfileFn.md +1 -1
  208. package/docs/wiki/TypeAlias.Navigation.md +1 -1
  209. package/docs/wiki/TypeAlias.NavigationWithInserts.md +1 -1
  210. package/docs/wiki/TypeAlias.SettingsMenuItemComponent.md +1 -1
  211. package/docs/wiki/Variable.EXTRACT_USERNAME_FROM_PROFILE.md +1 -1
  212. package/docs/wiki/Variable.RXAP_DEFAULT_HEADER_ITEM_COMPONENT.md +1 -1
  213. package/docs/wiki/Variable.RXAP_EXTERNAL_APP.md +1 -1
  214. package/docs/wiki/Variable.RXAP_EXTERNAL_APP_FILTER.md +1 -1
  215. package/docs/wiki/Variable.RXAP_FOOTER_COMPONENT.md +1 -1
  216. package/docs/wiki/Variable.RXAP_HEADER_COMPONENT.md +1 -1
  217. package/docs/wiki/Variable.RXAP_LAYOUT_APPS_GRID.md +1 -1
  218. package/docs/wiki/Variable.RXAP_LOGO_CONFIG.md +1 -1
  219. package/docs/wiki/Variable.RXAP_LOGO_CONFIG_DEFAULTS.md +1 -1
  220. package/docs/wiki/Variable.RXAP_NAVIGATION_CONFIG.md +1 -1
  221. package/docs/wiki/Variable.RXAP_NAVIGATION_CONFIG_INSERTS.md +1 -1
  222. package/docs/wiki/Variable.RXAP_NAVIGATION_LAYOUT_CONFIG_DEFAULTS.md +1 -1
  223. package/docs/wiki/Variable.RXAP_RELEASE_INFO_MODULE.md +1 -1
  224. package/docs/wiki/Variable.RXAP_SETTINGS_MENU_ITEM.md +1 -1
  225. package/docs/wiki/Variable.RXAP_SETTINGS_MENU_ITEM_COMPONENT.md +1 -1
  226. package/docs/wiki/Variable.RXAP_USER_PROFILE_DATA_SOURCE.md +1 -1
  227. package/docs/wiki/globals.md +1 -1
  228. package/fesm2022/rxap-layout.mjs +219 -294
  229. package/fesm2022/rxap-layout.mjs.map +1 -1
  230. package/package.json +47 -46
  231. package/src/generators/init/generator.spec.ts +228 -0
  232. package/src/generators/init/generator.ts +139 -0
  233. package/src/generators/init/index.ts +5 -0
  234. package/src/generators/init/schema.d.ts +2 -0
  235. package/src/generators/init/schema.json +8 -0
  236. package/{index.d.ts → src/index.ts} +47 -0
  237. package/src/migrations/18.0.0/add-seperate-external-apps-provider/__snapshots__/add-seperate-external-apps-provider.spec.ts.snap +1 -1
  238. package/src/migrations/18.0.0/add-seperate-external-apps-provider/add-seperate-external-apps-provider.spec.ts +63 -0
  239. package/src/migrations/18.0.0/add-seperate-external-apps-provider/add-seperate-external-apps-provider.ts +59 -0
  240. package/src/migrations/18.0.0/add-theme-provider-to-app-config/__snapshots__/add-theme-provider-to-app-config.spec.ts.snap +1 -1
  241. package/src/migrations/18.0.0/add-theme-provider-to-app-config/add-theme-provider-to-app-config.spec.ts +61 -0
  242. package/src/migrations/18.0.0/add-theme-provider-to-app-config/add-theme-provider-to-app-config.ts +44 -0
  243. package/src/migrations/18.0.0/add-user-theme-provider-to-layout-providers/__snapshots__/add-user-theme-provider-to-layout-providers.spec.ts.snap +1 -1
  244. package/src/migrations/18.0.0/add-user-theme-provider-to-layout-providers/add-user-theme-provider-to-layout-providers.spec.ts +94 -0
  245. package/src/migrations/18.0.0/add-user-theme-provider-to-layout-providers/add-user-theme-provider-to-layout-providers.ts +51 -0
  246. package/src/migrations/18.0.0/add-with-user-profile-provider/__snapshots__/add-with-user-profile-provider.spec.ts.snap +1 -1
  247. package/src/migrations/18.0.0/add-with-user-profile-provider/add-with-user-profile-provider.spec.ts +94 -0
  248. package/src/migrations/18.0.0/add-with-user-profile-provider/add-with-user-profile-provider.ts +53 -0
  249. package/src/test-setup.ts +25 -0
  250. package/types/rxap-layout.d.ts +507 -0
  251. package/lib/base-layout/base-layout.component.d.ts +0 -5
  252. package/lib/default-header/apps-button/apps-button.component.d.ts +0 -16
  253. package/lib/default-header/default-header.component.d.ts +0 -15
  254. package/lib/default-header/default-header.service.d.ts +0 -36
  255. package/lib/default-header/settings-button/settings-button.component.d.ts +0 -33
  256. package/lib/default-header/sidenav-toggle-button/sidenav-toggle-button.component.d.ts +0 -9
  257. package/lib/default-header/user-profile-icon/user-profile-icon.component.d.ts +0 -12
  258. package/lib/external-apps.service.d.ts +0 -26
  259. package/lib/footer/footer.component.d.ts +0 -9
  260. package/lib/footer/footer.directive.d.ts +0 -12
  261. package/lib/footer.service.d.ts +0 -32
  262. package/lib/header/header.component.d.ts +0 -11
  263. package/lib/header/header.directive.d.ts +0 -12
  264. package/lib/header.service.d.ts +0 -34
  265. package/lib/layout/layout.component.d.ts +0 -11
  266. package/lib/layout.service.d.ts +0 -27
  267. package/lib/logo.service.d.ts +0 -10
  268. package/lib/minimal-layout/minimal-layout.component.d.ts +0 -5
  269. package/lib/navigation/navigation-item/navigation-item.component.d.ts +0 -28
  270. package/lib/navigation/navigation-item.d.ts +0 -25
  271. package/lib/navigation/navigation.component.d.ts +0 -21
  272. package/lib/navigation-progress-bar/navigation-progress-bar.component.d.ts +0 -8
  273. package/lib/navigation.service.d.ts +0 -36
  274. package/lib/provide.d.ts +0 -17
  275. package/lib/release-info/release-info.component.d.ts +0 -10
  276. package/lib/sidenav/sidenav-footer.directive.d.ts +0 -8
  277. package/lib/sidenav/sidenav-header.directive.d.ts +0 -8
  278. package/lib/sidenav/sidenav.component.d.ts +0 -31
  279. package/lib/tokens.d.ts +0 -22
  280. package/lib/types.d.ts +0 -17
@@ -0,0 +1,63 @@
1
+ import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing';
2
+ import {
3
+ addProjectConfiguration,
4
+ Tree,
5
+ } from '@nx/devkit';
6
+
7
+ import update from './add-seperate-external-apps-provider';
8
+
9
+ describe('add-seperate-external-apps-provider migration', () => {
10
+ let tree: Tree;
11
+
12
+ beforeEach(() => {
13
+ tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
14
+ addProjectConfiguration(tree, 'service', {
15
+ root: 'apps/service',
16
+ projectType: 'application',
17
+ sourceRoot: 'apps/service/src',
18
+ tags: [ 'service' ],
19
+ targets: {},
20
+ });
21
+ addProjectConfiguration(tree, 'angularA', {
22
+ root: 'apps/angularA',
23
+ projectType: 'application',
24
+ sourceRoot: 'apps/angularA/src',
25
+ tags: [ 'angular' ],
26
+ targets: {},
27
+ });
28
+ addProjectConfiguration(tree, 'angularB', {
29
+ root: 'apps/angularB',
30
+ projectType: 'application',
31
+ sourceRoot: 'apps/angularB/src',
32
+ tags: [ 'angular' ],
33
+ targets: {},
34
+ });
35
+ tree.write('apps/angularB/src/app/layout.routes.ts', '');
36
+ addProjectConfiguration(tree, 'angularC', {
37
+ root: 'apps/angularC',
38
+ projectType: 'application',
39
+ sourceRoot: 'apps/angularC/src',
40
+ tags: [ 'angular' ],
41
+ targets: {},
42
+ });
43
+ tree.write('apps/angularC/src/app/layout.routes.ts', '');
44
+ tree.write('apps/angularC/src/app/app.config.ts', '');
45
+ addProjectConfiguration(tree, 'angularD', {
46
+ root: 'apps/angularD',
47
+ projectType: 'application',
48
+ sourceRoot: 'apps/angularD/src',
49
+ tags: [ 'angular' ],
50
+ targets: {},
51
+ });
52
+ tree.write('apps/angularD/src/app/layout.routes.ts', '');
53
+ tree.write('apps/angularD/src/app/app.config.ts', 'export const appConfig = { providers: [] };');
54
+ });
55
+
56
+ it('should run successfully', async () => {
57
+ await update(tree);
58
+ expect(tree.read('apps/angularA/src/app/app.config.ts', 'utf-8')).toMatchSnapshot();
59
+ expect(tree.read('apps/angularB/src/app/app.config.ts', 'utf-8')).toMatchSnapshot();
60
+ expect(tree.read('apps/angularC/src/app/app.config.ts', 'utf-8')).toMatchSnapshot();
61
+ expect(tree.read('apps/angularD/src/app/app.config.ts', 'utf-8')).toMatchSnapshot();
62
+ });
63
+ });
@@ -0,0 +1,59 @@
1
+ /* eslint-disable @typescript-eslint/no-unused-vars */
2
+ import {
3
+ getProjects,
4
+ Tree,
5
+ } from '@nx/devkit';
6
+ import {
7
+ CoerceAppConfigProvider,
8
+ CoerceImports,
9
+ } from '@rxap/ts-morph';
10
+ import { TsMorphAngularProjectTransform } from '@rxap/workspace-ts-morph';
11
+ import {
12
+ GetProjectSourceRoot,
13
+ IsAngularProject,
14
+ IsApplicationProject,
15
+ } from '@rxap/workspace-utilities';
16
+ import { join } from 'path';
17
+
18
+ export default async function update(tree: Tree) {
19
+ // ...
20
+
21
+ console.log('Add separate external apps provider to app config');
22
+
23
+ for (const [projectName, project] of getProjects(tree).entries()) {
24
+
25
+ // skip all projects that are not angular application projects
26
+ if (!(IsAngularProject(project) && IsApplicationProject(project))) {
27
+ console.log(`The project ${projectName} is not an angular application project. Skip the migration!`);
28
+ continue;
29
+ }
30
+
31
+ const projectSourceRoot = GetProjectSourceRoot(tree, projectName);
32
+
33
+ const layoutRoutesFilePath = join(projectSourceRoot, 'app', 'layout.routes.ts');
34
+
35
+ if (!tree.exists(join(layoutRoutesFilePath))) {
36
+ console.log(`The project ${projectName} does not have a layout.routes.ts file. Skip the migration!`);
37
+ continue;
38
+ }
39
+
40
+ const appConfigFilePath = join(projectSourceRoot, 'app', 'app.config.ts');
41
+
42
+ if (!tree.exists(join(appConfigFilePath))) {
43
+ console.log(`The project ${projectName} does not have a app.config.ts file. Skip the migration!`);
44
+ continue;
45
+ }
46
+
47
+ await TsMorphAngularProjectTransform(tree, { project: projectName }, (_, [appConfig]) => {
48
+ CoerceAppConfigProvider(appConfig, {
49
+ providers: ['provideExternalApps()']
50
+ });
51
+ CoerceImports(appConfig, {
52
+ moduleSpecifier: '@rxap/layout',
53
+ namedImports: ['provideExternalApps']
54
+ });
55
+ }, [ join('app', 'app.config.ts') ]);
56
+
57
+ }
58
+
59
+ }
@@ -1,4 +1,4 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
1
+ // Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
2
2
 
3
3
  exports[`add-theme-provider-to-app-config migration should run successfully 1`] = `
4
4
  "import { ApplicationConfig } from '@angular/core';
@@ -0,0 +1,61 @@
1
+ import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing';
2
+ import {
3
+ addProjectConfiguration,
4
+ Tree,
5
+ } from '@nx/devkit';
6
+
7
+ import update from './add-theme-provider-to-app-config';
8
+
9
+ describe('add-theme-provider-to-app-config migration', () => {
10
+ let tree: Tree;
11
+
12
+ beforeEach(() => {
13
+ tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
14
+ addProjectConfiguration(tree, 'service', {
15
+ root: 'apps/service',
16
+ projectType: 'application',
17
+ sourceRoot: 'apps/service/src',
18
+ tags: [ 'service' ],
19
+ targets: {},
20
+ });
21
+ addProjectConfiguration(tree, 'angularA', {
22
+ root: 'apps/angularA',
23
+ projectType: 'application',
24
+ sourceRoot: 'apps/angularA/src',
25
+ tags: [ 'angular' ],
26
+ targets: {},
27
+ });
28
+ addProjectConfiguration(tree, 'angularB', {
29
+ root: 'apps/angularB',
30
+ projectType: 'application',
31
+ sourceRoot: 'apps/angularB/src',
32
+ tags: [ 'angular' ],
33
+ targets: {},
34
+ });
35
+ tree.write('apps/angularB/src/app/layout.routes.ts', '');
36
+ addProjectConfiguration(tree, 'angularC', {
37
+ root: 'apps/angularC',
38
+ projectType: 'application',
39
+ sourceRoot: 'apps/angularC/src',
40
+ tags: [ 'angular' ],
41
+ targets: {},
42
+ });
43
+ tree.write('apps/angularC/src/app/layout.routes.ts', '');
44
+ tree.write('apps/angularC/src/app/app.config.ts', '');
45
+ addProjectConfiguration(tree, 'angularD', {
46
+ root: 'apps/angularD',
47
+ projectType: 'application',
48
+ sourceRoot: 'apps/angularD/src',
49
+ tags: [ 'angular' ],
50
+ targets: {},
51
+ });
52
+ tree.write('apps/angularD/src/app/layout.routes.ts', '');
53
+ tree.write('apps/angularD/src/app/app.config.ts', 'export const appConfig = { providers: [] };');
54
+ });
55
+
56
+ it('should run successfully', async () => {
57
+ await update(tree);
58
+ expect(tree.read('apps/angularC/src/app/app.config.ts', 'utf-8')).toMatchSnapshot();
59
+ expect(tree.read('apps/angularD/src/app/app.config.ts', 'utf-8')).toMatchSnapshot();
60
+ });
61
+ });
@@ -0,0 +1,44 @@
1
+ /* eslint-disable @typescript-eslint/no-unused-vars */
2
+ import {
3
+ getProjects,
4
+ Tree,
5
+ } from '@nx/devkit';
6
+ import {
7
+ CoerceAppConfigProvider,
8
+ CoerceImports,
9
+ } from '@rxap/ts-morph';
10
+ import { TsMorphAngularProjectTransform } from '@rxap/workspace-ts-morph';
11
+ import {
12
+ GetProjectSourceRoot,
13
+ IsAngularProject,
14
+ IsApplicationProject,
15
+ } from '@rxap/workspace-utilities';
16
+
17
+ export default async function update(host: Tree) {
18
+ for (const [ projectName, project ] of getProjects(host)) {
19
+ if (!IsApplicationProject(project) || !IsAngularProject(project)) {
20
+ continue;
21
+ }
22
+ const projectSourceRoot = GetProjectSourceRoot(host, projectName);
23
+ const layoutRoutesPath = `${ projectSourceRoot }/app/layout.routes.ts`;
24
+ if (!host.exists(layoutRoutesPath)) {
25
+ console.log(`The project ${ projectName } does not have a layout.routes.ts file. Skip Migration`);
26
+ continue;
27
+ }
28
+ if (!host.exists(`${ projectSourceRoot }/app/app.config.ts`)) {
29
+ console.log(`The project ${ projectName } does not have a app.config.ts file. Skip Migration`);
30
+ continue;
31
+ }
32
+ await TsMorphAngularProjectTransform(host, {
33
+ project: projectName,
34
+ }, (_, [ sourceFile ]) => {
35
+ CoerceAppConfigProvider(sourceFile, {
36
+ providers: [ 'provideTheme()' ],
37
+ });
38
+ CoerceImports(sourceFile, {
39
+ moduleSpecifier: '@rxap/ngx-theme',
40
+ namedImports: [ 'provideTheme' ],
41
+ });
42
+ }, [ '/app/app.config.ts' ]);
43
+ }
44
+ }
@@ -1,4 +1,4 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
1
+ // Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
2
2
 
3
3
  exports[`add-user-theme-provider-to-app-config migration should run successfully 1`] = `
4
4
  "export const ROUTES: Route[] = [
@@ -0,0 +1,94 @@
1
+ import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing';
2
+ import {
3
+ addProjectConfiguration,
4
+ Tree,
5
+ } from '@nx/devkit';
6
+ import update from './add-user-theme-provider-to-layout-providers';
7
+
8
+
9
+ describe('add-user-theme-provider-to-app-config migration', () => {
10
+ let tree: Tree;
11
+
12
+ beforeEach(() => {
13
+ tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
14
+ addProjectConfiguration(tree, 'service', {
15
+ root: 'apps/service',
16
+ projectType: 'application',
17
+ sourceRoot: 'apps/service/src',
18
+ tags: [ 'service' ],
19
+ targets: {},
20
+ });
21
+ addProjectConfiguration(tree, 'angularA', {
22
+ root: 'apps/angularA',
23
+ projectType: 'application',
24
+ sourceRoot: 'apps/angularA/src',
25
+ tags: [ 'angular' ],
26
+ targets: {},
27
+ });
28
+ addProjectConfiguration(tree, 'angularB', {
29
+ root: 'apps/angularB',
30
+ projectType: 'application',
31
+ sourceRoot: 'apps/angularB/src',
32
+ tags: [ 'angular' ],
33
+ targets: {},
34
+ });
35
+ tree.write('apps/angularB/src/app/layout.routes.ts', `export const ROUTES: Route[] = [
36
+ {
37
+ path: '',
38
+ component: LayoutComponent,
39
+ children: [],
40
+ providers: []
41
+ }
42
+ ];
43
+
44
+ export default ROUTES;`);
45
+ addProjectConfiguration(tree, 'angularC', {
46
+ root: 'apps/angularC',
47
+ projectType: 'application',
48
+ sourceRoot: 'apps/angularC/src',
49
+ tags: [ 'angular' ],
50
+ targets: {},
51
+ });
52
+ tree.write('apps/angularC/src/app/layout.routes.ts', `export const ROUTES: Route[] = [
53
+ {
54
+ path: '',
55
+ component: LayoutComponent,
56
+ children: [],
57
+ providers: [
58
+ provideLayout()
59
+ ]
60
+ }
61
+ ];
62
+
63
+ export default ROUTES;`);
64
+ addProjectConfiguration(tree, 'angularD', {
65
+ root: 'apps/angularD',
66
+ projectType: 'application',
67
+ sourceRoot: 'apps/angularD/src',
68
+ tags: [ 'angular' ],
69
+ targets: {},
70
+ });
71
+ tree.write('apps/angularD/src/app/layout.routes.ts', `export const ROUTES: Route[] = [
72
+ {
73
+ path: '',
74
+ component: LayoutComponent,
75
+ children: [],
76
+ providers: [
77
+ provideLayout(
78
+ withNavigationConfig(APP_NAVIGATION),
79
+ withDefaultHeaderComponent()
80
+ )
81
+ ]
82
+ }
83
+ ];
84
+
85
+ export default ROUTES;`);
86
+ });
87
+
88
+ it('should run successfully', async () => {
89
+ await update(tree);
90
+ expect(tree.read('apps/angularB/src/app/layout.routes.ts', 'utf-8')).toMatchSnapshot();
91
+ expect(tree.read('apps/angularC/src/app/layout.routes.ts', 'utf-8')).toMatchSnapshot();
92
+ expect(tree.read('apps/angularD/src/app/layout.routes.ts', 'utf-8')).toMatchSnapshot();
93
+ });
94
+ });
@@ -0,0 +1,51 @@
1
+ import {
2
+ getProjects,
3
+ Tree,
4
+ } from '@nx/devkit';
5
+ import {
6
+ CoerceAppConfigProvider,
7
+ CoerceImports,
8
+ } from '@rxap/ts-morph';
9
+ import { TsMorphAngularProjectTransform } from '@rxap/workspace-ts-morph';
10
+ import {
11
+ GetProjectSourceRoot,
12
+ IsAngularProject,
13
+ IsApplicationProject,
14
+ } from '@rxap/workspace-utilities';
15
+
16
+ export default async function update(host: Tree) {
17
+
18
+ for (const [ projectName, project ] of getProjects(host)) {
19
+ if (!IsApplicationProject(project) || !IsAngularProject(project)) {
20
+ continue;
21
+ }
22
+ const projectSourceRoot = GetProjectSourceRoot(host, projectName);
23
+ const layoutRoutesPath = `${ projectSourceRoot }/app/layout.routes.ts`;
24
+ if (!host.exists(layoutRoutesPath)) {
25
+ console.log(`The project ${ projectName } does not have a layout.routes.ts file. Skip Migration`);
26
+ continue;
27
+ }
28
+ let content = host.read(layoutRoutesPath, 'utf-8');
29
+ if (!content?.includes('provideLayout(')) {
30
+ console.log(`The project ${ projectName } does not have the provideLayout provider. Skip Migration`);
31
+ continue;
32
+ }
33
+ if (content.includes('provideUserTheme(')) {
34
+ console.log(`The project ${ projectName } already has the provideUserTheme provider. Skip Migration`);
35
+ continue;
36
+ }
37
+ content = content.replace('provideLayout(', 'provideUserTheme(), provideLayout(');
38
+ host.write(layoutRoutesPath, content);
39
+ await TsMorphAngularProjectTransform(host, {
40
+ project: projectName,
41
+ }, (_, [ sourceFile ]) => {
42
+ CoerceImports(sourceFile, [
43
+ {
44
+ moduleSpecifier: '@rxap/ngx-user',
45
+ namedImports: [ 'provideUserTheme' ],
46
+ },
47
+ ]);
48
+ }, [ '/app/layout.routes.ts' ]);
49
+ }
50
+
51
+ }
@@ -1,4 +1,4 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
1
+ // Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
2
2
 
3
3
  exports[`add-with-user-profile-provider migration should run successfully 1`] = `
4
4
  "export const ROUTES: Route[] = [
@@ -0,0 +1,94 @@
1
+ import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing';
2
+ import {
3
+ addProjectConfiguration,
4
+ Tree,
5
+ } from '@nx/devkit';
6
+
7
+ import update from './add-with-user-profile-provider';
8
+
9
+ describe('add-with-user-profile-provider migration', () => {
10
+ let tree: Tree;
11
+
12
+ beforeEach(() => {
13
+ tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
14
+ addProjectConfiguration(tree, 'service', {
15
+ root: 'apps/service',
16
+ projectType: 'application',
17
+ sourceRoot: 'apps/service/src',
18
+ tags: [ 'service' ],
19
+ targets: {},
20
+ });
21
+ addProjectConfiguration(tree, 'angularA', {
22
+ root: 'apps/angularA',
23
+ projectType: 'application',
24
+ sourceRoot: 'apps/angularA/src',
25
+ tags: [ 'angular' ],
26
+ targets: {},
27
+ });
28
+ addProjectConfiguration(tree, 'angularB', {
29
+ root: 'apps/angularB',
30
+ projectType: 'application',
31
+ sourceRoot: 'apps/angularB/src',
32
+ tags: [ 'angular' ],
33
+ targets: {},
34
+ });
35
+ tree.write('apps/angularB/src/app/layout.routes.ts', `export const ROUTES: Route[] = [
36
+ {
37
+ path: '',
38
+ component: LayoutComponent,
39
+ children: [],
40
+ providers: []
41
+ }
42
+ ];
43
+
44
+ export default ROUTES;`);
45
+ addProjectConfiguration(tree, 'angularC', {
46
+ root: 'apps/angularC',
47
+ projectType: 'application',
48
+ sourceRoot: 'apps/angularC/src',
49
+ tags: [ 'angular' ],
50
+ targets: {},
51
+ });
52
+ tree.write('apps/angularC/src/app/layout.routes.ts', `export const ROUTES: Route[] = [
53
+ {
54
+ path: '',
55
+ component: LayoutComponent,
56
+ children: [],
57
+ providers: [
58
+ provideLayout()
59
+ ]
60
+ }
61
+ ];
62
+
63
+ export default ROUTES;`);
64
+ addProjectConfiguration(tree, 'angularD', {
65
+ root: 'apps/angularD',
66
+ projectType: 'application',
67
+ sourceRoot: 'apps/angularD/src',
68
+ tags: [ 'angular' ],
69
+ targets: {},
70
+ });
71
+ tree.write('apps/angularD/src/app/layout.routes.ts', `export const ROUTES: Route[] = [
72
+ {
73
+ path: '',
74
+ component: LayoutComponent,
75
+ children: [],
76
+ providers: [
77
+ provideLayout(
78
+ withNavigationConfig(APP_NAVIGATION),
79
+ withDefaultHeaderComponent()
80
+ )
81
+ ]
82
+ }
83
+ ];
84
+
85
+ export default ROUTES;`);
86
+ });
87
+
88
+ it('should run successfully', async () => {
89
+ await update(tree);
90
+ expect(tree.read('apps/angularB/src/app/layout.routes.ts', 'utf-8')).toMatchSnapshot();
91
+ expect(tree.read('apps/angularC/src/app/layout.routes.ts', 'utf-8')).toMatchSnapshot();
92
+ expect(tree.read('apps/angularD/src/app/layout.routes.ts', 'utf-8')).toMatchSnapshot();
93
+ });
94
+ });
@@ -0,0 +1,53 @@
1
+ /* eslint-disable @typescript-eslint/no-unused-vars */
2
+ import {
3
+ getProjects,
4
+ Tree,
5
+ } from '@nx/devkit';
6
+ import { CoerceImports } from '@rxap/ts-morph';
7
+ import { TsMorphAngularProjectTransform } from '@rxap/workspace-ts-morph';
8
+ import {
9
+ GetProjectSourceRoot,
10
+ IsAngularProject,
11
+ IsApplicationProject,
12
+ } from '@rxap/workspace-utilities';
13
+
14
+ export default async function update(host: Tree) {
15
+
16
+ for (const [ projectName, project ] of getProjects(host)) {
17
+ if (!IsApplicationProject(project) || !IsAngularProject(project)) {
18
+ continue;
19
+ }
20
+ const projectSourceRoot = GetProjectSourceRoot(host, projectName);
21
+ const layoutRoutesPath = `${ projectSourceRoot }/app/layout.routes.ts`;
22
+ if (!host.exists(layoutRoutesPath)) {
23
+ console.log(`The project ${ projectName } does not have a layout.routes.ts file. Skip Migration`);
24
+ continue;
25
+ }
26
+ let content = host.read(layoutRoutesPath, 'utf-8');
27
+ if (!content?.includes('provideLayout(')) {
28
+ console.log(`The project ${ projectName } does not have the provideLayout provider. Skip Migration`);
29
+ continue;
30
+ }
31
+ if (content.includes('withUserProfileDataSource(')) {
32
+ console.log(`The project ${ projectName } already has the withUserProfileDataSource provider. Skip Migration`);
33
+ continue;
34
+ }
35
+ content = content.replace('provideLayout(', 'provideLayout(withUserProfileDataSource(UserProfileDataSource),');
36
+ host.write(layoutRoutesPath, content);
37
+ await TsMorphAngularProjectTransform(host, {
38
+ project: projectName,
39
+ }, (_, [ sourceFile ]) => {
40
+ CoerceImports(sourceFile, [
41
+ {
42
+ moduleSpecifier: '@rxap/ngx-user',
43
+ namedImports: [ 'UserProfileDataSource' ],
44
+ },
45
+ {
46
+ moduleSpecifier: '@rxap/layout',
47
+ namedImports: [ 'withUserProfileDataSource' ],
48
+ },
49
+ ]);
50
+ }, [ '/app/layout.routes.ts' ]);
51
+ }
52
+
53
+ }
@@ -0,0 +1,25 @@
1
+ // @ts-expect-error https://thymikee.github.io/jest-preset-angular/docs/getting-started/test-environment
2
+ globalThis.ngJest = {
3
+ testEnvironmentOptions: {
4
+ errorOnUnknownElements: true,
5
+ errorOnUnknownProperties: true,
6
+ },
7
+ };
8
+ import { setupZoneTestEnv } from 'jest-preset-angular/setup-env/zone';
9
+
10
+ setupZoneTestEnv();
11
+ import { TextDecoder, TextEncoder } from 'util';
12
+ global.TextEncoder ??= TextEncoder as any;
13
+ global.TextDecoder ??= TextDecoder as any;
14
+
15
+ import '@angular/localize/init';
16
+ jest.spyOn(global as any, '$localize').mockImplementation((...args: any[]) => {
17
+ // This template tag function just returns the first argument with no transformations.
18
+ // Change this to fit your unit test needs.
19
+ return args[0];
20
+ });
21
+
22
+ jest.mock('prettier', () => ({
23
+ format: (str: string) => str,
24
+ resolveConfig: () => Promise.resolve({}),
25
+ }));