@rxap/layout 22.0.0-dev.1 → 22.0.0-dev.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 (247) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +5 -3
  3. package/compodoc/changelog.html +26 -0
  4. package/compodoc/dependencies.html +12 -12
  5. package/compodoc/index.html +4 -3
  6. package/compodoc/js/search/search_index.js +2 -2
  7. package/compodoc/llms.txt +3 -1
  8. package/compodoc/miscellaneous/functions.html +81 -0
  9. package/compodoc/properties.html +1 -1
  10. package/docs/documentation.json +343 -319
  11. package/docs/html/classes/AppsButtonComponent.html +10 -10
  12. package/docs/html/classes/BaseLayoutComponent.html +4 -4
  13. package/docs/html/classes/DefaultHeaderComponent.html +12 -12
  14. package/docs/html/classes/DefaultHeaderService.html +8 -8
  15. package/docs/html/classes/ExternalAppsService.html +20 -20
  16. package/docs/html/classes/FooterComponent.html +7 -7
  17. package/docs/html/classes/FooterDirective.html +6 -6
  18. package/docs/html/classes/FooterService.html +8 -8
  19. package/docs/html/classes/HeaderComponent.html +8 -8
  20. package/docs/html/classes/HeaderDirective.html +6 -6
  21. package/docs/html/classes/HeaderService.html +8 -8
  22. package/docs/html/classes/LayoutComponent.html +8 -8
  23. package/docs/html/classes/LayoutService.html +19 -19
  24. package/docs/html/classes/LogoService.html +8 -8
  25. package/docs/html/classes/MinimalLayoutComponent.html +4 -4
  26. package/docs/html/classes/NavigationComponent.html +14 -14
  27. package/docs/html/classes/NavigationItemComponent.html +16 -16
  28. package/docs/html/classes/NavigationProgressBarComponent.html +6 -6
  29. package/docs/html/classes/NavigationService.html +14 -14
  30. package/docs/html/classes/ReleaseInfoComponent.html +8 -8
  31. package/docs/html/classes/SettingsButtonComponent.html +21 -21
  32. package/docs/html/classes/SidenavComponent.html +20 -20
  33. package/docs/html/classes/SidenavFooterDirective.html +5 -5
  34. package/docs/html/classes/SidenavHeaderDirective.html +5 -5
  35. package/docs/html/classes/SidenavToggleButtonComponent.html +7 -7
  36. package/docs/html/classes/UserProfileIconComponent.html +9 -9
  37. package/docs/html/functions/IsNavigationDividerItem.html +4 -4
  38. package/docs/html/functions/IsNavigationInsertItem.html +4 -4
  39. package/docs/html/functions/IsNavigationItem.html +4 -4
  40. package/docs/html/functions/provideExternalApps.html +4 -4
  41. package/docs/html/functions/provideLayout.html +4 -4
  42. package/docs/html/functions/withDefaultHeaderComponent.html +4 -4
  43. package/docs/html/functions/withDefaultHeaderItems.html +4 -4
  44. package/docs/html/functions/withFooterComponents.html +4 -4
  45. package/docs/html/functions/withHeaderComponents.html +4 -4
  46. package/docs/html/functions/withNavigationConfig.html +4 -4
  47. package/docs/html/functions/withNavigationInserts.html +4 -4
  48. package/docs/html/functions/withReleaseInfoModules.html +4 -4
  49. package/docs/html/functions/withSettingsMenuItems.html +4 -4
  50. package/docs/html/functions/withUserProfileDataSource.html +4 -4
  51. package/docs/html/hierarchy.html +4 -4
  52. package/docs/html/index.html +8 -7
  53. package/docs/html/interfaces/NavigationDividerItem.html +6 -6
  54. package/docs/html/interfaces/NavigationInsertItem.html +5 -5
  55. package/docs/html/interfaces/NavigationItem.html +9 -9
  56. package/docs/html/interfaces/NavigationStatus.html +5 -5
  57. package/docs/html/interfaces/ReleaseInfoModule.html +7 -7
  58. package/docs/html/interfaces/SettingsMenuItem.html +7 -7
  59. package/docs/html/modules.html +4 -4
  60. package/docs/html/types/DefaultHeaderItemComponent.html +4 -4
  61. package/docs/html/types/ExternalApp.html +4 -4
  62. package/docs/html/types/ExtractUsernameFromProfileFn.html +4 -4
  63. package/docs/html/types/Navigation.html +4 -4
  64. package/docs/html/types/NavigationWithInserts.html +4 -4
  65. package/docs/html/types/SettingsMenuItemComponent.html +4 -4
  66. package/docs/html/variables/EXTRACT_USERNAME_FROM_PROFILE.html +4 -4
  67. package/docs/html/variables/RXAP_DEFAULT_HEADER_ITEM_COMPONENT.html +4 -4
  68. package/docs/html/variables/RXAP_EXTERNAL_APP.html +4 -4
  69. package/docs/html/variables/RXAP_EXTERNAL_APP_FILTER.html +4 -4
  70. package/docs/html/variables/RXAP_FOOTER_COMPONENT.html +4 -4
  71. package/docs/html/variables/RXAP_HEADER_COMPONENT.html +4 -4
  72. package/docs/html/variables/RXAP_LAYOUT_APPS_GRID.html +4 -4
  73. package/docs/html/variables/RXAP_LOGO_CONFIG.html +4 -4
  74. package/docs/html/variables/RXAP_LOGO_CONFIG_DEFAULTS.html +4 -4
  75. package/docs/html/variables/RXAP_NAVIGATION_CONFIG.html +4 -4
  76. package/docs/html/variables/RXAP_NAVIGATION_CONFIG_INSERTS.html +4 -4
  77. package/docs/html/variables/RXAP_NAVIGATION_LAYOUT_CONFIG_DEFAULTS.html +4 -4
  78. package/docs/html/variables/RXAP_RELEASE_INFO_MODULE.html +4 -4
  79. package/docs/html/variables/RXAP_SETTINGS_MENU_ITEM.html +4 -4
  80. package/docs/html/variables/RXAP_SETTINGS_MENU_ITEM_COMPONENT.html +4 -4
  81. package/docs/html/variables/RXAP_USER_PROFILE_DATA_SOURCE.html +4 -4
  82. package/docs/markdown/README.md +6 -4
  83. package/docs/markdown/classes/AppsButtonComponent.md +8 -8
  84. package/docs/markdown/classes/BaseLayoutComponent.md +2 -2
  85. package/docs/markdown/classes/DefaultHeaderComponent.md +10 -10
  86. package/docs/markdown/classes/DefaultHeaderService.md +6 -6
  87. package/docs/markdown/classes/ExternalAppsService.md +18 -18
  88. package/docs/markdown/classes/FooterComponent.md +5 -5
  89. package/docs/markdown/classes/FooterDirective.md +4 -4
  90. package/docs/markdown/classes/FooterService.md +6 -6
  91. package/docs/markdown/classes/HeaderComponent.md +6 -6
  92. package/docs/markdown/classes/HeaderDirective.md +4 -4
  93. package/docs/markdown/classes/HeaderService.md +6 -6
  94. package/docs/markdown/classes/LayoutComponent.md +6 -6
  95. package/docs/markdown/classes/LayoutService.md +17 -17
  96. package/docs/markdown/classes/LogoService.md +6 -6
  97. package/docs/markdown/classes/MinimalLayoutComponent.md +2 -2
  98. package/docs/markdown/classes/NavigationComponent.md +12 -12
  99. package/docs/markdown/classes/NavigationItemComponent.md +14 -14
  100. package/docs/markdown/classes/NavigationProgressBarComponent.md +4 -4
  101. package/docs/markdown/classes/NavigationService.md +12 -12
  102. package/docs/markdown/classes/ReleaseInfoComponent.md +6 -6
  103. package/docs/markdown/classes/SettingsButtonComponent.md +19 -19
  104. package/docs/markdown/classes/SidenavComponent.md +18 -18
  105. package/docs/markdown/classes/SidenavFooterDirective.md +3 -3
  106. package/docs/markdown/classes/SidenavHeaderDirective.md +3 -3
  107. package/docs/markdown/classes/SidenavToggleButtonComponent.md +5 -5
  108. package/docs/markdown/classes/UserProfileIconComponent.md +7 -7
  109. package/docs/markdown/functions/IsNavigationDividerItem.md +2 -2
  110. package/docs/markdown/functions/IsNavigationInsertItem.md +2 -2
  111. package/docs/markdown/functions/IsNavigationItem.md +2 -2
  112. package/docs/markdown/functions/provideExternalApps.md +2 -2
  113. package/docs/markdown/functions/provideLayout.md +2 -2
  114. package/docs/markdown/functions/withDefaultHeaderComponent.md +2 -2
  115. package/docs/markdown/functions/withDefaultHeaderItems.md +2 -2
  116. package/docs/markdown/functions/withFooterComponents.md +2 -2
  117. package/docs/markdown/functions/withHeaderComponents.md +2 -2
  118. package/docs/markdown/functions/withNavigationConfig.md +2 -2
  119. package/docs/markdown/functions/withNavigationInserts.md +2 -2
  120. package/docs/markdown/functions/withReleaseInfoModules.md +2 -2
  121. package/docs/markdown/functions/withSettingsMenuItems.md +2 -2
  122. package/docs/markdown/functions/withUserProfileDataSource.md +2 -2
  123. package/docs/markdown/globals.md +2 -2
  124. package/docs/markdown/interfaces/NavigationDividerItem.md +4 -4
  125. package/docs/markdown/interfaces/NavigationInsertItem.md +3 -3
  126. package/docs/markdown/interfaces/NavigationItem.md +7 -7
  127. package/docs/markdown/interfaces/NavigationStatus.md +3 -3
  128. package/docs/markdown/interfaces/ReleaseInfoModule.md +5 -5
  129. package/docs/markdown/interfaces/SettingsMenuItem.md +5 -5
  130. package/docs/markdown/type-aliases/DefaultHeaderItemComponent.md +2 -2
  131. package/docs/markdown/type-aliases/ExternalApp.md +2 -2
  132. package/docs/markdown/type-aliases/ExtractUsernameFromProfileFn.md +2 -2
  133. package/docs/markdown/type-aliases/Navigation.md +2 -2
  134. package/docs/markdown/type-aliases/NavigationWithInserts.md +2 -2
  135. package/docs/markdown/type-aliases/SettingsMenuItemComponent.md +2 -2
  136. package/docs/markdown/variables/EXTRACT_USERNAME_FROM_PROFILE.md +2 -2
  137. package/docs/markdown/variables/RXAP_DEFAULT_HEADER_ITEM_COMPONENT.md +2 -2
  138. package/docs/markdown/variables/RXAP_EXTERNAL_APP.md +2 -2
  139. package/docs/markdown/variables/RXAP_EXTERNAL_APP_FILTER.md +2 -2
  140. package/docs/markdown/variables/RXAP_FOOTER_COMPONENT.md +2 -2
  141. package/docs/markdown/variables/RXAP_HEADER_COMPONENT.md +2 -2
  142. package/docs/markdown/variables/RXAP_LAYOUT_APPS_GRID.md +2 -2
  143. package/docs/markdown/variables/RXAP_LOGO_CONFIG.md +2 -2
  144. package/docs/markdown/variables/RXAP_LOGO_CONFIG_DEFAULTS.md +2 -2
  145. package/docs/markdown/variables/RXAP_NAVIGATION_CONFIG.md +2 -2
  146. package/docs/markdown/variables/RXAP_NAVIGATION_CONFIG_INSERTS.md +2 -2
  147. package/docs/markdown/variables/RXAP_NAVIGATION_LAYOUT_CONFIG_DEFAULTS.md +2 -2
  148. package/docs/markdown/variables/RXAP_RELEASE_INFO_MODULE.md +2 -2
  149. package/docs/markdown/variables/RXAP_SETTINGS_MENU_ITEM.md +2 -2
  150. package/docs/markdown/variables/RXAP_SETTINGS_MENU_ITEM_COMPONENT.md +2 -2
  151. package/docs/markdown/variables/RXAP_USER_PROFILE_DATA_SOURCE.md +2 -2
  152. package/docs/wiki/Class.AppsButtonComponent.md +7 -7
  153. package/docs/wiki/Class.BaseLayoutComponent.md +1 -1
  154. package/docs/wiki/Class.DefaultHeaderComponent.md +9 -9
  155. package/docs/wiki/Class.DefaultHeaderService.md +5 -5
  156. package/docs/wiki/Class.ExternalAppsService.md +17 -17
  157. package/docs/wiki/Class.FooterComponent.md +4 -4
  158. package/docs/wiki/Class.FooterDirective.md +3 -3
  159. package/docs/wiki/Class.FooterService.md +5 -5
  160. package/docs/wiki/Class.HeaderComponent.md +5 -5
  161. package/docs/wiki/Class.HeaderDirective.md +3 -3
  162. package/docs/wiki/Class.HeaderService.md +5 -5
  163. package/docs/wiki/Class.LayoutComponent.md +5 -5
  164. package/docs/wiki/Class.LayoutService.md +16 -16
  165. package/docs/wiki/Class.LogoService.md +5 -5
  166. package/docs/wiki/Class.MinimalLayoutComponent.md +1 -1
  167. package/docs/wiki/Class.NavigationComponent.md +11 -11
  168. package/docs/wiki/Class.NavigationItemComponent.md +13 -13
  169. package/docs/wiki/Class.NavigationProgressBarComponent.md +3 -3
  170. package/docs/wiki/Class.NavigationService.md +11 -11
  171. package/docs/wiki/Class.ReleaseInfoComponent.md +5 -5
  172. package/docs/wiki/Class.SettingsButtonComponent.md +18 -18
  173. package/docs/wiki/Class.SidenavComponent.md +17 -17
  174. package/docs/wiki/Class.SidenavFooterDirective.md +2 -2
  175. package/docs/wiki/Class.SidenavHeaderDirective.md +2 -2
  176. package/docs/wiki/Class.SidenavToggleButtonComponent.md +4 -4
  177. package/docs/wiki/Class.UserProfileIconComponent.md +6 -6
  178. package/docs/wiki/Function.IsNavigationDividerItem.md +1 -1
  179. package/docs/wiki/Function.IsNavigationInsertItem.md +1 -1
  180. package/docs/wiki/Function.IsNavigationItem.md +1 -1
  181. package/docs/wiki/Function.provideExternalApps.md +1 -1
  182. package/docs/wiki/Function.provideLayout.md +1 -1
  183. package/docs/wiki/Function.withDefaultHeaderComponent.md +1 -1
  184. package/docs/wiki/Function.withDefaultHeaderItems.md +1 -1
  185. package/docs/wiki/Function.withFooterComponents.md +1 -1
  186. package/docs/wiki/Function.withHeaderComponents.md +1 -1
  187. package/docs/wiki/Function.withNavigationConfig.md +1 -1
  188. package/docs/wiki/Function.withNavigationInserts.md +1 -1
  189. package/docs/wiki/Function.withReleaseInfoModules.md +1 -1
  190. package/docs/wiki/Function.withSettingsMenuItems.md +1 -1
  191. package/docs/wiki/Function.withUserProfileDataSource.md +1 -1
  192. package/docs/wiki/Home.md +5 -3
  193. package/docs/wiki/Interface.NavigationDividerItem.md +3 -3
  194. package/docs/wiki/Interface.NavigationInsertItem.md +2 -2
  195. package/docs/wiki/Interface.NavigationItem.md +6 -6
  196. package/docs/wiki/Interface.NavigationStatus.md +2 -2
  197. package/docs/wiki/Interface.ReleaseInfoModule.md +4 -4
  198. package/docs/wiki/Interface.SettingsMenuItem.md +4 -4
  199. package/docs/wiki/TypeAlias.DefaultHeaderItemComponent.md +1 -1
  200. package/docs/wiki/TypeAlias.ExternalApp.md +1 -1
  201. package/docs/wiki/TypeAlias.ExtractUsernameFromProfileFn.md +1 -1
  202. package/docs/wiki/TypeAlias.Navigation.md +1 -1
  203. package/docs/wiki/TypeAlias.NavigationWithInserts.md +1 -1
  204. package/docs/wiki/TypeAlias.SettingsMenuItemComponent.md +1 -1
  205. package/docs/wiki/Variable.EXTRACT_USERNAME_FROM_PROFILE.md +1 -1
  206. package/docs/wiki/Variable.RXAP_DEFAULT_HEADER_ITEM_COMPONENT.md +1 -1
  207. package/docs/wiki/Variable.RXAP_EXTERNAL_APP.md +1 -1
  208. package/docs/wiki/Variable.RXAP_EXTERNAL_APP_FILTER.md +1 -1
  209. package/docs/wiki/Variable.RXAP_FOOTER_COMPONENT.md +1 -1
  210. package/docs/wiki/Variable.RXAP_HEADER_COMPONENT.md +1 -1
  211. package/docs/wiki/Variable.RXAP_LAYOUT_APPS_GRID.md +1 -1
  212. package/docs/wiki/Variable.RXAP_LOGO_CONFIG.md +1 -1
  213. package/docs/wiki/Variable.RXAP_LOGO_CONFIG_DEFAULTS.md +1 -1
  214. package/docs/wiki/Variable.RXAP_NAVIGATION_CONFIG.md +1 -1
  215. package/docs/wiki/Variable.RXAP_NAVIGATION_CONFIG_INSERTS.md +1 -1
  216. package/docs/wiki/Variable.RXAP_NAVIGATION_LAYOUT_CONFIG_DEFAULTS.md +1 -1
  217. package/docs/wiki/Variable.RXAP_RELEASE_INFO_MODULE.md +1 -1
  218. package/docs/wiki/Variable.RXAP_SETTINGS_MENU_ITEM.md +1 -1
  219. package/docs/wiki/Variable.RXAP_SETTINGS_MENU_ITEM_COMPONENT.md +1 -1
  220. package/docs/wiki/Variable.RXAP_USER_PROFILE_DATA_SOURCE.md +1 -1
  221. package/docs/wiki/globals.md +1 -1
  222. package/package.json +30 -32
  223. package/src/generators/init/generator.js +120 -0
  224. package/src/generators/init/index.js +6 -0
  225. package/src/generators/package.json +3 -0
  226. package/compodoc/components/LanguageSelectorComponent.html +0 -478
  227. package/compodoc/components/ResetButtonComponent.html +0 -486
  228. package/compodoc/components/SignOutComponent.html +0 -440
  229. package/compodoc/components/ToggleWindowSidenavButtonComponent.html +0 -549
  230. package/compodoc/components/VersionComponent.html +0 -524
  231. package/compodoc/components/WindowContainerSidenavComponent.html +0 -687
  232. package/compodoc/directives/FooterDirective-1.html +0 -293
  233. package/compodoc/injectables/AppUrlService.html +0 -829
  234. package/compodoc/injectables/AuthenticationServiceMock.html +0 -303
  235. package/compodoc/injectables/LayoutComponentService.html +0 -848
  236. package/compodoc/injectables/ReplaceRouterPathsService.html +0 -337
  237. package/compodoc/injectables/SidenavComponentService.html +0 -408
  238. package/compodoc/interfaces/ExternalApps.html +0 -634
  239. package/compodoc/interfaces/LogoConfig.html +0 -381
  240. package/compodoc/js/libs/vis.min.js +0 -47
  241. package/compodoc/js/menu-wc_es5.js +0 -40
  242. package/compodoc/pipes/ReplaceRouterPathsPipe.html +0 -363
  243. package/src/generators/init/generator.spec.ts +0 -228
  244. package/src/generators/init/generator.ts +0 -139
  245. package/src/generators/init/index.ts +0 -5
  246. package/src/generators/init/schema.d.ts +0 -2
  247. package/theme.css +0 -425
@@ -1,40 +0,0 @@
1
- 'use strict';
2
-
3
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
- function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
5
- function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
6
- function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
7
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
8
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
9
- function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
10
- function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
11
- function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
12
- function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
13
- function _wrapNativeSuper(t) { var r = "function" == typeof Map ? new Map() : void 0; return _wrapNativeSuper = function _wrapNativeSuper(t) { if (null === t || !_isNativeFunction(t)) return t; if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function"); if (void 0 !== r) { if (r.has(t)) return r.get(t); r.set(t, Wrapper); } function Wrapper() { return _construct(t, arguments, _getPrototypeOf(this).constructor); } return Wrapper.prototype = Object.create(t.prototype, { constructor: { value: Wrapper, enumerable: !1, writable: !0, configurable: !0 } }), _setPrototypeOf(Wrapper, t); }, _wrapNativeSuper(t); }
14
- function _construct(t, e, r) { if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments); var o = [null]; o.push.apply(o, e); var p = new (t.bind.apply(t, o))(); return r && _setPrototypeOf(p, r.prototype), p; }
15
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
16
- function _isNativeFunction(t) { try { return -1 !== Function.toString.call(t).indexOf("[native code]"); } catch (n) { return "function" == typeof t; } }
17
- function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
18
- function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
19
- customElements.define('compodoc-menu', /*#__PURE__*/function (_HTMLElement) {
20
- function _class() {
21
- var _this;
22
- _classCallCheck(this, _class);
23
- _this = _callSuper(this, _class);
24
- _this.isNormalMode = _this.getAttribute('mode') === 'normal';
25
- return _this;
26
- }
27
- _inherits(_class, _HTMLElement);
28
- return _createClass(_class, [{
29
- key: "connectedCallback",
30
- value: function connectedCallback() {
31
- this.render(this.isNormalMode);
32
- }
33
- }, {
34
- key: "render",
35
- value: function render(isNormalMode) {
36
- var tp = lithtml.html("\n <nav>\n <ul class=\"list\">\n <li class=\"title\">\n <a href=\"index.html\" data-type=\"index-link\">angular-layout</a>\n </li>\n\n <li class=\"divider\"></li>\n ".concat(isNormalMode ? "<div id=\"book-search-input\" role=\"search\"><input type=\"text\" placeholder=\"Type to search\"></div>" : '', "\n <li class=\"chapter\">\n <a data-type=\"chapter-link\" href=\"index.html\"><span class=\"icon ion-ios-home\"></span>Getting started</a>\n <ul class=\"links\">\n <li class=\"link\">\n <a href=\"overview.html\" data-type=\"chapter-link\">\n <span class=\"icon ion-ios-keypad\"></span>Overview\n </a>\n </li>\n <li class=\"link\">\n <a href=\"index.html\" data-type=\"chapter-link\">\n <span class=\"icon ion-ios-paper\"></span>README\n </a>\n </li>\n <li class=\"link\">\n <a href=\"changelog.html\" data-type=\"chapter-link\">\n <span class=\"icon ion-ios-paper\"></span>CHANGELOG\n </a>\n </li>\n <li class=\"link\">\n <a href=\"license.html\" data-type=\"chapter-link\">\n <span class=\"icon ion-ios-paper\"></span>LICENSE\n </a>\n </li>\n <li class=\"link\">\n <a href=\"dependencies.html\" data-type=\"chapter-link\">\n <span class=\"icon ion-ios-list\"></span>Dependencies\n </a>\n </li>\n <li class=\"link\">\n <a href=\"properties.html\" data-type=\"chapter-link\">\n <span class=\"icon ion-ios-apps\"></span>Properties\n </a>\n </li>\n </ul>\n </li>\n <li class=\"chapter\">\n <div class=\"simple menu-toggler\" data-bs-toggle=\"collapse\" ").concat(isNormalMode ? 'data-bs-target="#components-links"' : 'data-bs-target="#xs-components-links"', ">\n <span class=\"icon ion-md-cog\"></span>\n <span>Components</span>\n <span class=\"icon ion-ios-arrow-down\"></span>\n </div>\n <ul class=\"links collapse \" ").concat(isNormalMode ? 'id="components-links"' : 'id="xs-components-links"', ">\n <li class=\"link\">\n <a href=\"components/AppsButtonComponent.html\" data-type=\"entity-link\" >AppsButtonComponent</a>\n </li>\n <li class=\"link\">\n <a href=\"components/BaseLayoutComponent.html\" data-type=\"entity-link\" >BaseLayoutComponent</a>\n </li>\n <li class=\"link\">\n <a href=\"components/DefaultHeaderComponent.html\" data-type=\"entity-link\" >DefaultHeaderComponent</a>\n </li>\n <li class=\"link\">\n <a href=\"components/FooterComponent.html\" data-type=\"entity-link\" >FooterComponent</a>\n </li>\n <li class=\"link\">\n <a href=\"components/HeaderComponent.html\" data-type=\"entity-link\" >HeaderComponent</a>\n </li>\n <li class=\"link\">\n <a href=\"components/LayoutComponent.html\" data-type=\"entity-link\" >LayoutComponent</a>\n </li>\n <li class=\"link\">\n <a href=\"components/MinimalLayoutComponent.html\" data-type=\"entity-link\" >MinimalLayoutComponent</a>\n </li>\n <li class=\"link\">\n <a href=\"components/NavigationComponent.html\" data-type=\"entity-link\" >NavigationComponent</a>\n </li>\n <li class=\"link\">\n <a href=\"components/NavigationItemComponent.html\" data-type=\"entity-link\" >NavigationItemComponent</a>\n </li>\n <li class=\"link\">\n <a href=\"components/NavigationProgressBarComponent.html\" data-type=\"entity-link\" >NavigationProgressBarComponent</a>\n </li>\n <li class=\"link\">\n <a href=\"components/ReleaseInfoComponent.html\" data-type=\"entity-link\" >ReleaseInfoComponent</a>\n </li>\n <li class=\"link\">\n <a href=\"components/SettingsButtonComponent.html\" data-type=\"entity-link\" >SettingsButtonComponent</a>\n </li>\n <li class=\"link\">\n <a href=\"components/SidenavComponent.html\" data-type=\"entity-link\" >SidenavComponent</a>\n </li>\n <li class=\"link\">\n <a href=\"components/SidenavToggleButtonComponent.html\" data-type=\"entity-link\" >SidenavToggleButtonComponent</a>\n </li>\n <li class=\"link\">\n <a href=\"components/UserProfileIconComponent.html\" data-type=\"entity-link\" >UserProfileIconComponent</a>\n </li>\n </ul>\n </li>\n <li class=\"chapter\">\n <div class=\"simple menu-toggler\" data-bs-toggle=\"collapse\" ").concat(isNormalMode ? 'data-bs-target="#directives-links"' : 'data-bs-target="#xs-directives-links"', ">\n <span class=\"icon ion-md-code-working\"></span>\n <span>Directives</span>\n <span class=\"icon ion-ios-arrow-down\"></span>\n </div>\n <ul class=\"links collapse \" ").concat(isNormalMode ? 'id="directives-links"' : 'id="xs-directives-links"', ">\n <li class=\"link\">\n <a href=\"directives/FooterDirective.html\" data-type=\"entity-link\" >FooterDirective</a>\n </li>\n <li class=\"link\">\n <a href=\"directives/HeaderDirective.html\" data-type=\"entity-link\" >HeaderDirective</a>\n </li>\n <li class=\"link\">\n <a href=\"directives/SidenavFooterDirective.html\" data-type=\"entity-link\" >SidenavFooterDirective</a>\n </li>\n <li class=\"link\">\n <a href=\"directives/SidenavHeaderDirective.html\" data-type=\"entity-link\" >SidenavHeaderDirective</a>\n </li>\n </ul>\n </li>\n <li class=\"chapter\">\n <div class=\"simple menu-toggler\" data-bs-toggle=\"collapse\" ").concat(isNormalMode ? 'data-bs-target="#injectables-links"' : 'data-bs-target="#xs-injectables-links"', ">\n <span class=\"icon ion-md-arrow-round-down\"></span>\n <span>Injectables</span>\n <span class=\"icon ion-ios-arrow-down\"></span>\n </div>\n <ul class=\"links collapse \" ").concat(isNormalMode ? 'id="injectables-links"' : 'id="xs-injectables-links"', ">\n <li class=\"link\">\n <a href=\"injectables/DefaultHeaderService.html\" data-type=\"entity-link\" >DefaultHeaderService</a>\n </li>\n <li class=\"link\">\n <a href=\"injectables/ExternalAppsService.html\" data-type=\"entity-link\" >ExternalAppsService</a>\n </li>\n <li class=\"link\">\n <a href=\"injectables/FooterService.html\" data-type=\"entity-link\" >FooterService</a>\n </li>\n <li class=\"link\">\n <a href=\"injectables/HeaderService.html\" data-type=\"entity-link\" >HeaderService</a>\n </li>\n <li class=\"link\">\n <a href=\"injectables/LayoutService.html\" data-type=\"entity-link\" >LayoutService</a>\n </li>\n <li class=\"link\">\n <a href=\"injectables/LogoService.html\" data-type=\"entity-link\" >LogoService</a>\n </li>\n <li class=\"link\">\n <a href=\"injectables/NavigationService.html\" data-type=\"entity-link\" >NavigationService</a>\n </li>\n </ul>\n </li>\n <li class=\"chapter\">\n <div class=\"simple menu-toggler\" data-bs-toggle=\"collapse\" ").concat(isNormalMode ? 'data-bs-target="#interfaces-links"' : 'data-bs-target="#xs-interfaces-links"', ">\n <span class=\"icon ion-md-information-circle-outline\"></span>\n <span>Interfaces</span>\n <span class=\"icon ion-ios-arrow-down\"></span>\n </div>\n <ul class=\"links collapse \" ").concat(isNormalMode ? ' id="interfaces-links"' : 'id="xs-interfaces-links"', ">\n <li class=\"link\">\n <a href=\"interfaces/NavigationDividerItem.html\" data-type=\"entity-link\" >NavigationDividerItem</a>\n </li>\n <li class=\"link\">\n <a href=\"interfaces/NavigationInsertItem.html\" data-type=\"entity-link\" >NavigationInsertItem</a>\n </li>\n <li class=\"link\">\n <a href=\"interfaces/NavigationItem.html\" data-type=\"entity-link\" >NavigationItem</a>\n </li>\n <li class=\"link\">\n <a href=\"interfaces/NavigationStatus.html\" data-type=\"entity-link\" >NavigationStatus</a>\n </li>\n <li class=\"link\">\n <a href=\"interfaces/ReleaseInfoModule.html\" data-type=\"entity-link\" >ReleaseInfoModule</a>\n </li>\n <li class=\"link\">\n <a href=\"interfaces/SettingsMenuItem.html\" data-type=\"entity-link\" >SettingsMenuItem</a>\n </li>\n </ul>\n </li>\n <li class=\"chapter\">\n <div class=\"simple menu-toggler\" data-bs-toggle=\"collapse\" ").concat(isNormalMode ? 'data-bs-target="#miscellaneous-links"' : 'data-bs-target="#xs-miscellaneous-links"', ">\n <span class=\"icon ion-ios-cube\"></span>\n <span>Miscellaneous</span>\n <span class=\"icon ion-ios-arrow-down\"></span>\n </div>\n <ul class=\"links collapse \" ").concat(isNormalMode ? 'id="miscellaneous-links"' : 'id="xs-miscellaneous-links"', ">\n <li class=\"link\">\n <a href=\"miscellaneous/functions.html\" data-type=\"entity-link\">Functions</a>\n </li>\n <li class=\"link\">\n <a href=\"miscellaneous/typealiases.html\" data-type=\"entity-link\">Type aliases</a>\n </li>\n <li class=\"link\">\n <a href=\"miscellaneous/variables.html\" data-type=\"entity-link\">Variables</a>\n </li>\n </ul>\n </li>\n <li class=\"divider\"></li>\n <li class=\"copyright\">\n Documentation generated using <a href=\"https://compodoc.app/\" target=\"_blank\" rel=\"noopener noreferrer\">\n <img data-src=\"images/compodoc-vectorise.png\" class=\"img-responsive\" data-type=\"compodoc-logo\">\n </a>\n </li>\n </ul>\n </nav>\n "));
37
- this.innerHTML = tp.strings;
38
- }
39
- }]);
40
- }(/*#__PURE__*/_wrapNativeSuper(HTMLElement)));
@@ -1,363 +0,0 @@
1
- <!doctype html>
2
- <html class="no-js" lang="">
3
- <head>
4
- <meta charset="utf-8">
5
- <meta http-equiv="x-ua-compatible" content="ie=edge">
6
- <title>angular-layout</title>
7
- <meta name="description" content="">
8
- <meta name="viewport" content="width=device-width, initial-scale=1">
9
-
10
- <link rel="icon" type="image/x-icon" href="../images/favicon.ico">
11
- <link rel="stylesheet" href="../styles/style.css">
12
- <link rel="stylesheet" href="../styles/dark.css">
13
- </head>
14
- <body>
15
- <script>
16
- // Blocking script to avoid flickering dark mode
17
- // Dark mode toggle button
18
- var useDark = window.matchMedia('(prefers-color-scheme: dark)');
19
- var darkModeState = useDark.matches;
20
- var $darkModeToggleSwitchers = document.querySelectorAll('.dark-mode-switch input');
21
- var $darkModeToggles = document.querySelectorAll('.dark-mode-switch');
22
- var darkModeStateLocal = localStorage.getItem('compodoc_darkmode-state');
23
-
24
- function checkToggle(check) {
25
- for (var i = 0; i < $darkModeToggleSwitchers.length; i++) {
26
- $darkModeToggleSwitchers[i].checked = check;
27
- }
28
- }
29
-
30
- function toggleDarkMode(state) {
31
- if (window.localStorage) {
32
- localStorage.setItem('compodoc_darkmode-state', state);
33
- }
34
-
35
- checkToggle(state);
36
-
37
- const hasClass = document.body.classList.contains('dark');
38
-
39
- if (state) {
40
- for (var i = 0; i < $darkModeToggles.length; i++) {
41
- $darkModeToggles[i].classList.add('dark');
42
- }
43
- if (!hasClass) {
44
- document.body.classList.add('dark');
45
- }
46
- } else {
47
- for (var i = 0; i < $darkModeToggles.length; i++) {
48
- $darkModeToggles[i].classList.remove('dark');
49
- }
50
- if (hasClass) {
51
- document.body.classList.remove('dark');
52
- }
53
- }
54
- }
55
-
56
- useDark.addEventListener('change', function (evt) {
57
- toggleDarkMode(evt.matches);
58
- });
59
- if (darkModeStateLocal) {
60
- darkModeState = darkModeStateLocal === 'true';
61
- }
62
- toggleDarkMode(darkModeState);
63
- </script>
64
-
65
- <div class="navbar navbar-default navbar-fixed-top d-md-none p-0">
66
- <div class="d-flex">
67
- <a href="../" class="navbar-brand">angular-layout</a>
68
- <button type="button" class="btn btn-default btn-menu ion-ios-menu" id="btn-menu"></button>
69
- </div>
70
- </div>
71
-
72
- <div class="xs-menu menu" id="mobile-menu">
73
- <div id="book-search-input" role="search"><input type="text" placeholder="Type to search"></div> <compodoc-menu></compodoc-menu>
74
- </div>
75
-
76
- <div class="container-fluid main">
77
- <div class="row main">
78
- <div class="d-none d-md-block menu">
79
- <compodoc-menu mode="normal"></compodoc-menu>
80
- </div>
81
- <!-- START CONTENT -->
82
- <div class="content pipe">
83
- <div class="content-data">
84
-
85
-
86
-
87
-
88
-
89
-
90
-
91
-
92
-
93
-
94
-
95
- <ol class="breadcrumb">
96
- <li class="breadcrumb-item">Pipes</li>
97
- <li class="breadcrumb-item" >ReplaceRouterPathsPipe</li>
98
- </ol>
99
-
100
- <ul class="nav nav-tabs" role="tablist">
101
- <li class="nav-item">
102
- <a href="#info"
103
- class="nav-link"
104
- class="nav-link active"
105
- role="tab" id="info-tab" data-bs-toggle="tab" data-link="info">Info</a>
106
- </li>
107
- <li class="nav-item">
108
- <a href="#source"
109
- class="nav-link"
110
-
111
- role="tab" id="source-tab" data-bs-toggle="tab" data-link="source">Source</a>
112
- </li>
113
- </ul>
114
-
115
- <div class="tab-content">
116
- <div class="tab-pane fade active in" id="info">
117
-
118
- <p class="comment">
119
- <h3>File</h3>
120
- </p>
121
- <p class="comment">
122
- <code>src/lib/navigation/replace-router-paths.pipe.ts</code>
123
- </p>
124
-
125
-
126
-
127
-
128
- <section data-compodoc="block-metadata">
129
- <h3>Metadata</h3>
130
- <table class="table table-sm table-hover metadata">
131
- <tbody>
132
- <tr>
133
- <td class="col-md-3">Name</td>
134
- <td class="col-md-9">replaceRouterPaths</td>
135
- </tr>
136
- <tr>
137
- <td class="col-md-3">Standalone</td>
138
- <td class="col-md-9"><code>true</code></td>
139
- </tr>
140
- </tbody>
141
- </table>
142
- </section>
143
-
144
- <section data-compodoc="block-methods">
145
-
146
- <h3 id="methods">
147
- Methods
148
- </h3>
149
- <table class="table table-sm table-bordered">
150
- <tbody>
151
- <tr>
152
- <td class="col-md-4">
153
- <a name="transform"></a>
154
- <span class="name">
155
- <span ><b>transform</b></span>
156
- <a href="#transform"><span class="icon ion-ios-link"></span></a>
157
- </span>
158
- </td>
159
- </tr>
160
- <tr>
161
- <td class="col-md-4">
162
- <code>transform(routerLink: string[])</code>
163
- </td>
164
- </tr>
165
-
166
-
167
- <tr>
168
- <td class="col-md-4">
169
- <div class="io-line">Defined in <a href="" data-line="18"
170
- class="link-to-prism">src/lib/navigation/replace-router-paths.pipe.ts:18</a></div>
171
- </td>
172
- </tr>
173
-
174
-
175
- <tr>
176
- <td class="col-md-4">
177
-
178
- <div class="io-description">
179
- <b>Parameters :</b>
180
-
181
- <table class="params">
182
- <thead>
183
- <tr>
184
- <td>Name</td>
185
- <td>Type</td>
186
- <td>Optional</td>
187
- </tr>
188
- </thead>
189
- <tbody>
190
- <tr>
191
- <td>routerLink</td>
192
- <td>
193
- <code>string[]</code>
194
- </td>
195
-
196
- <td>
197
- No
198
- </td>
199
-
200
-
201
- </tr>
202
- </tbody>
203
- </table>
204
- </div>
205
- <div class="io-description">
206
- <b>Returns : </b> <code>Observable&lt;string[]&gt;</code>
207
-
208
- </div>
209
- <div class="io-description">
210
-
211
- </div>
212
- </td>
213
- </tr>
214
- </tbody>
215
- </table>
216
- </section>
217
- <section data-compodoc="block-properties">
218
-
219
- <h3 id="inputs">
220
- Properties
221
- </h3>
222
- <table class="table table-sm table-bordered">
223
- <tbody>
224
- <tr>
225
- <td class="col-md-4">
226
- <a name="rrp"></a>
227
- <span class="name">
228
- <span class="modifier">Public</span>
229
- <span ><b>rrp</b></span>
230
- <a href="#rrp"><span class="icon ion-ios-link"></span></a>
231
- </span>
232
- </td>
233
- </tr>
234
- <tr>
235
- <td class="col-md-4">
236
- <i>Type : </i> <code><a href="../injectables/ReplaceRouterPathsService.html" target="_self" >ReplaceRouterPathsService</a></code>
237
-
238
- </td>
239
- </tr>
240
- <tr>
241
- <td class="col-md-4">
242
- <div class="io-line">Defined in <a href="" data-line="14" class="link-to-prism">src/lib/navigation/replace-router-paths.pipe.ts:14</a></div>
243
- </td>
244
- </tr>
245
-
246
-
247
- </tbody>
248
- </table>
249
- </section>
250
-
251
- </div>
252
-
253
-
254
- <div class="tab-pane fade tab-source-code" id="source">
255
- <pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import {
256
- Pipe,
257
- PipeTransform,
258
- } from &#x27;@angular/core&#x27;;
259
- import { Observable } from &#x27;rxjs&#x27;;
260
- import { ReplaceRouterPathsService } from &#x27;./replace-router-paths.service&#x27;;
261
-
262
- @Pipe({
263
- name: &#x27;replaceRouterPaths&#x27;,
264
- standalone: true,
265
- })
266
- export class ReplaceRouterPathsPipe implements PipeTransform {
267
- constructor(
268
- public rrp: ReplaceRouterPathsService,
269
- ) {
270
- }
271
-
272
- transform(routerLink: string[]): Observable&lt;string[]&gt; {
273
- return this.rrp.transform(routerLink);
274
- }
275
- }
276
-
277
-
278
- </code></pre>
279
- </div>
280
-
281
- </div>
282
-
283
-
284
-
285
-
286
-
287
-
288
-
289
-
290
-
291
-
292
- </div><div class="search-results">
293
- <div class="has-results">
294
- <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
295
- <ul class="search-results-list"></ul>
296
- </div>
297
- <div class="no-results">
298
- <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
299
- </div>
300
- </div>
301
- </div>
302
- <!-- END CONTENT -->
303
- </div>
304
- </div>
305
-
306
- <label class="dark-mode-switch">
307
- <input type="checkbox">
308
- <span class="slider">
309
- <svg class="slider-icon" viewBox="0 0 24 24" fill="none" height="20" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" width="20" xmlns="http://www.w3.org/2000/svg">
310
- <path d="M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"></path>
311
- </svg>
312
- </span>
313
- </label>
314
-
315
- <script>
316
- var COMPODOC_CURRENT_PAGE_DEPTH = 1;
317
- var COMPODOC_CURRENT_PAGE_CONTEXT = 'pipe';
318
- var COMPODOC_CURRENT_PAGE_URL = 'ReplaceRouterPathsPipe.html';
319
- var MAX_SEARCH_RESULTS = 15;
320
- </script>
321
-
322
- <script>
323
- $darkModeToggleSwitchers = document.querySelectorAll('.dark-mode-switch input');
324
- checkToggle(darkModeState);
325
- if ($darkModeToggleSwitchers.length > 0) {
326
- for (var i = 0; i < $darkModeToggleSwitchers.length; i++) {
327
- $darkModeToggleSwitchers[i].addEventListener('change', function (event) {
328
- darkModeState = !darkModeState;
329
- toggleDarkMode(darkModeState);
330
- });
331
- }
332
- }
333
- </script>
334
-
335
- <script src="../js/libs/custom-elements.min.js"></script>
336
- <script src="../js/libs/lit-html.js"></script>
337
-
338
- <script src="../js/menu-wc.js" defer></script>
339
- <script nomodule src="../js/menu-wc_es5.js" defer></script>
340
-
341
- <script src="../js/libs/bootstrap-native.js"></script>
342
-
343
- <script src="../js/libs/es6-shim.min.js"></script>
344
- <script src="../js/libs/EventDispatcher.js"></script>
345
- <script src="../js/libs/promise.min.js"></script>
346
- <script src="../js/libs/zepto.min.js"></script>
347
-
348
- <script src="../js/compodoc.js"></script>
349
-
350
- <script src="../js/tabs.js"></script>
351
- <script src="../js/menu.js"></script>
352
- <script src="../js/libs/clipboard.min.js"></script>
353
- <script src="../js/libs/prism.js"></script>
354
- <script src="../js/sourceCode.js"></script>
355
- <script src="../js/search/search.js"></script>
356
- <script src="../js/search/lunr.min.js"></script>
357
- <script src="../js/search/search-lunr.js"></script>
358
- <script src="../js/search/search_index.js"></script>
359
- <script src="../js/lazy-load-graphs.js"></script>
360
-
361
-
362
- </body>
363
- </html>
@@ -1,228 +0,0 @@
1
- import { readJson, Tree, writeJson } from '@nx/devkit';
2
- import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing';
3
- import { readFileSync } from 'fs';
4
- import { join } from 'path';
5
- import initGenerator from './generator';
6
-
7
- const mockFiles: Record<string, string> = ((globalThis as any).__mockFiles = {});
8
-
9
- jest.mock('fs', () => {
10
- const actual = jest.requireActual('fs');
11
- const mockFiles = (): Record<string, string> => (globalThis as any).__mockFiles ?? {};
12
- return {
13
- ...actual,
14
- existsSync: (p: string) => p in mockFiles() || actual.existsSync(p),
15
- readFileSync: (p: string, ...rest: any[]) =>
16
- p in mockFiles() ? mockFiles()[p] : actual.readFileSync(p, ...rest),
17
- };
18
- });
19
-
20
- jest.mock('@nx/devkit', () => ({
21
- ...jest.requireActual('@nx/devkit'),
22
- installPackagesTask: jest.fn(),
23
- }));
24
-
25
- const pkg = JSON.parse(
26
- readFileSync(join(__dirname, '..', '..', '..', 'package.json'), 'utf-8'),
27
- );
28
- const peers: Record<string, string> = pkg.peerDependencies ?? {};
29
- const peerNames = Object.keys(peers);
30
-
31
- describe('initGenerator', () => {
32
- let tree: Tree;
33
-
34
- beforeEach(() => {
35
- tree = createTreeWithEmptyWorkspace();
36
- jest.spyOn(console, 'log').mockImplementation(() => undefined);
37
- jest.spyOn(console, 'warn').mockImplementation(() => undefined);
38
- jest.spyOn(console, 'error').mockImplementation(() => undefined);
39
- });
40
-
41
- afterEach(() => jest.restoreAllMocks());
42
-
43
- it('is a function exported as default', () => {
44
- expect(typeof initGenerator).toBe('function');
45
- });
46
-
47
- if (peerNames.length) {
48
- it('adds missing peer dependencies to the root package.json', async () => {
49
- writeJson(tree, 'package.json', {
50
- name: 'root',
51
- dependencies: { [pkg.name]: '1.0.0' },
52
- devDependencies: {},
53
- });
54
- await initGenerator(tree, {} as any);
55
- const json = readJson(tree, 'package.json');
56
- for (const [dep, version] of Object.entries(peers)) {
57
- expect(json.dependencies[dep] ?? json.devDependencies[dep]).toBe(
58
- version,
59
- );
60
- }
61
- });
62
-
63
- it('does not change package.json when all peers exist', async () => {
64
- const deps = { [pkg.name]: '1.0.0', ...peers };
65
- writeJson(tree, 'package.json', {
66
- name: 'root',
67
- dependencies: deps,
68
- devDependencies: {},
69
- });
70
- await initGenerator(tree, {} as any);
71
- expect(readJson(tree, 'package.json').dependencies).toEqual(deps);
72
- });
73
-
74
- it('adds peers to devDependencies when the package is a dev dependency', async () => {
75
- writeJson(tree, 'package.json', {
76
- name: 'root',
77
- dependencies: {},
78
- devDependencies: { [pkg.name]: '1.0.0' },
79
- });
80
- await initGenerator(tree, {} as any);
81
- const json = readJson(tree, 'package.json');
82
- if (/^@rxap\/(ngx|nest)/.test(pkg.name)) {
83
- // runtime packages are moved to dependencies
84
- expect(json.dependencies[pkg.name]).toBe('1.0.0');
85
- expect(json.devDependencies[pkg.name]).toBeUndefined();
86
- expect(json.dependencies[peerNames[0]]).toBe(peers[peerNames[0]]);
87
- } else {
88
- expect(json.devDependencies[peerNames[0]]).toBe(peers[peerNames[0]]);
89
- }
90
- });
91
- } else {
92
- it('does nothing when the package declares no peer dependencies', async () => {
93
- writeJson(tree, 'package.json', { name: 'root', dependencies: {} });
94
- const before = tree.read('package.json', 'utf-8');
95
- await initGenerator(tree, {} as any);
96
- expect(tree.read('package.json', 'utf-8')).toBe(before);
97
- });
98
- }
99
- });
100
-
101
- describe('initGenerator with mocked package metadata', () => {
102
- const ownPkg = join(__dirname, '..', '..', '..', 'package.json');
103
- const peerPkg = (name: string) =>
104
- join('/virtual', 'node_modules', ...name.split('/'), 'package.json');
105
- let tree: Tree;
106
- let logs: string[];
107
-
108
- const setOwn = (json: object) => {
109
- mockFiles[ownPkg] = JSON.stringify(json);
110
- };
111
-
112
- beforeEach(() => {
113
- for (const k of Object.keys(mockFiles)) delete mockFiles[k];
114
- tree = createTreeWithEmptyWorkspace();
115
- logs = [];
116
- jest.spyOn(console, 'log').mockImplementation((m) => void logs.push(String(m)));
117
- jest.spyOn(console, 'warn').mockImplementation(() => undefined);
118
- jest.spyOn(console, 'error').mockImplementation(() => undefined);
119
- });
120
-
121
- afterEach(() => jest.restoreAllMocks());
122
-
123
- it('logs and returns when package.json is missing', async () => {
124
- const spy = jest.spyOn(require('fs'), 'existsSync');
125
- spy.mockImplementation(() => false);
126
- await initGenerator(tree, {} as any);
127
- expect(console.error).toHaveBeenCalledWith(
128
- expect.stringContaining('package.json not found'),
129
- );
130
- });
131
-
132
- it('returns early without peer dependencies', async () => {
133
- setOwn({ name: '@rxap/x' });
134
- await initGenerator(tree, {} as any);
135
- expect(logs).toContain('No peer dependencies found');
136
- });
137
-
138
- it('returns early when no peers are missing', async () => {
139
- setOwn({ name: '@rxap/x', peerDependencies: { a: '1' } });
140
- writeJson(tree, 'package.json', { dependencies: { a: '1' } });
141
- await initGenerator(tree, {} as any);
142
- expect(logs).toContain('No missing peer dependencies');
143
- });
144
-
145
- it('moves a plugin package from dependencies to devDependencies', async () => {
146
- setOwn({ name: '@rxap/plugin-x', peerDependencies: { a: '1' } });
147
- writeJson(tree, 'package.json', {
148
- dependencies: { '@rxap/plugin-x': '2.0.0' },
149
- });
150
- await initGenerator(tree, {} as any);
151
- const json = readJson(tree, 'package.json');
152
- expect(json.dependencies['@rxap/plugin-x']).toBeUndefined();
153
- expect(json.devDependencies['@rxap/plugin-x']).toBe('2.0.0');
154
- expect(json.devDependencies['a']).toBe('1');
155
- });
156
-
157
- it('moves a nest package from devDependencies to dependencies', async () => {
158
- setOwn({ name: '@rxap/nest-x', peerDependencies: { a: '1' } });
159
- writeJson(tree, 'package.json', {
160
- devDependencies: { '@rxap/nest-x': '2.0.0' },
161
- });
162
- await initGenerator(tree, {} as any);
163
- const json = readJson(tree, 'package.json');
164
- expect(json.dependencies['@rxap/nest-x']).toBe('2.0.0');
165
- expect(json.dependencies['a']).toBe('1');
166
- });
167
-
168
- describe('peer init generators', () => {
169
- const run = async (peerJson?: object, extra: Record<string, string> = {}) => {
170
- setOwn({ name: '@rxap/nest-x', peerDependencies: { 'peer-a': '1' } });
171
- writeJson(tree, 'package.json', { dependencies: { '@rxap/nest-x': '1' } });
172
- if (peerJson) mockFiles[peerPkg('peer-a')] = JSON.stringify(peerJson);
173
- Object.assign(mockFiles, extra);
174
- await initGenerator(tree, { project: 'p' } as any);
175
- };
176
- const dir = join('/virtual', 'node_modules', 'peer-a');
177
-
178
- it('skips peers without package.json', async () => {
179
- await run();
180
- expect(logs).toContain('Peer dependency peer-a has no package.json');
181
- });
182
-
183
- it('skips peers without generators', async () => {
184
- await run({ name: 'peer-a' });
185
- expect(logs).toContain('Peer dependency peer-a has no generators or schematics');
186
- });
187
-
188
- it('skips peers with missing generators file', async () => {
189
- await run({ generators: './generators.json' });
190
- expect(logs).toContain('Peer dependency peer-a has no generators or schematics file');
191
- });
192
-
193
- it('skips peers without init generator', async () => {
194
- await run({ generators: './generators.json' }, {
195
- [join(dir, 'generators.json')]: JSON.stringify({ generators: {} }),
196
- });
197
- expect(logs).toContain('Peer dependency peer-a has no init generator');
198
- });
199
-
200
- it('skips peers whose init generator file is missing', async () => {
201
- await run({ generators: './generators.json' }, {
202
- [join(dir, 'generators.json')]: JSON.stringify({ generators: { init: { factory: './gen' } } }),
203
- });
204
- expect(logs.some((l) => l.includes('has no init generator file'))).toBe(true);
205
- });
206
-
207
- it('skips peers whose init export is not a function', async () => {
208
- jest.resetModules();
209
- jest.doMock(join(dir, 'gen'), () => ({ default: 1 }), { virtual: true });
210
- await run({ generators: './generators.json' }, {
211
- [join(dir, 'generators.json')]: JSON.stringify({ generators: { init: { factory: './gen' } } }),
212
- [join(dir, 'gen.js')]: '',
213
- });
214
- expect(logs).toContain('Peer dependency peer-a has no init generator function');
215
- });
216
-
217
- it('runs the init generator of a peer', async () => {
218
- const peerInit = jest.fn();
219
- jest.resetModules();
220
- jest.doMock(join(dir, 'gen'), () => ({ default: peerInit }), { virtual: true });
221
- await run({ schematics: './generators.json' }, {
222
- [join(dir, 'generators.json')]: JSON.stringify({ generators: { init: { factory: './gen' } } }),
223
- [join(dir, 'gen.js')]: '',
224
- });
225
- expect(peerInit).toHaveBeenCalledWith(tree, { project: 'p' });
226
- });
227
- });
228
- });