feat(types): move Emigrate types to separate package and improve types (#41)

* feat(types): move Emigrate types to separate package

Also refactor the types to use discriminating unions for easier error handling and such.
Errors passed to storage plugins should now be serialized and storage plugins are expected to return already serialized errors on failed history entries.

* fix(mysql): handle the new type changes

* fix(storage-fs): handle the new type changes

* feat(cli): better error handling and types

Adapt to the new types from the @emigrate/types package, like discriminating union types and serializing and deserializing errors
This commit is contained in:
Joakim Carlstein 2023-12-15 13:03:35 +01:00 committed by GitHub
parent afe56594c5
commit cae6d11d53
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
38 changed files with 630 additions and 259 deletions

View file

@ -0,0 +1,5 @@
---
'@emigrate/cli': minor
---
Make Emigrate Error instances deserializable using the serialize-error package, and also switch to its serializeError method

View file

@ -0,0 +1,5 @@
---
'@emigrate/cli': patch
---
Shutdown the storage correctly in case of directory or file reading errors

View file

@ -0,0 +1,5 @@
---
'@emigrate/types': minor
---
Use discriminating union types for migration types for easier error handling and such

View file

@ -0,0 +1,6 @@
---
'@emigrate/plugin-tools': minor
'@emigrate/types': minor
---
Move the Emigrate plugin types to a separate package for fewer version bumps in plugins hopefully

View file

@ -0,0 +1,5 @@
---
'@emigrate/cli': minor
---
Adapt to the new discriminating union types in @emigrate/types

View file

@ -0,0 +1,5 @@
---
'@emigrate/types': minor
---
Make it easier for storage plugins by serializing errors passed to the onError method and let it respond with serialized errors in the getHistory method