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: cache project context in toolbox to avoid passing it everywhere #115

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

km1chno
Copy link
Collaborator

@km1chno km1chno commented Sep 19, 2024

Resolves #43

@km1chno km1chno self-assigned this Sep 19, 2024
@km1chno km1chno marked this pull request as draft September 19, 2024 13:09
@km1chno km1chno changed the title @km1chno/refactor better project context refactor: cache project context in toolbox to avoid passing it everywhere Sep 19, 2024
@km1chno km1chno marked this pull request as ready for review September 30, 2024 08:01
toolbox.interactive.surveyStep(
'Created snapshot of project state before execution.'
)

context.selectedOptions = await getSelectedOptions(toolbox)
toolbox.context.selectedOptions = await getSelectedOptions(toolbox)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd prefer a setter here and possibly in other places getter instead of just toolbox.context.variable -> so noone is tempted to write (override) something

packageManager = LOCK_FILE_TO_MANAGER[lockFiles[0]]
}

return packageManager as PackageManager
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wonder if we couldn't check it somhow to avoid casting?

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.

Figure out what to do with project context
2 participants