@enspirit/emb 0.20.1 → 0.21.0

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.20.1 darwin-arm64 node-v22.21.1
17
+ @enspirit/emb/0.21.0 darwin-arm64 node-v22.21.1
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.20.1/src/commands/clean.ts)_
116
+ _See code: [src/commands/clean.ts](https://github.com/enspirit/emb/blob/v0.21.0/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.20.1/src/commands/components/index.ts)_
141
+ _See code: [src/commands/components/index.ts](https://github.com/enspirit/emb/blob/v0.21.0/src/commands/components/index.ts)_
142
142
 
143
143
  ## `emb components logs [COMPONENT]`
144
144
 
@@ -169,7 +169,7 @@ EXAMPLES
169
169
  $ emb components logs --no-follow backend
170
170
  ```
171
171
 
172
- _See code: [src/commands/components/logs.ts](https://github.com/enspirit/emb/blob/v0.20.1/src/commands/components/logs.ts)_
172
+ _See code: [src/commands/components/logs.ts](https://github.com/enspirit/emb/blob/v0.21.0/src/commands/components/logs.ts)_
173
173
 
174
174
  ## `emb components shell COMPONENT`
175
175
 
@@ -197,7 +197,7 @@ EXAMPLES
197
197
  $ emb components shell
198
198
  ```
199
199
 
200
- _See code: [src/commands/components/shell.ts](https://github.com/enspirit/emb/blob/v0.20.1/src/commands/components/shell.ts)_
200
+ _See code: [src/commands/components/shell.ts](https://github.com/enspirit/emb/blob/v0.21.0/src/commands/components/shell.ts)_
201
201
 
202
202
  ## `emb config print`
203
203
 
@@ -222,7 +222,7 @@ EXAMPLES
222
222
  $ emb config print
223
223
  ```
224
224
 
225
- _See code: [src/commands/config/print.ts](https://github.com/enspirit/emb/blob/v0.20.1/src/commands/config/print.ts)_
225
+ _See code: [src/commands/config/print.ts](https://github.com/enspirit/emb/blob/v0.21.0/src/commands/config/print.ts)_
226
226
 
227
227
  ## `emb containers`
228
228
 
@@ -247,7 +247,7 @@ EXAMPLES
247
247
  $ emb containers
248
248
  ```
249
249
 
250
- _See code: [src/commands/containers/index.ts](https://github.com/enspirit/emb/blob/v0.20.1/src/commands/containers/index.ts)_
250
+ _See code: [src/commands/containers/index.ts](https://github.com/enspirit/emb/blob/v0.21.0/src/commands/containers/index.ts)_
251
251
 
252
252
  ## `emb containers prune`
253
253
 
@@ -271,7 +271,7 @@ EXAMPLES
271
271
  $ emb containers prune
272
272
  ```
273
273
 
274
- _See code: [src/commands/containers/prune.ts](https://github.com/enspirit/emb/blob/v0.20.1/src/commands/containers/prune.ts)_
274
+ _See code: [src/commands/containers/prune.ts](https://github.com/enspirit/emb/blob/v0.21.0/src/commands/containers/prune.ts)_
275
275
 
276
276
  ## `emb down`
277
277
 
@@ -296,7 +296,7 @@ EXAMPLES
296
296
  $ emb down
297
297
  ```
298
298
 
299
- _See code: [src/commands/down.ts](https://github.com/enspirit/emb/blob/v0.20.1/src/commands/down.ts)_
299
+ _See code: [src/commands/down.ts](https://github.com/enspirit/emb/blob/v0.21.0/src/commands/down.ts)_
300
300
 
301
301
  ## `emb help [COMMAND]`
302
302
 
@@ -342,7 +342,7 @@ EXAMPLES
342
342
  $ emb images
343
343
  ```
344
344
 
345
- _See code: [src/commands/images/index.ts](https://github.com/enspirit/emb/blob/v0.20.1/src/commands/images/index.ts)_
345
+ _See code: [src/commands/images/index.ts](https://github.com/enspirit/emb/blob/v0.21.0/src/commands/images/index.ts)_
346
346
 
347
347
  ## `emb images delete`
348
348
 
@@ -367,7 +367,7 @@ EXAMPLES
367
367
  $ emb images delete
368
368
  ```
369
369
 
370
- _See code: [src/commands/images/delete.ts](https://github.com/enspirit/emb/blob/v0.20.1/src/commands/images/delete.ts)_
370
+ _See code: [src/commands/images/delete.ts](https://github.com/enspirit/emb/blob/v0.21.0/src/commands/images/delete.ts)_
371
371
 
372
372
  ## `emb images prune`
373
373
 
@@ -392,7 +392,7 @@ EXAMPLES
392
392
  $ emb images prune
393
393
  ```
394
394
 
395
- _See code: [src/commands/images/prune.ts](https://github.com/enspirit/emb/blob/v0.20.1/src/commands/images/prune.ts)_
395
+ _See code: [src/commands/images/prune.ts](https://github.com/enspirit/emb/blob/v0.21.0/src/commands/images/prune.ts)_
396
396
 
397
397
  ## `emb images push`
398
398
 
@@ -421,7 +421,7 @@ EXAMPLES
421
421
  $ emb images push --registry my.registry.io --retag newtag
422
422
  ```
423
423
 
424
- _See code: [src/commands/images/push.ts](https://github.com/enspirit/emb/blob/v0.20.1/src/commands/images/push.ts)_
424
+ _See code: [src/commands/images/push.ts](https://github.com/enspirit/emb/blob/v0.21.0/src/commands/images/push.ts)_
425
425
 
426
426
  ## `emb kubernetes logs COMPONENT`
427
427
 
@@ -447,7 +447,7 @@ EXAMPLES
447
447
  $ emb kubernetes logs
448
448
  ```
449
449
 
450
- _See code: [src/commands/kubernetes/logs.ts](https://github.com/enspirit/emb/blob/v0.20.1/src/commands/kubernetes/logs.ts)_
450
+ _See code: [src/commands/kubernetes/logs.ts](https://github.com/enspirit/emb/blob/v0.21.0/src/commands/kubernetes/logs.ts)_
451
451
 
452
452
  ## `emb kubernetes ps`
453
453
 
@@ -470,7 +470,7 @@ EXAMPLES
470
470
  $ emb kubernetes ps
471
471
  ```
472
472
 
473
- _See code: [src/commands/kubernetes/ps.ts](https://github.com/enspirit/emb/blob/v0.20.1/src/commands/kubernetes/ps.ts)_
473
+ _See code: [src/commands/kubernetes/ps.ts](https://github.com/enspirit/emb/blob/v0.21.0/src/commands/kubernetes/ps.ts)_
474
474
 
475
475
  ## `emb kubernetes restart [DEPLOYMENT]`
476
476
 
@@ -495,7 +495,7 @@ EXAMPLES
495
495
  $ emb kubernetes restart
496
496
  ```
497
497
 
498
- _See code: [src/commands/kubernetes/restart.ts](https://github.com/enspirit/emb/blob/v0.20.1/src/commands/kubernetes/restart.ts)_
498
+ _See code: [src/commands/kubernetes/restart.ts](https://github.com/enspirit/emb/blob/v0.21.0/src/commands/kubernetes/restart.ts)_
499
499
 
500
500
  ## `emb kubernetes shell COMPONENT`
501
501
 
@@ -524,7 +524,7 @@ EXAMPLES
524
524
  $ emb kubernetes shell
525
525
  ```
526
526
 
527
- _See code: [src/commands/kubernetes/shell.ts](https://github.com/enspirit/emb/blob/v0.20.1/src/commands/kubernetes/shell.ts)_
527
+ _See code: [src/commands/kubernetes/shell.ts](https://github.com/enspirit/emb/blob/v0.21.0/src/commands/kubernetes/shell.ts)_
528
528
 
529
529
  ## `emb logs [COMPONENT]`
530
530
 
@@ -555,7 +555,7 @@ EXAMPLES
555
555
  $ emb logs --no-follow backend
556
556
  ```
557
557
 
558
- _See code: [src/commands/logs/index.ts](https://github.com/enspirit/emb/blob/v0.20.1/src/commands/logs/index.ts)_
558
+ _See code: [src/commands/logs/index.ts](https://github.com/enspirit/emb/blob/v0.21.0/src/commands/logs/index.ts)_
559
559
 
560
560
  ## `emb logs archive [COMPONENT]`
561
561
 
@@ -591,7 +591,7 @@ EXAMPLES
591
591
  $ emb logs archive --tail 1000
592
592
  ```
593
593
 
594
- _See code: [src/commands/logs/archive.ts](https://github.com/enspirit/emb/blob/v0.20.1/src/commands/logs/archive.ts)_
594
+ _See code: [src/commands/logs/archive.ts](https://github.com/enspirit/emb/blob/v0.21.0/src/commands/logs/archive.ts)_
595
595
 
596
596
  ## `emb ps`
597
597
 
@@ -614,7 +614,7 @@ EXAMPLES
614
614
  $ emb ps
615
615
  ```
616
616
 
617
- _See code: [src/commands/ps.ts](https://github.com/enspirit/emb/blob/v0.20.1/src/commands/ps.ts)_
617
+ _See code: [src/commands/ps.ts](https://github.com/enspirit/emb/blob/v0.21.0/src/commands/ps.ts)_
618
618
 
619
619
  ## `emb resources`
620
620
 
@@ -639,7 +639,7 @@ EXAMPLES
639
639
  $ emb resources
640
640
  ```
641
641
 
642
- _See code: [src/commands/resources/index.ts](https://github.com/enspirit/emb/blob/v0.20.1/src/commands/resources/index.ts)_
642
+ _See code: [src/commands/resources/index.ts](https://github.com/enspirit/emb/blob/v0.21.0/src/commands/resources/index.ts)_
643
643
 
644
644
  ## `emb resources build [COMPONENT]`
645
645
 
@@ -669,7 +669,7 @@ EXAMPLES
669
669
  $ emb resources build build --flavor development
670
670
  ```
671
671
 
672
- _See code: [src/commands/resources/build.ts](https://github.com/enspirit/emb/blob/v0.20.1/src/commands/resources/build.ts)_
672
+ _See code: [src/commands/resources/build.ts](https://github.com/enspirit/emb/blob/v0.21.0/src/commands/resources/build.ts)_
673
673
 
674
674
  ## `emb restart [COMPONENT]`
675
675
 
@@ -697,7 +697,7 @@ EXAMPLES
697
697
  $ emb restart
698
698
  ```
699
699
 
700
- _See code: [src/commands/restart.ts](https://github.com/enspirit/emb/blob/v0.20.1/src/commands/restart.ts)_
700
+ _See code: [src/commands/restart.ts](https://github.com/enspirit/emb/blob/v0.21.0/src/commands/restart.ts)_
701
701
 
702
702
  ## `emb run TASK`
703
703
 
@@ -755,7 +755,7 @@ EXAMPLES
755
755
  $ emb secrets --json
756
756
  ```
757
757
 
758
- _See code: [src/commands/secrets/index.ts](https://github.com/enspirit/emb/blob/v0.20.1/src/commands/secrets/index.ts)_
758
+ _See code: [src/commands/secrets/index.ts](https://github.com/enspirit/emb/blob/v0.21.0/src/commands/secrets/index.ts)_
759
759
 
760
760
  ## `emb secrets providers`
761
761
 
@@ -780,7 +780,7 @@ EXAMPLES
780
780
  $ emb secrets providers
781
781
  ```
782
782
 
783
- _See code: [src/commands/secrets/providers.ts](https://github.com/enspirit/emb/blob/v0.20.1/src/commands/secrets/providers.ts)_
783
+ _See code: [src/commands/secrets/providers.ts](https://github.com/enspirit/emb/blob/v0.21.0/src/commands/secrets/providers.ts)_
784
784
 
785
785
  ## `emb secrets validate`
786
786
 
@@ -810,7 +810,7 @@ EXAMPLES
810
810
  $ emb secrets validate --json
811
811
  ```
812
812
 
813
- _See code: [src/commands/secrets/validate.ts](https://github.com/enspirit/emb/blob/v0.20.1/src/commands/secrets/validate.ts)_
813
+ _See code: [src/commands/secrets/validate.ts](https://github.com/enspirit/emb/blob/v0.21.0/src/commands/secrets/validate.ts)_
814
814
 
815
815
  ## `emb shell COMPONENT`
816
816
 
@@ -863,7 +863,7 @@ EXAMPLES
863
863
  $ emb start
864
864
  ```
865
865
 
866
- _See code: [src/commands/start.ts](https://github.com/enspirit/emb/blob/v0.20.1/src/commands/start.ts)_
866
+ _See code: [src/commands/start.ts](https://github.com/enspirit/emb/blob/v0.21.0/src/commands/start.ts)_
867
867
 
868
868
  ## `emb stop`
869
869
 
@@ -888,7 +888,7 @@ EXAMPLES
888
888
  $ emb stop
889
889
  ```
890
890
 
891
- _See code: [src/commands/stop.ts](https://github.com/enspirit/emb/blob/v0.20.1/src/commands/stop.ts)_
891
+ _See code: [src/commands/stop.ts](https://github.com/enspirit/emb/blob/v0.21.0/src/commands/stop.ts)_
892
892
 
893
893
  ## `emb tasks`
894
894
 
@@ -912,7 +912,7 @@ EXAMPLES
912
912
  $ emb tasks
913
913
  ```
914
914
 
915
- _See code: [src/commands/tasks/index.ts](https://github.com/enspirit/emb/blob/v0.20.1/src/commands/tasks/index.ts)_
915
+ _See code: [src/commands/tasks/index.ts](https://github.com/enspirit/emb/blob/v0.21.0/src/commands/tasks/index.ts)_
916
916
 
917
917
  ## `emb tasks run TASK`
918
918
 
@@ -945,7 +945,7 @@ EXAMPLES
945
945
  $ emb tasks run
946
946
  ```
947
947
 
948
- _See code: [src/commands/tasks/run.ts](https://github.com/enspirit/emb/blob/v0.20.1/src/commands/tasks/run.ts)_
948
+ _See code: [src/commands/tasks/run.ts](https://github.com/enspirit/emb/blob/v0.21.0/src/commands/tasks/run.ts)_
949
949
 
950
950
  ## `emb up [COMPONENT]`
951
951
 
@@ -974,7 +974,7 @@ EXAMPLES
974
974
  $ emb up
975
975
  ```
976
976
 
977
- _See code: [src/commands/up.ts](https://github.com/enspirit/emb/blob/v0.20.1/src/commands/up.ts)_
977
+ _See code: [src/commands/up.ts](https://github.com/enspirit/emb/blob/v0.21.0/src/commands/up.ts)_
978
978
 
979
979
  ## `emb update [CHANNEL]`
980
980
 
@@ -207,6 +207,14 @@
207
207
  "DockerImageConfig": {
208
208
  "type": "object",
209
209
  "properties": {
210
+ "image": {
211
+ "type": "string",
212
+ "description": "Image name (without project prefix or tag). Defaults to component name."
213
+ },
214
+ "tag": {
215
+ "type": "string",
216
+ "description": "Image tag. Defaults to defaults.docker.tag or 'latest'."
217
+ },
210
218
  "buildArgs": {
211
219
  "type": "object",
212
220
  "properties": {},
@@ -50,7 +50,7 @@ export class PushImagesOperation extends AbstractOperation {
50
50
  });
51
51
  return manager.run([
52
52
  {
53
- title: 'Push imags',
53
+ title: 'Push images',
54
54
  async task(ctx, task) {
55
55
  return task.newListr(tasks, {
56
56
  rendererOptions: {
@@ -19,22 +19,10 @@ class DockerImageResourceBuilder extends SentinelFileBasedBuilder {
19
19
  : buildContext.monorepo.join(buildContext.component.rootDir);
20
20
  }
21
21
  async getReference() {
22
- const configTag = this.config?.tag;
23
- let imageNamePart;
24
- let tagPart;
25
- if (configTag && configTag.includes(':')) {
26
- // config.tag contains both image name and tag (e.g., "myimage:v1.0.0")
27
- const colonIndex = configTag.lastIndexOf(':');
28
- imageNamePart = configTag.slice(0, colonIndex);
29
- tagPart = configTag.slice(colonIndex + 1);
30
- }
31
- else {
32
- // config.tag is just an image name or undefined
33
- imageNamePart = configTag || this.component.name;
34
- tagPart = this.monorepo.defaults.docker?.tag || 'latest';
35
- }
36
- const imageName = [this.monorepo.name, imageNamePart].join('/');
37
- return this.monorepo.expand(`${imageName}:${tagPart}`);
22
+ const imageName = this.config?.image || this.component.name;
23
+ const tag = this.config?.tag || this.monorepo.defaults.docker?.tag || 'latest';
24
+ const fullImageName = [this.monorepo.name, imageName].join('/');
25
+ return this.monorepo.expand(`${fullImageName}:${tag}`);
38
26
  }
39
27
  get monorepo() {
40
28
  return this.buildContext.monorepo;
@@ -53,6 +41,8 @@ class DockerImageResourceBuilder extends SentinelFileBasedBuilder {
53
41
  .withRelativePaths()
54
42
  .crawl(this.dockerContext)
55
43
  .withPromise();
44
+ // Build operation input - note that 'image' from config is only used for
45
+ // getReference(), it's not passed to the build operation
56
46
  const buildParams = {
57
47
  context: this.dockerContext,
58
48
  dockerfile: this.config?.dockerfile || 'Dockerfile',
@@ -29,8 +29,8 @@ export class OnePasswordPlugin extends AbstractPlugin {
29
29
  async init() {
30
30
  const resolvedConfig = this.resolveConfig();
31
31
  this.provider = new OnePasswordProvider(resolvedConfig);
32
- await this.provider.connect();
33
32
  // Register the provider with the global SecretManager
33
+ // Connection is lazy - op CLI is only checked when secrets are actually fetched
34
34
  const context = getContext();
35
35
  if (context?.secrets) {
36
36
  context.secrets.register('op', this.provider);
@@ -15,6 +15,7 @@ export interface OnePasswordProviderConfig {
15
15
  * 2. Service account token (CI/CD) - Via `OP_SERVICE_ACCOUNT_TOKEN` env var
16
16
  */
17
17
  export declare class OnePasswordProvider extends AbstractSecretProvider<OnePasswordProviderConfig> {
18
+ private connected;
18
19
  /**
19
20
  * Execute the `op` CLI command.
20
21
  * Protected to allow mocking in tests.
@@ -11,6 +11,7 @@ import { OnePasswordError } from './OnePasswordError.js';
11
11
  * 2. Service account token (CI/CD) - Via `OP_SERVICE_ACCOUNT_TOKEN` env var
12
12
  */
13
13
  export class OnePasswordProvider extends AbstractSecretProvider {
14
+ connected = false;
14
15
  /**
15
16
  * Execute the `op` CLI command.
16
17
  * Protected to allow mocking in tests.
@@ -20,12 +21,16 @@ export class OnePasswordProvider extends AbstractSecretProvider {
20
21
  return execFileAsync('op', args);
21
22
  }
22
23
  async connect() {
24
+ if (this.connected) {
25
+ return;
26
+ }
23
27
  try {
24
28
  const args = ['whoami'];
25
29
  if (this.config.account) {
26
30
  args.push('--account', this.config.account);
27
31
  }
28
32
  await this.execOp(args);
33
+ this.connected = true;
29
34
  }
30
35
  catch (error) {
31
36
  const err = error;
@@ -45,9 +50,12 @@ export class OnePasswordProvider extends AbstractSecretProvider {
45
50
  }
46
51
  }
47
52
  async disconnect() {
53
+ this.connected = false;
48
54
  this.clearCache();
49
55
  }
50
56
  async fetchSecret(ref) {
57
+ // Ensure we're connected before fetching (lazy initialization)
58
+ await this.connect();
51
59
  // Parse path as vault/item
52
60
  const slashIndex = ref.path.indexOf('/');
53
61
  if (slashIndex === -1) {