@genesislcap/blank-app-seed 3.16.1 → 3.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.genx/.genxrc.js +1 -1
- package/.genx/.prettierrc +5 -0
- package/.genx/configure.js +19 -10
- package/.genx/details.js +1 -1
- package/.genx/eslint.config.mjs +20 -0
- package/.genx/package-lock.json +1173 -0
- package/.genx/package.json +14 -1
- package/.genx/prompts/api.js +12 -20
- package/.genx/prompts/server.js +55 -54
- package/.genx/prompts/ui.js +40 -13
- package/.genx/prompts/validators.js +16 -6
- package/.genx/prompts.js +11 -4
- package/.genx/scripts/update-versions.js +9 -4
- package/.genx/static.js +96 -0
- package/.genx/templates/angular/route.hbs +14 -0
- package/.genx/templates/angular/route.styles.hbs +3 -0
- package/.genx/templates/angular/route.template.hbs +8 -0
- package/.genx/utils/excludeFrameworks.js +29 -0
- package/.genx/utils/formatJSONValue.js +9 -0
- package/.genx/utils/formatRouteData.js +36 -0
- package/.genx/utils/generateCsv.js +13 -0
- package/.genx/utils/generateRoute.js +64 -0
- package/.genx/utils/getCombinedCsvData.js +72 -0
- package/.genx/utils/getLayoutType.js +10 -0
- package/.genx/utils/gridColumnsSerializer.js +17 -0
- package/.genx/utils/gridOptionsSerializer.js +33 -0
- package/.genx/utils/index.js +25 -0
- package/.genx/utils/makeDirectory.js +9 -0
- package/.genx/utils/normalizeFrameworkAlias.js +5 -0
- package/.genx/utils/parseJSONArgument.js +13 -0
- package/.genx/utils/registerPartials.js +25 -0
- package/.genx/utils/validateFrameworkAlias.js +8 -0
- package/.genx/utils/validateRoute.js +8 -0
- package/.genx/versions.json +2 -2
- package/CHANGELOG.md +14 -0
- package/client-tmp/angular/README.md +27 -0
- package/client-tmp/angular/angular.json +136 -0
- package/client-tmp/angular/globals.d.ts +6 -0
- package/client-tmp/angular/package.json +51 -0
- package/client-tmp/angular/src/app/app.component.css +0 -0
- package/client-tmp/angular/src/app/app.component.html +3 -0
- package/client-tmp/angular/src/app/app.component.spec.ts +29 -0
- package/client-tmp/angular/src/app/app.component.ts +26 -0
- package/client-tmp/angular/src/app/app.config.ts +7 -0
- package/client-tmp/angular/src/app/app.routes.ts +28 -0
- package/client-tmp/angular/src/app/guards/auth.guard.ts +25 -0
- package/client-tmp/angular/src/app/pages/auth-login/auth-login.component.css +4 -0
- package/client-tmp/angular/src/app/pages/auth-login/auth-login.component.html +1 -0
- package/client-tmp/angular/src/app/pages/auth-login/auth-login.component.spec.ts +22 -0
- package/client-tmp/angular/src/app/pages/auth-login/auth-login.component.ts +12 -0
- package/client-tmp/angular/src/app/pages/home/home.component.css +3 -0
- package/client-tmp/angular/src/app/pages/home/home.component.html +1 -0
- package/client-tmp/angular/src/app/pages/home/home.component.ts +16 -0
- package/client-tmp/angular/src/app/services/auth.service.ts +14 -0
- package/client-tmp/angular/src/app/share/foundation-auth.ts +21 -0
- package/client-tmp/angular/src/app/share/foundation-login.ts +37 -0
- package/client-tmp/angular/src/app/share/genesis-components.ts +15 -0
- package/client-tmp/angular/src/assets/.gitkeep +0 -0
- package/client-tmp/angular/src/environments/environment.prod.ts +5 -0
- package/client-tmp/angular/src/environments/environment.ts +6 -0
- package/client-tmp/angular/src/index.html +13 -0
- package/client-tmp/angular/src/main.ts +6 -0
- package/client-tmp/angular/src/styles.css +13 -0
- package/client-tmp/angular/tsconfig.app.json +15 -0
- package/client-tmp/angular/tsconfig.json +33 -0
- package/client-tmp/angular/tsconfig.spec.json +14 -0
- package/client-tmp/angular/webpack.dev.config.js +14 -0
- package/client-tmp/angular/webpack.prod.config.js +14 -0
- package/client-tmp/angular/webpack.shared.config.js +42 -0
- package/client-tmp/react/react-file.ts +1 -0
- package/client-tmp/web-components/public/favicon.ico +0 -0
- package/package.json +1 -1
- package/.genx/utils.js +0 -212
- /package/.genx/templates/{route.hbs → web-components/route.hbs} +0 -0
- /package/.genx/templates/{route.styles.hbs → web-components/route.styles.hbs} +0 -0
- /package/.genx/templates/{route.template.hbs → web-components/route.template.hbs} +0 -0
- /package/{client/public → client-tmp/angular/src}/favicon.ico +0 -0
- /package/{client → client-tmp/web-components}/.editorconfig +0 -0
- /package/{client → client-tmp/web-components}/.prettierignore +0 -0
- /package/{client → client-tmp/web-components}/Dockerfile +0 -0
- /package/{client → client-tmp/web-components}/README.md +0 -0
- /package/{client → client-tmp/web-components}/build.gradle.kts +0 -0
- /package/{client → client-tmp/web-components}/docs/images/lsp_jetbrains_one.png +0 -0
- /package/{client → client-tmp/web-components}/docs/images/lsp_jetbrains_two.png +0 -0
- /package/{client → client-tmp/web-components}/docs/images/lsp_vscode_one.png +0 -0
- /package/{client → client-tmp/web-components}/docs/images/lsp_vscode_two.png +0 -0
- /package/{client → client-tmp/web-components}/index.html +0 -0
- /package/{client → client-tmp/web-components}/package.json +0 -0
- /package/{client → client-tmp/web-components}/playwright.config.ts +0 -0
- /package/{client → client-tmp/web-components}/public/initSSO.js +0 -0
- /package/{client → client-tmp/web-components}/settings.gradle.kts +0 -0
- /package/{client → client-tmp/web-components}/src/components/components.ts +0 -0
- /package/{client → client-tmp/web-components}/src/components/index.ts +0 -0
- /package/{client → client-tmp/web-components}/src/components/not-permitted-component/index.ts +0 -0
- /package/{client → client-tmp/web-components}/src/components/not-permitted-component/not-permitted-component.styles.ts +0 -0
- /package/{client → client-tmp/web-components}/src/components/not-permitted-component/not-permitted-component.template.ts +0 -0
- /package/{client → client-tmp/web-components}/src/components/not-permitted-component/not-permitted-component.ts +0 -0
- /package/{client → client-tmp/web-components}/src/index.federated.ts +0 -0
- /package/{client → client-tmp/web-components}/src/index.ts +0 -0
- /package/{client → client-tmp/web-components}/src/layouts/default.ts +0 -0
- /package/{client → client-tmp/web-components}/src/layouts/index.ts +0 -0
- /package/{client → client-tmp/web-components}/src/main/index.ts +0 -0
- /package/{client → client-tmp/web-components}/src/main/main.css +0 -0
- /package/{client → client-tmp/web-components}/src/main/main.styles.ts +0 -0
- /package/{client → client-tmp/web-components}/src/main/main.template.ts +0 -0
- /package/{client → client-tmp/web-components}/src/main/main.ts +0 -0
- /package/{client → client-tmp/web-components}/src/pbc/README.md +0 -0
- /package/{client → client-tmp/web-components}/src/routes/config.ts +0 -0
- /package/{client → client-tmp/web-components}/src/routes/index.ts +0 -0
- /package/{client → client-tmp/web-components}/src/routes/not-found/not-found.styles.ts +0 -0
- /package/{client → client-tmp/web-components}/src/routes/not-found/not-found.template.ts +0 -0
- /package/{client → client-tmp/web-components}/src/routes/not-found/not-found.ts +0 -0
- /package/{client → client-tmp/web-components}/src/routes/not-permitted/not-permitted.styles.ts +0 -0
- /package/{client → client-tmp/web-components}/src/routes/not-permitted/not-permitted.template.ts +0 -0
- /package/{client → client-tmp/web-components}/src/routes/not-permitted/not-permitted.ts +0 -0
- /package/{client → client-tmp/web-components}/src/routes/types.ts +0 -0
- /package/{client → client-tmp/web-components}/src/store/index.ts +0 -0
- /package/{client → client-tmp/web-components}/src/store/store.ts +0 -0
- /package/{client → client-tmp/web-components}/src/styles/design-tokens.json +0 -0
- /package/{client → client-tmp/web-components}/src/styles/index.ts +0 -0
- /package/{client → client-tmp/web-components}/src/styles/styles.ts +0 -0
- /package/{client → client-tmp/web-components}/src/styles/typography.ts +0 -0
- /package/{client → client-tmp/web-components}/src/types.ts +0 -0
- /package/{client → client-tmp/web-components}/src/typings.d.ts +0 -0
- /package/{client → client-tmp/web-components}/src/utils/fdc3.ts +0 -0
- /package/{client → client-tmp/web-components}/src/utils/formatters.ts +0 -0
- /package/{client → client-tmp/web-components}/src/utils/index.ts +0 -0
- /package/{client → client-tmp/web-components}/src/utils/logger.ts +0 -0
- /package/{client → client-tmp/web-components}/src/utils/permissions.ts +0 -0
- /package/{client → client-tmp/web-components}/test/README.md +0 -0
- /package/{client → client-tmp/web-components}/test/e2e/fixture.ts +0 -0
- /package/{client → client-tmp/web-components}/test/e2e/flows/001-protected.e2e.ts +0 -0
- /package/{client → client-tmp/web-components}/test/e2e/index.ts +0 -0
- /package/{client → client-tmp/web-components}/test/e2e/pages/index.ts +0 -0
- /package/{client → client-tmp/web-components}/test/e2e/pages/protected.ts +0 -0
- /package/{client → client-tmp/web-components}/test/unit/sample.test.ts +0 -0
- /package/{client → client-tmp/web-components}/tsconfig.json +0 -0
package/.genx/package.json
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genesislcap/blank-app-seed-config",
|
|
3
3
|
"description": "Genesis Blank App Seed Configuration",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.17.1",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"lint": "eslint .",
|
|
8
|
+
"lint:fix": "eslint . --fix",
|
|
9
|
+
"format": "prettier --write \"**/*.js\""
|
|
10
|
+
},
|
|
6
11
|
"genxSeedConfig": {
|
|
7
12
|
"exclude": [
|
|
8
13
|
".git",
|
|
@@ -47,5 +52,13 @@
|
|
|
47
52
|
]
|
|
48
53
|
}
|
|
49
54
|
}
|
|
55
|
+
},
|
|
56
|
+
"devDependencies": {
|
|
57
|
+
"@eslint/js": "^9.3.0",
|
|
58
|
+
"eslint": "^9.3.0",
|
|
59
|
+
"eslint-config-prettier": "^9.1.0",
|
|
60
|
+
"eslint-plugin-prettier": "^5.1.3",
|
|
61
|
+
"globals": "^15.3.0",
|
|
62
|
+
"prettier": "^3.2.5"
|
|
50
63
|
}
|
|
51
64
|
}
|
package/.genx/prompts/api.js
CHANGED
|
@@ -1,48 +1,40 @@
|
|
|
1
|
-
const {websocketValidator} = require('./validators');
|
|
1
|
+
const { websocketValidator } = require('./validators');
|
|
2
|
+
const { TEXTS } = require('../static');
|
|
2
3
|
|
|
3
|
-
const apiHostIntro = () => console.log(
|
|
4
|
-
|
|
5
|
-
`);
|
|
6
|
-
|
|
7
|
-
const ssoIntro = () => console.log(`
|
|
8
|
-
Optionally, you can enable the SSO function, which will redirect to identity provider before starting the application (given we only have one identity provider).
|
|
9
|
-
`);
|
|
4
|
+
const apiHostIntro = () => console.log(TEXTS.INTRO_API_HOST);
|
|
5
|
+
const ssoIntro = () => console.log(TEXTS.INTRO_API_SSO);
|
|
10
6
|
|
|
11
7
|
module.exports = async (inquirer, prevAns = {}) => {
|
|
12
8
|
apiHostIntro();
|
|
13
|
-
const {
|
|
14
|
-
apiHost = prevAns.apiHost,
|
|
15
|
-
} = await inquirer.prompt([
|
|
9
|
+
const { apiHost = prevAns.apiHost } = await inquirer.prompt([
|
|
16
10
|
{
|
|
17
11
|
name: 'setApiHost',
|
|
18
12
|
type: 'confirm',
|
|
19
|
-
message:
|
|
13
|
+
message: TEXTS.MESSAGE_API_SET_HOST,
|
|
20
14
|
when: !prevAns.apiHost,
|
|
21
15
|
default: true,
|
|
22
16
|
},
|
|
23
17
|
{
|
|
24
18
|
name: 'apiHost',
|
|
25
19
|
type: 'input',
|
|
26
|
-
message:
|
|
27
|
-
when: ({setApiHost}) => setApiHost,
|
|
20
|
+
message: TEXTS.MESSAGE_API_HOST,
|
|
21
|
+
when: ({ setApiHost }) => setApiHost,
|
|
28
22
|
default: prevAns.apiHost || 'ws://localhost/gwf/',
|
|
29
23
|
validate: websocketValidator,
|
|
30
24
|
},
|
|
31
|
-
])
|
|
25
|
+
]);
|
|
32
26
|
ssoIntro();
|
|
33
|
-
const {
|
|
34
|
-
enableSSO = prevAns.enableSSO
|
|
35
|
-
} = await inquirer.prompt([
|
|
27
|
+
const { enableSSO = prevAns.enableSSO } = await inquirer.prompt([
|
|
36
28
|
{
|
|
37
29
|
name: 'enableSSO',
|
|
38
30
|
type: 'confirm',
|
|
39
|
-
message:
|
|
31
|
+
message: TEXTS.MESSAGE_API_SSO,
|
|
40
32
|
default: prevAns.enableSSO || false,
|
|
41
33
|
when: prevAns.enableSSO === undefined,
|
|
42
34
|
},
|
|
43
35
|
]);
|
|
44
36
|
return {
|
|
45
37
|
apiHost,
|
|
46
|
-
enableSSO
|
|
38
|
+
enableSSO,
|
|
47
39
|
};
|
|
48
40
|
};
|
package/.genx/prompts/server.js
CHANGED
|
@@ -1,59 +1,60 @@
|
|
|
1
|
-
const {mavenArtifactVersionRegex} = require('./validators');
|
|
2
|
-
const {parseJSONArgument} = require('../utils');
|
|
1
|
+
const { mavenArtifactVersionRegex } = require('./validators');
|
|
2
|
+
const { parseJSONArgument } = require('../utils');
|
|
3
|
+
const { TEXTS } = require('../static');
|
|
3
4
|
|
|
4
5
|
const parsecsv = parseJSONArgument('csv', []);
|
|
5
6
|
|
|
6
7
|
module.exports = async (inquirer, prevAns = {}) => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
8
|
+
const {
|
|
9
|
+
description = prevAns.description,
|
|
10
|
+
groupId = prevAns.groupId,
|
|
11
|
+
applicationVersion = prevAns.applicationVersion,
|
|
12
|
+
enableDeployPlugin = prevAns.enableDeployPlugin,
|
|
13
|
+
csv = prevAns.csv,
|
|
14
|
+
} = await inquirer.prompt([
|
|
15
|
+
{
|
|
16
|
+
name: 'description',
|
|
17
|
+
type: 'input',
|
|
18
|
+
message: TEXTS.MESSAGE_SERVER_DESCRIPTION,
|
|
19
|
+
when: !prevAns.description,
|
|
20
|
+
default: '\n',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: 'groupId',
|
|
24
|
+
type: 'input',
|
|
25
|
+
message: TEXTS.MESSAGE_SERVER_GROUP_ID,
|
|
26
|
+
when: !prevAns.groupId,
|
|
27
|
+
default: 'global.genesis',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: 'applicationVersion',
|
|
31
|
+
type: 'input',
|
|
32
|
+
message: TEXTS.MESSAGE_SERVER_APPLICATION_VERSION,
|
|
33
|
+
when: !prevAns.applicationVersion,
|
|
34
|
+
default: '1.0.0-SNAPSHOT',
|
|
35
|
+
validate: mavenArtifactVersionRegex,
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: 'enableDeployPlugin',
|
|
39
|
+
type: 'confirm',
|
|
40
|
+
message: TEXTS.MESSAGE_SERVER_DEPLOY_PLUGIN,
|
|
41
|
+
when: prevAns.enableDeployPlugin === undefined,
|
|
42
|
+
default: prevAns.enableDeployPlugin || false,
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: 'csv',
|
|
46
|
+
type: 'input',
|
|
47
|
+
message: TEXTS.MESSAGE_SERVER_CSV,
|
|
48
|
+
when: !prevAns.csv,
|
|
49
|
+
default: '[]',
|
|
50
|
+
},
|
|
51
|
+
]);
|
|
51
52
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
53
|
+
return {
|
|
54
|
+
description,
|
|
55
|
+
groupId,
|
|
56
|
+
applicationVersion,
|
|
57
|
+
enableDeployPlugin,
|
|
58
|
+
csv: parsecsv(csv),
|
|
59
|
+
};
|
|
60
|
+
};
|
package/.genx/prompts/ui.js
CHANGED
|
@@ -1,38 +1,65 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const { frameworkValidator } = require('./validators');
|
|
2
|
+
const { parseJSONArgument, normalizeFrameworkAlias } = require('../utils');
|
|
3
|
+
const {
|
|
4
|
+
FRAMEWORK_WEB_COMPONENTS_ALIAS,
|
|
5
|
+
FRAMEWORKS_ALIAS,
|
|
6
|
+
FRAMEWORKS_LABEL_MAP,
|
|
7
|
+
TEXTS,
|
|
8
|
+
} = require('../static');
|
|
2
9
|
|
|
3
10
|
const defaultRoutes = [{ name: 'home' }];
|
|
4
11
|
const parseRoutes = parseJSONArgument('routes', defaultRoutes);
|
|
5
|
-
const routesIntro = () => console.log(`
|
|
6
|
-
Pages to be added to the navigation header
|
|
7
|
-
`);
|
|
8
12
|
|
|
9
13
|
const defaultUI = {};
|
|
10
14
|
const parseUI = parseJSONArgument('ui', defaultUI);
|
|
11
15
|
|
|
16
|
+
const selectedFrameworkInfo = (framework) => {
|
|
17
|
+
if (framework && frameworkValidator(framework) === true) {
|
|
18
|
+
console.log(
|
|
19
|
+
`${TEXTS.MESSAGE_UI_FRAMEWORK}: ${FRAMEWORKS_LABEL_MAP.get(normalizeFrameworkAlias(framework))}`,
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
|
|
12
24
|
module.exports = async (inquirer, prevAns = {}) => {
|
|
13
|
-
|
|
25
|
+
selectedFrameworkInfo(prevAns.framework);
|
|
26
|
+
|
|
14
27
|
const {
|
|
15
|
-
|
|
28
|
+
framework = prevAns.framework,
|
|
16
29
|
ui = prevAns.ui,
|
|
30
|
+
routes = prevAns.routes,
|
|
17
31
|
} = await inquirer.prompt([
|
|
18
32
|
{
|
|
19
|
-
name: '
|
|
20
|
-
type: '
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
33
|
+
name: 'framework',
|
|
34
|
+
type: 'list',
|
|
35
|
+
choices: FRAMEWORKS_ALIAS.map((value) => ({
|
|
36
|
+
name: FRAMEWORKS_LABEL_MAP.get(value),
|
|
37
|
+
value,
|
|
38
|
+
})),
|
|
39
|
+
message: TEXTS.MESSAGE_UI_FRAMEWORK,
|
|
40
|
+
when: prevAns.framework === undefined,
|
|
41
|
+
validate: frameworkValidator,
|
|
42
|
+
default: FRAMEWORK_WEB_COMPONENTS_ALIAS,
|
|
24
43
|
},
|
|
25
44
|
{
|
|
26
45
|
name: 'ui',
|
|
27
46
|
type: 'input',
|
|
28
|
-
message:
|
|
47
|
+
message: TEXTS.MESSAGE_UI_CONFIG,
|
|
29
48
|
when: !prevAns.ui,
|
|
30
49
|
default: JSON.stringify(defaultUI),
|
|
31
50
|
},
|
|
32
|
-
|
|
51
|
+
{
|
|
52
|
+
name: 'routes',
|
|
53
|
+
type: 'input',
|
|
54
|
+
message: TEXTS.MESSAGE_UI_ROTUES,
|
|
55
|
+
when: !prevAns.routes,
|
|
56
|
+
default: JSON.stringify(defaultRoutes),
|
|
57
|
+
},
|
|
58
|
+
]);
|
|
33
59
|
|
|
34
60
|
return {
|
|
35
61
|
routes: parseRoutes(routes),
|
|
36
62
|
ui: parseUI(ui),
|
|
63
|
+
framework: normalizeFrameworkAlias(framework),
|
|
37
64
|
};
|
|
38
65
|
};
|
|
@@ -1,10 +1,20 @@
|
|
|
1
|
-
const
|
|
2
|
-
const mavenArtifactVersionRegex = /([\d+{1,3}\.A-Z]+)/;
|
|
1
|
+
const { TEXTS } = require('../static');
|
|
3
2
|
|
|
4
|
-
const
|
|
5
|
-
|
|
3
|
+
const { validateFrameworkAlias } = require('../utils');
|
|
4
|
+
|
|
5
|
+
const websocketRegex =
|
|
6
|
+
/wss?:\/\/[-a-zA-Z0-9@:%._+~#=]{1,256}\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)\b\/*$/;
|
|
7
|
+
const mavenArtifactVersionRegex = /([\d+{1,3}.A-Z]+)/;
|
|
8
|
+
|
|
9
|
+
const frameworkValidator = (value) =>
|
|
10
|
+
validateFrameworkAlias(value) || TEXTS.ERROR_VALIDATOR_FRAMEWORK;
|
|
11
|
+
const websocketValidator = (value) =>
|
|
12
|
+
websocketRegex.test(value) || TEXTS.ERROR_VALIDATOR_WEBSOCKET;
|
|
13
|
+
const mavenArtifactVersionValidator = (value) =>
|
|
14
|
+
mavenArtifactVersionRegex.test(value) || TEXTS.ERROR_VALIDATOR_VERSION;
|
|
6
15
|
|
|
7
16
|
module.exports = {
|
|
17
|
+
frameworkValidator,
|
|
8
18
|
websocketValidator,
|
|
9
|
-
mavenArtifactVersionValidator
|
|
10
|
-
}
|
|
19
|
+
mavenArtifactVersionValidator,
|
|
20
|
+
};
|
package/.genx/prompts.js
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
const apiPrompts = require('./prompts/api');
|
|
2
2
|
const genesisServerPrompts = require('./prompts/server');
|
|
3
3
|
const uiPrompts = require('./prompts/ui');
|
|
4
|
-
const {
|
|
4
|
+
const {
|
|
5
|
+
description: packageDescription,
|
|
6
|
+
license,
|
|
7
|
+
name,
|
|
8
|
+
version,
|
|
9
|
+
} = require('./package.json');
|
|
5
10
|
|
|
6
11
|
module.exports = async (inquirer, prevAns = {}) => {
|
|
7
12
|
console.log(`
|
|
@@ -11,9 +16,10 @@ module.exports = async (inquirer, prevAns = {}) => {
|
|
|
11
16
|
Version: ${version}
|
|
12
17
|
License: ${license}`);
|
|
13
18
|
|
|
14
|
-
const {apiHost, enableSSO} = await apiPrompts(inquirer, prevAns)
|
|
15
|
-
const {description, groupId, applicationVersion, enableDeployPlugin, csv} =
|
|
16
|
-
|
|
19
|
+
const { apiHost, enableSSO } = await apiPrompts(inquirer, prevAns);
|
|
20
|
+
const { description, groupId, applicationVersion, enableDeployPlugin, csv } =
|
|
21
|
+
await genesisServerPrompts(inquirer, prevAns);
|
|
22
|
+
const { routes, ui, framework } = await uiPrompts(inquirer, prevAns);
|
|
17
23
|
|
|
18
24
|
return {
|
|
19
25
|
apiHost,
|
|
@@ -25,5 +31,6 @@ module.exports = async (inquirer, prevAns = {}) => {
|
|
|
25
31
|
enableDeployPlugin,
|
|
26
32
|
csv,
|
|
27
33
|
ui,
|
|
34
|
+
framework,
|
|
28
35
|
};
|
|
29
36
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
const { execSync } = require('node:child_process');
|
|
2
2
|
const { writeFileSync } = require('node:fs');
|
|
3
|
-
const { resolve }
|
|
3
|
+
const { resolve } = require('node:path');
|
|
4
4
|
const current = require('../versions.json');
|
|
5
5
|
|
|
6
|
-
const run = (command) =>
|
|
6
|
+
const run = (command) =>
|
|
7
|
+
execSync(command, {
|
|
7
8
|
stdio: ['pipe', 'pipe', 'ignore'],
|
|
8
9
|
})
|
|
9
10
|
.toString('utf8')
|
|
@@ -20,8 +21,12 @@ const writeJSON = (json, path) => {
|
|
|
20
21
|
};
|
|
21
22
|
|
|
22
23
|
const UI = run('npm info @genesislcap/foundation-ui@latest version');
|
|
23
|
-
const GSF = run(
|
|
24
|
-
|
|
24
|
+
const GSF = run(
|
|
25
|
+
`jf rt s "libs-release-client/global/genesis/genesis-distribution/" --exclusions="*-RC*;*-SNAPSHOT*;*maven-metadata*;*test*;*TEST*" | grep path | tr -s ' ' | sed 's/"path": //g' | awk -F'/' '{print $(NF-1)}' | sort -V | tail -n 1`,
|
|
26
|
+
);
|
|
27
|
+
const Auth = run(
|
|
28
|
+
`jf rt s "libs-release-client/global/genesis/auth-distribution/" --exclusions="*-RC*;*-SNAPSHOT*;*maven-metadata*;*test*;*TEST*" | grep path | tr -s ' ' | sed 's/"path": //g' | awk -F'/' '{print $(NF-1)}' | sort -V | tail -n 1`,
|
|
29
|
+
);
|
|
25
30
|
const latest = { UI, GSF, Auth };
|
|
26
31
|
|
|
27
32
|
console.log('Current:', current);
|
package/.genx/static.js
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
const FRAMEWORK_WEB_COMPONENTS_ALIAS = 'webcomponents';
|
|
2
|
+
const FRAMEWORK_ANGULAR_ALIAS = 'angular';
|
|
3
|
+
const FRAMEWORK_REACT_ALIAS = 'react';
|
|
4
|
+
|
|
5
|
+
const FRAMEWORKS_ALIAS = [
|
|
6
|
+
FRAMEWORK_WEB_COMPONENTS_ALIAS,
|
|
7
|
+
FRAMEWORK_ANGULAR_ALIAS,
|
|
8
|
+
FRAMEWORK_REACT_ALIAS,
|
|
9
|
+
];
|
|
10
|
+
|
|
11
|
+
const FRAMEWORKS_LABEL_MAP = new Map([
|
|
12
|
+
[FRAMEWORK_WEB_COMPONENTS_ALIAS, 'Web Components'],
|
|
13
|
+
[FRAMEWORK_ANGULAR_ALIAS, 'Angular'],
|
|
14
|
+
[FRAMEWORK_REACT_ALIAS, 'React'],
|
|
15
|
+
]);
|
|
16
|
+
|
|
17
|
+
const FRAMEWORKS_DIR_MAP = new Map([
|
|
18
|
+
[FRAMEWORK_WEB_COMPONENTS_ALIAS, 'web-components'],
|
|
19
|
+
[FRAMEWORK_ANGULAR_ALIAS, 'angular'],
|
|
20
|
+
[FRAMEWORK_REACT_ALIAS, 'react'],
|
|
21
|
+
]);
|
|
22
|
+
|
|
23
|
+
const DEFAULT_FRAMEWORK_ALIAS = FRAMEWORK_WEB_COMPONENTS_ALIAS;
|
|
24
|
+
|
|
25
|
+
const DIR_CLIENT_MAIN_ALIAS = 'client';
|
|
26
|
+
const DIR_CLIENT_TEMP_ALIAS = 'client-tmp';
|
|
27
|
+
const DIR_TEMPLATE_ROOT_ALIAS = 'templates';
|
|
28
|
+
const DIR_TEMPLATE_ANGULAR_ALIAS = 'angular';
|
|
29
|
+
const DIR_TEMPLATE_WEB_COMPONENT_ALIAS = 'web-components';
|
|
30
|
+
const DIR_TEMPLATE_REACT_ALIAS = 'react';
|
|
31
|
+
|
|
32
|
+
const DIRS_MAP = new Map([
|
|
33
|
+
[DIR_CLIENT_MAIN_ALIAS, DIR_CLIENT_MAIN_ALIAS],
|
|
34
|
+
[DIR_CLIENT_TEMP_ALIAS, DIR_CLIENT_TEMP_ALIAS],
|
|
35
|
+
[DIR_TEMPLATE_ROOT_ALIAS, DIR_TEMPLATE_ROOT_ALIAS],
|
|
36
|
+
[
|
|
37
|
+
DIR_TEMPLATE_ANGULAR_ALIAS,
|
|
38
|
+
`${DIR_TEMPLATE_ROOT_ALIAS}/${DIR_TEMPLATE_ANGULAR_ALIAS}`,
|
|
39
|
+
],
|
|
40
|
+
[
|
|
41
|
+
DIR_TEMPLATE_WEB_COMPONENT_ALIAS,
|
|
42
|
+
`${DIR_TEMPLATE_ROOT_ALIAS}/${DIR_TEMPLATE_WEB_COMPONENT_ALIAS}`,
|
|
43
|
+
],
|
|
44
|
+
[
|
|
45
|
+
DIR_TEMPLATE_REACT_ALIAS,
|
|
46
|
+
`${DIR_TEMPLATE_ROOT_ALIAS}/${DIR_TEMPLATE_REACT_ALIAS}`,
|
|
47
|
+
],
|
|
48
|
+
]);
|
|
49
|
+
|
|
50
|
+
const DIR_TEMPLATE_BY_FRAMEWORK = {
|
|
51
|
+
[FRAMEWORK_WEB_COMPONENTS_ALIAS]: DIRS_MAP.get(
|
|
52
|
+
DIR_TEMPLATE_WEB_COMPONENT_ALIAS,
|
|
53
|
+
),
|
|
54
|
+
[FRAMEWORK_ANGULAR_ALIAS]: DIRS_MAP.get(DIR_TEMPLATE_ANGULAR_ALIAS),
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const TEXTS = {
|
|
58
|
+
INTRO_API_HOST:
|
|
59
|
+
'You can override the default Genesis server URL used during local developent.',
|
|
60
|
+
INTRO_API_SSO:
|
|
61
|
+
'Optionally, you can enable the SSO function, which will redirect to identity provider before starting the application (given we only have one identity provider).',
|
|
62
|
+
MESSAGE_API_SET_HOST: 'Set API Host',
|
|
63
|
+
MESSAGE_API_HOST: 'API Host (with WebSocket prefix and suffix if any)',
|
|
64
|
+
MESSAGE_API_SSO: 'Init SSO connection before loading application',
|
|
65
|
+
MESSAGE_SERVER_DESCRIPTION: 'Project Description',
|
|
66
|
+
MESSAGE_SERVER_GROUP_ID: 'Group Id',
|
|
67
|
+
MESSAGE_SERVER_APPLICATION_VERSION: 'Application Version',
|
|
68
|
+
MESSAGE_SERVER_DEPLOY_PLUGIN: 'Enable deploy plugin?',
|
|
69
|
+
MESSAGE_SERVER_CSV:
|
|
70
|
+
'Generate empty CSV for entities? (config in JSON format)',
|
|
71
|
+
MESSAGE_UI_ROTUES: 'Pages config in JSON format',
|
|
72
|
+
MESSAGE_UI_CONFIG: 'UI configuration in JSON format',
|
|
73
|
+
MESSAGE_UI_FRAMEWORK: 'Framework',
|
|
74
|
+
ERROR_VALIDATOR_FRAMEWORK: 'Selected framework is not supported',
|
|
75
|
+
ERROR_VALIDATOR_WEBSOCKET: 'Not a valid websocket',
|
|
76
|
+
ERROR_VALIDATOR_VERSION: 'Not a valid version',
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
module.exports = {
|
|
80
|
+
FRAMEWORK_WEB_COMPONENTS_ALIAS,
|
|
81
|
+
FRAMEWORK_ANGULAR_ALIAS,
|
|
82
|
+
FRAMEWORK_REACT_ALIAS,
|
|
83
|
+
FRAMEWORKS_ALIAS,
|
|
84
|
+
FRAMEWORKS_LABEL_MAP,
|
|
85
|
+
FRAMEWORKS_DIR_MAP,
|
|
86
|
+
DEFAULT_FRAMEWORK_ALIAS,
|
|
87
|
+
DIR_CLIENT_MAIN_ALIAS,
|
|
88
|
+
DIR_CLIENT_TEMP_ALIAS,
|
|
89
|
+
DIR_TEMPLATE_ROOT_ALIAS,
|
|
90
|
+
DIR_TEMPLATE_ANGULAR_ALIAS,
|
|
91
|
+
DIR_TEMPLATE_WEB_COMPONENT_ALIAS,
|
|
92
|
+
DIR_TEMPLATE_REACT_ALIAS,
|
|
93
|
+
DIR_TEMPLATE_BY_FRAMEWORK,
|
|
94
|
+
DIRS_MAP,
|
|
95
|
+
TEXTS,
|
|
96
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {Component, CUSTOM_ELEMENTS_SCHEMA} from '@angular/core';
|
|
2
|
+
import {CommonModule} from '@angular/common';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'app-{{pascalCase route.name}}',
|
|
6
|
+
standalone: true,
|
|
7
|
+
imports: [
|
|
8
|
+
CommonModule,
|
|
9
|
+
],
|
|
10
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
11
|
+
templateUrl: './{{kebabCase route.name}}.component.html',
|
|
12
|
+
styleUrls: ['./{{kebabCase route.name}}.component.css'],
|
|
13
|
+
})
|
|
14
|
+
export class {{pascalCase route.name}}Component {}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const { rmSync, renameSync } = require('node:fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const {
|
|
4
|
+
FRAMEWORKS_DIR_MAP,
|
|
5
|
+
DIR_CLIENT_MAIN_ALIAS,
|
|
6
|
+
DIR_CLIENT_TEMP_ALIAS,
|
|
7
|
+
DIRS_MAP,
|
|
8
|
+
} = require('../static');
|
|
9
|
+
|
|
10
|
+
const dirClientTemp = path.join(
|
|
11
|
+
__dirname,
|
|
12
|
+
`../../${DIRS_MAP.get(DIR_CLIENT_TEMP_ALIAS)}`,
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
const getDirClientTemp = (frameworkName) => {
|
|
16
|
+
return `${dirClientTemp}/${FRAMEWORKS_DIR_MAP.get(frameworkName)}`;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const excludeFrameworks = (selectedFramework) => {
|
|
20
|
+
const mainClientDirPath = path.join(
|
|
21
|
+
__dirname,
|
|
22
|
+
`../../${DIRS_MAP.get(DIR_CLIENT_MAIN_ALIAS)}`,
|
|
23
|
+
);
|
|
24
|
+
renameSync(getDirClientTemp(selectedFramework), mainClientDirPath);
|
|
25
|
+
|
|
26
|
+
rmSync(dirClientTemp, { recursive: true, force: true });
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
module.exports = excludeFrameworks;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
const gridOptionsSerializer = require('./gridOptionsSerializer');
|
|
2
|
+
const formatJSONValue = require('./formatJSONValue');
|
|
3
|
+
const gridColumnsSerializer = require('./gridColumnsSerializer');
|
|
4
|
+
const getLayoutType = require('./getLayoutType');
|
|
5
|
+
|
|
6
|
+
const formatRouteData = (route) => {
|
|
7
|
+
const layoutKey = route?.layoutKey || `${route.name}_${Date.now()}`;
|
|
8
|
+
const layoutType = route?.layoutType || getLayoutType(route);
|
|
9
|
+
|
|
10
|
+
const FDC3ClickCategory = 'fdc3';
|
|
11
|
+
const FDC3EventHandlersEnabled = !!route.tiles?.find(
|
|
12
|
+
(t) => t.config?.gridOptions?.onRowClicked?.category === FDC3ClickCategory,
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
const tiles = route.tiles?.map((tile) => ({
|
|
16
|
+
...tile,
|
|
17
|
+
config: {
|
|
18
|
+
...(tile.config || {}),
|
|
19
|
+
gridOptions: gridOptionsSerializer(tile.config?.gridOptions),
|
|
20
|
+
createFormUiSchema: formatJSONValue(tile.config?.createFormUiSchema),
|
|
21
|
+
updateFormUiSchema: formatJSONValue(tile.config?.updateFormUiSchema),
|
|
22
|
+
uischema: formatJSONValue(tile.config?.uischema),
|
|
23
|
+
columns: gridColumnsSerializer(tile.config?.columns),
|
|
24
|
+
},
|
|
25
|
+
}));
|
|
26
|
+
|
|
27
|
+
return {
|
|
28
|
+
...route,
|
|
29
|
+
layoutType,
|
|
30
|
+
layoutKey,
|
|
31
|
+
tiles,
|
|
32
|
+
FDC3EventHandlersEnabled,
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
module.exports = formatRouteData;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const { resolve } = require('node:path');
|
|
2
|
+
|
|
3
|
+
const generateCsv = (entity, { writeFileWithData }) => {
|
|
4
|
+
writeFileWithData(
|
|
5
|
+
resolve(
|
|
6
|
+
__dirname,
|
|
7
|
+
`../../server/{{appName}}-app/src/main/genesis/data/${entity.name}.csv`,
|
|
8
|
+
),
|
|
9
|
+
{ entity },
|
|
10
|
+
resolve(__dirname, '../templates/csv.hbs'),
|
|
11
|
+
);
|
|
12
|
+
};
|
|
13
|
+
module.exports = generateCsv;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
const { resolve } = require('node:path');
|
|
2
|
+
const makeDirectory = require('./makeDirectory');
|
|
3
|
+
const {
|
|
4
|
+
FRAMEWORK_WEB_COMPONENTS_ALIAS,
|
|
5
|
+
FRAMEWORK_ANGULAR_ALIAS,
|
|
6
|
+
DIR_TEMPLATE_BY_FRAMEWORK,
|
|
7
|
+
} = require('../static');
|
|
8
|
+
|
|
9
|
+
const getPathByFramework = {
|
|
10
|
+
[FRAMEWORK_WEB_COMPONENTS_ALIAS]: {
|
|
11
|
+
clientSrcPath: `../../client/src/routes`,
|
|
12
|
+
route: (clientSrcPath, routeName) => `${clientSrcPath}/${routeName}`,
|
|
13
|
+
component: (routeDir, routeName) => `${routeDir}/${routeName}.ts`,
|
|
14
|
+
template: (routeDir, routeName) => `${routeDir}/${routeName}.template.ts`,
|
|
15
|
+
style: (routePath, routeName) => `${routePath}/${routeName}.styles.ts`,
|
|
16
|
+
},
|
|
17
|
+
[FRAMEWORK_ANGULAR_ALIAS]: {
|
|
18
|
+
clientSrcPath: `../../client/src/app/pages`,
|
|
19
|
+
route: (clientSrcPath, routeName) => `${clientSrcPath}/${routeName}`,
|
|
20
|
+
component: (routeDir, routeName) => `${routeDir}/${routeName}.component.ts`,
|
|
21
|
+
template: (routeDir, routeName) =>
|
|
22
|
+
`${routeDir}/${routeName}.component.html`,
|
|
23
|
+
style: (routePath, routeName) => `${routePath}/${routeName}.component.css`,
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const generateRoute = (route, { changeCase, writeFileWithData }, framework) => {
|
|
28
|
+
const routeName = changeCase.paramCase(route.name);
|
|
29
|
+
const sourceTemplateDir = `../${DIR_TEMPLATE_BY_FRAMEWORK[framework]}`;
|
|
30
|
+
const {
|
|
31
|
+
clientSrcPath,
|
|
32
|
+
route: getRouteDir,
|
|
33
|
+
component: getComponentTarget,
|
|
34
|
+
template: getTemplateTarget,
|
|
35
|
+
style: getStyleTarget,
|
|
36
|
+
} = getPathByFramework[framework];
|
|
37
|
+
const routeDir = getRouteDir(clientSrcPath, routeName);
|
|
38
|
+
|
|
39
|
+
const filesToWrite = [
|
|
40
|
+
{
|
|
41
|
+
source: `${sourceTemplateDir}/route.hbs`,
|
|
42
|
+
target: getComponentTarget(routeDir, routeName),
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
source: `${sourceTemplateDir}/route.template.hbs`,
|
|
46
|
+
target: getTemplateTarget(routeDir, routeName),
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
source: `${sourceTemplateDir}/route.styles.hbs`,
|
|
50
|
+
target: getStyleTarget(routeDir, routeName),
|
|
51
|
+
},
|
|
52
|
+
];
|
|
53
|
+
|
|
54
|
+
makeDirectory(resolve(__dirname, routeDir));
|
|
55
|
+
filesToWrite.forEach(({ source, target }) => {
|
|
56
|
+
writeFileWithData(
|
|
57
|
+
resolve(__dirname, target),
|
|
58
|
+
{ route },
|
|
59
|
+
resolve(__dirname, source),
|
|
60
|
+
);
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
module.exports = generateRoute;
|