@enspirit/emb 0.5.0 → 0.5.2

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.5.0 darwin-x64 node-v22.18.0
17
+ @enspirit/emb/0.5.2 darwin-x64 node-v22.18.0
18
18
  $ emb --help [COMMAND]
19
19
  USAGE
20
20
  $ emb COMMAND
@@ -41,6 +41,7 @@ USAGE
41
41
  * [`emb resources`](#emb-resources)
42
42
  * [`emb resources build [COMPONENT]`](#emb-resources-build-component)
43
43
  * [`emb shell COMPONENT`](#emb-shell-component)
44
+ * [`emb stop`](#emb-stop)
44
45
  * [`emb tasks`](#emb-tasks)
45
46
  * [`emb tasks run TASK`](#emb-tasks-run-task)
46
47
  * [`emb up [COMPONENT]`](#emb-up-component)
@@ -454,6 +455,27 @@ EXAMPLES
454
455
  $ emb shell
455
456
  ```
456
457
 
458
+ ## `emb stop`
459
+
460
+ Stop the whole project.
461
+
462
+ ```
463
+ USAGE
464
+ $ emb stop [--json] [--flavor <value>]
465
+
466
+ FLAGS
467
+ --flavor=<value> Specify the flavor to use.
468
+
469
+ GLOBAL FLAGS
470
+ --json Format output as json.
471
+
472
+ DESCRIPTION
473
+ Stop the whole project.
474
+
475
+ EXAMPLES
476
+ $ emb stop
477
+ ```
478
+
457
479
  ## `emb tasks`
458
480
 
459
481
  List tasks.
@@ -0,0 +1,8 @@
1
+ import { FlavoredCommand } from '../index.js';
2
+ export default class StopCommand extends FlavoredCommand<typeof StopCommand> {
3
+ static description: string;
4
+ static enableJsonFlag: boolean;
5
+ static examples: string[];
6
+ static flags: {};
7
+ run(): Promise<void>;
8
+ }
@@ -0,0 +1,22 @@
1
+ import { Listr } from 'listr2';
2
+ import { FlavoredCommand, getContext } from '../index.js';
3
+ import { ComposeDownOperation } from '../../docker/index.js';
4
+ export default class StopCommand extends FlavoredCommand {
5
+ static description = 'Stop the whole project.';
6
+ static enableJsonFlag = true;
7
+ static examples = ['<%= config.bin %> <%= command.id %>'];
8
+ static flags = {};
9
+ async run() {
10
+ const { monorepo } = getContext();
11
+ const runner = new Listr([
12
+ {
13
+ rendererOptions: { persistentOutput: true },
14
+ async task(ctx, task) {
15
+ return monorepo.run(new ComposeDownOperation(task.stdout()), {});
16
+ },
17
+ title: 'Stopping project',
18
+ },
19
+ ]);
20
+ await runner.run();
21
+ }
22
+ }
@@ -188,6 +188,17 @@
188
188
  "type": "string",
189
189
  "description": "The stage to target for the build"
190
190
  },
191
+ "labels": {
192
+ "type": "object",
193
+ "additionalProperties": {
194
+ "type": "string"
195
+ },
196
+ "description": "Labels to apply to the resulting image"
197
+ },
198
+ "context": {
199
+ "type": "string",
200
+ "description": "The context folder for the docker build"
201
+ },
191
202
  "dockerfile": {
192
203
  "type": "string",
193
204
  "description": "The Dockerfile to use"
@@ -232,8 +243,7 @@
232
243
  "then": {
233
244
  "properties": {
234
245
  "params": { "$ref": "#/definitions/DockerImageConfig" }
235
- },
236
- "required": ["params"]
246
+ }
237
247
  }
238
248
  },
239
249
  {
@@ -0,0 +1,13 @@
1
+ import { Readable, Writable } from 'node:stream';
2
+ import * as z from 'zod';
3
+ import { AbstractOperation } from '../../../operations/index.js';
4
+ /**
5
+ * https://docs.docker.com/reference/cli/docker/compose/stop/
6
+ */
7
+ declare const schema: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
8
+ export declare class ComposeStopOperation extends AbstractOperation<typeof schema, Readable> {
9
+ protected out: Writable;
10
+ constructor(out: Writable);
11
+ protected _run(_input: z.input<typeof schema>): Promise<Readable>;
12
+ }
13
+ export {};
@@ -0,0 +1,23 @@
1
+ import { getContext } from '../../../index.js';
2
+ import * as z from 'zod';
3
+ import { ExecuteLocalCommandOperation } from '../../../monorepo/index.js';
4
+ import { AbstractOperation } from '../../../operations/index.js';
5
+ /**
6
+ * https://docs.docker.com/reference/cli/docker/compose/stop/
7
+ */
8
+ const schema = z.object({}).optional();
9
+ export class ComposeStopOperation extends AbstractOperation {
10
+ out;
11
+ constructor(out) {
12
+ super(schema);
13
+ this.out = out;
14
+ }
15
+ async _run(_input) {
16
+ const { monorepo } = getContext();
17
+ const command = ['docker', 'compose', 'stop'];
18
+ return monorepo.run(new ExecuteLocalCommandOperation(this.out), {
19
+ script: command.join(' '),
20
+ workingDir: monorepo.rootDir,
21
+ });
22
+ }
23
+ }
@@ -1,4 +1,5 @@
1
1
  export * from './ComposeDownOperation.js';
2
2
  export * from './ComposeExecOperation.js';
3
3
  export * from './ComposeExecShellOperation.js';
4
+ export * from './ComposeStopOperation.js';
4
5
  export * from './ComposeUpOperation.js';
@@ -1,4 +1,5 @@
1
1
  export * from './ComposeDownOperation.js';
2
2
  export * from './ComposeExecOperation.js';
3
3
  export * from './ComposeExecShellOperation.js';
4
+ export * from './ComposeStopOperation.js';
4
5
  export * from './ComposeUpOperation.js';
@@ -80,6 +80,46 @@
80
80
  "down.js"
81
81
  ]
82
82
  },
83
+ "stop": {
84
+ "aliases": [],
85
+ "args": {},
86
+ "description": "Stop the whole project.",
87
+ "examples": [
88
+ "<%= config.bin %> <%= command.id %>"
89
+ ],
90
+ "flags": {
91
+ "json": {
92
+ "description": "Format output as json.",
93
+ "helpGroup": "GLOBAL",
94
+ "name": "json",
95
+ "allowNo": false,
96
+ "type": "boolean"
97
+ },
98
+ "flavor": {
99
+ "description": "Specify the flavor to use.",
100
+ "name": "flavor",
101
+ "required": false,
102
+ "hasDynamicHelp": false,
103
+ "multiple": false,
104
+ "type": "option"
105
+ }
106
+ },
107
+ "hasDynamicHelp": false,
108
+ "hiddenAliases": [],
109
+ "id": "stop",
110
+ "pluginAlias": "@enspirit/emb",
111
+ "pluginName": "@enspirit/emb",
112
+ "pluginType": "core",
113
+ "enableJsonFlag": true,
114
+ "isESM": true,
115
+ "relativePath": [
116
+ "dist",
117
+ "src",
118
+ "cli",
119
+ "commands",
120
+ "stop.js"
121
+ ]
122
+ },
83
123
  "up": {
84
124
  "aliases": [],
85
125
  "args": {
@@ -260,10 +300,12 @@
260
300
  "shell.js"
261
301
  ]
262
302
  },
263
- "config:print": {
264
- "aliases": [],
303
+ "containers": {
304
+ "aliases": [
305
+ "ps"
306
+ ],
265
307
  "args": {},
266
- "description": "Print the current config.",
308
+ "description": "List docker containers.",
267
309
  "examples": [
268
310
  "<%= config.bin %> <%= command.id %>"
269
311
  ],
@@ -275,21 +317,22 @@
275
317
  "allowNo": false,
276
318
  "type": "boolean"
277
319
  },
278
- "flavor": {
279
- "description": "Specify the flavor to use.",
280
- "name": "flavor",
320
+ "all": {
321
+ "char": "a",
322
+ "description": "Retun all containers. By default, only running containers are shown",
323
+ "name": "all",
281
324
  "required": false,
282
- "hasDynamicHelp": false,
283
- "multiple": false,
284
- "type": "option"
325
+ "allowNo": false,
326
+ "type": "boolean"
285
327
  }
286
328
  },
287
329
  "hasDynamicHelp": false,
288
330
  "hiddenAliases": [],
289
- "id": "config:print",
331
+ "id": "containers",
290
332
  "pluginAlias": "@enspirit/emb",
291
333
  "pluginName": "@enspirit/emb",
292
334
  "pluginType": "core",
335
+ "strict": true,
293
336
  "enableJsonFlag": true,
294
337
  "isESM": true,
295
338
  "relativePath": [
@@ -297,16 +340,14 @@
297
340
  "src",
298
341
  "cli",
299
342
  "commands",
300
- "config",
301
- "print.js"
343
+ "containers",
344
+ "index.js"
302
345
  ]
303
346
  },
304
- "containers": {
305
- "aliases": [
306
- "ps"
307
- ],
347
+ "containers:prune": {
348
+ "aliases": [],
308
349
  "args": {},
309
- "description": "List docker containers.",
350
+ "description": "Prune containers.",
310
351
  "examples": [
311
352
  "<%= config.bin %> <%= command.id %>"
312
353
  ],
@@ -317,19 +358,11 @@
317
358
  "name": "json",
318
359
  "allowNo": false,
319
360
  "type": "boolean"
320
- },
321
- "all": {
322
- "char": "a",
323
- "description": "Retun all containers. By default, only running containers are shown",
324
- "name": "all",
325
- "required": false,
326
- "allowNo": false,
327
- "type": "boolean"
328
361
  }
329
362
  },
330
363
  "hasDynamicHelp": false,
331
364
  "hiddenAliases": [],
332
- "id": "containers",
365
+ "id": "containers:prune",
333
366
  "pluginAlias": "@enspirit/emb",
334
367
  "pluginName": "@enspirit/emb",
335
368
  "pluginType": "core",
@@ -342,13 +375,13 @@
342
375
  "cli",
343
376
  "commands",
344
377
  "containers",
345
- "index.js"
378
+ "prune.js"
346
379
  ]
347
380
  },
348
- "containers:prune": {
381
+ "config:print": {
349
382
  "aliases": [],
350
383
  "args": {},
351
- "description": "Prune containers.",
384
+ "description": "Print the current config.",
352
385
  "examples": [
353
386
  "<%= config.bin %> <%= command.id %>"
354
387
  ],
@@ -359,15 +392,22 @@
359
392
  "name": "json",
360
393
  "allowNo": false,
361
394
  "type": "boolean"
395
+ },
396
+ "flavor": {
397
+ "description": "Specify the flavor to use.",
398
+ "name": "flavor",
399
+ "required": false,
400
+ "hasDynamicHelp": false,
401
+ "multiple": false,
402
+ "type": "option"
362
403
  }
363
404
  },
364
405
  "hasDynamicHelp": false,
365
406
  "hiddenAliases": [],
366
- "id": "containers:prune",
407
+ "id": "config:print",
367
408
  "pluginAlias": "@enspirit/emb",
368
409
  "pluginName": "@enspirit/emb",
369
410
  "pluginType": "core",
370
- "strict": true,
371
411
  "enableJsonFlag": true,
372
412
  "isESM": true,
373
413
  "relativePath": [
@@ -375,8 +415,8 @@
375
415
  "src",
376
416
  "cli",
377
417
  "commands",
378
- "containers",
379
- "prune.js"
418
+ "config",
419
+ "print.js"
380
420
  ]
381
421
  },
382
422
  "images:delete": {
@@ -710,5 +750,5 @@
710
750
  ]
711
751
  }
712
752
  },
713
- "version": "0.5.0"
753
+ "version": "0.5.2"
714
754
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@enspirit/emb",
3
3
  "type": "module",
4
- "version": "0.5.0",
4
+ "version": "0.5.2",
5
5
  "keywords": [
6
6
  "monorepo",
7
7
  "docker",