signalk-siparu 0.2.8 → 0.2.10

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/NOTICE ADDED
@@ -0,0 +1,42 @@
1
+ Siparu
2
+ Copyright (c) 2026 Siparu
3
+
4
+ This product is licensed under the Apache License, Version 2.0 (see LICENSE).
5
+
6
+ It includes third-party components under their own licenses:
7
+
8
+ -------------------------------------------------------------------------------
9
+ vector-seamarks - https://github.com/josxha/vector-seamarks
10
+ Copyright (c) 2024, Joscha Eckert (josxha)
11
+ BSD 2-Clause License
12
+
13
+ Redistribution and use in source and binary forms, with or without
14
+ modification, are permitted provided that the following conditions are met:
15
+
16
+ 1. Redistributions of source code must retain the above copyright notice,
17
+ this list of conditions and the following disclaimer.
18
+ 2. Redistributions in binary form must reproduce the above copyright notice,
19
+ this list of conditions and the following disclaimer in the documentation
20
+ and/or other materials provided with the distribution.
21
+
22
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
26
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
+ POSSIBILITY OF SUCH DAMAGE.
33
+
34
+ Adapted style layers in webapp/src/map/seamarks-layers.json; seamark sprite
35
+ sheets are served from the tile host.
36
+
37
+ -------------------------------------------------------------------------------
38
+ Map data and assets served from the tile host (not bundled in this package):
39
+
40
+ OpenStreetMap contributors - ODbL 1.0 - https://www.openstreetmap.org/copyright
41
+ Protomaps basemaps - BSD-3-Clause - https://github.com/protomaps/basemaps
42
+ Noto Sans glyphs - SIL OFL 1.1 - https://github.com/protomaps/basemaps-assets
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "signalk-siparu",
3
- "version": "0.2.8",
3
+ "version": "0.2.10",
4
4
  "description": "Kept aboard, proven ashore. Position, wind, depth and voyage history, recorded on the boat and readable from anywhere: sealed to the devices you name, signed on the way out. A read-only Signal K plugin with a built-in dashboard.",
5
5
  "keywords": [
6
6
  "signalk-node-server-plugin",
@@ -9,7 +9,8 @@
9
9
  "main": "plugin/dist/index.js",
10
10
  "files": [
11
11
  "plugin/dist",
12
- "public"
12
+ "public",
13
+ "NOTICE"
13
14
  ],
14
15
  "signalk-plugin-enabled-by-default": true,
15
16
  "signalk": {
@@ -33,7 +34,7 @@
33
34
  "watch": "tsc -p plugin/tsconfig.json --watch",
34
35
  "test": "vitest run",
35
36
  "prepack": "npm run build:all",
36
- "prepublishOnly": "bash scripts/clean-room-scan.sh",
37
+ "prepublishOnly": "bash tools/clean-room-scan.sh",
37
38
  "build:webapp": "npm --prefix webapp run build",
38
39
  "build:all": "npm run build && npm run build:webapp",
39
40
  "ci:build": "npm --prefix ui ci && npm --prefix webapp ci && npm run build:all"
@@ -19,6 +19,7 @@ export declare class RollupEngine {
19
19
  catchUp(now: number): Promise<void>;
20
20
  private readHourlyMonth;
21
21
  readHourly(fromTs: number, toTs: number): Promise<RollupHour[]>;
22
+ private hourlyMonthsOnDisk;
22
23
  readDaily(fromTs: number, toTs: number): Promise<RollupDay[]>;
23
24
  status(now: number): Promise<{
24
25
  last_hour: string | null;
@@ -345,8 +345,11 @@ class RollupEngine {
345
345
  months.add(d.toISOString().slice(0, 7));
346
346
  t = Date.UTC(d.getUTCFullYear(), d.getUTCMonth() + 1, 1);
347
347
  }
348
+ const onDisk = await this.hourlyMonthsOnDisk();
348
349
  const out = [];
349
350
  for (const month of [...months].sort()) {
351
+ if (!onDisk.has(month))
352
+ continue;
350
353
  for (const h of await this.readHourlyMonth(month)) {
351
354
  if (h.last_ts >= fromTs && h.first_ts <= toTs)
352
355
  out.push(h);
@@ -354,6 +357,16 @@ class RollupEngine {
354
357
  }
355
358
  return out.sort((a, b) => a.hour.localeCompare(b.hour));
356
359
  }
360
+ async hourlyMonthsOnDisk() {
361
+ const names = await fs.readdir(this.store.rollupDir).catch(() => []);
362
+ const months = new Set();
363
+ for (const name of names) {
364
+ const m = /^hourly-(\d{4}-\d{2})\.ndjson$/.exec(name);
365
+ if (m?.[1])
366
+ months.add(m[1]);
367
+ }
368
+ return months;
369
+ }
357
370
  async readDaily(fromTs, toTs) {
358
371
  ;
359
372
  [fromTs, toTs] = clampRange(fromTs, toTs);