@enspirit/emb 0.9.0 → 0.10.1

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
@@ -14,7 +14,7 @@ $ npm install -g @enspirit/emb
14
14
  $ emb COMMAND
15
15
  running command...
16
16
  $ emb (--version)
17
- @enspirit/emb/0.9.0 darwin-x64 node-v22.18.0
17
+ @enspirit/emb/0.10.1 darwin-arm64 node-v22.14.0
18
18
  $ emb --help [COMMAND]
19
19
  USAGE
20
20
  $ emb COMMAND
@@ -88,10 +88,11 @@ Clean the project.
88
88
 
89
89
  ```
90
90
  USAGE
91
- $ emb clean [--json] [-f]
91
+ $ emb clean [--json] [--verbose] [-f]
92
92
 
93
93
  FLAGS
94
- -f, --force Force the deletion of containers & images
94
+ -f, --force Force the deletion of containers & images
95
+ --[no-]verbose
95
96
 
96
97
  GLOBAL FLAGS
97
98
  --json Format output as json.
@@ -109,10 +110,11 @@ List components.
109
110
 
110
111
  ```
111
112
  USAGE
112
- $ emb components [--json] [--flavor <value>]
113
+ $ emb components [--json] [--verbose] [--flavor <value>]
113
114
 
114
115
  FLAGS
115
116
  --flavor=<value> Specify the flavor to use.
117
+ --[no-]verbose
116
118
 
117
119
  GLOBAL FLAGS
118
120
  --json Format output as json.
@@ -130,13 +132,14 @@ Get components logs.
130
132
 
131
133
  ```
132
134
  USAGE
133
- $ emb components logs COMPONENT [-f]
135
+ $ emb components logs COMPONENT [--verbose] [-f]
134
136
 
135
137
  ARGUMENTS
136
138
  COMPONENT The component you want to see the logs of
137
139
 
138
140
  FLAGS
139
- -f, --[no-]follow Follow log output
141
+ -f, --[no-]follow Follow log output
142
+ --[no-]verbose
140
143
 
141
144
  DESCRIPTION
142
145
  Get components logs.
@@ -154,13 +157,14 @@ Get a shell on a running component.
154
157
 
155
158
  ```
156
159
  USAGE
157
- $ emb components shell COMPONENT [-s <value>]
160
+ $ emb components shell COMPONENT [--verbose] [-s <value>]
158
161
 
159
162
  ARGUMENTS
160
163
  COMPONENT The component you want to get a shell on
161
164
 
162
165
  FLAGS
163
166
  -s, --shell=<value> [default: bash] The shell to run
167
+ --[no-]verbose
164
168
 
165
169
  DESCRIPTION
166
170
  Get a shell on a running component.
@@ -178,10 +182,11 @@ Print the current config.
178
182
 
179
183
  ```
180
184
  USAGE
181
- $ emb config print [--json] [--flavor <value>]
185
+ $ emb config print [--json] [--verbose] [--flavor <value>]
182
186
 
183
187
  FLAGS
184
188
  --flavor=<value> Specify the flavor to use.
189
+ --[no-]verbose
185
190
 
186
191
  GLOBAL FLAGS
187
192
  --json Format output as json.
@@ -199,10 +204,11 @@ List docker containers.
199
204
 
200
205
  ```
201
206
  USAGE
202
- $ emb containers [--json] [-a]
207
+ $ emb containers [--json] [--verbose] [-a]
203
208
 
204
209
  FLAGS
205
- -a, --all Retun all containers. By default, only running containers are shown
210
+ -a, --all Retun all containers. By default, only running containers are shown
211
+ --[no-]verbose
206
212
 
207
213
  GLOBAL FLAGS
208
214
  --json Format output as json.
@@ -223,7 +229,10 @@ Prune containers.
223
229
 
224
230
  ```
225
231
  USAGE
226
- $ emb containers prune [--json]
232
+ $ emb containers prune [--json] [--verbose]
233
+
234
+ FLAGS
235
+ --[no-]verbose
227
236
 
228
237
  GLOBAL FLAGS
229
238
  --json Format output as json.
@@ -241,10 +250,11 @@ Stop the whole project.
241
250
 
242
251
  ```
243
252
  USAGE
244
- $ emb down [--json] [--flavor <value>]
253
+ $ emb down [--json] [--verbose] [--flavor <value>]
245
254
 
246
255
  FLAGS
247
256
  --flavor=<value> Specify the flavor to use.
257
+ --[no-]verbose
248
258
 
249
259
  GLOBAL FLAGS
250
260
  --json Format output as json.
@@ -282,11 +292,12 @@ List docker images.
282
292
 
283
293
  ```
284
294
  USAGE
285
- $ emb images [--json] [--flavor <value>] [-a]
295
+ $ emb images [--json] [--verbose] [--flavor <value>] [-a]
286
296
 
287
297
  FLAGS
288
298
  -a, --all Show all images. Only images from a final layer (no children) are shown by default.
289
299
  --flavor=<value> Specify the flavor to use.
300
+ --[no-]verbose
290
301
 
291
302
  GLOBAL FLAGS
292
303
  --json Format output as json.
@@ -304,10 +315,11 @@ Delete project images.
304
315
 
305
316
  ```
306
317
  USAGE
307
- $ emb images delete [--json] [-f]
318
+ $ emb images delete [--json] [--verbose] [-f]
308
319
 
309
320
  FLAGS
310
- -f, --force Remove the image even if it is being used by stopped containers or has other tags
321
+ -f, --force Remove the image even if it is being used by stopped containers or has other tags
322
+ --[no-]verbose
311
323
 
312
324
  GLOBAL FLAGS
313
325
  --json Format output as json.
@@ -325,10 +337,11 @@ Prune project images.
325
337
 
326
338
  ```
327
339
  USAGE
328
- $ emb images prune [--json] [-a]
340
+ $ emb images prune [--json] [--verbose] [-a]
329
341
 
330
342
  FLAGS
331
- -a, --all Prune all images. When set to true all images will be pruned, not only dangling ones
343
+ -a, --all Prune all images. When set to true all images will be pruned, not only dangling ones
344
+ --[no-]verbose
332
345
 
333
346
  GLOBAL FLAGS
334
347
  --json Format output as json.
@@ -346,12 +359,13 @@ Push docker images.
346
359
 
347
360
  ```
348
361
  USAGE
349
- $ emb images push [--json] [--flavor <value>] [--registry <value>] [--retag <value>]
362
+ $ emb images push [--json] [--verbose] [--flavor <value>] [--registry <value>] [--retag <value>]
350
363
 
351
364
  FLAGS
352
365
  --flavor=<value> Specify the flavor to use.
353
366
  --registry=<value> Override the registry to push to
354
367
  --retag=<value> Override the original tag to push to a new tag
368
+ --[no-]verbose
355
369
 
356
370
  GLOBAL FLAGS
357
371
  --json Format output as json.
@@ -371,13 +385,14 @@ Get components logs.
371
385
 
372
386
  ```
373
387
  USAGE
374
- $ emb logs COMPONENT [-f]
388
+ $ emb logs COMPONENT [--verbose] [-f]
375
389
 
376
390
  ARGUMENTS
377
391
  COMPONENT The component you want to see the logs of
378
392
 
379
393
  FLAGS
380
- -f, --[no-]follow Follow log output
394
+ -f, --[no-]follow Follow log output
395
+ --[no-]verbose
381
396
 
382
397
  DESCRIPTION
383
398
  Get components logs.
@@ -395,10 +410,11 @@ List docker containers.
395
410
 
396
411
  ```
397
412
  USAGE
398
- $ emb ps [--json] [-a]
413
+ $ emb ps [--json] [--verbose] [-a]
399
414
 
400
415
  FLAGS
401
- -a, --all Retun all containers. By default, only running containers are shown
416
+ -a, --all Retun all containers. By default, only running containers are shown
417
+ --[no-]verbose
402
418
 
403
419
  GLOBAL FLAGS
404
420
  --json Format output as json.
@@ -419,10 +435,11 @@ List resources.
419
435
 
420
436
  ```
421
437
  USAGE
422
- $ emb resources [--json] [--flavor <value>]
438
+ $ emb resources [--json] [--verbose] [--flavor <value>]
423
439
 
424
440
  FLAGS
425
441
  --flavor=<value> Specify the flavor to use.
442
+ --[no-]verbose
426
443
 
427
444
  GLOBAL FLAGS
428
445
  --json Format output as json.
@@ -440,7 +457,7 @@ Build the resources of the monorepo
440
457
 
441
458
  ```
442
459
  USAGE
443
- $ emb resources build [COMPONENT...] [--json] [--flavor <value>] [--dry-run] [-f]
460
+ $ emb resources build [COMPONENT...] [--json] [--verbose] [--flavor <value>] [--dry-run] [-f]
444
461
 
445
462
  ARGUMENTS
446
463
  COMPONENT... List of resources to build (defaults to all)
@@ -449,6 +466,7 @@ FLAGS
449
466
  -f, --force Bypass the cache and force the build
450
467
  --dry-run Do not build the resources but only produce build meta information
451
468
  --flavor=<value> Specify the flavor to use.
469
+ --[no-]verbose
452
470
 
453
471
  GLOBAL FLAGS
454
472
  --json Format output as json.
@@ -466,13 +484,14 @@ Restart the whole project.
466
484
 
467
485
  ```
468
486
  USAGE
469
- $ emb restart [COMPONENT...] [--json] [-f]
487
+ $ emb restart [COMPONENT...] [--json] [--verbose] [-f]
470
488
 
471
489
  ARGUMENTS
472
490
  COMPONENT... The component(s) to restart
473
491
 
474
492
  FLAGS
475
- -f, --no-deps Don't restart depdendent components
493
+ -f, --no-deps Don't restart depdendent components
494
+ --[no-]verbose
476
495
 
477
496
  GLOBAL FLAGS
478
497
  --json Format output as json.
@@ -490,7 +509,7 @@ Run tasks.
490
509
 
491
510
  ```
492
511
  USAGE
493
- $ emb run TASK... [--json] [-x container|local] [-a]
512
+ $ emb run TASK... [--json] [--verbose] [-x container|local] [-a]
494
513
 
495
514
  ARGUMENTS
496
515
  TASK... List of tasks to run. You can provide either ids or names (eg: component:task or task)
@@ -499,6 +518,7 @@ FLAGS
499
518
  -a, --all-matching Run all tasks matching (when multiple matches)
500
519
  -x, --executor=<option> Where to run the task. (experimental!)
501
520
  <options: container|local>
521
+ --[no-]verbose
502
522
 
503
523
  GLOBAL FLAGS
504
524
  --json Format output as json.
@@ -519,13 +539,14 @@ Get a shell on a running component.
519
539
 
520
540
  ```
521
541
  USAGE
522
- $ emb shell COMPONENT [-s <value>]
542
+ $ emb shell COMPONENT [--verbose] [-s <value>]
523
543
 
524
544
  ARGUMENTS
525
545
  COMPONENT The component you want to get a shell on
526
546
 
527
547
  FLAGS
528
548
  -s, --shell=<value> [default: bash] The shell to run
549
+ --[no-]verbose
529
550
 
530
551
  DESCRIPTION
531
552
  Get a shell on a running component.
@@ -543,11 +564,14 @@ Starts the whole project.
543
564
 
544
565
  ```
545
566
  USAGE
546
- $ emb start [COMPONENT...] [--json]
567
+ $ emb start [COMPONENT...] [--json] [--verbose]
547
568
 
548
569
  ARGUMENTS
549
570
  COMPONENT... The component(s) to start
550
571
 
572
+ FLAGS
573
+ --[no-]verbose
574
+
551
575
  GLOBAL FLAGS
552
576
  --json Format output as json.
553
577
 
@@ -564,10 +588,11 @@ Stop the whole project.
564
588
 
565
589
  ```
566
590
  USAGE
567
- $ emb stop [--json] [--flavor <value>]
591
+ $ emb stop [--json] [--verbose] [--flavor <value>]
568
592
 
569
593
  FLAGS
570
594
  --flavor=<value> Specify the flavor to use.
595
+ --[no-]verbose
571
596
 
572
597
  GLOBAL FLAGS
573
598
  --json Format output as json.
@@ -585,7 +610,10 @@ List tasks.
585
610
 
586
611
  ```
587
612
  USAGE
588
- $ emb tasks [--json]
613
+ $ emb tasks [--json] [--verbose]
614
+
615
+ FLAGS
616
+ --[no-]verbose
589
617
 
590
618
  GLOBAL FLAGS
591
619
  --json Format output as json.
@@ -603,7 +631,7 @@ Run tasks.
603
631
 
604
632
  ```
605
633
  USAGE
606
- $ emb tasks run TASK... [--json] [-x container|local] [-a]
634
+ $ emb tasks run TASK... [--json] [--verbose] [-x container|local] [-a]
607
635
 
608
636
  ARGUMENTS
609
637
  TASK... List of tasks to run. You can provide either ids or names (eg: component:task or task)
@@ -612,6 +640,7 @@ FLAGS
612
640
  -a, --all-matching Run all tasks matching (when multiple matches)
613
641
  -x, --executor=<option> Where to run the task. (experimental!)
614
642
  <options: container|local>
643
+ --[no-]verbose
615
644
 
616
645
  GLOBAL FLAGS
617
646
  --json Format output as json.
@@ -632,7 +661,7 @@ Start the whole project.
632
661
 
633
662
  ```
634
663
  USAGE
635
- $ emb up [COMPONENT...] [--json] [--flavor <value>] [-f]
664
+ $ emb up [COMPONENT...] [--json] [--verbose] [--flavor <value>] [-f]
636
665
 
637
666
  ARGUMENTS
638
667
  COMPONENT... The component(s) to build and start
@@ -640,6 +669,7 @@ ARGUMENTS
640
669
  FLAGS
641
670
  -f, --force Bypass caches, force the recreation of containers, etc
642
671
  --flavor=<value> Specify the flavor to use.
672
+ --[no-]verbose
643
673
 
644
674
  GLOBAL FLAGS
645
675
  --json Format output as json.
@@ -2,5 +2,8 @@ import { EmbContext } from '../../index.js';
2
2
  import { Command } from '@oclif/core';
3
3
  export declare abstract class BaseCommand extends Command {
4
4
  protected context: EmbContext;
5
+ static baseFlags: {
6
+ verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
7
+ };
5
8
  init(): Promise<void>;
6
9
  }
@@ -1,12 +1,19 @@
1
1
  import { DockerComposeClient, getContext, setContext } from '../../index.js';
2
- import { Command } from '@oclif/core';
2
+ import { Command, Flags } from '@oclif/core';
3
3
  import Dockerode from 'dockerode';
4
4
  import { loadConfig } from '../../config/index.js';
5
5
  import { Monorepo } from '../../monorepo/monorepo.js';
6
6
  import { withMarker } from '../utils.js';
7
7
  export class BaseCommand extends Command {
8
8
  context;
9
+ static baseFlags = {
10
+ verbose: Flags.boolean({
11
+ name: 'verbose',
12
+ allowNo: true,
13
+ }),
14
+ };
9
15
  async init() {
16
+ const { flags } = await this.parse();
10
17
  await super.init();
11
18
  if (getContext()) {
12
19
  return;
@@ -16,6 +23,9 @@ export class BaseCommand extends Command {
16
23
  const monorepo = await withMarker('emb:monorepo', 'init', () => {
17
24
  return new Monorepo(config, rootDir).init();
18
25
  });
26
+ if (flags.verbose) {
27
+ monorepo.setTaskRenderer('verbose');
28
+ }
19
29
  const compose = new DockerComposeClient(monorepo);
20
30
  this.context = setContext({
21
31
  docker: new Dockerode(),
@@ -5,6 +5,7 @@ export type Args<T extends typeof Command> = Interfaces.InferredArgs<T['args']>;
5
5
  export declare abstract class FlavoredCommand<T extends typeof Command> extends BaseCommand {
6
6
  static baseFlags: {
7
7
  flavor: Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
8
+ verbose: Interfaces.BooleanFlag<boolean>;
8
9
  };
9
10
  static enableJsonFlag: boolean;
10
11
  protected args: Args<T>;
@@ -5,6 +5,7 @@ import { BaseCommand } from './BaseCommand.js';
5
5
  export class FlavoredCommand extends BaseCommand {
6
6
  // define flags that can be inherited by any command that extends FlavoredCommand
7
7
  static baseFlags = {
8
+ ...super.baseFlags,
8
9
  flavor: Flags.string({
9
10
  description: 'Specify the flavor to use.',
10
11
  name: 'flavor',
@@ -42,7 +42,7 @@ export default class RunTask extends BaseCommand {
42
42
  if (error instanceof AmbiguousReferenceError) {
43
43
  throw error.toCliError([
44
44
  `Specify just one. Eg: \`emb tasks run ${error.matches[0]}\``,
45
- 'Run the same command with --all-matches / -a',
45
+ 'Run the same command with --all-matching / -a',
46
46
  'Review the list of tasks by running `emb tasks`',
47
47
  ]);
48
48
  }
@@ -1,6 +1,6 @@
1
1
  import { getContext } from '../../../index.js';
2
2
  import * as z from 'zod';
3
- import { ExecuteLocalCommandOperation, taskManagerFactory } from '../../../monorepo/index.js';
3
+ import { ExecuteLocalCommandOperation } from '../../../monorepo/index.js';
4
4
  import { AbstractOperation } from '../../../operations/index.js';
5
5
  /**
6
6
  * https://docs.docker.com/reference/cli/docker/compose/restart/
@@ -20,7 +20,7 @@ export class ComposeRestartOperation extends AbstractOperation {
20
20
  }
21
21
  async _run(input) {
22
22
  const { monorepo } = getContext();
23
- const manager = taskManagerFactory();
23
+ const manager = monorepo.taskManager();
24
24
  const command = ['docker', 'compose', 'restart'];
25
25
  if (input?.services) {
26
26
  command.push(...input.services);
@@ -1,6 +1,6 @@
1
1
  import { getContext } from '../../../index.js';
2
2
  import * as z from 'zod';
3
- import { ExecuteLocalCommandOperation, taskManagerFactory } from '../../../monorepo/index.js';
3
+ import { ExecuteLocalCommandOperation } from '../../../monorepo/index.js';
4
4
  import { AbstractOperation } from '../../../operations/index.js';
5
5
  /**
6
6
  * https://docs.docker.com/reference/cli/docker/compose/start/
@@ -19,7 +19,7 @@ export class ComposeStartOperation extends AbstractOperation {
19
19
  }
20
20
  async _run(input) {
21
21
  const { monorepo } = getContext();
22
- const manager = taskManagerFactory();
22
+ const manager = monorepo.taskManager();
23
23
  const command = ['docker', 'compose', 'start'];
24
24
  if (input?.services) {
25
25
  command.push(...input.services);
@@ -1,6 +1,6 @@
1
1
  import { getContext } from '../../../index.js';
2
2
  import * as z from 'zod';
3
- import { ExecuteLocalCommandOperation, taskManagerFactory } from '../../../monorepo/index.js';
3
+ import { ExecuteLocalCommandOperation } from '../../../monorepo/index.js';
4
4
  import { AbstractOperation } from '../../../operations/index.js';
5
5
  /**
6
6
  * https://docs.docker.com/reference/cli/docker/compose/up/
@@ -23,7 +23,7 @@ export class ComposeUpOperation extends AbstractOperation {
23
23
  }
24
24
  async _run(input) {
25
25
  const { monorepo } = getContext();
26
- const manager = taskManagerFactory();
26
+ const manager = monorepo.taskManager();
27
27
  const command = ['docker', 'compose', 'up', '-d'];
28
28
  if (input?.components) {
29
29
  command.push(...input.components);
@@ -1,4 +1,3 @@
1
- import { taskManagerFactory } from '../../../index.js';
2
1
  import { join } from 'node:path/posix';
3
2
  import { Transform } from 'node:stream';
4
3
  import * as z from 'zod';
@@ -38,7 +37,7 @@ export class PushImagesOperation extends AbstractOperation {
38
37
  });
39
38
  return builder.getReference();
40
39
  }));
41
- const manager = taskManagerFactory();
40
+ const manager = monorepo.taskManager();
42
41
  const tasks = references.map((fullName) => {
43
42
  return {
44
43
  title: `Push ${fullName}`,