@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.
- package/.genx/configure.js +11 -1
- package/.genx/package.json +1 -1
- package/.genx/scripts/generate-test-apps.sh +124 -0
- package/.genx/templates/angular/chart.hbs +19 -7
- package/.genx/templates/angular/component/component.column.defs.hbs +16 -4
- package/.genx/templates/angular/component/component.create.form.hbs +10 -2
- package/.genx/templates/angular/component/component.events.config.hbs +31 -6
- package/.genx/templates/angular/component/component.filter.form.hbs +1 -2
- package/.genx/templates/angular/component/component.gridOptions.hbs +15 -3
- package/.genx/templates/angular/component/component.hbs +77 -46
- package/.genx/templates/angular/component/component.index.hbs +1 -1
- package/.genx/templates/angular/component/component.update.form.hbs +1 -1
- package/.genx/templates/angular/entityManager.hbs +6 -6
- package/{client-tmp/angular/src/app/utils/fdc3.ts → .genx/templates/angular/fdc3.ts.hbs} +6 -8
- package/.genx/templates/angular/form.hbs +9 -12
- package/.genx/templates/angular/grid.hbs +43 -40
- package/.genx/templates/angular/route.hbs +8 -2
- package/.genx/templates/angular/route.template.hbs +7 -7
- package/.genx/templates/angular/slices/eventing.slice.hbs +21 -10
- package/.genx/templates/angular/store.hbs +1 -5
- package/.genx/templates/angular/tabsPanel.hbs +2 -2
- package/.genx/templates/react/chart.hbs +6 -15
- package/.genx/templates/react/component/component.column.defs.hbs +16 -10
- package/.genx/templates/react/component/component.create.form.hbs +2 -2
- package/.genx/templates/react/component/component.events.config.hbs +32 -5
- package/.genx/templates/react/component/component.filter.form.hbs +1 -2
- package/.genx/templates/react/component/component.gridOptions.hbs +17 -11
- package/.genx/templates/react/component/component.hbs +84 -42
- package/.genx/templates/react/component/component.update.form.hbs +1 -1
- package/.genx/templates/react/entityManager.hbs +8 -16
- package/{client-tmp/react/src/utils/fdc3.ts → .genx/templates/react/fdc3.ts.hbs} +7 -8
- package/.genx/templates/react/form.hbs +1 -15
- package/.genx/templates/react/grid.hbs +11 -11
- package/.genx/templates/react/gridLayout.hbs +44 -4
- package/.genx/templates/react/horizontalLayout.hbs +10 -1
- package/.genx/templates/react/route.hbs +21 -14
- package/.genx/templates/react/slices/eventing.slice.hbs +19 -8
- package/.genx/templates/react/store.hbs +1 -5
- package/.genx/templates/react/tabsLayout.hbs +5 -1
- package/.genx/templates/web-components/chart.hbs +25 -25
- package/.genx/templates/web-components/component/component.column.defs.hbs +11 -3
- package/.genx/templates/web-components/component/component.create.form.hbs +11 -4
- package/.genx/templates/web-components/component/component.events.config.hbs +33 -6
- package/.genx/templates/web-components/component/component.filter.form.hbs +1 -2
- package/.genx/templates/web-components/component/component.gridOptions.hbs +12 -3
- package/.genx/templates/web-components/component/component.hbs +19 -20
- package/.genx/templates/web-components/component/component.index.hbs +1 -1
- package/.genx/templates/web-components/component/component.template.hbs +9 -13
- package/.genx/templates/web-components/component/component.update.form.hbs +1 -1
- package/.genx/templates/web-components/entityManager.hbs +92 -73
- package/{client-tmp/web-components/src/utils/fdc3.ts → .genx/templates/web-components/fdc3.ts.hbs} +6 -7
- package/.genx/templates/web-components/form.hbs +16 -15
- package/.genx/templates/web-components/grid.hbs +49 -41
- package/.genx/templates/web-components/gridLayout.hbs +32 -28
- package/.genx/templates/web-components/horizontalLayout.hbs +5 -5
- package/.genx/templates/web-components/route.template.hbs +4 -6
- package/.genx/templates/web-components/slices/eventing.slice.hbs +23 -15
- package/.genx/templates/web-components/store.hbs +1 -9
- package/.genx/templates/web-components/tabsLayout.hbs +5 -5
- package/.genx/tests/fixtures/routes-full.json +299 -0
- package/.genx/tests/fixtures/testapp/client/src/pages/Home/Home.tsx +12 -0
- package/.genx/utils/formatJSONValue.js +38 -2
- package/.genx/utils/formatRouteData.js +67 -18
- package/.genx/utils/generateTile.js +10 -1
- package/.genx/utils/gridSerializers.js +63 -23
- package/.genx/utils/registerPartials.js +15 -12
- package/.genx/utils/toJsStringLiteral.js +37 -0
- package/.github/workflows/build.yml +22 -1
- package/.github/workflows/release.yaml +96 -0
- package/.husky/pre-commit +8 -0
- package/.releaserc +1 -1
- package/CHANGELOG.md +23 -0
- package/client-tmp/angular/.oxfmtrc.json +32 -0
- package/client-tmp/angular/.oxlintrc.json +4 -0
- package/client-tmp/angular/README.md +4 -4
- package/client-tmp/angular/jest.config.js +1 -1
- package/client-tmp/angular/lint-css.js +24 -3
- package/client-tmp/angular/oxlint-staged.js +45 -0
- package/client-tmp/angular/package.json +19 -9
- package/client-tmp/angular/playwright.config.ts +12 -11
- package/client-tmp/angular/src/app/app.component.html +0 -1
- package/client-tmp/angular/src/app/app.component.ts +8 -9
- package/client-tmp/angular/src/app/app.config.ts +2 -2
- package/client-tmp/angular/src/app/app.module.ts +6 -5
- package/client-tmp/angular/src/app/components/error-message/error-message.component.html +29 -15
- package/client-tmp/angular/src/app/components/error-message/error-message.component.spec.ts +2 -2
- package/client-tmp/angular/src/app/components/error-message/error-message.component.ts +3 -5
- package/client-tmp/angular/src/app/directive/app-lazy-load.directive.ts +1 -0
- package/client-tmp/angular/src/app/guards/chained.guard.ts +19 -19
- package/client-tmp/angular/src/app/guards/connection.guard.ts +12 -12
- package/client-tmp/angular/src/app/layouts/blank/blank.layout.spec.ts +1 -1
- package/client-tmp/angular/src/app/layouts/blank/blank.layout.ts +1 -5
- package/client-tmp/angular/src/app/layouts/default/default.layout.html +3 -4
- package/client-tmp/angular/src/app/layouts/default/default.layout.spec.ts +4 -4
- package/client-tmp/angular/src/app/layouts/default/default.layout.ts +1 -1
- package/client-tmp/angular/src/app/pages/auth-login/auth-login.component.ts +1 -2
- package/client-tmp/angular/src/app/pages/not-permitted/not-permitted.component.html +3 -3
- package/client-tmp/angular/src/app/pages/not-permitted/not-permitted.component.scss +1 -1
- package/client-tmp/angular/src/app/pages/not-permitted/not-permitted.component.spec.ts +5 -5
- package/client-tmp/angular/src/app/pages/not-permitted/not-permitted.component.ts +3 -4
- package/client-tmp/angular/src/app/services/route.service.ts +79 -74
- package/client-tmp/angular/src/app/share/foundation-auth.ts +7 -1
- package/client-tmp/angular/src/app/share/genesis-components.ts +66 -68
- package/client-tmp/angular/src/app/utils/index.ts +3 -1
- package/client-tmp/angular/src/app/utils/permissions.ts +7 -7
- package/client-tmp/angular/src/declaration.d.ts +1 -1
- package/client-tmp/angular/src/environments/environment.ts +1 -1
- package/client-tmp/angular/src/jest.setup.ts +8 -0
- package/client-tmp/angular/src/main.ts +2 -2
- package/client-tmp/angular/src/pbc/container.ts +28 -26
- package/client-tmp/angular/src/pbc/elementsRenderer.ts +49 -39
- package/client-tmp/angular/src/pbc/utils.ts +61 -60
- package/client-tmp/angular/src/styles/_mixins.scss +7 -8
- package/client-tmp/angular/src/styles/styles.css +6 -6
- package/client-tmp/angular/test/e2e/fixture.ts +2 -2
- package/client-tmp/angular/test/e2e/flows/001-protected.e2e.ts +1 -1
- package/client-tmp/angular/tsconfig.app.json +2 -8
- package/client-tmp/angular/tsconfig.json +1 -4
- package/client-tmp/angular/tsconfig.spec.json +4 -11
- package/client-tmp/angular/webpack.dev.config.js +3 -4
- package/client-tmp/angular/webpack.prod.config.js +3 -4
- package/client-tmp/angular/webpack.shared.config.js +20 -24
- package/client-tmp/react/.oxfmtrc.json +30 -0
- package/client-tmp/react/.oxlintrc.json +4 -0
- package/client-tmp/react/README.md +4 -4
- package/client-tmp/react/jest.config.ts +8 -4
- package/client-tmp/react/jest.setup.ts +85 -1
- package/client-tmp/react/oxlint-staged.js +45 -0
- package/client-tmp/react/package.json +24 -9
- package/client-tmp/react/playwright.config.ts +11 -10
- package/client-tmp/react/src/App.tsx +27 -29
- package/client-tmp/react/src/__mocks__/fileMock.js +1 -0
- package/client-tmp/react/src/components/ErrorMessage/ErrorMessage.test.tsx +16 -4
- package/client-tmp/react/src/components/ErrorMessage/ErrorMessage.tsx +32 -29
- package/client-tmp/react/src/components/error-boundary/ErrorBoundary.tsx +15 -6
- package/client-tmp/react/src/components/routes/AppRoutes.tsx +1 -1
- package/client-tmp/react/src/components/single-component/registry.ts +4 -0
- package/client-tmp/react/src/custom-elements.d.ts +4 -2
- package/client-tmp/react/src/helpers/hasPermissionHelper.tsx +1 -1
- package/client-tmp/react/src/helpers/isAuthenticatedHelper.tsx +1 -1
- package/client-tmp/react/src/helpers/isConnectedHelper.tsx +3 -3
- package/client-tmp/react/src/layouts/blank/BlankLayout.tsx +7 -11
- package/client-tmp/react/src/layouts/default/DefaultLayout.tsx +8 -8
- package/client-tmp/react/src/main.tsx +11 -11
- package/client-tmp/react/src/pages/AuthPage/AuthPage.test.tsx +13 -2
- package/client-tmp/react/src/pages/AuthPage/AuthPage.tsx +14 -13
- package/client-tmp/react/src/pages/NotFoundPage/NotFoundPage.tsx +2 -7
- package/client-tmp/react/src/pages/NotPermittedPage/NotPermittedPage.test.tsx +8 -4
- package/client-tmp/react/src/pages/NotPermittedPage/NotPermittedPage.tsx +1 -1
- package/client-tmp/react/src/pbc/container.tsx +9 -4
- package/client-tmp/react/src/pbc/elementsRenderer.tsx +13 -7
- package/client-tmp/react/src/pbc/utils.ts +60 -59
- package/client-tmp/react/src/services/auth.service.ts +1 -1
- package/client-tmp/react/src/services/store.service.ts +5 -3
- package/client-tmp/react/src/share/foundation-login.ts +2 -2
- package/client-tmp/react/src/share/genesis-components.ts +46 -47
- package/client-tmp/react/src/store/AuthContext.tsx +2 -10
- package/client-tmp/react/src/store/RoutesContext.test.tsx +99 -0
- package/client-tmp/react/src/store/RoutesContext.tsx +25 -5
- package/client-tmp/react/src/styles/styles.css +7 -7
- package/client-tmp/react/src/types/LayoutName.ts +1 -1
- package/client-tmp/react/src/utils/getLayoutNameByRoute.ts +1 -1
- package/client-tmp/react/src/utils/index.ts +2 -0
- package/client-tmp/react/src/utils/layout.ts +8 -1
- package/client-tmp/react/src/utils/permissions.ts +7 -7
- package/client-tmp/react/src/utils/useDocumentTitle.ts +5 -6
- package/client-tmp/react/test/e2e/fixture.ts +5 -2
- package/client-tmp/react/test/e2e/flows/001-protected.e2e.ts +3 -1
- package/client-tmp/react/tsconfig.app.json +1 -1
- package/client-tmp/react/tsconfig.json +1 -5
- package/client-tmp/web-components/.oxfmtrc.json +30 -0
- package/client-tmp/web-components/.oxlintrc.json +4 -0
- package/client-tmp/web-components/oxlint-staged.js +45 -0
- package/client-tmp/web-components/package.json +14 -22
- package/client-tmp/web-components/src/components/components.ts +9 -7
- package/client-tmp/web-components/src/main/main.css +1 -2
- package/client-tmp/web-components/src/main/main.ts +1 -1
- package/client-tmp/web-components/src/routes/config.ts +4 -0
- package/client-tmp/web-components/src/utils/index.ts +2 -0
- package/client-tmp/web-components/tsconfig.json +1 -4
- package/package.json +1 -1
- package/.genx/templates/angular/gridLayout.hbs +0 -30
- package/.genx/templates/angular/horizontalLayout.hbs +0 -7
- package/.genx/templates/angular/tabsLayout.hbs +0 -7
- package/.genx/tests/fixtures/testapp/client/src/routes/home/home.template.ts +0 -6
- package/.github/workflows/release.yml +0 -50
- package/client-tmp/react/.babelrc +0 -10
- package/client-tmp/react/.eslintrc.cjs +0 -21
- package/client-tmp/react/git +0 -0
- package/client-tmp/react/webpack.config.js +0 -121
- 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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
|
|
25
|
+
@ViewChild('container', { static: true }) container!: ElementRef;
|
|
24
26
|
|
|
25
|
-
|
|
27
|
+
constructor(private route: ActivatedRoute) {}
|
|
26
28
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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 {
|
|
3
|
-
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
42
|
+
async ngOnInit() {
|
|
43
|
+
this.setTemplates();
|
|
44
|
+
this.renderTemplates();
|
|
45
|
+
}
|
|
36
46
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
47
|
+
$emit(type: string, detail?: any) {
|
|
48
|
+
this.container.nativeElement.dispatchEvent(customEventFactory(type, detail));
|
|
49
|
+
}
|
|
40
50
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
-
|
|
50
|
-
|
|
51
|
-
|
|
59
|
+
setTemplates() {
|
|
60
|
+
this.templates = getTargetElements(this.target, this.predicate);
|
|
61
|
+
}
|
|
52
62
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
) =>
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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
|
-
|
|
57
|
-
|
|
58
|
-
)
|
|
59
|
-
|
|
60
|
-
|
|
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
|
-
|
|
72
|
-
|
|
64
|
+
targetId: AppTargetId,
|
|
65
|
+
predicate: AppElementPredicate = () => true,
|
|
73
66
|
) {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
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
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
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(
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
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
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
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
|
-
|
|
119
|
-
|
|
120
|
-
|
|
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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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:
|
|
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(
|
|
17
|
+
src: local('Segoe UI Semilight'), local('Segoe UI');
|
|
18
18
|
}
|
|
19
|
-
{{/unless}}
|
|
20
19
|
|
|
20
|
+
{{/unless}}
|
|
21
21
|
* {
|
|
22
|
-
font-family: {{#if fontFamily}}
|
|
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
|
|
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 ({
|
|
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
|
-
|
|
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
|
}
|
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
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
|
+
}
|
|
@@ -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
|
|
56
|
-
- `npm run lint:fix`: Fixes
|
|
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: [
|
|
12
|
-
watchPathIgnorePatterns: [
|
|
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;
|