NickRimmer / insomnia-plugin-free-sync

Insomnia plugin to save collections into a file
https://insomnia.rest/plugins/insomnia-plugin-free-sync
17 stars 3 forks source link

Add Save And Load As Multiple Files Feature #22

Closed PatrickMurrell closed 1 year ago

PatrickMurrell commented 1 year ago

I added an option to the plugin to allow the user to sync the data files of their insomnia repository across multiple directories and files. This will make it easier to avoid merge conflicts when using insomnia with version control systems. As each resource is largely confined to its own file it will make it especially easier for git use.

I based this implementation on the git sync feature insomnia has built in, but opted to work on this plugin because the devs based on what I read have no intention of letting you use git sync with local files so as a result it is very slow. It downloads entire repos worth of data anytime you commit, type up an test, and its just very laggy. So saving to local files using this should help any one who has experienced problems with that.

PatrickMurrell commented 1 year ago

If there are any issues you find with the changes I have made or if you feel this feature belongs in a separate plugin and don't want to merge this let me know. I can create different plugin with this feature, but I figured it would be better to contribute upstream than to make another sync plugin.

NickRimmer commented 1 year ago

Hi, @PatrickMurrell

Thank you for such a great idea. I really like and I'm thinking about how even to remove the one-file solution and stay with your only. I have a couple of questions about refactoring, but nothing critical.

Let me think a bit how to save previous implementation for users who saving as one file, and make multi-file logic as default

NickRimmer commented 1 year ago

I've updated a bit settings window and refactored your code.

image