Project Structure
The project follows a specific structure to ensure consistency in the development and maintenance process.
Source code is located in the source
folder, and compiled code is in the lib
folder.
Source Code Structure
Section titled “Source Code Structure”The source code is divided into modules, which are located in folders inside the source
folder:
colors-css
— modules that implement colorscommon-css
— modules that implement common stylescommon-js
— modules that implement common functionscomponents
— modules that implement componentscore
— modules that implement the core of the librarydatetime
— module that implements components for working with date and timedom
— module that implements components for working with DOMextensions
— modules that implement extensions of standard JavaScript objectsfarbe
— module that implements color functionalityguardian
— module that implements data validation functionshooks
— modules that implement hooks (useMemo
,useState
,useEffect
, etc.)html
— modules that implement functions for creating HTML elements in JavaScripti18n
— modules that implement functions for working with localizationicons
— modules that implement functions for working with iconsinclude
— LESS modules that implement style variables and mixinsmodel
— module that implements functions for working with reactive data modelreset
— module that implements style resetsrouter
— module that implements functions for working with routing for SPAstring
— module that implements functions for working with strings
Individual files in the source
folder:
index.js
— entry point for bundlers, includes all components and styles in the buildi18n.js
— entry point for bundlers, includes all localizationsicons.js
— entry point for bundlers, includes all iconsruntime.js
— entry point for bundlers, includes in the build all functions that are not components and stylesdefault.js
— entry point for bundlers, includes in the buildreset
,common{css,js}
,i18n
,runtime
, and allcomponent
Components
Section titled “Components”Each component has its own folder, which contains files index.js
, [component-name].less
, [component-name].js
.
Also, in the component folder, there may be additional component inclusions that are used by the current component.
Color Styles
Section titled “Color Styles”Color styles are located in the colors-css
folder. Each file represents a separate module with classes that implement one specific behavior.
Common Styles
Section titled “Common Styles”Common styles are located in the common-css
folder. Each file represents a separate module with classes that implement one specific behavior.
Common Functions
Section titled “Common Functions”Common functions are located in the common-js
folder. The file contains various functions that are not components or styles, but are used in different components.
External Modules
Section titled “External Modules”In folders: dom
, html
, datetime
, farbe
, guardian
, hooks
, model
, router
, and string
are functions that connect third-party modules for use with Metro UI.
Library Core
Section titled “Library Core”In the core
folder are modules that implement the core of the library and the global namespace Metro
.