@barmark/cli 0.12.0 → 0.13.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/CHANGELOG.md +19 -1
- package/README.md +4 -1
- package/dist/check.js +6 -1
- package/dist/report.js +9 -2
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,23 @@ package uses [semantic versioning](https://semver.org/).
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.13.0] - 2026-11-14
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- **`check` prints a problem's suggestion** (so do `part`, `transpose` and
|
|
14
|
+
`export`, which print problems the same way): `bad.chart.md:4: error: C(b2): "b2" is
|
|
15
|
+
not a tone a parenthesis can add (write C(b9))`, for errors and warnings.
|
|
16
|
+
`--format github` carries the same sentence in the annotation, and
|
|
17
|
+
`--format json` a `suggestion` field beside `message`, absent when there
|
|
18
|
+
is none. A problem with no suggestion prints as before.
|
|
19
|
+
- **`check`, `format`, `render` and the exports read a flat sixth, an
|
|
20
|
+
`add` before any tone and `Δ9`** (`F#m(b6)`, `Cadd13`, `CΔ9`), as
|
|
21
|
+
`barmark` now reads them.
|
|
22
|
+
- **Uses** barmark 0.24.0, @barmark/render 0.20.1, @barmark/musicxml
|
|
23
|
+
0.9.2, @barmark/score 0.6.1 and @barmark/midi 0.3.4 (and through them
|
|
24
|
+
@barmark/fretboard 0.1.1 and @barmark/sync 0.4.2).
|
|
25
|
+
|
|
9
26
|
## [0.12.0] - 2026-11-13
|
|
10
27
|
|
|
11
28
|
### Added
|
|
@@ -394,7 +411,8 @@ The first release of the `barmark` command. Uses `barmark` 0.8.0 and
|
|
|
394
411
|
- **The `barmark` command:** `check`, `format`, `render` and `transpose`
|
|
395
412
|
for `.chart.md` files, on npm and as standalone binaries.
|
|
396
413
|
|
|
397
|
-
[Unreleased]: https://github.com/kevinpeckham/barmark/compare/cli-v0.
|
|
414
|
+
[Unreleased]: https://github.com/kevinpeckham/barmark/compare/cli-v0.13.0...HEAD
|
|
415
|
+
[0.13.0]: https://github.com/kevinpeckham/barmark/compare/cli-v0.12.0...cli-v0.13.0
|
|
398
416
|
[0.12.0]: https://github.com/kevinpeckham/barmark/compare/cli-v0.11.3...cli-v0.12.0
|
|
399
417
|
[0.11.3]: https://github.com/kevinpeckham/barmark/compare/cli-v0.11.2...cli-v0.11.3
|
|
400
418
|
[0.11.2]: https://github.com/kevinpeckham/barmark/compare/cli-v0.11.1...cli-v0.11.2
|
package/README.md
CHANGED
|
@@ -49,7 +49,10 @@ barmark render song.chart.md --diagrams guitar --left-handed --out song.html #
|
|
|
49
49
|
barmark transpose song.chart.md --to E # or --semitones -2
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
A problem the parser can suggest a fix for ends with it, as `song.chart.md:4:
|
|
53
|
+
error: C(b2): "b2" is not a tone a parenthesis can add (write C(b9))`
|
|
54
|
+
(`check`, `export`, `part` and `transpose`; `--format json` gives it as a
|
|
55
|
+
`suggestion` field). `check --format json` prints the diagnostics for other tools. `render`
|
|
53
56
|
takes the renderer's options as flags: `--theme auto|light|dark`,
|
|
54
57
|
`--numerals nashville|roman`, `--no-bar-numbers`, `--rehearsal-letters`,
|
|
55
58
|
`--no-wrap`, `--columns shared|row`, `--diagrams guitar` (a strip of guitar
|
package/dist/check.js
CHANGED
|
@@ -20,7 +20,12 @@ export async function check(args, io) {
|
|
|
20
20
|
if (format === "json") {
|
|
21
21
|
const files = results.map(({ path, diagnostics }) => ({
|
|
22
22
|
file: path,
|
|
23
|
-
diagnostics: diagnostics.map(({ line, severity, message }) => ({
|
|
23
|
+
diagnostics: diagnostics.map(({ line, severity, message, suggestion }) => ({
|
|
24
|
+
line,
|
|
25
|
+
severity,
|
|
26
|
+
message,
|
|
27
|
+
...(suggestion ? { suggestion } : {}),
|
|
28
|
+
})),
|
|
24
29
|
}));
|
|
25
30
|
io.stdout(`${JSON.stringify(files, null, 2)}\n`);
|
|
26
31
|
}
|
package/dist/report.js
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A diagnostic's message, ending with what to write instead when the parser
|
|
3
|
+
* has a suggestion the message does not already spell out.
|
|
4
|
+
*/
|
|
5
|
+
const sentence = (d) => d.suggestion && !d.message.includes(d.suggestion)
|
|
6
|
+
? `${d.message} (write ${d.suggestion})`
|
|
7
|
+
: d.message;
|
|
1
8
|
export function textLine(path, d) {
|
|
2
|
-
return `${path}:${d.line}: ${d.severity}: ${d
|
|
9
|
+
return `${path}:${d.line}: ${d.severity}: ${sentence(d)}`;
|
|
3
10
|
}
|
|
4
11
|
/** GitHub's workflow-command escaping for a message. */
|
|
5
12
|
const escapeData = (text) => text.replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A");
|
|
6
13
|
export function githubLine(path, d) {
|
|
7
14
|
const file = escapeData(path).replace(/:/g, "%3A").replace(/,/g, "%2C");
|
|
8
|
-
return `::${d.severity} file=${file},line=${d.line}::${escapeData(d
|
|
15
|
+
return `::${d.severity} file=${file},line=${d.line}::${escapeData(sentence(d))}`;
|
|
9
16
|
}
|
|
10
17
|
const count = (n, noun) => `${n} ${noun}${n === 1 ? "" : "s"}`;
|
|
11
18
|
export function summary(files, errors, warnings) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@barmark/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "The barmark command: check, format, render, transpose and export barmark chord charts (.chart.md) from the terminal and in CI.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
"url": "https://github.com/kevinpeckham/barmark/issues"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"barmark": "0.
|
|
41
|
-
"@barmark/render": "0.20.
|
|
42
|
-
"@barmark/musicxml": "0.9.
|
|
43
|
-
"@barmark/midi": "0.3.
|
|
44
|
-
"@barmark/score": "0.6.
|
|
40
|
+
"barmark": "0.24.0",
|
|
41
|
+
"@barmark/render": "0.20.1",
|
|
42
|
+
"@barmark/musicxml": "0.9.2",
|
|
43
|
+
"@barmark/midi": "0.3.4",
|
|
44
|
+
"@barmark/score": "0.6.1",
|
|
45
45
|
"verovio": "6.4.1"
|
|
46
46
|
},
|
|
47
47
|
"scripts": {
|