v2.0.0
Pre-releaseRelease Notes: LeetCode Daily Problem Fetcher (v2.0.0)
We are excited to announce the release of LeetCode Daily Problem Fetcher v1.0.0! This release introduces a complete refactor of the codebase to improve scalability, maintainability, and robustness. Below is a summary of the changes and improvements:
New Features
-
Modular Project Structure:
- The codebase is now organized into a modular structure with clear separation of concerns:
helpers/: Contains reusable utility classes (e.g.,FileHelper,GraphqlHelper).services/: Contains business logic (e.g.,ProblemService).config/: Contains shared utilities (e.g.,envConfig).tests/: Includes unit and integration tests (to be added in future releases).
- The codebase is now organized into a modular structure with clear separation of concerns:
-
Environment Configuration:
- Added a
env.config.tsfile to manage environment variables and default configurations (e.g., GraphQL endpoint, default programming language).
- Added a
-
Centralized Logging:
- Introduced a
logger.helper.tsutility for consistent and structured logging across the application.
- Introduced a
-
Support for Multiple Languages:
- The application now supports multiple programming languages (C++, Python3, JavaScript, Java, C) for code snippet generation.
-
Dynamic File and Directory Creation:
- Files and directories are now created dynamically based on the problem's metadata (e.g., title, difficulty, tags).
Improvements
-
Error Handling:
- Improved error handling and logging across all modules to ensure robustness and easier debugging.
-
Code Reusability:
- Reusable functions and classes (e.g.,
FileHelper,GraphqlHelper) reduce code duplication and improve maintainability.
- Reusable functions and classes (e.g.,
-
Scalability:
- The new structure makes it easy to add new features (e.g., support for additional languages, new GraphQL queries).
-
Best Practices:
- The codebase now adheres to best practices, including:
- Proper naming conventions.
- Separation of concerns.
- Use of design patterns (e.g., Singleton for
GraphqlHelper).
- The codebase now adheres to best practices, including:
-
Documentation:
- Added inline comments and improved readability for better understanding of the code.
Bug Fixes
-
Fixed Invalid Data Handling:
- Added validation checks to ensure the data structure from the GraphQL API is correct before processing.
-
Fixed Default Language Fallback:
- If no language is provided, the application now defaults to
Python3instead of throwing an error.
- If no language is provided, the application now defaults to
Breaking Changes
-
Environment Variables:
- The GraphQL endpoint and default language are now configured via environment variables (
.envfile). Ensure you have a.envfile with the required variables:GRAPHQL_ENDPOINT=https://leetcode.com/graphql DEFAULT_LANGUAGE=Python3
- The GraphQL endpoint and default language are now configured via environment variables (
-
File and Directory Paths:
- The directory structure for saving files has been updated to include the month and year for better organization.
Future Roadmap
- Testing:
- Add unit and integration tests to ensure code reliability.
- CI/CD Pipeline:
- Set up automated testing and deployment pipelines.
- Additional Features:
- Support for more programming languages.
- Add a CLI interface for easier usage.
- Add support for fetching problems by ID or topic.
How to Upgrade
- Clone the latest version of the repository.
- Install dependencies:
bun install
- Create a
.envfile with the required environment variables. - Run the application:
bun run start
Thank you for using LeetCode Daily Problem Fetcher! We hope these changes make your experience better and more efficient. If you encounter any issues or have suggestions for improvement, please open an issue on our GitHub repository.
Happy coding! 🚀