This is one of the main reasons libraries like this are a bad idea.
Actually the library itself isn't a bad idea. What is hard to achieve is handling the SavedVariables :
- using it a as standard library would require to duplicate the SV for each addon using it, which would negate the purpose of a centralized datastore.
- requiring the including addons to have the same SV for the library won't work either, because if several addons use it, they will erase each other variables, with funny things happening if any of them is disabled.
I'm wondering how the Curse Client honors the "required dependencies" of the .pkgmeta. It could be the solution though it doesn't help with manual installation.
On the other hand, the biggest inconvenient I have faced so far is packaging issues.
At this point, DataStore and its modules are all separate projects, so the svn repository cannot copy them into an addon's package since they would have to be at the same level as the client addon's folder.
I think you could have the packager to layout the folders as need using .pkgmeta:
# more externals there
# more move-folders there
There are two issues though :
- the "nolib" package may cause Datastore not to be included (though you could disable this kind of packages),
- the Curse Client may have issue identifying which addons installed DataStore if several of them are installted at the same time (the DataStore version of each addon erases the other one).
IMO the whole datastore modules could have been made a single project.
Another solution would be to defined "required dependencies" but I'm not sure how the Curse Client really handle them ; plus it is not handled at all when downloading directly from the website.