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