dashcam 0.2.1 → 0.3.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/README.md +91 -57
- package/index.js +6 -8
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,49 +1,115 @@
|
|
|
1
1
|
<img src="https://user-images.githubusercontent.com/318295/204898620-922afee0-5415-46a9-a84f-ae6237001bf0.png" height="50" alt="Replayable"/>
|
|
2
2
|
|
|
3
|
-
#
|
|
3
|
+
# Replayable API
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Add Replayable to your app or workflow. This package allows you to control the Replayable desktop application from the via CLI SDK.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
> Why double-back when you can capture it the first time? Playback and share exactly what happened with Replayable's desktop replay buffer.
|
|
8
8
|
|
|
9
|
-
You can easily embed desktop replays within git commits, pull requests, bug reports, jira tickets, and even within log files.
|
|
9
|
+
You can easily embed desktop replays within git commits, pull requests, bug reports, jira tickets, and even within log files. Desktop replays are a great way to share context behind problems and document the application state within logs, tickets and more.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Requires that you [install Replayable Desktop](https://replayable.io). Replayable Desktop runs in the background giving you access to a buffer of video.
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
<p>Capture bugs with replayable. - Watch Video</p>
|
|
15
|
-
<img style="max-width:300px;" src="https://cdn.loom.com/sessions/thumbnails/ea9c2831013a4b5eb996bd47f8178f4e-with-play.gif">
|
|
16
|
-
</a>
|
|
13
|
+
## Table of contents
|
|
17
14
|
|
|
18
|
-
|
|
15
|
+
- [Replayable API](#replayable-api)
|
|
16
|
+
- [Install Replayable Desktop](#install-replayable-desktop)
|
|
17
|
+
- [Examples](#examples)
|
|
18
|
+
- [Web](#web)
|
|
19
|
+
- [Setup](#setup)
|
|
20
|
+
- [HTML Anchor Tag](#html-anchor-tag)
|
|
21
|
+
- [JS Error Handler](#js-error-handler)
|
|
22
|
+
- [NodeJS SDK](#nodejs-sdk)
|
|
23
|
+
- [Setup](#setup)
|
|
24
|
+
- [Create a Replay](#create-a-replay)
|
|
25
|
+
- [Error Handler](#error-handler)
|
|
26
|
+
- [CLI](#cli)
|
|
27
|
+
- [Setup](#setup)
|
|
28
|
+
- [Create a Replay](#create-a-replay)
|
|
29
|
+
- [Return a rich markdown link](#return-a-rich-markdown-link)
|
|
30
|
+
- [Set a replay title](#set-a-replay-title)
|
|
31
|
+
- [Attach the last 20 CLI commands to the replay](#attach-the-last-20-cli-commands-to-the-replay)
|
|
32
|
+
- [Attach a logfile to the replay](#attach-a-logfile-to-the-replay)
|
|
33
|
+
- [GitHub CLI](#github-cli)
|
|
34
|
+
- [Create a github issue with a replay in the description](#create-a-github-issue-with-a-replay-in-the-description)
|
|
35
|
+
- [Create a github pull request with a replay in the description](#create-a-github-pull-request-with-a-replay-in-the-description)
|
|
36
|
+
- [Append a 30 second replay to a commit](#append-a-30-second-replay-to-a-commit)
|
|
37
|
+
- [Advanced Usage](#advanced-usage)
|
|
38
|
+
- [Ideas](#ideas)
|
|
39
|
+
|
|
40
|
+
# Examples
|
|
41
|
+
|
|
42
|
+
Also see [the examples folder](https://github.com/replayableio/cli/tree/main/examples).
|
|
43
|
+
|
|
44
|
+
## Web
|
|
45
|
+
|
|
46
|
+
### Setup
|
|
47
|
+
|
|
48
|
+
Nothing! The app exposes the protocol to the system natively via `replayable://`.
|
|
19
49
|
|
|
20
|
-
###
|
|
50
|
+
### HTML Anchor Tag
|
|
51
|
+
|
|
52
|
+
```html
|
|
53
|
+
<a href="replayable://replay/create" target="_blank">Create a Replay</a>
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### JS Error Handler
|
|
57
|
+
|
|
58
|
+
```js
|
|
59
|
+
window.onerror = function myErrorHandler() {
|
|
60
|
+
window.open("replayable://replay/create", "_blank");
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
setTimeout(() => {
|
|
64
|
+
throw new Error("Throw makes it go boom!");
|
|
65
|
+
}, 3000);
|
|
66
|
+
```
|
|
21
67
|
|
|
22
|
-
|
|
68
|
+
## NodeJS SDK
|
|
23
69
|
|
|
24
|
-
###
|
|
70
|
+
### Setup
|
|
25
71
|
|
|
26
72
|
```sh
|
|
27
|
-
npm install replayable
|
|
73
|
+
npm install replayable
|
|
28
74
|
```
|
|
29
75
|
|
|
30
|
-
|
|
76
|
+
### Create a Replay
|
|
31
77
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
- [Examples](#examples)
|
|
35
|
-
- [CLI](#cli)
|
|
36
|
-
- [GitHub CLI](#github-cli)
|
|
37
|
-
- [NodeJS SDK](#nodejs-sdk)
|
|
38
|
-
- [Javascript Integration](#javascript-integration)
|
|
39
|
-
- [Advanced Usage](#advanced-usage)
|
|
78
|
+
```js
|
|
79
|
+
const replayable = require("replayable");
|
|
40
80
|
|
|
41
|
-
|
|
81
|
+
let replay = await replayable.createReplay({
|
|
82
|
+
title: "My New Replay",
|
|
83
|
+
description: `This **renders markdown** or plaintext in monospace font.`
|
|
84
|
+
});
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Error Handler
|
|
88
|
+
|
|
89
|
+
```js
|
|
90
|
+
const replayable = require("replayable");
|
|
91
|
+
|
|
92
|
+
process.on("uncaughtException", async (err) => {
|
|
93
|
+
let replay = await replayable.createReplay({
|
|
94
|
+
title: "uncaughtException",
|
|
95
|
+
description: err,
|
|
96
|
+
});
|
|
97
|
+
console.log("Replayable", replay);
|
|
98
|
+
});
|
|
42
99
|
|
|
43
|
-
|
|
100
|
+
setTimeout(() => {
|
|
101
|
+
throw new Error("Throw makes it go boom!");
|
|
102
|
+
}, 3000);
|
|
103
|
+
```
|
|
44
104
|
|
|
45
105
|
## CLI
|
|
46
106
|
|
|
107
|
+
### Setup
|
|
108
|
+
|
|
109
|
+
```sh
|
|
110
|
+
npm install replayable -g
|
|
111
|
+
```
|
|
112
|
+
|
|
47
113
|
### Create a Replay
|
|
48
114
|
|
|
49
115
|
```sh
|
|
@@ -109,38 +175,6 @@ $ gh pr create -w -t "Title" -b "`replayable --md`"
|
|
|
109
175
|
$ git commit -am "`replayable`"
|
|
110
176
|
```
|
|
111
177
|
|
|
112
|
-
## NodeJS SDK
|
|
113
|
-
|
|
114
|
-
```js
|
|
115
|
-
const replayable = require("replayable");
|
|
116
|
-
|
|
117
|
-
process.on("uncaughtException", async (err) => {
|
|
118
|
-
let replay = await replayable.createReplay({
|
|
119
|
-
title: "uncaughtException",
|
|
120
|
-
description: err,
|
|
121
|
-
});
|
|
122
|
-
console.log("Replayable", replay);
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
setTimeout(() => {
|
|
126
|
-
throw new Error("Throw makes it go boom!");
|
|
127
|
-
}, 3000);
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
## Javascript Integration
|
|
131
|
-
|
|
132
|
-
Note that this example does not require any library to be installed as the app exposes the protocol natively.
|
|
133
|
-
|
|
134
|
-
```js
|
|
135
|
-
window.onerror = function myErrorHandler() {
|
|
136
|
-
window.open("replayable://replay/create", "_blank");
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
setTimeout(() => {
|
|
140
|
-
throw new Error("Throw makes it go boom!");
|
|
141
|
-
}, 3000);
|
|
142
|
-
```
|
|
143
|
-
|
|
144
178
|
# Advanced Usage
|
|
145
179
|
|
|
146
180
|
```
|
package/index.js
CHANGED
|
@@ -6,26 +6,24 @@ const { program } = require("commander");
|
|
|
6
6
|
let stdin = "";
|
|
7
7
|
|
|
8
8
|
program
|
|
9
|
-
.name("
|
|
10
|
-
.description(
|
|
11
|
-
|
|
12
|
-
)
|
|
13
|
-
.version("0.0.9");
|
|
9
|
+
.name("dashcam")
|
|
10
|
+
.description("Capture the steps to reproduce every bug.")
|
|
11
|
+
.version("0.1.0");
|
|
14
12
|
|
|
15
13
|
program.showHelpAfterError();
|
|
16
14
|
|
|
17
15
|
program
|
|
18
16
|
.command("create", { isDefault: true })
|
|
19
17
|
.description(
|
|
20
|
-
"Create a
|
|
18
|
+
"Create a clip and output the resulting url or markdown. Will launch desktop app for local editing before publishing."
|
|
21
19
|
)
|
|
22
20
|
.option(
|
|
23
21
|
"-t, --title <string>",
|
|
24
|
-
"Title of the
|
|
22
|
+
"Title of the clip. Automatically generated if not supplied."
|
|
25
23
|
)
|
|
26
24
|
.option(
|
|
27
25
|
"-d, --description [text]",
|
|
28
|
-
"
|
|
26
|
+
"Markdown body. This may also be piped in: `cat README.md | dashcam create`"
|
|
29
27
|
)
|
|
30
28
|
.option("--md", "Returns code for a rich markdown image link.")
|
|
31
29
|
.action(async function (str, options) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dashcam",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Fix bugs, close pulls, and update your team with desktop instant replay.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"prepare": "husky install"
|
|
9
9
|
},
|
|
10
10
|
"bin": {
|
|
11
|
-
"
|
|
11
|
+
"dashcam": "index.js"
|
|
12
12
|
},
|
|
13
13
|
"author": "",
|
|
14
14
|
"license": "ISC",
|