Breaking
- Require Electron 35 1aa2096, f78f186
- Update to
conf16 f78f186- Migrations no longer run for a config file that does not exist yet. A new store starts at the current version.
- Migrations run in version order, whatever order they are defined in.
- The recorded migration version never moves backwards.
.get()throws when given a non-string key.- The
rootSchemaoption throws when it contains apropertieskey. - With
clearInvalidConfig, the cleared store is now written to the config file. projectVersionmust be a full semantic version when usingmigrations.namemust not point outsidecwd.- An empty
encryptionKeyis refused. - With dot notation, a key that is not a valid path (for example,
a[x) throws.
New
- Add
cacheoption to keep the store in memory- Reads do not parse the config file each time. Values returned from the store are frozen, so copy a value before you change it.
- Add
.eventsto listen forchangeevents directly - Allow
serializeto return aUint8Array - Allow the
projectVersionoption in the types 9fbe0a1 - Make the
nameoption non-readonly in the types 9d62519 - Improve the TypeScript types. Annotating
schemawithSchema<T>now gives.get()its types.
Improvements
- Fail with a clear error when not running in Electron, unless you pass an absolute
cwd44bd512 - Update dependencies 1aa2096
- Improve the docs, including the encryption algorithm,
rootSchema,ajvOptions,configFileMode, nested defaults, and renderer process requirements 49ab1c3, e7cada4, 36f7106, 17122f8, 5ad6974
Fixes
- Fix
.reset()with dot-notation keys - Fix a migration with a semver range making the store impossible to open after a failed migration
Migration guide
Migrations
A new config file no longer runs migrations, so the store starts at the current version. If your migrations must run on first launch, do that work in your app code instead.
If you use migrations, the projectVersion (or your app version) must be a full semantic version, such as 1.0.0.