hereya-cli 0.51.0 → 0.52.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
@@ -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.51.0 linux-x64 node-v22.17.1
23
+ hereya-cli/0.52.0 linux-x64 node-v22.17.1
24
24
  $ hereya --help [COMMAND]
25
25
  USAGE
26
26
  $ hereya COMMAND
@@ -98,7 +98,7 @@ EXAMPLES
98
98
  $ hereya add cloudy/docker_postgres
99
99
  ```
100
100
 
101
- _See code: [src/commands/add/index.ts](https://github.com/hereya/hereya-cli/blob/v0.51.0/src/commands/add/index.ts)_
101
+ _See code: [src/commands/add/index.ts](https://github.com/hereya/hereya-cli/blob/v0.52.0/src/commands/add/index.ts)_
102
102
 
103
103
  ## `hereya bootstrap INFRASTRUCTURETYPE`
104
104
 
@@ -123,7 +123,7 @@ EXAMPLES
123
123
  $ hereya bootstrap local
124
124
  ```
125
125
 
126
- _See code: [src/commands/bootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.51.0/src/commands/bootstrap/index.ts)_
126
+ _See code: [src/commands/bootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.52.0/src/commands/bootstrap/index.ts)_
127
127
 
128
128
  ## `hereya config export-backend [FILE]`
129
129
 
@@ -145,7 +145,7 @@ EXAMPLES
145
145
  $ hereya config export-backend ./path/to/export.json
146
146
  ```
147
147
 
148
- _See code: [src/commands/config/export-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.51.0/src/commands/config/export-backend/index.ts)_
148
+ _See code: [src/commands/config/export-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.52.0/src/commands/config/export-backend/index.ts)_
149
149
 
150
150
  ## `hereya config get-backend`
151
151
 
@@ -162,7 +162,7 @@ EXAMPLES
162
162
  $ hereya config get-backend
163
163
  ```
164
164
 
165
- _See code: [src/commands/config/get-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.51.0/src/commands/config/get-backend/index.ts)_
165
+ _See code: [src/commands/config/get-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.52.0/src/commands/config/get-backend/index.ts)_
166
166
 
167
167
  ## `hereya config import-backend FILE`
168
168
 
@@ -182,7 +182,7 @@ EXAMPLES
182
182
  $ hereya config import-backend ./path/to/cloud-backend.json
183
183
  ```
184
184
 
185
- _See code: [src/commands/config/import-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.51.0/src/commands/config/import-backend/index.ts)_
185
+ _See code: [src/commands/config/import-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.52.0/src/commands/config/import-backend/index.ts)_
186
186
 
187
187
  ## `hereya config use-backend TYPE`
188
188
 
@@ -204,7 +204,7 @@ EXAMPLES
204
204
  $ hereya config use-backend local
205
205
  ```
206
206
 
207
- _See code: [src/commands/config/use-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.51.0/src/commands/config/use-backend/index.ts)_
207
+ _See code: [src/commands/config/use-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.52.0/src/commands/config/use-backend/index.ts)_
208
208
 
209
209
  ## `hereya delete-state`
210
210
 
@@ -230,7 +230,7 @@ EXAMPLES
230
230
  $ hereya delete-state --workspace staging
231
231
  ```
232
232
 
233
- _See code: [src/commands/delete-state/index.ts](https://github.com/hereya/hereya-cli/blob/v0.51.0/src/commands/delete-state/index.ts)_
233
+ _See code: [src/commands/delete-state/index.ts](https://github.com/hereya/hereya-cli/blob/v0.52.0/src/commands/delete-state/index.ts)_
234
234
 
235
235
  ## `hereya deploy`
236
236
 
@@ -255,7 +255,7 @@ EXAMPLES
255
255
  $ hereya deploy
256
256
  ```
257
257
 
258
- _See code: [src/commands/deploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.51.0/src/commands/deploy/index.ts)_
258
+ _See code: [src/commands/deploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.52.0/src/commands/deploy/index.ts)_
259
259
 
260
260
  ## `hereya down`
261
261
 
@@ -282,7 +282,7 @@ EXAMPLES
282
282
  $ hereya down
283
283
  ```
284
284
 
285
- _See code: [src/commands/down/index.ts](https://github.com/hereya/hereya-cli/blob/v0.51.0/src/commands/down/index.ts)_
285
+ _See code: [src/commands/down/index.ts](https://github.com/hereya/hereya-cli/blob/v0.52.0/src/commands/down/index.ts)_
286
286
 
287
287
  ## `hereya env [NAME]`
288
288
 
@@ -313,7 +313,7 @@ EXAMPLES
313
313
  $ hereya env -w dev -l
314
314
  ```
315
315
 
316
- _See code: [src/commands/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.51.0/src/commands/env/index.ts)_
316
+ _See code: [src/commands/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.52.0/src/commands/env/index.ts)_
317
317
 
318
318
  ## `hereya env set [NAME]`
319
319
 
@@ -340,7 +340,7 @@ EXAMPLES
340
340
  $ hereya env set FOO -v bar -w dev
341
341
  ```
342
342
 
343
- _See code: [src/commands/env/set/index.ts](https://github.com/hereya/hereya-cli/blob/v0.51.0/src/commands/env/set/index.ts)_
343
+ _See code: [src/commands/env/set/index.ts](https://github.com/hereya/hereya-cli/blob/v0.52.0/src/commands/env/set/index.ts)_
344
344
 
345
345
  ## `hereya flow add PACKAGE`
346
346
 
@@ -378,7 +378,7 @@ EXAMPLES
378
378
  $ hereya flow add cloudy/docker_postgres -p DB_NAME=mydb -p DB_USER=admin
379
379
  ```
380
380
 
381
- _See code: [src/commands/flow/add/index.ts](https://github.com/hereya/hereya-cli/blob/v0.51.0/src/commands/flow/add/index.ts)_
381
+ _See code: [src/commands/flow/add/index.ts](https://github.com/hereya/hereya-cli/blob/v0.52.0/src/commands/flow/add/index.ts)_
382
382
 
383
383
  ## `hereya flow down`
384
384
 
@@ -412,7 +412,7 @@ EXAMPLES
412
412
  $ hereya flow down --pin
413
413
  ```
414
414
 
415
- _See code: [src/commands/flow/down/index.ts](https://github.com/hereya/hereya-cli/blob/v0.51.0/src/commands/flow/down/index.ts)_
415
+ _See code: [src/commands/flow/down/index.ts](https://github.com/hereya/hereya-cli/blob/v0.52.0/src/commands/flow/down/index.ts)_
416
416
 
417
417
  ## `hereya flow env [NAME]`
418
418
 
@@ -446,7 +446,7 @@ EXAMPLES
446
446
  $ hereya flow env -l
447
447
  ```
448
448
 
449
- _See code: [src/commands/flow/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.51.0/src/commands/flow/env/index.ts)_
449
+ _See code: [src/commands/flow/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.52.0/src/commands/flow/env/index.ts)_
450
450
 
451
451
  ## `hereya flow remove PACKAGE`
452
452
 
@@ -476,7 +476,7 @@ EXAMPLES
476
476
  $ hereya flow remove cloudy/docker_postgres --profile staging
477
477
  ```
478
478
 
479
- _See code: [src/commands/flow/remove/index.ts](https://github.com/hereya/hereya-cli/blob/v0.51.0/src/commands/flow/remove/index.ts)_
479
+ _See code: [src/commands/flow/remove/index.ts](https://github.com/hereya/hereya-cli/blob/v0.52.0/src/commands/flow/remove/index.ts)_
480
480
 
481
481
  ## `hereya flow run CMD`
482
482
 
@@ -505,7 +505,7 @@ EXAMPLES
505
505
  $ hereya flow run --pin -- npm test
506
506
  ```
507
507
 
508
- _See code: [src/commands/flow/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.51.0/src/commands/flow/run/index.ts)_
508
+ _See code: [src/commands/flow/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.52.0/src/commands/flow/run/index.ts)_
509
509
 
510
510
  ## `hereya flow up`
511
511
 
@@ -539,7 +539,7 @@ EXAMPLES
539
539
  $ hereya flow up --pin
540
540
  ```
541
541
 
542
- _See code: [src/commands/flow/up/index.ts](https://github.com/hereya/hereya-cli/blob/v0.51.0/src/commands/flow/up/index.ts)_
542
+ _See code: [src/commands/flow/up/index.ts](https://github.com/hereya/hereya-cli/blob/v0.52.0/src/commands/flow/up/index.ts)_
543
543
 
544
544
  ## `hereya help [COMMAND]`
545
545
 
@@ -596,7 +596,7 @@ EXAMPLES
596
596
  $ hereya import org/my-package -f state.tfstate -w my-workspace
597
597
  ```
598
598
 
599
- _See code: [src/commands/import/index.ts](https://github.com/hereya/hereya-cli/blob/v0.51.0/src/commands/import/index.ts)_
599
+ _See code: [src/commands/import/index.ts](https://github.com/hereya/hereya-cli/blob/v0.52.0/src/commands/import/index.ts)_
600
600
 
601
601
  ## `hereya init PROJECT`
602
602
 
@@ -622,7 +622,7 @@ EXAMPLES
622
622
  $ hereya init myProject -w=defaultWorkspace --chdir=./myProject
623
623
  ```
624
624
 
625
- _See code: [src/commands/init/index.ts](https://github.com/hereya/hereya-cli/blob/v0.51.0/src/commands/init/index.ts)_
625
+ _See code: [src/commands/init/index.ts](https://github.com/hereya/hereya-cli/blob/v0.52.0/src/commands/init/index.ts)_
626
626
 
627
627
  ## `hereya login [URL]`
628
628
 
@@ -651,7 +651,7 @@ EXAMPLES
651
651
  $ hereya login --token=your-token https://cloud.hereya.dev
652
652
  ```
653
653
 
654
- _See code: [src/commands/login/index.ts](https://github.com/hereya/hereya-cli/blob/v0.51.0/src/commands/login/index.ts)_
654
+ _See code: [src/commands/login/index.ts](https://github.com/hereya/hereya-cli/blob/v0.52.0/src/commands/login/index.ts)_
655
655
 
656
656
  ## `hereya logout`
657
657
 
@@ -668,7 +668,7 @@ EXAMPLES
668
668
  $ hereya logout
669
669
  ```
670
670
 
671
- _See code: [src/commands/logout/index.ts](https://github.com/hereya/hereya-cli/blob/v0.51.0/src/commands/logout/index.ts)_
671
+ _See code: [src/commands/logout/index.ts](https://github.com/hereya/hereya-cli/blob/v0.52.0/src/commands/logout/index.ts)_
672
672
 
673
673
  ## `hereya remove PACKAGE`
674
674
 
@@ -696,7 +696,7 @@ EXAMPLES
696
696
  $ hereya remove cloudy/docker_postgres
697
697
  ```
698
698
 
699
- _See code: [src/commands/remove/index.ts](https://github.com/hereya/hereya-cli/blob/v0.51.0/src/commands/remove/index.ts)_
699
+ _See code: [src/commands/remove/index.ts](https://github.com/hereya/hereya-cli/blob/v0.52.0/src/commands/remove/index.ts)_
700
700
 
701
701
  ## `hereya run CMD`
702
702
 
@@ -722,7 +722,7 @@ EXAMPLES
722
722
  $ hereya run -w uat -- node index.js
723
723
  ```
724
724
 
725
- _See code: [src/commands/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.51.0/src/commands/run/index.ts)_
725
+ _See code: [src/commands/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.52.0/src/commands/run/index.ts)_
726
726
 
727
727
  ## `hereya unbootstrap INFRASTRUCTURETYPE`
728
728
 
@@ -747,7 +747,7 @@ EXAMPLES
747
747
  $ hereya unbootstrap local
748
748
  ```
749
749
 
750
- _See code: [src/commands/unbootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.51.0/src/commands/unbootstrap/index.ts)_
750
+ _See code: [src/commands/unbootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.52.0/src/commands/unbootstrap/index.ts)_
751
751
 
752
752
  ## `hereya undeploy`
753
753
 
@@ -772,7 +772,7 @@ EXAMPLES
772
772
  $ hereya undeploy
773
773
  ```
774
774
 
775
- _See code: [src/commands/undeploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.51.0/src/commands/undeploy/index.ts)_
775
+ _See code: [src/commands/undeploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.52.0/src/commands/undeploy/index.ts)_
776
776
 
777
777
  ## `hereya up`
778
778
 
@@ -799,7 +799,7 @@ EXAMPLES
799
799
  $ hereya up
800
800
  ```
801
801
 
802
- _See code: [src/commands/up/index.ts](https://github.com/hereya/hereya-cli/blob/v0.51.0/src/commands/up/index.ts)_
802
+ _See code: [src/commands/up/index.ts](https://github.com/hereya/hereya-cli/blob/v0.52.0/src/commands/up/index.ts)_
803
803
 
804
804
  ## `hereya workspace create NAME`
805
805
 
@@ -807,14 +807,15 @@ Create a new workspace if it does not exist.
807
807
 
808
808
  ```
809
809
  USAGE
810
- $ hereya workspace create NAME [--mirror <value>] [--profile <value>]
810
+ $ hereya workspace create NAME [-d] [--mirror <value>] [--profile <value>]
811
811
 
812
812
  ARGUMENTS
813
813
  NAME name of the workspace to create
814
814
 
815
815
  FLAGS
816
- --mirror=<value> workspace to mirror
817
- --profile=<value> workspace profile to set (cloud backend only)
816
+ -d, --deployment mark workspace as a deployment workspace
817
+ --mirror=<value> workspace to mirror
818
+ --profile=<value> workspace profile to set (cloud backend only)
818
819
 
819
820
  DESCRIPTION
820
821
  Create a new workspace if it does not exist.
@@ -823,7 +824,7 @@ EXAMPLES
823
824
  $ hereya workspace create dev
824
825
  ```
825
826
 
826
- _See code: [src/commands/workspace/create/index.ts](https://github.com/hereya/hereya-cli/blob/v0.51.0/src/commands/workspace/create/index.ts)_
827
+ _See code: [src/commands/workspace/create/index.ts](https://github.com/hereya/hereya-cli/blob/v0.52.0/src/commands/workspace/create/index.ts)_
827
828
 
828
829
  ## `hereya workspace delete NAME`
829
830
 
@@ -843,7 +844,7 @@ EXAMPLES
843
844
  $ hereya workspace delete dev
844
845
  ```
845
846
 
846
- _See code: [src/commands/workspace/delete/index.ts](https://github.com/hereya/hereya-cli/blob/v0.51.0/src/commands/workspace/delete/index.ts)_
847
+ _See code: [src/commands/workspace/delete/index.ts](https://github.com/hereya/hereya-cli/blob/v0.52.0/src/commands/workspace/delete/index.ts)_
847
848
 
848
849
  ## `hereya workspace env [NAME]`
849
850
 
@@ -869,7 +870,7 @@ EXAMPLES
869
870
  $ hereya workspace env myEnv -w dev
870
871
  ```
871
872
 
872
- _See code: [src/commands/workspace/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.51.0/src/commands/workspace/env/index.ts)_
873
+ _See code: [src/commands/workspace/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.52.0/src/commands/workspace/env/index.ts)_
873
874
 
874
875
  ## `hereya workspace env set`
875
876
 
@@ -893,7 +894,7 @@ EXAMPLES
893
894
  $ hereya workspace env set -w my-workspace -n myVar -v my-value -i aws -s
894
895
  ```
895
896
 
896
- _See code: [src/commands/workspace/env/set/index.ts](https://github.com/hereya/hereya-cli/blob/v0.51.0/src/commands/workspace/env/set/index.ts)_
897
+ _See code: [src/commands/workspace/env/set/index.ts](https://github.com/hereya/hereya-cli/blob/v0.52.0/src/commands/workspace/env/set/index.ts)_
897
898
 
898
899
  ## `hereya workspace env unset`
899
900
 
@@ -914,7 +915,7 @@ EXAMPLES
914
915
  $ hereya workspace env unset -w my-workspace -n myVar
915
916
  ```
916
917
 
917
- _See code: [src/commands/workspace/env/unset/index.ts](https://github.com/hereya/hereya-cli/blob/v0.51.0/src/commands/workspace/env/unset/index.ts)_
918
+ _See code: [src/commands/workspace/env/unset/index.ts](https://github.com/hereya/hereya-cli/blob/v0.52.0/src/commands/workspace/env/unset/index.ts)_
918
919
 
919
920
  ## `hereya workspace install PACKAGE`
920
921
 
@@ -941,7 +942,7 @@ EXAMPLES
941
942
  $ hereya workspace install hereya/aws-cognito
942
943
  ```
943
944
 
944
- _See code: [src/commands/workspace/install/index.ts](https://github.com/hereya/hereya-cli/blob/v0.51.0/src/commands/workspace/install/index.ts)_
945
+ _See code: [src/commands/workspace/install/index.ts](https://github.com/hereya/hereya-cli/blob/v0.52.0/src/commands/workspace/install/index.ts)_
945
946
 
946
947
  ## `hereya workspace list`
947
948
 
@@ -958,30 +959,31 @@ EXAMPLES
958
959
  $ hereya workspace list
959
960
  ```
960
961
 
961
- _See code: [src/commands/workspace/list/index.ts](https://github.com/hereya/hereya-cli/blob/v0.51.0/src/commands/workspace/list/index.ts)_
962
+ _See code: [src/commands/workspace/list/index.ts](https://github.com/hereya/hereya-cli/blob/v0.52.0/src/commands/workspace/list/index.ts)_
962
963
 
963
964
  ## `hereya workspace set-profile PROFILE`
964
965
 
965
- Set AWS profile for a workspace (cloud backend only).
966
+ Set AWS profile and deployment status for a workspace (cloud backend only).
966
967
 
967
968
  ```
968
969
  USAGE
969
- $ hereya workspace set-profile PROFILE -w <value>
970
+ $ hereya workspace set-profile PROFILE -w <value> [-d]
970
971
 
971
972
  ARGUMENTS
972
973
  PROFILE AWS profile name to set for the workspace
973
974
 
974
975
  FLAGS
976
+ -d, --[no-]deployment mark workspace as a deployment workspace (use --no-deployment to unset)
975
977
  -w, --workspace=<value> (required) workspace name
976
978
 
977
979
  DESCRIPTION
978
- Set AWS profile for a workspace (cloud backend only).
980
+ Set AWS profile and deployment status for a workspace (cloud backend only).
979
981
 
980
982
  EXAMPLES
981
983
  $ hereya workspace set-profile prod-profile -w production
982
984
  ```
983
985
 
984
- _See code: [src/commands/workspace/set-profile/index.ts](https://github.com/hereya/hereya-cli/blob/v0.51.0/src/commands/workspace/set-profile/index.ts)_
986
+ _See code: [src/commands/workspace/set-profile/index.ts](https://github.com/hereya/hereya-cli/blob/v0.52.0/src/commands/workspace/set-profile/index.ts)_
985
987
 
986
988
  ## `hereya workspace uninstall PACKAGE`
987
989
 
@@ -1008,5 +1010,5 @@ EXAMPLES
1008
1010
  $ hereya workspace uninstall hereya/aws-cognito
1009
1011
  ```
1010
1012
 
1011
- _See code: [src/commands/workspace/uninstall/index.ts](https://github.com/hereya/hereya-cli/blob/v0.51.0/src/commands/workspace/uninstall/index.ts)_
1013
+ _See code: [src/commands/workspace/uninstall/index.ts](https://github.com/hereya/hereya-cli/blob/v0.52.0/src/commands/workspace/uninstall/index.ts)_
1012
1014
  <!-- commandsstop -->
@@ -40,6 +40,9 @@ export class CloudBackend {
40
40
  if (input.profile) {
41
41
  formData.append('profile', input.profile);
42
42
  }
43
+ if (input.isDeploy !== undefined) {
44
+ formData.append('isDeploy', String(input.isDeploy));
45
+ }
43
46
  const response = await fetch(`${this.config.url}/api/workspaces`, {
44
47
  body: formData,
45
48
  headers: {
@@ -377,6 +380,9 @@ export class CloudBackend {
377
380
  if (input.profile !== undefined) {
378
381
  formData.append('profile', input.profile === null ? '' : input.profile);
379
382
  }
383
+ if (input.isDeploy !== undefined) {
384
+ formData.append('isDeploy', input.isDeploy === null ? '' : String(input.isDeploy));
385
+ }
380
386
  const response = await fetch(`${this.config.url}/api/workspaces/${encodeURIComponent(input.name)}`, {
381
387
  body: formData,
382
388
  headers: {
@@ -424,6 +430,7 @@ export class CloudBackend {
424
430
  return {
425
431
  env,
426
432
  id: workspace.id,
433
+ isDeploy: workspace.isDeploy,
427
434
  mirrorOf: workspace.mirrorOf?.name,
428
435
  name: workspace.name,
429
436
  packages,
@@ -23,6 +23,7 @@ export interface Backend {
23
23
  export declare const WorkspaceSchema: z.ZodObject<{
24
24
  env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
25
25
  id: z.ZodString;
26
+ isDeploy: z.ZodOptional<z.ZodBoolean>;
26
27
  mirrorOf: z.ZodOptional<z.ZodString>;
27
28
  name: z.ZodString;
28
29
  packages: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
@@ -44,6 +45,7 @@ export declare const WorkspaceSchema: z.ZodObject<{
44
45
  version: string;
45
46
  parameters?: Record<string, any> | undefined;
46
47
  }> | undefined;
48
+ isDeploy?: boolean | undefined;
47
49
  mirrorOf?: string | undefined;
48
50
  profile?: string | undefined;
49
51
  }, {
@@ -54,6 +56,7 @@ export declare const WorkspaceSchema: z.ZodObject<{
54
56
  version: string;
55
57
  parameters?: Record<string, any> | undefined;
56
58
  }> | undefined;
59
+ isDeploy?: boolean | undefined;
57
60
  mirrorOf?: string | undefined;
58
61
  profile?: string | undefined;
59
62
  }>;
@@ -93,6 +96,7 @@ export interface InitProjectOutput {
93
96
  };
94
97
  }
95
98
  export interface CreateWorkspaceInput {
99
+ isDeploy?: boolean;
96
100
  mirrorOf?: string;
97
101
  name: string;
98
102
  profile?: string;
@@ -212,6 +216,7 @@ export type UnsetEnvVarInput = {
212
216
  };
213
217
  export type UnsetEnvVarOutput = SetEnvVarOutput;
214
218
  export type UpdateWorkspaceInput = {
219
+ isDeploy?: boolean | null;
215
220
  name: string;
216
221
  profile?: null | string;
217
222
  };
@@ -2,6 +2,7 @@ import { z } from 'zod';
2
2
  export const WorkspaceSchema = z.object({
3
3
  env: z.record(z.string()).optional(),
4
4
  id: z.string().min(2),
5
+ isDeploy: z.boolean().optional(),
5
6
  mirrorOf: z.string().optional(),
6
7
  name: z.string().min(2),
7
8
  packages: z
@@ -86,6 +86,7 @@ export class FileBackend {
86
86
  }
87
87
  const workspace = {
88
88
  id: input.name,
89
+ isDeploy: input.isDeploy,
89
90
  mirrorOf: input.mirrorOf,
90
91
  name: input.name,
91
92
  };
@@ -10,6 +10,7 @@ import { arrayOfStringToObject } from '../../lib/object-utils.js';
10
10
  import { getParameterManager } from '../../lib/parameter/index.js';
11
11
  import { getProfileFromWorkspace } from '../../lib/profile-utils.js';
12
12
  import { delay } from '../../lib/shell.js';
13
+ import { validateDevelopmentWorkspace } from '../../lib/workspace-validation.js';
13
14
  export default class Add extends Command {
14
15
  static args = {
15
16
  package: Args.string({
@@ -73,6 +74,12 @@ export default class Add extends Command {
73
74
  ctx.configOutput = loadConfigOutput;
74
75
  // Use workspace from flag if provided, otherwise use config workspace
75
76
  ctx.workspace = flags.workspace || loadConfigOutput.config.workspace;
77
+ // Validate that the workspace is a development workspace
78
+ const backend = await getBackend();
79
+ const validation = await validateDevelopmentWorkspace(ctx.workspace, backend, 'add');
80
+ if (!validation.isValid) {
81
+ throw new Error(validation.message);
82
+ }
76
83
  task.output = `Loaded project config`;
77
84
  await delay(500);
78
85
  },
@@ -9,6 +9,7 @@ import { getLogger, getLogPath, isDebug, setDebug } from '../../lib/log.js';
9
9
  import { getParameterManager } from '../../lib/parameter/index.js';
10
10
  import { getProfileFromWorkspace } from '../../lib/profile-utils.js';
11
11
  import { delay } from '../../lib/shell.js';
12
+ import { validateDeploymentWorkspace } from '../../lib/workspace-validation.js';
12
13
  export default class Deploy extends Command {
13
14
  static description = 'Deploy a hereya project using the project deployment package';
14
15
  static examples = ['<%= config.bin %> <%= command.id %>'];
@@ -35,6 +36,12 @@ export default class Deploy extends Command {
35
36
  const { flags } = await this.parse(Deploy);
36
37
  setDebug(flags.debug);
37
38
  const projectRootDir = path.resolve(flags.chdir || process.env.HEREYA_PROJECT_ROOT_DIR || process.cwd());
39
+ // Validate that the workspace is a deployment workspace
40
+ const backend = await getBackend();
41
+ const validation = await validateDeploymentWorkspace(flags.workspace, backend, 'deploy');
42
+ if (!validation.isValid) {
43
+ this.error(validation.message);
44
+ }
38
45
  const myLogger = new ListrLogger({ useIcons: false });
39
46
  const task = new Listr([
40
47
  {
@@ -8,6 +8,7 @@ import { getLogger, getLogPath, isDebug, setDebug } from '../../lib/log.js';
8
8
  import { getParameterManager } from '../../lib/parameter/index.js';
9
9
  import { getProfileFromWorkspace } from '../../lib/profile-utils.js';
10
10
  import { delay } from '../../lib/shell.js';
11
+ import { validateDevelopmentWorkspace } from '../../lib/workspace-validation.js';
11
12
  export default class Down extends Command {
12
13
  static description = 'Destroy all packages in the project.';
13
14
  static examples = ['<%= config.bin %> <%= command.id %>'];
@@ -58,6 +59,12 @@ export default class Down extends Command {
58
59
  }
59
60
  ctx.configOutput = loadConfigOutput;
60
61
  ctx.workspace = flags.workspace || loadConfigOutput.config.workspace;
62
+ // Validate that the workspace is a development workspace
63
+ const backend = await getBackend();
64
+ const validation = await validateDevelopmentWorkspace(ctx.workspace, backend, 'down');
65
+ if (!validation.isValid) {
66
+ throw new Error(validation.message);
67
+ }
61
68
  await delay(500);
62
69
  },
63
70
  title: 'Loading project config',
@@ -1,7 +1,9 @@
1
1
  import { Args, Command, Flags } from '@oclif/core';
2
+ import { getBackend } from '../../../backend/index.js';
2
3
  import { getConfigManager } from '../../../lib/config/index.js';
3
4
  import { buildFlowWorkspaceName } from '../../../lib/flow-utils.js';
4
5
  import { setDebug } from '../../../lib/log.js';
6
+ import { validateFlowCommand } from '../../../lib/workspace-validation.js';
5
7
  import Add from '../../add/index.js';
6
8
  import WorkspaceCreate from '../../workspace/create/index.js';
7
9
  export default class FlowAdd extends Command {
@@ -62,6 +64,12 @@ export default class FlowAdd extends Command {
62
64
  project: loadConfigOutput.config.project,
63
65
  projectRootDir,
64
66
  });
67
+ // Validate that if workspace exists, it's not a deployment workspace
68
+ const backend = await getBackend();
69
+ const validation = await validateFlowCommand(workspaceName, backend);
70
+ if (!validation.isValid) {
71
+ this.error(validation.message);
72
+ }
65
73
  // Import workspace resolution utility
66
74
  const { resolveWorkspaceName } = await import('../../../lib/workspace-utils.js');
67
75
  // Resolve mirror workspace name with org prefix
@@ -1,7 +1,9 @@
1
1
  import { Command, Flags } from '@oclif/core';
2
+ import { getBackend } from '../../../backend/index.js';
2
3
  import { getConfigManager } from '../../../lib/config/index.js';
3
4
  import { buildFlowWorkspaceName } from '../../../lib/flow-utils.js';
4
5
  import { setDebug } from '../../../lib/log.js';
6
+ import { validateFlowCommand } from '../../../lib/workspace-validation.js';
5
7
  import DeleteState from '../../delete-state/index.js';
6
8
  import Down from '../../down/index.js';
7
9
  import WorkspaceCreate from '../../workspace/create/index.js';
@@ -63,6 +65,12 @@ export default class FlowDown extends Command {
63
65
  project: loadConfigOutput.config.project,
64
66
  projectRootDir,
65
67
  });
68
+ // Validate that if workspace exists, it's not a deployment workspace
69
+ const backend = await getBackend();
70
+ const validation = await validateFlowCommand(workspaceName, backend);
71
+ if (!validation.isValid) {
72
+ this.error(validation.message);
73
+ }
66
74
  // Import workspace resolution utility
67
75
  const { resolveWorkspaceName } = await import('../../../lib/workspace-utils.js');
68
76
  // Resolve mirror workspace name with org prefix
@@ -1,6 +1,8 @@
1
1
  import { Args, Command, Flags } from '@oclif/core';
2
+ import { getBackend } from '../../../backend/index.js';
2
3
  import { getConfigManager } from '../../../lib/config/index.js';
3
4
  import { buildFlowWorkspaceName } from '../../../lib/flow-utils.js';
5
+ import { validateFlowCommand } from '../../../lib/workspace-validation.js';
4
6
  import Env from '../../env/index.js';
5
7
  export default class FlowEnv extends Command {
6
8
  static args = {
@@ -49,6 +51,12 @@ export default class FlowEnv extends Command {
49
51
  project: loadConfigOutput.config.project,
50
52
  projectRootDir,
51
53
  });
54
+ // Validate that if workspace exists, it's not a deployment workspace
55
+ const backend = await getBackend();
56
+ const validation = await validateFlowCommand(workspaceName, backend);
57
+ if (!validation.isValid) {
58
+ this.error(validation.message);
59
+ }
52
60
  // Build args for env command
53
61
  const envArgs = ['--workspace', workspaceName];
54
62
  // Pass through all flags
@@ -1,7 +1,9 @@
1
1
  import { Args, Command, Flags } from '@oclif/core';
2
+ import { getBackend } from '../../../backend/index.js';
2
3
  import { getConfigManager } from '../../../lib/config/index.js';
3
4
  import { buildFlowWorkspaceName } from '../../../lib/flow-utils.js';
4
5
  import { setDebug } from '../../../lib/log.js';
6
+ import { validateFlowCommand } from '../../../lib/workspace-validation.js';
5
7
  import Remove from '../../remove/index.js';
6
8
  import WorkspaceCreate from '../../workspace/create/index.js';
7
9
  export default class FlowRemove extends Command {
@@ -51,6 +53,12 @@ export default class FlowRemove extends Command {
51
53
  project: loadConfigOutput.config.project,
52
54
  projectRootDir,
53
55
  });
56
+ // Validate that if workspace exists, it's not a deployment workspace
57
+ const backend = await getBackend();
58
+ const validation = await validateFlowCommand(workspaceName, backend);
59
+ if (!validation.isValid) {
60
+ this.error(validation.message);
61
+ }
54
62
  // Import workspace resolution utility
55
63
  const { resolveWorkspaceName } = await import('../../../lib/workspace-utils.js');
56
64
  // Resolve mirror workspace name with org prefix
@@ -1,6 +1,8 @@
1
1
  import { Args, Command, Flags } from '@oclif/core';
2
+ import { getBackend } from '../../../backend/index.js';
2
3
  import { getConfigManager } from '../../../lib/config/index.js';
3
4
  import { buildFlowWorkspaceName } from '../../../lib/flow-utils.js';
5
+ import { validateFlowCommand } from '../../../lib/workspace-validation.js';
4
6
  import Run from '../../run/index.js';
5
7
  export default class FlowRun extends Command {
6
8
  static args = {
@@ -43,6 +45,12 @@ export default class FlowRun extends Command {
43
45
  project: loadConfigOutput.config.project,
44
46
  projectRootDir,
45
47
  });
48
+ // Validate that if workspace exists, it's not a deployment workspace
49
+ const backend = await getBackend();
50
+ const validation = await validateFlowCommand(workspaceName, backend);
51
+ if (!validation.isValid) {
52
+ this.error(validation.message);
53
+ }
46
54
  // Build args for run command
47
55
  const runArgs = ['--workspace', workspaceName];
48
56
  // Pass through chdir flag
@@ -1,7 +1,9 @@
1
1
  import { Command, Flags } from '@oclif/core';
2
+ import { getBackend } from '../../../backend/index.js';
2
3
  import { getConfigManager } from '../../../lib/config/index.js';
3
4
  import { buildFlowWorkspaceName } from '../../../lib/flow-utils.js';
4
5
  import { setDebug } from '../../../lib/log.js';
6
+ import { validateFlowCommand } from '../../../lib/workspace-validation.js';
5
7
  import Up from '../../up/index.js';
6
8
  import WorkspaceCreate from '../../workspace/create/index.js';
7
9
  export default class FlowUp extends Command {
@@ -61,6 +63,12 @@ export default class FlowUp extends Command {
61
63
  project: loadConfigOutput.config.project,
62
64
  projectRootDir,
63
65
  });
66
+ // Validate that if workspace exists, it's not a deployment workspace
67
+ const backend = await getBackend();
68
+ const validation = await validateFlowCommand(workspaceName, backend);
69
+ if (!validation.isValid) {
70
+ this.error(validation.message);
71
+ }
64
72
  // Import workspace resolution utility
65
73
  const { resolveWorkspaceName } = await import('../../../lib/workspace-utils.js');
66
74
  // Resolve mirror workspace name with org prefix