@genesislcap/blank-app-seed 5.22.1 → 5.23.0

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 (191) hide show
  1. package/.genx/configure.js +11 -1
  2. package/.genx/package.json +1 -1
  3. package/.genx/scripts/generate-test-apps.sh +124 -0
  4. package/.genx/templates/angular/chart.hbs +19 -7
  5. package/.genx/templates/angular/component/component.column.defs.hbs +16 -4
  6. package/.genx/templates/angular/component/component.create.form.hbs +10 -2
  7. package/.genx/templates/angular/component/component.events.config.hbs +31 -6
  8. package/.genx/templates/angular/component/component.filter.form.hbs +1 -2
  9. package/.genx/templates/angular/component/component.gridOptions.hbs +15 -3
  10. package/.genx/templates/angular/component/component.hbs +77 -46
  11. package/.genx/templates/angular/component/component.index.hbs +1 -1
  12. package/.genx/templates/angular/component/component.update.form.hbs +1 -1
  13. package/.genx/templates/angular/entityManager.hbs +6 -6
  14. package/{client-tmp/angular/src/app/utils/fdc3.ts → .genx/templates/angular/fdc3.ts.hbs} +6 -8
  15. package/.genx/templates/angular/form.hbs +9 -12
  16. package/.genx/templates/angular/grid.hbs +43 -40
  17. package/.genx/templates/angular/route.hbs +8 -2
  18. package/.genx/templates/angular/route.template.hbs +7 -7
  19. package/.genx/templates/angular/slices/eventing.slice.hbs +21 -10
  20. package/.genx/templates/angular/store.hbs +1 -5
  21. package/.genx/templates/angular/tabsPanel.hbs +2 -2
  22. package/.genx/templates/react/chart.hbs +6 -15
  23. package/.genx/templates/react/component/component.column.defs.hbs +16 -10
  24. package/.genx/templates/react/component/component.create.form.hbs +2 -2
  25. package/.genx/templates/react/component/component.events.config.hbs +32 -5
  26. package/.genx/templates/react/component/component.filter.form.hbs +1 -2
  27. package/.genx/templates/react/component/component.gridOptions.hbs +17 -11
  28. package/.genx/templates/react/component/component.hbs +84 -42
  29. package/.genx/templates/react/component/component.update.form.hbs +1 -1
  30. package/.genx/templates/react/entityManager.hbs +8 -16
  31. package/{client-tmp/react/src/utils/fdc3.ts → .genx/templates/react/fdc3.ts.hbs} +7 -8
  32. package/.genx/templates/react/form.hbs +1 -15
  33. package/.genx/templates/react/grid.hbs +11 -11
  34. package/.genx/templates/react/gridLayout.hbs +44 -4
  35. package/.genx/templates/react/horizontalLayout.hbs +10 -1
  36. package/.genx/templates/react/route.hbs +21 -14
  37. package/.genx/templates/react/slices/eventing.slice.hbs +19 -8
  38. package/.genx/templates/react/store.hbs +1 -5
  39. package/.genx/templates/react/tabsLayout.hbs +5 -1
  40. package/.genx/templates/web-components/chart.hbs +25 -25
  41. package/.genx/templates/web-components/component/component.column.defs.hbs +11 -3
  42. package/.genx/templates/web-components/component/component.create.form.hbs +11 -4
  43. package/.genx/templates/web-components/component/component.events.config.hbs +33 -6
  44. package/.genx/templates/web-components/component/component.filter.form.hbs +1 -2
  45. package/.genx/templates/web-components/component/component.gridOptions.hbs +12 -3
  46. package/.genx/templates/web-components/component/component.hbs +19 -20
  47. package/.genx/templates/web-components/component/component.index.hbs +1 -1
  48. package/.genx/templates/web-components/component/component.template.hbs +9 -13
  49. package/.genx/templates/web-components/component/component.update.form.hbs +1 -1
  50. package/.genx/templates/web-components/entityManager.hbs +92 -73
  51. package/{client-tmp/web-components/src/utils/fdc3.ts → .genx/templates/web-components/fdc3.ts.hbs} +6 -7
  52. package/.genx/templates/web-components/form.hbs +16 -15
  53. package/.genx/templates/web-components/grid.hbs +49 -41
  54. package/.genx/templates/web-components/gridLayout.hbs +32 -28
  55. package/.genx/templates/web-components/horizontalLayout.hbs +5 -5
  56. package/.genx/templates/web-components/route.template.hbs +4 -6
  57. package/.genx/templates/web-components/slices/eventing.slice.hbs +23 -15
  58. package/.genx/templates/web-components/store.hbs +1 -9
  59. package/.genx/templates/web-components/tabsLayout.hbs +5 -5
  60. package/.genx/tests/fixtures/routes-full.json +299 -0
  61. package/.genx/tests/fixtures/testapp/client/src/pages/Home/Home.tsx +12 -0
  62. package/.genx/utils/formatJSONValue.js +38 -2
  63. package/.genx/utils/formatRouteData.js +67 -18
  64. package/.genx/utils/generateTile.js +10 -1
  65. package/.genx/utils/gridSerializers.js +63 -23
  66. package/.genx/utils/registerPartials.js +15 -12
  67. package/.genx/utils/toJsStringLiteral.js +37 -0
  68. package/.github/workflows/build.yml +22 -1
  69. package/.github/workflows/release.yaml +96 -0
  70. package/.husky/pre-commit +8 -0
  71. package/.releaserc +1 -1
  72. package/CHANGELOG.md +23 -0
  73. package/client-tmp/angular/.oxfmtrc.json +32 -0
  74. package/client-tmp/angular/.oxlintrc.json +4 -0
  75. package/client-tmp/angular/README.md +4 -4
  76. package/client-tmp/angular/jest.config.js +1 -1
  77. package/client-tmp/angular/lint-css.js +24 -3
  78. package/client-tmp/angular/oxlint-staged.js +45 -0
  79. package/client-tmp/angular/package.json +19 -9
  80. package/client-tmp/angular/playwright.config.ts +12 -11
  81. package/client-tmp/angular/src/app/app.component.html +0 -1
  82. package/client-tmp/angular/src/app/app.component.ts +8 -9
  83. package/client-tmp/angular/src/app/app.config.ts +2 -2
  84. package/client-tmp/angular/src/app/app.module.ts +6 -5
  85. package/client-tmp/angular/src/app/components/error-message/error-message.component.html +29 -15
  86. package/client-tmp/angular/src/app/components/error-message/error-message.component.spec.ts +2 -2
  87. package/client-tmp/angular/src/app/components/error-message/error-message.component.ts +3 -5
  88. package/client-tmp/angular/src/app/directive/app-lazy-load.directive.ts +1 -0
  89. package/client-tmp/angular/src/app/guards/chained.guard.ts +19 -19
  90. package/client-tmp/angular/src/app/guards/connection.guard.ts +12 -12
  91. package/client-tmp/angular/src/app/layouts/blank/blank.layout.spec.ts +1 -1
  92. package/client-tmp/angular/src/app/layouts/blank/blank.layout.ts +1 -5
  93. package/client-tmp/angular/src/app/layouts/default/default.layout.html +3 -4
  94. package/client-tmp/angular/src/app/layouts/default/default.layout.spec.ts +4 -4
  95. package/client-tmp/angular/src/app/layouts/default/default.layout.ts +1 -1
  96. package/client-tmp/angular/src/app/pages/auth-login/auth-login.component.ts +1 -2
  97. package/client-tmp/angular/src/app/pages/not-permitted/not-permitted.component.html +3 -3
  98. package/client-tmp/angular/src/app/pages/not-permitted/not-permitted.component.scss +1 -1
  99. package/client-tmp/angular/src/app/pages/not-permitted/not-permitted.component.spec.ts +5 -5
  100. package/client-tmp/angular/src/app/pages/not-permitted/not-permitted.component.ts +3 -4
  101. package/client-tmp/angular/src/app/services/route.service.ts +79 -74
  102. package/client-tmp/angular/src/app/share/foundation-auth.ts +7 -1
  103. package/client-tmp/angular/src/app/share/genesis-components.ts +66 -68
  104. package/client-tmp/angular/src/app/utils/index.ts +3 -1
  105. package/client-tmp/angular/src/app/utils/permissions.ts +7 -7
  106. package/client-tmp/angular/src/declaration.d.ts +1 -1
  107. package/client-tmp/angular/src/environments/environment.ts +1 -1
  108. package/client-tmp/angular/src/jest.setup.ts +8 -0
  109. package/client-tmp/angular/src/main.ts +2 -2
  110. package/client-tmp/angular/src/pbc/container.ts +28 -26
  111. package/client-tmp/angular/src/pbc/elementsRenderer.ts +49 -39
  112. package/client-tmp/angular/src/pbc/utils.ts +61 -60
  113. package/client-tmp/angular/src/styles/_mixins.scss +7 -8
  114. package/client-tmp/angular/src/styles/styles.css +6 -6
  115. package/client-tmp/angular/test/e2e/fixture.ts +2 -2
  116. package/client-tmp/angular/test/e2e/flows/001-protected.e2e.ts +1 -1
  117. package/client-tmp/angular/tsconfig.app.json +2 -8
  118. package/client-tmp/angular/tsconfig.json +1 -4
  119. package/client-tmp/angular/tsconfig.spec.json +4 -11
  120. package/client-tmp/angular/webpack.dev.config.js +3 -4
  121. package/client-tmp/angular/webpack.prod.config.js +3 -4
  122. package/client-tmp/angular/webpack.shared.config.js +20 -24
  123. package/client-tmp/react/.oxfmtrc.json +30 -0
  124. package/client-tmp/react/.oxlintrc.json +4 -0
  125. package/client-tmp/react/README.md +4 -4
  126. package/client-tmp/react/jest.config.ts +8 -4
  127. package/client-tmp/react/jest.setup.ts +85 -1
  128. package/client-tmp/react/oxlint-staged.js +45 -0
  129. package/client-tmp/react/package.json +24 -9
  130. package/client-tmp/react/playwright.config.ts +11 -10
  131. package/client-tmp/react/src/App.tsx +27 -29
  132. package/client-tmp/react/src/__mocks__/fileMock.js +1 -0
  133. package/client-tmp/react/src/components/ErrorMessage/ErrorMessage.test.tsx +16 -4
  134. package/client-tmp/react/src/components/ErrorMessage/ErrorMessage.tsx +32 -29
  135. package/client-tmp/react/src/components/error-boundary/ErrorBoundary.tsx +15 -6
  136. package/client-tmp/react/src/components/routes/AppRoutes.tsx +1 -1
  137. package/client-tmp/react/src/components/single-component/registry.ts +4 -0
  138. package/client-tmp/react/src/custom-elements.d.ts +4 -2
  139. package/client-tmp/react/src/helpers/hasPermissionHelper.tsx +1 -1
  140. package/client-tmp/react/src/helpers/isAuthenticatedHelper.tsx +1 -1
  141. package/client-tmp/react/src/helpers/isConnectedHelper.tsx +3 -3
  142. package/client-tmp/react/src/layouts/blank/BlankLayout.tsx +7 -11
  143. package/client-tmp/react/src/layouts/default/DefaultLayout.tsx +8 -8
  144. package/client-tmp/react/src/main.tsx +11 -11
  145. package/client-tmp/react/src/pages/AuthPage/AuthPage.test.tsx +13 -2
  146. package/client-tmp/react/src/pages/AuthPage/AuthPage.tsx +14 -13
  147. package/client-tmp/react/src/pages/NotFoundPage/NotFoundPage.tsx +2 -7
  148. package/client-tmp/react/src/pages/NotPermittedPage/NotPermittedPage.test.tsx +8 -4
  149. package/client-tmp/react/src/pages/NotPermittedPage/NotPermittedPage.tsx +1 -1
  150. package/client-tmp/react/src/pbc/container.tsx +9 -4
  151. package/client-tmp/react/src/pbc/elementsRenderer.tsx +13 -7
  152. package/client-tmp/react/src/pbc/utils.ts +60 -59
  153. package/client-tmp/react/src/services/auth.service.ts +1 -1
  154. package/client-tmp/react/src/services/store.service.ts +5 -3
  155. package/client-tmp/react/src/share/foundation-login.ts +2 -2
  156. package/client-tmp/react/src/share/genesis-components.ts +46 -47
  157. package/client-tmp/react/src/store/AuthContext.tsx +2 -10
  158. package/client-tmp/react/src/store/RoutesContext.test.tsx +99 -0
  159. package/client-tmp/react/src/store/RoutesContext.tsx +25 -5
  160. package/client-tmp/react/src/styles/styles.css +7 -7
  161. package/client-tmp/react/src/types/LayoutName.ts +1 -1
  162. package/client-tmp/react/src/utils/getLayoutNameByRoute.ts +1 -1
  163. package/client-tmp/react/src/utils/index.ts +2 -0
  164. package/client-tmp/react/src/utils/layout.ts +8 -1
  165. package/client-tmp/react/src/utils/permissions.ts +7 -7
  166. package/client-tmp/react/src/utils/useDocumentTitle.ts +5 -6
  167. package/client-tmp/react/test/e2e/fixture.ts +5 -2
  168. package/client-tmp/react/test/e2e/flows/001-protected.e2e.ts +3 -1
  169. package/client-tmp/react/tsconfig.app.json +1 -1
  170. package/client-tmp/react/tsconfig.json +1 -5
  171. package/client-tmp/web-components/.oxfmtrc.json +30 -0
  172. package/client-tmp/web-components/.oxlintrc.json +4 -0
  173. package/client-tmp/web-components/oxlint-staged.js +45 -0
  174. package/client-tmp/web-components/package.json +14 -22
  175. package/client-tmp/web-components/src/components/components.ts +9 -7
  176. package/client-tmp/web-components/src/main/main.css +1 -2
  177. package/client-tmp/web-components/src/main/main.ts +1 -1
  178. package/client-tmp/web-components/src/routes/config.ts +4 -0
  179. package/client-tmp/web-components/src/utils/index.ts +2 -0
  180. package/client-tmp/web-components/tsconfig.json +1 -4
  181. package/package.json +1 -1
  182. package/.genx/templates/angular/gridLayout.hbs +0 -30
  183. package/.genx/templates/angular/horizontalLayout.hbs +0 -7
  184. package/.genx/templates/angular/tabsLayout.hbs +0 -7
  185. package/.genx/tests/fixtures/testapp/client/src/routes/home/home.template.ts +0 -6
  186. package/.github/workflows/release.yml +0 -50
  187. package/client-tmp/react/.babelrc +0 -10
  188. package/client-tmp/react/.eslintrc.cjs +0 -21
  189. package/client-tmp/react/git +0 -0
  190. package/client-tmp/react/webpack.config.js +0 -121
  191. package/client-tmp/web-components/.prettierignore +0 -14
@@ -6,35 +6,37 @@ import { deriveElementTag } from './utils';
6
6
  * An app level container for the lazy loading of the web component based PBC routes in angular router.
7
7
  */
8
8
  @Component({
9
- standalone: true,
10
- selector: 'pbc-container',
11
- template: `<div #container class="container"></div>`, // todo get rid of the extra div
12
- styles: [`
13
- .container {
14
- width: 100%;
15
- height: 100%;
16
- }
17
- `],
18
- schemas: [
19
- CUSTOM_ELEMENTS_SCHEMA
20
- ],
9
+ standalone: true,
10
+ selector: 'pbc-container',
11
+ template: `
12
+ <div #container class="container"></div>
13
+ `, // todo get rid of the extra div
14
+ styles: [
15
+ `
16
+ .container {
17
+ width: 100%;
18
+ height: 100%;
19
+ }
20
+ `,
21
+ ],
22
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
21
23
  })
22
24
  export class PBCContainer implements OnInit {
23
- @ViewChild('container', { static: true }) container!: ElementRef;
25
+ @ViewChild('container', { static: true }) container!: ElementRef;
24
26
 
25
- constructor(private route: ActivatedRoute) {}
27
+ constructor(private route: ActivatedRoute) {}
26
28
 
27
- async ngOnInit() {
28
- const { pbcElement, pbcElementTag } = this.route.snapshot.data ?? {};
29
- if (!pbcElement) {
30
- return;
31
- }
32
- /**
33
- * Account for PBC elements being a mix of constructors and lazy loading functions
34
- */
35
- const element = pbcElement.define ? pbcElement : await pbcElement();
36
- const tagName = pbcElementTag || deriveElementTag(element.name);
37
- const customElement = document.createElement(tagName);
38
- this.container.nativeElement.appendChild(customElement);
29
+ async ngOnInit() {
30
+ const { pbcElement, pbcElementTag } = this.route.snapshot.data ?? {};
31
+ if (!pbcElement) {
32
+ return;
39
33
  }
34
+ /**
35
+ * Account for PBC elements being a mix of constructors and lazy loading functions
36
+ */
37
+ const element = pbcElement.define ? pbcElement : await pbcElement();
38
+ const tagName = pbcElementTag || deriveElementTag(element.name);
39
+ const customElement = document.createElement(tagName);
40
+ this.container.nativeElement.appendChild(customElement);
41
+ }
40
42
  }
@@ -1,7 +1,16 @@
1
1
  import { CommonModule } from '@angular/common';
2
- import { Component, CUSTOM_ELEMENTS_SCHEMA, ElementRef, Input, OnChanges, OnInit, SimpleChanges, ViewChild } from '@angular/core';
3
- import { AppElementPredicate, AppTargetId } from '@genesislcap/foundation-shell/app';
2
+ import {
3
+ Component,
4
+ CUSTOM_ELEMENTS_SCHEMA,
5
+ ElementRef,
6
+ Input,
7
+ OnChanges,
8
+ OnInit,
9
+ SimpleChanges,
10
+ ViewChild,
11
+ } from '@angular/core';
4
12
  import { createLogger } from '@genesislcap/foundation-logger';
13
+ import { AppElementPredicate, AppTargetId } from '@genesislcap/foundation-shell/app';
5
14
  import type { ViewTemplate } from '@genesislcap/web-core';
6
15
  import { customEventFactory, getTargetElements } from './utils';
7
16
 
@@ -9,49 +18,50 @@ import { customEventFactory, getTargetElements } from './utils';
9
18
  * An app level component for renderering target PBC elements to an angular template.
10
19
  */
11
20
  @Component({
12
- standalone: true,
13
- selector: 'pbc-elements-renderer',
14
- template: `<div #container class="container"></div>`, // < can we get rid of the extra div?
15
- styles: [`
16
- .container {}
17
- `],
18
- schemas: [
19
- CUSTOM_ELEMENTS_SCHEMA
20
- ],
21
- imports: [
22
- CommonModule,
23
- ]
21
+ standalone: true,
22
+ selector: 'pbc-elements-renderer',
23
+ template: `
24
+ <div #container class="container"></div>
25
+ `, // < can we get rid of the extra div?
26
+ styles: [
27
+ `
28
+ .container {
29
+ }
30
+ `,
31
+ ],
32
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
33
+ imports: [CommonModule],
24
34
  })
25
35
  export class PBCElementsRenderer implements OnChanges, OnInit {
26
- @ViewChild('container', { static: true }) container!: ElementRef;
27
- @Input() target: AppTargetId = [];
28
- @Input() predicate: AppElementPredicate = () => true;
29
- templates: ViewTemplate[] = [];
30
- logger = createLogger('pbc-elements-renderer');
36
+ @ViewChild('container', { static: true }) container!: ElementRef;
37
+ @Input() target: AppTargetId = [];
38
+ @Input() predicate: AppElementPredicate = () => true;
39
+ templates: ViewTemplate[] = [];
40
+ logger = createLogger('pbc-elements-renderer');
31
41
 
32
- async ngOnInit() {
33
- this.setTemplates();
34
- this.renderTemplates();
35
- }
42
+ async ngOnInit() {
43
+ this.setTemplates();
44
+ this.renderTemplates();
45
+ }
36
46
 
37
- $emit(type: string, detail?: any) {
38
- this.container.nativeElement.dispatchEvent(customEventFactory(type, detail));
39
- };
47
+ $emit(type: string, detail?: any) {
48
+ this.container.nativeElement.dispatchEvent(customEventFactory(type, detail));
49
+ }
40
50
 
41
- ngOnChanges(changes: SimpleChanges): void {
42
- if (changes['target']) {
43
- this.logger.debug('target changed, rendering qualifying elements');
44
- this.setTemplates();
45
- this.renderTemplates();
46
- }
51
+ ngOnChanges(changes: SimpleChanges): void {
52
+ if (changes['target']) {
53
+ this.logger.debug('target changed, rendering qualifying elements');
54
+ this.setTemplates();
55
+ this.renderTemplates();
47
56
  }
57
+ }
48
58
 
49
- setTemplates() {
50
- this.templates = getTargetElements(this.target, this.predicate);
51
- }
59
+ setTemplates() {
60
+ this.templates = getTargetElements(this.target, this.predicate);
61
+ }
52
62
 
53
- renderTemplates() {
54
- this.container.nativeElement.replaceChildren();
55
- this.templates.forEach((template) => template.render(this, this.container.nativeElement));
56
- }
63
+ renderTemplates() {
64
+ this.container.nativeElement.replaceChildren();
65
+ this.templates.forEach((template) => template.render(this, this.container.nativeElement));
66
+ }
57
67
  }
@@ -1,15 +1,15 @@
1
1
  import { createLogger } from '@genesislcap/foundation-logger';
2
2
  import {
3
- AppContext,
4
- AppElement,
5
- AppElementPredicate,
6
- AppStyle,
7
- AppStylePredicate,
8
- AppTargetId,
9
- assetPredicate,
10
- getApp,
11
- registrationPredicate,
12
- targetIdPredicate
3
+ AppContext,
4
+ AppElement,
5
+ AppElementPredicate,
6
+ AppStyle,
7
+ AppStylePredicate,
8
+ AppTargetId,
9
+ assetPredicate,
10
+ getApp,
11
+ registrationPredicate,
12
+ targetIdPredicate,
13
13
  } from '@genesislcap/foundation-shell/app';
14
14
  import { importPBCAssets } from '@genesislcap/foundation-shell/pbc';
15
15
  import { toElementStyles } from '@genesislcap/foundation-utils';
@@ -26,10 +26,10 @@ const logger = createLogger('pbc-utils');
26
26
  * @public
27
27
  */
28
28
  export async function registerPBCs(): Promise<boolean> {
29
- const app = getApp();
30
- const pbcAssets = await importPBCAssets();
31
- app.registerAssets(pbcAssets);
32
- return app.hasAssets();
29
+ const app = getApp();
30
+ const pbcAssets = await importPBCAssets();
31
+ app.registerAssets(pbcAssets);
32
+ return app.hasAssets();
33
33
  }
34
34
 
35
35
  /**
@@ -37,77 +37,73 @@ export async function registerPBCs(): Promise<boolean> {
37
37
  * Shared across elements and styles.
38
38
  */
39
39
  const assetFilter = (
40
- asset: AppElement | AppStyle,
41
- targetId: AppTargetId,
42
- predicate: AppElementPredicate | AppStylePredicate = () => true,
43
- context: AppContext,
44
- ) => targetIdPredicate(asset, targetId) &&
45
- assetPredicate(asset, context) &&
46
- registrationPredicate(
47
- asset,
48
- predicate,
49
- context,
50
- );
40
+ asset: AppElement | AppStyle,
41
+ targetId: AppTargetId,
42
+ predicate: AppElementPredicate | AppStylePredicate = () => true,
43
+ context: AppContext,
44
+ ) =>
45
+ targetIdPredicate(asset, targetId) &&
46
+ assetPredicate(asset, context) &&
47
+ registrationPredicate(asset, predicate, context);
51
48
 
52
49
  /**
53
50
  * @public
54
51
  */
55
- export function getTargetStyles(
56
- targetId: AppTargetId,
57
- predicate: AppStylePredicate = () => true
58
- ) {
59
- const app = getApp();
60
- return app.styles
61
- .filter(asset => assetFilter(asset, targetId, predicate, app.config.context!))
62
- .map((token) => token.styles)
63
- .flat();
52
+ export function getTargetStyles(targetId: AppTargetId, predicate: AppStylePredicate = () => true) {
53
+ const app = getApp();
54
+ return app.styles
55
+ .filter((asset) => assetFilter(asset, targetId, predicate, app.config.context!))
56
+ .map((token) => token.styles)
57
+ .flat();
64
58
  }
65
59
 
66
-
67
60
  /**
68
61
  * @public
69
62
  */
70
63
  export function getTargetElements(
71
- targetId: AppTargetId,
72
- predicate: AppElementPredicate = () => true
64
+ targetId: AppTargetId,
65
+ predicate: AppElementPredicate = () => true,
73
66
  ) {
74
- const app = getApp();
75
- return app.elements
76
- .filter(asset => assetFilter(asset, targetId, predicate, app.config.context!))
77
- .map((token) => token.elements);
67
+ const app = getApp();
68
+ return app.elements
69
+ .filter((asset) => assetFilter(asset, targetId, predicate, app.config.context!))
70
+ .map((token) => token.elements);
78
71
  }
79
72
 
80
73
  /**
81
74
  * @public
82
75
  */
83
76
  export function registerStylesTarget(nativeElement: HTMLElement, targetId: AppTargetId) {
84
- const styles = getTargetStyles(targetId);
85
- if (!styles || styles.length === 0) {
86
- return;
87
- }
88
- applyDynamicStyles(nativeElement, styles);
77
+ const styles = getTargetStyles(targetId);
78
+ if (!styles || styles.length === 0) {
79
+ return;
80
+ }
81
+ applyDynamicStyles(nativeElement, styles);
89
82
  }
90
83
 
91
84
  /**
92
85
  * @public
93
86
  */
94
- export function applyDynamicStyles(nativeElement: HTMLElement, style: ComposableStyles | ComposableStyles[]) {
95
- const elementStyles = toElementStyles(style);
96
- const styleTarget = nativeElement.shadowRoot ? nativeElement.shadowRoot : document;
97
- elementStyles.addStylesTo(styleTarget);
87
+ export function applyDynamicStyles(
88
+ nativeElement: HTMLElement,
89
+ style: ComposableStyles | ComposableStyles[],
90
+ ) {
91
+ const elementStyles = toElementStyles(style);
92
+ const styleTarget = nativeElement.shadowRoot ? nativeElement.shadowRoot : document;
93
+ elementStyles.addStylesTo(styleTarget);
98
94
  }
99
95
 
100
96
  /**
101
97
  * @public
102
98
  */
103
99
  export function customEventFactory(type: string, detail?: any) {
104
- return new CustomEvent(type, {
105
- bubbles: true,
106
- cancelable: true,
107
- composed: true,
108
- detail,
109
- });
110
- };
100
+ return new CustomEvent(type, {
101
+ bubbles: true,
102
+ cancelable: true,
103
+ composed: true,
104
+ detail,
105
+ });
106
+ }
111
107
 
112
108
  /**
113
109
  * @privateRemarks
@@ -115,7 +111,12 @@ export function customEventFactory(type: string, detail?: any) {
115
111
  * @public
116
112
  */
117
113
  export function deriveElementTag(name: string): string {
118
- const tagName = name.replace(/([A-Z])/g, '-$1').toLowerCase().replace(/^-/, '');
119
- logger.debug(`Guessing pbc element tag is '${tagName}' based on '${name}'. This may be incorrect, please set pbcElementTag in route data.`);
120
- return tagName;
114
+ const tagName = name
115
+ .replace(/([A-Z])/g, '-$1')
116
+ .toLowerCase()
117
+ .replace(/^-/, '');
118
+ logger.debug(
119
+ `Guessing pbc element tag is '${tagName}' based on '${name}'. This may be incorrect, please set pbcElementTag in route data.`,
120
+ );
121
+ return tagName;
121
122
  }
@@ -1,8 +1,7 @@
1
- @mixin screen($display: 'block') {
2
- contain: content;
3
- display: #{$display};
4
- height: 100%;
5
- width: 100%;
6
- overflow-y: auto;
7
- }
8
-
1
+ @mixin screen($display: 'block') {
2
+ contain: content;
3
+ display: #{$display};
4
+ height: 100%;
5
+ width: 100%;
6
+ overflow-y: auto;
7
+ }
@@ -1,25 +1,25 @@
1
1
  {{#if fontData}}
2
2
  {{#each fontData}}
3
3
  @font-face {
4
- font-family: "{{../fontFamily}}";
4
+ font-family: '{{../fontFamily}}';
5
5
  src: url("../assets/fonts/{{filename}}") format("{{format}}");
6
6
  font-weight: {{weight}};
7
7
  font-style: normal;
8
8
  font-display: swap;
9
9
  }
10
10
  {{/each}}
11
- {{/if}}
12
11
 
12
+ {{/if}}
13
13
  {{#unless fontFamily}}
14
14
  @font-face {
15
15
  font-family: Segoe UI;
16
16
  font-weight: 300;
17
- src: local("Segoe UI Semilight"), local("Segoe UI");
17
+ src: local('Segoe UI Semilight'), local('Segoe UI');
18
18
  }
19
- {{/unless}}
20
19
 
20
+ {{/unless}}
21
21
  * {
22
- font-family: {{#if fontFamily}}"{{fontFamily}}", {{/if}}"Segoe UI", "Helvetica Neue", Arial, sans-serif;
22
+ font-family: {{#if fontFamily}}'{{fontFamily}}', {{/if}}'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
23
23
  font-style: normal;
24
24
  font-weight: normal;
25
25
  }
@@ -41,4 +41,4 @@ foundation-router {
41
41
  display: flex;
42
42
  width: 100%;
43
43
  height: 100%;
44
- }
44
+ }
@@ -1,6 +1,6 @@
1
1
  import { base, Page } from '@genesislcap/foundation-testing/e2e';
2
+ import { environment } from '../../src/environments/environment';
2
3
  import { ProtectedPage } from './pages';
3
- import { environment } from '../../src/environments/environment'
4
4
 
5
5
  export type FixtureConfig = {
6
6
  API_HOST: string;
@@ -17,7 +17,7 @@ export type Fixture = {
17
17
  const { PORT, API_HOST } = environment;
18
18
  export const test = base.extend<Fixture>({
19
19
  config: [{ PORT, API_HOST, DEFAULT_PASSWORD: '', DEFAULT_USER: '' }, { option: true }],
20
- protectedPage: async ({ config, page }: { config: FixtureConfig, page: Page }, use: any) => {
20
+ protectedPage: async ({ config, page }: { config: FixtureConfig; page: Page }, use: any) => {
21
21
  const protectedPage = new ProtectedPage(config, page);
22
22
  await protectedPage.goto();
23
23
  await use(protectedPage);
@@ -1,6 +1,6 @@
1
1
  import { expect } from '@genesislcap/foundation-testing/e2e';
2
2
  import { test } from '../fixture';
3
3
 
4
- test('expected page title', async ({ page }: { page: any }) => {
4
+ test('expected page title', async ({ protectedPage, page }) => {
5
5
  await expect(page).toHaveTitle(/{{capitalCase appName}}/);
6
6
  });
@@ -4,12 +4,6 @@
4
4
  "outDir": "./out-tsc/app",
5
5
  "types": ["node"]
6
6
  },
7
- "files": [
8
- "src/main.ts"
9
- ],
10
- "include": [
11
- "src/**/*.d.ts",
12
- "src/pbc/**/*.ts",
13
- "globals.d.ts"
14
- ]
7
+ "files": ["src/main.ts"],
8
+ "include": ["src/**/*.d.ts", "src/pbc/**/*.ts", "globals.d.ts"]
15
9
  }
@@ -18,10 +18,7 @@
18
18
  "target": "ES2022",
19
19
  "module": "ES2022",
20
20
  "useDefineForClassFields": false,
21
- "lib": [
22
- "ES2022",
23
- "dom"
24
- ],
21
+ "lib": ["ES2022", "dom"],
25
22
  "resolveJsonModule": true
26
23
  },
27
24
  "angularCompilerOptions": {
@@ -4,18 +4,11 @@
4
4
  "module": "ES2022",
5
5
  "target": "ES2022",
6
6
  "outDir": "./out-tsc/spec",
7
- "types": [
8
- "jest"
9
- ],
7
+ "types": ["jest"],
10
8
  "esModuleInterop": true,
11
9
  "emitDecoratorMetadata": true,
12
10
  "resolveJsonModule": true
13
11
  },
14
- "files": [
15
- "src/jest.setup.ts",
16
- ],
17
- "include": [
18
- "src/**/*.spec.ts",
19
- "src/**/*.d.ts"
20
- ]
21
- }
12
+ "files": ["src/jest.setup.ts"],
13
+ "include": ["src/**/*.spec.ts", "src/**/*.d.ts"]
14
+ }
@@ -1,6 +1,7 @@
1
- const webpackSharedConfig = require('./webpack.shared.config');
2
1
  const { DefinePlugin } = require('webpack');
3
2
  const environment = require('./src/environments/environment.ts').environment;
3
+ const webpackSharedConfig = require('./webpack.shared.config');
4
+
4
5
  const envKeys = Object.keys(environment).reduce((prev, next) => {
5
6
  prev[next] = JSON.stringify(environment[next]);
6
7
  return prev;
@@ -8,7 +9,5 @@ const envKeys = Object.keys(environment).reduce((prev, next) => {
8
9
 
9
10
  module.exports = {
10
11
  ...webpackSharedConfig,
11
- plugins: [
12
- new DefinePlugin(envKeys),
13
- ],
12
+ plugins: [new DefinePlugin(envKeys)],
14
13
  };
@@ -1,6 +1,7 @@
1
- const webpackSharedConfig = require('./webpack.shared.config');
2
1
  const { DefinePlugin } = require('webpack');
3
2
  const environment = require('./src/environments/environment.prod.ts').environment;
3
+ const webpackSharedConfig = require('./webpack.shared.config');
4
+
4
5
  const envKeys = Object.keys(environment).reduce((prev, next) => {
5
6
  prev[next] = JSON.stringify(environment[next]);
6
7
  return prev;
@@ -8,7 +9,5 @@ const envKeys = Object.keys(environment).reduce((prev, next) => {
8
9
 
9
10
  module.exports = {
10
11
  ...webpackSharedConfig,
11
- plugins: [
12
- new DefinePlugin(envKeys),
13
- ],
12
+ plugins: [new DefinePlugin(envKeys)],
14
13
  };
@@ -4,8 +4,8 @@ const path = require('path');
4
4
  require('ts-node').register({
5
5
  transpileOnly: true,
6
6
  compilerOptions: {
7
- module: 'commonjs'
8
- }
7
+ module: 'commonjs',
8
+ },
9
9
  });
10
10
 
11
11
  const apiPrefix = process.env.SOCKET_EXT || 'gwf';
@@ -36,10 +36,7 @@ module.exports = {
36
36
  },
37
37
  resolve: {
38
38
  alias: {
39
- 'pbc': path.resolve(
40
- __dirname,
41
- 'src/pbc',
42
- )
39
+ pbc: path.resolve(__dirname, 'src/pbc'),
43
40
  },
44
41
  },
45
42
  /**
@@ -56,22 +53,21 @@ module.exports = {
56
53
  'foundationZero/ZeroDesignSystem': 'foundationZero/ZeroDesignSystem',
57
54
  },
58
55
  devServer: {
59
- proxy: [
60
- {
61
- context: apiBasePath,
62
- target: "{{apiHost}}",
63
- pathRewrite: { [`^${apiBasePath}`]: '' },
64
- secure: false,
65
- changeOrigin: true,
66
- cookieDomainRewrite: 'localhost',
67
- ws: true,
68
- headers: {
69
- origin: "{{apiHost}}",
70
- }
71
- }
72
- ],
73
- compress: true,
74
- historyApiFallback: true,
75
- },
56
+ proxy: [
57
+ {
58
+ context: apiBasePath,
59
+ target: '{{apiHost}}',
60
+ pathRewrite: { [`^${apiBasePath}`]: '' },
61
+ secure: false,
62
+ changeOrigin: true,
63
+ cookieDomainRewrite: 'localhost',
64
+ ws: true,
65
+ headers: {
66
+ origin: '{{apiHost}}',
67
+ },
68
+ },
69
+ ],
70
+ compress: true,
71
+ historyApiFallback: true,
72
+ },
76
73
  };
77
-
@@ -0,0 +1,30 @@
1
+ {
2
+ "semi": true,
3
+ "tabWidth": 2,
4
+ "singleQuote": true,
5
+ "bracketSpacing": true,
6
+ "printWidth": 100,
7
+ "htmlWhitespaceSensitivity": "ignore",
8
+ "sortPackageJson": false,
9
+ "ignorePatterns": [
10
+ "**/.git",
11
+ "**/.svn",
12
+ "**/.hg",
13
+ "**/node_modules",
14
+ "**/__tests__",
15
+ "**/__test__",
16
+ "**/.tmp",
17
+ "**/bootstrap",
18
+ "**/coverage",
19
+ "**/test-results",
20
+ "**/dist",
21
+ "**/temp",
22
+ "**/storybook-static",
23
+ "**/*.d.ts",
24
+ "**/*.md",
25
+ "**/*.hbs",
26
+ "**/.genx/**",
27
+ "**/src/generated/**",
28
+ "**/index.html"
29
+ ]
30
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "$schema": "./node_modules/oxlint/configuration_schema.json",
3
+ "extends": ["./node_modules/@genesislcap/oxlint-config/.oxlintrc.json"]
4
+ }
@@ -27,7 +27,8 @@ Run `npm run test:e2e` to execute the end-to-end tests.
27
27
 
28
28
  ## Linting
29
29
 
30
- Run `npm run lint` to lint the project.
30
+ Run `npm run lint` to lint the project (Oxlint → Oxfmt → Stylelint via `genx lint -l ox`).
31
+ Run `npm run lint:fix` to auto-fix lint findings and formatting.
31
32
 
32
33
  ## Styling
33
34
 
@@ -52,9 +53,8 @@ modes, and the selected mode is remembered across reloads.
52
53
  - `npm run dev:no-open`: Serves the project in development mode without automatically opening the browser.
53
54
  - `npm run dev:intellij`: Serves the project in development mode (specific for IntelliJ).
54
55
  - `npm run dev:https`: Serves the project in development mode with HTTPS.
55
- - `npm run lint`: Lints the project using the specified profile.
56
- - `npm run lint:fix`: Fixes linting errors in the project.
57
- - `npm run lint:eslint`: Lints the project using ESLint and the specified profile.
56
+ - `npm run lint`: Lints the project (Oxlint Oxfmt → Stylelint).
57
+ - `npm run lint:fix`: Fixes lint findings and formatting.
58
58
  - `npm run lint:stylelint`: Lints CSS using a custom script.
59
59
  - `npm run test`: Runs unit tests.
60
60
  - `npm run test:e2e`: Runs end-to-end tests.
@@ -4,12 +4,16 @@ const config: Config.InitialOptions = {
4
4
  testEnvironment: 'jsdom',
5
5
  moduleFileExtensions: ['js', 'jsx', 'ts', 'tsx'],
6
6
  transform: {
7
- '^.+\\.jsx?$': 'babel-jest',
7
+ '^.+\\.jsx?$': ['babel-jest', { presets: ['@babel/preset-env'] }],
8
8
  '^.+\\.tsx?$': ['ts-jest', { tsconfig: 'tsconfig.app.json' }],
9
9
  },
10
+ moduleNameMapper: {
11
+ '\\.(css|jpg|jpeg|png|gif|svg|woff2?)$': '<rootDir>/src/__mocks__/fileMock.js',
12
+ },
13
+ transformIgnorePatterns: ['node_modules/(?!(@genesislcap/*|consola|@microsoft|exenv-es6|uuid))'],
10
14
  setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
11
- testMatch: ["**/?(*.)+(test).[jt]s?(x)"],
12
- watchPathIgnorePatterns: ["<rootDir>/node_modules/", "<rootDir>/dist/"],
15
+ testMatch: ['**/?(*.)+(test).[jt]s?(x)'],
16
+ watchPathIgnorePatterns: ['<rootDir>/node_modules/', '<rootDir>/dist/'],
13
17
  };
14
18
 
15
- export default config;
19
+ export default config;