Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restructure the Utils Folder #212

Open
5 tasks done
mahid797 opened this issue Feb 20, 2025 · 0 comments · May be fixed by #233
Open
5 tasks done

Restructure the Utils Folder #212

mahid797 opened this issue Feb 20, 2025 · 0 comments · May be fixed by #233
Assignees
Labels
Cleanup Tasks for removing clutter and improving project structure. 🌱Nice-to-Have Enhancements, Refactors, UI tweaks, or non-critical optimizations
Milestone

Comments

@mahid797
Copy link
Collaborator

mahid797 commented Feb 20, 2025

The utilities in the project are currently scattered and inconsistent, making them hard to
locate and maintain. This issue focuses on organizing utilities into domain-focused files and
creating a centralized export point for easier imports.


Tasks

  • Create domain-specific utility files:

    • fileUtils.ts: File-related utilities (size conversion, extensions).
    • dateUtils.ts: Date formatting and manipulation functions.
    • validators.ts: Input and form validators.
    • stringUtils.ts: String manipulation helpers.
  • Add an index.ts in the utils/ folder to re-export all utilities.

  • Remove redundant or outdated utility functions.

  • Locate and add new utility functions used across the application (e.g., name splitting, file size formatting) to the appropriate utility files.

    📝 What is a utility function?
    Utility functions are stateless helper functions designed to perform common, reusable operations such as string manipulation, date formatting, file handling, or data validation.

  • Update all imports across the project to use the reorganized structure.


Proposed Directory Structure

src/shared/
└── utils/
    ├── fileUtils.ts
    ├── dateUtils.ts
    ├── validators.ts
    ├── stringUtils.ts
    └── index.ts  // Re-exports for cleaner imports

Guidelines

Keep utility files small and focused on a single concern.
Centralize exports to avoid deep import paths.
Remove unused functions to prevent bloat.


Benefits

Faster navigation through organized files.
✅ Easier to maintain and extend utilities.
Cleaner imports (e.g., import { formatFileSize } from '@/utils';).

@mahid797 mahid797 added the Cleanup Tasks for removing clutter and improving project structure. label Feb 20, 2025
@mahid797 mahid797 added this to the v0.1 milestone Feb 20, 2025
@mahid797 mahid797 added the 🌱Nice-to-Have Enhancements, Refactors, UI tweaks, or non-critical optimizations label Feb 22, 2025
@SepidehShahbazi SepidehShahbazi linked a pull request Feb 25, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cleanup Tasks for removing clutter and improving project structure. 🌱Nice-to-Have Enhancements, Refactors, UI tweaks, or non-critical optimizations
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants