Extension to sync and backup preferences?

:wave: I’m interested in building a way to backup and sync Nova preferences (including installed extensions and their preferences) across different Macs, similar to Atom’s sync-settings extension.

Panic Sync doesn’t seem to sync Nova preferences.

Can anyone offer some insight as to whether or not this might be possible with the current Nova extension runtime?

Thanks!


And thanks, Panic, for making such an awesome editor and extensions API. It’s been really fun to work with, which is not something I ever expected to say about a text editor extension API!

Hi @kylefox. Great idea.

Backing up workspace preferences should be easy enough because they are stored in Configuration.json, which is inside the .nova directory in each workspace. So it would just be a matter of backing up that file. See, https://docs.nova.app/extensions/preferences/.

However, I don’t see a way to retrieve all Environment preferences or information about installed extensions. The Configuration object provides the ability to return specific keys using the get method, but not all keys. If I am correct, this might be a good API feature request?

For more information I would take a look at the config property of the Environment and Workspace objects. The Environment is responsible for global application preferences and the Workspace for specific workspace configurations. See https://docs.nova.app/api-reference/environment/#config
and https://docs.nova.app/api-reference/workspace/#config. Both of these store a Configuration object. See, https://docs.nova.app/api-reference/configuration/#configuration.

Another developer, or Panic, should be able to confirm these API limitations or provide additional suggestions, but hopefully this helps. Good luck!

Jason

An additional thought…maybe this is a security decision made by Panic? That is that extensions should only have access to their own configurations, especially in the global environment.

Thanks Jason, this is super helpful — I’ll explore this!

1 Like

While this is clearly outside of any API contract, global extension configuration items are in UserConfiguration.json two levels up from nova.extension.globalStoragePath. But any extension could easily and opaquely store whatever kind of state they want in nova.extension.globalStoragePath, and not use the configuration api at all.

But ++ on having a preferences sync, that would be nice!

Having PanicSync would be the obvious conduit, from a Panic customer POV.

Thanks for pointing out the location of the global configuration @jrf!

I agree completely, PanicSync would seem ideal place to store these preferences. Not sure if this then becomes something Panic would need to bake into Nova itself or if it’s possible this functionality might be opened with an API.

:100: I’d much rather have Panic Sync handle this!