ultimatedarktower 2.1.0 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +86 -0
- package/README.md +20 -0
- package/dist/esm/index.mjs +3558 -0
- package/dist/src/UltimateDarkTower.d.ts +1 -15
- package/dist/src/UltimateDarkTower.js.map +1 -1
- package/dist/src/index.d.ts +4 -0
- package/dist/src/index.js +8 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/udtTowerCommands.js +0 -1
- package/dist/src/udtTowerCommands.js.map +1 -1
- package/dist/src/udtTowerResponse.d.ts +16 -1
- package/dist/src/udtTowerResponse.js.map +1 -1
- package/package.json +8 -5
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/), and this project adheres to [Semantic Versioning](https://semver.org/).
|
|
6
|
+
|
|
7
|
+
## [2.1.2] - 2026-02-19
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- **ESM named imports broken** — `import { UltimateDarkTower } from 'ultimatedarktower'` previously threw `SyntaxError: The requested module does not provide an export named 'UltimateDarkTower'` in Node.js ESM projects because the `"import"` export condition pointed to the CommonJS build. The package now ships a true ES Module bundle so named imports work correctly.
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- **ESM build** (`dist/esm/index.mjs`) — a native ES Module bundle produced by esbuild, included in the published package alongside the existing CommonJS build
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
|
|
19
|
+
- `package.json` `exports["import"]` condition now points to `dist/esm/index.mjs` instead of the CommonJS output; `exports["require"]` is unchanged
|
|
20
|
+
- `package.json` `files` now includes `dist/esm/**/*`
|
|
21
|
+
|
|
22
|
+
## [2.1.1] - 2026-02-19
|
|
23
|
+
|
|
24
|
+
### Added
|
|
25
|
+
|
|
26
|
+
- Integration test for tower calibration using Node.js Bluetooth adapter, located in `tests/integration/calibration.integration.ts`
|
|
27
|
+
- `npm run test:integration` script to run integration tests requiring real hardware
|
|
28
|
+
- Integration tests are now organized under `tests/integration/` and are not run by default with unit tests or during publish
|
|
29
|
+
|
|
30
|
+
## [2.1.0] - 2026-02-19
|
|
31
|
+
|
|
32
|
+
### Added
|
|
33
|
+
|
|
34
|
+
- **Public Tower State Types** — Exported `TowerState`, `Light`, `Layer`, `Drum`, `Audio`, and `Beam` type interfaces for direct tower state manipulation
|
|
35
|
+
- **Tower State Utilities** — Exported `rtdt_unpack_state`, `rtdt_pack_state`, `isCalibrated`, and `createDefaultTowerState` for converting between `TowerState` objects and binary tower data
|
|
36
|
+
- **Differential Readings** — Exported `parseDifferentialReadings` function and `ParsedDifferentialReadings` type for parsing tower sensor data
|
|
37
|
+
- **`TowerResponseConfig` Type** — Exported interface for controlling which tower responses are logged via `logTowerResponseConfig`
|
|
38
|
+
|
|
39
|
+
### Changed
|
|
40
|
+
|
|
41
|
+
- **`TowerResponseConfig`** — Moved from private interface in `UltimateDarkTower.ts` to exported interface in `udtTowerResponse.ts`
|
|
42
|
+
- **`shouldLogResponse`** — Updated parameter type from `any` to `TowerResponseConfig` for type safety
|
|
43
|
+
- **Controller Example** — Updated imports to use the package index instead of internal module paths
|
|
44
|
+
|
|
45
|
+
## [2.0.0] - 2025-02-18
|
|
46
|
+
|
|
47
|
+
### Added
|
|
48
|
+
|
|
49
|
+
- **Node.js Support** — `NodeBluetoothAdapter` using `@stoprocent/noble` for BLE communication in Node.js environments (macOS, Linux, Windows)
|
|
50
|
+
- **Platform Auto-Detection** — `BluetoothAdapterFactory` automatically selects the correct adapter based on the runtime environment (browser vs Node.js vs Electron)
|
|
51
|
+
- **`BluetoothPlatform` Enum** — Explicit platform selection via `BluetoothPlatform.WEB`, `BluetoothPlatform.NODE`, or `BluetoothPlatform.AUTO`
|
|
52
|
+
- **`IBluetoothAdapter` Interface** — Public adapter interface for implementing custom Bluetooth adapters (React Native, Cordova, etc.)
|
|
53
|
+
- **Platform-Agnostic Error Types** — `BluetoothConnectionError`, `BluetoothDeviceNotFoundError`, `BluetoothNotAvailableError`, `BluetoothCharacteristicError`, `BluetoothAdapterError` for consistent error handling across platforms
|
|
54
|
+
- **Node.js CLI Example** — Interactive command-line example application (`examples/node/`)
|
|
55
|
+
- **Adapter Layer Tests** — Unit tests for `NodeBluetoothAdapter`, `WebBluetoothAdapter`, `BluetoothAdapterFactory`, `UdtBleConnection`, and error types
|
|
56
|
+
|
|
57
|
+
### Changed
|
|
58
|
+
|
|
59
|
+
- **`udtBleConnection`** — Refactored to use `IBluetoothAdapter` interface instead of direct Web Bluetooth API calls, enabling multi-platform support
|
|
60
|
+
- **`UltimateDarkTower` Constructor** — Now accepts `UltimateDarkTowerConfig` with optional `platform` or `adapter` properties for platform selection
|
|
61
|
+
- **Peer Dependency** — Updated `@stoprocent/noble` peer dependency from `^1.15.0` to `^2.0.0`
|
|
62
|
+
|
|
63
|
+
## [1.0.0] - 2025-08-18
|
|
64
|
+
|
|
65
|
+
### Added
|
|
66
|
+
|
|
67
|
+
- Initial release
|
|
68
|
+
- Web Bluetooth support for Chrome, Edge, and Samsung Internet
|
|
69
|
+
- Tower control API (lights, sounds, drum rotation)
|
|
70
|
+
- Glyph position tracking with automatic updates on drum rotation
|
|
71
|
+
- Seal management for game mechanics
|
|
72
|
+
- Tower state management and validation
|
|
73
|
+
- Multi-layered disconnect detection (heartbeat, GATT events, command timeout)
|
|
74
|
+
- Callback-based event system for tower events
|
|
75
|
+
- Comprehensive logging system with multiple outputs
|
|
76
|
+
- Battery monitoring with low battery warnings
|
|
77
|
+
- TypeScript definitions and type safety
|
|
78
|
+
- Tower Controller example web app
|
|
79
|
+
- Tower Game ("The Tower's Challenge") example web app
|
|
80
|
+
- Complete API reference documentation
|
|
81
|
+
|
|
82
|
+
[2.1.2]: https://github.com/ChessMess/UltimateDarkTower/compare/v2.1.1...v2.1.2
|
|
83
|
+
[2.1.1]: https://github.com/ChessMess/UltimateDarkTower/compare/v2.1.0...v2.1.1
|
|
84
|
+
[2.1.0]: https://github.com/ChessMess/UltimateDarkTower/compare/v2.0.0...v2.1.0
|
|
85
|
+
[2.0.0]: https://github.com/ChessMess/UltimateDarkTower/compare/v1.0.0...v2.0.0
|
|
86
|
+
[1.0.0]: https://github.com/ChessMess/UltimateDarkTower/releases/tag/v1.0.0
|
package/README.md
CHANGED
|
@@ -44,6 +44,7 @@ I have spent many hours reverse engineering the Tower's protocol in order to cre
|
|
|
44
44
|
- **Tower Control** - Complete control over lights, sounds, and drum rotation
|
|
45
45
|
- **Game State Tracking** - Track glyph positions, broken seals, and skull counts
|
|
46
46
|
- **Event System** - Callback-based event handling for tower events
|
|
47
|
+
- **ESM + CJS** - Ships both an ES Module build and a CommonJS build; works with `import` and `require` without configuration
|
|
47
48
|
- **TypeScript Support** - Full TypeScript definitions and type safety
|
|
48
49
|
- **Comprehensive Logging** - Multi-output logging system for debugging
|
|
49
50
|
- **Battery Monitoring** - Real-time battery level tracking and low battery warnings
|
|
@@ -143,6 +144,25 @@ Comprehensive documentation with TypeScript examples, best practices, and troubl
|
|
|
143
144
|
- **Best Practices** - Performance tips, error handling, and common patterns
|
|
144
145
|
- **Troubleshooting** - Solutions for common issues and debugging techniques
|
|
145
146
|
|
|
147
|
+
## Integration Testing
|
|
148
|
+
|
|
149
|
+
Integration tests that require real hardware are located in `tests/integration/` and are not run by default with the main test suite. These tests use the Node.js Bluetooth adapter and require a physical Return to Dark Tower device in range.
|
|
150
|
+
|
|
151
|
+
To run the calibration integration test:
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
npm run test:integration
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
- This will connect to the tower, perform a full calibration sequence, and print the resulting glyph positions.
|
|
158
|
+
- The test will fail if the tower is not available or calibration does not complete within 60 seconds.
|
|
159
|
+
- Integration tests are not included in automated test runs or npm publish.
|
|
160
|
+
|
|
161
|
+
**Prerequisites:**
|
|
162
|
+
|
|
163
|
+
- Tower must be powered on and in Bluetooth range
|
|
164
|
+
- `@stoprocent/noble` must be installed (it is a peer dependency)
|
|
165
|
+
|
|
146
166
|
## Development
|
|
147
167
|
|
|
148
168
|
### Building and Testing
|