signalk-livedepth-plugin 0.3.16 → 0.3.18

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
@@ -4,6 +4,28 @@ All notable changes to this project are documented here, newest first. The
4
4
  format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and
5
5
  versions follow [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [0.3.18] - 2026-11-02
8
+
9
+ ### Changed
10
+
11
+ - **The layer now always draws the plugin's bathymetry grid.** The History API
12
+ is no longer offered as a depth source in the layer's settings; the source
13
+ selector and its history-only window/interval fields are gone. The separate
14
+ History import in the plugin's server settings is unchanged — that is what
15
+ seeds the grid. Settings saved with the old History source migrate
16
+ automatically.
17
+
18
+ ## [0.3.17] - 2026-11-01
19
+
20
+ ### Fixed
21
+
22
+ - **The extension no longer disappears after saving the plugin configuration.**
23
+ Saving stops and starts the plugin, and the server unregisters a plugin's
24
+ resource providers on stop. Registration was guarded by a module-level flag
25
+ that outlived the restart, so the extension dropped out of
26
+ `/signalk/v2/api/resources/plotterExtensions` even though depth collection
27
+ resumed. The provider is now registered on every start.
28
+
7
29
  ## [0.3.16] - 2026-11-01
8
30
 
9
31
  ### Added
@@ -1,7 +1,11 @@
1
1
  import type { ServerAPI } from "@signalk/server-api";
2
2
  /** Offer the plotter extension: register the read-only `plotterExtensions`
3
- * resource and mount the extension's pages. Safe to call on every start — the
4
- * provider is registered and the assets mounted once; `isRunning` reflects the
5
- * plugin's current state so the extension leaves when the plugin is disabled. */
3
+ * resource and mount the extension's pages. Register on every start — the
4
+ * server unregisters a plugin's resource providers when it stops, so the flag
5
+ * that used to guard this would leave the extension missing after a restart.
6
+ * Registration replaces the provider by type, so repeating it is safe. The
7
+ * static assets are mounted once; the server keeps the route across a restart.
8
+ * `isRunning` reflects the plugin's current state so the extension leaves when
9
+ * the plugin is disabled. */
6
10
  export declare function registerPlotterExtension(app: ServerAPI, isRunning: () => boolean): void;
7
11
  //# sourceMappingURL=provider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/plotterext/provider.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAYrD;;;iFAGiF;AACjF,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,SAAS,EACd,SAAS,EAAE,MAAM,OAAO,GACvB,IAAI,CAgCN"}
1
+ {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/plotterext/provider.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAWrD;;;;;;;6BAO6B;AAC7B,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,SAAS,EACd,SAAS,EAAE,MAAM,OAAO,GACvB,IAAI,CA6BN"}
@@ -2,40 +2,40 @@ import { createRequire } from "node:module";
2
2
  import { dirname, join } from "node:path";
3
3
  import { fileURLToPath } from "node:url";
4
4
  import { ASSET_BASE, PLUGIN_ID, buildManifest } from "./manifest.js";
5
- let registered = false;
6
5
  let mounted = false;
7
6
  /** Offer the plotter extension: register the read-only `plotterExtensions`
8
- * resource and mount the extension's pages. Safe to call on every start — the
9
- * provider is registered and the assets mounted once; `isRunning` reflects the
10
- * plugin's current state so the extension leaves when the plugin is disabled. */
7
+ * resource and mount the extension's pages. Register on every start — the
8
+ * server unregisters a plugin's resource providers when it stops, so the flag
9
+ * that used to guard this would leave the extension missing after a restart.
10
+ * Registration replaces the provider by type, so repeating it is safe. The
11
+ * static assets are mounted once; the server keeps the route across a restart.
12
+ * `isRunning` reflects the plugin's current state so the extension leaves when
13
+ * the plugin is disabled. */
11
14
  export function registerPlotterExtension(app, isRunning) {
12
15
  const a = app;
13
- if (!registered) {
14
- if (typeof a.registerResourceProvider === "function") {
15
- a.registerResourceProvider({
16
- type: "plotterExtensions",
17
- methods: {
18
- listResources: async () => isRunning() ? { [PLUGIN_ID]: buildManifest() } : {},
19
- getResource: async (id) => {
20
- if (!isRunning() || id !== PLUGIN_ID) {
21
- throw new Error(`No such plotterExtensions resource: ${id}`);
22
- }
23
- return buildManifest();
24
- },
25
- setResource: async () => {
26
- throw new Error(`${PLUGIN_ID} is a read-only provider`);
27
- },
28
- deleteResource: async () => {
29
- throw new Error(`${PLUGIN_ID} is a read-only provider`);
30
- },
16
+ if (typeof a.registerResourceProvider === "function") {
17
+ a.registerResourceProvider({
18
+ type: "plotterExtensions",
19
+ methods: {
20
+ listResources: async () => isRunning() ? { [PLUGIN_ID]: buildManifest() } : {},
21
+ getResource: async (id) => {
22
+ if (!isRunning() || id !== PLUGIN_ID) {
23
+ throw new Error(`No such plotterExtensions resource: ${id}`);
24
+ }
25
+ return buildManifest();
31
26
  },
32
- });
33
- registered = true;
34
- a.debug(`${PLUGIN_ID}: plotter extension offered`);
35
- }
36
- else {
37
- a.debug(`${PLUGIN_ID}: server has no resource provider registry`);
38
- }
27
+ setResource: async () => {
28
+ throw new Error(`${PLUGIN_ID} is a read-only provider`);
29
+ },
30
+ deleteResource: async () => {
31
+ throw new Error(`${PLUGIN_ID} is a read-only provider`);
32
+ },
33
+ },
34
+ });
35
+ a.debug(`${PLUGIN_ID}: plotter extension offered`);
36
+ }
37
+ else {
38
+ a.debug(`${PLUGIN_ID}: server has no resource provider registry`);
39
39
  }
40
40
  mountAssets(a);
41
41
  }
@@ -1 +1 @@
1
- {"version":3,"file":"provider.js","sourceRoot":"","sources":["../../src/plotterext/provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAQrE,IAAI,UAAU,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