@ham2k/extension-tools 0.11.0 → 0.12.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.
Files changed (2) hide show
  1. package/h2kext.mjs +15 -2
  2. package/package.json +1 -1
package/h2kext.mjs CHANGED
@@ -37,14 +37,22 @@ import yazl from "yazl"
37
37
  /// tuner, passband and antennas, the keying calls, what `readRadio` reports of
38
38
  /// them, and the scene's host-fed `radio` values; 8 adds the Developer
39
39
  /// panel's `target: 'developer'` settings and leaves a settings panel with
40
- /// nothing to show out of the Settings list.
41
- export const H2KEXT_API_VERSION = 8
40
+ /// nothing to show out of the Settings list; 9 hands `ctx.getQsos`'s QSOs
41
+ /// frozen, from the one copy of the log every extension shares, and adds the
42
+ /// `chasing` hook category.
43
+ export const H2KEXT_API_VERSION = 9
42
44
 
43
45
  /// The first API with `host.webSocket`. A manifest declaring `webSockets`
44
46
  /// under an older one is refused: an older app would install it and fail only
45
47
  /// when it tried to connect.
46
48
  export const WEB_SOCKETS_API_VERSION = 2
47
49
 
50
+ /// The first API that calls `chasing` hooks. A manifest promising one under an
51
+ /// older api is refused: an older app would install it and ignore the
52
+ /// program, and for an extension that does nothing else, install a bundle
53
+ /// that silently does nothing.
54
+ export const CHASING_API_VERSION = 9
55
+
48
56
  /// The first API with timers. The build points a bundle's bare `setTimeout`
49
57
  /// and friends at the SDK's only from here on: an older app's kernel hands an
50
58
  /// extension no timers, and a bundle declaring less says it runs there.
@@ -147,6 +155,7 @@ SHARED_MODULES_BY_API[5] = SHARED_MODULES_BY_API[4]
147
155
  SHARED_MODULES_BY_API[6] = SHARED_MODULES_BY_API[5]
148
156
  SHARED_MODULES_BY_API[7] = SHARED_MODULES_BY_API[6]
149
157
  SHARED_MODULES_BY_API[8] = SHARED_MODULES_BY_API[7]
158
+ SHARED_MODULES_BY_API[9] = SHARED_MODULES_BY_API[8]
150
159
 
151
160
  /// What a scaffolded extension declares on day one: the eight modules the SDK
152
161
  /// barrel itself reaches, so a project that has written no code yet still
@@ -336,6 +345,10 @@ export function validateManifest(manifest, { source = MANIFEST_ENTRY, forceName
336
345
  }
337
346
  }
338
347
 
348
+ if (Array.isArray(manifest.hooks) && manifest.hooks.includes("chasing") && Number.isInteger(manifest.api) && manifest.api < CHASING_API_VERSION) {
349
+ say(`'chasing' needs 'api' ${CHASING_API_VERSION} or later — an app older than that would install this and never ask it what a contact claims`)
350
+ }
351
+
339
352
  // An extension with no category is CORE to the host: always enabled, and
340
353
  // never listed in the Extensions panel. That is a status the app grants its
341
354
  // own extensions, not one a distributed bundle may claim for itself — a user
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ham2k/extension-tools",
3
- "version": "0.11.0",
3
+ "version": "0.12.0",
4
4
  "description": "Build and package extensions for the Ham2K Logger",
5
5
  "keywords": [
6
6
  "ham2k",