@haulmont/jmix-generator-example
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

Custom jmix front generator

This project is an example of creating and usage custom generator for jmix frontend. Generator can create screens with bar chart, line chart or pie chart and add it to app frontend module. Note that generated screens required extra dependencies that will not be added automatically by a generator. If app doesn't contain @haulmont/jmix-addon-charts in package.json, dependencies should be installed via npm

npm install @haulmont/jmix-addon-charts

Build

npm run build

After build, generators: react-typescript:bar-chart, react-typescript:line-chart, react-typescript:pie-chart will be available in dist folder and could be used in gen-jmix-front by passing folder to custom-generator-paths argument

npx gen-jmix-front react-typescript:bar-chart --custom-generator-paths jmix-front-generator-example/dist

Usage in jmix project

Note that all commands below should be executed in fontend module folder of jmix-project.

  • install generator
npm install @haulmont/jmix-generator-example --prefix generation --save-dev
  • generate line-chart screen, type LineChart as component name and menu item answers
node generation/node_modules/@haulmont/jmix-front-generator/bin/gen-jmix-front.js react-typescript:line-chart --custom-generator-paths generation/node_modules/@haulmont/jmix-generator-example/dist --model generation/projectModel.json --dest src/app --dirShift ../
  • install charts deps in app if they are not installed yet
npm install @haulmont/jmix-addon-charts

Start fronted app. Chart screen will be available at http://localhost:3000/chart

Readme

Keywords

none

Package Sidebar

Install

npm i @haulmont/jmix-generator-example

Weekly Downloads

1

Version

1.1.0

License

Apache-2.0

Unpacked Size

49.6 kB

Total Files

42

Last publish

Collaborators

  • cuba-platform