@ham2k/extension-tools 0.7.0 → 0.9.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 +3 -3
- package/h2kext.mjs +9 -5
- package/package.json +1 -1
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
|
|
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
|
|
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
|
|
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
|
@@ -30,8 +30,10 @@ import yazl from "yazl"
|
|
|
30
30
|
/// without it — not for every addition. 2 adds `host.webSocket` and the
|
|
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
|
-
/// (the QSO Party Hub)
|
|
34
|
-
|
|
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
|
+
/// 6 adds the scene's `spectrum` control and `host.setRadioSpectrum`.
|
|
36
|
+
export const H2KEXT_API_VERSION = 6
|
|
35
37
|
|
|
36
38
|
/// The first API with `host.webSocket`. A manifest declaring `webSockets`
|
|
37
39
|
/// under an older one is refused: an older app would install it and fail only
|
|
@@ -136,6 +138,8 @@ export const SHARED_MODULES_BY_API = {
|
|
|
136
138
|
SHARED_MODULES_BY_API[2] = SHARED_MODULES_BY_API[1]
|
|
137
139
|
SHARED_MODULES_BY_API[3] = SHARED_MODULES_BY_API[2]
|
|
138
140
|
SHARED_MODULES_BY_API[4] = SHARED_MODULES_BY_API[3]
|
|
141
|
+
SHARED_MODULES_BY_API[5] = SHARED_MODULES_BY_API[4]
|
|
142
|
+
SHARED_MODULES_BY_API[6] = SHARED_MODULES_BY_API[5]
|
|
139
143
|
|
|
140
144
|
/// What a scaffolded extension declares on day one: the eight modules the SDK
|
|
141
145
|
/// barrel itself reaches, so a project that has written no code yet still
|
|
@@ -283,7 +287,7 @@ export function validateAdifFieldsScope(manifest) {
|
|
|
283
287
|
if (!hooks.includes("adifFields") || scope === "always") return []
|
|
284
288
|
if (hooks.some((hook) => typeof hook === "string" && hook.startsWith("ref:"))) return []
|
|
285
289
|
return [
|
|
286
|
-
`'hooks' lists 'adifFields' but no 'ref:' type — the full ADIF export asks an extension only about contacts
|
|
290
|
+
`'hooks' lists 'adifFields' but no 'ref:' type — the full ADIF export asks an extension only about contacts with a reference it handles, ` +
|
|
287
291
|
`so these fields would never be written; declare the 'ref:' types, or set "adifFieldsScope": "always" (docs/extensions/hooks.md)`,
|
|
288
292
|
]
|
|
289
293
|
}
|
|
@@ -341,7 +345,7 @@ export function validateManifest(manifest, { source = MANIFEST_ENTRY, forceName
|
|
|
341
345
|
const offered = sharedModulesFor(manifest.api)
|
|
342
346
|
for (const [pkg, range] of Object.entries(declared)) {
|
|
343
347
|
if (!offered.includes(pkg)) {
|
|
344
|
-
say(`'sharedDependencies' names '${pkg}', which the host does not
|
|
348
|
+
say(`'sharedDependencies' names '${pkg}', which the host does not provide — bundle it into your build instead`)
|
|
345
349
|
} else if (typeof range !== "string" || range.trim() === "") {
|
|
346
350
|
say(`'sharedDependencies' entry '${pkg}' needs a version range, e.g. "^1.0.0"`)
|
|
347
351
|
}
|
|
@@ -353,7 +357,7 @@ export function validateManifest(manifest, { source = MANIFEST_ENTRY, forceName
|
|
|
353
357
|
// key the host does not define hides the extension forever, with nothing in
|
|
354
358
|
// the UI to explain it, so a distributed bundle must not carry one.
|
|
355
359
|
if (manifest.experiments !== undefined) {
|
|
356
|
-
say("'experiments'
|
|
360
|
+
say("'experiments' refers to the app's own experiment catalog and would hide this extension permanently — remove it")
|
|
357
361
|
}
|
|
358
362
|
|
|
359
363
|
// The name `relevance` replaced. Nothing reads `geo`, and nothing here
|