hereya-cli 0.56.0 → 0.57.1

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
@@ -20,7 +20,7 @@ $ npm install -g hereya-cli
20
20
  $ hereya COMMAND
21
21
  running command...
22
22
  $ hereya (--version)
23
- hereya-cli/0.56.0 linux-x64 node-v22.18.0
23
+ hereya-cli/0.57.1 linux-x64 node-v22.18.0
24
24
  $ hereya --help [COMMAND]
25
25
  USAGE
26
26
  $ hereya COMMAND
@@ -100,7 +100,7 @@ EXAMPLES
100
100
  $ hereya add cloudy/docker_postgres
101
101
  ```
102
102
 
103
- _See code: [src/commands/add/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/add/index.ts)_
103
+ _See code: [src/commands/add/index.ts](https://github.com/hereya/hereya-cli/blob/v0.57.1/src/commands/add/index.ts)_
104
104
 
105
105
  ## `hereya bootstrap INFRASTRUCTURETYPE`
106
106
 
@@ -125,7 +125,7 @@ EXAMPLES
125
125
  $ hereya bootstrap local
126
126
  ```
127
127
 
128
- _See code: [src/commands/bootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/bootstrap/index.ts)_
128
+ _See code: [src/commands/bootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.57.1/src/commands/bootstrap/index.ts)_
129
129
 
130
130
  ## `hereya config export-backend [FILE]`
131
131
 
@@ -147,7 +147,7 @@ EXAMPLES
147
147
  $ hereya config export-backend ./path/to/export.json
148
148
  ```
149
149
 
150
- _See code: [src/commands/config/export-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/config/export-backend/index.ts)_
150
+ _See code: [src/commands/config/export-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.57.1/src/commands/config/export-backend/index.ts)_
151
151
 
152
152
  ## `hereya config get-backend`
153
153
 
@@ -164,7 +164,7 @@ EXAMPLES
164
164
  $ hereya config get-backend
165
165
  ```
166
166
 
167
- _See code: [src/commands/config/get-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/config/get-backend/index.ts)_
167
+ _See code: [src/commands/config/get-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.57.1/src/commands/config/get-backend/index.ts)_
168
168
 
169
169
  ## `hereya config import-backend FILE`
170
170
 
@@ -184,7 +184,7 @@ EXAMPLES
184
184
  $ hereya config import-backend ./path/to/cloud-backend.json
185
185
  ```
186
186
 
187
- _See code: [src/commands/config/import-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/config/import-backend/index.ts)_
187
+ _See code: [src/commands/config/import-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.57.1/src/commands/config/import-backend/index.ts)_
188
188
 
189
189
  ## `hereya config use-backend TYPE`
190
190
 
@@ -206,7 +206,7 @@ EXAMPLES
206
206
  $ hereya config use-backend local
207
207
  ```
208
208
 
209
- _See code: [src/commands/config/use-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/config/use-backend/index.ts)_
209
+ _See code: [src/commands/config/use-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.57.1/src/commands/config/use-backend/index.ts)_
210
210
 
211
211
  ## `hereya delete-state`
212
212
 
@@ -232,7 +232,7 @@ EXAMPLES
232
232
  $ hereya delete-state --workspace staging
233
233
  ```
234
234
 
235
- _See code: [src/commands/delete-state/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/delete-state/index.ts)_
235
+ _See code: [src/commands/delete-state/index.ts](https://github.com/hereya/hereya-cli/blob/v0.57.1/src/commands/delete-state/index.ts)_
236
236
 
237
237
  ## `hereya deploy`
238
238
 
@@ -257,7 +257,7 @@ EXAMPLES
257
257
  $ hereya deploy
258
258
  ```
259
259
 
260
- _See code: [src/commands/deploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/deploy/index.ts)_
260
+ _See code: [src/commands/deploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.57.1/src/commands/deploy/index.ts)_
261
261
 
262
262
  ## `hereya doc PACKAGE`
263
263
 
@@ -290,7 +290,7 @@ EXAMPLES
290
290
  $ hereya doc my-package --no-doc
291
291
  ```
292
292
 
293
- _See code: [src/commands/doc/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/doc/index.ts)_
293
+ _See code: [src/commands/doc/index.ts](https://github.com/hereya/hereya-cli/blob/v0.57.1/src/commands/doc/index.ts)_
294
294
 
295
295
  ## `hereya down`
296
296
 
@@ -317,7 +317,7 @@ EXAMPLES
317
317
  $ hereya down
318
318
  ```
319
319
 
320
- _See code: [src/commands/down/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/down/index.ts)_
320
+ _See code: [src/commands/down/index.ts](https://github.com/hereya/hereya-cli/blob/v0.57.1/src/commands/down/index.ts)_
321
321
 
322
322
  ## `hereya env [NAME]`
323
323
 
@@ -348,7 +348,7 @@ EXAMPLES
348
348
  $ hereya env -w dev -l
349
349
  ```
350
350
 
351
- _See code: [src/commands/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/env/index.ts)_
351
+ _See code: [src/commands/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.57.1/src/commands/env/index.ts)_
352
352
 
353
353
  ## `hereya env set [NAME]`
354
354
 
@@ -375,7 +375,7 @@ EXAMPLES
375
375
  $ hereya env set FOO -v bar -w dev
376
376
  ```
377
377
 
378
- _See code: [src/commands/env/set/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/env/set/index.ts)_
378
+ _See code: [src/commands/env/set/index.ts](https://github.com/hereya/hereya-cli/blob/v0.57.1/src/commands/env/set/index.ts)_
379
379
 
380
380
  ## `hereya flow add PACKAGE`
381
381
 
@@ -413,7 +413,7 @@ EXAMPLES
413
413
  $ hereya flow add cloudy/docker_postgres -p DB_NAME=mydb -p DB_USER=admin
414
414
  ```
415
415
 
416
- _See code: [src/commands/flow/add/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/flow/add/index.ts)_
416
+ _See code: [src/commands/flow/add/index.ts](https://github.com/hereya/hereya-cli/blob/v0.57.1/src/commands/flow/add/index.ts)_
417
417
 
418
418
  ## `hereya flow down`
419
419
 
@@ -447,7 +447,7 @@ EXAMPLES
447
447
  $ hereya flow down --pin
448
448
  ```
449
449
 
450
- _See code: [src/commands/flow/down/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/flow/down/index.ts)_
450
+ _See code: [src/commands/flow/down/index.ts](https://github.com/hereya/hereya-cli/blob/v0.57.1/src/commands/flow/down/index.ts)_
451
451
 
452
452
  ## `hereya flow env [NAME]`
453
453
 
@@ -481,7 +481,7 @@ EXAMPLES
481
481
  $ hereya flow env -l
482
482
  ```
483
483
 
484
- _See code: [src/commands/flow/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/flow/env/index.ts)_
484
+ _See code: [src/commands/flow/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.57.1/src/commands/flow/env/index.ts)_
485
485
 
486
486
  ## `hereya flow remove PACKAGE`
487
487
 
@@ -511,7 +511,7 @@ EXAMPLES
511
511
  $ hereya flow remove cloudy/docker_postgres --profile staging
512
512
  ```
513
513
 
514
- _See code: [src/commands/flow/remove/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/flow/remove/index.ts)_
514
+ _See code: [src/commands/flow/remove/index.ts](https://github.com/hereya/hereya-cli/blob/v0.57.1/src/commands/flow/remove/index.ts)_
515
515
 
516
516
  ## `hereya flow run CMD`
517
517
 
@@ -540,7 +540,7 @@ EXAMPLES
540
540
  $ hereya flow run --pin -- npm test
541
541
  ```
542
542
 
543
- _See code: [src/commands/flow/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/flow/run/index.ts)_
543
+ _See code: [src/commands/flow/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.57.1/src/commands/flow/run/index.ts)_
544
544
 
545
545
  ## `hereya flow up`
546
546
 
@@ -574,7 +574,7 @@ EXAMPLES
574
574
  $ hereya flow up --pin
575
575
  ```
576
576
 
577
- _See code: [src/commands/flow/up/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/flow/up/index.ts)_
577
+ _See code: [src/commands/flow/up/index.ts](https://github.com/hereya/hereya-cli/blob/v0.57.1/src/commands/flow/up/index.ts)_
578
578
 
579
579
  ## `hereya help [COMMAND]`
580
580
 
@@ -631,7 +631,7 @@ EXAMPLES
631
631
  $ hereya import org/my-package -f state.tfstate -w my-workspace
632
632
  ```
633
633
 
634
- _See code: [src/commands/import/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/import/index.ts)_
634
+ _See code: [src/commands/import/index.ts](https://github.com/hereya/hereya-cli/blob/v0.57.1/src/commands/import/index.ts)_
635
635
 
636
636
  ## `hereya init PROJECT`
637
637
 
@@ -657,7 +657,7 @@ EXAMPLES
657
657
  $ hereya init myProject -w=defaultWorkspace --chdir=./myProject
658
658
  ```
659
659
 
660
- _See code: [src/commands/init/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/init/index.ts)_
660
+ _See code: [src/commands/init/index.ts](https://github.com/hereya/hereya-cli/blob/v0.57.1/src/commands/init/index.ts)_
661
661
 
662
662
  ## `hereya login [URL]`
663
663
 
@@ -686,7 +686,7 @@ EXAMPLES
686
686
  $ hereya login --token=your-token https://cloud.hereya.dev
687
687
  ```
688
688
 
689
- _See code: [src/commands/login/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/login/index.ts)_
689
+ _See code: [src/commands/login/index.ts](https://github.com/hereya/hereya-cli/blob/v0.57.1/src/commands/login/index.ts)_
690
690
 
691
691
  ## `hereya logout`
692
692
 
@@ -703,7 +703,7 @@ EXAMPLES
703
703
  $ hereya logout
704
704
  ```
705
705
 
706
- _See code: [src/commands/logout/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/logout/index.ts)_
706
+ _See code: [src/commands/logout/index.ts](https://github.com/hereya/hereya-cli/blob/v0.57.1/src/commands/logout/index.ts)_
707
707
 
708
708
  ## `hereya publish`
709
709
 
@@ -726,7 +726,7 @@ EXAMPLES
726
726
  $ hereya publish --chdir=/path/to/package
727
727
  ```
728
728
 
729
- _See code: [src/commands/publish/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/publish/index.ts)_
729
+ _See code: [src/commands/publish/index.ts](https://github.com/hereya/hereya-cli/blob/v0.57.1/src/commands/publish/index.ts)_
730
730
 
731
731
  ## `hereya remove PACKAGE`
732
732
 
@@ -754,7 +754,7 @@ EXAMPLES
754
754
  $ hereya remove cloudy/docker_postgres
755
755
  ```
756
756
 
757
- _See code: [src/commands/remove/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/remove/index.ts)_
757
+ _See code: [src/commands/remove/index.ts](https://github.com/hereya/hereya-cli/blob/v0.57.1/src/commands/remove/index.ts)_
758
758
 
759
759
  ## `hereya run CMD`
760
760
 
@@ -780,7 +780,7 @@ EXAMPLES
780
780
  $ hereya run -w uat -- node index.js
781
781
  ```
782
782
 
783
- _See code: [src/commands/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/run/index.ts)_
783
+ _See code: [src/commands/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.57.1/src/commands/run/index.ts)_
784
784
 
785
785
  ## `hereya unbootstrap INFRASTRUCTURETYPE`
786
786
 
@@ -805,7 +805,7 @@ EXAMPLES
805
805
  $ hereya unbootstrap local
806
806
  ```
807
807
 
808
- _See code: [src/commands/unbootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/unbootstrap/index.ts)_
808
+ _See code: [src/commands/unbootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.57.1/src/commands/unbootstrap/index.ts)_
809
809
 
810
810
  ## `hereya undeploy`
811
811
 
@@ -830,7 +830,7 @@ EXAMPLES
830
830
  $ hereya undeploy
831
831
  ```
832
832
 
833
- _See code: [src/commands/undeploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/undeploy/index.ts)_
833
+ _See code: [src/commands/undeploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.57.1/src/commands/undeploy/index.ts)_
834
834
 
835
835
  ## `hereya up`
836
836
 
@@ -857,7 +857,7 @@ EXAMPLES
857
857
  $ hereya up
858
858
  ```
859
859
 
860
- _See code: [src/commands/up/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/up/index.ts)_
860
+ _See code: [src/commands/up/index.ts](https://github.com/hereya/hereya-cli/blob/v0.57.1/src/commands/up/index.ts)_
861
861
 
862
862
  ## `hereya workspace create NAME`
863
863
 
@@ -882,7 +882,7 @@ EXAMPLES
882
882
  $ hereya workspace create dev
883
883
  ```
884
884
 
885
- _See code: [src/commands/workspace/create/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/workspace/create/index.ts)_
885
+ _See code: [src/commands/workspace/create/index.ts](https://github.com/hereya/hereya-cli/blob/v0.57.1/src/commands/workspace/create/index.ts)_
886
886
 
887
887
  ## `hereya workspace delete NAME`
888
888
 
@@ -902,7 +902,7 @@ EXAMPLES
902
902
  $ hereya workspace delete dev
903
903
  ```
904
904
 
905
- _See code: [src/commands/workspace/delete/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/workspace/delete/index.ts)_
905
+ _See code: [src/commands/workspace/delete/index.ts](https://github.com/hereya/hereya-cli/blob/v0.57.1/src/commands/workspace/delete/index.ts)_
906
906
 
907
907
  ## `hereya workspace env [NAME]`
908
908
 
@@ -928,7 +928,7 @@ EXAMPLES
928
928
  $ hereya workspace env myEnv -w dev
929
929
  ```
930
930
 
931
- _See code: [src/commands/workspace/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/workspace/env/index.ts)_
931
+ _See code: [src/commands/workspace/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.57.1/src/commands/workspace/env/index.ts)_
932
932
 
933
933
  ## `hereya workspace env set`
934
934
 
@@ -952,7 +952,7 @@ EXAMPLES
952
952
  $ hereya workspace env set -w my-workspace -n myVar -v my-value -i aws -s
953
953
  ```
954
954
 
955
- _See code: [src/commands/workspace/env/set/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/workspace/env/set/index.ts)_
955
+ _See code: [src/commands/workspace/env/set/index.ts](https://github.com/hereya/hereya-cli/blob/v0.57.1/src/commands/workspace/env/set/index.ts)_
956
956
 
957
957
  ## `hereya workspace env unset`
958
958
 
@@ -973,7 +973,7 @@ EXAMPLES
973
973
  $ hereya workspace env unset -w my-workspace -n myVar
974
974
  ```
975
975
 
976
- _See code: [src/commands/workspace/env/unset/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/workspace/env/unset/index.ts)_
976
+ _See code: [src/commands/workspace/env/unset/index.ts](https://github.com/hereya/hereya-cli/blob/v0.57.1/src/commands/workspace/env/unset/index.ts)_
977
977
 
978
978
  ## `hereya workspace install PACKAGE`
979
979
 
@@ -1000,7 +1000,7 @@ EXAMPLES
1000
1000
  $ hereya workspace install hereya/aws-cognito
1001
1001
  ```
1002
1002
 
1003
- _See code: [src/commands/workspace/install/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/workspace/install/index.ts)_
1003
+ _See code: [src/commands/workspace/install/index.ts](https://github.com/hereya/hereya-cli/blob/v0.57.1/src/commands/workspace/install/index.ts)_
1004
1004
 
1005
1005
  ## `hereya workspace list`
1006
1006
 
@@ -1017,7 +1017,7 @@ EXAMPLES
1017
1017
  $ hereya workspace list
1018
1018
  ```
1019
1019
 
1020
- _See code: [src/commands/workspace/list/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/workspace/list/index.ts)_
1020
+ _See code: [src/commands/workspace/list/index.ts](https://github.com/hereya/hereya-cli/blob/v0.57.1/src/commands/workspace/list/index.ts)_
1021
1021
 
1022
1022
  ## `hereya workspace set-profile PROFILE`
1023
1023
 
@@ -1041,7 +1041,7 @@ EXAMPLES
1041
1041
  $ hereya workspace set-profile prod-profile -w production
1042
1042
  ```
1043
1043
 
1044
- _See code: [src/commands/workspace/set-profile/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/workspace/set-profile/index.ts)_
1044
+ _See code: [src/commands/workspace/set-profile/index.ts](https://github.com/hereya/hereya-cli/blob/v0.57.1/src/commands/workspace/set-profile/index.ts)_
1045
1045
 
1046
1046
  ## `hereya workspace uninstall PACKAGE`
1047
1047
 
@@ -1068,5 +1068,5 @@ EXAMPLES
1068
1068
  $ hereya workspace uninstall hereya/aws-cognito
1069
1069
  ```
1070
1070
 
1071
- _See code: [src/commands/workspace/uninstall/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/workspace/uninstall/index.ts)_
1071
+ _See code: [src/commands/workspace/uninstall/index.ts](https://github.com/hereya/hereya-cli/blob/v0.57.1/src/commands/workspace/uninstall/index.ts)_
1072
1072
  <!-- commandsstop -->
@@ -49,9 +49,9 @@ export declare const WorkspaceSchema: z.ZodObject<{
49
49
  version: string;
50
50
  parameters?: Record<string, any> | undefined;
51
51
  }> | undefined;
52
+ profile?: string | undefined;
52
53
  isDeploy?: boolean | undefined;
53
54
  mirrorOf?: string | undefined;
54
- profile?: string | undefined;
55
55
  }, {
56
56
  name: string;
57
57
  id: string;
@@ -60,9 +60,9 @@ export declare const WorkspaceSchema: z.ZodObject<{
60
60
  version: string;
61
61
  parameters?: Record<string, any> | undefined;
62
62
  }> | undefined;
63
+ profile?: string | undefined;
63
64
  isDeploy?: boolean | undefined;
64
65
  mirrorOf?: string | undefined;
65
- profile?: string | undefined;
66
66
  }>;
67
67
  export type Workspace = z.infer<typeof WorkspaceSchema>;
68
68
  export type AddPackageToWorkspaceInput = {
@@ -147,8 +147,9 @@ export default class Add extends Command {
147
147
  const configManager = getConfigManager();
148
148
  await configManager.addPackage({
149
149
  metadata: ctx.provisionOutput.metadata,
150
- package: ctx.package,
150
+ package: ctx.provisionOutput.pkgName,
151
151
  projectRootDir,
152
+ version: ctx.provisionOutput.version,
152
153
  });
153
154
  await delay(500);
154
155
  },
@@ -54,8 +54,20 @@ export default class Deploy extends Command {
54
54
  async task(ctx) {
55
55
  // Config already loaded above for validation
56
56
  ctx.configOutput = loadConfigOutput;
57
- ctx.deployPackages = Object.keys(loadConfigOutput.config.deploy ?? {});
58
- ctx.packages = Object.keys(loadConfigOutput.config.packages ?? {});
57
+ // Get deploy packages with their versions
58
+ const deployPackages = loadConfigOutput.config.deploy ?? {};
59
+ ctx.deployPackages = Object.entries(deployPackages).map(([name, info]) => ({
60
+ name,
61
+ packageSpec: info.version ? `${name}@${info.version}` : name,
62
+ version: info.version || ''
63
+ }));
64
+ // Get regular packages with their versions
65
+ const packages = loadConfigOutput.config.packages ?? {};
66
+ ctx.packages = Object.entries(packages).map(([name, info]) => ({
67
+ name,
68
+ packageSpec: info.version ? `${name}@${info.version}` : name,
69
+ version: info.version || ''
70
+ }));
59
71
  ctx.workspace = flags.workspace;
60
72
  await delay(500);
61
73
  },
@@ -97,10 +109,24 @@ export default class Deploy extends Command {
97
109
  },
98
110
  {
99
111
  async task(ctx) {
100
- const savedDeployPackages = Object.keys(ctx.savedStateOutput?.config.deploy ?? {});
101
- ctx.removedDeployPackages = savedDeployPackages.filter((packageName) => !ctx.deployPackages.includes(packageName));
102
- const savedPackages = Object.keys(ctx.savedStateOutput?.config.packages ?? {});
103
- ctx.removedPackages = savedPackages.filter((packageName) => !ctx.packages.includes(packageName));
112
+ const savedDeployPackages = ctx.savedStateOutput?.config.deploy ?? {};
113
+ const currentDeployPackageNames = new Set(ctx.deployPackages.map(pkg => pkg.name));
114
+ ctx.removedDeployPackages = Object.entries(savedDeployPackages)
115
+ .filter(([name]) => !currentDeployPackageNames.has(name))
116
+ .map(([name, info]) => ({
117
+ name,
118
+ packageSpec: info.version ? `${name}@${info.version}` : name,
119
+ version: info.version || ''
120
+ }));
121
+ const savedPackages = ctx.savedStateOutput?.config.packages ?? {};
122
+ const currentPackageNames = new Set(ctx.packages.map(pkg => pkg.name));
123
+ ctx.removedPackages = Object.entries(savedPackages)
124
+ .filter(([name]) => !currentPackageNames.has(name))
125
+ .map(([name, info]) => ({
126
+ name,
127
+ packageSpec: info.version ? `${name}@${info.version}` : name,
128
+ version: info.version || ''
129
+ }));
104
130
  await delay(500);
105
131
  },
106
132
  title: 'Identifying removed packages',
@@ -108,7 +134,7 @@ export default class Deploy extends Command {
108
134
  {
109
135
  skip: (ctx) => ctx.removedDeployPackages.length === 0,
110
136
  task(ctx, task) {
111
- return task.newListr(ctx.removedDeployPackages.map((packageName) => ({
137
+ return task.newListr(ctx.removedDeployPackages.map((pkg) => ({
112
138
  rendererOptions: {
113
139
  persistentOutput: isDebug(),
114
140
  },
@@ -117,7 +143,7 @@ export default class Deploy extends Command {
117
143
  const backend = await getBackend();
118
144
  const profile = await getProfileFromWorkspace(backend, ctx.workspace, ctx.configOutput.config.project);
119
145
  const { parameters } = await parameterManager.getPackageParameters({
120
- package: packageName,
146
+ package: pkg.name,
121
147
  profile,
122
148
  projectRootDir,
123
149
  });
@@ -129,7 +155,7 @@ export default class Deploy extends Command {
129
155
  const destroyOutput = await executor.destroy({
130
156
  isDeploying: true,
131
157
  logger: getLogger(task),
132
- package: packageName,
158
+ package: pkg.packageSpec,
133
159
  parameters,
134
160
  project: ctx.configOutput.config.project,
135
161
  projectEnv: ctx.projectEnv,
@@ -140,7 +166,7 @@ export default class Deploy extends Command {
140
166
  throw new Error(destroyOutput.reason);
141
167
  }
142
168
  },
143
- title: `Destroying package ${packageName}`,
169
+ title: `Destroying package ${pkg.name}`,
144
170
  })), { concurrent: true, rendererOptions: { collapseSubtasks: !isDebug() } });
145
171
  },
146
172
  title: 'Destroying removed deployment packages',
@@ -148,7 +174,7 @@ export default class Deploy extends Command {
148
174
  {
149
175
  skip: (ctx) => ctx.removedPackages.length === 0,
150
176
  task(ctx, task) {
151
- return task.newListr(ctx.removedPackages.map((packageName) => ({
177
+ return task.newListr(ctx.removedPackages.map((pkg) => ({
152
178
  rendererOptions: {
153
179
  persistentOutput: isDebug(),
154
180
  },
@@ -157,7 +183,7 @@ export default class Deploy extends Command {
157
183
  const backend = await getBackend();
158
184
  const profile = await getProfileFromWorkspace(backend, ctx.workspace, ctx.configOutput.config.project);
159
185
  const { parameters } = await parameterManager.getPackageParameters({
160
- package: packageName,
186
+ package: pkg.name,
161
187
  profile,
162
188
  projectRootDir,
163
189
  });
@@ -169,7 +195,7 @@ export default class Deploy extends Command {
169
195
  const destroyOutput = await executor.destroy({
170
196
  isDeploying: true,
171
197
  logger: getLogger(task),
172
- package: packageName,
198
+ package: pkg.packageSpec,
173
199
  parameters,
174
200
  project: ctx.configOutput.config.project,
175
201
  projectRootDir,
@@ -180,10 +206,10 @@ export default class Deploy extends Command {
180
206
  }
181
207
  const { env, metadata } = destroyOutput;
182
208
  const output = ctx.removed || [];
183
- output.push({ env, metadata, packageName });
209
+ output.push({ env, metadata, packageName: pkg.name });
184
210
  ctx.removed = output;
185
211
  },
186
- title: `Destroying ${packageName}`,
212
+ title: `Destroying ${pkg.name}`,
187
213
  })), { concurrent: true, rendererOptions: { collapseSubtasks: !isDebug() } });
188
214
  },
189
215
  title: 'Destroying removed packages',
@@ -194,7 +220,7 @@ export default class Deploy extends Command {
194
220
  if (!ctx.packages || ctx.packages.length === 0) {
195
221
  return;
196
222
  }
197
- return task.newListr(ctx.packages.map((packageName) => ({
223
+ return task.newListr(ctx.packages.map((pkg) => ({
198
224
  rendererOptions: {
199
225
  persistentOutput: isDebug(),
200
226
  },
@@ -203,7 +229,7 @@ export default class Deploy extends Command {
203
229
  const backend = await getBackend();
204
230
  const profile = await getProfileFromWorkspace(backend, ctx.workspace, ctx.configOutput.config.project);
205
231
  const { parameters } = await parameterManager.getPackageParameters({
206
- package: packageName,
232
+ package: pkg.name,
207
233
  profile,
208
234
  projectRootDir,
209
235
  });
@@ -215,7 +241,7 @@ export default class Deploy extends Command {
215
241
  const provisionOutput = await executor.provision({
216
242
  isDeploying: true,
217
243
  logger: getLogger(task),
218
- package: packageName,
244
+ package: pkg.packageSpec,
219
245
  parameters,
220
246
  project: ctx.configOutput.config.project,
221
247
  projectRootDir,
@@ -226,10 +252,10 @@ export default class Deploy extends Command {
226
252
  }
227
253
  const { env, metadata } = provisionOutput;
228
254
  const output = ctx.added || [];
229
- output.push({ env, metadata, packageName });
255
+ output.push({ env, metadata, packageName: pkg.name });
230
256
  ctx.added = output;
231
257
  },
232
- title: `Provisioning ${packageName}`,
258
+ title: `Provisioning ${pkg.name}`,
233
259
  })), { concurrent: true, rendererOptions: { collapseSubtasks: !isDebug() } });
234
260
  },
235
261
  title: `Provisioning packages`,
@@ -300,7 +326,7 @@ export default class Deploy extends Command {
300
326
  throw new Error(getProjectEnvOutput.reason);
301
327
  }
302
328
  const { env: projectEnv } = getProjectEnvOutput;
303
- return task.newListr(ctx.deployPackages.map((packageName) => ({
329
+ return task.newListr(ctx.deployPackages.map((pkg) => ({
304
330
  rendererOptions: {
305
331
  persistentOutput: isDebug(),
306
332
  },
@@ -309,7 +335,7 @@ export default class Deploy extends Command {
309
335
  const backend = await getBackend();
310
336
  const profile = await getProfileFromWorkspace(backend, ctx.workspace, ctx.configOutput.config.project);
311
337
  const { parameters } = await parameterManager.getPackageParameters({
312
- package: packageName,
338
+ package: pkg.name,
313
339
  profile,
314
340
  projectRootDir,
315
341
  });
@@ -321,7 +347,7 @@ export default class Deploy extends Command {
321
347
  const provisionOutput = await executor.provision({
322
348
  isDeploying: true,
323
349
  logger: getLogger(task),
324
- package: packageName,
350
+ package: pkg.packageSpec,
325
351
  parameters,
326
352
  project: ctx.configOutput.config.project,
327
353
  projectEnv,
@@ -335,7 +361,7 @@ export default class Deploy extends Command {
335
361
  .map(([key, value]) => `${key}=${value}`)
336
362
  .join('\n'));
337
363
  },
338
- title: `Provisioning package ${packageName}`,
364
+ title: `Provisioning package ${pkg.name}`,
339
365
  })), { concurrent: true, rendererOptions: { collapseSubtasks: !isDebug() } });
340
366
  },
341
367
  title: 'Provisioning deployment packages',