Skip to content

Commit 8c0a489

Browse files
committed
docs(commit-preview): add docs demos for commit preview
1 parent 912c7fb commit 8c0a489

4 files changed

Lines changed: 246 additions & 0 deletions

File tree

284 KB
Loading
393 KB
Loading

docs/images/commit_preview.tape

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
Output cli_interactive/commit_preview.gif
2+
3+
Require cz
4+
5+
# Use bash for cross-platform compatibility (macOS, Linux, Windows)
6+
Set Shell bash
7+
8+
Set FontSize 16
9+
Set Width 878
10+
Set Height 568
11+
Set Padding 20
12+
Set TypingSpeed 50ms
13+
14+
Set Theme {
15+
"name": "Commitizen",
16+
"black": "#232628",
17+
"red": "#fc4384",
18+
"green": "#b3e33b",
19+
"yellow": "#ffa727",
20+
"blue": "#75dff2",
21+
"magenta": "#ae89fe",
22+
"cyan": "#708387",
23+
"white": "#d5d5d0",
24+
"brightBlack": "#626566",
25+
"brightRed": "#ff7fac",
26+
"brightGreen": "#c8ed71",
27+
"brightYellow": "#ebdf86",
28+
"brightBlue": "#75dff2",
29+
"brightMagenta": "#ae89fe",
30+
"brightCyan": "#b1c6ca",
31+
"brightWhite": "#f9f9f4",
32+
"background": "#1e1e2e",
33+
"foreground": "#afafaf",
34+
"cursor": "#c7c7c7"
35+
}
36+
37+
# Hide initial shell prompt
38+
Hide
39+
40+
# Wait for terminal to be ready
41+
Sleep 1s
42+
43+
# Set a clean, simple prompt (while hidden)
44+
Type "PS1='$ '"
45+
Enter
46+
Sleep 300ms
47+
48+
# Create a clean temporary directory for recording
49+
Type "rm -rf /tmp/commitizen-example && mkdir -p /tmp/commitizen-example && cd /tmp/commitizen-example"
50+
Enter
51+
Sleep 500ms
52+
53+
# Initialize git repository
54+
Type "git init"
55+
Enter
56+
Type "git config user.email 'you@example.com'"
57+
Enter
58+
Type "git config user.name 'Your Name'"
59+
Enter
60+
Sleep 500ms
61+
62+
Type "git checkout -b awesome-feature"
63+
Enter
64+
Sleep 500ms
65+
66+
# Create a dummy file to commit
67+
Type "echo 'test content' > example.py"
68+
Enter
69+
Sleep 300ms
70+
71+
Type "git add example.py"
72+
Enter
73+
Sleep 300ms
74+
75+
# Clear the screen to start fresh
76+
Type "clear"
77+
Enter
78+
Sleep 500ms
79+
80+
# Show commands from here
81+
Show
82+
83+
# Now run cz commit
84+
Type "cz commit --preview"
85+
Sleep 500ms
86+
Enter
87+
88+
# Wait for first prompt to appear
89+
Sleep 1s
90+
91+
# Question 1: Select the type of change (move down to "feat")
92+
Down
93+
Sleep 1s
94+
Enter
95+
Sleep 1s
96+
97+
# Question 2: Scope (optional, skip)
98+
Type "preview commit subject"
99+
Sleep 1s
100+
Enter
101+
Sleep 1s
102+
103+
# Question 3: Subject
104+
Type "awesome new feature"
105+
Sleep 1s
106+
Enter
107+
Sleep 1s
108+
109+
# Question 4: Is this a BREAKING CHANGE? (No)
110+
Enter
111+
Sleep 500ms
112+
113+
# Question 5: Body (optional, skip)
114+
Enter
115+
Sleep 500ms
116+
117+
# Question 6: Footer (optional, skip)
118+
Enter
119+
Sleep 500ms
120+
121+
# Wait for commit success message
122+
Sleep 2s
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
Output cli_interactive/commit_preview_length_limit.gif
2+
3+
Require cz
4+
5+
# Use bash for cross-platform compatibility (macOS, Linux, Windows)
6+
Set Shell bash
7+
8+
Set FontSize 16
9+
Set Width 878
10+
Set Height 568
11+
Set Padding 20
12+
Set TypingSpeed 50ms
13+
14+
Set Theme {
15+
"name": "Commitizen",
16+
"black": "#232628",
17+
"red": "#fc4384",
18+
"green": "#b3e33b",
19+
"yellow": "#ffa727",
20+
"blue": "#75dff2",
21+
"magenta": "#ae89fe",
22+
"cyan": "#708387",
23+
"white": "#d5d5d0",
24+
"brightBlack": "#626566",
25+
"brightRed": "#ff7fac",
26+
"brightGreen": "#c8ed71",
27+
"brightYellow": "#ebdf86",
28+
"brightBlue": "#75dff2",
29+
"brightMagenta": "#ae89fe",
30+
"brightCyan": "#b1c6ca",
31+
"brightWhite": "#f9f9f4",
32+
"background": "#1e1e2e",
33+
"foreground": "#afafaf",
34+
"cursor": "#c7c7c7"
35+
}
36+
37+
# Hide initial shell prompt
38+
Hide
39+
40+
# Wait for terminal to be ready
41+
Sleep 1s
42+
43+
# Set a clean, simple prompt (while hidden)
44+
Type "PS1='$ '"
45+
Enter
46+
Sleep 300ms
47+
48+
# Create a clean temporary directory for recording
49+
Type "rm -rf /tmp/commitizen-example && mkdir -p /tmp/commitizen-example && cd /tmp/commitizen-example"
50+
Enter
51+
Sleep 500ms
52+
53+
# Initialize git repository
54+
Type "git init"
55+
Enter
56+
Type "git config user.email 'you@example.com'"
57+
Enter
58+
Type "git config user.name 'Your Name'"
59+
Enter
60+
Sleep 500ms
61+
62+
Type "git checkout -b awesome-feature"
63+
Enter
64+
Sleep 500ms
65+
66+
# Create a dummy file to commit
67+
Type "echo 'test content' > example.py"
68+
Enter
69+
Sleep 300ms
70+
71+
Type "git add example.py"
72+
Enter
73+
Sleep 300ms
74+
75+
# Clear the screen to start fresh
76+
Type "clear"
77+
Enter
78+
Sleep 500ms
79+
80+
# Show commands from here
81+
Show
82+
83+
# Now run cz commit
84+
Type "cz commit --preview -l 72"
85+
Sleep 500ms
86+
Enter
87+
88+
# Wait for first prompt to appear
89+
Sleep 1s
90+
91+
# Question 1: Select the type of change (move down to "feat")
92+
Down
93+
Sleep 1s
94+
Enter
95+
Sleep 1s
96+
97+
# Question 2: Scope (optional, skip)
98+
Type "preview commit subject"
99+
Sleep 1s
100+
Enter
101+
Sleep 1s
102+
103+
# Question 3: Subject
104+
Type "awesome new feature 11111111111111111111111111111111"
105+
Sleep 1s
106+
Backspace 10
107+
Sleep 1s
108+
Enter
109+
Sleep 1s
110+
111+
# Question 4: Is this a BREAKING CHANGE? (No)
112+
Enter
113+
Sleep 500ms
114+
115+
# Question 5: Body (optional, skip)
116+
Enter
117+
Sleep 500ms
118+
119+
# Question 6: Footer (optional, skip)
120+
Enter
121+
Sleep 500ms
122+
123+
# Wait for commit success message
124+
Sleep 2s

0 commit comments

Comments
 (0)