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

Refactor main.ts to extract specific functionalities #3

Merged
merged 2 commits into from
May 17, 2024

Conversation

dtinth
Copy link
Collaborator

@dtinth dtinth commented May 17, 2024

Refactors src/main.ts by extracting and organizing code into separate, more focused modules.

  • Extracts environment variables: Moves environment variable definitions to src/env.ts.
  • Schemas: Moves Task and TaskListFile JSON schemas to src/schema.ts.
  • Context creation: Extracts the creation of the context object, which includes DynamoDB and SQS clients, to src/createContext.ts.
  • Duration tracking: Separates the duration tracking functionality into src/createDurationTracker.ts.
  • DynamoDB functions: Moves DynamoDB related functions, such as table creation and task status updates, to src/db.ts.
  • SQS functions: Extracts SQS related functions, including queue creation and message visibility timeout updates, to src/queue.ts.
  • Main module cleanup: Updates src/main.ts to import and use the newly created modules, significantly reducing its complexity and improving readability.

For more details, open the Copilot Workspace session.

@dtinth dtinth merged commit f3a2ec1 into main May 17, 2024
1 check passed
@dtinth dtinth deleted the dtinth/refactor-main branch May 17, 2024 07:10
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