reladraw 0.17.0 → 0.17.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/README.md CHANGED
@@ -86,7 +86,7 @@ That gets you a copy of the skill at the time you run it, so you'll need to re-r
86
86
 
87
87
  ## Status
88
88
 
89
- Version 0.17.0. Early stage, but works. The parser, layout engine, and SVG renderer are written in TypeScript, with zero runtime dependencies. There is a command-line tool that turns a .reladraw text file into an SVG, and an element that does the same inside a web page.
89
+ Version 0.17.1. Early stage, but works. The parser, layout engine, and SVG renderer are written in TypeScript, with zero runtime dependencies. There is a command-line tool that turns a .reladraw text file into an SVG, and an element that does the same inside a web page.
90
90
 
91
91
  The language isn't stable yet, so expect the syntax to change.
92
92
 
package/SYNTAX.md CHANGED
@@ -1,4 +1,4 @@
1
- # Syntax reference — 0.17.0
1
+ # Syntax reference — 0.17.1
2
2
 
3
3
  What the language accepts. The changelog at the end lists what changed in each published version; 0.17.0's changes are large, and its entry has a table of every old spelling and what to write instead.
4
4
 
@@ -1123,6 +1123,7 @@ reladraw check diagram.reladraw
1123
1123
  | `--guides` | draw the guides |
1124
1124
  | `--checks "<kind>: on, …"` | turn kinds of finding on or off, over the file |
1125
1125
  | `--no-checks` | print no findings; errors still print |
1126
+ | `-v`, `--version` | print the version |
1126
1127
 
1127
1128
  The output is a standalone SVG: every picture is drawn into it as path data, never from a font or a linked file. A web page can draw a diagram in place with `<reladraw-diagram>`; see "In a web page" in the README.
1128
1129
 
@@ -1192,6 +1193,11 @@ Designed and absent from the code.
1192
1193
 
1193
1194
  Pre-1.0, so the minor number is where a breaking change goes. Every removal is refused by name with the replacement quoted, rather than dropped in silence: an older file stops with an error saying what to write instead.
1194
1195
 
1196
+ **0.17.1**
1197
+
1198
+ - **`reladraw --version`**, or `-v`, prints the version.
1199
+ - **The playground waits for a pause in typing** before it redraws a diagram that is slow to draw, so the keystrokes aren't held up behind it. A quick one still redraws on every keystroke. Suggested in #6.
1200
+
1195
1201
  **0.17.0**
1196
1202
 
1197
1203
  The redesign. The tool no longer decides anything the file doesn't say: a gap is exact, nothing moves a box to make room, lines are straight unless told and go only where they are told, and anything that may not read as meant is drawn as written and reported as a finding. Almost every diagram written for 0.16.0 needs changes; the table below gives each old spelling and what to write instead.
package/dist/cli.js CHANGED
@@ -25,6 +25,8 @@ const USAGE = `reladraw — draw a diagram from stated placement
25
25
  --checks turn kinds of finding on or off, over what the file says:
26
26
  --checks "edge-crossings: on, node-overlap: off"
27
27
  --no-checks print no findings. Errors still print.
28
+ -v, --version
29
+ print the version.
28
30
  -h, --help print this.
29
31
  `;
30
32
  const COMMANDS = ['render', 'check'];
@@ -33,6 +35,12 @@ async function main(argv) {
33
35
  process.stdout.write(USAGE);
34
36
  return argv.length === 0 ? 1 : 0;
35
37
  }
38
+ if (argv.includes('-v') || argv.includes('--version')) {
39
+ // package.json ships beside dist/, so the number is the installed one.
40
+ const pkg = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8'));
41
+ process.stdout.write(`${pkg.version}\n`);
42
+ return 0;
43
+ }
36
44
  const verb = argv[0];
37
45
  if (!COMMANDS.includes(verb)) {
38
46
  // A file where the command goes is the old form, and is told the new one;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reladraw",
3
- "version": "0.17.0",
3
+ "version": "0.17.1",
4
4
  "description": "A diagram language where you say where things go.",
5
5
  "type": "module",
6
6
  "bin": {