@hortiview/generator-hortiview
v2.0.18091
Published
Generator for a HortiView module-template.
Keywords
Readme
HortiView Template-Generator
This yeoman-generator creates the scaffolding for a HortiView-module.
The module is based on RSBuild and React Version 18.3.1.
It uses the @hortiview/modulebase to implement everything, that is required to make the module work with Bayers HortiView.
The generator creates template structure with examples for pages, access to module api data and custom apis.
Via the @hortiview/modulebase, the routing, localization and access to any of the backend-services is handles.
The template currently doesn't use the @hortiview/shared-components, but will do in the next update.
Features
Routing- the routing works fully integrated with HortiViewBreadcrumb- the breadcrumb of HortiView will be updated automaticallyLocalization- language switch in HortiView will be detected by the module as wellBackend-Servicewrapper- You can access module- and common-api data via the useEntity- and useCommon-Hooks, that are provided by the @hortiview/modulebaseautomatic error handling and logging- errors are handled by the ModuleBase-Component, that is the entry-point of a module
Installation
You need to install yeoman-generator:
npm install -g yoThen you need to install the generator itself. It should be installed globally:
npm i -g @hortiview/generator-hortiviewWe recommend to install yarn as package-manager:
npm install -g yarnHow to use the generator?
After installing the dependencies, you can call the generator with
yo.
You should call this inside a newly created folder for project, e.g.: (create a folder)
e.g.mkdir your-project(call the generator)
yo @hortiview/hortiviewAnwser the question for a project-name:
e.g.Your ProjectAfter entering the project-name the generator creates all config files, scaffoldings and installs the depedencies
via yarn.
When the installation is done, everything is set up and you can start the project.
Getting started after generating a template
You can use yarn start:dev to start the project with the debug-configuration.
When doint this, the project will run on port 3001 - it will also automatically open the test-environment and try to load the LocalDebug-Module.
You need to be logged in and need to have the localdebug-module installed.
For a full guide, please take a look on the Documentation
How to provide the solution in HortiView after development?
To create a fully builded module, that can be uploaded to HortiView as a module; You need to run yarn build to create a builded module, that can be uploaded..
This build uses the hvconfig.json-file, you can adjust the names in that file, if you like, but they will be "preset" by the generator.
