@genesislcap/blank-app-seed 3.30.0-prerelease.13 → 3.30.0-prerelease.15

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 (52) hide show
  1. package/.genx/package.json +1 -1
  2. package/CHANGELOG.md +14 -0
  3. package/client-tmp/angular/__mocks__/fileMock.js +1 -0
  4. package/client-tmp/angular/angular.json +0 -29
  5. package/client-tmp/angular/jest.config.js +20 -0
  6. package/client-tmp/angular/package.json +6 -6
  7. package/client-tmp/angular/src/app/layouts/default/default.layout.spec.ts +2 -2
  8. package/client-tmp/angular/src/jest.setup.ts +46 -0
  9. package/client-tmp/angular/tsconfig.app.json +1 -2
  10. package/client-tmp/angular/tsconfig.json +1 -2
  11. package/client-tmp/angular/tsconfig.spec.json +13 -7
  12. package/client-tmp/react/package.json +12 -6
  13. package/client-tmp/react/src/App.tsx +85 -68
  14. package/client-tmp/react/src/config.ts +0 -15
  15. package/client-tmp/react/src/guards/ProtectedGuard.tsx +56 -0
  16. package/client-tmp/react/src/helpers/hasPermissionHelper.tsx +10 -0
  17. package/client-tmp/react/src/helpers/isAuthenticatedHelper.tsx +14 -0
  18. package/client-tmp/react/src/helpers/isConnectedHelper.tsx +16 -0
  19. package/client-tmp/react/src/layouts/blank/BlankLayout.tsx +1 -1
  20. package/client-tmp/react/src/layouts/default/DefaultLayout.tsx +17 -14
  21. package/client-tmp/react/src/main.tsx +19 -5
  22. package/client-tmp/react/src/pages/NotFoundPage/NotFoundPage.css +0 -0
  23. package/client-tmp/react/src/pages/NotFoundPage/NotFoundPage.tsx +14 -0
  24. package/client-tmp/react/src/pages/NotPermittedPage/NotPermittedPage.test.tsx +1 -1
  25. package/client-tmp/react/src/pages/NotPermittedPage/NotPermittedPage.tsx +1 -1
  26. package/client-tmp/react/src/pbc/README.md +7 -0
  27. package/client-tmp/react/src/pbc/container.tsx +36 -0
  28. package/client-tmp/react/src/pbc/elementsRenderer.tsx +40 -0
  29. package/client-tmp/react/src/pbc/utils.ts +121 -0
  30. package/client-tmp/react/src/services/store.service.ts +48 -0
  31. package/client-tmp/react/src/share/foundation-login.ts +13 -6
  32. package/client-tmp/react/src/share/genesis-components.ts +49 -23
  33. package/client-tmp/react/src/store/AuthContext.tsx +0 -2
  34. package/client-tmp/react/src/store/RoutesContext.tsx +73 -0
  35. package/client-tmp/react/src/types/LayoutName.ts +3 -0
  36. package/client-tmp/react/src/types/RouteLayouts.ts +3 -1
  37. package/client-tmp/react/src/utils/getLayoutNameByRoute.ts +5 -0
  38. package/client-tmp/react/src/utils/history.ts +4 -2
  39. package/client-tmp/react/src/utils/index.ts +3 -1
  40. package/client-tmp/react/src/utils/store.ts +34 -0
  41. package/client-tmp/react/test/e2e/fixture.ts +1 -1
  42. package/client-tmp/react/tsconfig.app.json +1 -22
  43. package/client-tmp/react/tsconfig.json +28 -10
  44. package/client-tmp/react/vite.config.ts +21 -3
  45. package/package.json +1 -1
  46. package/client-tmp/angular/karma.conf.js +0 -9
  47. package/client-tmp/angular/src/app/app.component.spec.ts +0 -23
  48. package/client-tmp/react/src/guards/AuthGuard.tsx +0 -32
  49. package/client-tmp/react/src/guards/PermissionsGuard.tsx +0 -37
  50. package/client-tmp/react/src/index.ts +0 -21
  51. package/client-tmp/react/src/reportWebVitals.ts +0 -13
  52. /package/server/{{appName}}-app/src/main/genesis/scripts/{{{appName}}-data-pipelines.kts → {{appName}}-pipelines.kts} +0 -0
@@ -1,25 +1,4 @@
1
1
  {
2
- "compilerOptions": {
3
- "composite": true,
4
- "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
5
- "target": "ES2020",
6
- "useDefineForClassFields": true,
7
- "lib": ["ES2020", "DOM", "DOM.Iterable"],
8
- "module": "ESNext",
9
- "skipLibCheck": true,
10
- "moduleResolution": "bundler",
11
- "allowImportingTsExtensions": true,
12
- "resolveJsonModule": true,
13
- "isolatedModules": true,
14
- "moduleDetection": "force",
15
- "noEmit": true,
16
- "jsx": "react-jsx",
17
- "strict": true,
18
- "esModuleInterop": true,
19
- "noUnusedLocals": true,
20
- "noUnusedParameters": true,
21
- "noFallthroughCasesInSwitch": true,
22
- "types": ["node", "react"]
23
- },
2
+ "extends": "./tsconfig.json",
24
3
  "include": ["src" , "src/**/*.d.ts"],
25
4
  }
@@ -1,14 +1,32 @@
1
1
  {
2
- "files": [],
3
- "references": [
4
- {
5
- "path": "./tsconfig.app.json"
6
- },
7
- {
8
- "path": "./tsconfig.node.json"
9
- }
10
- ],
11
2
  "compilerOptions": {
3
+ "composite": true,
4
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
5
+ "target": "ES2020",
6
+ "useDefineForClassFields": false,
7
+ "lib": ["ES2020", "DOM", "DOM.Iterable"],
8
+ "module": "ESNext",
9
+ "skipLibCheck": true,
10
+ "moduleResolution": "bundler",
11
+ "allowImportingTsExtensions": true,
12
+ "resolveJsonModule": true,
13
+ "isolatedModules": true,
14
+ "moduleDetection": "force",
15
+ "noEmit": true,
16
+ "jsx": "react-jsx",
17
+ "strict": true,
12
18
  "esModuleInterop": true,
13
- }
19
+ "noUnusedLocals": true,
20
+ "noUnusedParameters": true,
21
+ "noFallthroughCasesInSwitch": true,
22
+ "baseUrl": "./",
23
+ "paths": {
24
+ "@/*": ["src/*"]
25
+ },
26
+ },
27
+ "include": [
28
+ "src" ,
29
+ "src/**/*.d.ts",
30
+ "src/pbc/**/*.ts",
31
+ ],
14
32
  }
@@ -4,6 +4,7 @@ import { defineConfig, UserConfig } from 'vite';
4
4
  import fs from 'fs';
5
5
  import react from '@vitejs/plugin-react';
6
6
  import visualizer from 'rollup-plugin-visualizer';
7
+ import tsconfigPaths from 'vite-plugin-tsconfig-paths';
7
8
 
8
9
  const __dirname = dirname(fileURLToPath(import.meta.url));
9
10
 
@@ -23,22 +24,39 @@ export default defineConfig(({ mode }: { mode: string }): UserConfig => {
23
24
  }
24
25
 
25
26
  const config: UserConfig = {
26
- define: envConfig,
27
+ define: {
28
+ ...envConfig,
29
+ BUILDER: JSON.stringify('vite'),
30
+ },
27
31
  server: {
28
32
  https,
29
33
  open,
34
+ fs: {
35
+ strict: false,
36
+ }
30
37
  },
31
38
  plugins: [
32
39
  react(),
40
+ tsconfigPaths(),
33
41
  ],
34
42
  build: {
35
43
  rollupOptions: {
36
- plugins: []
37
- }
44
+ plugins: [],
45
+ treeshake: false, // Disable tree-shaking because it's causing issues with the Foundation Router
46
+ },
38
47
  },
39
48
  resolve: {
40
49
  alias: {
41
50
  'foundationZero/ZeroDesignSystem': resolve(__dirname, 'node_modules/@genesislcap/foundation-zero'),
51
+ 'pbc': resolve(__dirname, 'src/pbc'),
52
+ },
53
+ preserveSymlinks: true,
54
+ },
55
+ esbuild: {
56
+ tsconfigRaw: {
57
+ compilerOptions: {
58
+ experimentalDecorators: true,
59
+ },
42
60
  },
43
61
  },
44
62
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/blank-app-seed",
3
3
  "description": "Genesis Blank App Seed",
4
- "version": "3.30.0-prerelease.13",
4
+ "version": "3.30.0-prerelease.15",
5
5
  "license": "Apache-2.0",
6
6
  "scripts": {
7
7
  "release": "semantic-release"
@@ -1,9 +0,0 @@
1
- module.exports = function(config) {
2
- config.set({
3
- browsers: ['Chrome'],
4
- browserDisconnectTimeout: 60000,
5
- browserDisconnectTolerance: 3,
6
- browserNoActivityTimeout: 60000,
7
- captureTimeout: 120000,
8
- });
9
- };
@@ -1,23 +0,0 @@
1
- import { TestBed } from '@angular/core/testing';
2
- import { AppComponent } from './app.component';
3
-
4
- describe('AppComponent', () => {
5
- beforeEach(async () => {
6
- await TestBed.configureTestingModule({
7
- declarations: [AppComponent],
8
- }).compileComponents();
9
- });
10
-
11
- it('should create the app', () => {
12
- const fixture = TestBed.createComponent(AppComponent);
13
- const app = fixture.componentInstance;
14
- expect(app).toBeTruthy();
15
- });
16
-
17
- it(`should have the '{{capitalCase appName}}' title`, () => {
18
- const fixture = TestBed.createComponent(AppComponent);
19
- const app = fixture.componentInstance;
20
- expect(app.title).toEqual('{{capitalCase appName}}');
21
- });
22
- });
23
-
@@ -1,32 +0,0 @@
1
- import { useEffect, useState, ReactNode } from 'react';
2
- import { useAuth } from '../store/AuthContext';
3
- import { Navigate } from 'react-router-dom';
4
- import { AUTH_PATH } from '../config';
5
- interface AuthGuardProps {
6
- children: ReactNode;
7
- }
8
- const AuthGuard: React.FC<AuthGuardProps> = ({ children }: AuthGuardProps) => {
9
- const { user, checkAuthStatus } = useAuth();
10
- const [isLoading, setIsLoading] = useState(true);
11
-
12
- useEffect(() => {
13
- const verifyAuth = async () => {
14
- await checkAuthStatus();
15
- setIsLoading(false);
16
- };
17
-
18
- verifyAuth();
19
- }, [checkAuthStatus]);
20
-
21
- if (isLoading) {
22
- return <div>Loading...</div>; // Or some loading component
23
- }
24
-
25
- if (!user) {
26
- return <Navigate to={`/${AUTH_PATH}`} />;
27
- }
28
-
29
- return <>{children}</>;
30
- };
31
-
32
- export default AuthGuard;
@@ -1,37 +0,0 @@
1
- import { useEffect, useState, ReactNode } from 'react';
2
- import { useNavigate } from 'react-router-dom';
3
- import { getUser } from '@genesislcap/foundation-user';
4
- import { NOT_PERMITTED_PATH } from '../config';
5
-
6
- interface PermissionsGuardProps {
7
- children: ReactNode;
8
- permissionCode?: string;
9
- }
10
-
11
- const PermissionsGuard: React.FC<PermissionsGuardProps> = ({ children, permissionCode }: PermissionsGuardProps) => {
12
- const navigate = useNavigate();
13
- const [isAuthorized, setIsAuthorized] = useState(false);
14
- const [isLoading, setIsLoading] = useState(true);
15
-
16
- useEffect(() => {
17
- const checkPermission = async () => {
18
- const user = getUser();
19
- if (permissionCode && !user.hasPermission(permissionCode)) {
20
- navigate(`/${NOT_PERMITTED_PATH}`);
21
- } else {
22
- setIsAuthorized(true);
23
- }
24
- setIsLoading(false);
25
- };
26
-
27
- checkPermission();
28
- }, [navigate, permissionCode]);
29
-
30
- if (isLoading) {
31
- return <div>Loading...</div>; // Or some loading component
32
- }
33
-
34
- return isAuthorized ? <>{children}</> : null;
35
- };
36
-
37
- export default PermissionsGuard;
@@ -1,21 +0,0 @@
1
- import React from 'react';
2
- import ReactDOM from 'react-dom/client';
3
- import './styles/styles.css';
4
- import App from './App';
5
- import reportWebVitals from './reportWebVitals';
6
-
7
- const rootElement = document.getElementById('root');
8
-
9
- if (rootElement) {
10
- const root = ReactDOM.createRoot(rootElement);
11
- root.render(
12
- <React.StrictMode>
13
- <App />
14
- </React.StrictMode>,
15
- );
16
-
17
- // If you want to start measuring performance in your app, pass a function
18
- // to log results (for example: reportWebVitals(console.log))
19
- // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
20
- reportWebVitals();
21
- }
@@ -1,13 +0,0 @@
1
- const reportWebVitals = onPerfEntry => {
2
- if (onPerfEntry && onPerfEntry instanceof Function) {
3
- import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
4
- getCLS(onPerfEntry);
5
- getFID(onPerfEntry);
6
- getFCP(onPerfEntry);
7
- getLCP(onPerfEntry);
8
- getTTFB(onPerfEntry);
9
- });
10
- }
11
- };
12
-
13
- export default reportWebVitals;