demotape 0.0.7 → 0.0.9
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.
- checksums.yaml +4 -4
- data/.gitignore +1 -1
- data/CHANGELOG.md +11 -0
- data/Makefile +7 -0
- data/README.md +8 -0
- data/editors/sublime-text/DemoTape.sublime-completions +99 -24
- data/editors/sublime-text/DemoTape.sublime-syntax +6 -6
- data/editors/vim/syntax/demotape.vim +3 -3
- data/editors/vscode/demotape.tmLanguage.json +5 -5
- data/editors/vscode/package-lock.json +4225 -0
- data/editors/vscode/package.json +13 -3
- data/editors/vscode/snippets/demotape.json +542 -0
- data/editors/zed/extension.toml +5 -4
- data/editors/zed/grammars/demotape.wasm +0 -0
- data/editors/zed/languages/demotape/highlights.scm +1 -0
- data/editors/zed/tree-sitter/grammar.js +7 -0
- data/editors/zed/tree-sitter/package-lock.json +2 -2
- data/editors/zed/tree-sitter/src/grammar.json +29 -0
- data/editors/zed/tree-sitter/src/node-types.json +27 -0
- data/editors/zed/tree-sitter/src/parser.c +6117 -5455
- data/lib/demo_tape/cli.rb +3 -0
- data/lib/demo_tape/command.rb +2 -5
- data/lib/demo_tape/parser/rules.rb +7 -2
- data/lib/demo_tape/runner.rb +52 -5
- data/lib/demo_tape/version.rb +1 -1
- data/lib/demo_tape.rb +1 -0
- metadata +7 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0a4c67efaf040420dc543039549015bb4a7bdf56a7ffe7a9083c4d706260c561
|
|
4
|
+
data.tar.gz: 3a7005597cba7f68adfed6b8273d2ff42d150c4179cb4daedc8e5dd046e11b5e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b084505658402b05e585a8d03c10086afbe89e0fa73c5d0a112550cc3120e16d624b69d288de7b88ab936ad9db40002defbb0b79b84dad14d8729683582621dd
|
|
7
|
+
data.tar.gz: 690905dcae32c4b1b2454dba06186eb43b139aca7af13a0fe2ae3ee72bdbd65039ccdae1d0e555c7890052bd301b9d6833cd243f5e0ec8e0943253b2eb85ee1e
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
|
@@ -11,6 +11,17 @@ Prefix your message with one of the following:
|
|
|
11
11
|
- [Security] in case of vulnerabilities.
|
|
12
12
|
-->
|
|
13
13
|
|
|
14
|
+
## v0.0.9
|
|
15
|
+
|
|
16
|
+
- [Fixed] Handle `SIGINT` and `SIGQUIT` signals to gracefully stop recording.
|
|
17
|
+
- [Added] Add `--timeout` and `Set timeout duration` to specify a maximum time
|
|
18
|
+
to wait for the demo tape execution.
|
|
19
|
+
|
|
20
|
+
## v0.0.8
|
|
21
|
+
|
|
22
|
+
- [Added] Add `WaitUntilDone`, which is just a shortcut for
|
|
23
|
+
`WaitUntil /::done::/`.
|
|
24
|
+
|
|
14
25
|
## v0.0.7
|
|
15
26
|
|
|
16
27
|
- [Fixed] Fix key combos that had numbers in them not being recognized.
|
data/Makefile
CHANGED
|
@@ -29,3 +29,10 @@ theme-examples:
|
|
|
29
29
|
optipng -quiet -o2 examples/themes/$${name}.png; \
|
|
30
30
|
fi; \
|
|
31
31
|
done;
|
|
32
|
+
|
|
33
|
+
zed:
|
|
34
|
+
@cd editors/zed/tree-sitter && \
|
|
35
|
+
npm install && \
|
|
36
|
+
node_modules/.bin/tree-sitter generate && \
|
|
37
|
+
node_modules/.bin/tree-sitter build-wasm && \
|
|
38
|
+
mv tree-sitter-demotape.wasm ../grammars/demotape.wasm
|
data/README.md
CHANGED
|
@@ -282,6 +282,14 @@ WaitUntil@10s /complete/
|
|
|
282
282
|
The pattern is a regular expression. The command waits until the terminal output
|
|
283
283
|
matches the pattern or the timeout is reached.
|
|
284
284
|
|
|
285
|
+
**WaitUntilDone** - Wait for output matching `/::done::`. This is just a
|
|
286
|
+
shortcut for `WaitUntil /::done::/`.
|
|
287
|
+
|
|
288
|
+
```demotape
|
|
289
|
+
WaitUntilDone
|
|
290
|
+
WaitUntilDone@5s
|
|
291
|
+
```
|
|
292
|
+
|
|
285
293
|
#### Clipboard
|
|
286
294
|
|
|
287
295
|
**Copy** - Copy text to clipboard
|
|
@@ -5,7 +5,10 @@
|
|
|
5
5
|
{ "trigger": "Type", "contents": "Type \"${1:text}\"" },
|
|
6
6
|
{ "trigger": "Type@", "contents": "Type@${1:50ms} \"${2:text}\"" },
|
|
7
7
|
{ "trigger": "TypeFile", "contents": "TypeFile \"${1:path/to/file}\"" },
|
|
8
|
-
{
|
|
8
|
+
{
|
|
9
|
+
"trigger": "TypeFile@",
|
|
10
|
+
"contents": "TypeFile@${1:50ms} \"${2:path/to/file}\"",
|
|
11
|
+
},
|
|
9
12
|
{ "trigger": "Run", "contents": "Run \"${1:command}\"" },
|
|
10
13
|
{ "trigger": "Run@", "contents": "Run@${1:1s} \"${2:command}\"" },
|
|
11
14
|
{ "trigger": "Copy", "contents": "Copy \"${1:text}\"" },
|
|
@@ -23,6 +26,8 @@
|
|
|
23
26
|
{ "trigger": "Sleep", "contents": "Sleep ${1:1s}" },
|
|
24
27
|
{ "trigger": "WaitUntil", "contents": "WaitUntil /${1:pattern}/" },
|
|
25
28
|
{ "trigger": "WaitUntil@", "contents": "WaitUntil@${1:5s} /${2:pattern}/" },
|
|
29
|
+
{ "trigger": "WaitUntilDone", "contents": "WaitUntilDone" },
|
|
30
|
+
{ "trigger": "WaitUntilDone@", "contents": "WaitUntilDone@${1:5s}" },
|
|
26
31
|
|
|
27
32
|
// Control commands
|
|
28
33
|
"Clear",
|
|
@@ -52,36 +57,106 @@
|
|
|
52
57
|
},
|
|
53
58
|
{ "trigger": "Set padding", "contents": "Set padding ${1:20}" },
|
|
54
59
|
{ "trigger": "Set margin", "contents": "Set margin ${1:60}" },
|
|
55
|
-
{
|
|
60
|
+
{
|
|
61
|
+
"trigger": "Set margin_fill",
|
|
62
|
+
"contents": "Set margin_fill \"${1:#6b50ff}\"",
|
|
63
|
+
},
|
|
56
64
|
{ "trigger": "Set border_radius", "contents": "Set border_radius ${1:10}" },
|
|
57
65
|
{ "trigger": "Set typing_speed", "contents": "Set typing_speed ${1:50ms}" },
|
|
58
|
-
{
|
|
66
|
+
{
|
|
67
|
+
"trigger": "Set variable_typing",
|
|
68
|
+
"contents": "Set variable_typing ${1:true}",
|
|
69
|
+
},
|
|
59
70
|
{ "trigger": "Set loop", "contents": "Set loop ${1:true}" },
|
|
60
71
|
{ "trigger": "Set loop_delay", "contents": "Set loop_delay ${1:2s}" },
|
|
61
|
-
{ "trigger": "Set
|
|
72
|
+
{ "trigger": "Set timeout", "contents": "Set timeout ${1:1m}" },
|
|
73
|
+
{
|
|
74
|
+
"trigger": "Set run_enter_delay",
|
|
75
|
+
"contents": "Set run_enter_delay ${1:300ms}",
|
|
76
|
+
},
|
|
62
77
|
{ "trigger": "Set run_sleep", "contents": "Set run_sleep ${1:1s}" },
|
|
63
78
|
|
|
64
79
|
// Theme color overrides
|
|
65
|
-
{
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
{
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
{
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
{
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
{
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
80
|
+
{
|
|
81
|
+
"trigger": "Set theme.background",
|
|
82
|
+
"contents": "Set theme.background \"${1:#222222}\"",
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"trigger": "Set theme.foreground",
|
|
86
|
+
"contents": "Set theme.foreground \"${1:#ffffff}\"",
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"trigger": "Set theme.cursor",
|
|
90
|
+
"contents": "Set theme.cursor \"${1:#00ff00}\"",
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"trigger": "Set theme.selection_background",
|
|
94
|
+
"contents": "Set theme.selection_background \"${1:#444444}\"",
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"trigger": "Set theme.black",
|
|
98
|
+
"contents": "Set theme.black \"${1:#000000}\"",
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"trigger": "Set theme.red",
|
|
102
|
+
"contents": "Set theme.red \"${1:#ff0000}\"",
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"trigger": "Set theme.green",
|
|
106
|
+
"contents": "Set theme.green \"${1:#00ff00}\"",
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"trigger": "Set theme.yellow",
|
|
110
|
+
"contents": "Set theme.yellow \"${1:#ffff00}\"",
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"trigger": "Set theme.blue",
|
|
114
|
+
"contents": "Set theme.blue \"${1:#0000ff}\"",
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"trigger": "Set theme.magenta",
|
|
118
|
+
"contents": "Set theme.magenta \"${1:#ff00ff}\"",
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"trigger": "Set theme.cyan",
|
|
122
|
+
"contents": "Set theme.cyan \"${1:#00ffff}\"",
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"trigger": "Set theme.white",
|
|
126
|
+
"contents": "Set theme.white \"${1:#ffffff}\"",
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"trigger": "Set theme.bright_black",
|
|
130
|
+
"contents": "Set theme.bright_black \"${1:#555555}\"",
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"trigger": "Set theme.bright_red",
|
|
134
|
+
"contents": "Set theme.bright_red \"${1:#ff5555}\"",
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"trigger": "Set theme.bright_green",
|
|
138
|
+
"contents": "Set theme.bright_green \"${1:#55ff55}\"",
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"trigger": "Set theme.bright_yellow",
|
|
142
|
+
"contents": "Set theme.bright_yellow \"${1:#ffff55}\"",
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"trigger": "Set theme.bright_blue",
|
|
146
|
+
"contents": "Set theme.bright_blue \"${1:#5555ff}\"",
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"trigger": "Set theme.bright_magenta",
|
|
150
|
+
"contents": "Set theme.bright_magenta \"${1:#ff55ff}\"",
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"trigger": "Set theme.bright_cyan",
|
|
154
|
+
"contents": "Set theme.bright_cyan \"${1:#55ffff}\"",
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"trigger": "Set theme.bright_white",
|
|
158
|
+
"contents": "Set theme.bright_white \"${1:#ffffff}\"",
|
|
159
|
+
},
|
|
85
160
|
|
|
86
161
|
// Special keys
|
|
87
162
|
"Enter",
|
|
@@ -40,10 +40,10 @@ contexts:
|
|
|
40
40
|
captures:
|
|
41
41
|
2: entity.name.function.demotape
|
|
42
42
|
|
|
43
|
-
# Commands with @ duration
|
|
44
|
-
- match: '\b(Type|TypeFile|WaitUntil|Run)\b'
|
|
43
|
+
# Commands with @ duration
|
|
44
|
+
- match: '\b(Type|TypeFile|WaitUntil|WaitUntilDone|Run)\b'
|
|
45
45
|
scope: keyword.control.demotape
|
|
46
|
-
push:
|
|
46
|
+
push: command_with_duration
|
|
47
47
|
|
|
48
48
|
# Set command with option value
|
|
49
49
|
- match: '\b(Set)\b'
|
|
@@ -97,7 +97,7 @@ contexts:
|
|
|
97
97
|
key_combo:
|
|
98
98
|
- match: '\+'
|
|
99
99
|
scope: keyword.operator.demotape
|
|
100
|
-
- match: '\b(Ctrl|Control|Alt|Option|Shift|Meta|Command|Enter|Return|Tab|Backspace|Delete|Escape|Esc|Space|Up|Down|Left|Right|Home|End|PageUp|PageDown|Insert|Cancel|Help|Pause|Semicolon|Colon|Equals|Slash|BackSlash|Numpad[0-9]|Multiply|Add|Separator|Subtract|Decimal|Divide|F[1-9]|F1[0-2]|[A-Za-z0-9])\b'
|
|
100
|
+
- match: '\b(Ctrl|Control|Alt|Option|Shift|Meta|Command|Cmd|Enter|Return|Tab|Backspace|Delete|Escape|Esc|Space|Up|Down|Left|Right|Home|End|PageUp|PageDown|Insert|Cancel|Help|Pause|Semicolon|Colon|Equals|Slash|BackSlash|Numpad[0-9]|Multiply|Add|Separator|Subtract|Decimal|Divide|F[1-9]|F1[0-2]|[A-Za-z0-9])\b'
|
|
101
101
|
scope: keyword.control.demotape
|
|
102
102
|
- match: '\d+'
|
|
103
103
|
scope: constant.numeric.integer.demotape
|
|
@@ -145,7 +145,7 @@ contexts:
|
|
|
145
145
|
- match: "$"
|
|
146
146
|
pop: true
|
|
147
147
|
|
|
148
|
-
|
|
148
|
+
command_with_duration:
|
|
149
149
|
- match: "@"
|
|
150
150
|
scope: keyword.operator.demotape
|
|
151
151
|
push: duration_value
|
|
@@ -154,7 +154,7 @@ contexts:
|
|
|
154
154
|
pop: true
|
|
155
155
|
|
|
156
156
|
set_command:
|
|
157
|
-
- match: '\b(border_radius|shell|theme|width|height|font_size|font_family|line_height|cursor_blink|cursor_width|cursor_style|letter_spacing|padding|margin|margin_fill|fps|typing_speed|loop|loop_delay|variable_typing|run_enter_delay|run_sleep)(\.[a-z_]+)?\b'
|
|
157
|
+
- match: '\b(border_radius|shell|theme|width|height|font_size|font_family|line_height|cursor_blink|cursor_width|cursor_style|letter_spacing|padding|margin|margin_fill|fps|typing_speed|loop|loop_delay|timeout|variable_typing|run_enter_delay|run_sleep)(\.[a-z_]+)?\b'
|
|
158
158
|
captures:
|
|
159
159
|
1: variable.parameter.demotape
|
|
160
160
|
2: variable.other.member.demotape
|
|
@@ -11,7 +11,7 @@ endif
|
|
|
11
11
|
syn match demotapeComment "#.*$"
|
|
12
12
|
|
|
13
13
|
" Commands
|
|
14
|
-
syn keyword demotapeCommand Type TypeFile WaitUntil Run Set Output Copy Paste Send Include Screenshot
|
|
14
|
+
syn keyword demotapeCommand Type TypeFile WaitUntil WaitUntilDone Run Set Output Copy Paste Send Include Screenshot
|
|
15
15
|
syn keyword demotapeCommand Wait Sleep Require Pause Resume Clear nextgroup=demotapeString,demotapeDuration,demotapeNumber skipwhite
|
|
16
16
|
|
|
17
17
|
" Group blocks
|
|
@@ -41,9 +41,9 @@ syn match demotapeOperator "@"
|
|
|
41
41
|
" Set options
|
|
42
42
|
syn keyword demotapeOption border_radius shell theme width height font_size font_family
|
|
43
43
|
syn keyword demotapeOption line_height cursor_blink cursor_width cursor_style letter_spacing
|
|
44
|
-
syn keyword demotapeOption padding margin margin_fill fps typing_speed loop loop_delay variable_typing
|
|
44
|
+
syn keyword demotapeOption padding margin margin_fill fps typing_speed loop loop_delay timeout variable_typing
|
|
45
45
|
syn keyword demotapeOption run_enter_delay run_sleep
|
|
46
|
-
syn match demotapeOption "\<\(border_radius\|shell\|theme\|width\|height\|font_size\|font_family\|line_height\|cursor_blink\|cursor_width\|cursor_style\|letter_spacing\|padding\|margin\|margin_fill\|fps\|typing_speed\|loop_delay\|loop\|variable_typing\|run_enter_delay\|run_sleep\)\.\w\+\>"
|
|
46
|
+
syn match demotapeOption "\<\(border_radius\|shell\|theme\|width\|height\|font_size\|font_family\|line_height\|cursor_blink\|cursor_width\|cursor_style\|letter_spacing\|padding\|margin\|margin_fill\|fps\|typing_speed\|loop_delay\|timeout\|loop\|variable_typing\|run_enter_delay\|run_sleep\)\.\w\+\>"
|
|
47
47
|
|
|
48
48
|
" Strings
|
|
49
49
|
syn region demotapeString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=demotapeEscape
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
|
-
"comment": "Commands with @ duration
|
|
49
|
-
"match": "\\b(Type|TypeFile|WaitUntil|Run)\\b",
|
|
48
|
+
"comment": "Commands with @ duration",
|
|
49
|
+
"match": "\\b(Type|TypeFile|WaitUntil|WaitUntilDone|Run)\\b",
|
|
50
50
|
"name": "keyword.control.demotape",
|
|
51
51
|
"captures": {
|
|
52
52
|
"1": { "name": "keyword.control.demotape" }
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
},
|
|
101
101
|
{
|
|
102
102
|
"comment": "Key combinations with +",
|
|
103
|
-
"match": "\\b(Ctrl|Control|Alt|Option|Shift|Meta|Command|Enter|Return|Tab|Backspace|Delete|Escape|Esc|Space|Up|Down|Left|Right|Home|End|PageUp|PageDown|Insert|Cancel|Help|Pause|Semicolon|Colon|Equals|Slash|BackSlash|Numpad[0-9]|Multiply|Add|Separator|Subtract|Decimal|Divide|F[1-9]|F1[0-2]|[A-Za-z0-9])\\s*\\+\\s*(Ctrl|Control|Alt|Option|Shift|Meta|Command|Enter|Return|Tab|Backspace|Delete|Escape|Esc|Space|Up|Down|Left|Right|Home|End|PageUp|PageDown|Insert|Cancel|Help|Pause|Semicolon|Colon|Equals|Slash|Numpad[0-9]|Multiply|Add|Separator|Subtract|Decimal|Divide|F[1-9]|F1[0-2]|[A-Za-z0-9])",
|
|
103
|
+
"match": "\\b(Ctrl|Control|Alt|Option|Shift|Meta|Command|Cmd|Enter|Return|Tab|Backspace|Delete|Escape|Esc|Space|Up|Down|Left|Right|Home|End|PageUp|PageDown|Insert|Cancel|Help|Pause|Semicolon|Colon|Equals|Slash|BackSlash|Numpad[0-9]|Multiply|Add|Separator|Subtract|Decimal|Divide|F[1-9]|F1[0-2]|[A-Za-z0-9])\\s*\\+\\s*(Ctrl|Control|Alt|Option|Shift|Meta|Command|Cmd|Enter|Return|Tab|Backspace|Delete|Escape|Esc|Space|Up|Down|Left|Right|Home|End|PageUp|PageDown|Insert|Cancel|Help|Pause|Semicolon|Colon|Equals|Slash|Numpad[0-9]|Multiply|Add|Separator|Subtract|Decimal|Divide|F[1-9]|F1[0-2]|[A-Za-z0-9])",
|
|
104
104
|
"captures": {
|
|
105
105
|
"0": { "name": "keyword.control.demotape" }
|
|
106
106
|
}
|
|
@@ -112,14 +112,14 @@
|
|
|
112
112
|
},
|
|
113
113
|
{
|
|
114
114
|
"comment": "Set command options",
|
|
115
|
-
"match": "\\b(border_radius|shell|theme|width|height|font_size|font_family|line_height|cursor_blink|cursor_width|cursor_style|letter_spacing|padding|margin|margin_fill|fps|typing_speed|loop|loop_delay|variable_typing|run_enter_delay|run_sleep)(\\.[a-z_]+)?\\b",
|
|
115
|
+
"match": "\\b(border_radius|shell|theme|width|height|font_size|font_family|line_height|cursor_blink|cursor_width|cursor_style|letter_spacing|padding|margin|margin_fill|fps|typing_speed|loop|loop_delay|timeout|variable_typing|run_enter_delay|run_sleep)(\\.[a-z_]+)?\\b",
|
|
116
116
|
"captures": {
|
|
117
117
|
"1": { "name": "variable.parameter.demotape" },
|
|
118
118
|
"2": { "name": "variable.other.member.demotape" }
|
|
119
119
|
}
|
|
120
120
|
},
|
|
121
121
|
{
|
|
122
|
-
"comment": "At symbol for
|
|
122
|
+
"comment": "At symbol for duration",
|
|
123
123
|
"match": "@",
|
|
124
124
|
"name": "keyword.operator.demotape"
|
|
125
125
|
},
|