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

Versioning the config store #66

Closed
EduardoSimon opened this issue Apr 7, 2020 · 3 comments
Closed

Versioning the config store #66

EduardoSimon opened this issue Apr 7, 2020 · 3 comments

Comments

@EduardoSimon
Copy link

Hi, I'd like to congratulate you for the amazing work you've done with this package. It's been great. However, I've got a problem when I update the default configuration in the ConfigStore declaration and release it to npm. Users who have an older version of my package don't get their local config-store delete under ~/.config/configstore. Should I do this in the bootstrap of my package and save the version in the config itself? If the version is older do something like config.clear().

Thanks in advance

@sindresorhus
Copy link
Member

Yes, it's up to you to handle breaking version changes.

@EduardoSimon
Copy link
Author

Okay, any tips on that?

@sindresorhus
Copy link
Member

It really depends on how you use it. If the values can be regenerated, .clear() is fine. Otherwise, you need to migrate over the data to the new structure.

I have a similar package that supports migrations: https://github.com/sindresorhus/conf#migrations

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

No branches or pull requests

2 participants