@genesislcap/blank-app-seed 2.4.0 → 2.5.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.
@@ -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
- // 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
+ const routeName = utils.changeCase.paramCase(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
  };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/blank-app-seed-config",
3
3
  "description": "Genesis Blank App Seed Configuration",
4
- "version": "2.4.0",
4
+ "version": "2.5.1",
5
5
  "license": "Apache-2.0",
6
6
  "genxSeedConfig": {
7
7
  "exclude": [
@@ -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,26 @@ module.exports = async (inquirer, prevAns = {}) => {
10
12
  {
11
13
  name: 'routes',
12
14
  type: 'input',
13
- message: 'Pages in comma separated format e.g. home,dashboard,admin',
15
+ message: 'Pages config in json format',
14
16
  when: !prevAns.routes,
15
- default: prevAns.routes || 'home',
17
+ default: defaultRoutes,
16
18
  },
17
19
  ])
18
20
 
21
+ let routesParsed;
22
+ if (routes) {
23
+ try {
24
+ routesParsed = JSON.parse(routes);
25
+ } catch (error) {
26
+ console.error("Error parsing `routes` parameter as JSON:", error.message);
27
+ console.log("Falling back to the default routes value");
28
+ routesParsed = JSON.parse(defaultRoutes);
29
+ }
30
+ } else {
31
+ routesParsed = JSON.parse(defaultRoutes);
32
+ }
33
+
19
34
  return {
20
- routes: routes?.split(','),
35
+ routes: routesParsed,
21
36
  };
22
37
  };
@@ -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>
@@ -0,0 +1,9 @@
1
+ <zero-grid-pro>
2
+ <grid-pro-genesis-datasource
3
+ resource-name="{{config.resourceName}}"
4
+ {{#if config.snapshot}}
5
+ isSnapshot="{{config.snapshot}}"
6
+ {{/if}}
7
+ >
8
+ </grid-pro-genesis-datasource>
9
+ </zero-grid-pro>
@@ -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 './{{kebabCase route.name}}.styles';
3
+ import { {{pascalCase route.name}}Template as template } from './{{kebabCase route.name}}.template';
4
4
 
5
5
  @customElement({
6
- name: '{{route}}-route',
6
+ name: '{{kebabCase 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,6 +1,6 @@
1
1
  import { css } from '@microsoft/fast-element';
2
2
 
3
- export const {{pascalCase route}}Styles = css`
3
+ export const {{pascalCase route.name}}Styles = css`
4
4
  :host {
5
5
  /* insert css styles here */
6
6
  }
@@ -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,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.5.1](https://github.com/genesiscommunitysuccess/blank-app-seed/compare/v2.5.0...v2.5.1) (2024-03-19)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * consistent route file and web component naming GENC-176 (#151) 14a3b2a
9
+
10
+ ## [2.5.0](https://github.com/genesiscommunitysuccess/blank-app-seed/compare/v2.4.0...v2.5.0) (2024-03-15)
11
+
12
+
13
+ ### Features
14
+
15
+ * routes and components generation GENC-68 (#149) d85c86d
16
+
3
17
  ## [2.4.0](https://github.com/genesiscommunitysuccess/blank-app-seed/compare/v2.3.2...v2.4.0) (2024-03-15)
4
18
 
5
19
 
@@ -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 './{{kebabCase this.name}}/{{kebabCase 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: '{{kebabCase 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: '{{kebabCase this.name}}',
78
+ element: {{pascalCase this.name}},
79
+ title: '{{sentenceCase this.name}}',
80
+ name: '{{kebabCase 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',
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": "2.4.0",
4
+ "version": "2.5.1",
5
5
  "license": "Apache-2.0",
6
6
  "scripts": {
7
7
  "release": "semantic-release"
@@ -1,8 +1,8 @@
1
1
  systemDefinition {
2
2
  global {
3
3
  item(name = "DbLayer", value = "SQL")
4
- item(name = "DictionarySource", value = "FILE")
5
- item(name = "DbHost", value = "jdbc:h2:file:./server/h2/test;DB_CLOSE_DELAY=-1;NON_KEYWORDS=VALUE,KEY;AUTO_SERVER=TRUE")
4
+ item(name = "DictionarySource", value = "DB")
5
+ item(name = "DbHost", value = "jdbc:h2:file:~/{{appName}}/server/h2/test;DB_CLOSE_DELAY=-1;NON_KEYWORDS=VALUE,KEY;AUTO_SERVER=TRUE")
6
6
  item(name = "DbQuotedIdentifiers", value = true)
7
7
  item(name = "DEPLOYED_PRODUCT", value = "{{appName}}")
8
8
  item(name = "MqLayer", value = env["MQ_LAYER", "ZeroMQ"])