@genesislcap/blank-app-seed 2.4.0 → 2.5.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 +10 -5
- package/.genx/package.json +1 -1
- package/.genx/prompts/ui.js +14 -3
- package/.genx/templates/chart.hbs +18 -0
- package/.genx/templates/entityManager.hbs +18 -0
- package/.genx/templates/form.hbs +1 -0
- package/.genx/templates/grid.hbs +9 -0
- package/.genx/templates/route.hbs +4 -4
- package/.genx/templates/route.styles.hbs +1 -1
- package/.genx/templates/route.template.hbs +15 -3
- package/CHANGELOG.md +7 -0
- package/client/src/routes/config.ts +7 -7
- package/package.json +1 -1
package/.genx/configure.js
CHANGED
|
@@ -18,14 +18,19 @@ module.exports = async (data, utils) => {
|
|
|
18
18
|
data.localGenId = data.appName.toUpperCase().replace("-", "_");
|
|
19
19
|
data.applicationVersionWeb = data.applicationVersion.split('-').shift();
|
|
20
20
|
data.versions = versions;
|
|
21
|
+
|
|
22
|
+
utils.registerPartial('smart-form', path.resolve(data.directory, '.genx/templates/form.hbs'))
|
|
23
|
+
utils.registerPartial('chart', path.resolve(data.directory, '.genx/templates/chart.hbs'))
|
|
24
|
+
utils.registerPartial('entity-manager', path.resolve(data.directory, '.genx/templates/entityManager.hbs'))
|
|
25
|
+
utils.registerPartial('grid-pro', path.resolve(data.directory, '.genx/templates/grid.hbs'))
|
|
21
26
|
// to be exposed via user prompt in the future
|
|
22
27
|
data.useDocker = !!process.env.USE_DOCKER;
|
|
23
28
|
data.routes.forEach(route => {
|
|
24
|
-
|
|
25
|
-
makeDirectory(path.resolve(data.directory,`client/src/routes/${
|
|
26
|
-
utils.writeFileWithData(path.resolve(data.directory, `client/src/routes/${
|
|
27
|
-
utils.writeFileWithData(path.resolve(data.directory, `client/src/routes/${
|
|
28
|
-
utils.writeFileWithData(path.resolve(data.directory, `client/src/routes/${
|
|
29
|
+
const routeName = route.name;
|
|
30
|
+
makeDirectory(path.resolve(data.directory,`client/src/routes/${routeName}`));
|
|
31
|
+
utils.writeFileWithData(path.resolve(data.directory, `client/src/routes/${routeName}/${routeName}.ts`), {route}, path.resolve(data.directory, '.genx/templates/route.hbs'));
|
|
32
|
+
utils.writeFileWithData(path.resolve(data.directory, `client/src/routes/${routeName}/${routeName}.template.ts`), {route}, path.resolve(data.directory, '.genx/templates/route.template.hbs'));
|
|
33
|
+
utils.writeFileWithData(path.resolve(data.directory, `client/src/routes/${routeName}/${routeName}.styles.ts`), {route}, path.resolve(data.directory, '.genx/templates/route.styles.hbs'));
|
|
29
34
|
})
|
|
30
35
|
|
|
31
36
|
};
|
package/.genx/package.json
CHANGED
package/.genx/prompts/ui.js
CHANGED
|
@@ -2,6 +2,8 @@ const routesInto = () => console.log(`
|
|
|
2
2
|
Pages to be added to the navigation header
|
|
3
3
|
`);
|
|
4
4
|
|
|
5
|
+
const defaultRoutes = '[{"name":"home"}]';
|
|
6
|
+
|
|
5
7
|
module.exports = async (inquirer, prevAns = {}) => {
|
|
6
8
|
routesInto();
|
|
7
9
|
const {
|
|
@@ -10,13 +12,22 @@ module.exports = async (inquirer, prevAns = {}) => {
|
|
|
10
12
|
{
|
|
11
13
|
name: 'routes',
|
|
12
14
|
type: 'input',
|
|
13
|
-
message: 'Pages in
|
|
15
|
+
message: 'Pages config in json format',
|
|
14
16
|
when: !prevAns.routes,
|
|
15
|
-
default:
|
|
17
|
+
default: defaultRoutes,
|
|
16
18
|
},
|
|
17
19
|
])
|
|
18
20
|
|
|
21
|
+
let routesParsed;
|
|
22
|
+
try {
|
|
23
|
+
routesParsed = JSON.parse(routes);
|
|
24
|
+
} catch (error) {
|
|
25
|
+
console.error("Error parsing `routes` parameter as JSON:", error.message);
|
|
26
|
+
console.log("Falling back to the default routes value");
|
|
27
|
+
routesParsed = JSON.parse(defaultRoutes);
|
|
28
|
+
}
|
|
29
|
+
|
|
19
30
|
return {
|
|
20
|
-
routes:
|
|
31
|
+
routes: routesParsed,
|
|
21
32
|
};
|
|
22
33
|
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<zero-g2plot-chart
|
|
2
|
+
type="{{ config.type }}"
|
|
3
|
+
:config="${(x) => ({
|
|
4
|
+
{{#ifEquals config.type "pie"}}
|
|
5
|
+
radius: 0.75,
|
|
6
|
+
angleField: 'value',
|
|
7
|
+
colorField: 'groupBy',
|
|
8
|
+
{{else}}
|
|
9
|
+
xField: 'groupBy',
|
|
10
|
+
yField: 'value',
|
|
11
|
+
{{/ifEquals}}
|
|
12
|
+
})}"
|
|
13
|
+
>
|
|
14
|
+
<chart-datasource
|
|
15
|
+
resourceName="{{ config.resourceName }}"
|
|
16
|
+
server-fields="{{ config.xField }} {{ config.yField }}"
|
|
17
|
+
></chart-datasource>
|
|
18
|
+
</zero-g2plot-chart>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<entity-management
|
|
2
|
+
{{#if config.title}}
|
|
3
|
+
title="{{ config.title }}"
|
|
4
|
+
{{/if}}
|
|
5
|
+
resourceName="{{ config.resourceName }}"
|
|
6
|
+
{{#if config.updateEvent}}
|
|
7
|
+
updateEvent="{{ config.updateEvent }}"
|
|
8
|
+
{{/if}}
|
|
9
|
+
{{#if config.deleteEvent}}
|
|
10
|
+
deleteEvent="{{ config.deleteEvent }}"
|
|
11
|
+
{{/if}}
|
|
12
|
+
{{#if config.createEvent}}
|
|
13
|
+
createEvent="{{ config.createEvent }}"
|
|
14
|
+
{{/if}}
|
|
15
|
+
{{#if config.snapshot}}
|
|
16
|
+
:datasourceConfig="${() => ({isSnapshot: {{ config.snapshot }} })}"
|
|
17
|
+
{{/if}}
|
|
18
|
+
></entity-management>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<foundation-form resourceName="{{config.resourceName}}"></foundation-form>
|
|
@@ -1,13 +1,13 @@
|
|
|
1
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';
|
|
2
|
+
import { {{pascalCase route.name}}Styles as styles } from './{{route.name}}.styles';
|
|
3
|
+
import { {{pascalCase route.name}}Template as template } from './{{route.name}}.template';
|
|
4
4
|
|
|
5
5
|
@customElement({
|
|
6
|
-
name: '{{route}}-route',
|
|
6
|
+
name: '{{route.name}}-route',
|
|
7
7
|
template,
|
|
8
8
|
styles,
|
|
9
9
|
})
|
|
10
|
-
export class {{pascalCase route}} extends FASTElement {
|
|
10
|
+
export class {{pascalCase route.name}} extends FASTElement {
|
|
11
11
|
constructor() {
|
|
12
12
|
super();
|
|
13
13
|
}
|
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
import { html } from '@microsoft/fast-element';
|
|
2
|
-
import type { {{pascalCase route}} } from './{{route}}';
|
|
2
|
+
import type { {{pascalCase route.name}} } from './{{route.name}}';
|
|
3
3
|
|
|
4
|
-
export const {{pascalCase route}}Template = html<{{pascalCase route}}>`
|
|
4
|
+
export const {{pascalCase route.name}}Template = html<{{pascalCase route.name}}>`
|
|
5
|
+
{{#if route.tiles}}
|
|
6
|
+
<zero-layout auto-save-key="{{route.name}}">
|
|
7
|
+
<zero-layout-region>
|
|
8
|
+
{{#each route.tiles}}
|
|
9
|
+
<zero-layout-item title="{{this.title}}">
|
|
10
|
+
{{> (lookup . 'type') }}
|
|
11
|
+
</zero-layout-item>
|
|
12
|
+
{{/each}}
|
|
13
|
+
</zero-layout-region>
|
|
14
|
+
</zero-layout>
|
|
15
|
+
{{else}}
|
|
5
16
|
<!-- insert template code here -->
|
|
6
|
-
Welcome to {{route}}
|
|
17
|
+
Welcome to {{sentenceCase route.name}}
|
|
18
|
+
{{/if}}
|
|
7
19
|
`;
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.5.0](https://github.com/genesiscommunitysuccess/blank-app-seed/compare/v2.4.0...v2.5.0) (2024-03-15)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* routes and components generation GENC-68 (#149) d85c86d
|
|
9
|
+
|
|
3
10
|
## [2.4.0](https://github.com/genesiscommunitysuccess/blank-app-seed/compare/v2.3.2...v2.4.0) (2024-03-15)
|
|
4
11
|
|
|
5
12
|
|
|
@@ -10,7 +10,7 @@ import { Route } from '@microsoft/fast-router';
|
|
|
10
10
|
import { defaultLayout, loginLayout } from '../layouts';
|
|
11
11
|
import { NotFound } from './not-found/not-found';
|
|
12
12
|
{{#each routes}}
|
|
13
|
-
import { {{pascalCase this}} } from './{{this}}/{{this}}';
|
|
13
|
+
import { {{pascalCase this.name}} } from './{{this.name}}/{{this.name}}';
|
|
14
14
|
{{/each}}
|
|
15
15
|
|
|
16
16
|
// eslint-disable-next-line
|
|
@@ -57,7 +57,7 @@ export class MainRouterConfig extends FoundationRouterConfiguration<LoginSetting
|
|
|
57
57
|
);
|
|
58
58
|
configure(this.container, {
|
|
59
59
|
autoConnect: true,
|
|
60
|
-
defaultRedirectUrl: '{{routes.[0]}}',
|
|
60
|
+
defaultRedirectUrl: '{{routes.[0].name}}',
|
|
61
61
|
...ssoSettings,
|
|
62
62
|
});
|
|
63
63
|
return define({
|
|
@@ -74,13 +74,13 @@ export class MainRouterConfig extends FoundationRouterConfiguration<LoginSetting
|
|
|
74
74
|
{ path: 'not-found', element: NotFound, title: 'Not Found', name: 'not-found' },
|
|
75
75
|
{{#each routes}}
|
|
76
76
|
{
|
|
77
|
-
path: '{{this}}',
|
|
78
|
-
element: {{pascalCase this}},
|
|
79
|
-
title: '{{sentenceCase this}}',
|
|
80
|
-
name: '{{this}}',
|
|
77
|
+
path: '{{this.name}}',
|
|
78
|
+
element: {{pascalCase this.name}},
|
|
79
|
+
title: '{{sentenceCase this.name}}',
|
|
80
|
+
name: '{{this.name}}',
|
|
81
81
|
navItems: [
|
|
82
82
|
{
|
|
83
|
-
title: '{{sentenceCase this}}',
|
|
83
|
+
title: '{{sentenceCase this.name}}',
|
|
84
84
|
icon: {
|
|
85
85
|
name: 'cog',
|
|
86
86
|
variant: 'solid',
|