Skip to content

Commit

Permalink
Version Packages (#10)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and github-actions[bot] authored Apr 16, 2022
1 parent e15ed5d commit 5cfd240
Show file tree
Hide file tree
Showing 15 changed files with 85 additions and 110 deletions.
5 changes: 0 additions & 5 deletions .changeset/angry-turtles-mate.md

This file was deleted.

15 changes: 0 additions & 15 deletions .changeset/breezy-ghosts-argue.md

This file was deleted.

22 changes: 0 additions & 22 deletions .changeset/forty-days-melt.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/forty-files-peel.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/fuzzy-windows-dress.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/gold-countries-sing.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/ninety-colts-whisper.md

This file was deleted.

9 changes: 0 additions & 9 deletions .changeset/popular-keys-dress.md

This file was deleted.

13 changes: 0 additions & 13 deletions .changeset/purple-goats-joke.md

This file was deleted.

19 changes: 0 additions & 19 deletions .changeset/small-games-speak.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/spotty-oranges-obey.md

This file was deleted.

7 changes: 7 additions & 0 deletions apps/demo/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# demo

## 0.1.0

### Minor Changes

- d66c5c6: Add a demo, woohoo!
2 changes: 1 addition & 1 deletion apps/demo/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "demo",
"private": true,
"version": "0.0.0",
"version": "0.1.0",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
Expand Down
76 changes: 76 additions & 0 deletions packages/controlfreak/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# @hmans/controlfreak

## 0.2.0

### Minor Changes

- 1daae22: The ControlFreak repository is now a monorepo, giving us some much-needed breathing room for a small demo app and the usual goodness of `preconstruct dev`. :D
- c8df83d: **Breaking Change:** Controllers now provide `addDevice` and `removeDevice` functions, and devices need to be explicitly instantiated and added to controllers:

```ts
export const controller = new Controller()

const keyboard = new KeyboardDevice()
const gamepad = new GamepadDevice()

controller.addDevice(keyboard)
controller.addDevice(gamepad)
```

- 1c1d119: The Keyboard device's `isPressed` function now optionally accepts an array of keys to check. This allows step implementations for keyboard controls to support more than a single key per axis/input. For example:

```ts
controller
.addControl("move", VectorControl)
.addStep(
keyboard.compositeVector(
["KeyW", "ArrowUp"],
["KeyS", "ArrowDown"],
["KeyA", "ArrowLeft"],
["KeyD", "ArrowRight"]
)
)

controller
.addControl("fire", BooleanControl)
.addStep(keyboard.whenKeyPressed(["Space", "Enter"]))
```

- 7b5e0ca: **Breaking Change:** all keyboard input now uses key codes, not key names. Please refer to [this list of supported values](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values).
- d2cfa41: Finally, we have changesets and a changelog!
- c8df83d: **Breaking Change:** All of the device-specific steps have been moved into instance methods on devices themselves, and a `processors` object has been introduced to group processor-style steps:

```ts
const keyboard = new KeyboardDevice()
const gamepad = new GamepadDevice()

controller.addDevice(keyboard)
controller.addDevice(gamepad)

controller
.addControl("move", VectorControl)
.addStep(keyboard.compositeVector("KeyW", "KeyS", "KeyA", "KeyD"))
.addStep(gamepad.axisVector(0, 1))
.addStep(processors.clampVector(1))
```

- c8df83d: This library now uses @hmans/signal for signals instead of its own implementation.

### Patch Changes

- 0d81906: The `Vector` type has been changed to an `IVector2` interface, and some basic vector math functions have been implemented within this package. They are designed to be compatible with instances of the Vector2 class exported by Three.js (ie. `x` and `y` properties, and mutating values to not create new objects.)
- c8df83d: Controllers now provide an `onDeviceChange` signal that emits whenever the currently active device changes. This can be used to, for example, display input method-specific UI.

```ts
controller.onDeviceChange.add((d) => console.log("new device:", d))
```

- e15ed5d: New processor: `deadzone`. Applies a deadzone to a `VectorControl`.

```ts
controller
.addControl("move", VectorControl)
.addStep(gamepad.axisVector(0, 1))
.addStep(processors.clampVector(1))
.addStep(processors.deadzone(0.15))
```
2 changes: 1 addition & 1 deletion packages/controlfreak/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"input"
],
"sideEffects": false,
"version": "0.1.8",
"version": "0.2.0",
"main": "dist/hmans-controlfreak.cjs.js",
"module": "dist/hmans-controlfreak.esm.js",
"types": "dist/hmans-controlfreak.cjs.d.ts",
Expand Down

0 comments on commit 5cfd240

Please sign in to comment.