@genesislcap/blank-app-seed 2.2.0 → 2.3.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/configure.js +16 -0
- package/.genx/package.json +1 -1
- package/.genx/prompts/ui.js +22 -0
- package/.genx/prompts.js +3 -0
- package/.genx/templates/route.hbs +14 -0
- package/{client/src/routes/home/home.styles.ts → .genx/templates/route.styles.hbs} +1 -1
- package/.genx/templates/route.template.hbs +7 -0
- package/CHANGELOG.md +14 -0
- package/client/src/routes/config.ts +13 -9
- package/package.json +1 -1
- package/server/gradle.properties +1 -0
- package/client/src/routes/home/home.template.ts +0 -6
- package/client/src/routes/home/home.ts +0 -14
package/.genx/configure.js
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
const versions = require('./versions.json');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const directoryExists = (directory) => fs.existsSync(directory);
|
|
2
5
|
|
|
6
|
+
const makeDirectory = (directory) => {
|
|
7
|
+
if (!directoryExists(directory)) {
|
|
8
|
+
fs.mkdirSync(directory);
|
|
9
|
+
}
|
|
10
|
+
};
|
|
3
11
|
/**
|
|
4
12
|
* Signature is `async (data: inquirer.Answers, utils: SeedConfigurationUtils)`
|
|
5
13
|
*/
|
|
@@ -12,4 +20,12 @@ module.exports = async (data, utils) => {
|
|
|
12
20
|
data.versions = versions;
|
|
13
21
|
// to be exposed via user prompt in the future
|
|
14
22
|
data.useDocker = !!process.env.USE_DOCKER;
|
|
23
|
+
data.routes.forEach(route => {
|
|
24
|
+
// utils.makeDirectory(path.resolve(data.directory,`client/src/routes/${route}`))
|
|
25
|
+
makeDirectory(path.resolve(data.directory,`client/src/routes/${route}`));
|
|
26
|
+
utils.writeFileWithData(path.resolve(data.directory, `client/src/routes/${route}/${route}.ts`), {route}, path.resolve(data.directory, '.genx/templates/route.hbs'));
|
|
27
|
+
utils.writeFileWithData(path.resolve(data.directory, `client/src/routes/${route}/${route}.template.ts`), {route}, path.resolve(data.directory, '.genx/templates/route.template.hbs'));
|
|
28
|
+
utils.writeFileWithData(path.resolve(data.directory, `client/src/routes/${route}/${route}.styles.ts`), {route}, path.resolve(data.directory, '.genx/templates/route.styles.hbs'));
|
|
29
|
+
})
|
|
30
|
+
|
|
15
31
|
};
|
package/.genx/package.json
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const routesInto = () => console.log(`
|
|
2
|
+
Pages to be added to the navigation header
|
|
3
|
+
`);
|
|
4
|
+
|
|
5
|
+
module.exports = async (inquirer, prevAns = {}) => {
|
|
6
|
+
routesInto();
|
|
7
|
+
const {
|
|
8
|
+
routes = prevAns.routes,
|
|
9
|
+
} = await inquirer.prompt([
|
|
10
|
+
{
|
|
11
|
+
name: 'routes',
|
|
12
|
+
type: 'input',
|
|
13
|
+
message: 'Pages in comma separated format e.g. home,dashboard,admin',
|
|
14
|
+
when: !prevAns.routes,
|
|
15
|
+
default: prevAns.routes || 'home',
|
|
16
|
+
},
|
|
17
|
+
])
|
|
18
|
+
|
|
19
|
+
return {
|
|
20
|
+
routes: routes?.split(','),
|
|
21
|
+
};
|
|
22
|
+
};
|
package/.genx/prompts.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const apiPrompts = require('./prompts/api');
|
|
2
2
|
const genesisServerPrompts = require('./prompts/server');
|
|
3
|
+
const uiPrompts = require('./prompts/ui');
|
|
3
4
|
const {description, license, name, version} = require('./package.json');
|
|
4
5
|
|
|
5
6
|
module.exports = async (inquirer, prevAns = {}) => {
|
|
@@ -12,9 +13,11 @@ module.exports = async (inquirer, prevAns = {}) => {
|
|
|
12
13
|
|
|
13
14
|
const {apiHost, enableSSO} = await apiPrompts(inquirer, prevAns)
|
|
14
15
|
const {groupId, applicationVersion, enableDeployPlugin} = await genesisServerPrompts(inquirer, prevAns);
|
|
16
|
+
const {routes} = await uiPrompts(inquirer, prevAns);
|
|
15
17
|
|
|
16
18
|
return {
|
|
17
19
|
apiHost,
|
|
20
|
+
routes,
|
|
18
21
|
enableSSO,
|
|
19
22
|
groupId,
|
|
20
23
|
applicationVersion,
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { customElement, FASTElement } from '@microsoft/fast-element';
|
|
2
|
+
import { {{pascalCase route}}Styles as styles } from './{{route}}.styles';
|
|
3
|
+
import { {{pascalCase route}}Template as template } from './{{route}}.template';
|
|
4
|
+
|
|
5
|
+
@customElement({
|
|
6
|
+
name: '{{route}}-route',
|
|
7
|
+
template,
|
|
8
|
+
styles,
|
|
9
|
+
})
|
|
10
|
+
export class {{pascalCase route}} extends FASTElement {
|
|
11
|
+
constructor() {
|
|
12
|
+
super();
|
|
13
|
+
}
|
|
14
|
+
}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.3.1](https://github.com/genesiscommunitysuccess/blank-app-seed/compare/v2.3.0...v2.3.1) (2024-03-14)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* add version to gradle.properties. (PBC-101) (#147) bb04aab
|
|
9
|
+
|
|
10
|
+
## [2.3.0](https://github.com/genesiscommunitysuccess/blank-app-seed/compare/v2.2.0...v2.3.0) (2024-03-14)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* route generation GENC-57 (#144) 5374330
|
|
16
|
+
|
|
3
17
|
## [2.2.0](https://github.com/genesiscommunitysuccess/blank-app-seed/compare/v2.1.0...v2.2.0) (2024-03-11)
|
|
4
18
|
|
|
5
19
|
|
|
@@ -8,8 +8,10 @@ import { FoundationRouterConfiguration } from '@genesislcap/foundation-ui';
|
|
|
8
8
|
import { optional } from '@microsoft/fast-foundation';
|
|
9
9
|
import { Route } from '@microsoft/fast-router';
|
|
10
10
|
import { defaultLayout, loginLayout } from '../layouts';
|
|
11
|
-
import { Home } from './home/home';
|
|
12
11
|
import { NotFound } from './not-found/not-found';
|
|
12
|
+
{{#each routes}}
|
|
13
|
+
import { {{pascalCase this}} } from './{{this}}/{{this}}';
|
|
14
|
+
{{/each}}
|
|
13
15
|
|
|
14
16
|
// eslint-disable-next-line
|
|
15
17
|
declare var ENABLE_SSO: string;
|
|
@@ -55,7 +57,7 @@ export class MainRouterConfig extends FoundationRouterConfiguration<LoginSetting
|
|
|
55
57
|
);
|
|
56
58
|
configure(this.container, {
|
|
57
59
|
autoConnect: true,
|
|
58
|
-
defaultRedirectUrl: '
|
|
60
|
+
defaultRedirectUrl: '{{routes.[0]}}',
|
|
59
61
|
...ssoSettings,
|
|
60
62
|
});
|
|
61
63
|
return define({
|
|
@@ -69,22 +71,24 @@ export class MainRouterConfig extends FoundationRouterConfiguration<LoginSetting
|
|
|
69
71
|
settings: { public: true },
|
|
70
72
|
childRouters: true,
|
|
71
73
|
},
|
|
74
|
+
{ path: 'not-found', element: NotFound, title: 'Not Found', name: 'not-found' },
|
|
75
|
+
{{#each routes}}
|
|
72
76
|
{
|
|
73
|
-
path: '
|
|
74
|
-
|
|
75
|
-
title: '
|
|
76
|
-
|
|
77
|
+
path: '{{this}}',
|
|
78
|
+
element: {{pascalCase this}},
|
|
79
|
+
title: '{{sentenceCase this}}',
|
|
80
|
+
name: '{{this}}',
|
|
77
81
|
navItems: [
|
|
78
82
|
{
|
|
79
|
-
title: '
|
|
83
|
+
title: '{{sentenceCase this}}',
|
|
80
84
|
icon: {
|
|
81
|
-
name: '
|
|
85
|
+
name: 'cog',
|
|
82
86
|
variant: 'solid',
|
|
83
87
|
},
|
|
84
88
|
},
|
|
85
89
|
],
|
|
86
90
|
},
|
|
87
|
-
{
|
|
91
|
+
{{/each}}
|
|
88
92
|
);
|
|
89
93
|
|
|
90
94
|
/**
|
package/package.json
CHANGED
package/server/gradle.properties
CHANGED
|
@@ -3,6 +3,7 @@ org.gradle.jvmargs=-Xmx6g -Xss512k -XX:+HeapDumpOnOutOfMemoryError -XX:+UseG1GC
|
|
|
3
3
|
org.gradle.configuration-cache=true
|
|
4
4
|
enableDockerTasks=true
|
|
5
5
|
dockerCompactProcesses=true
|
|
6
|
+
version={{applicationVersion}}
|
|
6
7
|
genesisVersion={{ versions.GSF }}
|
|
7
8
|
authVersion={{ versions.Auth }}
|
|
8
9
|
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { customElement, FASTElement } from '@microsoft/fast-element';
|
|
2
|
-
import { HomeStyles as styles } from './home.styles';
|
|
3
|
-
import { HomeTemplate as template } from './home.template';
|
|
4
|
-
|
|
5
|
-
@customElement({
|
|
6
|
-
name: 'home-route',
|
|
7
|
-
template,
|
|
8
|
-
styles,
|
|
9
|
-
})
|
|
10
|
-
export class Home extends FASTElement {
|
|
11
|
-
constructor() {
|
|
12
|
-
super();
|
|
13
|
-
}
|
|
14
|
-
}
|