Skip to content

Refactored imports#11

Merged
upayanmazumder merged 3 commits intoGDGVIT:devfrom
upayanmazumder-DevLabs:dev
Oct 21, 2025
Merged

Refactored imports#11
upayanmazumder merged 3 commits intoGDGVIT:devfrom
upayanmazumder-DevLabs:dev

Conversation

@upayanmazumder
Copy link
Member

This pull request primarily reorganizes import statements across many files in the API codebase to ensure a more consistent and logical order. The changes improve code readability and maintainability by grouping related imports together and following best practices for import ordering. No functional code changes were made.

Key changes include:

Import Order and Grouping Improvements:

  • Moved env imports and other configuration imports to the top of files, before model and utility imports, in multiple controllers and strategy files for better clarity and convention. [1] [2] [3] [4] [5] [6] [7]
  • Ensured that type-only imports (e.g., type { Document } from 'mongoose') are grouped before regular imports, aligning with TypeScript best practices. [1] [2] [3] [4] [5] [6] [7]

General Import Cleanup:

  • Adjusted the order of utility and model imports to be more consistent, such as moving User and Plan imports after configuration and type imports. [1] [2]
  • Fixed the order of middleware and logger imports for clarity and to prevent potential side effects. [1] [2]

Specific Import Order Corrections:

  • Moved exec and other Node.js built-in imports to the top of relevant files, before application-specific imports, for better convention. [1] [2] [3]

Miscellaneous:

  • No changes to application logic or functionality were introduced—these are strictly code organization and style improvements.

@upayanmazumder
Copy link
Member Author

i love autism

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request reorganizes import statements across the API codebase to improve code maintainability and readability. The changes ensure a consistent import ordering convention: built-in Node.js modules first, followed by third-party dependencies, configuration imports, internal modules, and finally type-only imports grouped appropriately according to TypeScript best practices.

Key changes:

  • Standardized import order across all files, placing built-in modules, third-party packages, configuration, utilities, and types in a consistent hierarchy
  • Moved type-only imports to follow TypeScript conventions
  • Added new npm scripts for build and start commands in package.json

Reviewed Changes

Copilot reviewed 43 out of 44 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
package.json Added build and start scripts, reformatted dependencies object
api/src/api.ts Reorganized imports with better grouping and separation
api/src/server.ts Moved env import after mongoose import
api/src/auth/*.ts Moved env imports to follow third-party dependencies
api/src/routes/*.ts Moved middleware imports after controller imports
api/src/models/*.ts Moved type imports after schema imports
api/src/controllers/**/*.ts Standardized order of Express, mongoose types, models, utilities, and custom types
api/src/utils/**/*.ts Moved type imports to end, utilities before types

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@upayanmazumder upayanmazumder merged commit dcb1a73 into GDGVIT:dev Oct 21, 2025
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments