diff --git a/.vscode/settings.json b/.vscode/settings.json index a830391a..7d730aa0 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -10,6 +10,6 @@ ".editorconfig": ".eslintrc, .prettierrc", "jest.config.ts": "babel.config.json", "package.json": "package-lock.json, yarn.lock, pnpm-lock.yaml, .npmrc", - "README.md": "LICENSE, CHANGELOG.md" + "README.md": "CHANGELOG.md, LICENSE, UPGRADE.md" } } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b5bde14..5cc3090f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ ✨ New 🐞 Fix ♻️ Refactor / Enhance / Update +⬆️ Upgrading --> @@ -32,13 +33,12 @@ - Update layout and manifest references to propagate from [`@elgato/schemas`](https://github.com/elgatosf/schemas). - Localization lookup will now return the key if the resource is not defined. +- Update structure of JSON localizations. - Update `State` type to allow for more than two states. -### ➡️ Migration +### ⬆️ Upgrading -- Localizations keys are now indexed from the `Localization` node within the translation file. -- Previous `PayloadObject` type has been replaced with `JsonObject`. -- JSON schemas can now be found in their dedicated schemas package, [`@elgato/schemas`](https://github.com/elgatosf/schemas). +- For information on breaking changes, and migrating to the this version, read more about [upgrading to v0.4.0](/UPGRADE.md#v0-4-0). ## 0.3.0 @@ -68,10 +68,6 @@ ## 0.2.0 -### ⚠️ Breaking Changes - -Namespaces have been introduced in place of the previous `streamDeck.client` object to provide better natural-grouping of functionality. Additionally, `streamDeck.devices` has been promoted to a namespace to allow for future enhancements, with devices remaining iterable. For more information, see [migration details](#0-2-0_migration). - ### ✨ New #### Stream Deck 6.5 @@ -102,50 +98,9 @@ Namespaces have been introduced in place of the previous `streamDeck.client` obj - Correctly validate paths without extensions in manifest JSON schema. - Default `text-overflow` set to `ellipsis` in layout JSON schema. -

- ➡️ Migration -

- -> Functionality introduced in Stream Deck 6.5 requires the plugin's manifest to have a `Software.MinimumVersion` of 6.5 or higher. - -Members previously accessed directly from `streamDeck.client` have been relocated to the following namespaces: - -| Previous `streamDeck.client` Member | New Namespace | -| ----------------------------------- | ----------------------------------------- | -| `getGlobalSettings` | `streamDeck.settings` | -| `getSettings` | `streamDeck.actions.createController(id)` | -| `onApplicationDidLaunch` | `streamDeck.system` | -| `onApplicationDidTerminate` | `streamDeck.system` | -| `onDeviceDidConnect` | `streamDeck.devices` | -| `onDeviceDidDisconnect` | `streamDeck.devices` | -| `onDialDown` | `streamDeck.actions` | -| `onDialRotate` | `streamDeck.actions` | -| `onDialUp` | `streamDeck.actions` | -| `onDidReceiveGlobalSettings` | `streamDeck.settings` | -| `onDidReceiveSettings` | `streamDeck.settings` | -| `onKeyDown` | `streamDeck.actions` | -| `onKeyUp` | `streamDeck.actions` | -| `onPropertyInspectorDidAppear` | `streamDeck.ui` | -| `onPropertyInspectorDidDisappear` | `streamDeck.ui` | -| `onSendToPlugin` | `streamDeck.ui` | -| `onSystemDidWakeUp` | `streamDeck.system` | -| `onTitleParametersDidChange` | `streamDeck.actions` | -| `onTouchTap` | `streamDeck.actions` | -| `onWillAppear` | `streamDeck.actions` | -| `onWillDisappear` | `streamDeck.actions` | -| `openUrl` | `streamDeck.system` | -| `sendToPropertyInspector` | `streamDeck.actions.createController(id)` | -| `setFeedback` | `streamDeck.actions.createController(id)` | -| `setFeedbackLayout` | `streamDeck.actions.createController(id)` | -| `setGlobalSettings` | `streamDeck.settings` | -| `setImage` | `streamDeck.actions.createController(id)` | -| `setSettings` | `streamDeck.actions.createController(id)` | -| `setState` | `streamDeck.actions.createController(id)` | -| `setTitle` | `streamDeck.actions.createController(id)` | -| `setTriggerDescription` | `streamDeck.actions.createController(id)` | -| `showAlert` | `streamDeck.actions.createController(id)` | -| `showOk` | `streamDeck.actions.createController(id)` | -| `switchToProfile` | `streamDeck.profiles` | +### ⬆️ Upgrading + +- For information on breaking changes, and migrating to the this version, read more about [upgrading to v0.2.0](/UPGRADE.md#v0-2-0). ## 0.1.0 diff --git a/UPGRADE.md b/UPGRADE.md new file mode 100644 index 00000000..0df574a4 --- /dev/null +++ b/UPGRADE.md @@ -0,0 +1,131 @@ +# Upgrade Guide + +**Versions** + +- [v0.4.0](#v0-4-0) +- [v0.2.0](#v0-2-0) + +## v0.4.0 + +- [Localization JSON structure](#localization-json-structure) +- [Localization lookup](#localization-lookup) +- [`PayloadObject`](#payloadobjectt) +- [JSON schemas](#json-schemas) + +### Localization JSON structure + +Localizations within JSON files must now be nested under a `Localization` object, for example. + +**Before** + +```json +{ + "Hello world": "Hallo Welt" +} +``` + +**v0.4.0** + +```json +{ + "Localization": { + "Hello world": "Hallo Welt" + } +} +``` + +### Localization lookup + +Localization lookup will now return the `key` when the localization cannot be found, for example, given the localizations above: + +**Before** + +```ts +import streamDeck from "@elgato/streamdeck"; +streamDeck.i18n.translate("test"); // undefined +``` + +**v0.4.0** + +```ts +import streamDeck from "@elgato/streamdeck"; +streamDeck.i18n.translate("test"); // "test" +``` + +### `PayloadObject` + +The previous `PayloadObject` has been deprecated in favour of the newer `JsonObject` type. The `JsonObject` is now the primary constraint for action settings types, and can be used to create base actions. + +**Before** + +```ts +export class BaseAction> extends SingletonAction { +``` + +**v0.4.0** + +```ts +export class BaseAction extends SingletonAction { +``` + +### JSON schemas + +Manifest and layout JSON schemas have been relocated to [`@elgato/schemas`](https://github.com/elgatosf/schemas), and are now publicly accessible: + +- [Manifest schema](https://schemas.elgato.com/streamdeck/plugins/manifest.json) +- [Layout schema](https://schemas.elgato.com/streamdeck/plugins/layout.json) + +**Before** + +```json +"$schema": "../node_modules/@elgato/streamdeck/schemas/manifest.json" +``` + +**After** + +```json +"$schema": "https://schemas.elgato.com/streamdeck/plugins/manifest.json" +``` + +## v0.2.0 + +Namespaces have been introduced in place of the previous `streamDeck.client` object to provide better natural-grouping of functionality. Additionally, `streamDeck.devices` has been promoted to a namespace to allow for future enhancements, with devices remaining iterable. + +Members previously accessed directly from `streamDeck.client` have been relocated to the following namespaces: + +| Before, `streamDeck.client` member | v0.2.0 namespace | +| ---------------------------------- | ----------------------------------------- | +| `getGlobalSettings` | `streamDeck.settings` | +| `getSettings` | `streamDeck.actions.createController(id)` | +| `onApplicationDidLaunch` | `streamDeck.system` | +| `onApplicationDidTerminate` | `streamDeck.system` | +| `onDeviceDidConnect` | `streamDeck.devices` | +| `onDeviceDidDisconnect` | `streamDeck.devices` | +| `onDialDown` | `streamDeck.actions` | +| `onDialRotate` | `streamDeck.actions` | +| `onDialUp` | `streamDeck.actions` | +| `onDidReceiveGlobalSettings` | `streamDeck.settings` | +| `onDidReceiveSettings` | `streamDeck.settings` | +| `onKeyDown` | `streamDeck.actions` | +| `onKeyUp` | `streamDeck.actions` | +| `onPropertyInspectorDidAppear` | `streamDeck.ui` | +| `onPropertyInspectorDidDisappear` | `streamDeck.ui` | +| `onSendToPlugin` | `streamDeck.ui` | +| `onSystemDidWakeUp` | `streamDeck.system` | +| `onTitleParametersDidChange` | `streamDeck.actions` | +| `onTouchTap` | `streamDeck.actions` | +| `onWillAppear` | `streamDeck.actions` | +| `onWillDisappear` | `streamDeck.actions` | +| `openUrl` | `streamDeck.system` | +| `sendToPropertyInspector` | `streamDeck.actions.createController(id)` | +| `setFeedback` | `streamDeck.actions.createController(id)` | +| `setFeedbackLayout` | `streamDeck.actions.createController(id)` | +| `setGlobalSettings` | `streamDeck.settings` | +| `setImage` | `streamDeck.actions.createController(id)` | +| `setSettings` | `streamDeck.actions.createController(id)` | +| `setState` | `streamDeck.actions.createController(id)` | +| `setTitle` | `streamDeck.actions.createController(id)` | +| `setTriggerDescription` | `streamDeck.actions.createController(id)` | +| `showAlert` | `streamDeck.actions.createController(id)` | +| `showOk` | `streamDeck.actions.createController(id)` | +| `switchToProfile` | `streamDeck.profiles` |