π¦ Depedencies
Centralized Dependency Export
π§ What is this file?β
The depts.ts file serves as a centralized entry point for all major external and internal dependencies used throughout the project.
Rather than importing dependencies from their original paths in every file, we group and re-export them here, under a single unified module. This improves maintainability, readability, and scalability of the codebase.
π Why is it useful?β
- β Simplified imports: Avoid deep or repetitive import paths across the codebase.
- π§Ή Cleaner project structure: Centralizes third-party and internal module references.
- π οΈ Easy updates: If a library path changes or is swapped out, only one file needs to be updated.
- π§ Better navigation: Developers can quickly see all major dependencies in one place.
π§ How to use it
Thanks to a Webpack/Vite alias (@depts), any file in the project can import dependencies like this:
import { uuid, vvComponents, vvAPI, vvExcel } from '@depts';
warning
No need to write:
import { v4 as uuidv4 } from 'uuid';
import { Button } from '@infrasoftbe/infrasoft-ui-components';
import { fetchSomething } from '@infrasoftbe/infrasoft-vnv-api-kit';
π Dependencies includedβ
Alias | Source Package | Description |
---|---|---|
uuid | uuid | UUID generation utilities |
vvComponents | @infrasoftbe/infrasoft-ui-components | Infrasoftβs internal UI component library |
vvAPI | @infrasoftbe/infrasoft-vnv-api-kit | API client for VnV tool |
vvExcel | @infrasoftbe/infrasoft-vnv-excel-generator | Excel export/generation tools |