@enspirit/emb 0.0.7 → 0.0.8

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.0.7 darwin-x64 node-v22.12.0
17
+ @enspirit/emb/0.0.8 darwin-x64 node-v22.12.0
18
18
  $ emb --help [COMMAND]
19
19
  USAGE
20
20
  $ emb COMMAND
@@ -354,12 +354,13 @@ Run tasks.
354
354
 
355
355
  ```
356
356
  USAGE
357
- $ emb tasks run TASK... [--json] [-x container|local]
357
+ $ emb tasks run TASK... [--json] [-x container|local] [-a]
358
358
 
359
359
  ARGUMENTS
360
360
  TASK... List of tasks to run. You can provide either ids or names (eg: component:task or task)
361
361
 
362
362
  FLAGS
363
+ -a, --all-matching Run all tasks matching (when multiple matches)
363
364
  -x, --executor=<option> Where to run the task. (experimental!)
364
365
  <options: container|local>
365
366
 
@@ -25,6 +25,7 @@ export default class BuildCommand extends FlavoredCommand {
25
25
  const { monorepo } = getContext();
26
26
  return monorepo.run(new BuildComponentsOperation(), {
27
27
  dryRun: flags['dry-run'],
28
+ silent: flags.json,
28
29
  components: argv.length > 0
29
30
  ? argv
30
31
  : monorepo.components.map((c) => c.name),
@@ -8,6 +8,7 @@ export default class RunTask extends Command {
8
8
  static examples: string[];
9
9
  static flags: {
10
10
  executor: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ 'all-matching': import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
12
  };
12
13
  static strict: boolean;
13
14
  run(): Promise<void>;
@@ -1,4 +1,4 @@
1
- import { getContext } from '../../../index.js';
1
+ import { AmbiguousTaskError, getContext } from '../../../index.js';
2
2
  import { Args, Command, Flags } from '@oclif/core';
3
3
  import { ExecutorType, RunTasksOperation } from '../../../monorepo/index.js';
4
4
  export default class RunTask extends Command {
@@ -18,14 +18,32 @@ export default class RunTask extends Command {
18
18
  description: 'Where to run the task. (experimental!)',
19
19
  options: Object.values(ExecutorType),
20
20
  }),
21
+ 'all-matching': Flags.boolean({
22
+ name: 'all-matching',
23
+ char: 'a',
24
+ description: 'Run all tasks matching (when multiple matches)',
25
+ default: false,
26
+ }),
21
27
  };
22
28
  static strict = false;
23
29
  async run() {
24
30
  const { argv, flags } = await this.parse(RunTask);
25
31
  const { monorepo } = await getContext();
26
- await monorepo.run(new RunTasksOperation(), {
27
- tasks: argv,
28
- executor: flags.executor,
29
- });
32
+ try {
33
+ await monorepo.run(new RunTasksOperation(), {
34
+ tasks: argv,
35
+ executor: flags.executor,
36
+ allMatching: flags['all-matching'],
37
+ });
38
+ }
39
+ catch (error) {
40
+ if (error instanceof AmbiguousTaskError) {
41
+ throw error.toCliError([
42
+ `Specify just one. Eg: \`emb tasks run ${error.options[0]}\``,
43
+ 'Run the same command with --all-matches / -a',
44
+ 'Review the list of tasks by running `emb tasks`',
45
+ ]);
46
+ }
47
+ }
30
48
  }
31
49
  }
@@ -0,0 +1,57 @@
1
+ export declare class EMBError extends Error {
2
+ code: string;
3
+ message: string;
4
+ constructor(code: string, message: string);
5
+ toCliError(suggestions: string[], ref?: string): CliError;
6
+ }
7
+ export declare class CliError extends EMBError {
8
+ /**
9
+ * a unique error code for this error class
10
+ */
11
+ code: string;
12
+ /**
13
+ * message to display related to the error
14
+ */
15
+ message: string;
16
+ /**
17
+ * a suggestion that may be useful or provide additional context
18
+ */
19
+ suggestions?: string[] | undefined;
20
+ /**
21
+ * a url to find out more information related to this error
22
+ * or fixing the error
23
+ */
24
+ ref?: string | undefined;
25
+ constructor(
26
+ /**
27
+ * a unique error code for this error class
28
+ */
29
+ code: string,
30
+ /**
31
+ * message to display related to the error
32
+ */
33
+ message: string,
34
+ /**
35
+ * a suggestion that may be useful or provide additional context
36
+ */
37
+ suggestions?: string[] | undefined,
38
+ /**
39
+ * a url to find out more information related to this error
40
+ * or fixing the error
41
+ */
42
+ ref?: string | undefined);
43
+ }
44
+ export declare class AmbiguousTaskError extends EMBError {
45
+ options: string[];
46
+ constructor(msg: string, options: string[]);
47
+ }
48
+ export declare class UnkownReferenceError extends EMBError {
49
+ constructor(msg: string);
50
+ }
51
+ export declare class TaskNameCollisionError extends EMBError {
52
+ collisions: Array<string>;
53
+ constructor(msg: string, collisions: Array<string>);
54
+ }
55
+ export declare class CircularDependencyError extends EMBError {
56
+ constructor(msg: string);
57
+ }
@@ -0,0 +1,66 @@
1
+ export class EMBError extends Error {
2
+ code;
3
+ message;
4
+ constructor(code, message) {
5
+ super(message);
6
+ this.code = code;
7
+ this.message = message;
8
+ }
9
+ toCliError(suggestions, ref) {
10
+ return new CliError(this.code, this.message, suggestions, ref);
11
+ }
12
+ }
13
+ export class CliError extends EMBError {
14
+ code;
15
+ message;
16
+ suggestions;
17
+ ref;
18
+ constructor(
19
+ /**
20
+ * a unique error code for this error class
21
+ */
22
+ code,
23
+ /**
24
+ * message to display related to the error
25
+ */
26
+ message,
27
+ /**
28
+ * a suggestion that may be useful or provide additional context
29
+ */
30
+ suggestions,
31
+ /**
32
+ * a url to find out more information related to this error
33
+ * or fixing the error
34
+ */
35
+ ref) {
36
+ super(code, message);
37
+ this.code = code;
38
+ this.message = message;
39
+ this.suggestions = suggestions;
40
+ this.ref = ref;
41
+ }
42
+ }
43
+ export class AmbiguousTaskError extends EMBError {
44
+ options;
45
+ constructor(msg, options) {
46
+ super('AMBIG_TASK', msg);
47
+ this.options = options;
48
+ }
49
+ }
50
+ export class UnkownReferenceError extends EMBError {
51
+ constructor(msg) {
52
+ super('UNKNOWN_REF', msg);
53
+ }
54
+ }
55
+ export class TaskNameCollisionError extends EMBError {
56
+ collisions;
57
+ constructor(msg, collisions) {
58
+ super('UNKNOWN_REF', msg);
59
+ this.collisions = collisions;
60
+ }
61
+ }
62
+ export class CircularDependencyError extends EMBError {
63
+ constructor(msg) {
64
+ super('CIRCULAR_DEPS', msg);
65
+ }
66
+ }
@@ -1,3 +1,4 @@
1
1
  export * from './context.js';
2
+ export * from './errors.js';
2
3
  export * from './types.js';
3
4
  export { run } from '@oclif/core';
package/dist/src/index.js CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from './context.js';
2
+ export * from './errors.js';
2
3
  export * from './types.js';
3
4
  export { run } from '@oclif/core';
@@ -24,6 +24,7 @@ export declare class Monorepo {
24
24
  expand(str: string, expander?: TemplateExpander): Promise<string>;
25
25
  expand<R extends Record<string, unknown>>(record: R, expander?: TemplateExpander): Promise<R>;
26
26
  private installStore;
27
+ private installEnv;
27
28
  init(): Promise<Monorepo>;
28
29
  join(...paths: string[]): string;
29
30
  run<I, O>(operation: IOperation<I, O>, args: I): Promise<O>;
@@ -84,6 +84,19 @@ export class Monorepo {
84
84
  this._store = store || new EMBStore(this);
85
85
  await this._store.init();
86
86
  }
87
+ async installEnv() {
88
+ // Expand env vars at the init and then we don't expand anymore
89
+ // The only available source for them is the existing env
90
+ const expander = new TemplateExpander();
91
+ const options = {
92
+ default: 'env',
93
+ sources: {
94
+ env: process.env,
95
+ },
96
+ };
97
+ const expanded = await expander.expandRecord(this._config.env, options);
98
+ Object.assign(process.env, expanded);
99
+ }
87
100
  // Initialize
88
101
  async init() {
89
102
  if (this.initialized) {
@@ -98,17 +111,7 @@ export class Monorepo {
98
111
  const newConfig = await plugin.extendConfig?.(await pConfig);
99
112
  return newConfig ?? pConfig;
100
113
  }, Promise.resolve(this._config));
101
- // Expand env vars at the init and then we don't expand anymore
102
- // The only available source for them is the existing env
103
- const expander = new TemplateExpander();
104
- const options = {
105
- default: 'env',
106
- sources: {
107
- env: process.env,
108
- },
109
- };
110
- const expanded = await expander.expandRecord(this._config.env, options);
111
- Object.assign(process.env, expanded);
114
+ await this.installEnv();
112
115
  this.initialized = true;
113
116
  await Promise.all(plugins.map(async (p) => {
114
117
  await p.init?.();
@@ -125,6 +128,7 @@ export class Monorepo {
125
128
  async withFlavor(name) {
126
129
  const repo = new Monorepo(this._config.withFlavor(name));
127
130
  await repo.installStore();
131
+ await repo.installEnv();
128
132
  return repo;
129
133
  }
130
134
  }
@@ -11,6 +11,7 @@ export type BuildComponentMeta = {
11
11
  declare const schema: z.ZodObject<{
12
12
  components: z.ZodOptional<z.ZodArray<z.ZodString>>;
13
13
  dryRun: z.ZodOptional<z.ZodBoolean>;
14
+ silent: z.ZodOptional<z.ZodBoolean>;
14
15
  }, z.core.$strip>;
15
16
  export declare class BuildComponentsOperation extends AbstractOperation<typeof schema, Record<string, BuildComponentMeta>> {
16
17
  constructor();
@@ -13,6 +13,10 @@ const schema = z.object({
13
13
  .boolean()
14
14
  .optional()
15
15
  .describe('Do not build but return the config that would be used to build the images'),
16
+ silent: z
17
+ .boolean()
18
+ .optional()
19
+ .describe('Do not produce any output on the terminal'),
16
20
  });
17
21
  export class BuildComponentsOperation extends AbstractOperation {
18
22
  constructor() {
@@ -37,6 +41,7 @@ export class BuildComponentsOperation extends AbstractOperation {
37
41
  };
38
42
  }));
39
43
  const list = manager.newListr([...tasks], {
44
+ renderer: input.silent ? 'silent' : 'default',
40
45
  rendererOptions: { persistentOutput: true },
41
46
  ctx: {},
42
47
  });
@@ -72,7 +77,7 @@ export class BuildComponentsOperation extends AbstractOperation {
72
77
  const diff = await prereqPlugin.diff(cmp, ctx.build.prerequisites, lastValue, ctx.preBuildMeta);
73
78
  if (!diff) {
74
79
  ctx.cacheHit = true;
75
- // parentTask.skip(`${parentTask.title} (cache hit)`);
80
+ parentTask.skip(`${parentTask.title} (cache hit)`);
76
81
  }
77
82
  }
78
83
  },
@@ -118,7 +123,7 @@ export class BuildComponentsOperation extends AbstractOperation {
118
123
  async task(ctx) {
119
124
  parentContext[cmp.name] = ctx;
120
125
  if (ctx.dryRun) {
121
- // parentTask.skip(`${parentTask.title} (dry run)`);
126
+ parentTask.skip(`${parentTask.title} (dry run)`);
122
127
  }
123
128
  },
124
129
  },
@@ -8,13 +8,12 @@ export declare enum ExecutorType {
8
8
  export type RunTasksOperationParams = {
9
9
  tasks: Array<string>;
10
10
  executor?: ExecutorType | undefined;
11
+ allMatching?: boolean;
11
12
  };
12
13
  export type TaskWithScript = TaskInfo & {
13
14
  script: string;
14
15
  };
15
16
  export declare class RunTasksOperation implements IOperation<RunTasksOperationParams, Array<TaskInfo>> {
16
- protected out?: Writable | undefined;
17
- constructor(out?: Writable | undefined);
18
17
  run(params: RunTasksOperationParams): Promise<Array<TaskInfo>>;
19
18
  protected runDocker(task: TaskWithScript, out?: Writable): Promise<void>;
20
19
  protected runLocal(task: TaskWithScript): Promise<import("stream").Readable>;
@@ -9,10 +9,6 @@ export var ExecutorType;
9
9
  ExecutorType["local"] = "local";
10
10
  })(ExecutorType || (ExecutorType = {}));
11
11
  export class RunTasksOperation {
12
- out;
13
- constructor(out) {
14
- this.out = out;
15
- }
16
12
  async run(params) {
17
13
  const { monorepo } = getContext();
18
14
  // First ensure the selection is valid (user can use task IDs or names)
@@ -20,7 +16,9 @@ export class RunTasksOperation {
20
16
  idField: 'id',
21
17
  depField: 'pre',
22
18
  });
23
- const ordered = findRunOrder(params.tasks, collection);
19
+ const ordered = findRunOrder(params.tasks, collection, {
20
+ onAmbiguous: params.allMatching ? 'runAll' : 'error',
21
+ });
24
22
  const runner = new Manager({
25
23
  concurrent: false,
26
24
  exitOnError: false,
@@ -1,4 +1,5 @@
1
1
  import graphlib from 'graphlib';
2
+ import { AmbiguousTaskError, CircularDependencyError, TaskNameCollisionError, UnkownReferenceError, } from '../../errors.js';
2
3
  export class EMBCollection {
3
4
  items;
4
5
  idField;
@@ -63,8 +64,7 @@ export class EMBCollection {
63
64
  parts.push(`id↔name collisions (${collisions.length}):\n` +
64
65
  collisions.join('\n'));
65
66
  }
66
- // eslint-disable-next-line unicorn/error-message
67
- throw new Error(parts.join('\n\n'));
67
+ throw new TaskNameCollisionError('Collision between task names and ids', parts);
68
68
  }
69
69
  }
70
70
  /** All items (stable array iteration) */
@@ -83,13 +83,13 @@ export class EMBCollection {
83
83
  return opts?.multiple ? [idHit] : idHit;
84
84
  const nameHits = this.byName.get(ref) ?? [];
85
85
  if (nameHits.length === 0) {
86
- throw new Error(`Unknown reference "${ref}"`);
86
+ throw new UnkownReferenceError(`Unknown reference "${ref}"`);
87
87
  }
88
88
  if (opts?.multiple)
89
89
  return nameHits;
90
90
  if (nameHits.length > 1) {
91
- const ids = nameHits.map((t) => this.idOf(t)).join(', ');
92
- throw new Error(`Ambiguous reference "${ref}" matches multiple ids: [${ids}]`);
91
+ const ids = nameHits.map((t) => this.idOf(t));
92
+ throw new AmbiguousTaskError(`Ambiguous reference "${ref}" matches multiple id/name`, ids);
93
93
  }
94
94
  return nameHits[0];
95
95
  }
@@ -136,7 +136,7 @@ export function findRunOrder(selection, collection, { onAmbiguous = 'error' } =
136
136
  const g = buildGraph(collection, onAmbiguous);
137
137
  const cycles = graphlib.alg.findCycles(g);
138
138
  if (cycles.length > 0) {
139
- throw new Error(`Circular dependencies detected: ${JSON.stringify(cycles)}`);
139
+ throw new CircularDependencyError(`Circular dependencies detected: ${JSON.stringify(cycles)}`);
140
140
  }
141
141
  const selectedIds = new Set();
142
142
  for (const ref of selection)
@@ -226,12 +226,10 @@
226
226
  "index.js"
227
227
  ]
228
228
  },
229
- "containers": {
230
- "aliases": [
231
- "ps"
232
- ],
229
+ "config:print": {
230
+ "aliases": [],
233
231
  "args": {},
234
- "description": "List docker containers.",
232
+ "description": "Print the current config.",
235
233
  "examples": [
236
234
  "<%= config.bin %> <%= command.id %>"
237
235
  ],
@@ -243,18 +241,18 @@
243
241
  "allowNo": false,
244
242
  "type": "boolean"
245
243
  },
246
- "all": {
247
- "char": "a",
248
- "description": "Retun all containers. By default, only running containers are shown",
249
- "name": "all",
244
+ "flavor": {
245
+ "description": "Specify the flavor to use.",
246
+ "name": "flavor",
250
247
  "required": false,
251
- "allowNo": false,
252
- "type": "boolean"
248
+ "hasDynamicHelp": false,
249
+ "multiple": false,
250
+ "type": "option"
253
251
  }
254
252
  },
255
253
  "hasDynamicHelp": false,
256
254
  "hiddenAliases": [],
257
- "id": "containers",
255
+ "id": "config:print",
258
256
  "pluginAlias": "@enspirit/emb",
259
257
  "pluginName": "@enspirit/emb",
260
258
  "pluginType": "core",
@@ -266,14 +264,16 @@
266
264
  "src",
267
265
  "cli",
268
266
  "commands",
269
- "containers",
270
- "index.js"
267
+ "config",
268
+ "print.js"
271
269
  ]
272
270
  },
273
- "containers:prune": {
274
- "aliases": [],
271
+ "containers": {
272
+ "aliases": [
273
+ "ps"
274
+ ],
275
275
  "args": {},
276
- "description": "Prune containers.",
276
+ "description": "List docker containers.",
277
277
  "examples": [
278
278
  "<%= config.bin %> <%= command.id %>"
279
279
  ],
@@ -284,11 +284,19 @@
284
284
  "name": "json",
285
285
  "allowNo": false,
286
286
  "type": "boolean"
287
+ },
288
+ "all": {
289
+ "char": "a",
290
+ "description": "Retun all containers. By default, only running containers are shown",
291
+ "name": "all",
292
+ "required": false,
293
+ "allowNo": false,
294
+ "type": "boolean"
287
295
  }
288
296
  },
289
297
  "hasDynamicHelp": false,
290
298
  "hiddenAliases": [],
291
- "id": "containers:prune",
299
+ "id": "containers",
292
300
  "pluginAlias": "@enspirit/emb",
293
301
  "pluginName": "@enspirit/emb",
294
302
  "pluginType": "core",
@@ -301,13 +309,13 @@
301
309
  "cli",
302
310
  "commands",
303
311
  "containers",
304
- "prune.js"
312
+ "index.js"
305
313
  ]
306
314
  },
307
- "config:print": {
315
+ "containers:prune": {
308
316
  "aliases": [],
309
317
  "args": {},
310
- "description": "Print the current config.",
318
+ "description": "Prune containers.",
311
319
  "examples": [
312
320
  "<%= config.bin %> <%= command.id %>"
313
321
  ],
@@ -318,19 +326,11 @@
318
326
  "name": "json",
319
327
  "allowNo": false,
320
328
  "type": "boolean"
321
- },
322
- "flavor": {
323
- "description": "Specify the flavor to use.",
324
- "name": "flavor",
325
- "required": false,
326
- "hasDynamicHelp": false,
327
- "multiple": false,
328
- "type": "option"
329
329
  }
330
330
  },
331
331
  "hasDynamicHelp": false,
332
332
  "hiddenAliases": [],
333
- "id": "config:print",
333
+ "id": "containers:prune",
334
334
  "pluginAlias": "@enspirit/emb",
335
335
  "pluginName": "@enspirit/emb",
336
336
  "pluginType": "core",
@@ -342,14 +342,14 @@
342
342
  "src",
343
343
  "cli",
344
344
  "commands",
345
- "config",
346
- "print.js"
345
+ "containers",
346
+ "prune.js"
347
347
  ]
348
348
  },
349
- "images:delete": {
349
+ "tasks": {
350
350
  "aliases": [],
351
351
  "args": {},
352
- "description": "Delete project images.",
352
+ "description": "List tasks.",
353
353
  "examples": [
354
354
  "<%= config.bin %> <%= command.id %>"
355
355
  ],
@@ -360,19 +360,11 @@
360
360
  "name": "json",
361
361
  "allowNo": false,
362
362
  "type": "boolean"
363
- },
364
- "force": {
365
- "char": "f",
366
- "description": "Remove the image even if it is being used by stopped containers or has other tags",
367
- "name": "force",
368
- "required": false,
369
- "allowNo": false,
370
- "type": "boolean"
371
363
  }
372
364
  },
373
365
  "hasDynamicHelp": false,
374
366
  "hiddenAliases": [],
375
- "id": "images:delete",
367
+ "id": "tasks",
376
368
  "pluginAlias": "@enspirit/emb",
377
369
  "pluginName": "@enspirit/emb",
378
370
  "pluginType": "core",
@@ -384,14 +376,20 @@
384
376
  "src",
385
377
  "cli",
386
378
  "commands",
387
- "images",
388
- "delete.js"
379
+ "tasks",
380
+ "index.js"
389
381
  ]
390
382
  },
391
- "images": {
383
+ "tasks:run": {
392
384
  "aliases": [],
393
- "args": {},
394
- "description": "List docker images.",
385
+ "args": {
386
+ "task": {
387
+ "description": "List of tasks to run. You can provide either ids or names (eg: component:task or task)",
388
+ "name": "task",
389
+ "required": true
390
+ }
391
+ },
392
+ "description": "Run tasks.",
395
393
  "examples": [
396
394
  "<%= config.bin %> <%= command.id %>"
397
395
  ],
@@ -403,22 +401,33 @@
403
401
  "allowNo": false,
404
402
  "type": "boolean"
405
403
  },
406
- "all": {
404
+ "executor": {
405
+ "char": "x",
406
+ "description": "Where to run the task. (experimental!)",
407
+ "name": "executor",
408
+ "hasDynamicHelp": false,
409
+ "multiple": false,
410
+ "options": [
411
+ "container",
412
+ "local"
413
+ ],
414
+ "type": "option"
415
+ },
416
+ "all-matching": {
407
417
  "char": "a",
408
- "description": "Show all images. Only images from a final layer (no children) are shown by default.",
409
- "name": "all",
410
- "required": false,
418
+ "description": "Run all tasks matching (when multiple matches)",
419
+ "name": "all-matching",
411
420
  "allowNo": false,
412
421
  "type": "boolean"
413
422
  }
414
423
  },
415
424
  "hasDynamicHelp": false,
416
425
  "hiddenAliases": [],
417
- "id": "images",
426
+ "id": "tasks:run",
418
427
  "pluginAlias": "@enspirit/emb",
419
428
  "pluginName": "@enspirit/emb",
420
429
  "pluginType": "core",
421
- "strict": true,
430
+ "strict": false,
422
431
  "enableJsonFlag": true,
423
432
  "isESM": true,
424
433
  "relativePath": [
@@ -426,14 +435,14 @@
426
435
  "src",
427
436
  "cli",
428
437
  "commands",
429
- "images",
430
- "index.js"
438
+ "tasks",
439
+ "run.js"
431
440
  ]
432
441
  },
433
- "images:prune": {
442
+ "images:delete": {
434
443
  "aliases": [],
435
444
  "args": {},
436
- "description": "Prune project images.",
445
+ "description": "Delete project images.",
437
446
  "examples": [
438
447
  "<%= config.bin %> <%= command.id %>"
439
448
  ],
@@ -445,10 +454,10 @@
445
454
  "allowNo": false,
446
455
  "type": "boolean"
447
456
  },
448
- "all": {
449
- "char": "a",
450
- "description": "Prune all images. When set to true all images will be pruned, not only dangling ones",
451
- "name": "all",
457
+ "force": {
458
+ "char": "f",
459
+ "description": "Remove the image even if it is being used by stopped containers or has other tags",
460
+ "name": "force",
452
461
  "required": false,
453
462
  "allowNo": false,
454
463
  "type": "boolean"
@@ -456,7 +465,7 @@
456
465
  },
457
466
  "hasDynamicHelp": false,
458
467
  "hiddenAliases": [],
459
- "id": "images:prune",
468
+ "id": "images:delete",
460
469
  "pluginAlias": "@enspirit/emb",
461
470
  "pluginName": "@enspirit/emb",
462
471
  "pluginType": "core",
@@ -469,13 +478,13 @@
469
478
  "cli",
470
479
  "commands",
471
480
  "images",
472
- "prune.js"
481
+ "delete.js"
473
482
  ]
474
483
  },
475
- "tasks": {
484
+ "images": {
476
485
  "aliases": [],
477
486
  "args": {},
478
- "description": "List tasks.",
487
+ "description": "List docker images.",
479
488
  "examples": [
480
489
  "<%= config.bin %> <%= command.id %>"
481
490
  ],
@@ -486,11 +495,19 @@
486
495
  "name": "json",
487
496
  "allowNo": false,
488
497
  "type": "boolean"
498
+ },
499
+ "all": {
500
+ "char": "a",
501
+ "description": "Show all images. Only images from a final layer (no children) are shown by default.",
502
+ "name": "all",
503
+ "required": false,
504
+ "allowNo": false,
505
+ "type": "boolean"
489
506
  }
490
507
  },
491
508
  "hasDynamicHelp": false,
492
509
  "hiddenAliases": [],
493
- "id": "tasks",
510
+ "id": "images",
494
511
  "pluginAlias": "@enspirit/emb",
495
512
  "pluginName": "@enspirit/emb",
496
513
  "pluginType": "core",
@@ -502,20 +519,14 @@
502
519
  "src",
503
520
  "cli",
504
521
  "commands",
505
- "tasks",
522
+ "images",
506
523
  "index.js"
507
524
  ]
508
525
  },
509
- "tasks:run": {
526
+ "images:prune": {
510
527
  "aliases": [],
511
- "args": {
512
- "task": {
513
- "description": "List of tasks to run. You can provide either ids or names (eg: component:task or task)",
514
- "name": "task",
515
- "required": true
516
- }
517
- },
518
- "description": "Run tasks.",
528
+ "args": {},
529
+ "description": "Prune project images.",
519
530
  "examples": [
520
531
  "<%= config.bin %> <%= command.id %>"
521
532
  ],
@@ -527,26 +538,22 @@
527
538
  "allowNo": false,
528
539
  "type": "boolean"
529
540
  },
530
- "executor": {
531
- "char": "x",
532
- "description": "Where to run the task. (experimental!)",
533
- "name": "executor",
534
- "hasDynamicHelp": false,
535
- "multiple": false,
536
- "options": [
537
- "container",
538
- "local"
539
- ],
540
- "type": "option"
541
+ "all": {
542
+ "char": "a",
543
+ "description": "Prune all images. When set to true all images will be pruned, not only dangling ones",
544
+ "name": "all",
545
+ "required": false,
546
+ "allowNo": false,
547
+ "type": "boolean"
541
548
  }
542
549
  },
543
550
  "hasDynamicHelp": false,
544
551
  "hiddenAliases": [],
545
- "id": "tasks:run",
552
+ "id": "images:prune",
546
553
  "pluginAlias": "@enspirit/emb",
547
554
  "pluginName": "@enspirit/emb",
548
555
  "pluginType": "core",
549
- "strict": false,
556
+ "strict": true,
550
557
  "enableJsonFlag": true,
551
558
  "isESM": true,
552
559
  "relativePath": [
@@ -554,10 +561,10 @@
554
561
  "src",
555
562
  "cli",
556
563
  "commands",
557
- "tasks",
558
- "run.js"
564
+ "images",
565
+ "prune.js"
559
566
  ]
560
567
  }
561
568
  },
562
- "version": "0.0.7"
569
+ "version": "0.0.8"
563
570
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@enspirit/emb",
3
3
  "type": "module",
4
- "version": "0.0.7",
4
+ "version": "0.0.8",
5
5
  "keywords": ["monorepo", "docker", "taskrunner", "ci", "docker compose", "sentinel", "makefile"],
6
6
  "author": "Louis Lambeau <louis.lambeau@enspirit.be>",
7
7
  "license": "ISC",
@@ -109,6 +109,11 @@
109
109
  ],
110
110
  "topicSeparator": " ",
111
111
  "topics": {
112
+ "images": {"description": "List, delete, prune docker containers" },
113
+ "containers": {"description": "List, delete, prune docker images" },
114
+ "components": {"description": "List & build components resources" },
115
+ "config": {"description": "It's all about config" },
116
+ "tasks": {"description": "List and run tasks" }
112
117
  }
113
118
  }
114
119
  }