Skip to content

Commit

Permalink
docs: relocate upgrading guides to dedicated page (#38)
Browse files Browse the repository at this point in the history
Co-authored-by: Richard Herman <geekyeggo@users.noreply.github.com>
GeekyEggo and GeekyEggo authored Apr 25, 2024
1 parent 9e5fc2e commit 82fb01b
Showing 3 changed files with 139 additions and 53 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
59 changes: 7 additions & 52 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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<T>` 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.

<h3 id="0-2-0_migration">
➡️ Migration
</h3>

> 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

131 changes: 131 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
# Upgrade Guide

**Versions**

- [v0.4.0](#v0-4-0)
- [v0.2.0](#v0-2-0)

## <a id="v0-4-0"></a>v0.4.0

- [Localization JSON structure](#localization-json-structure)
- [Localization lookup](#localization-lookup)
- [`PayloadObject<T>`](#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<T>`

The previous `PayloadObject<T>` 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<T extends PayloadObject<T>> extends SingletonAction<T> {
```
**v0.4.0**
```ts
export class BaseAction<T extends JsonObject> extends SingletonAction<T> {
```
### 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"
```
## <a id="v0-2-0"></a>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` |

0 comments on commit 82fb01b

Please sign in to comment.