skeudo 0.0.0-stage → 0.2.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/LICENSE +21 -0
- package/README.md +75 -2
- package/dist/skeudo.js +7081 -0
- package/package.json +38 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 The Skeudo authors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,76 @@
|
|
|
1
|
-
#
|
|
1
|
+
# skeudo
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> **Alpha.** The format and the commands will change in ways that break existing sketches and scripts. Until 1.0, breaking changes come in minor versions (0.1 to 0.2), never in patches, and the [release notes](https://github.com/wlezzar/skeudo/releases) list each one.
|
|
4
|
+
|
|
5
|
+
Checks [Skeudo](https://github.com/wlezzar/skeudo) sketches and renders them as standalone HTML pages. A sketch is pseudocode for code review where every outside effect is tagged, or a data model drawn as tables and a story of how their rows change, and its first line says which: `view: code` or `view: data`. The format is defined in [spec/spec.md](https://github.com/wlezzar/skeudo/blob/main/spec/spec.md).
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm install -g skeudo # or run it once with npx skeudo
|
|
9
|
+
skeudo check docs/ # warnings in every sketch under docs/
|
|
10
|
+
skeudo render pr-123.md -o pr.html # a page to send to someone
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
It needs Node 22 or later.
|
|
14
|
+
|
|
15
|
+
## Input
|
|
16
|
+
|
|
17
|
+
- A `.md` or `.markdown` file is Markdown: every ` ```skeudo ` fence in it is a sketch (` ```sketch ` works too).
|
|
18
|
+
- A `.skeudo` file is a sketch.
|
|
19
|
+
- A directory is searched for both, skipping hidden folders and `node_modules`.
|
|
20
|
+
- With no path, or with `-`, the input is read from stdin. Any input other than a `.md`, `.markdown` or `.skeudo` file is Markdown when it has a sketch fence, and a sketch otherwise.
|
|
21
|
+
|
|
22
|
+
## check
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
skeudo check [path...]
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Prints the parser's warnings, listed under Warnings in each view's spec, at their lines in the file, then a summary:
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
docs/refunds.md:13: warning: ::fail needs a name, as in ::fail:NotFound.
|
|
32
|
+
docs/refunds.md:18: warning: ::write needs the system it touches, as in ::write:postgres.
|
|
33
|
+
Checked 4 sketches in 3 files: 2 warnings.
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
It exits with 0 when there are no warnings, 1 when there are, and 2 when a file can't be read or the command is wrong. To check a sketch before saving it, pipe it in:
|
|
37
|
+
|
|
38
|
+
```sh
|
|
39
|
+
skeudo check <<'EOF'
|
|
40
|
+
view: code
|
|
41
|
+
get_user(id):
|
|
42
|
+
row = find(id) ::read:postgres.users
|
|
43
|
+
EOF
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## render
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
skeudo render [file] [-o out.html] [--src-base <url>]
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Writes one HTML page with the styles and the script inlined (variable highlighting, explanations on hover, folding blocks, and stepping through data sketches), so it loads nothing from elsewhere and can be sent as a file. It follows the reader's light or dark mode. The page goes to stdout unless `-o` names a file, and warnings go to stderr; a sketch with warnings still renders.
|
|
53
|
+
|
|
54
|
+
The title is the front matter's `title`, or else the first `#` heading, the sketch's function name, or the file name.
|
|
55
|
+
|
|
56
|
+
`::src` locations link to the repository a sketch names with `::repo`, on GitHub, GitLab or Bitbucket, at the sketch's revision. A sketch that names none links under the front matter's `srcBase`. `--src-base` overrides both, for every sketch on the page:
|
|
57
|
+
|
|
58
|
+
```markdown
|
|
59
|
+
---
|
|
60
|
+
title: shop a1b2c3d
|
|
61
|
+
srcBase: https://github.com/org/shop/blob/a1b2c3d/
|
|
62
|
+
---
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## From the repository
|
|
66
|
+
|
|
67
|
+
To try a change, build the CLI from the source:
|
|
68
|
+
|
|
69
|
+
```sh
|
|
70
|
+
pnpm install
|
|
71
|
+
pnpm build:cli # apps/cli/dist/skeudo.js, one file with no dependencies
|
|
72
|
+
node apps/cli/dist/skeudo.js check docs/
|
|
73
|
+
|
|
74
|
+
pnpm package:cli # apps/cli/skeudo.tgz
|
|
75
|
+
npm install -g apps/cli/skeudo.tgz # puts this build on your PATH
|
|
76
|
+
```
|