signalk-pypilot-newui 2.7.1 → 2.7.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 CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.7.2 — 2026-09-14 — Registry score bump
4
+
5
+ No code change vs 2.7.1. Adds a smoke test suite (Node built-in test
6
+ runner, no extra devDependencies) so `npm test` passes for the Signal K
7
+ Plugin Registry, and clears a `high` `npm audit` finding in a
8
+ transitive dependency. Together these lift the plugin's registry
9
+ score by ~45 points.
10
+
3
11
  ## 2.7.1 — 2026-09-14
4
12
 
5
13
  Sea-trial release. Big reliability upgrade after intensive on-water
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ // Minimal smoke tests for the Signal K plugin registry.
3
+ // Uses node:test (built-in, no devDependencies pulled) so it works when
4
+ // the registry clones the source and runs `npm test`. We do NOT call
5
+ // start() here because start() opens a socket.io connection to
6
+ // pypilot_web and would hang the test runner. The registry does its
7
+ // own activate check with the schema defaults.
8
+ var __importDefault = (this && this.__importDefault) || function (mod) {
9
+ return (mod && mod.__esModule) ? mod : { "default": mod };
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const node_test_1 = require("node:test");
13
+ const strict_1 = __importDefault(require("node:assert/strict"));
14
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
15
+ const pluginFactory = require("../index");
16
+ (0, node_test_1.describe)("signalk-pypilot-newui plugin", () => {
17
+ const app = {
18
+ debug: () => { },
19
+ error: () => { },
20
+ setPluginStatus: () => { },
21
+ setPluginError: () => { },
22
+ selfId: "test-vessel",
23
+ getPath: () => undefined,
24
+ getSelfPath: () => undefined,
25
+ handleMessage: () => { },
26
+ registerPutHandler: () => { },
27
+ registerActionHandler: () => { },
28
+ registerAutopilotProvider: () => { },
29
+ subscriptionmanager: {
30
+ subscribe: () => { },
31
+ },
32
+ streambundle: {
33
+ getSelfBus: () => ({ onValue: () => () => { }, subscribe: () => ({ unsubscribe: () => { } }) }),
34
+ },
35
+ savePluginOptions: (_o, cb) => cb(),
36
+ readPluginOptions: () => ({ configuration: {} }),
37
+ };
38
+ const plugin = pluginFactory(app);
39
+ (0, node_test_1.it)("exports a factory that returns a plugin object", () => {
40
+ strict_1.default.equal(typeof pluginFactory, "function");
41
+ strict_1.default.ok(plugin, "factory returned a truthy plugin object");
42
+ });
43
+ (0, node_test_1.it)("exposes id and name", () => {
44
+ strict_1.default.equal(typeof plugin.id, "string");
45
+ strict_1.default.ok(plugin.id.length > 0, "plugin.id is non-empty");
46
+ strict_1.default.equal(typeof plugin.name, "string");
47
+ strict_1.default.ok(plugin.name.length > 0, "plugin.name is non-empty");
48
+ });
49
+ (0, node_test_1.it)("exposes start and stop functions", () => {
50
+ strict_1.default.equal(typeof plugin.start, "function");
51
+ strict_1.default.equal(typeof plugin.stop, "function");
52
+ });
53
+ (0, node_test_1.it)("exposes a schema function that returns a valid JSON Schema object", () => {
54
+ strict_1.default.equal(typeof plugin.schema, "function");
55
+ const s = plugin.schema();
56
+ strict_1.default.equal(s.type, "object");
57
+ strict_1.default.ok(s.properties, "schema has properties");
58
+ // host and port are the two required connection fields.
59
+ strict_1.default.ok(s.properties.host, "schema declares host");
60
+ strict_1.default.ok(s.properties.port, "schema declares port");
61
+ // Port ships with a sensible default so the registry can activate
62
+ // without user input.
63
+ strict_1.default.equal(s.properties.port.default, 80);
64
+ });
65
+ (0, node_test_1.it)("stop() is safe to call when nothing was started", () => {
66
+ // Must not throw. start() is intentionally not exercised here — it
67
+ // opens a real socket.io client.
68
+ strict_1.default.doesNotThrow(() => plugin.stop());
69
+ });
70
+ });
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "signalk-pypilot-newui",
3
- "version": "2.7.1",
3
+ "version": "2.7.2",
4
4
  "description": "Signal K friendly UI for the pypilot autopilot, with the capability to spread its functions and buttons to other programs like KIP, WilhelmSK and freeboard. Touch-first mobile visor + full pypilot data (servo, gains, calibration, tack, warnings) as first-class Signal K paths and Simple Switches. Coexists with pypilot-autopilot-provider.",
5
5
  "main": "./dist/index.js",
6
6
  "scripts": {
7
7
  "build": "tsc",
8
8
  "clean": "rimraf dist",
9
+ "test": "tsc && node --test dist/test/plugin.test.js",
9
10
  "prepack": "npm run build"
10
11
  },
11
12
  "keywords": [