@enspirit/emb 0.5.1 → 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.1 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
+ }
@@ -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": {
@@ -710,5 +750,5 @@
710
750
  ]
711
751
  }
712
752
  },
713
- "version": "0.5.1"
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.1",
4
+ "version": "0.5.2",
5
5
  "keywords": [
6
6
  "monorepo",
7
7
  "docker",