hereya-cli 0.59.0 → 0.60.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 +39 -39
- package/dist/lib/env/index.d.ts +2 -0
- package/dist/lib/env/index.js +55 -1
- package/dist/lib/package/index.js +8 -2
- 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.60.1 linux-x64 node-v24.13.0
|
|
24
24
|
$ hereya --help [COMMAND]
|
|
25
25
|
USAGE
|
|
26
26
|
$ hereya COMMAND
|
|
@@ -101,7 +101,7 @@ EXAMPLES
|
|
|
101
101
|
$ hereya add cloudy/docker_postgres
|
|
102
102
|
```
|
|
103
103
|
|
|
104
|
-
_See code: [src/commands/add/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
104
|
+
_See code: [src/commands/add/index.ts](https://github.com/hereya/hereya-cli/blob/v0.60.1/src/commands/add/index.ts)_
|
|
105
105
|
|
|
106
106
|
## `hereya bootstrap INFRASTRUCTURETYPE`
|
|
107
107
|
|
|
@@ -126,7 +126,7 @@ EXAMPLES
|
|
|
126
126
|
$ hereya bootstrap local
|
|
127
127
|
```
|
|
128
128
|
|
|
129
|
-
_See code: [src/commands/bootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
129
|
+
_See code: [src/commands/bootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.60.1/src/commands/bootstrap/index.ts)_
|
|
130
130
|
|
|
131
131
|
## `hereya config export-backend [FILE]`
|
|
132
132
|
|
|
@@ -148,7 +148,7 @@ EXAMPLES
|
|
|
148
148
|
$ hereya config export-backend ./path/to/export.json
|
|
149
149
|
```
|
|
150
150
|
|
|
151
|
-
_See code: [src/commands/config/export-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
151
|
+
_See code: [src/commands/config/export-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.60.1/src/commands/config/export-backend/index.ts)_
|
|
152
152
|
|
|
153
153
|
## `hereya config get-backend`
|
|
154
154
|
|
|
@@ -165,7 +165,7 @@ EXAMPLES
|
|
|
165
165
|
$ hereya config get-backend
|
|
166
166
|
```
|
|
167
167
|
|
|
168
|
-
_See code: [src/commands/config/get-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
168
|
+
_See code: [src/commands/config/get-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.60.1/src/commands/config/get-backend/index.ts)_
|
|
169
169
|
|
|
170
170
|
## `hereya config import-backend FILE`
|
|
171
171
|
|
|
@@ -185,7 +185,7 @@ EXAMPLES
|
|
|
185
185
|
$ hereya config import-backend ./path/to/cloud-backend.json
|
|
186
186
|
```
|
|
187
187
|
|
|
188
|
-
_See code: [src/commands/config/import-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
188
|
+
_See code: [src/commands/config/import-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.60.1/src/commands/config/import-backend/index.ts)_
|
|
189
189
|
|
|
190
190
|
## `hereya config use-backend TYPE`
|
|
191
191
|
|
|
@@ -207,7 +207,7 @@ EXAMPLES
|
|
|
207
207
|
$ hereya config use-backend local
|
|
208
208
|
```
|
|
209
209
|
|
|
210
|
-
_See code: [src/commands/config/use-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
210
|
+
_See code: [src/commands/config/use-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.60.1/src/commands/config/use-backend/index.ts)_
|
|
211
211
|
|
|
212
212
|
## `hereya delete-state`
|
|
213
213
|
|
|
@@ -233,7 +233,7 @@ EXAMPLES
|
|
|
233
233
|
$ hereya delete-state --workspace staging
|
|
234
234
|
```
|
|
235
235
|
|
|
236
|
-
_See code: [src/commands/delete-state/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
236
|
+
_See code: [src/commands/delete-state/index.ts](https://github.com/hereya/hereya-cli/blob/v0.60.1/src/commands/delete-state/index.ts)_
|
|
237
237
|
|
|
238
238
|
## `hereya deploy`
|
|
239
239
|
|
|
@@ -258,7 +258,7 @@ EXAMPLES
|
|
|
258
258
|
$ hereya deploy
|
|
259
259
|
```
|
|
260
260
|
|
|
261
|
-
_See code: [src/commands/deploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
261
|
+
_See code: [src/commands/deploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.60.1/src/commands/deploy/index.ts)_
|
|
262
262
|
|
|
263
263
|
## `hereya doc PACKAGE`
|
|
264
264
|
|
|
@@ -291,7 +291,7 @@ EXAMPLES
|
|
|
291
291
|
$ hereya doc my-package --no-doc
|
|
292
292
|
```
|
|
293
293
|
|
|
294
|
-
_See code: [src/commands/doc/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
294
|
+
_See code: [src/commands/doc/index.ts](https://github.com/hereya/hereya-cli/blob/v0.60.1/src/commands/doc/index.ts)_
|
|
295
295
|
|
|
296
296
|
## `hereya down`
|
|
297
297
|
|
|
@@ -318,7 +318,7 @@ EXAMPLES
|
|
|
318
318
|
$ hereya down
|
|
319
319
|
```
|
|
320
320
|
|
|
321
|
-
_See code: [src/commands/down/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
321
|
+
_See code: [src/commands/down/index.ts](https://github.com/hereya/hereya-cli/blob/v0.60.1/src/commands/down/index.ts)_
|
|
322
322
|
|
|
323
323
|
## `hereya env [NAME]`
|
|
324
324
|
|
|
@@ -349,7 +349,7 @@ EXAMPLES
|
|
|
349
349
|
$ hereya env -w dev -l
|
|
350
350
|
```
|
|
351
351
|
|
|
352
|
-
_See code: [src/commands/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
352
|
+
_See code: [src/commands/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.60.1/src/commands/env/index.ts)_
|
|
353
353
|
|
|
354
354
|
## `hereya env set [NAME]`
|
|
355
355
|
|
|
@@ -376,7 +376,7 @@ EXAMPLES
|
|
|
376
376
|
$ hereya env set FOO -v bar -w dev
|
|
377
377
|
```
|
|
378
378
|
|
|
379
|
-
_See code: [src/commands/env/set/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
379
|
+
_See code: [src/commands/env/set/index.ts](https://github.com/hereya/hereya-cli/blob/v0.60.1/src/commands/env/set/index.ts)_
|
|
380
380
|
|
|
381
381
|
## `hereya flow add PACKAGE`
|
|
382
382
|
|
|
@@ -414,7 +414,7 @@ EXAMPLES
|
|
|
414
414
|
$ hereya flow add cloudy/docker_postgres -p DB_NAME=mydb -p DB_USER=admin
|
|
415
415
|
```
|
|
416
416
|
|
|
417
|
-
_See code: [src/commands/flow/add/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
417
|
+
_See code: [src/commands/flow/add/index.ts](https://github.com/hereya/hereya-cli/blob/v0.60.1/src/commands/flow/add/index.ts)_
|
|
418
418
|
|
|
419
419
|
## `hereya flow down`
|
|
420
420
|
|
|
@@ -448,7 +448,7 @@ EXAMPLES
|
|
|
448
448
|
$ hereya flow down --pin
|
|
449
449
|
```
|
|
450
450
|
|
|
451
|
-
_See code: [src/commands/flow/down/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
451
|
+
_See code: [src/commands/flow/down/index.ts](https://github.com/hereya/hereya-cli/blob/v0.60.1/src/commands/flow/down/index.ts)_
|
|
452
452
|
|
|
453
453
|
## `hereya flow env [NAME]`
|
|
454
454
|
|
|
@@ -482,7 +482,7 @@ EXAMPLES
|
|
|
482
482
|
$ hereya flow env -l
|
|
483
483
|
```
|
|
484
484
|
|
|
485
|
-
_See code: [src/commands/flow/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
485
|
+
_See code: [src/commands/flow/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.60.1/src/commands/flow/env/index.ts)_
|
|
486
486
|
|
|
487
487
|
## `hereya flow remove PACKAGE`
|
|
488
488
|
|
|
@@ -512,7 +512,7 @@ EXAMPLES
|
|
|
512
512
|
$ hereya flow remove cloudy/docker_postgres --profile staging
|
|
513
513
|
```
|
|
514
514
|
|
|
515
|
-
_See code: [src/commands/flow/remove/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
515
|
+
_See code: [src/commands/flow/remove/index.ts](https://github.com/hereya/hereya-cli/blob/v0.60.1/src/commands/flow/remove/index.ts)_
|
|
516
516
|
|
|
517
517
|
## `hereya flow run CMD`
|
|
518
518
|
|
|
@@ -541,7 +541,7 @@ EXAMPLES
|
|
|
541
541
|
$ hereya flow run --pin -- npm test
|
|
542
542
|
```
|
|
543
543
|
|
|
544
|
-
_See code: [src/commands/flow/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
544
|
+
_See code: [src/commands/flow/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.60.1/src/commands/flow/run/index.ts)_
|
|
545
545
|
|
|
546
546
|
## `hereya flow up`
|
|
547
547
|
|
|
@@ -575,7 +575,7 @@ EXAMPLES
|
|
|
575
575
|
$ hereya flow up --pin
|
|
576
576
|
```
|
|
577
577
|
|
|
578
|
-
_See code: [src/commands/flow/up/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
578
|
+
_See code: [src/commands/flow/up/index.ts](https://github.com/hereya/hereya-cli/blob/v0.60.1/src/commands/flow/up/index.ts)_
|
|
579
579
|
|
|
580
580
|
## `hereya help [COMMAND]`
|
|
581
581
|
|
|
@@ -632,7 +632,7 @@ EXAMPLES
|
|
|
632
632
|
$ hereya import org/my-package -f state.tfstate -w my-workspace
|
|
633
633
|
```
|
|
634
634
|
|
|
635
|
-
_See code: [src/commands/import/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
635
|
+
_See code: [src/commands/import/index.ts](https://github.com/hereya/hereya-cli/blob/v0.60.1/src/commands/import/index.ts)_
|
|
636
636
|
|
|
637
637
|
## `hereya init PROJECT`
|
|
638
638
|
|
|
@@ -658,7 +658,7 @@ EXAMPLES
|
|
|
658
658
|
$ hereya init myProject -w=defaultWorkspace --chdir=./myProject
|
|
659
659
|
```
|
|
660
660
|
|
|
661
|
-
_See code: [src/commands/init/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
661
|
+
_See code: [src/commands/init/index.ts](https://github.com/hereya/hereya-cli/blob/v0.60.1/src/commands/init/index.ts)_
|
|
662
662
|
|
|
663
663
|
## `hereya login [URL]`
|
|
664
664
|
|
|
@@ -687,7 +687,7 @@ EXAMPLES
|
|
|
687
687
|
$ hereya login --token=your-token https://cloud.hereya.dev
|
|
688
688
|
```
|
|
689
689
|
|
|
690
|
-
_See code: [src/commands/login/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
690
|
+
_See code: [src/commands/login/index.ts](https://github.com/hereya/hereya-cli/blob/v0.60.1/src/commands/login/index.ts)_
|
|
691
691
|
|
|
692
692
|
## `hereya logout`
|
|
693
693
|
|
|
@@ -704,7 +704,7 @@ EXAMPLES
|
|
|
704
704
|
$ hereya logout
|
|
705
705
|
```
|
|
706
706
|
|
|
707
|
-
_See code: [src/commands/logout/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
707
|
+
_See code: [src/commands/logout/index.ts](https://github.com/hereya/hereya-cli/blob/v0.60.1/src/commands/logout/index.ts)_
|
|
708
708
|
|
|
709
709
|
## `hereya publish`
|
|
710
710
|
|
|
@@ -727,7 +727,7 @@ EXAMPLES
|
|
|
727
727
|
$ hereya publish --chdir=/path/to/package
|
|
728
728
|
```
|
|
729
729
|
|
|
730
|
-
_See code: [src/commands/publish/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
730
|
+
_See code: [src/commands/publish/index.ts](https://github.com/hereya/hereya-cli/blob/v0.60.1/src/commands/publish/index.ts)_
|
|
731
731
|
|
|
732
732
|
## `hereya remove PACKAGE`
|
|
733
733
|
|
|
@@ -755,7 +755,7 @@ EXAMPLES
|
|
|
755
755
|
$ hereya remove cloudy/docker_postgres
|
|
756
756
|
```
|
|
757
757
|
|
|
758
|
-
_See code: [src/commands/remove/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
758
|
+
_See code: [src/commands/remove/index.ts](https://github.com/hereya/hereya-cli/blob/v0.60.1/src/commands/remove/index.ts)_
|
|
759
759
|
|
|
760
760
|
## `hereya run CMD`
|
|
761
761
|
|
|
@@ -781,7 +781,7 @@ EXAMPLES
|
|
|
781
781
|
$ hereya run -w uat -- node index.js
|
|
782
782
|
```
|
|
783
783
|
|
|
784
|
-
_See code: [src/commands/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
784
|
+
_See code: [src/commands/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.60.1/src/commands/run/index.ts)_
|
|
785
785
|
|
|
786
786
|
## `hereya search QUERY`
|
|
787
787
|
|
|
@@ -812,7 +812,7 @@ EXAMPLES
|
|
|
812
812
|
$ hereya search database --json
|
|
813
813
|
```
|
|
814
814
|
|
|
815
|
-
_See code: [src/commands/search/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
815
|
+
_See code: [src/commands/search/index.ts](https://github.com/hereya/hereya-cli/blob/v0.60.1/src/commands/search/index.ts)_
|
|
816
816
|
|
|
817
817
|
## `hereya unbootstrap INFRASTRUCTURETYPE`
|
|
818
818
|
|
|
@@ -837,7 +837,7 @@ EXAMPLES
|
|
|
837
837
|
$ hereya unbootstrap local
|
|
838
838
|
```
|
|
839
839
|
|
|
840
|
-
_See code: [src/commands/unbootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
840
|
+
_See code: [src/commands/unbootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.60.1/src/commands/unbootstrap/index.ts)_
|
|
841
841
|
|
|
842
842
|
## `hereya undeploy`
|
|
843
843
|
|
|
@@ -862,7 +862,7 @@ EXAMPLES
|
|
|
862
862
|
$ hereya undeploy
|
|
863
863
|
```
|
|
864
864
|
|
|
865
|
-
_See code: [src/commands/undeploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
865
|
+
_See code: [src/commands/undeploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.60.1/src/commands/undeploy/index.ts)_
|
|
866
866
|
|
|
867
867
|
## `hereya up`
|
|
868
868
|
|
|
@@ -889,7 +889,7 @@ EXAMPLES
|
|
|
889
889
|
$ hereya up
|
|
890
890
|
```
|
|
891
891
|
|
|
892
|
-
_See code: [src/commands/up/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
892
|
+
_See code: [src/commands/up/index.ts](https://github.com/hereya/hereya-cli/blob/v0.60.1/src/commands/up/index.ts)_
|
|
893
893
|
|
|
894
894
|
## `hereya workspace create NAME`
|
|
895
895
|
|
|
@@ -914,7 +914,7 @@ EXAMPLES
|
|
|
914
914
|
$ hereya workspace create dev
|
|
915
915
|
```
|
|
916
916
|
|
|
917
|
-
_See code: [src/commands/workspace/create/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
917
|
+
_See code: [src/commands/workspace/create/index.ts](https://github.com/hereya/hereya-cli/blob/v0.60.1/src/commands/workspace/create/index.ts)_
|
|
918
918
|
|
|
919
919
|
## `hereya workspace delete NAME`
|
|
920
920
|
|
|
@@ -934,7 +934,7 @@ EXAMPLES
|
|
|
934
934
|
$ hereya workspace delete dev
|
|
935
935
|
```
|
|
936
936
|
|
|
937
|
-
_See code: [src/commands/workspace/delete/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
937
|
+
_See code: [src/commands/workspace/delete/index.ts](https://github.com/hereya/hereya-cli/blob/v0.60.1/src/commands/workspace/delete/index.ts)_
|
|
938
938
|
|
|
939
939
|
## `hereya workspace env [NAME]`
|
|
940
940
|
|
|
@@ -960,7 +960,7 @@ EXAMPLES
|
|
|
960
960
|
$ hereya workspace env myEnv -w dev
|
|
961
961
|
```
|
|
962
962
|
|
|
963
|
-
_See code: [src/commands/workspace/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
963
|
+
_See code: [src/commands/workspace/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.60.1/src/commands/workspace/env/index.ts)_
|
|
964
964
|
|
|
965
965
|
## `hereya workspace env set`
|
|
966
966
|
|
|
@@ -984,7 +984,7 @@ EXAMPLES
|
|
|
984
984
|
$ hereya workspace env set -w my-workspace -n myVar -v my-value -i aws -s
|
|
985
985
|
```
|
|
986
986
|
|
|
987
|
-
_See code: [src/commands/workspace/env/set/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
987
|
+
_See code: [src/commands/workspace/env/set/index.ts](https://github.com/hereya/hereya-cli/blob/v0.60.1/src/commands/workspace/env/set/index.ts)_
|
|
988
988
|
|
|
989
989
|
## `hereya workspace env unset`
|
|
990
990
|
|
|
@@ -1005,7 +1005,7 @@ EXAMPLES
|
|
|
1005
1005
|
$ hereya workspace env unset -w my-workspace -n myVar
|
|
1006
1006
|
```
|
|
1007
1007
|
|
|
1008
|
-
_See code: [src/commands/workspace/env/unset/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1008
|
+
_See code: [src/commands/workspace/env/unset/index.ts](https://github.com/hereya/hereya-cli/blob/v0.60.1/src/commands/workspace/env/unset/index.ts)_
|
|
1009
1009
|
|
|
1010
1010
|
## `hereya workspace install PACKAGE`
|
|
1011
1011
|
|
|
@@ -1032,7 +1032,7 @@ EXAMPLES
|
|
|
1032
1032
|
$ hereya workspace install hereya/aws-cognito
|
|
1033
1033
|
```
|
|
1034
1034
|
|
|
1035
|
-
_See code: [src/commands/workspace/install/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1035
|
+
_See code: [src/commands/workspace/install/index.ts](https://github.com/hereya/hereya-cli/blob/v0.60.1/src/commands/workspace/install/index.ts)_
|
|
1036
1036
|
|
|
1037
1037
|
## `hereya workspace list`
|
|
1038
1038
|
|
|
@@ -1049,7 +1049,7 @@ EXAMPLES
|
|
|
1049
1049
|
$ hereya workspace list
|
|
1050
1050
|
```
|
|
1051
1051
|
|
|
1052
|
-
_See code: [src/commands/workspace/list/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1052
|
+
_See code: [src/commands/workspace/list/index.ts](https://github.com/hereya/hereya-cli/blob/v0.60.1/src/commands/workspace/list/index.ts)_
|
|
1053
1053
|
|
|
1054
1054
|
## `hereya workspace set-profile PROFILE`
|
|
1055
1055
|
|
|
@@ -1073,7 +1073,7 @@ EXAMPLES
|
|
|
1073
1073
|
$ hereya workspace set-profile prod-profile -w production
|
|
1074
1074
|
```
|
|
1075
1075
|
|
|
1076
|
-
_See code: [src/commands/workspace/set-profile/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1076
|
+
_See code: [src/commands/workspace/set-profile/index.ts](https://github.com/hereya/hereya-cli/blob/v0.60.1/src/commands/workspace/set-profile/index.ts)_
|
|
1077
1077
|
|
|
1078
1078
|
## `hereya workspace uninstall PACKAGE`
|
|
1079
1079
|
|
|
@@ -1100,5 +1100,5 @@ EXAMPLES
|
|
|
1100
1100
|
$ hereya workspace uninstall hereya/aws-cognito
|
|
1101
1101
|
```
|
|
1102
1102
|
|
|
1103
|
-
_See code: [src/commands/workspace/uninstall/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1103
|
+
_See code: [src/commands/workspace/uninstall/index.ts](https://github.com/hereya/hereya-cli/blob/v0.60.1/src/commands/workspace/uninstall/index.ts)_
|
|
1104
1104
|
<!-- commandsstop -->
|
package/dist/lib/env/index.d.ts
CHANGED
|
@@ -7,7 +7,9 @@ export declare class EnvManager {
|
|
|
7
7
|
private extractProfileSections;
|
|
8
8
|
private getEnvPath;
|
|
9
9
|
private getUserEnvPaths;
|
|
10
|
+
private loadDotEnvFiles;
|
|
10
11
|
private loadFirstDocument;
|
|
12
|
+
private parseDotEnv;
|
|
11
13
|
}
|
|
12
14
|
export declare const envManager: EnvManager;
|
|
13
15
|
export declare function getEnvManager(): EnvManager;
|
package/dist/lib/env/index.js
CHANGED
|
@@ -24,6 +24,12 @@ export class EnvManager {
|
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
26
|
const { executor } = executor$;
|
|
27
|
+
// Load .env files first (lowest priority base layer)
|
|
28
|
+
// All .env values are treated as secrets - mark with secret:// prefix
|
|
29
|
+
let dotEnv = await this.loadDotEnvFiles(input.profile, input.projectRootDir);
|
|
30
|
+
if (input.markSecret && Object.keys(dotEnv).length > 0) {
|
|
31
|
+
dotEnv = Object.fromEntries(Object.entries(dotEnv).map(([key, value]) => [key, `secret://${value}`]));
|
|
32
|
+
}
|
|
27
33
|
if (found) {
|
|
28
34
|
resolvedEnv = await executor.resolveEnvValues({ env, markSecret: input.markSecret });
|
|
29
35
|
}
|
|
@@ -49,7 +55,8 @@ export class EnvManager {
|
|
|
49
55
|
const resolvedProfileSections = await executor.resolveEnvValues({ env: profileSections, markSecret: input.markSecret });
|
|
50
56
|
userMergedEnv = { ...userMergedEnv, ...resolvedProfileSections };
|
|
51
57
|
}
|
|
52
|
-
|
|
58
|
+
// Final merge: .env -> workspace env -> static env (static env has highest priority)
|
|
59
|
+
const finalEnv = { ...dotEnv, ...resolvedEnv, ...userMergedEnv };
|
|
53
60
|
return { env: finalEnv, success: true };
|
|
54
61
|
}
|
|
55
62
|
async getStaticEnvDir(projectRootDir) {
|
|
@@ -106,6 +113,30 @@ export class EnvManager {
|
|
|
106
113
|
]);
|
|
107
114
|
return paths;
|
|
108
115
|
}
|
|
116
|
+
// Load .env files from project root
|
|
117
|
+
async loadDotEnvFiles(profile, projectRootDir) {
|
|
118
|
+
const rootDir = projectRootDir ?? process.cwd();
|
|
119
|
+
let dotEnv = {};
|
|
120
|
+
// Load base .env file (lowest priority)
|
|
121
|
+
const baseDotEnvPath = path.join(rootDir, '.env');
|
|
122
|
+
try {
|
|
123
|
+
const content = await fs.readFile(baseDotEnvPath, 'utf8');
|
|
124
|
+
dotEnv = { ...dotEnv, ...this.parseDotEnv(content) };
|
|
125
|
+
}
|
|
126
|
+
catch {
|
|
127
|
+
// .env file doesn't exist, skip
|
|
128
|
+
}
|
|
129
|
+
// Load profile-specific .env.{profile} file
|
|
130
|
+
const profileDotEnvPath = path.join(rootDir, `.env.${profile}`);
|
|
131
|
+
try {
|
|
132
|
+
const content = await fs.readFile(profileDotEnvPath, 'utf8');
|
|
133
|
+
dotEnv = { ...dotEnv, ...this.parseDotEnv(content) };
|
|
134
|
+
}
|
|
135
|
+
catch {
|
|
136
|
+
// .env.{profile} file doesn't exist, skip
|
|
137
|
+
}
|
|
138
|
+
return dotEnv;
|
|
139
|
+
}
|
|
109
140
|
async loadFirstDocument(filePath) {
|
|
110
141
|
try {
|
|
111
142
|
await fs.access(filePath);
|
|
@@ -121,6 +152,29 @@ export class EnvManager {
|
|
|
121
152
|
return null;
|
|
122
153
|
}
|
|
123
154
|
}
|
|
155
|
+
// Parse .env file content (KEY=VALUE format)
|
|
156
|
+
parseDotEnv(content) {
|
|
157
|
+
const result = {};
|
|
158
|
+
for (const line of content.split('\n')) {
|
|
159
|
+
const trimmed = line.trim();
|
|
160
|
+
// Skip empty lines and comments
|
|
161
|
+
if (!trimmed || trimmed.startsWith('#'))
|
|
162
|
+
continue;
|
|
163
|
+
const eqIndex = trimmed.indexOf('=');
|
|
164
|
+
if (eqIndex === -1)
|
|
165
|
+
continue;
|
|
166
|
+
const key = trimmed.slice(0, eqIndex).trim();
|
|
167
|
+
let value = trimmed.slice(eqIndex + 1).trim();
|
|
168
|
+
// Remove surrounding quotes if present
|
|
169
|
+
if ((value.startsWith('"') && value.endsWith('"')) ||
|
|
170
|
+
(value.startsWith("'") && value.endsWith("'"))) {
|
|
171
|
+
value = value.slice(1, -1);
|
|
172
|
+
}
|
|
173
|
+
if (key)
|
|
174
|
+
result[key] = value;
|
|
175
|
+
}
|
|
176
|
+
return result;
|
|
177
|
+
}
|
|
124
178
|
}
|
|
125
179
|
export const envManager = new EnvManager();
|
|
126
180
|
export function getEnvManager() {
|
|
@@ -145,7 +145,10 @@ async function resolveWithStandardManager(protocol, input, packageName, version)
|
|
|
145
145
|
return { found: false, reason: 'Package has dependencies but is not a deploy package' };
|
|
146
146
|
}
|
|
147
147
|
if (input.isDeploying && metadata.onDeploy) {
|
|
148
|
-
|
|
148
|
+
const onDeployPackage = metadata.onDeploy.version
|
|
149
|
+
? `${metadata.onDeploy.pkg}@${metadata.onDeploy.version}`
|
|
150
|
+
: metadata.onDeploy.pkg;
|
|
151
|
+
return resolvePackage({ ...input, package: onDeployPackage });
|
|
149
152
|
}
|
|
150
153
|
return {
|
|
151
154
|
canonicalName: getPackageCanonicalName(packageName),
|
|
@@ -206,7 +209,10 @@ async function resolveCloudPackage(packageInfo, cloudManager, input) {
|
|
|
206
209
|
return { found: false, reason: 'Package has dependencies but is not a deploy package' };
|
|
207
210
|
}
|
|
208
211
|
if (input.isDeploying && metadata.onDeploy) {
|
|
209
|
-
|
|
212
|
+
const onDeployPackage = metadata.onDeploy.version
|
|
213
|
+
? `${metadata.onDeploy.pkg}@${metadata.onDeploy.version}`
|
|
214
|
+
: metadata.onDeploy.pkg;
|
|
215
|
+
return resolvePackage({ ...input, package: onDeployPackage });
|
|
210
216
|
}
|
|
211
217
|
// Build packageUri with repository and commit
|
|
212
218
|
const packageUri = packageInfo.registryPackage.commit
|
package/oclif.manifest.json
CHANGED