@nickchristensen/cliftin 4.0.0 → 4.1.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
CHANGED
|
@@ -78,7 +78,7 @@ DESCRIPTION
|
|
|
78
78
|
List exercises
|
|
79
79
|
```
|
|
80
80
|
|
|
81
|
-
_See code: [src/commands/exercises/list.ts](https://github.com/nickchristensen/cliftin/blob/v4.
|
|
81
|
+
_See code: [src/commands/exercises/list.ts](https://github.com/nickchristensen/cliftin/blob/v4.1.0/src/commands/exercises/list.ts)_
|
|
82
82
|
|
|
83
83
|
## `cliftin exercises show SELECTOR`
|
|
84
84
|
|
|
@@ -87,8 +87,8 @@ Show one exercise detail and history
|
|
|
87
87
|
```
|
|
88
88
|
USAGE
|
|
89
89
|
$ cliftin exercises show SELECTOR [--json] [--all | --limit <value>] [--from <value>] [--max-reps <value>]
|
|
90
|
-
[--max-weight <value>] [--min-reps <value>] [--min-weight <value>] [--
|
|
91
|
-
<value>]
|
|
90
|
+
[--max-weight <value>] [--min-reps <value>] [--min-weight <value>] [--no-warmup] [--program <value>] [--routine
|
|
91
|
+
<value>] [--to <value>]
|
|
92
92
|
|
|
93
93
|
ARGUMENTS
|
|
94
94
|
SELECTOR exercise id or name
|
|
@@ -101,6 +101,7 @@ FLAGS
|
|
|
101
101
|
--max-weight=<value> History max top weight
|
|
102
102
|
--min-reps=<value> History min top reps
|
|
103
103
|
--min-weight=<value> History min top weight
|
|
104
|
+
--no-warmup Hide warmup sets from output
|
|
104
105
|
--program=<value> History filter by program id or name
|
|
105
106
|
--routine=<value> History filter by routine id or name
|
|
106
107
|
--to=<value> History end date YYYY-MM-DD
|
|
@@ -112,7 +113,7 @@ DESCRIPTION
|
|
|
112
113
|
Show one exercise detail and history
|
|
113
114
|
```
|
|
114
115
|
|
|
115
|
-
_See code: [src/commands/exercises/show.ts](https://github.com/nickchristensen/cliftin/blob/v4.
|
|
116
|
+
_See code: [src/commands/exercises/show.ts](https://github.com/nickchristensen/cliftin/blob/v4.1.0/src/commands/exercises/show.ts)_
|
|
116
117
|
|
|
117
118
|
## `cliftin help [COMMAND]`
|
|
118
119
|
|
|
@@ -149,7 +150,7 @@ DESCRIPTION
|
|
|
149
150
|
List programs
|
|
150
151
|
```
|
|
151
152
|
|
|
152
|
-
_See code: [src/commands/programs/list.ts](https://github.com/nickchristensen/cliftin/blob/v4.
|
|
153
|
+
_See code: [src/commands/programs/list.ts](https://github.com/nickchristensen/cliftin/blob/v4.1.0/src/commands/programs/list.ts)_
|
|
153
154
|
|
|
154
155
|
## `cliftin programs show [SELECTOR]`
|
|
155
156
|
|
|
@@ -169,7 +170,7 @@ DESCRIPTION
|
|
|
169
170
|
Show one program hierarchy
|
|
170
171
|
```
|
|
171
172
|
|
|
172
|
-
_See code: [src/commands/programs/show.ts](https://github.com/nickchristensen/cliftin/blob/v4.
|
|
173
|
+
_See code: [src/commands/programs/show.ts](https://github.com/nickchristensen/cliftin/blob/v4.1.0/src/commands/programs/show.ts)_
|
|
173
174
|
|
|
174
175
|
## `cliftin routines from-workout [WORKOUTID]`
|
|
175
176
|
|
|
@@ -189,7 +190,7 @@ DESCRIPTION
|
|
|
189
190
|
Show the planned routine for a completed workout
|
|
190
191
|
```
|
|
191
192
|
|
|
192
|
-
_See code: [src/commands/routines/from-workout.ts](https://github.com/nickchristensen/cliftin/blob/v4.
|
|
193
|
+
_See code: [src/commands/routines/from-workout.ts](https://github.com/nickchristensen/cliftin/blob/v4.1.0/src/commands/routines/from-workout.ts)_
|
|
193
194
|
|
|
194
195
|
## `cliftin routines latest`
|
|
195
196
|
|
|
@@ -206,7 +207,7 @@ DESCRIPTION
|
|
|
206
207
|
Show the planned routine for the latest workout
|
|
207
208
|
```
|
|
208
209
|
|
|
209
|
-
_See code: [src/commands/routines/latest.ts](https://github.com/nickchristensen/cliftin/blob/v4.
|
|
210
|
+
_See code: [src/commands/routines/latest.ts](https://github.com/nickchristensen/cliftin/blob/v4.1.0/src/commands/routines/latest.ts)_
|
|
210
211
|
|
|
211
212
|
## `cliftin routines list`
|
|
212
213
|
|
|
@@ -228,7 +229,7 @@ DESCRIPTION
|
|
|
228
229
|
List planned routines
|
|
229
230
|
```
|
|
230
231
|
|
|
231
|
-
_See code: [src/commands/routines/list.ts](https://github.com/nickchristensen/cliftin/blob/v4.
|
|
232
|
+
_See code: [src/commands/routines/list.ts](https://github.com/nickchristensen/cliftin/blob/v4.1.0/src/commands/routines/list.ts)_
|
|
232
233
|
|
|
233
234
|
## `cliftin routines next`
|
|
234
235
|
|
|
@@ -245,7 +246,7 @@ DESCRIPTION
|
|
|
245
246
|
Show the up-next routine from the active program
|
|
246
247
|
```
|
|
247
248
|
|
|
248
|
-
_See code: [src/commands/routines/next.ts](https://github.com/nickchristensen/cliftin/blob/v4.
|
|
249
|
+
_See code: [src/commands/routines/next.ts](https://github.com/nickchristensen/cliftin/blob/v4.1.0/src/commands/routines/next.ts)_
|
|
249
250
|
|
|
250
251
|
## `cliftin routines show SELECTOR`
|
|
251
252
|
|
|
@@ -265,7 +266,7 @@ DESCRIPTION
|
|
|
265
266
|
Show one planned routine
|
|
266
267
|
```
|
|
267
268
|
|
|
268
|
-
_See code: [src/commands/routines/show.ts](https://github.com/nickchristensen/cliftin/blob/v4.
|
|
269
|
+
_See code: [src/commands/routines/show.ts](https://github.com/nickchristensen/cliftin/blob/v4.1.0/src/commands/routines/show.ts)_
|
|
269
270
|
|
|
270
271
|
## `cliftin workouts list`
|
|
271
272
|
|
|
@@ -292,7 +293,7 @@ DESCRIPTION
|
|
|
292
293
|
List workouts
|
|
293
294
|
```
|
|
294
295
|
|
|
295
|
-
_See code: [src/commands/workouts/list.ts](https://github.com/nickchristensen/cliftin/blob/v4.
|
|
296
|
+
_See code: [src/commands/workouts/list.ts](https://github.com/nickchristensen/cliftin/blob/v4.1.0/src/commands/workouts/list.ts)_
|
|
296
297
|
|
|
297
298
|
## `cliftin workouts next`
|
|
298
299
|
|
|
@@ -309,7 +310,7 @@ DESCRIPTION
|
|
|
309
310
|
Redirect to routines next
|
|
310
311
|
```
|
|
311
312
|
|
|
312
|
-
_See code: [src/commands/workouts/next.ts](https://github.com/nickchristensen/cliftin/blob/v4.
|
|
313
|
+
_See code: [src/commands/workouts/next.ts](https://github.com/nickchristensen/cliftin/blob/v4.1.0/src/commands/workouts/next.ts)_
|
|
313
314
|
|
|
314
315
|
## `cliftin workouts show [WORKOUTID]`
|
|
315
316
|
|
|
@@ -317,11 +318,14 @@ Show one workout with exercises and sets
|
|
|
317
318
|
|
|
318
319
|
```
|
|
319
320
|
USAGE
|
|
320
|
-
$ cliftin workouts show [WORKOUTID] [--json]
|
|
321
|
+
$ cliftin workouts show [WORKOUTID] [--json] [--no-warmup]
|
|
321
322
|
|
|
322
323
|
ARGUMENTS
|
|
323
324
|
[WORKOUTID] workout id (default: latest workout)
|
|
324
325
|
|
|
326
|
+
FLAGS
|
|
327
|
+
--no-warmup Hide warmup sets from output
|
|
328
|
+
|
|
325
329
|
GLOBAL FLAGS
|
|
326
330
|
--json Format output as json.
|
|
327
331
|
|
|
@@ -329,5 +333,5 @@ DESCRIPTION
|
|
|
329
333
|
Show one workout with exercises and sets
|
|
330
334
|
```
|
|
331
335
|
|
|
332
|
-
_See code: [src/commands/workouts/show.ts](https://github.com/nickchristensen/cliftin/blob/v4.
|
|
336
|
+
_See code: [src/commands/workouts/show.ts](https://github.com/nickchristensen/cliftin/blob/v4.1.0/src/commands/workouts/show.ts)_
|
|
333
337
|
<!-- commandsstop -->
|
|
@@ -13,6 +13,7 @@ export default class ExercisesShow extends Command {
|
|
|
13
13
|
'max-weight': import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
14
|
'min-reps': import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
15
|
'min-weight': import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
+
'no-warmup': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
16
17
|
program: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
18
|
routine: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
19
|
to: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
@@ -40,6 +40,7 @@ export default class ExercisesShow extends Command {
|
|
|
40
40
|
'max-weight': Flags.integer({ description: 'History max top weight' }),
|
|
41
41
|
'min-reps': Flags.integer({ description: 'History min top reps' }),
|
|
42
42
|
'min-weight': Flags.integer({ description: 'History min top weight' }),
|
|
43
|
+
'no-warmup': Flags.boolean({ description: 'Hide warmup sets from output' }),
|
|
43
44
|
program: Flags.string({ description: 'History filter by program id or name' }),
|
|
44
45
|
routine: Flags.string({ description: 'History filter by routine id or name' }),
|
|
45
46
|
to: Flags.string({ description: 'History end date YYYY-MM-DD' }),
|
|
@@ -58,7 +59,9 @@ export default class ExercisesShow extends Command {
|
|
|
58
59
|
const historyUnitPreference = await resolveExerciseWeightUnit(context.db, exerciseId);
|
|
59
60
|
const history = (await getExerciseHistoryWithSetsRows(context.db, exerciseId, historyFilters)).map((row) => ({
|
|
60
61
|
...row,
|
|
61
|
-
sets: row.sets
|
|
62
|
+
sets: row.sets
|
|
63
|
+
.filter((set) => (parsedFlags['no-warmup'] ? !set.isWarmup : true))
|
|
64
|
+
.map((set) => ({
|
|
62
65
|
...set,
|
|
63
66
|
weight: withWeightUnit(set.weight, historyUnitPreference),
|
|
64
67
|
})),
|
|
@@ -92,7 +95,7 @@ export default class ExercisesShow extends Command {
|
|
|
92
95
|
this.log(`Program: ${lastPerformedSnapshot.workout.program ?? 'n/a'}`);
|
|
93
96
|
this.log(`Date: ${formatWorkoutDate(lastPerformedSnapshot.workout.date)}`);
|
|
94
97
|
this.log('');
|
|
95
|
-
this.log(renderTable(lastPerformedSnapshot.exercise.sets.map((set) => ({
|
|
98
|
+
this.log(renderTable(lastPerformedSnapshot.exercise.sets.filter((set) => (parsedFlags['no-warmup'] ? !set.isWarmup : true)).map((set) => ({
|
|
96
99
|
id: set.id,
|
|
97
100
|
isWarmup: set.isWarmup,
|
|
98
101
|
reps: set.reps,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Args, Command } from '@oclif/core';
|
|
1
|
+
import { Args, Command, Flags } from '@oclif/core';
|
|
2
2
|
import { format, isValid, parseISO } from 'date-fns';
|
|
3
3
|
import { closeDb, openDb } from '../../lib/db.js';
|
|
4
4
|
import { serializeWorkoutDetailWithWeightUnits } from '../../lib/json-weight.js';
|
|
@@ -18,14 +18,28 @@ function formatWorkoutDate(dateIso) {
|
|
|
18
18
|
return dateIso;
|
|
19
19
|
return format(parsed, 'yyyy-MM-dd HH:mm');
|
|
20
20
|
}
|
|
21
|
+
function maybeExcludeWarmupSets(detail, omitWarmups) {
|
|
22
|
+
if (!omitWarmups)
|
|
23
|
+
return detail;
|
|
24
|
+
return {
|
|
25
|
+
...detail,
|
|
26
|
+
exercises: detail.exercises.map((exercise) => ({
|
|
27
|
+
...exercise,
|
|
28
|
+
sets: exercise.sets.filter((set) => !set.isWarmup),
|
|
29
|
+
})),
|
|
30
|
+
};
|
|
31
|
+
}
|
|
21
32
|
export default class WorkoutsShow extends Command {
|
|
22
33
|
static args = {
|
|
23
34
|
workoutId: Args.string({ description: 'workout id (default: latest workout)', ignoreStdin: true, required: false }),
|
|
24
35
|
};
|
|
25
36
|
static description = 'Show one workout with exercises and sets';
|
|
26
37
|
static enableJsonFlag = true;
|
|
38
|
+
static flags = {
|
|
39
|
+
'no-warmup': Flags.boolean({ description: 'Hide warmup sets from output' }),
|
|
40
|
+
};
|
|
27
41
|
async run() {
|
|
28
|
-
const { args } = await this.parse(WorkoutsShow);
|
|
42
|
+
const { args, flags } = await this.parse(WorkoutsShow);
|
|
29
43
|
const context = openDb();
|
|
30
44
|
try {
|
|
31
45
|
if (args.workoutId !== undefined && !/^\d+$/.test(args.workoutId)) {
|
|
@@ -38,7 +52,7 @@ export default class WorkoutsShow extends Command {
|
|
|
38
52
|
throw new Error('No workouts found.');
|
|
39
53
|
return rows[0].id;
|
|
40
54
|
});
|
|
41
|
-
const detail = await getWorkoutDetail(context.db, workoutId);
|
|
55
|
+
const detail = maybeExcludeWarmupSets(await getWorkoutDetail(context.db, workoutId), flags['no-warmup']);
|
|
42
56
|
const unitPreference = await resolveGlobalWeightUnit(context.db);
|
|
43
57
|
const unitLabel = weightUnitLabel(unitPreference);
|
|
44
58
|
if (this.jsonEnabled()) {
|
package/oclif.manifest.json
CHANGED
|
@@ -139,6 +139,12 @@
|
|
|
139
139
|
"multiple": false,
|
|
140
140
|
"type": "option"
|
|
141
141
|
},
|
|
142
|
+
"no-warmup": {
|
|
143
|
+
"description": "Hide warmup sets from output",
|
|
144
|
+
"name": "no-warmup",
|
|
145
|
+
"allowNo": false,
|
|
146
|
+
"type": "boolean"
|
|
147
|
+
},
|
|
142
148
|
"program": {
|
|
143
149
|
"description": "History filter by program id or name",
|
|
144
150
|
"name": "program",
|
|
@@ -558,6 +564,12 @@
|
|
|
558
564
|
"name": "json",
|
|
559
565
|
"allowNo": false,
|
|
560
566
|
"type": "boolean"
|
|
567
|
+
},
|
|
568
|
+
"no-warmup": {
|
|
569
|
+
"description": "Hide warmup sets from output",
|
|
570
|
+
"name": "no-warmup",
|
|
571
|
+
"allowNo": false,
|
|
572
|
+
"type": "boolean"
|
|
561
573
|
}
|
|
562
574
|
},
|
|
563
575
|
"hasDynamicHelp": false,
|
|
@@ -577,5 +589,5 @@
|
|
|
577
589
|
]
|
|
578
590
|
}
|
|
579
591
|
},
|
|
580
|
-
"version": "4.
|
|
592
|
+
"version": "4.1.0"
|
|
581
593
|
}
|