Project Config Function
The project config function is used to validate the Project Configuration File using command line statements.
To validate the project configuration, go to the command prompt or terminal of the template project and execute ch5-shell-cli validate:projectconfig or npm run validate:projectconfig. The validate:projectconfig and val:pc NPM one-click scripts can also be selected from within Visual Studio Code as shown below.
Based on the responses, the output is classified into errors and warnings. The project-config.json is validated for the following cases:
- Validate project-config.json based on project-config-schema.json.
- Verify if the pages defined in project-config.json exists in the physical folders.
- Verify if the widgets defined in project-config.json exists in the physical folders.
- Verify if the pages names are repeated in project-config.json.
- Check if the widget names are repeated in project-config.json.
- Check if the page sequences are repeated.
- Check if the theme name is not available in the list of mentioned themes.
- Check if the theme name is repeated in the themes array.
- If menuOrientation is either 'vertical' or 'horizontal', then check if at least one navigation item exists in the pages list.
- Check if the menuOrientation is 'vertical', and if there is an 'IconPosition' defined for navigation.
- Check if the menuOrientation is 'vertical', and if the menu is displayed.
- Check if the pages array is empty.
- Check if page names are reused in widgets and vice-versa.
- Check that a defaultLanguage parameter is defined for the project.
This validation will review the settings in the project configuration file and inform the developer of any invalid configuration before running the browser or running on the touch screen. During the 'start' and 'build' process, this script will be executed and if there are errors (not warnings), the script will not continue to the next step.