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

feat(mongodb-runner): add programmatic api for mongodb-runner #186

Merged
merged 5 commits into from
Dec 13, 2023

Conversation

baileympearson
Copy link
Contributor

Description

I've been tinkering around with a vscode extension wrapper for mongodb-runner. The package currently only exports the cluster helpers but does not provide a programmatic interface to the functionality contained in cli.ts.

I pulled logic for ls, start and stop into standalone, exported functions so that I can consume them in my vscode extension without running bash commands using the runner's CLI. I understand if there's a desire to keep the API of this package slim and if we don't want to export the standalone helpers. If that's the case, I would be okay with keeping them as standalone functions but not exporting them from the index. I'm happy to import from the runner-helpers.ts file directly, this is just a toy project.

Along the way, I discovered that if I restarted my computer, mongodb-runner ls displays clusters that have been terminated. I also added a prune command, both to the programmatic exports and the runner's CLI, that attempts to connect to every instance in the runner's runnerDir and removes all entries for clusters that cannot be connected to.

Open Questions

Checklist

@baileympearson baileympearson merged commit 53faa4d into main Dec 13, 2023
3 checks passed
@baileympearson baileympearson deleted the add-programmatic-api-for-mongodb-runner-helpers branch December 13, 2023 17:11
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.

3 participants