@ham2k/extension-sdk 0.2.0 → 0.4.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/docs/templates.md CHANGED
@@ -19,7 +19,7 @@ const text = renderTemplate("{{ op.station }} — {{ op.qsoCount }} QSOs", templ
19
19
 
20
20
  A template is DATA. Liquid parses and interprets; Handlebars compiles
21
21
  through `new Function`. These templates are written by operators, copied
22
- between operators, and will eventually be editable in settings, so the one
22
+ between operators, and are editable in settings, so the one
23
23
  that cannot become code is the one to have. Liquid also has comparisons
24
24
  (`{% if op.qsoCount > 100 %}`) and loops built in, where Handlebars needs a
25
25
  registered helper for `>` and Mustache cannot compare at all.
@@ -38,19 +38,19 @@ the namespaces are deliberately polo's. The syntax around them does not:
38
38
 
39
39
  ## What a template can name
40
40
 
41
- | namespace | panel `render` | export filename | ADIF fields |
42
- |---|---|---|---|
43
- | `app` | ✓ | — | ✓ |
44
- | `now` | ✓ | ✓ | ✓ |
45
- | `op` | ✓ | dates only | ✓ |
46
- | `qso` | when the placement's triggers ask for it | — | ✓ |
47
- | `config` | ✓ | — | — |
48
- | `log` | — | ✓ | ✓ |
41
+ | namespace | panel `render` | export filename | ADIF fields | CW message |
42
+ |---|---|---|---|---|
43
+ | `app` | ✓ | — | ✓ | ✓ |
44
+ | `now` | ✓ | ✓ | ✓ | ✓ |
45
+ | `op` | ✓ | ✓ | ✓ | ✓ |
46
+ | `qso` | when the placement's triggers ask for it | — | ✓ | the draft contact, as far as it is typed |
47
+ | `config` | ✓ | — | — | — |
48
+ | `log` | — | ✓ | ✓ | — |
49
49
 
50
50
  A namespace a surface has nothing for is **absent**, not blank — which is
51
- what makes `{% if qso %}` an honest question. Filenames get only the date
52
- half of `op` because a filename is built from parts rather than from an
53
- operation (`exportNames.ts`).
51
+ what makes `{% if qso %}` an honest question. Registered exports get the operation plus the selected file’s `log` values.
52
+ The low-level `exportFilename(parts)` helper still supplies only dates and
53
+ filename parts.
54
54
 
55
55
  ### `app`
56
56
  `app.name` — the platform-appropriate name ("Ham2K Logger" on desktop,
@@ -61,7 +61,8 @@ An ISO-8601 UTC string, for the `date` filter: `{{ now | date: '%H:%M' }}`.
61
61
 
62
62
  ### `op` — the operation
63
63
  `station` (the field as typed, which may hold several comma-separated
64
- callsigns), `stations` (that list, uppercased and deduped), `operator`,
64
+ callsigns; `call` is the same value, the name `qso.call` has), `stations`
65
+ (that list, uppercased and deduped), `operator`,
65
66
  `title` (the generated, ref-derived one), `userTitle` (the operator's own
66
67
  words), `grid`, `refs`, `uuid`, `qsoCount`, `date`, `dateCompact`, `time`,
67
68
  `at`, `startDate`, `startTime`, `startAt`, `endDate`, `endTime`, `endAt`.
@@ -190,15 +191,16 @@ will jump rather than count. Show HH:MM.
190
191
  | what | where | editable |
191
192
  |---|---|---|
192
193
  | Panel documents | `custom-text`'s content and tab name | by the operator, in the panel's config form |
193
- | Export filenames | `sdk/src/exportNames.ts` `NAME_TEMPLATES` | not yet |
194
- | ADIF NOTES / COMMENT / QSLMSG | `core/adif`'s `TEXT_FIELD_TEMPLATES` | not yet |
195
-
196
- COMMENT and QSLMSG are empty, so nothing is written for them. app-polo
197
- defaults COMMENT to the QSO's notes and QSLMSG to the operation's
198
- references; both wait here until there is a settings screen to edit them in,
199
- since a default nobody can see is one nobody can turn off, and these fields
200
- travel to a program's servers.
201
-
202
- Whatever fills them must respect the private/public split: `notes` is the
203
- operator's own words and belongs only in a field the export withholds when
204
- private data is off. NOTES is such a field. COMMENT and QSLMSG are not.
194
+ | Export filenames and titles | Registered export types and `sdk/src/exportSettings.ts` | Settings → Exports, globally and per type |
195
+ | ADIF NOTES / COMMENT / QSLMSG | Export type settings, consumed by `core/adif` | Settings → Exports; empty templates suppress a field |
196
+ | CW messages | Radio settings `cwMessage1..8`, keyed on F1-F8 through the radio (docs/design/cat.md § CW keying) — rendered by the `template` hook (hooks.md) | by the operator, in the Station dialog's Messages… dialog |
197
+
198
+ NOTES and COMMENT default to QSO notes and are withheld when private data
199
+ is off. QSLMSG defaults to empty for program exports, and to the operation’s
200
+ references for the whole-log ADIF. Custom QSL messages may use contact values.
201
+ Templates receive no withheld private or lookup values. File titles obey the
202
+ private-data choice; filename templates are labels for the operator’s files.
203
+
204
+ The `textTemplate` form field provides sample previews and an insertable
205
+ reference; see [forms.md](forms.md). Invalid Liquid reports an error rather
206
+ than silently replacing the operator’s template with a default.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ham2k/extension-sdk",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "description": "Write extensions for the Ham2K Logger: typed hook contracts and the host API",
5
5
  "keywords": [
6
6
  "ham2k",
@@ -10,7 +10,7 @@
10
10
  "sdk",
11
11
  "logging"
12
12
  ],
13
- "license": "MPL-2.0",
13
+ "license": "MIT",
14
14
  "author": "Sebastian Delmont <sd@ham2k.com>",
15
15
  "homepage": "https://ham2k.com",
16
16
  "repository": {
@@ -25,8 +25,17 @@
25
25
  "subpath, so a tool asking this package its own version is told the package",
26
26
  "does not exist. Common enough that npm's own docs call it out."
27
27
  ],
28
+ "//ham2k-source": [
29
+ "A condition only this repo's own test run asks for (`--conditions=ham2k-source`),",
30
+ "so a test can import the SDK by name and get the TypeScript sources rather",
31
+ "than a build of them — the same thing esbuild's alias does when it bundles an",
32
+ "extension. Deliberately not the conventional `development`: the published",
33
+ "tarball ships `dist` and not `src`, and a consumer who happened to run with",
34
+ "that common condition would be pointed at files their install does not have."
35
+ ],
28
36
  "exports": {
29
37
  ".": {
38
+ "ham2k-source": "./src/index.ts",
30
39
  "types": "./dist/index.d.ts",
31
40
  "default": "./dist/index.js"
32
41
  },
@@ -5,7 +5,6 @@
5
5
  "version": "1.0.0",
6
6
  "description": "CQ WW DX points and multipliers, as a worked example",
7
7
  "category": "contest",
8
- "enabledByDefault": false,
9
8
  "icon": "earth",
10
9
  "accentColor": "#B03A2E",
11
10
  "api": 1,
@@ -1,5 +1,5 @@
1
1
  // Copyright ©️ 2026 Sebastian Delmont <sd@ham2k.com>
2
- // SPDX-License-Identifier: MPL-2.0
2
+ // SPDX-License-Identifier: MIT
3
3
  //
4
4
  // SAMPLE — a contest: an exchange to type, and a score to keep.
5
5
  //
@@ -5,7 +5,6 @@
5
5
  "version": "1.0.0",
6
6
  "description": "Looks up callsign details with a free HamQTH.com account",
7
7
  "category": "lookup",
8
- "enabledByDefault": true,
9
8
  "icon": "card-account-details-outline",
10
9
  "accentColor": "#1E6F5C",
11
10
  "api": 1,
@@ -1,5 +1,5 @@
1
1
  // Copyright ©️ 2026 Sebastian Delmont <sd@ham2k.com>
2
- // SPDX-License-Identifier: MPL-2.0
2
+ // SPDX-License-Identifier: MIT
3
3
  //
4
4
  // SAMPLE — a callsign lookup source, with the credentials one needs.
5
5
  //
@@ -5,13 +5,13 @@
5
5
  "version": "1.0.0",
6
6
  "description": "Lake references and activation scoring, as a worked example",
7
7
  "category": "activity",
8
- "enabledByDefault": false,
9
8
  "icon": "waves",
10
9
  "accentColor": "#2F7FA6",
11
10
  "api": 1,
12
11
  "keywords": ["lakes", "activation", "hunting", "sample"],
13
12
  "hooks": ["activity", "adifFields", "adifImport", "dataFile", "ref:k2hrcLlota", "ref:k2hrcLlotaActivation", "scoring"],
14
13
  "domains": ["llota.app"],
14
+ "relevance": { "continents": ["SA"] },
15
15
  "sharedDependencies": {
16
16
  "@ham2k/lib-callsigns": "^1.0.0",
17
17
  "@ham2k/lib-country-files": "^1.0.0",
@@ -1,5 +1,5 @@
1
1
  // Copyright ©️ 2026 Sebastian Delmont <sd@ham2k.com>
2
- // SPDX-License-Identifier: MPL-2.0
2
+ // SPDX-License-Identifier: MIT
3
3
  //
4
4
  // SAMPLE — an award program: references, an offline list, and activation
5
5
  // scoring.
@@ -5,7 +5,6 @@
5
5
  "version": "1.0.0",
6
6
  "description": "A big band, mode and frequency readout across the room",
7
7
  "category": "dashboard",
8
- "enabledByDefault": true,
9
8
  "icon": "radio-tower",
10
9
  "accentColor": "#4C6EF5",
11
10
  "api": 1,
@@ -1,5 +1,5 @@
1
1
  // Copyright ©️ 2026 Sebastian Delmont <sd@ham2k.com>
2
- // SPDX-License-Identifier: MPL-2.0
2
+ // SPDX-License-Identifier: MIT
3
3
  //
4
4
  // SAMPLE — an HTML panel: what the radio is doing, big enough to read from
5
5
  // across the room.