# cob-cli customize command
cob-cli customize
There are multiple available customizations that a server can make use of. These are interactively chosen and installed by running cob-cli customize inside the server directory (aka the local repository). Once you run this command, the list of available customizations will be shown, allowing the user to select one or more to add to the server.
Each individual customization has its own public Github repository, which can be found in CoB's Github (opens new window), with the name format customization.<category>.<customization_name>
.
When the user runs the command, they will be prompted with the following interactive menu, where they can select the customizations to apply, show below:
Customize...
? What customization do you want to apply? (Press <space> to select, <a> to toggle all, <i> to invert selection)
❯◯ customize.backend.governance
◯ customize.backend.vuepress
◯ customize.dashboard.dash
◯ customize.dashboard.html_page_base
◯ customize.dashboard.vue_base
◯ customize.frontend.common
◯ customize.frontend.style.currency
(Move up and down to reveal more choices)
Depending on the choice made, additional details might be requested. After selecting the customizations, cob-cli customize will pull the files from each respective repository and merge them into the server's structure. However, before pulling the customization's files, cob-cli will check if you have a clean working repository. If it finds that the user has uncommited changes or is behind (akin to outdated) the most recent commit/version of the server repository, it will show an error abort the process - followed by sugestions on what you should do for each case.
Each customization's folder structure will match part of the server's structure - meaning that when a customization's files are pulled, they are directly put inside their respective folders IN the server's directory. Refer to the following example:
Example - Training Server Folder Structure:
environments/
integrationm/
others/
recordm/
|-- customUI/
|-- css/
|-- customizations.css
|-- (...)
|-- js/
|-- customizations2.js
|-- (...)
|-- (...)
recordm-importer/
reportm/
userm/
Dash Customization Folder Structure
others/
recordm/
|--customUI/
|-- css/
|-- dash/
|-- js/
|-- (...)
customize-js
When choosing the Dash customization, its files will be pulled from the repository, and "merged" (copied) into the server's matching folder structure. For example customize.dashboard.dash/recordm/customUI
gets copied into server_training/recordm/customUI
.
Posteriorly, for every added customizations, their respective .css and .js main files are registered in (respectively) the server's .../recordm/customUI/css/customizations.css
and .../recordm/customUI/js/customizations2.js
files.
Moreover, every customization has a file in their root directory called customize.js
, this file has the semantic version of the customization. When a customization is fetched with the cob-cli customize <customization_name>
, the version of the customization
is also registered in the file customizations.json, which is in the root folder of the server where we are applying the customization.