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(cli): consolidate most MainWorker related code to the same place #15459

Merged
merged 1 commit into from
Aug 11, 2022

Conversation

dsherret
Copy link
Member

@dsherret dsherret commented Aug 11, 2022

This PR consolidates a lot of the MainWorker code into a CliMainWorker struct with high level methods. The low level details are then within this class.

At the moment, I mostly extracted out this code to this struct, but I think even some more code re-use code occur.

This will allow me to inject some node-compat like stuff into everywhere more easily instead of spreading it around 7ish different places.

@dsherret dsherret changed the title refactor: consolidate most runtime code to the same place refactor: consolidate most MainWorker related code to the same place Aug 11, 2022
@dsherret dsherret changed the title refactor: consolidate most MainWorker related code to the same place refactor(cli): consolidate most MainWorker related code to the same place Aug 11, 2022
worker.dispatch_unload_event(&located_script_name!())?;
Ok(0)
let exit_code = worker.run().await?;
Ok(exit_code)
Copy link
Member Author

@dsherret dsherret Aug 11, 2022

Choose a reason for hiding this comment

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

Change here to include the exit code is mostly a formality and to align with the other methods. It seems like deno eval already returned the exit code.

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

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

Seems reasonable

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.

None yet

2 participants