@shayc/open-board-format 0.1.0 → 0.1.1
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/CHANGELOG.md +7 -0
- package/README.md +22 -22
- package/dist/index.mjs +2 -2
- package/package.json +23 -6
package/CHANGELOG.md
ADDED
package/README.md
CHANGED
|
@@ -112,35 +112,35 @@ if (result.success) {
|
|
|
112
112
|
|
|
113
113
|
### Utilities
|
|
114
114
|
|
|
115
|
-
| Function
|
|
116
|
-
|
|
|
115
|
+
| Function | Description |
|
|
116
|
+
| ---------------- | -------------------------------------------------------- |
|
|
117
117
|
| `isZip(archive)` | Check if an `ArrayBuffer` starts with a ZIP magic number |
|
|
118
118
|
| `zip(entries)` | Create a ZIP from a map of paths to buffers |
|
|
119
119
|
| `unzip(archive)` | Extract a ZIP into a map of paths to `Uint8Array` |
|
|
120
120
|
|
|
121
121
|
### Types
|
|
122
122
|
|
|
123
|
-
| Type | Description
|
|
124
|
-
| --------------------- |
|
|
125
|
-
| `OBFBoard` | A single communication board
|
|
126
|
-
| `OBFGrid` | Grid layout (rows, columns, order)
|
|
127
|
-
| `OBFButton` | A button on the board
|
|
128
|
-
| `OBFButtonAction` | Button action (spelling or specialty)
|
|
129
|
-
| `OBFSpellingAction` | Spelling action (e.g., `+s`)
|
|
130
|
-
| `OBFSpecialtyAction` | Specialty action (e.g., `:clear`)
|
|
131
|
-
| `OBFLoadBoard` | Reference to load another board
|
|
132
|
-
| `OBFMedia` | Common media properties (base for `OBFImage` and `OBFSound`)
|
|
133
|
-
| `OBFImage` | An image resource (extends `OBFMedia`)
|
|
134
|
-
| `OBFSound` | A sound resource (extends `OBFMedia`)
|
|
135
|
-
| `OBFSymbolInfo` | Symbol set reference
|
|
136
|
-
| `OBFManifest` | OBZ package manifest
|
|
123
|
+
| Type | Description |
|
|
124
|
+
| --------------------- | --------------------------------------------------------------------------- |
|
|
125
|
+
| `OBFBoard` | A single communication board |
|
|
126
|
+
| `OBFGrid` | Grid layout (rows, columns, order) |
|
|
127
|
+
| `OBFButton` | A button on the board |
|
|
128
|
+
| `OBFButtonAction` | Button action (spelling or specialty) |
|
|
129
|
+
| `OBFSpellingAction` | Spelling action (e.g., `+s`) |
|
|
130
|
+
| `OBFSpecialtyAction` | Specialty action (e.g., `:clear`) |
|
|
131
|
+
| `OBFLoadBoard` | Reference to load another board |
|
|
132
|
+
| `OBFMedia` | Common media properties (base for `OBFImage` and `OBFSound`) |
|
|
133
|
+
| `OBFImage` | An image resource (extends `OBFMedia`) |
|
|
134
|
+
| `OBFSound` | A sound resource (extends `OBFMedia`) |
|
|
135
|
+
| `OBFSymbolInfo` | Symbol set reference |
|
|
136
|
+
| `OBFManifest` | OBZ package manifest |
|
|
137
137
|
| `ParsedOBZ` | Return type of `extractOBZ` / `loadOBZ` — `{ manifest, boards, resources }` |
|
|
138
|
-
| `OBFID` | Unique identifier (string, coerced from number)
|
|
139
|
-
| `OBFFormatVersion` | Format version string (e.g., `open-board-0.1`)
|
|
140
|
-
| `OBFLicense` | Licensing information
|
|
141
|
-
| `OBFLocaleCode` | BCP 47 locale code
|
|
142
|
-
| `OBFLocalizedStrings` | Key-value string translations
|
|
143
|
-
| `OBFStrings` | Multi-locale string translations
|
|
138
|
+
| `OBFID` | Unique identifier (string, coerced from number) |
|
|
139
|
+
| `OBFFormatVersion` | Format version string (e.g., `open-board-0.1`) |
|
|
140
|
+
| `OBFLicense` | Licensing information |
|
|
141
|
+
| `OBFLocaleCode` | BCP 47 locale code |
|
|
142
|
+
| `OBFLocalizedStrings` | Key-value string translations |
|
|
143
|
+
| `OBFStrings` | Multi-locale string translations |
|
|
144
144
|
|
|
145
145
|
## Development
|
|
146
146
|
|
package/dist/index.mjs
CHANGED
|
@@ -264,7 +264,7 @@ function parseOBF(json) {
|
|
|
264
264
|
try {
|
|
265
265
|
rawBoard = JSON.parse(sanitized);
|
|
266
266
|
} catch (error) {
|
|
267
|
-
throw new Error(buildParseErrorMessage(error));
|
|
267
|
+
throw new Error(buildParseErrorMessage(error), { cause: error });
|
|
268
268
|
}
|
|
269
269
|
return validateOBF(rawBoard);
|
|
270
270
|
}
|
|
@@ -420,7 +420,7 @@ function parseManifest(json) {
|
|
|
420
420
|
try {
|
|
421
421
|
data = JSON.parse(json);
|
|
422
422
|
} catch (error) {
|
|
423
|
-
throw new Error(`Invalid manifest: JSON parse failed${error?.message ? ` — ${error.message}` : ""}
|
|
423
|
+
throw new Error(`Invalid manifest: JSON parse failed${error?.message ? ` — ${error.message}` : ""}`, { cause: error });
|
|
424
424
|
}
|
|
425
425
|
const result = OBFManifestSchema.safeParse(data);
|
|
426
426
|
if (!result.success) throw new Error(`Invalid manifest: ${result.error.message}`);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shayc/open-board-format",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.1",
|
|
5
5
|
"description": "Parse, validate, and create Open Board Format (OBF/OBZ) files for AAC applications.",
|
|
6
6
|
"author": "Shay Cojocaru <shayc@outlook.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -25,20 +25,34 @@
|
|
|
25
25
|
},
|
|
26
26
|
"types": "./dist/index.d.mts",
|
|
27
27
|
"files": [
|
|
28
|
-
"dist"
|
|
28
|
+
"dist",
|
|
29
|
+
"CHANGELOG.md"
|
|
29
30
|
],
|
|
30
31
|
"scripts": {
|
|
31
32
|
"build": "tsdown",
|
|
32
33
|
"dev": "tsdown --watch",
|
|
33
|
-
"
|
|
34
|
+
"lint": "eslint .",
|
|
35
|
+
"format": "prettier --write .",
|
|
36
|
+
"test": "vitest run",
|
|
34
37
|
"typecheck": "tsc --noEmit",
|
|
35
|
-
"prepublishOnly": "npm run build"
|
|
38
|
+
"prepublishOnly": "npm run build && npm run pack:check",
|
|
39
|
+
"pack:check": "publint --strict",
|
|
40
|
+
"changeset": "changeset",
|
|
41
|
+
"version": "changeset version",
|
|
42
|
+
"release": "npm run build && changeset publish"
|
|
36
43
|
},
|
|
37
44
|
"devDependencies": {
|
|
38
|
-
"@
|
|
39
|
-
"
|
|
45
|
+
"@changesets/cli": "^2.31.0",
|
|
46
|
+
"@eslint/js": "^10.0.1",
|
|
47
|
+
"@types/node": "^25.9.1",
|
|
48
|
+
"eslint": "^10.4.0",
|
|
49
|
+
"eslint-config-prettier": "^10.1.8",
|
|
50
|
+
"globals": "^17.6.0",
|
|
51
|
+
"prettier": "^3.8.3",
|
|
52
|
+
"publint": "^0.3.21",
|
|
40
53
|
"tsdown": "^0.22.0",
|
|
41
54
|
"typescript": "~6.0.3",
|
|
55
|
+
"typescript-eslint": "^8.60.0",
|
|
42
56
|
"vitest": "^4.1.6"
|
|
43
57
|
},
|
|
44
58
|
"dependencies": {
|
|
@@ -47,5 +61,8 @@
|
|
|
47
61
|
},
|
|
48
62
|
"publishConfig": {
|
|
49
63
|
"access": "public"
|
|
64
|
+
},
|
|
65
|
+
"engines": {
|
|
66
|
+
"node": ">=24"
|
|
50
67
|
}
|
|
51
68
|
}
|