Skip to content

Commit

Permalink
chore: add errors to aid in migration
Browse files Browse the repository at this point in the history
  • Loading branch information
ghostdevv committed Feb 22, 2023
1 parent 980f242 commit c892aca
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/chilled-avocados-speak.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'jellycommands': patch
---

add errors to props.get, props.set, props.has to aid in migration
21 changes: 21 additions & 0 deletions packages/jellycommands/src/JellyCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,27 @@ export class JellyCommands extends Client {
else this.joptions = value;

this.props = options.props || {};

// TODO remove for 1.0
// Makes need for a migration more obvious for those using props api
this.props = {
get() {
throw new Error(
'props.get has been removed, SEE: https://jellycommands.dev/guide/migrate/props.html',
);
},
set() {
throw new Error(
'props.set has been removed, SEE: https://jellycommands.dev/guide/migrate/props.html',
);
},
has() {
throw new Error(
'props.has has been removed, SEE: https://jellycommands.dev/guide/migrate/props.html',
);
},
...this.props,
};
}

async login(potentialToken?: string): Promise<string> {
Expand Down

0 comments on commit c892aca

Please sign in to comment.