Introducing Snippet Wizard
A utility site to manage code snippets across multiple different services with ease.
Table of contents
The Problem and Solution
I had a problem.
My job uses GitLab and I personally use GitHub. My team stores handy code snippets for daily development in GitLab and I know at some point, I want to transfer those snippets to my GitHub. I made an open source project named Snippet Wizard as a solution to this problem.
Snippet Wizard allows you to enter a personal access token (PAT) for a respective service (GitHub, GitLab, etc) and CRUD snippets. One handy feature is the ability to clone a snippet from one service to others.
The Architecture
Snippet Wizard is based on plugins.
Each plugin overrides the abstract SnippetPlugin
class. The plugin class methods are responsible for calling the snippet service API with the input and doing the desired operation (create, read, update, destroy)
The SnippetPluginManager
takes care of calling the desired snippet plugins.
At the time of this writing, there are only 2 supported plugins: GitHub and GitLab.
The project is open source so if you required a plugin for another service, please consider opening a merge request with the plugin so others can use it too!!
Links
Notes
- I expect the snippet plugin code to change overtime as a heads up for plugin authors. One thing I want to do is move the snippet plugin to its own package so it can be used in any JS context like nodejs.