@herodevs/cli 0.1.15 → 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.
Files changed (48) hide show
  1. package/README.md +16 -330
  2. package/dist/commands/{committer/get-all.d.ts → report/committers.d.ts} +3 -3
  3. package/dist/commands/{committer/get-all.js → report/committers.js} +17 -26
  4. package/dist/commands/tracker/init.d.ts +8 -0
  5. package/dist/commands/tracker/init.js +16 -0
  6. package/dist/commands/tracker/run.d.ts +13 -0
  7. package/dist/commands/tracker/run.js +38 -0
  8. package/dist/package.json +25 -11
  9. package/dist/shared/command/base-command.d.ts +1 -1
  10. package/dist/shared/lib/version-update.js +11 -26
  11. package/dist/shared/tracker/default-config.d.ts +3 -0
  12. package/dist/shared/tracker/default-config.js +19 -0
  13. package/dist/shared/tracker/initialize.d.ts +1 -0
  14. package/dist/shared/tracker/initialize.js +15 -0
  15. package/dist/shared/tracker/models/aggregate-result.d.ts +4 -0
  16. package/dist/shared/tracker/models/aggregate-result.js +2 -0
  17. package/dist/shared/tracker/models/category-result.d.ts +7 -0
  18. package/dist/shared/tracker/models/category-result.js +2 -0
  19. package/dist/shared/tracker/models/category.d.ts +9 -0
  20. package/dist/shared/tracker/models/category.js +2 -0
  21. package/dist/shared/tracker/models/chart-config.d.ts +24 -0
  22. package/dist/shared/tracker/models/chart-config.js +81 -0
  23. package/dist/shared/tracker/models/config.d.ts +8 -0
  24. package/dist/shared/tracker/models/config.js +2 -0
  25. package/dist/shared/tracker/models/file-result.d.ts +5 -0
  26. package/dist/shared/tracker/models/file-result.js +2 -0
  27. package/dist/shared/tracker/models/process-result.d.ts +6 -0
  28. package/dist/shared/tracker/models/process-result.js +2 -0
  29. package/dist/shared/tracker/models/result.d.ts +11 -0
  30. package/dist/shared/tracker/models/result.js +2 -0
  31. package/dist/shared/tracker/models/total-result.d.ts +4 -0
  32. package/dist/shared/tracker/models/total-result.js +2 -0
  33. package/dist/shared/tracker/models/viz-dataset.d.ts +4 -0
  34. package/dist/shared/tracker/models/viz-dataset.js +2 -0
  35. package/dist/shared/tracker/models/viz-labels-datasets.d.ts +5 -0
  36. package/dist/shared/tracker/models/viz-labels-datasets.js +2 -0
  37. package/dist/shared/tracker/process-category.d.ts +3 -0
  38. package/dist/shared/tracker/process-category.js +155 -0
  39. package/dist/shared/tracker/process-config.d.ts +3 -0
  40. package/dist/shared/tracker/process-config.js +16 -0
  41. package/dist/shared/tracker/tracker-chart.d.ts +14 -0
  42. package/dist/shared/tracker/tracker-chart.js +158 -0
  43. package/dist/shared/tracker/util.d.ts +20 -0
  44. package/dist/shared/tracker/util.js +92 -0
  45. package/oclif.manifest.json +41 -31
  46. package/package.json +25 -11
  47. package/dist/commands/committer/index.d.ts +0 -9
  48. package/dist/commands/committer/index.js +0 -15
package/README.md CHANGED
@@ -1,356 +1,42 @@
1
- # HeroDevs NES Developer Kit -- `@herodevs/cli`
1
+ # HeroDevs CLI -- `@herodevs/cli`
2
2
 
3
- <!-- [![herodevs](https://img.shields.io/badge/cli-oclif-brightgreen.svg)](https://herodevs.com)
4
- [![CircleCI](https://circleci.com/gh/oclif/hello-world/tree/main.svg?style=shield)](https://circleci.com/gh/oclif/hello-world/tree/main)
5
- [![GitHub license](https://img.shields.io/github/license/oclif/hello-world)](https://github.com/oclif/hello-world/blob/main/LICENSE) -->
3
+ ## Installation
6
4
 
7
- <!-- toc -->
8
- * [HeroDevs NES Developer Kit -- `@herodevs/cli`](#herodevs-nes-developer-kit----herodevscli)
9
- * [Usage](#usage)
10
- * [Commands](#commands)
11
- <!-- tocstop -->
12
-
13
- # Usage
14
-
15
- <!-- usage -->
16
- ```sh-session
17
- $ npm install -g @herodevs/cli
18
- $ @herodevs/cli COMMAND
19
- running command...
20
- $ @herodevs/cli (--version)
21
- @herodevs/cli/0.1.15 darwin-arm64 node-v18.17.1
22
- $ @herodevs/cli --help [COMMAND]
23
- USAGE
24
- $ @herodevs/cli COMMAND
25
- ...
26
- ```
27
- <!-- usagestop -->
28
-
29
- # Commands
30
-
31
- <!-- commands -->
32
- * [`@herodevs/cli committer [GET-ALL]`](#herodevscli-committer-get-all)
33
- * [`@herodevs/cli committer:get-all [flags [-s][-e][-x]]`](#herodevscli-committerget-all-flags--s-e-x)
34
- * [`@herodevs/cli help [COMMANDS]`](#herodevscli-help-commands)
35
- * [`@herodevs/cli plugins`](#herodevscli-plugins)
36
- * [`@herodevs/cli plugins:install PLUGIN...`](#herodevscli-pluginsinstall-plugin)
37
- * [`@herodevs/cli plugins:inspect PLUGIN...`](#herodevscli-pluginsinspect-plugin)
38
- * [`@herodevs/cli plugins:install PLUGIN...`](#herodevscli-pluginsinstall-plugin-1)
39
- * [`@herodevs/cli plugins:link PLUGIN`](#herodevscli-pluginslink-plugin)
40
- * [`@herodevs/cli plugins:uninstall PLUGIN...`](#herodevscli-pluginsuninstall-plugin)
41
- * [`@herodevs/cli plugins:uninstall PLUGIN...`](#herodevscli-pluginsuninstall-plugin-1)
42
- * [`@herodevs/cli plugins:uninstall PLUGIN...`](#herodevscli-pluginsuninstall-plugin-2)
43
- * [`@herodevs/cli plugins update`](#herodevscli-plugins-update)
44
-
45
- ## `@herodevs/cli committer [GET-ALL]`
46
-
47
- Gets committer info
48
-
49
- ```
50
- USAGE
51
- $ @herodevs/cli committer [GET-ALL] [--json] [--log-level debug|info|warn|error]
52
-
53
- GLOBAL FLAGS
54
- --json Format output as json.
55
- --log-level=<option> Specify level for logging.
56
- <options: debug|info|warn|error>
57
-
58
- DESCRIPTION
59
- Gets committer info
60
-
61
- EXAMPLES
62
- $ @herodevs/cli committer
63
- ```
64
-
65
- _See code: [dist/commands/committer/index.ts](https://github.com/herodevs/cli/blob/v0.1.15/dist/commands/committer/index.ts)_
66
-
67
- ## `@herodevs/cli committer:get-all [flags [-s][-e][-x]]`
68
-
69
- Get Committers Between Two Dates
70
-
71
- ```
72
- USAGE
73
- $ @herodevs/cli committer get-all [flags [-s][-e][-x]]
74
-
75
- FLAGS
76
- -e, --endDate=<value> [default: 2022-09-01] End Date (format: yyyy-MM-dd)
77
- -s, --startDate=<value> [default: 2023-09-01] Start Date (format: yyyy-MM-dd)
78
- -x, --exclude=<value>... Path Exclusions (eg -x="./src/bin" -x="./dist")
79
-
80
- GLOBAL FLAGS
81
- --json Format output as json.
82
- --log-level=<option> Specify level for logging.
83
- <options: debug|info|warn|error>
84
-
85
- EXAMPLES
86
- $ @herodevs/cli committer get-all
87
- ```
88
-
89
- _See code: [dist/commands/committer/get-all.ts](https://github.com/herodevs/cli/blob/v0.1.15/dist/commands/committer/get-all.ts)_
90
-
91
- ## `@herodevs/cli help [COMMANDS]`
92
-
93
- Display help for @herodevs/cli.
94
-
95
- ```
96
- USAGE
97
- $ @herodevs/cli help [COMMANDS] [-n]
98
-
99
- ARGUMENTS
100
- COMMANDS Command to show help for.
101
-
102
- FLAGS
103
- -n, --nested-commands Include all nested commands in the output.
104
-
105
- DESCRIPTION
106
- Display help for @herodevs/cli.
107
- ```
108
-
109
- _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.2.16/src/commands/help.ts)_
110
-
111
- ## `@herodevs/cli plugins`
112
-
113
- List installed plugins.
114
-
115
- ```
116
- USAGE
117
- $ @herodevs/cli plugins [--json] [--core]
118
-
119
- FLAGS
120
- --core Show core plugins.
121
-
122
- GLOBAL FLAGS
123
- --json Format output as json.
124
-
125
- DESCRIPTION
126
- List installed plugins.
127
-
128
- EXAMPLES
129
- $ @herodevs/cli plugins
130
- ```
131
-
132
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.2.5/src/commands/plugins/index.ts)_
133
-
134
- ## `@herodevs/cli plugins:install PLUGIN...`
135
-
136
- Installs a plugin into the CLI.
137
-
138
- ```
139
- USAGE
140
- $ @herodevs/cli plugins:install PLUGIN...
141
-
142
- ARGUMENTS
143
- PLUGIN Plugin to install.
144
-
145
- FLAGS
146
- -f, --force Run yarn install with force flag.
147
- -h, --help Show CLI help.
148
- -v, --verbose
149
-
150
- DESCRIPTION
151
- Installs a plugin into the CLI.
152
- Can be installed from npm or a git url.
153
-
154
- Installation of a user-installed plugin will override a core plugin.
155
-
156
- e.g. If you have a core plugin that has a 'hello' command, installing a user-installed plugin with a 'hello' command
157
- will override the core plugin implementation. This is useful if a user needs to update core plugin functionality in
158
- the CLI without the need to patch and update the whole CLI.
159
-
160
-
161
- ALIASES
162
- $ @herodevs/cli plugins add
163
-
164
- EXAMPLES
165
- $ @herodevs/cli plugins:install myplugin
166
-
167
- $ @herodevs/cli plugins:install https://github.com/someuser/someplugin
168
-
169
- $ @herodevs/cli plugins:install someuser/someplugin
170
- ```
171
-
172
- ## `@herodevs/cli plugins:inspect PLUGIN...`
173
-
174
- Displays installation properties of a plugin.
175
-
176
- ```
177
- USAGE
178
- $ @herodevs/cli plugins:inspect PLUGIN...
179
-
180
- ARGUMENTS
181
- PLUGIN [default: .] Plugin to inspect.
182
-
183
- FLAGS
184
- -h, --help Show CLI help.
185
- -v, --verbose
186
-
187
- GLOBAL FLAGS
188
- --json Format output as json.
189
-
190
- DESCRIPTION
191
- Displays installation properties of a plugin.
192
-
193
- EXAMPLES
194
- $ @herodevs/cli plugins:inspect myplugin
195
5
  ```
196
-
197
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.2.5/src/commands/plugins/inspect.ts)_
198
-
199
- ## `@herodevs/cli plugins:install PLUGIN...`
200
-
201
- Installs a plugin into the CLI.
202
-
203
- ```
204
- USAGE
205
- $ @herodevs/cli plugins:install PLUGIN...
206
-
207
- ARGUMENTS
208
- PLUGIN Plugin to install.
209
-
210
- FLAGS
211
- -f, --force Run yarn install with force flag.
212
- -h, --help Show CLI help.
213
- -v, --verbose
214
-
215
- DESCRIPTION
216
- Installs a plugin into the CLI.
217
- Can be installed from npm or a git url.
218
-
219
- Installation of a user-installed plugin will override a core plugin.
220
-
221
- e.g. If you have a core plugin that has a 'hello' command, installing a user-installed plugin with a 'hello' command
222
- will override the core plugin implementation. This is useful if a user needs to update core plugin functionality in
223
- the CLI without the need to patch and update the whole CLI.
224
-
225
-
226
- ALIASES
227
- $ @herodevs/cli plugins add
228
-
229
- EXAMPLES
230
- $ @herodevs/cli plugins:install myplugin
231
-
232
- $ @herodevs/cli plugins:install https://github.com/someuser/someplugin
233
-
234
- $ @herodevs/cli plugins:install someuser/someplugin
6
+ npm install -g @herodevs/cli
235
7
  ```
236
8
 
237
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.2.5/src/commands/plugins/install.ts)_
9
+ ## Usage
238
10
 
239
- ## `@herodevs/cli plugins:link PLUGIN`
240
-
241
- Links a plugin into the CLI for development.
11
+ after global installation
242
12
 
243
13
  ```
244
- USAGE
245
- $ @herodevs/cli plugins:link PLUGIN
246
-
247
- ARGUMENTS
248
- PATH [default: .] path to plugin
249
-
250
- FLAGS
251
- -h, --help Show CLI help.
252
- -v, --verbose
253
-
254
- DESCRIPTION
255
- Links a plugin into the CLI for development.
256
- Installation of a linked plugin will override a user-installed or core plugin.
257
-
258
- e.g. If you have a user-installed or core plugin that has a 'hello' command, installing a linked plugin with a 'hello'
259
- command will override the user-installed or core plugin implementation. This is useful for development work.
260
-
261
-
262
- EXAMPLES
263
- $ @herodevs/cli plugins:link myplugin
14
+ @herodevs/cli ____
264
15
  ```
265
16
 
266
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.2.5/src/commands/plugins/link.ts)_
267
-
268
- ## `@herodevs/cli plugins:uninstall PLUGIN...`
269
-
270
- Removes a plugin from the CLI.
17
+ or
271
18
 
272
19
  ```
273
- USAGE
274
- $ @herodevs/cli plugins:uninstall PLUGIN...
275
-
276
- ARGUMENTS
277
- PLUGIN plugin to uninstall
278
-
279
- FLAGS
280
- -h, --help Show CLI help.
281
- -v, --verbose
282
-
283
- DESCRIPTION
284
- Removes a plugin from the CLI.
285
-
286
- ALIASES
287
- $ @herodevs/cli plugins unlink
288
- $ @herodevs/cli plugins remove
20
+ hd ____
289
21
  ```
290
22
 
291
- ## `@herodevs/cli plugins:uninstall PLUGIN...`
292
-
293
- Removes a plugin from the CLI.
23
+ without installation:
294
24
 
295
25
  ```
296
- USAGE
297
- $ @herodevs/cli plugins:uninstall PLUGIN...
298
-
299
- ARGUMENTS
300
- PLUGIN plugin to uninstall
301
-
302
- FLAGS
303
- -h, --help Show CLI help.
304
- -v, --verbose
305
-
306
- DESCRIPTION
307
- Removes a plugin from the CLI.
308
-
309
- ALIASES
310
- $ @herodevs/cli plugins unlink
311
- $ @herodevs/cli plugins remove
26
+ npx @herodevs/cli ____
312
27
  ```
313
28
 
314
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.2.5/src/commands/plugins/uninstall.ts)_
29
+ ## Commands
315
30
 
316
- ## `@herodevs/cli plugins:uninstall PLUGIN...`
317
-
318
- Removes a plugin from the CLI.
31
+ Get a list of committers within a git repository
319
32
 
320
33
  ```
321
- USAGE
322
- $ @herodevs/cli plugins:uninstall PLUGIN...
323
-
324
- ARGUMENTS
325
- PLUGIN plugin to uninstall
326
-
327
- FLAGS
328
- -h, --help Show CLI help.
329
- -v, --verbose
330
-
331
- DESCRIPTION
332
- Removes a plugin from the CLI.
333
-
334
- ALIASES
335
- $ @herodevs/cli plugins unlink
336
- $ @herodevs/cli plugins remove
34
+ hd report committers
337
35
  ```
338
36
 
339
- ## `@herodevs/cli plugins update`
340
-
341
- Update installed plugins.
37
+ Track a project's progress via lines of code
342
38
 
343
39
  ```
344
- USAGE
345
- $ @herodevs/cli plugins update [-h] [-v]
346
-
347
- FLAGS
348
- -h, --help Show CLI help.
349
- -v, --verbose
350
-
351
- DESCRIPTION
352
- Update installed plugins.
40
+ hd tracker init
41
+ hd tracker run
353
42
  ```
354
-
355
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.2.5/src/commands/plugins/update.ts)_
356
- <!-- commandsstop -->
@@ -1,16 +1,16 @@
1
1
  import { BaseCommand, Flags as flagType } from '../../shared';
2
- export declare class CommitterGetAll extends BaseCommand<typeof CommitterGetAll> {
2
+ export declare class ReportCommitters extends BaseCommand<typeof ReportCommitters> {
3
3
  static summary: string;
4
4
  static usage: string;
5
5
  static examples: string[];
6
6
  static flags: {
7
7
  startDate: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
8
8
  endDate: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
9
- exclude: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
9
+ exclude: import("@oclif/core/lib/interfaces").OptionFlag<string[], import("@oclif/core/lib/interfaces/parser").CustomOptions>;
10
10
  };
11
11
  private _parseDateFlags;
12
12
  private _parseGitLogEntries;
13
13
  private _collapseAndSortCommitterInfo;
14
14
  private _printOutput;
15
- run(): Promise<flagType<typeof CommitterGetAll>>;
15
+ run(): Promise<flagType<typeof ReportCommitters>>;
16
16
  }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CommitterGetAll = void 0;
3
+ exports.ReportCommitters = void 0;
4
4
  const core_1 = require("@oclif/core");
5
5
  const shared_1 = require("../../shared");
6
6
  const date_fns_1 = require("date-fns");
@@ -9,17 +9,10 @@ const monthsToSubtract = 12;
9
9
  const dateFmt = 'yyyy-MM-dd';
10
10
  const defaultStartDate = (0, date_fns_1.format)(new Date(), dateFmt);
11
11
  const defaultEndDate = (0, date_fns_1.format)((0, date_fns_1.subMonths)(new Date(), monthsToSubtract), dateFmt);
12
- const gitOutputFormat = `"${[
13
- '%h',
14
- '%an',
15
- '%ad'
16
- ].join(gammaDelimiter)}"`;
17
- class CommitterGetAll extends shared_1.BaseCommand {
12
+ const gitOutputFormat = `"${['%h', '%an', '%ad'].join(gammaDelimiter)}"`;
13
+ class ReportCommitters extends shared_1.BaseCommand {
18
14
  _parseDateFlags(startDate, endDate) {
19
- return [
20
- (0, date_fns_1.parse)(endDate, dateFmt, new Date()),
21
- (0, date_fns_1.parse)(startDate, dateFmt, new Date()),
22
- ];
15
+ return [(0, date_fns_1.parse)(endDate, dateFmt, new Date()), (0, date_fns_1.parse)(startDate, dateFmt, new Date())];
23
16
  }
24
17
  _parseGitLogEntries(entries) {
25
18
  return entries.map((entry) => {
@@ -38,7 +31,9 @@ class CommitterGetAll extends shared_1.BaseCommand {
38
31
  Object.keys(hash).forEach((name) => {
39
32
  sortable.push({ name, commits: hash[name] });
40
33
  });
41
- return sortable.sort((a, b) => { return b.commits.length - a.commits.length; });
34
+ return sortable.sort((a, b) => {
35
+ return b.commits.length - a.commits.length;
36
+ });
42
37
  }
43
38
  _printOutput(committers) {
44
39
  if (!Object.keys(committers).length) {
@@ -52,12 +47,12 @@ class CommitterGetAll extends shared_1.BaseCommand {
52
47
  });
53
48
  this.log('\n');
54
49
  });
55
- this.log('--------------------------------------------------\n');
50
+ this.log('---------------------------------------------------\n');
56
51
  }
57
52
  async run() {
58
- const { flags } = await this.parse(CommitterGetAll);
53
+ const { flags } = (await this.parse(ReportCommitters));
59
54
  const dates = this._parseDateFlags(flags.startDate, flags.endDate);
60
- const ignores = (flags.exclude && flags.exclude.length) ? `-- . "!(${flags.exclude.join('|')})"` : '';
55
+ const ignores = flags.exclude && flags.exclude.length ? `-- . "!(${flags.exclude.join('|')})"` : '';
61
56
  const gitCommand = `git log --since "${dates[0]}" --until "${dates[1]}" --pretty=format:${gitOutputFormat} ${ignores}`;
62
57
  const result = await (0, shared_1.run)(gitCommand);
63
58
  const committers = this._collapseAndSortCommitterInfo(result.split('\n'));
@@ -65,26 +60,22 @@ class CommitterGetAll extends shared_1.BaseCommand {
65
60
  return Promise.resolve();
66
61
  }
67
62
  }
68
- exports.CommitterGetAll = CommitterGetAll;
69
- CommitterGetAll.summary = 'Get Committers Between Two Dates';
70
- CommitterGetAll.usage = '<%= command.id %> [flags [-s][-e][-x]]';
71
- CommitterGetAll.examples = [
72
- [
73
- '<%= config.bin %> <%= command.id %>',
74
- ].join('\n')
75
- ];
76
- CommitterGetAll.flags = {
63
+ exports.ReportCommitters = ReportCommitters;
64
+ ReportCommitters.summary = 'Get Committers Between Two Dates';
65
+ ReportCommitters.usage = '<%= command.id %> [flags [-s][-e][-x]]';
66
+ ReportCommitters.examples = [['<%= config.bin %> <%= command.id %>'].join('\n')];
67
+ ReportCommitters.flags = {
77
68
  startDate: core_1.Flags.string({
78
69
  char: 's',
79
70
  summary: `Start Date (format: yyyy-MM-dd)`,
80
71
  required: false,
81
- default: () => defaultStartDate
72
+ default: () => defaultStartDate,
82
73
  }),
83
74
  endDate: core_1.Flags.string({
84
75
  char: 'e',
85
76
  summary: `End Date (format: yyyy-MM-dd)`,
86
77
  required: false,
87
- default: () => defaultEndDate
78
+ default: () => defaultEndDate,
88
79
  }),
89
80
  exclude: core_1.Flags.string({
90
81
  char: 'x',
@@ -0,0 +1,8 @@
1
+ import { Command } from '@oclif/core';
2
+ export declare class TrackerInit extends Command {
3
+ static description: string;
4
+ static examples: string[];
5
+ static flags: {};
6
+ static args: {};
7
+ run(): Promise<void>;
8
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TrackerInit = void 0;
4
+ const core_1 = require("@oclif/core");
5
+ const initialize_1 = require("../../shared/tracker/initialize");
6
+ const util_1 = require("../../shared/tracker/util");
7
+ class TrackerInit extends core_1.Command {
8
+ async run() {
9
+ (0, initialize_1.initialize)((0, util_1.getTheRootDirectory)(global.process.cwd()));
10
+ }
11
+ }
12
+ exports.TrackerInit = TrackerInit;
13
+ TrackerInit.description = 'Initialize the tracker configuration';
14
+ TrackerInit.examples = ['<%= config.bin %> <%= command.id %>'];
15
+ TrackerInit.flags = {};
16
+ TrackerInit.args = {};
@@ -0,0 +1,13 @@
1
+ import { Command } from '@oclif/core';
2
+ import { ChartConfig } from '../../shared/tracker/models/chart-config';
3
+ export declare class TrackerRun extends Command {
4
+ static description: string;
5
+ static examples: string[];
6
+ static flags: {
7
+ root: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
8
+ config: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
9
+ chart: import("@oclif/core/lib/interfaces").OptionFlag<ChartConfig, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
10
+ };
11
+ static args: {};
12
+ run(): Promise<void>;
13
+ }
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TrackerRun = void 0;
4
+ const core_1 = require("@oclif/core");
5
+ const path_1 = require("path");
6
+ const util_1 = require("../../shared/tracker/util");
7
+ const process_config_1 = require("../../shared/tracker/process-config");
8
+ const chart_config_1 = require("../../shared/tracker/models/chart-config");
9
+ class TrackerRun extends core_1.Command {
10
+ async run() {
11
+ const { flags } = await this.parse(TrackerRun);
12
+ const localRootDir = (0, util_1.getTheRootDirectory)(global.process.cwd());
13
+ const rootDirectory = flags.root ? (0, path_1.resolve)(flags.root) : localRootDir;
14
+ const config = (0, util_1.readConfig)(localRootDir, flags.config);
15
+ const results = await (0, process_config_1.processConfig)(config, rootDirectory);
16
+ (0, util_1.saveResults)(localRootDir, config.outputDir, results);
17
+ const allData = (0, util_1.getData)(localRootDir, config.outputDir);
18
+ const parentDir = (0, path_1.resolve)(localRootDir, config.outputDir);
19
+ const chartConfig = new chart_config_1.ChartConfig(flags.chart);
20
+ try {
21
+ await (0, util_1.createDataVizIn)(chartConfig, parentDir, allData);
22
+ }
23
+ catch (error) {
24
+ console.log('Error creating visualization');
25
+ }
26
+ }
27
+ }
28
+ exports.TrackerRun = TrackerRun;
29
+ TrackerRun.description = 'Run the tracker';
30
+ TrackerRun.examples = ['<%= config.bin %> <%= command.id %>'];
31
+ TrackerRun.flags = {
32
+ root: core_1.Flags.string({ char: 'r', description: 'root dir of the project' }),
33
+ config: core_1.Flags.string({ char: 'c', description: 'path to config file' }),
34
+ chart: core_1.Flags.custom({
35
+ description: 'chart configuration',
36
+ })(),
37
+ };
38
+ TrackerRun.args = {};
package/dist/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@herodevs/cli",
3
- "version": "0.1.15",
4
- "description": "HeroDevs NES Developer Kit",
3
+ "version": "0.2.0",
4
+ "description": "HeroDevs CLI",
5
5
  "author": "@herodevs",
6
6
  "bin": {
7
7
  "@herodevs/cli": "./bin/run",
@@ -19,14 +19,20 @@
19
19
  "package.json"
20
20
  ],
21
21
  "dependencies": {
22
- "@badisi/latest-version": "^6.1.10",
23
22
  "@oclif/core": "^2",
24
23
  "@oclif/plugin-help": "^5",
25
24
  "@oclif/plugin-plugins": "^3.2.0",
26
- "clear-npx-cache": "^1.0.1",
25
+ "chart.js": "^3.9.1",
26
+ "chart.js-image": "^6.1.3",
27
+ "chartjs-node-canvas": "^4.1.6",
28
+ "chartjs-plugin-autocolors": "^0.2.2",
29
+ "chartjs-plugin-datalabels": "^2.2.0",
27
30
  "date-fns": "^2.30.0",
31
+ "get-json": "^1.0.1",
32
+ "git-last-commit": "^1.0.1",
28
33
  "module-alias": "^2.2.3",
29
- "shelljs": "^0.8.5"
34
+ "shelljs": "^0.8.5",
35
+ "sloc": "^0.2.1"
30
36
  },
31
37
  "devDependencies": {
32
38
  "@oclif/test": "^2.4.4",
@@ -49,13 +55,15 @@
49
55
  "dirname": "@herodevs/cli",
50
56
  "commands": "./dist/commands",
51
57
  "plugins": [
52
- "@oclif/plugin-help",
53
- "@oclif/plugin-plugins"
58
+ "@oclif/plugin-help"
54
59
  ],
55
60
  "topicSeparator": " ",
56
61
  "topics": {
57
- "committer": {
58
- "description": "Committer actions"
62
+ "report": {
63
+ "description": "Run reports for the current project (commands: committers)"
64
+ },
65
+ "tracker": {
66
+ "description": "Track project progress based upon lines of code (commands: init, run)"
59
67
  }
60
68
  }
61
69
  },
@@ -69,7 +77,7 @@
69
77
  "build": "shx rm -rf dist && tsc -b && shx cp package.json dist/package.json",
70
78
  "lint": "eslint . --ext .ts --config .eslintrc",
71
79
  "postpack": "shx rm -f oclif.manifest.json",
72
- "posttest": "npm run lint",
80
+ "posttestXXX": "npm run lint",
73
81
  "prepack": "npm run build && oclif manifest && oclif readme",
74
82
  "test": "mocha --forbid-only \"test/**/*.test.ts\"",
75
83
  "version": "oclif readme && git add README.md",
@@ -107,5 +115,11 @@
107
115
  "keywords": [
108
116
  "oclif"
109
117
  ],
110
- "types": "dist/index.d.ts"
118
+ "types": "dist/index.d.ts",
119
+ "prettier": {
120
+ "singleQuote": true,
121
+ "trailingComma": "es5",
122
+ "bracketSpacing": true,
123
+ "printWidth": 100
124
+ }
111
125
  }
@@ -9,7 +9,7 @@ declare enum LogLevel {
9
9
  export declare abstract class BaseCommand<T extends typeof Command> extends Command {
10
10
  static enableJsonFlag: boolean;
11
11
  static baseFlags: {
12
- 'log-level': import("@oclif/core/lib/interfaces").OptionFlag<LogLevel | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
12
+ 'log-level': import("@oclif/core/lib/interfaces").OptionFlag<LogLevel, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
13
13
  };
14
14
  protected flags: flagType<T>;
15
15
  protected args: argType<T>;