hereya-cli 0.49.0 → 0.50.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 +36 -36
- package/dist/backend/cloud/cloud-backend.js +2 -8
- package/dist/backend/file.js +2 -8
- package/dist/commands/add/index.js +1 -1
- package/dist/commands/deploy/index.js +6 -6
- package/dist/commands/down/index.js +1 -1
- package/dist/commands/env/index.js +1 -1
- package/dist/commands/import/index.js +1 -1
- package/dist/commands/remove/index.js +1 -1
- package/dist/commands/run/index.js +1 -1
- package/dist/commands/undeploy/index.js +3 -3
- package/dist/commands/up/index.js +2 -2
- package/dist/lib/org-utils.js +1 -1
- package/dist/lib/profile-utils.d.ts +1 -1
- package/dist/lib/profile-utils.js +5 -2
- package/dist/lib/workspace-utils.d.ts +16 -0
- package/dist/lib/workspace-utils.js +26 -0
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
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.
|
|
23
|
+
hereya-cli/0.50.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.
|
|
101
|
+
_See code: [src/commands/add/index.ts](https://github.com/hereya/hereya-cli/blob/v0.50.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.
|
|
126
|
+
_See code: [src/commands/bootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.50.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.
|
|
148
|
+
_See code: [src/commands/config/export-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.50.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.
|
|
165
|
+
_See code: [src/commands/config/get-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.50.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.
|
|
185
|
+
_See code: [src/commands/config/import-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.50.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.
|
|
207
|
+
_See code: [src/commands/config/use-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.50.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.
|
|
233
|
+
_See code: [src/commands/delete-state/index.ts](https://github.com/hereya/hereya-cli/blob/v0.50.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.
|
|
258
|
+
_See code: [src/commands/deploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.50.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.
|
|
285
|
+
_See code: [src/commands/down/index.ts](https://github.com/hereya/hereya-cli/blob/v0.50.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.
|
|
316
|
+
_See code: [src/commands/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.50.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.
|
|
343
|
+
_See code: [src/commands/env/set/index.ts](https://github.com/hereya/hereya-cli/blob/v0.50.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.
|
|
381
|
+
_See code: [src/commands/flow/add/index.ts](https://github.com/hereya/hereya-cli/blob/v0.50.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.
|
|
415
|
+
_See code: [src/commands/flow/down/index.ts](https://github.com/hereya/hereya-cli/blob/v0.50.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.
|
|
449
|
+
_See code: [src/commands/flow/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.50.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.
|
|
479
|
+
_See code: [src/commands/flow/remove/index.ts](https://github.com/hereya/hereya-cli/blob/v0.50.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.
|
|
508
|
+
_See code: [src/commands/flow/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.50.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.
|
|
542
|
+
_See code: [src/commands/flow/up/index.ts](https://github.com/hereya/hereya-cli/blob/v0.50.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.
|
|
599
|
+
_See code: [src/commands/import/index.ts](https://github.com/hereya/hereya-cli/blob/v0.50.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.
|
|
625
|
+
_See code: [src/commands/init/index.ts](https://github.com/hereya/hereya-cli/blob/v0.50.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.
|
|
654
|
+
_See code: [src/commands/login/index.ts](https://github.com/hereya/hereya-cli/blob/v0.50.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.
|
|
671
|
+
_See code: [src/commands/logout/index.ts](https://github.com/hereya/hereya-cli/blob/v0.50.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.
|
|
699
|
+
_See code: [src/commands/remove/index.ts](https://github.com/hereya/hereya-cli/blob/v0.50.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.
|
|
725
|
+
_See code: [src/commands/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.50.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.
|
|
750
|
+
_See code: [src/commands/unbootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.50.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.
|
|
775
|
+
_See code: [src/commands/undeploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.50.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.
|
|
802
|
+
_See code: [src/commands/up/index.ts](https://github.com/hereya/hereya-cli/blob/v0.50.0/src/commands/up/index.ts)_
|
|
803
803
|
|
|
804
804
|
## `hereya workspace create NAME`
|
|
805
805
|
|
|
@@ -823,7 +823,7 @@ EXAMPLES
|
|
|
823
823
|
$ hereya workspace create dev
|
|
824
824
|
```
|
|
825
825
|
|
|
826
|
-
_See code: [src/commands/workspace/create/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
826
|
+
_See code: [src/commands/workspace/create/index.ts](https://github.com/hereya/hereya-cli/blob/v0.50.0/src/commands/workspace/create/index.ts)_
|
|
827
827
|
|
|
828
828
|
## `hereya workspace delete NAME`
|
|
829
829
|
|
|
@@ -843,7 +843,7 @@ EXAMPLES
|
|
|
843
843
|
$ hereya workspace delete dev
|
|
844
844
|
```
|
|
845
845
|
|
|
846
|
-
_See code: [src/commands/workspace/delete/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
846
|
+
_See code: [src/commands/workspace/delete/index.ts](https://github.com/hereya/hereya-cli/blob/v0.50.0/src/commands/workspace/delete/index.ts)_
|
|
847
847
|
|
|
848
848
|
## `hereya workspace env [NAME]`
|
|
849
849
|
|
|
@@ -869,7 +869,7 @@ EXAMPLES
|
|
|
869
869
|
$ hereya workspace env myEnv -w dev
|
|
870
870
|
```
|
|
871
871
|
|
|
872
|
-
_See code: [src/commands/workspace/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
872
|
+
_See code: [src/commands/workspace/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.50.0/src/commands/workspace/env/index.ts)_
|
|
873
873
|
|
|
874
874
|
## `hereya workspace env set`
|
|
875
875
|
|
|
@@ -893,7 +893,7 @@ EXAMPLES
|
|
|
893
893
|
$ hereya workspace env set -w my-workspace -n myVar -v my-value -i aws -s
|
|
894
894
|
```
|
|
895
895
|
|
|
896
|
-
_See code: [src/commands/workspace/env/set/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
896
|
+
_See code: [src/commands/workspace/env/set/index.ts](https://github.com/hereya/hereya-cli/blob/v0.50.0/src/commands/workspace/env/set/index.ts)_
|
|
897
897
|
|
|
898
898
|
## `hereya workspace env unset`
|
|
899
899
|
|
|
@@ -914,7 +914,7 @@ EXAMPLES
|
|
|
914
914
|
$ hereya workspace env unset -w my-workspace -n myVar
|
|
915
915
|
```
|
|
916
916
|
|
|
917
|
-
_See code: [src/commands/workspace/env/unset/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
917
|
+
_See code: [src/commands/workspace/env/unset/index.ts](https://github.com/hereya/hereya-cli/blob/v0.50.0/src/commands/workspace/env/unset/index.ts)_
|
|
918
918
|
|
|
919
919
|
## `hereya workspace install PACKAGE`
|
|
920
920
|
|
|
@@ -941,7 +941,7 @@ EXAMPLES
|
|
|
941
941
|
$ hereya workspace install hereya/aws-cognito
|
|
942
942
|
```
|
|
943
943
|
|
|
944
|
-
_See code: [src/commands/workspace/install/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
944
|
+
_See code: [src/commands/workspace/install/index.ts](https://github.com/hereya/hereya-cli/blob/v0.50.0/src/commands/workspace/install/index.ts)_
|
|
945
945
|
|
|
946
946
|
## `hereya workspace list`
|
|
947
947
|
|
|
@@ -958,7 +958,7 @@ EXAMPLES
|
|
|
958
958
|
$ hereya workspace list
|
|
959
959
|
```
|
|
960
960
|
|
|
961
|
-
_See code: [src/commands/workspace/list/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
961
|
+
_See code: [src/commands/workspace/list/index.ts](https://github.com/hereya/hereya-cli/blob/v0.50.0/src/commands/workspace/list/index.ts)_
|
|
962
962
|
|
|
963
963
|
## `hereya workspace set-profile PROFILE`
|
|
964
964
|
|
|
@@ -981,7 +981,7 @@ EXAMPLES
|
|
|
981
981
|
$ hereya workspace set-profile prod-profile -w production
|
|
982
982
|
```
|
|
983
983
|
|
|
984
|
-
_See code: [src/commands/workspace/set-profile/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
984
|
+
_See code: [src/commands/workspace/set-profile/index.ts](https://github.com/hereya/hereya-cli/blob/v0.50.0/src/commands/workspace/set-profile/index.ts)_
|
|
985
985
|
|
|
986
986
|
## `hereya workspace uninstall PACKAGE`
|
|
987
987
|
|
|
@@ -1008,5 +1008,5 @@ EXAMPLES
|
|
|
1008
1008
|
$ hereya workspace uninstall hereya/aws-cognito
|
|
1009
1009
|
```
|
|
1010
1010
|
|
|
1011
|
-
_See code: [src/commands/workspace/uninstall/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1011
|
+
_See code: [src/commands/workspace/uninstall/index.ts](https://github.com/hereya/hereya-cli/blob/v0.50.0/src/commands/workspace/uninstall/index.ts)_
|
|
1012
1012
|
<!-- commandsstop -->
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { resolveWorkspaceName } from '../../lib/workspace-utils.js';
|
|
2
2
|
export class CloudBackend {
|
|
3
3
|
config;
|
|
4
4
|
constructor(config) {
|
|
@@ -212,13 +212,7 @@ export class CloudBackend {
|
|
|
212
212
|
}
|
|
213
213
|
async getWorkspaceEnv(input) {
|
|
214
214
|
// Apply org prefix if project has one and workspace doesn't
|
|
215
|
-
|
|
216
|
-
if (input.project) {
|
|
217
|
-
const { org: projectOrg } = extractOrgPrefix(input.project);
|
|
218
|
-
if (projectOrg) {
|
|
219
|
-
workspaceName = addOrgPrefix(projectOrg, input.workspace);
|
|
220
|
-
}
|
|
221
|
-
}
|
|
215
|
+
const workspaceName = resolveWorkspaceName(input.workspace, input.project);
|
|
222
216
|
const workspace$ = await this.getWorkspace(workspaceName);
|
|
223
217
|
if (!workspace$.found) {
|
|
224
218
|
return {
|
package/dist/backend/file.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { randomUUID } from 'node:crypto';
|
|
2
2
|
import { stringify } from 'yaml';
|
|
3
|
-
import {
|
|
3
|
+
import { resolveWorkspaceName } from '../lib/workspace-utils.js';
|
|
4
4
|
import { parseYaml } from '../lib/yaml-utils.js';
|
|
5
5
|
import { WorkspaceSchema, } from './common.js';
|
|
6
6
|
export class FileBackend {
|
|
@@ -292,13 +292,7 @@ export class FileBackend {
|
|
|
292
292
|
}
|
|
293
293
|
async getWorkspaceEnv(input) {
|
|
294
294
|
// Apply org prefix if project has one and workspace doesn't
|
|
295
|
-
|
|
296
|
-
if (input.project) {
|
|
297
|
-
const { org: projectOrg } = extractOrgPrefix(input.project);
|
|
298
|
-
if (projectOrg) {
|
|
299
|
-
workspaceName = addOrgPrefix(projectOrg, input.workspace);
|
|
300
|
-
}
|
|
301
|
-
}
|
|
295
|
+
const workspaceName = resolveWorkspaceName(input.workspace, input.project);
|
|
302
296
|
const workspace$ = await this.getWorkspace(workspaceName);
|
|
303
297
|
if (!workspace$.found) {
|
|
304
298
|
return {
|
|
@@ -83,7 +83,7 @@ export default class Add extends Command {
|
|
|
83
83
|
const userSpecifiedParameters = arrayOfStringToObject(ctx.userSpecifiedParameters);
|
|
84
84
|
const parameterManager = getParameterManager();
|
|
85
85
|
const backend = await getBackend();
|
|
86
|
-
const profile = await getProfileFromWorkspace(backend, ctx.workspace);
|
|
86
|
+
const profile = await getProfileFromWorkspace(backend, ctx.workspace, ctx.configOutput.config.project);
|
|
87
87
|
const parametersOutput = await parameterManager.getPackageParameters({
|
|
88
88
|
package: ctx.package,
|
|
89
89
|
profile,
|
|
@@ -55,7 +55,7 @@ export default class Deploy extends Command {
|
|
|
55
55
|
{
|
|
56
56
|
async task(ctx) {
|
|
57
57
|
const backend = await getBackend();
|
|
58
|
-
const profile = await getProfileFromWorkspace(backend, ctx.workspace);
|
|
58
|
+
const profile = await getProfileFromWorkspace(backend, ctx.workspace, ctx.configOutput.config.project);
|
|
59
59
|
const envManager = getEnvManager();
|
|
60
60
|
const getProjectEnvOutput = await envManager.getProjectEnv({
|
|
61
61
|
markSecret: true,
|
|
@@ -106,7 +106,7 @@ export default class Deploy extends Command {
|
|
|
106
106
|
async task(_, task) {
|
|
107
107
|
const parameterManager = getParameterManager();
|
|
108
108
|
const backend = await getBackend();
|
|
109
|
-
const profile = await getProfileFromWorkspace(backend, ctx.workspace);
|
|
109
|
+
const profile = await getProfileFromWorkspace(backend, ctx.workspace, ctx.configOutput.config.project);
|
|
110
110
|
const { parameters } = await parameterManager.getPackageParameters({
|
|
111
111
|
package: packageName,
|
|
112
112
|
profile,
|
|
@@ -146,7 +146,7 @@ export default class Deploy extends Command {
|
|
|
146
146
|
async task(_, task) {
|
|
147
147
|
const parameterManager = getParameterManager();
|
|
148
148
|
const backend = await getBackend();
|
|
149
|
-
const profile = await getProfileFromWorkspace(backend, ctx.workspace);
|
|
149
|
+
const profile = await getProfileFromWorkspace(backend, ctx.workspace, ctx.configOutput.config.project);
|
|
150
150
|
const { parameters } = await parameterManager.getPackageParameters({
|
|
151
151
|
package: packageName,
|
|
152
152
|
profile,
|
|
@@ -192,7 +192,7 @@ export default class Deploy extends Command {
|
|
|
192
192
|
async task(_, task) {
|
|
193
193
|
const parameterManager = getParameterManager();
|
|
194
194
|
const backend = await getBackend();
|
|
195
|
-
const profile = await getProfileFromWorkspace(backend, ctx.workspace);
|
|
195
|
+
const profile = await getProfileFromWorkspace(backend, ctx.workspace, ctx.configOutput.config.project);
|
|
196
196
|
const { parameters } = await parameterManager.getPackageParameters({
|
|
197
197
|
package: packageName,
|
|
198
198
|
profile,
|
|
@@ -279,7 +279,7 @@ export default class Deploy extends Command {
|
|
|
279
279
|
skip: (ctx) => ctx.deployPackages.length === 0,
|
|
280
280
|
async task(ctx, task) {
|
|
281
281
|
const backend = await getBackend();
|
|
282
|
-
const profile = await getProfileFromWorkspace(backend, ctx.workspace);
|
|
282
|
+
const profile = await getProfileFromWorkspace(backend, ctx.workspace, ctx.configOutput.config.project);
|
|
283
283
|
const envManager = getEnvManager();
|
|
284
284
|
const getProjectEnvOutput = await envManager.getProjectEnv({
|
|
285
285
|
markSecret: true,
|
|
@@ -298,7 +298,7 @@ export default class Deploy extends Command {
|
|
|
298
298
|
async task(_, task) {
|
|
299
299
|
const parameterManager = getParameterManager();
|
|
300
300
|
const backend = await getBackend();
|
|
301
|
-
const profile = await getProfileFromWorkspace(backend, ctx.workspace);
|
|
301
|
+
const profile = await getProfileFromWorkspace(backend, ctx.workspace, ctx.configOutput.config.project);
|
|
302
302
|
const { parameters } = await parameterManager.getPackageParameters({
|
|
303
303
|
package: packageName,
|
|
304
304
|
profile,
|
|
@@ -96,7 +96,7 @@ export default class Down extends Command {
|
|
|
96
96
|
async task(_, task) {
|
|
97
97
|
const parameterManager = getParameterManager();
|
|
98
98
|
const backend = await getBackend();
|
|
99
|
-
const profile = await getProfileFromWorkspace(backend, ctx.workspace);
|
|
99
|
+
const profile = await getProfileFromWorkspace(backend, ctx.workspace, ctx.configOutput.config.project);
|
|
100
100
|
const { parameters } = await parameterManager.getPackageParameters({
|
|
101
101
|
package: packageName,
|
|
102
102
|
profile,
|
|
@@ -49,7 +49,7 @@ export default class Env extends Command {
|
|
|
49
49
|
this.error('you must specify a workspace to print the env vars for');
|
|
50
50
|
}
|
|
51
51
|
const backend = await getBackend();
|
|
52
|
-
const profile = await getProfileFromWorkspace(backend, workspace);
|
|
52
|
+
const profile = await getProfileFromWorkspace(backend, workspace, config.project);
|
|
53
53
|
const envManager = getEnvManager();
|
|
54
54
|
const getProjectEnvOutput = await envManager.getProjectEnv({
|
|
55
55
|
profile,
|
|
@@ -90,7 +90,7 @@ export default class Import extends Command {
|
|
|
90
90
|
const userSpecifiedParameters = arrayOfStringToObject(ctx.userSpecifiedParameters);
|
|
91
91
|
const parameterManager = getParameterManager();
|
|
92
92
|
const backend = await getBackend();
|
|
93
|
-
const profile = await getProfileFromWorkspace(backend, ctx.workspace);
|
|
93
|
+
const profile = await getProfileFromWorkspace(backend, ctx.workspace, ctx.configOutput.config.project);
|
|
94
94
|
const parametersOutput = await parameterManager.getPackageParameters({
|
|
95
95
|
package: ctx.package,
|
|
96
96
|
profile,
|
|
@@ -72,7 +72,7 @@ export default class Remove extends Command {
|
|
|
72
72
|
async task(ctx) {
|
|
73
73
|
const parameterManager = getParameterManager();
|
|
74
74
|
const backend = await getBackend();
|
|
75
|
-
const profile = await getProfileFromWorkspace(backend, ctx.workspace);
|
|
75
|
+
const profile = await getProfileFromWorkspace(backend, ctx.workspace, ctx.configOutput.config.project);
|
|
76
76
|
const parametersOutput = await parameterManager.getPackageParameters({
|
|
77
77
|
package: ctx.package,
|
|
78
78
|
profile,
|
|
@@ -43,7 +43,7 @@ export default class Run extends Command {
|
|
|
43
43
|
this.error('you must specify a workspace to run the command in');
|
|
44
44
|
}
|
|
45
45
|
const backend = await getBackend();
|
|
46
|
-
const profile = await getProfileFromWorkspace(backend, workspace);
|
|
46
|
+
const profile = await getProfileFromWorkspace(backend, workspace, config.project);
|
|
47
47
|
const envManager = getEnvManager();
|
|
48
48
|
const getProjectEnvOutput = await envManager.getProjectEnv({
|
|
49
49
|
profile,
|
|
@@ -56,7 +56,7 @@ export default class Undeploy extends Command {
|
|
|
56
56
|
{
|
|
57
57
|
async task(ctx) {
|
|
58
58
|
const backend = await getBackend();
|
|
59
|
-
const profile = await getProfileFromWorkspace(backend, ctx.workspace);
|
|
59
|
+
const profile = await getProfileFromWorkspace(backend, ctx.workspace, ctx.configOutput.config.project);
|
|
60
60
|
const envManager = getEnvManager();
|
|
61
61
|
const getProjectEnvOutput = await envManager.getProjectEnv({
|
|
62
62
|
markSecret: true,
|
|
@@ -111,7 +111,7 @@ export default class Undeploy extends Command {
|
|
|
111
111
|
async task(_, task) {
|
|
112
112
|
const parameterManager = getParameterManager();
|
|
113
113
|
const backend = await getBackend();
|
|
114
|
-
const profile = await getProfileFromWorkspace(backend, ctx.workspace);
|
|
114
|
+
const profile = await getProfileFromWorkspace(backend, ctx.workspace, ctx.configOutput.config.project);
|
|
115
115
|
const { parameters } = await parameterManager.getPackageParameters({
|
|
116
116
|
package: packageName,
|
|
117
117
|
profile,
|
|
@@ -151,7 +151,7 @@ export default class Undeploy extends Command {
|
|
|
151
151
|
async task(_, task) {
|
|
152
152
|
const parameterManager = getParameterManager();
|
|
153
153
|
const backend = await getBackend();
|
|
154
|
-
const profile = await getProfileFromWorkspace(backend, ctx.workspace);
|
|
154
|
+
const profile = await getProfileFromWorkspace(backend, ctx.workspace, ctx.configOutput.config.project);
|
|
155
155
|
const { parameters } = await parameterManager.getPackageParameters({
|
|
156
156
|
package: packageName,
|
|
157
157
|
profile,
|
|
@@ -104,7 +104,7 @@ export default class Up extends Command {
|
|
|
104
104
|
async task(_, task) {
|
|
105
105
|
const parameterManager = getParameterManager();
|
|
106
106
|
const backend = await getBackend();
|
|
107
|
-
const profile = await getProfileFromWorkspace(backend, workspace);
|
|
107
|
+
const profile = await getProfileFromWorkspace(backend, workspace, ctx.configOutput.config.project);
|
|
108
108
|
const { parameters } = await parameterManager.getPackageParameters({
|
|
109
109
|
package: packageName,
|
|
110
110
|
profile,
|
|
@@ -150,7 +150,7 @@ export default class Up extends Command {
|
|
|
150
150
|
async task(_, task) {
|
|
151
151
|
const parameterManager = getParameterManager();
|
|
152
152
|
const backend = await getBackend();
|
|
153
|
-
const profile = await getProfileFromWorkspace(backend, ctx.workspace);
|
|
153
|
+
const profile = await getProfileFromWorkspace(backend, ctx.workspace, ctx.configOutput.config.project);
|
|
154
154
|
const { parameters } = await parameterManager.getPackageParameters({
|
|
155
155
|
package: packageName,
|
|
156
156
|
profile,
|
package/dist/lib/org-utils.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Backend } from '../backend/common.js';
|
|
2
|
-
export declare function getProfileFromWorkspace(backend: Backend, workspaceName: string): Promise<string>;
|
|
2
|
+
export declare function getProfileFromWorkspace(backend: Backend, workspaceName: string, project?: string): Promise<string>;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { resolveWorkspaceName } from './workspace-utils.js';
|
|
2
|
+
export async function getProfileFromWorkspace(backend, workspaceName, project) {
|
|
3
|
+
// Resolve workspace name with org prefix if needed
|
|
4
|
+
const resolvedWorkspaceName = resolveWorkspaceName(workspaceName, project);
|
|
5
|
+
const workspace$ = await backend.getWorkspace(resolvedWorkspaceName);
|
|
3
6
|
if (!workspace$.found || workspace$.hasError) {
|
|
4
7
|
// Fallback to workspace name if workspace not found
|
|
5
8
|
return workspaceName;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolves a workspace name by adding org prefix from project if needed.
|
|
3
|
+
*
|
|
4
|
+
* If the project has an org prefix and the workspace doesn't already have one,
|
|
5
|
+
* the org prefix from the project will be added to the workspace name.
|
|
6
|
+
*
|
|
7
|
+
* @param workspace - The workspace name
|
|
8
|
+
* @param project - Optional project name that may contain org prefix
|
|
9
|
+
* @returns The resolved workspace name
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* resolveWorkspaceName('dev', 'myorg/myproject') // returns 'myorg/dev'
|
|
13
|
+
* resolveWorkspaceName('myorg/dev', 'myorg/myproject') // returns 'myorg/dev'
|
|
14
|
+
* resolveWorkspaceName('dev', 'myproject') // returns 'dev'
|
|
15
|
+
*/
|
|
16
|
+
export declare function resolveWorkspaceName(workspace: string, project?: string): string;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { addOrgPrefix, extractOrgPrefix } from './org-utils.js';
|
|
2
|
+
/**
|
|
3
|
+
* Resolves a workspace name by adding org prefix from project if needed.
|
|
4
|
+
*
|
|
5
|
+
* If the project has an org prefix and the workspace doesn't already have one,
|
|
6
|
+
* the org prefix from the project will be added to the workspace name.
|
|
7
|
+
*
|
|
8
|
+
* @param workspace - The workspace name
|
|
9
|
+
* @param project - Optional project name that may contain org prefix
|
|
10
|
+
* @returns The resolved workspace name
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* resolveWorkspaceName('dev', 'myorg/myproject') // returns 'myorg/dev'
|
|
14
|
+
* resolveWorkspaceName('myorg/dev', 'myorg/myproject') // returns 'myorg/dev'
|
|
15
|
+
* resolveWorkspaceName('dev', 'myproject') // returns 'dev'
|
|
16
|
+
*/
|
|
17
|
+
export function resolveWorkspaceName(workspace, project) {
|
|
18
|
+
if (!project) {
|
|
19
|
+
return workspace;
|
|
20
|
+
}
|
|
21
|
+
const { org: projectOrg } = extractOrgPrefix(project);
|
|
22
|
+
if (!projectOrg) {
|
|
23
|
+
return workspace;
|
|
24
|
+
}
|
|
25
|
+
return addOrgPrefix(projectOrg, workspace);
|
|
26
|
+
}
|
package/oclif.manifest.json
CHANGED