dashcam 0.5.5 → 0.6.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.
Files changed (4) hide show
  1. package/README.md +17 -8
  2. package/index.js +21 -0
  3. package/lib.js +7 -1
  4. package/package.json +1 -1
package/README.md CHANGED
@@ -14,16 +14,17 @@ Usage: dashcam [options] [command]
14
14
  Capture the steps to reproduce every bug.
15
15
 
16
16
  Options:
17
- -V, --version output the version number
18
- -h, --help display help for command
17
+ -V, --version output the version number
18
+ -h, --help display help for command
19
19
 
20
20
  Commands:
21
- create [options] Create a clip and output the resulting url or markdown. Will launch desktop app for local editing before publishing.
22
- record [options] Start a recording terminal to be included in your dashcam video recording
23
- pipe Pipe command output to dashcam to be included in recorded video
24
- start Start instant replay recording on dashcam
25
- help [command] display help for command
26
- ```
21
+ create [options] Create a clip and output the resulting url or markdown. Will launch desktop app for local editing before publishing.
22
+ record [options] Start a recording terminal to be included in your dashcam video recording
23
+ pipe Pipe command output to dashcam to be included in recorded video
24
+ track [options] Add a logs config to Dashcam
25
+ start Start instant replay recording on dashcam
26
+ help [command] display help for command
27
+ ```
27
28
 
28
29
  ## Table of contents
29
30
 
@@ -74,6 +75,14 @@ Anything you type in your terminal will appear in your dash. To exit, simply typ
74
75
  exit
75
76
  ```
76
77
 
78
+ ## Add a new logs config to dashcam
79
+
80
+ Add a new logs config to dashcam by specifying a name, a type ("application" or "web"), and one or multiple patterns for the urls in the case of a web logs config, or for file paths in the case of an application logs config.
81
+
82
+ ```
83
+ dashcam track --name=social --type=web --pattern="*facebook.com*" --pattern="*twitter.com*"
84
+ ```
85
+
77
86
  ## Pipe command output into dashcam for recording
78
87
 
79
88
  To record the output of a command in the Dashcam app (In this example the `ping 1.1.1.1` command ), use the following command
package/index.js CHANGED
@@ -107,6 +107,27 @@ program
107
107
  }
108
108
  });
109
109
 
110
+ program
111
+ .command("track")
112
+ .requiredOption("--name <name>", "The name for the log config.")
113
+ .requiredOption(
114
+ "--type <type>",
115
+ 'The type of log config ("web" or "application").'
116
+ )
117
+ .requiredOption(
118
+ "--pattern <patterns...>",
119
+ 'The patterns of the urls in the case of "web" or the file paths in the case of "application" (Can contain wildcards \'*\'), multiple patterns can be provided.'
120
+ )
121
+ .description("Add a logs config to Dashcam")
122
+ .action(async function ({ name, type, pattern: patterns }) {
123
+ if (!["web", "application"].includes(type)) {
124
+ console.log('The "type" options needs to be "web" or "application"');
125
+ } else {
126
+ await lib.addLogsConfig({ name, type, patterns });
127
+ }
128
+ process.exit(0);
129
+ });
130
+
110
131
  program
111
132
  .command("start")
112
133
  .description("Start instant replay recording on dashcam")
package/lib.js CHANGED
@@ -129,9 +129,15 @@ const getLogFilePath = (id) => {
129
129
  return path.join(os.tmpdir(), `dashcam_cli_recording_${id}.log`);
130
130
  };
131
131
 
132
+ const addLogsConfig = async (options) => {
133
+ await connectToIpc();
134
+ ipc.of.dashcam.emit("add-logs-config", options);
135
+ };
136
+
132
137
  module.exports = {
133
138
  createReplay,
134
- startInstantReplay,
139
+ addLogsConfig,
135
140
  getLogFilePath,
141
+ startInstantReplay,
136
142
  PersistantDashcamIPC,
137
143
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dashcam",
3
- "version": "0.5.5",
3
+ "version": "0.6.0",
4
4
  "description": "Fix bugs, close pulls, and update your team with desktop instant replay.",
5
5
  "main": "index.js",
6
6
  "scripts": {