@ham2k/extension-tools 0.8.0 → 0.10.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/h2kext-build.mjs CHANGED
@@ -109,7 +109,7 @@ export function sharedModulesPlugin({ sharedDependencies = {}, api = H2KEXT_API_
109
109
  const notOffered = declared.filter((pkg) => !offered.includes(pkg))
110
110
  if (notOffered.length) {
111
111
  throw new BuildError(
112
- `${MANIFEST_ENTRY} declares sharedDependencies the host does not carry (${notOffered.join(", ")}). ` +
112
+ `${MANIFEST_ENTRY} declares sharedDependencies the host does not provide (${notOffered.join(", ")}). ` +
113
113
  "Bundle those into your build instead — only what the host offers can be shared.",
114
114
  )
115
115
  }
@@ -148,11 +148,11 @@ export function sharedModulesPlugin({ sharedDependencies = {}, api = H2KEXT_API_
148
148
  errors: [
149
149
  {
150
150
  text:
151
- `'${args.path}' is carried by the Ham2K extension host, but this bundle does not declare it. ` +
151
+ `'${args.path}' is provided by the Ham2K extension host, but this bundle does not declare it. ` +
152
152
  `Add it to "sharedDependencies" in ${MANIFEST_ENTRY} with the version range you work with ` +
153
153
  `(e.g. {${JSON.stringify(args.path)}: "^${installedVersionOf(args.path, args.resolveDir) ?? "1.0.0"}"}), ` +
154
154
  `or pass inline: [${JSON.stringify(args.path)}] ` +
155
- "to ship your own copy — which is how you use a version the host does not carry.",
155
+ "to ship your own copy — which is how you use a version the host does not provide.",
156
156
  },
157
157
  ],
158
158
  }))
package/h2kext.mjs CHANGED
@@ -31,8 +31,12 @@ import yazl from "yazl"
31
31
  /// manifest's `webSockets` grant; 3 adds timers and `onShow`/`onHide`; 4 lets
32
32
  /// `host.fetch` reach an http-only host the app fronts with its https proxy
33
33
  /// (the QSO Party Hub); 5 adds panel scenes' `scene` kind and what came with
34
- /// it — native controls, `strings`, `layout`, `after` and control `opacity`.
35
- export const H2KEXT_API_VERSION = 5
34
+ /// it — native controls, `strings`, `layout`, `after` and control `opacity`;
35
+ /// 6 adds the scene's `spectrum` control and `host.setRadioSpectrum`; 7 adds
36
+ /// `host.setRadio` (`tuneRadio` stays its alias) with power, keyer speed,
37
+ /// tuner, passband and antennas, the keying calls, what `readRadio` reports of
38
+ /// them, and the scene's host-fed `radio` values.
39
+ export const H2KEXT_API_VERSION = 7
36
40
 
37
41
  /// The first API with `host.webSocket`. A manifest declaring `webSockets`
38
42
  /// under an older one is refused: an older app would install it and fail only
@@ -138,6 +142,8 @@ SHARED_MODULES_BY_API[2] = SHARED_MODULES_BY_API[1]
138
142
  SHARED_MODULES_BY_API[3] = SHARED_MODULES_BY_API[2]
139
143
  SHARED_MODULES_BY_API[4] = SHARED_MODULES_BY_API[3]
140
144
  SHARED_MODULES_BY_API[5] = SHARED_MODULES_BY_API[4]
145
+ SHARED_MODULES_BY_API[6] = SHARED_MODULES_BY_API[5]
146
+ SHARED_MODULES_BY_API[7] = SHARED_MODULES_BY_API[6]
141
147
 
142
148
  /// What a scaffolded extension declares on day one: the eight modules the SDK
143
149
  /// barrel itself reaches, so a project that has written no code yet still
@@ -285,7 +291,7 @@ export function validateAdifFieldsScope(manifest) {
285
291
  if (!hooks.includes("adifFields") || scope === "always") return []
286
292
  if (hooks.some((hook) => typeof hook === "string" && hook.startsWith("ref:"))) return []
287
293
  return [
288
- `'hooks' lists 'adifFields' but no 'ref:' type — the full ADIF export asks an extension only about contacts carrying a reference it handles, ` +
294
+ `'hooks' lists 'adifFields' but no 'ref:' type — the full ADIF export asks an extension only about contacts with a reference it handles, ` +
289
295
  `so these fields would never be written; declare the 'ref:' types, or set "adifFieldsScope": "always" (docs/extensions/hooks.md)`,
290
296
  ]
291
297
  }
@@ -343,7 +349,7 @@ export function validateManifest(manifest, { source = MANIFEST_ENTRY, forceName
343
349
  const offered = sharedModulesFor(manifest.api)
344
350
  for (const [pkg, range] of Object.entries(declared)) {
345
351
  if (!offered.includes(pkg)) {
346
- say(`'sharedDependencies' names '${pkg}', which the host does not carry — bundle it into your build instead`)
352
+ say(`'sharedDependencies' names '${pkg}', which the host does not provide — bundle it into your build instead`)
347
353
  } else if (typeof range !== "string" || range.trim() === "") {
348
354
  say(`'sharedDependencies' entry '${pkg}' needs a version range, e.g. "^1.0.0"`)
349
355
  }
@@ -355,7 +361,7 @@ export function validateManifest(manifest, { source = MANIFEST_ENTRY, forceName
355
361
  // key the host does not define hides the extension forever, with nothing in
356
362
  // the UI to explain it, so a distributed bundle must not carry one.
357
363
  if (manifest.experiments !== undefined) {
358
- say("'experiments' gates on the app's own experiment catalog and would hide this extension permanently — remove it")
364
+ say("'experiments' refers to the app's own experiment catalog and would hide this extension permanently — remove it")
359
365
  }
360
366
 
361
367
  // The name `relevance` replaced. Nothing reads `geo`, and nothing here
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ham2k/extension-tools",
3
- "version": "0.8.0",
3
+ "version": "0.10.0",
4
4
  "description": "Build and package extensions for the Ham2K Logger",
5
5
  "keywords": [
6
6
  "ham2k",