signalk-wakelogger 0.2.0-beta.0
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 +32 -0
- package/LICENSE +201 -0
- package/README.md +49 -0
- package/SECURITY.md +7 -0
- package/assets/screenshots/plugin-config.png +0 -0
- package/assets/screenshots/plugin-status.png +0 -0
- package/assets/wakelogger.svg +6 -0
- package/dist/config/defaults.d.ts +18 -0
- package/dist/config/defaults.js +30 -0
- package/dist/config/defaults.js.map +1 -0
- package/dist/config/schema.d.ts +43 -0
- package/dist/config/schema.js +47 -0
- package/dist/config/schema.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +338 -0
- package/dist/index.js.map +1 -0
- package/dist/outbox/database-outbox.d.ts +25 -0
- package/dist/outbox/database-outbox.js +186 -0
- package/dist/outbox/database-outbox.js.map +1 -0
- package/dist/outbox/database-types.d.ts +19 -0
- package/dist/outbox/database-types.js +3 -0
- package/dist/outbox/database-types.js.map +1 -0
- package/dist/outbox/factory.d.ts +12 -0
- package/dist/outbox/factory.js +98 -0
- package/dist/outbox/factory.js.map +1 -0
- package/dist/outbox/file-outbox.d.ts +27 -0
- package/dist/outbox/file-outbox.js +280 -0
- package/dist/outbox/file-outbox.js.map +1 -0
- package/dist/outbox/interface.d.ts +33 -0
- package/dist/outbox/interface.js +3 -0
- package/dist/outbox/interface.js.map +1 -0
- package/dist/pairing/association-client.d.ts +3 -0
- package/dist/pairing/association-client.js +31 -0
- package/dist/pairing/association-client.js.map +1 -0
- package/dist/pairing/credentials.d.ts +46 -0
- package/dist/pairing/credentials.js +168 -0
- package/dist/pairing/credentials.js.map +1 -0
- package/dist/pairing/pairing-client.d.ts +19 -0
- package/dist/pairing/pairing-client.js +102 -0
- package/dist/pairing/pairing-client.js.map +1 -0
- package/dist/signalk/normaliser.d.ts +11 -0
- package/dist/signalk/normaliser.js +119 -0
- package/dist/signalk/normaliser.js.map +1 -0
- package/dist/signalk/paths.d.ts +2 -0
- package/dist/signalk/paths.js +14 -0
- package/dist/signalk/paths.js.map +1 -0
- package/dist/signalk/subscriber.d.ts +2 -0
- package/dist/signalk/subscriber.js +20 -0
- package/dist/signalk/subscriber.js.map +1 -0
- package/dist/telemetry/profile-store.d.ts +7 -0
- package/dist/telemetry/profile-store.js +39 -0
- package/dist/telemetry/profile-store.js.map +1 -0
- package/dist/telemetry/profile.d.ts +32 -0
- package/dist/telemetry/profile.js +94 -0
- package/dist/telemetry/profile.js.map +1 -0
- package/dist/telemetry/sampler.d.ts +14 -0
- package/dist/telemetry/sampler.js +44 -0
- package/dist/telemetry/sampler.js.map +1 -0
- package/dist/telemetry/types.d.ts +73 -0
- package/dist/telemetry/types.js +3 -0
- package/dist/telemetry/types.js.map +1 -0
- package/dist/transport/adaptive-mode.d.ts +23 -0
- package/dist/transport/adaptive-mode.js +63 -0
- package/dist/transport/adaptive-mode.js.map +1 -0
- package/dist/transport/mqtt-client.d.ts +69 -0
- package/dist/transport/mqtt-client.js +365 -0
- package/dist/transport/mqtt-client.js.map +1 -0
- package/dist/transport/topics.d.ts +10 -0
- package/dist/transport/topics.js +13 -0
- package/dist/transport/topics.js.map +1 -0
- package/dist/trips/state-machine.d.ts +38 -0
- package/dist/trips/state-machine.js +118 -0
- package/dist/trips/state-machine.js.map +1 -0
- package/docs/architecture.md +17 -0
- package/docs/development.md +49 -0
- package/docs/implementation-plan.md +1943 -0
- package/docs/original-plan-gap-audit.md +47 -0
- package/docs/pairing.md +17 -0
- package/docs/release.md +52 -0
- package/docs/telemetry-protocol.md +50 -0
- package/docs/trip-detection.md +7 -0
- package/docs/validation.md +35 -0
- package/package.json +80 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Development
|
|
2
|
+
|
|
3
|
+
Use Node.js 20 or newer:
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
npm ci --ignore-scripts
|
|
7
|
+
npm run lint
|
|
8
|
+
npm run typecheck
|
|
9
|
+
npm test
|
|
10
|
+
npm run build
|
|
11
|
+
npm run measure:protocol
|
|
12
|
+
npm run measure:outbox -- 300
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Docker end-to-end test
|
|
16
|
+
|
|
17
|
+
Docker Engine with Compose v2 can run the packaged plugin in a complete disposable stack:
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
npm run test:docker
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
The command:
|
|
24
|
+
|
|
25
|
+
1. Builds the local source into an npm tarball and installs that tarball in a pinned official Signal K image.
|
|
26
|
+
2. Generates a short-lived local certificate authority at runtime; no private key is committed.
|
|
27
|
+
3. Starts a verified HTTPS pairing/ACK service and TLS-only Mosquitto broker.
|
|
28
|
+
4. Starts Signal K with its synthesized NMEA 2000 stream and the normal production plugin configuration path.
|
|
29
|
+
5. Verifies pairing, every approved navigation/depth/apparent-wind field supplied by the sample, MQTT 5/QoS 1, application acknowledgements and current-state-before-backlog ordering.
|
|
30
|
+
6. Stops the broker, allows the durable queue to grow, kills Signal K with `SIGKILL`, and proves the queued sequences recover after both services return.
|
|
31
|
+
7. Waits for the application-acknowledged queue to drain, prints one-shot container CPU/memory/network statistics, and removes the isolated containers, network and volumes.
|
|
32
|
+
|
|
33
|
+
Set `WAKELOGGER_DOCKER_KEEP=1` to retain a failed or successful stack for inspection. The output identifies its unique Compose project name; remove only that named project when finished. `SIGNALK_IMAGE` may override the pinned multi-architecture image for an explicit server-version test, and Docker's normal `DOCKER_DEFAULT_PLATFORM` setting can select an emulated platform. Emulation remains portability evidence, not physical ARM performance evidence.
|
|
34
|
+
|
|
35
|
+
This harness deliberately contains no production or non-production Wake Logger endpoint. Its pairing code, device identity and credentials are fixed disposable fixture values, the broker accepts clients only inside the isolated Compose network, and the generated CA expires after two days.
|
|
36
|
+
|
|
37
|
+
For a local Signal K server, run `npm link` here and `npm link signalk-wakelogger` in the server configuration directory. The plugin loads from `dist/index.js`; rebuild after TypeScript changes. Startup with `{}` and without network access is a required success state.
|
|
38
|
+
|
|
39
|
+
Tests use Vitest and temporary filesystem directories. Add deterministic delta fixtures for new Signal K paths and crash/recovery cases for changes to outbox semantics. Network integration should use a local MQTT 5 broker with TLS and a fake Wake Logger consumer that acknowledges only after durable test storage.
|
|
40
|
+
|
|
41
|
+
CI also starts an isolated plaintext Mosquitto container from `test/fixtures/mosquitto.conf` for the fast `npm run test:broker` transport test. The full `npm run test:docker` job adds verified TLS, real Signal K sample input, packaging, abrupt restart and durable recovery coverage. Broker ACL isolation remains part of the private Wake Logger integration and release-environment suites. Never point either public test at a shared or production broker.
|
|
42
|
+
|
|
43
|
+
`npm run measure:outbox -- <samples>` performs an accelerated synced-write stress run using the production file outbox and prints machine-readable CPU, RSS, disk and throughput results. One sample represents one second; use up to `86400`. It deliberately uses a temporary directory and removes it afterwards. This is useful for comparing candidate builds, but only a real-time run of the packaged plugin on target hardware counts as first-vessel evidence.
|
|
44
|
+
|
|
45
|
+
Never add a native runtime dependency without proving installation with lifecycle scripts disabled across the Signal K CI matrix. Protocol changes require tests and an update to `telemetry-protocol.md`; incompatible changes require a protocol version change.
|
|
46
|
+
|
|
47
|
+
The emerging Signal K Database API is deliberately accessed through structural types so released Server API packages can still compile and run the plugin. Test both backend paths. File-backed devices may select the database only after their file queue is empty; database-backed devices must fail safely rather than reuse a file sequence space when the API is unavailable.
|
|
48
|
+
|
|
49
|
+
Release automation currently accepts beta tags only and publishes them under npm's `beta` dist-tag. A stable release workflow will be added only after its acceptance gate is agreed. The package-name bootstrap and OIDC procedure are in [release.md](release.md). See [the original-plan gap audit](original-plan-gap-audit.md) before claiming first-vessel or public-release readiness.
|