@enspirit/emb 0.25.3 → 0.25.6

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.25.3 darwin-x64 node-v22.18.0
17
+ @enspirit/emb/0.25.6 linux-x64 node-v22.22.2
18
18
  $ emb --help [COMMAND]
19
19
  USAGE
20
20
  $ emb COMMAND
@@ -113,7 +113,7 @@ EXAMPLES
113
113
  $ emb clean
114
114
  ```
115
115
 
116
- _See code: [src/commands/clean.ts](https://github.com/enspirit/emb/blob/v0.25.3/src/commands/clean.ts)_
116
+ _See code: [src/commands/clean.ts](https://github.com/enspirit/emb/blob/v0.25.6/src/commands/clean.ts)_
117
117
 
118
118
  ## `emb components`
119
119
 
@@ -138,7 +138,7 @@ EXAMPLES
138
138
  $ emb components
139
139
  ```
140
140
 
141
- _See code: [src/commands/components/index.ts](https://github.com/enspirit/emb/blob/v0.25.3/src/commands/components/index.ts)_
141
+ _See code: [src/commands/components/index.ts](https://github.com/enspirit/emb/blob/v0.25.6/src/commands/components/index.ts)_
142
142
 
143
143
  ## `emb components shell SERVICE`
144
144
 
@@ -166,7 +166,7 @@ EXAMPLES
166
166
  $ emb components shell
167
167
  ```
168
168
 
169
- _See code: [src/commands/components/shell.ts](https://github.com/enspirit/emb/blob/v0.25.3/src/commands/components/shell.ts)_
169
+ _See code: [src/commands/components/shell.ts](https://github.com/enspirit/emb/blob/v0.25.6/src/commands/components/shell.ts)_
170
170
 
171
171
  ## `emb config print`
172
172
 
@@ -191,7 +191,7 @@ EXAMPLES
191
191
  $ emb config print
192
192
  ```
193
193
 
194
- _See code: [src/commands/config/print.ts](https://github.com/enspirit/emb/blob/v0.25.3/src/commands/config/print.ts)_
194
+ _See code: [src/commands/config/print.ts](https://github.com/enspirit/emb/blob/v0.25.6/src/commands/config/print.ts)_
195
195
 
196
196
  ## `emb containers`
197
197
 
@@ -216,7 +216,7 @@ EXAMPLES
216
216
  $ emb containers
217
217
  ```
218
218
 
219
- _See code: [src/commands/containers/index.ts](https://github.com/enspirit/emb/blob/v0.25.3/src/commands/containers/index.ts)_
219
+ _See code: [src/commands/containers/index.ts](https://github.com/enspirit/emb/blob/v0.25.6/src/commands/containers/index.ts)_
220
220
 
221
221
  ## `emb containers prune`
222
222
 
@@ -240,7 +240,7 @@ EXAMPLES
240
240
  $ emb containers prune
241
241
  ```
242
242
 
243
- _See code: [src/commands/containers/prune.ts](https://github.com/enspirit/emb/blob/v0.25.3/src/commands/containers/prune.ts)_
243
+ _See code: [src/commands/containers/prune.ts](https://github.com/enspirit/emb/blob/v0.25.6/src/commands/containers/prune.ts)_
244
244
 
245
245
  ## `emb down [SERVICE]`
246
246
 
@@ -268,7 +268,7 @@ EXAMPLES
268
268
  $ emb down
269
269
  ```
270
270
 
271
- _See code: [src/commands/down.ts](https://github.com/enspirit/emb/blob/v0.25.3/src/commands/down.ts)_
271
+ _See code: [src/commands/down.ts](https://github.com/enspirit/emb/blob/v0.25.6/src/commands/down.ts)_
272
272
 
273
273
  ## `emb help [COMMAND]`
274
274
 
@@ -314,7 +314,7 @@ EXAMPLES
314
314
  $ emb images
315
315
  ```
316
316
 
317
- _See code: [src/commands/images/index.ts](https://github.com/enspirit/emb/blob/v0.25.3/src/commands/images/index.ts)_
317
+ _See code: [src/commands/images/index.ts](https://github.com/enspirit/emb/blob/v0.25.6/src/commands/images/index.ts)_
318
318
 
319
319
  ## `emb images delete`
320
320
 
@@ -339,7 +339,7 @@ EXAMPLES
339
339
  $ emb images delete
340
340
  ```
341
341
 
342
- _See code: [src/commands/images/delete.ts](https://github.com/enspirit/emb/blob/v0.25.3/src/commands/images/delete.ts)_
342
+ _See code: [src/commands/images/delete.ts](https://github.com/enspirit/emb/blob/v0.25.6/src/commands/images/delete.ts)_
343
343
 
344
344
  ## `emb images prune`
345
345
 
@@ -364,7 +364,7 @@ EXAMPLES
364
364
  $ emb images prune
365
365
  ```
366
366
 
367
- _See code: [src/commands/images/prune.ts](https://github.com/enspirit/emb/blob/v0.25.3/src/commands/images/prune.ts)_
367
+ _See code: [src/commands/images/prune.ts](https://github.com/enspirit/emb/blob/v0.25.6/src/commands/images/prune.ts)_
368
368
 
369
369
  ## `emb images push`
370
370
 
@@ -393,7 +393,7 @@ EXAMPLES
393
393
  $ emb images push --registry my.registry.io --retag newtag
394
394
  ```
395
395
 
396
- _See code: [src/commands/images/push.ts](https://github.com/enspirit/emb/blob/v0.25.3/src/commands/images/push.ts)_
396
+ _See code: [src/commands/images/push.ts](https://github.com/enspirit/emb/blob/v0.25.6/src/commands/images/push.ts)_
397
397
 
398
398
  ## `emb kubernetes logs COMPONENT`
399
399
 
@@ -419,7 +419,7 @@ EXAMPLES
419
419
  $ emb kubernetes logs
420
420
  ```
421
421
 
422
- _See code: [src/commands/kubernetes/logs.ts](https://github.com/enspirit/emb/blob/v0.25.3/src/commands/kubernetes/logs.ts)_
422
+ _See code: [src/commands/kubernetes/logs.ts](https://github.com/enspirit/emb/blob/v0.25.6/src/commands/kubernetes/logs.ts)_
423
423
 
424
424
  ## `emb kubernetes ps`
425
425
 
@@ -442,7 +442,7 @@ EXAMPLES
442
442
  $ emb kubernetes ps
443
443
  ```
444
444
 
445
- _See code: [src/commands/kubernetes/ps.ts](https://github.com/enspirit/emb/blob/v0.25.3/src/commands/kubernetes/ps.ts)_
445
+ _See code: [src/commands/kubernetes/ps.ts](https://github.com/enspirit/emb/blob/v0.25.6/src/commands/kubernetes/ps.ts)_
446
446
 
447
447
  ## `emb kubernetes restart [DEPLOYMENT]`
448
448
 
@@ -467,7 +467,7 @@ EXAMPLES
467
467
  $ emb kubernetes restart
468
468
  ```
469
469
 
470
- _See code: [src/commands/kubernetes/restart.ts](https://github.com/enspirit/emb/blob/v0.25.3/src/commands/kubernetes/restart.ts)_
470
+ _See code: [src/commands/kubernetes/restart.ts](https://github.com/enspirit/emb/blob/v0.25.6/src/commands/kubernetes/restart.ts)_
471
471
 
472
472
  ## `emb kubernetes shell COMPONENT`
473
473
 
@@ -496,7 +496,7 @@ EXAMPLES
496
496
  $ emb kubernetes shell
497
497
  ```
498
498
 
499
- _See code: [src/commands/kubernetes/shell.ts](https://github.com/enspirit/emb/blob/v0.25.3/src/commands/kubernetes/shell.ts)_
499
+ _See code: [src/commands/kubernetes/shell.ts](https://github.com/enspirit/emb/blob/v0.25.6/src/commands/kubernetes/shell.ts)_
500
500
 
501
501
  ## `emb logs [SERVICE]`
502
502
 
@@ -527,7 +527,7 @@ EXAMPLES
527
527
  $ emb logs --no-follow backend
528
528
  ```
529
529
 
530
- _See code: [src/commands/logs/index.ts](https://github.com/enspirit/emb/blob/v0.25.3/src/commands/logs/index.ts)_
530
+ _See code: [src/commands/logs/index.ts](https://github.com/enspirit/emb/blob/v0.25.6/src/commands/logs/index.ts)_
531
531
 
532
532
  ## `emb logs archive [SERVICE]`
533
533
 
@@ -563,7 +563,7 @@ EXAMPLES
563
563
  $ emb logs archive --tail 1000
564
564
  ```
565
565
 
566
- _See code: [src/commands/logs/archive.ts](https://github.com/enspirit/emb/blob/v0.25.3/src/commands/logs/archive.ts)_
566
+ _See code: [src/commands/logs/archive.ts](https://github.com/enspirit/emb/blob/v0.25.6/src/commands/logs/archive.ts)_
567
567
 
568
568
  ## `emb ps`
569
569
 
@@ -586,7 +586,7 @@ EXAMPLES
586
586
  $ emb ps
587
587
  ```
588
588
 
589
- _See code: [src/commands/ps.ts](https://github.com/enspirit/emb/blob/v0.25.3/src/commands/ps.ts)_
589
+ _See code: [src/commands/ps.ts](https://github.com/enspirit/emb/blob/v0.25.6/src/commands/ps.ts)_
590
590
 
591
591
  ## `emb resources`
592
592
 
@@ -614,7 +614,7 @@ EXAMPLES
614
614
  $ emb resources --publishable
615
615
  ```
616
616
 
617
- _See code: [src/commands/resources/index.ts](https://github.com/enspirit/emb/blob/v0.25.3/src/commands/resources/index.ts)_
617
+ _See code: [src/commands/resources/index.ts](https://github.com/enspirit/emb/blob/v0.25.6/src/commands/resources/index.ts)_
618
618
 
619
619
  ## `emb resources build [COMPONENT]`
620
620
 
@@ -648,7 +648,7 @@ EXAMPLES
648
648
  $ emb resources build build --publishable --flavor production
649
649
  ```
650
650
 
651
- _See code: [src/commands/resources/build.ts](https://github.com/enspirit/emb/blob/v0.25.3/src/commands/resources/build.ts)_
651
+ _See code: [src/commands/resources/build.ts](https://github.com/enspirit/emb/blob/v0.25.6/src/commands/resources/build.ts)_
652
652
 
653
653
  ## `emb resources publish [RESOURCES]`
654
654
 
@@ -679,7 +679,7 @@ EXAMPLES
679
679
  $ emb resources publish api:image --flavor production
680
680
  ```
681
681
 
682
- _See code: [src/commands/resources/publish.ts](https://github.com/enspirit/emb/blob/v0.25.3/src/commands/resources/publish.ts)_
682
+ _See code: [src/commands/resources/publish.ts](https://github.com/enspirit/emb/blob/v0.25.6/src/commands/resources/publish.ts)_
683
683
 
684
684
  ## `emb restart [SERVICE]`
685
685
 
@@ -707,7 +707,7 @@ EXAMPLES
707
707
  $ emb restart
708
708
  ```
709
709
 
710
- _See code: [src/commands/restart.ts](https://github.com/enspirit/emb/blob/v0.25.3/src/commands/restart.ts)_
710
+ _See code: [src/commands/restart.ts](https://github.com/enspirit/emb/blob/v0.25.6/src/commands/restart.ts)_
711
711
 
712
712
  ## `emb run TASK`
713
713
 
@@ -765,7 +765,7 @@ EXAMPLES
765
765
  $ emb secrets --json
766
766
  ```
767
767
 
768
- _See code: [src/commands/secrets/index.ts](https://github.com/enspirit/emb/blob/v0.25.3/src/commands/secrets/index.ts)_
768
+ _See code: [src/commands/secrets/index.ts](https://github.com/enspirit/emb/blob/v0.25.6/src/commands/secrets/index.ts)_
769
769
 
770
770
  ## `emb secrets providers`
771
771
 
@@ -790,7 +790,7 @@ EXAMPLES
790
790
  $ emb secrets providers
791
791
  ```
792
792
 
793
- _See code: [src/commands/secrets/providers.ts](https://github.com/enspirit/emb/blob/v0.25.3/src/commands/secrets/providers.ts)_
793
+ _See code: [src/commands/secrets/providers.ts](https://github.com/enspirit/emb/blob/v0.25.6/src/commands/secrets/providers.ts)_
794
794
 
795
795
  ## `emb secrets validate`
796
796
 
@@ -820,7 +820,7 @@ EXAMPLES
820
820
  $ emb secrets validate --json
821
821
  ```
822
822
 
823
- _See code: [src/commands/secrets/validate.ts](https://github.com/enspirit/emb/blob/v0.25.3/src/commands/secrets/validate.ts)_
823
+ _See code: [src/commands/secrets/validate.ts](https://github.com/enspirit/emb/blob/v0.25.6/src/commands/secrets/validate.ts)_
824
824
 
825
825
  ## `emb shell SERVICE`
826
826
 
@@ -873,7 +873,7 @@ EXAMPLES
873
873
  $ emb start
874
874
  ```
875
875
 
876
- _See code: [src/commands/start.ts](https://github.com/enspirit/emb/blob/v0.25.3/src/commands/start.ts)_
876
+ _See code: [src/commands/start.ts](https://github.com/enspirit/emb/blob/v0.25.6/src/commands/start.ts)_
877
877
 
878
878
  ## `emb stop [SERVICE]`
879
879
 
@@ -901,7 +901,7 @@ EXAMPLES
901
901
  $ emb stop
902
902
  ```
903
903
 
904
- _See code: [src/commands/stop.ts](https://github.com/enspirit/emb/blob/v0.25.3/src/commands/stop.ts)_
904
+ _See code: [src/commands/stop.ts](https://github.com/enspirit/emb/blob/v0.25.6/src/commands/stop.ts)_
905
905
 
906
906
  ## `emb tasks`
907
907
 
@@ -925,7 +925,7 @@ EXAMPLES
925
925
  $ emb tasks
926
926
  ```
927
927
 
928
- _See code: [src/commands/tasks/index.ts](https://github.com/enspirit/emb/blob/v0.25.3/src/commands/tasks/index.ts)_
928
+ _See code: [src/commands/tasks/index.ts](https://github.com/enspirit/emb/blob/v0.25.6/src/commands/tasks/index.ts)_
929
929
 
930
930
  ## `emb tasks run TASK`
931
931
 
@@ -958,7 +958,7 @@ EXAMPLES
958
958
  $ emb tasks run
959
959
  ```
960
960
 
961
- _See code: [src/commands/tasks/run.ts](https://github.com/enspirit/emb/blob/v0.25.3/src/commands/tasks/run.ts)_
961
+ _See code: [src/commands/tasks/run.ts](https://github.com/enspirit/emb/blob/v0.25.6/src/commands/tasks/run.ts)_
962
962
 
963
963
  ## `emb up [SERVICE]`
964
964
 
@@ -987,7 +987,7 @@ EXAMPLES
987
987
  $ emb up
988
988
  ```
989
989
 
990
- _See code: [src/commands/up.ts](https://github.com/enspirit/emb/blob/v0.25.3/src/commands/up.ts)_
990
+ _See code: [src/commands/up.ts](https://github.com/enspirit/emb/blob/v0.25.6/src/commands/up.ts)_
991
991
 
992
992
  ## `emb update [CHANNEL]`
993
993
 
@@ -1,11 +1,23 @@
1
1
  import { Ajv } from 'ajv';
2
2
  import { readFile, stat } from 'node:fs/promises';
3
3
  import yaml from 'yaml';
4
+ import { ConfigValidationError } from '../errors.js';
4
5
  import configSchema from './schema.json' with { type: 'json' };
5
- const ajv = new Ajv();
6
+ const ajv = new Ajv({ allErrors: true });
6
7
  ajv.addSchema(configSchema);
8
+ function formatAjvErrors(errors) {
9
+ return errors.map((err) => {
10
+ const path = err.instancePath || '/';
11
+ if (err.keyword === 'additionalProperties' &&
12
+ err.params?.additionalProperty) {
13
+ return `${path}: unknown property '${err.params.additionalProperty}'`;
14
+ }
15
+ return `${path}: ${err.message}`;
16
+ });
17
+ }
7
18
  export const validateUserConfig = async (pathOrObject) => {
8
19
  let embConfig;
20
+ const file = typeof pathOrObject === 'string' ? pathOrObject : '.emb.yml';
9
21
  if (typeof pathOrObject === 'string') {
10
22
  if (await stat(pathOrObject)) {
11
23
  const cfgYaml = (await readFile(pathOrObject)).toString();
@@ -19,13 +31,14 @@ export const validateUserConfig = async (pathOrObject) => {
19
31
  embConfig = pathOrObject;
20
32
  }
21
33
  if (!ajv.validate(configSchema, embConfig)) {
22
- ajv.errors?.forEach((err) => console.error(err));
23
- throw new Error(`Your .emb.yml is incorrect`);
34
+ const errors = formatAjvErrors(ajv.errors || []);
35
+ throw new ConfigValidationError([{ file, errors }]);
24
36
  }
25
37
  return embConfig;
26
38
  };
27
39
  export const validateEmbfile = async (pathOrObject) => {
28
40
  let component;
41
+ const file = typeof pathOrObject === 'string' ? pathOrObject : 'Embfile';
29
42
  if (typeof pathOrObject === 'string') {
30
43
  if (await stat(pathOrObject)) {
31
44
  const cfgYaml = (await readFile(pathOrObject)).toString();
@@ -46,8 +59,8 @@ export const validateEmbfile = async (pathOrObject) => {
46
59
  return {};
47
60
  }
48
61
  if (!validate(component)) {
49
- ajv.errors?.forEach((err) => console.error(err));
50
- throw new Error(`Your .emb.yml is incorrect`);
62
+ const errors = formatAjvErrors(validate.errors || []);
63
+ throw new ConfigValidationError([{ file, errors }]);
51
64
  }
52
65
  return component;
53
66
  };
@@ -82,3 +82,12 @@ export declare class ComposeExecError extends EMBError {
82
82
  signal?: (NodeJS.Signals | null) | undefined;
83
83
  constructor(msg: string, exitCode: number, signal?: (NodeJS.Signals | null) | undefined);
84
84
  }
85
+ export interface ConfigFileError {
86
+ errors: string[];
87
+ file: string;
88
+ }
89
+ export declare class ConfigValidationError extends EMBError {
90
+ fileErrors: ConfigFileError[];
91
+ constructor(fileErrors: ConfigFileError[]);
92
+ private static formatMessage;
93
+ }
@@ -113,3 +113,21 @@ export class ComposeExecError extends EMBError {
113
113
  this.signal = signal;
114
114
  }
115
115
  }
116
+ export class ConfigValidationError extends EMBError {
117
+ fileErrors;
118
+ constructor(fileErrors) {
119
+ super('CONFIG_VALIDATION', ConfigValidationError.formatMessage(fileErrors));
120
+ this.fileErrors = fileErrors;
121
+ }
122
+ static formatMessage(fileErrors) {
123
+ if (fileErrors.length === 1) {
124
+ const { file, errors } = fileErrors[0];
125
+ return `${file} is invalid:\n${errors.map((e) => ` - ${e}`).join('\n')}`;
126
+ }
127
+ return `Configuration files have errors:\n\n${fileErrors
128
+ .map(({ file, errors }) => {
129
+ return ` ${file}:\n${errors.map((e) => ` - ${e}`).join('\n')}`;
130
+ })
131
+ .join('\n\n')}`;
132
+ }
133
+ }
@@ -2,6 +2,7 @@ import deepmerge from '@fastify/deepmerge';
2
2
  import { glob } from 'glob';
3
3
  import { basename, dirname, join } from 'node:path';
4
4
  import { validateEmbfile } from '../../config/index.js';
5
+ import { ConfigValidationError } from '../../errors.js';
5
6
  import { AbstractPlugin } from './plugin.js';
6
7
  export const EmbfileLoaderPluginDefaultOptions = {
7
8
  glob: '*/Embfile.{yaml,yml}',
@@ -26,23 +27,37 @@ export class EmbfileLoaderPlugin extends AbstractPlugin {
26
27
  cwd: this.monorepo.rootDir,
27
28
  follow: true,
28
29
  });
29
- const newConfig = await files.reduce(async (pConfig, path) => {
30
- const config = await pConfig;
30
+ const validationErrors = [];
31
+ let newConfig = config;
32
+ for (const path of files) {
31
33
  const rootDir = dirname(path);
32
34
  const name = basename(rootDir);
33
- const embfile = await join(this.monorepo.rootDir, path);
34
- const component = await validateEmbfile(embfile);
35
- const original = config.components[name];
36
- const newComponent = deepmerge()(original || {}, {
37
- ...component,
38
- rootDir,
39
- });
40
- return config.with({
41
- components: {
42
- [name]: newComponent,
43
- },
44
- });
45
- }, Promise.resolve(config));
35
+ const embfile = join(this.monorepo.rootDir, path);
36
+ try {
37
+ const component = await validateEmbfile(embfile);
38
+ const original = newConfig.components[name];
39
+ const newComponent = deepmerge()(original || {}, {
40
+ ...component,
41
+ rootDir,
42
+ });
43
+ newConfig = newConfig.with({
44
+ components: {
45
+ [name]: newComponent,
46
+ },
47
+ });
48
+ }
49
+ catch (error) {
50
+ if (error instanceof ConfigValidationError) {
51
+ validationErrors.push(...error.fileErrors);
52
+ }
53
+ else {
54
+ throw error;
55
+ }
56
+ }
57
+ }
58
+ if (validationErrors.length > 0) {
59
+ throw new ConfigValidationError(validationErrors);
60
+ }
46
61
  return newConfig;
47
62
  }
48
63
  }
@@ -931,142 +931,6 @@
931
931
  "push.js"
932
932
  ]
933
933
  },
934
- "logs:archive": {
935
- "aliases": [],
936
- "args": {
937
- "service": {
938
- "description": "The service(s) to archive logs for (all if omitted)",
939
- "name": "service",
940
- "required": false
941
- }
942
- },
943
- "description": "Archive docker compose logs to files (one file per service).",
944
- "examples": [
945
- "<%= config.bin %> <%= command.id %>",
946
- "<%= config.bin %> <%= command.id %> backend frontend",
947
- "<%= config.bin %> <%= command.id %> --timestamps",
948
- "<%= config.bin %> <%= command.id %> --tail 1000"
949
- ],
950
- "flags": {
951
- "json": {
952
- "description": "Format output as json.",
953
- "helpGroup": "GLOBAL",
954
- "name": "json",
955
- "allowNo": false,
956
- "type": "boolean"
957
- },
958
- "verbose": {
959
- "name": "verbose",
960
- "allowNo": true,
961
- "type": "boolean"
962
- },
963
- "root": {
964
- "char": "C",
965
- "description": "Run as if emb was started in <path>. Can also be set via EMB_ROOT env var.",
966
- "name": "root",
967
- "required": false,
968
- "hasDynamicHelp": false,
969
- "multiple": false,
970
- "type": "option"
971
- },
972
- "timestamps": {
973
- "char": "t",
974
- "description": "Include timestamps in logs",
975
- "name": "timestamps",
976
- "allowNo": false,
977
- "type": "boolean"
978
- },
979
- "tail": {
980
- "description": "Number of lines to show from the end of the logs",
981
- "name": "tail",
982
- "hasDynamicHelp": false,
983
- "multiple": false,
984
- "type": "option"
985
- },
986
- "output": {
987
- "char": "o",
988
- "description": "Output directory for log files (defaults to .emb/<flavor>/logs/docker/compose)",
989
- "name": "output",
990
- "hasDynamicHelp": false,
991
- "multiple": false,
992
- "type": "option"
993
- }
994
- },
995
- "hasDynamicHelp": false,
996
- "hiddenAliases": [],
997
- "id": "logs:archive",
998
- "pluginAlias": "@enspirit/emb",
999
- "pluginName": "@enspirit/emb",
1000
- "pluginType": "core",
1001
- "strict": false,
1002
- "enableJsonFlag": true,
1003
- "isESM": true,
1004
- "relativePath": [
1005
- "dist",
1006
- "src",
1007
- "cli",
1008
- "commands",
1009
- "logs",
1010
- "archive.js"
1011
- ]
1012
- },
1013
- "logs": {
1014
- "aliases": [],
1015
- "args": {
1016
- "service": {
1017
- "description": "The service(s) you want to see the logs of (all if omitted)",
1018
- "name": "service",
1019
- "required": false
1020
- }
1021
- },
1022
- "description": "Get service logs.",
1023
- "examples": [
1024
- "<%= config.bin %> <%= command.id %>",
1025
- "<%= config.bin %> <%= command.id %> backend",
1026
- "<%= config.bin %> <%= command.id %> backend frontend",
1027
- "<%= config.bin %> <%= command.id %> --no-follow backend"
1028
- ],
1029
- "flags": {
1030
- "verbose": {
1031
- "name": "verbose",
1032
- "allowNo": true,
1033
- "type": "boolean"
1034
- },
1035
- "root": {
1036
- "char": "C",
1037
- "description": "Run as if emb was started in <path>. Can also be set via EMB_ROOT env var.",
1038
- "name": "root",
1039
- "required": false,
1040
- "hasDynamicHelp": false,
1041
- "multiple": false,
1042
- "type": "option"
1043
- },
1044
- "follow": {
1045
- "char": "f",
1046
- "description": "Follow log output",
1047
- "name": "follow",
1048
- "allowNo": true,
1049
- "type": "boolean"
1050
- }
1051
- },
1052
- "hasDynamicHelp": false,
1053
- "hiddenAliases": [],
1054
- "id": "logs",
1055
- "pluginAlias": "@enspirit/emb",
1056
- "pluginName": "@enspirit/emb",
1057
- "pluginType": "core",
1058
- "strict": false,
1059
- "enableJsonFlag": false,
1060
- "isESM": true,
1061
- "relativePath": [
1062
- "dist",
1063
- "src",
1064
- "cli",
1065
- "commands",
1066
- "logs",
1067
- "index.js"
1068
- ]
1069
- },
1070
934
  "kubernetes:logs": {
1071
935
  "aliases": [],
1072
936
  "args": {
@@ -1319,6 +1183,142 @@
1319
1183
  "shell.js"
1320
1184
  ]
1321
1185
  },
1186
+ "logs:archive": {
1187
+ "aliases": [],
1188
+ "args": {
1189
+ "service": {
1190
+ "description": "The service(s) to archive logs for (all if omitted)",
1191
+ "name": "service",
1192
+ "required": false
1193
+ }
1194
+ },
1195
+ "description": "Archive docker compose logs to files (one file per service).",
1196
+ "examples": [
1197
+ "<%= config.bin %> <%= command.id %>",
1198
+ "<%= config.bin %> <%= command.id %> backend frontend",
1199
+ "<%= config.bin %> <%= command.id %> --timestamps",
1200
+ "<%= config.bin %> <%= command.id %> --tail 1000"
1201
+ ],
1202
+ "flags": {
1203
+ "json": {
1204
+ "description": "Format output as json.",
1205
+ "helpGroup": "GLOBAL",
1206
+ "name": "json",
1207
+ "allowNo": false,
1208
+ "type": "boolean"
1209
+ },
1210
+ "verbose": {
1211
+ "name": "verbose",
1212
+ "allowNo": true,
1213
+ "type": "boolean"
1214
+ },
1215
+ "root": {
1216
+ "char": "C",
1217
+ "description": "Run as if emb was started in <path>. Can also be set via EMB_ROOT env var.",
1218
+ "name": "root",
1219
+ "required": false,
1220
+ "hasDynamicHelp": false,
1221
+ "multiple": false,
1222
+ "type": "option"
1223
+ },
1224
+ "timestamps": {
1225
+ "char": "t",
1226
+ "description": "Include timestamps in logs",
1227
+ "name": "timestamps",
1228
+ "allowNo": false,
1229
+ "type": "boolean"
1230
+ },
1231
+ "tail": {
1232
+ "description": "Number of lines to show from the end of the logs",
1233
+ "name": "tail",
1234
+ "hasDynamicHelp": false,
1235
+ "multiple": false,
1236
+ "type": "option"
1237
+ },
1238
+ "output": {
1239
+ "char": "o",
1240
+ "description": "Output directory for log files (defaults to .emb/<flavor>/logs/docker/compose)",
1241
+ "name": "output",
1242
+ "hasDynamicHelp": false,
1243
+ "multiple": false,
1244
+ "type": "option"
1245
+ }
1246
+ },
1247
+ "hasDynamicHelp": false,
1248
+ "hiddenAliases": [],
1249
+ "id": "logs:archive",
1250
+ "pluginAlias": "@enspirit/emb",
1251
+ "pluginName": "@enspirit/emb",
1252
+ "pluginType": "core",
1253
+ "strict": false,
1254
+ "enableJsonFlag": true,
1255
+ "isESM": true,
1256
+ "relativePath": [
1257
+ "dist",
1258
+ "src",
1259
+ "cli",
1260
+ "commands",
1261
+ "logs",
1262
+ "archive.js"
1263
+ ]
1264
+ },
1265
+ "logs": {
1266
+ "aliases": [],
1267
+ "args": {
1268
+ "service": {
1269
+ "description": "The service(s) you want to see the logs of (all if omitted)",
1270
+ "name": "service",
1271
+ "required": false
1272
+ }
1273
+ },
1274
+ "description": "Get service logs.",
1275
+ "examples": [
1276
+ "<%= config.bin %> <%= command.id %>",
1277
+ "<%= config.bin %> <%= command.id %> backend",
1278
+ "<%= config.bin %> <%= command.id %> backend frontend",
1279
+ "<%= config.bin %> <%= command.id %> --no-follow backend"
1280
+ ],
1281
+ "flags": {
1282
+ "verbose": {
1283
+ "name": "verbose",
1284
+ "allowNo": true,
1285
+ "type": "boolean"
1286
+ },
1287
+ "root": {
1288
+ "char": "C",
1289
+ "description": "Run as if emb was started in <path>. Can also be set via EMB_ROOT env var.",
1290
+ "name": "root",
1291
+ "required": false,
1292
+ "hasDynamicHelp": false,
1293
+ "multiple": false,
1294
+ "type": "option"
1295
+ },
1296
+ "follow": {
1297
+ "char": "f",
1298
+ "description": "Follow log output",
1299
+ "name": "follow",
1300
+ "allowNo": true,
1301
+ "type": "boolean"
1302
+ }
1303
+ },
1304
+ "hasDynamicHelp": false,
1305
+ "hiddenAliases": [],
1306
+ "id": "logs",
1307
+ "pluginAlias": "@enspirit/emb",
1308
+ "pluginName": "@enspirit/emb",
1309
+ "pluginType": "core",
1310
+ "strict": false,
1311
+ "enableJsonFlag": false,
1312
+ "isESM": true,
1313
+ "relativePath": [
1314
+ "dist",
1315
+ "src",
1316
+ "cli",
1317
+ "commands",
1318
+ "logs",
1319
+ "index.js"
1320
+ ]
1321
+ },
1322
1322
  "secrets": {
1323
1323
  "aliases": [],
1324
1324
  "args": {},
@@ -1840,5 +1840,5 @@
1840
1840
  ]
1841
1841
  }
1842
1842
  },
1843
- "version": "0.25.3"
1843
+ "version": "0.25.6"
1844
1844
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@enspirit/emb",
3
3
  "type": "module",
4
- "version": "0.25.3",
4
+ "version": "0.25.6",
5
5
  "keywords": [
6
6
  "monorepo",
7
7
  "docker",