@genesislcap/blank-app-seed 2.3.2 → 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.
Files changed (22) hide show
  1. package/.genx/configure.js +10 -5
  2. package/.genx/package.json +3 -2
  3. package/.genx/prompts/ui.js +14 -3
  4. package/.genx/templates/chart.hbs +18 -0
  5. package/.genx/templates/entityManager.hbs +18 -0
  6. package/.genx/templates/form.hbs +1 -0
  7. package/.genx/templates/grid.hbs +9 -0
  8. package/.genx/templates/route.hbs +4 -4
  9. package/.genx/templates/route.styles.hbs +1 -1
  10. package/.genx/templates/route.template.hbs +15 -3
  11. package/.gitignore +1 -4
  12. package/.idea/kotlinc.xml +13 -0
  13. package/.idea/modules/server/build/internal-modules/{{appName}}-dictionary-cache/{{appName}}-generated-dao/genesisproduct-{{appName}}.{{appName}}-dictionary-cache.{{appName}}-generated-dao.main.iml +8 -0
  14. package/.idea/modules/server/build/internal-modules/{{appName}}-dictionary-cache/{{appName}}-generated-fields/genesisproduct-{{appName}}.{{appName}}-dictionary-cache.{{appName}}-generated-fields.iml +8 -0
  15. package/.idea/modules/server/build/internal-modules/{{appName}}-dictionary-cache/{{appName}}-generated-fields/genesisproduct-{{appName}}.{{appName}}-dictionary-cache.{{appName}}-generated-fields.main.iml +8 -0
  16. package/.idea/modules/server/build/internal-modules/{{appName}}-generated-hft/genesisproduct-{{appName}}.{{appName}}-dictionary-cache.{{appName}}-generated-hft.iml +8 -0
  17. package/.idea/modules/server/build/internal-modules/{{appName}}-generated-sysdef/genesisproduct-{{appName}}.{{appName}}-dictionary-cache.{{appName}}-generated-sysdef.iml +8 -0
  18. package/.idea/modules/server/build/internal-modules/{{appName}}-generated-view/genesisproduct-{{appName}}.{{appName}}-dictionary-cache.{{appName}}-generated-view.iml +8 -0
  19. package/.idea/modules.xml +9 -0
  20. package/CHANGELOG.md +14 -0
  21. package/client/src/routes/config.ts +7 -7
  22. package/package.json +1 -1
@@ -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 = 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.3.2",
4
+ "version": "2.5.0",
5
5
  "license": "Apache-2.0",
6
6
  "genxSeedConfig": {
7
7
  "exclude": [
@@ -41,7 +41,8 @@
41
41
  ".properties",
42
42
  ".html",
43
43
  ".gitignore",
44
- ".xml"
44
+ ".xml",
45
+ ".iml"
45
46
  ]
46
47
  }
47
48
  }
@@ -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 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
+ 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: routes?.split(','),
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>
@@ -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 './{{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,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/.gitignore CHANGED
@@ -18,7 +18,6 @@ pids
18
18
  .env.*
19
19
 
20
20
  # Editor directories and files
21
- .idea
22
21
  .vscode
23
22
  !.vscode/settings.json
24
23
  *.suo
@@ -30,15 +29,13 @@ pids
30
29
 
31
30
  # Development
32
31
  target/
32
+ build/
33
33
  .settings/
34
34
  .project
35
35
  .classpath
36
36
  *.ignore
37
- *.iml
38
37
  *~
39
38
  .gradle
40
- **/build/
41
- !src/**/build/
42
39
  client/bootstrapDone
43
40
  .husky/.gitignore
44
41
  build-cache/
@@ -0,0 +1,13 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="Kotlin2JvmCompilerArguments">
4
+ <option name="jvmTarget" value="17" />
5
+ </component>
6
+ <component name="KotlinCommonCompilerArguments">
7
+ <option name="apiVersion" value="1.9" />
8
+ <option name="languageVersion" value="1.9" />
9
+ </component>
10
+ <component name="KotlinJpsPluginSettings">
11
+ <option name="version" value="1.9.10" />
12
+ </component>
13
+ </project>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module version="4">
3
+ <component name="AdditionalModuleElements">
4
+ <content url="file://$MODULE_DIR$/../../../../../../../server/build/internal-modules/{{appName}}-dictionary-cache/{{appName}}-generated-dao/build/generated/resources" dumb="true">
5
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../../server/build/internal-modules/{{appName}}-dictionary-cache/{{appName}}-generated-dao/build/generated/resources" />
6
+ </content>
7
+ </component>
8
+ </module>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module version="4">
3
+ <component name="AdditionalModuleElements">
4
+ <content url="file://$MODULE_DIR$/../../../../../../../server/build/internal-modules/{{appName}}-dictionary-cache/{{appName}}-generated-fields" dumb="true">
5
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../../server/build/internal-modules/{{appName}}-dictionary-cache/{{appName}}-generated-fields" />
6
+ </content>
7
+ </component>
8
+ </module>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module version="4">
3
+ <component name="AdditionalModuleElements">
4
+ <content url="file://$MODULE_DIR$/../../../../../../../server/build/internal-modules/{{appName}}-dictionary-cache/{{appName}}-generated-fields/build/generated/resources" dumb="true">
5
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../../server/build/internal-modules/{{appName}}-dictionary-cache/{{appName}}-generated-fields/build/generated/resources" />
6
+ </content>
7
+ </component>
8
+ </module>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module version="4">
3
+ <component name="AdditionalModuleElements">
4
+ <content url="file://$MODULE_DIR$/../../../../../../../server/build/internal-modules/{{appName}}-dictionary-cache/{{appName}}-generated-hft" dumb="true">
5
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../../server/build/internal-modules/{{appName}}-dictionary-cache/{{appName}}-generated-hft" />
6
+ </content>
7
+ </component>
8
+ </module>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module version="4">
3
+ <component name="AdditionalModuleElements">
4
+ <content url="file://$MODULE_DIR$/../../../../../../../server/build/internal-modules/{{appName}}-dictionary-cache/{{appName}}-generated-sysdef" dumb="true">
5
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../../server/build/internal-modules/{{appName}}-dictionary-cache/{{appName}}-generated-sysdef" />
6
+ </content>
7
+ </component>
8
+ </module>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module version="4">
3
+ <component name="AdditionalModuleElements">
4
+ <content url="file://$MODULE_DIR$/../../../../../../../server/build/internal-modules/{{appName}}-dictionary-cache/{{appName}}-generated-view" dumb="true">
5
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../../server/build/internal-modules/{{appName}}-dictionary-cache/{{appName}}-generated-view" />
6
+ </content>
7
+ </component>
8
+ </module>
@@ -0,0 +1,9 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/modules/server/build/internal-modules/{{appName}}-dictionary-cache/{{appName}}-generated-dao/genesisproduct-{{appName}}.{{appName}}-dictionary-cache.{{appName}}-generated-dao.main.iml" filepath="$PROJECT_DIR$/.idea/modules/server/build/internal-modules/{{appName}}-dictionary-cache/{{appName}}-generated-dao/genesisproduct-{{appName}}.{{appName}}-dictionary-cache.{{appName}}-generated-dao.main.iml" />
6
+ <module fileurl="file://$PROJECT_DIR$/.idea/modules/server/build/internal-modules/{{appName}}-dictionary-cache/{{appName}}-generated-fields/genesisproduct-{{appName}}.{{appName}}-dictionary-cache.{{appName}}-generated-fields.main.iml" filepath="$PROJECT_DIR$/.idea/modules/server/build/internal-modules/{{appName}}-dictionary-cache/{{appName}}-generated-fields/genesisproduct-{{appName}}.{{appName}}-dictionary-cache.{{appName}}-generated-fields.main.iml" />
7
+ </modules>
8
+ </component>
9
+ </project>
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
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
+
10
+ ## [2.4.0](https://github.com/genesiscommunitysuccess/blank-app-seed/compare/v2.3.2...v2.4.0) (2024-03-15)
11
+
12
+
13
+ ### Features
14
+
15
+ * shipping intellij in order to improve inntelisense experience (#148) 6634a34
16
+
3
17
  ## [2.3.2](https://github.com/genesiscommunitysuccess/blank-app-seed/compare/v2.3.1...v2.3.2) (2024-03-14)
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 './{{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',
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.3.2",
4
+ "version": "2.5.0",
5
5
  "license": "Apache-2.0",
6
6
  "scripts": {
7
7
  "release": "semantic-release"