@teambit/workspace-config-files 1.0.227 → 1.0.229
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/artifacts/__bit_junit.xml +2 -2
- package/artifacts/schema.json +169 -51
- package/dist/config-writer-entry.d.ts +129 -0
- package/dist/config-writer-list.d.ts +41 -0
- package/dist/dedup-paths.d.ts +29 -0
- package/dist/dedup-paths.spec.d.ts +1 -0
- package/dist/exceptions/write-failed.d.ts +4 -0
- package/dist/index.d.ts +8 -0
- package/dist/outputs/format-clean-output.d.ts +2 -0
- package/dist/outputs/format-list-output.d.ts +2 -0
- package/dist/outputs/format-write-output.d.ts +3 -0
- package/dist/outputs/index.d.ts +4 -0
- package/dist/outputs/verbose-format-write-output.d.ts +3 -0
- package/dist/outputs/write-outputs-texts.d.ts +2 -0
- package/dist/{preview-1712719054377.js → preview-1712822929999.js} +1 -1
- package/dist/workspace-config-env-type.d.ts +7 -0
- package/dist/workspace-config-files.aspect.d.ts +2 -0
- package/dist/workspace-config-files.main.runtime.d.ts +140 -0
- package/dist/workspace-config-files.service.d.ts +18 -0
- package/dist/writers/extending-config-files.d.ts +18 -0
- package/dist/writers/index.d.ts +4 -0
- package/dist/writers/real-config-files.d.ts +14 -0
- package/dist/ws-config.cmd.d.ts +61 -0
- package/package.json +7 -7
- package/tsconfig.json +1 -16
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<testsuites tests="6" failures="0" errors="0" skipped="0">
|
|
3
|
-
<testsuite name="teambit.workspace/workspace-config-files@1.0.
|
|
3
|
+
<testsuite name="teambit.workspace/workspace-config-files@1.0.229" tests="6" failures="0" errors="0" skipped="0">
|
|
4
4
|
<testcase classname="dist/dedup-paths.spec.js" name="should reduce files to minimum necessary" time="0.001"/>
|
|
5
5
|
<testcase classname="dist/dedup-paths.spec.js" name="should place files in correct folders"/>
|
|
6
6
|
<testcase classname="dist/dedup-paths.spec.js" name="should reduce files to minimum necessary"/>
|
|
7
|
-
<testcase classname="dist/dedup-paths.spec.js" name="should place files in correct folders"
|
|
7
|
+
<testcase classname="dist/dedup-paths.spec.js" name="should place files in correct folders"/>
|
|
8
8
|
<testcase classname="dist/dedup-paths.spec.js" name="should reduce files to minimum necessary"/>
|
|
9
9
|
<testcase classname="dist/dedup-paths.spec.js" name="should place files in correct folders"/>
|
|
10
10
|
</testsuite>
|
package/artifacts/schema.json
CHANGED
|
@@ -48,7 +48,11 @@
|
|
|
48
48
|
"line": 102,
|
|
49
49
|
"character": 24
|
|
50
50
|
},
|
|
51
|
-
"name": "Workspace"
|
|
51
|
+
"name": "Workspace",
|
|
52
|
+
"componentId": {
|
|
53
|
+
"scope": "teambit.workspace",
|
|
54
|
+
"name": "workspace"
|
|
55
|
+
}
|
|
52
56
|
},
|
|
53
57
|
"isOptional": false,
|
|
54
58
|
"isSpread": false
|
|
@@ -68,7 +72,11 @@
|
|
|
68
72
|
"line": 103,
|
|
69
73
|
"character": 19
|
|
70
74
|
},
|
|
71
|
-
"name": "EnvsMain"
|
|
75
|
+
"name": "EnvsMain",
|
|
76
|
+
"componentId": {
|
|
77
|
+
"scope": "teambit.envs",
|
|
78
|
+
"name": "envs"
|
|
79
|
+
}
|
|
72
80
|
},
|
|
73
81
|
"isOptional": false,
|
|
74
82
|
"isSpread": false
|
|
@@ -88,7 +96,11 @@
|
|
|
88
96
|
"line": 104,
|
|
89
97
|
"character": 21
|
|
90
98
|
},
|
|
91
|
-
"name": "Logger"
|
|
99
|
+
"name": "Logger",
|
|
100
|
+
"componentId": {
|
|
101
|
+
"scope": "teambit.harmony",
|
|
102
|
+
"name": "logger"
|
|
103
|
+
}
|
|
92
104
|
},
|
|
93
105
|
"isOptional": false,
|
|
94
106
|
"isSpread": false
|
|
@@ -108,7 +120,8 @@
|
|
|
108
120
|
"line": 105,
|
|
109
121
|
"character": 21
|
|
110
122
|
},
|
|
111
|
-
"name": "WorkspaceConfigFilesAspectConfig"
|
|
123
|
+
"name": "WorkspaceConfigFilesAspectConfig",
|
|
124
|
+
"internalFilePath": "workspace-config-files.main.runtime.ts"
|
|
112
125
|
},
|
|
113
126
|
"isOptional": false,
|
|
114
127
|
"isSpread": false
|
|
@@ -159,7 +172,8 @@
|
|
|
159
172
|
"line": 111,
|
|
160
173
|
"character": 14
|
|
161
174
|
},
|
|
162
|
-
"name": "WriteConfigFilesOptions"
|
|
175
|
+
"name": "WriteConfigFilesOptions",
|
|
176
|
+
"internalFilePath": "workspace-config-files.main.runtime.ts"
|
|
163
177
|
}
|
|
164
178
|
},
|
|
165
179
|
{
|
|
@@ -192,7 +206,8 @@
|
|
|
192
206
|
"line": 120,
|
|
193
207
|
"character": 35
|
|
194
208
|
},
|
|
195
|
-
"name": "WriteConfigFilesOptions"
|
|
209
|
+
"name": "WriteConfigFilesOptions",
|
|
210
|
+
"internalFilePath": "workspace-config-files.main.runtime.ts"
|
|
196
211
|
},
|
|
197
212
|
"isOptional": true,
|
|
198
213
|
"defaultValue": "{}",
|
|
@@ -258,7 +273,8 @@
|
|
|
258
273
|
"line": 171,
|
|
259
274
|
"character": 44
|
|
260
275
|
},
|
|
261
|
-
"name": "WriteConfigFilesOptions"
|
|
276
|
+
"name": "WriteConfigFilesOptions",
|
|
277
|
+
"internalFilePath": "workspace-config-files.main.runtime.ts"
|
|
262
278
|
},
|
|
263
279
|
"isOptional": true,
|
|
264
280
|
"defaultValue": "{}",
|
|
@@ -342,7 +358,8 @@
|
|
|
342
358
|
"line": 180,
|
|
343
359
|
"character": 14
|
|
344
360
|
},
|
|
345
|
-
"name": "CleanConfigFilesOptions"
|
|
361
|
+
"name": "CleanConfigFilesOptions",
|
|
362
|
+
"internalFilePath": "workspace-config-files.main.runtime.ts"
|
|
346
363
|
}
|
|
347
364
|
},
|
|
348
365
|
{
|
|
@@ -375,7 +392,8 @@
|
|
|
375
392
|
"line": 183,
|
|
376
393
|
"character": 35
|
|
377
394
|
},
|
|
378
|
-
"name": "CleanConfigFilesOptions"
|
|
395
|
+
"name": "CleanConfigFilesOptions",
|
|
396
|
+
"internalFilePath": "workspace-config-files.main.runtime.ts"
|
|
379
397
|
},
|
|
380
398
|
"isOptional": true,
|
|
381
399
|
"defaultValue": "{}",
|
|
@@ -505,7 +523,8 @@
|
|
|
505
523
|
"line": 205,
|
|
506
524
|
"character": 38
|
|
507
525
|
},
|
|
508
|
-
"name": "EnvConfigWritersList"
|
|
526
|
+
"name": "EnvConfigWritersList",
|
|
527
|
+
"internalFilePath": "workspace-config-files.main.runtime.ts"
|
|
509
528
|
}
|
|
510
529
|
]
|
|
511
530
|
},
|
|
@@ -580,7 +599,8 @@
|
|
|
580
599
|
"line": 343,
|
|
581
600
|
"character": 44
|
|
582
601
|
},
|
|
583
|
-
"name": "WriteConfigFilesOptions"
|
|
602
|
+
"name": "WriteConfigFilesOptions",
|
|
603
|
+
"internalFilePath": "workspace-config-files.main.runtime.ts"
|
|
584
604
|
},
|
|
585
605
|
"isOptional": false,
|
|
586
606
|
"objectBindingNodes": [
|
|
@@ -762,7 +782,8 @@
|
|
|
762
782
|
"line": 410,
|
|
763
783
|
"character": 33
|
|
764
784
|
},
|
|
765
|
-
"name": "WorkspaceConfigFilesAspectConfig"
|
|
785
|
+
"name": "WorkspaceConfigFilesAspectConfig",
|
|
786
|
+
"internalFilePath": "workspace-config-files.main.runtime.ts"
|
|
766
787
|
}
|
|
767
788
|
]
|
|
768
789
|
},
|
|
@@ -802,7 +823,11 @@
|
|
|
802
823
|
"line": 415,
|
|
803
824
|
"character": 44
|
|
804
825
|
},
|
|
805
|
-
"name": "CLIMain"
|
|
826
|
+
"name": "CLIMain",
|
|
827
|
+
"componentId": {
|
|
828
|
+
"scope": "teambit.harmony",
|
|
829
|
+
"name": "cli"
|
|
830
|
+
}
|
|
806
831
|
},
|
|
807
832
|
{
|
|
808
833
|
"__schema": "TypeRefSchema",
|
|
@@ -811,7 +836,11 @@
|
|
|
811
836
|
"line": 415,
|
|
812
837
|
"character": 53
|
|
813
838
|
},
|
|
814
|
-
"name": "Workspace"
|
|
839
|
+
"name": "Workspace",
|
|
840
|
+
"componentId": {
|
|
841
|
+
"scope": "teambit.workspace",
|
|
842
|
+
"name": "workspace"
|
|
843
|
+
}
|
|
815
844
|
},
|
|
816
845
|
{
|
|
817
846
|
"__schema": "TypeRefSchema",
|
|
@@ -820,7 +849,11 @@
|
|
|
820
849
|
"line": 415,
|
|
821
850
|
"character": 64
|
|
822
851
|
},
|
|
823
|
-
"name": "EnvsMain"
|
|
852
|
+
"name": "EnvsMain",
|
|
853
|
+
"componentId": {
|
|
854
|
+
"scope": "teambit.envs",
|
|
855
|
+
"name": "envs"
|
|
856
|
+
}
|
|
824
857
|
},
|
|
825
858
|
{
|
|
826
859
|
"__schema": "TypeRefSchema",
|
|
@@ -829,7 +862,11 @@
|
|
|
829
862
|
"line": 415,
|
|
830
863
|
"character": 74
|
|
831
864
|
},
|
|
832
|
-
"name": "LoggerMain"
|
|
865
|
+
"name": "LoggerMain",
|
|
866
|
+
"componentId": {
|
|
867
|
+
"scope": "teambit.harmony",
|
|
868
|
+
"name": "logger"
|
|
869
|
+
}
|
|
833
870
|
}
|
|
834
871
|
]
|
|
835
872
|
},
|
|
@@ -851,7 +888,8 @@
|
|
|
851
888
|
"line": 416,
|
|
852
889
|
"character": 13
|
|
853
890
|
},
|
|
854
|
-
"name": "WorkspaceConfigFilesAspectConfig"
|
|
891
|
+
"name": "WorkspaceConfigFilesAspectConfig",
|
|
892
|
+
"internalFilePath": "workspace-config-files.main.runtime.ts"
|
|
855
893
|
},
|
|
856
894
|
"isOptional": false,
|
|
857
895
|
"isSpread": false
|
|
@@ -1507,7 +1545,11 @@
|
|
|
1507
1545
|
"line": 97,
|
|
1508
1546
|
"character": 23
|
|
1509
1547
|
},
|
|
1510
|
-
"name": "ExecutionContext"
|
|
1548
|
+
"name": "ExecutionContext",
|
|
1549
|
+
"componentId": {
|
|
1550
|
+
"scope": "teambit.envs",
|
|
1551
|
+
"name": "envs"
|
|
1552
|
+
}
|
|
1511
1553
|
},
|
|
1512
1554
|
"isOptional": false,
|
|
1513
1555
|
"isSpread": false
|
|
@@ -1527,7 +1569,11 @@
|
|
|
1527
1569
|
"line": 98,
|
|
1528
1570
|
"character": 10
|
|
1529
1571
|
},
|
|
1530
|
-
"name": "Environment"
|
|
1572
|
+
"name": "Environment",
|
|
1573
|
+
"componentId": {
|
|
1574
|
+
"scope": "teambit.envs",
|
|
1575
|
+
"name": "envs"
|
|
1576
|
+
}
|
|
1531
1577
|
},
|
|
1532
1578
|
"isOptional": false,
|
|
1533
1579
|
"isSpread": false
|
|
@@ -1659,7 +1705,8 @@
|
|
|
1659
1705
|
"line": 110,
|
|
1660
1706
|
"character": 22
|
|
1661
1707
|
},
|
|
1662
|
-
"name": "MergeConfigFilesFunc"
|
|
1708
|
+
"name": "MergeConfigFilesFunc",
|
|
1709
|
+
"internalFilePath": "config-writer-entry.ts"
|
|
1663
1710
|
},
|
|
1664
1711
|
"isOptional": true
|
|
1665
1712
|
},
|
|
@@ -1829,7 +1876,8 @@
|
|
|
1829
1876
|
"line": 134,
|
|
1830
1877
|
"character": 29
|
|
1831
1878
|
},
|
|
1832
|
-
"name": "PostProcessExtendingConfigFilesOneFile"
|
|
1879
|
+
"name": "PostProcessExtendingConfigFilesOneFile",
|
|
1880
|
+
"internalFilePath": "config-writer-entry.ts"
|
|
1833
1881
|
}
|
|
1834
1882
|
]
|
|
1835
1883
|
},
|
|
@@ -2018,7 +2066,8 @@
|
|
|
2018
2066
|
"line": 34,
|
|
2019
2067
|
"character": 48
|
|
2020
2068
|
},
|
|
2021
|
-
"name": "ExtendingConfigFileAdditionalProp"
|
|
2069
|
+
"name": "ExtendingConfigFileAdditionalProp",
|
|
2070
|
+
"internalFilePath": "config-writer-entry.ts"
|
|
2022
2071
|
}
|
|
2023
2072
|
]
|
|
2024
2073
|
}
|
|
@@ -2381,7 +2430,8 @@
|
|
|
2381
2430
|
"line": 57,
|
|
2382
2431
|
"character": 23
|
|
2383
2432
|
},
|
|
2384
|
-
"name": "WrittenConfigFile"
|
|
2433
|
+
"name": "WrittenConfigFile",
|
|
2434
|
+
"internalFilePath": "writers/real-config-files.ts"
|
|
2385
2435
|
}
|
|
2386
2436
|
},
|
|
2387
2437
|
"isOptional": false
|
|
@@ -2443,6 +2493,10 @@
|
|
|
2443
2493
|
"character": 12
|
|
2444
2494
|
},
|
|
2445
2495
|
"name": "EnvHandler",
|
|
2496
|
+
"componentId": {
|
|
2497
|
+
"scope": "teambit.envs",
|
|
2498
|
+
"name": "envs"
|
|
2499
|
+
},
|
|
2446
2500
|
"typeArgs": [
|
|
2447
2501
|
{
|
|
2448
2502
|
"__schema": "TypeRefSchema",
|
|
@@ -2901,7 +2955,11 @@
|
|
|
2901
2955
|
"line": 76,
|
|
2902
2956
|
"character": 20
|
|
2903
2957
|
},
|
|
2904
|
-
"name": "EnvContext"
|
|
2958
|
+
"name": "EnvContext",
|
|
2959
|
+
"componentId": {
|
|
2960
|
+
"scope": "teambit.envs",
|
|
2961
|
+
"name": "envs"
|
|
2962
|
+
}
|
|
2905
2963
|
},
|
|
2906
2964
|
"isOptional": false,
|
|
2907
2965
|
"isSpread": false
|
|
@@ -3301,7 +3359,8 @@
|
|
|
3301
3359
|
"line": 53,
|
|
3302
3360
|
"character": 42
|
|
3303
3361
|
},
|
|
3304
|
-
"name": "EnvConfigWriter"
|
|
3362
|
+
"name": "EnvConfigWriter",
|
|
3363
|
+
"internalFilePath": "workspace-config-files.main.runtime.ts"
|
|
3305
3364
|
}
|
|
3306
3365
|
]
|
|
3307
3366
|
}
|
|
@@ -4149,7 +4208,11 @@
|
|
|
4149
4208
|
"line": 102,
|
|
4150
4209
|
"character": 24
|
|
4151
4210
|
},
|
|
4152
|
-
"name": "Workspace"
|
|
4211
|
+
"name": "Workspace",
|
|
4212
|
+
"componentId": {
|
|
4213
|
+
"scope": "teambit.workspace",
|
|
4214
|
+
"name": "workspace"
|
|
4215
|
+
}
|
|
4153
4216
|
},
|
|
4154
4217
|
"isOptional": false,
|
|
4155
4218
|
"isSpread": false
|
|
@@ -4169,7 +4232,11 @@
|
|
|
4169
4232
|
"line": 103,
|
|
4170
4233
|
"character": 19
|
|
4171
4234
|
},
|
|
4172
|
-
"name": "EnvsMain"
|
|
4235
|
+
"name": "EnvsMain",
|
|
4236
|
+
"componentId": {
|
|
4237
|
+
"scope": "teambit.envs",
|
|
4238
|
+
"name": "envs"
|
|
4239
|
+
}
|
|
4173
4240
|
},
|
|
4174
4241
|
"isOptional": false,
|
|
4175
4242
|
"isSpread": false
|
|
@@ -4189,7 +4256,11 @@
|
|
|
4189
4256
|
"line": 104,
|
|
4190
4257
|
"character": 21
|
|
4191
4258
|
},
|
|
4192
|
-
"name": "Logger"
|
|
4259
|
+
"name": "Logger",
|
|
4260
|
+
"componentId": {
|
|
4261
|
+
"scope": "teambit.harmony",
|
|
4262
|
+
"name": "logger"
|
|
4263
|
+
}
|
|
4193
4264
|
},
|
|
4194
4265
|
"isOptional": false,
|
|
4195
4266
|
"isSpread": false
|
|
@@ -4209,7 +4280,8 @@
|
|
|
4209
4280
|
"line": 105,
|
|
4210
4281
|
"character": 21
|
|
4211
4282
|
},
|
|
4212
|
-
"name": "WorkspaceConfigFilesAspectConfig"
|
|
4283
|
+
"name": "WorkspaceConfigFilesAspectConfig",
|
|
4284
|
+
"internalFilePath": "workspace-config-files.main.runtime.ts"
|
|
4213
4285
|
},
|
|
4214
4286
|
"isOptional": false,
|
|
4215
4287
|
"isSpread": false
|
|
@@ -4260,7 +4332,8 @@
|
|
|
4260
4332
|
"line": 111,
|
|
4261
4333
|
"character": 14
|
|
4262
4334
|
},
|
|
4263
|
-
"name": "WriteConfigFilesOptions"
|
|
4335
|
+
"name": "WriteConfigFilesOptions",
|
|
4336
|
+
"internalFilePath": "workspace-config-files.main.runtime.ts"
|
|
4264
4337
|
}
|
|
4265
4338
|
},
|
|
4266
4339
|
{
|
|
@@ -4293,7 +4366,8 @@
|
|
|
4293
4366
|
"line": 120,
|
|
4294
4367
|
"character": 35
|
|
4295
4368
|
},
|
|
4296
|
-
"name": "WriteConfigFilesOptions"
|
|
4369
|
+
"name": "WriteConfigFilesOptions",
|
|
4370
|
+
"internalFilePath": "workspace-config-files.main.runtime.ts"
|
|
4297
4371
|
},
|
|
4298
4372
|
"isOptional": true,
|
|
4299
4373
|
"defaultValue": "{}",
|
|
@@ -4359,7 +4433,8 @@
|
|
|
4359
4433
|
"line": 171,
|
|
4360
4434
|
"character": 44
|
|
4361
4435
|
},
|
|
4362
|
-
"name": "WriteConfigFilesOptions"
|
|
4436
|
+
"name": "WriteConfigFilesOptions",
|
|
4437
|
+
"internalFilePath": "workspace-config-files.main.runtime.ts"
|
|
4363
4438
|
},
|
|
4364
4439
|
"isOptional": true,
|
|
4365
4440
|
"defaultValue": "{}",
|
|
@@ -4443,7 +4518,8 @@
|
|
|
4443
4518
|
"line": 180,
|
|
4444
4519
|
"character": 14
|
|
4445
4520
|
},
|
|
4446
|
-
"name": "CleanConfigFilesOptions"
|
|
4521
|
+
"name": "CleanConfigFilesOptions",
|
|
4522
|
+
"internalFilePath": "workspace-config-files.main.runtime.ts"
|
|
4447
4523
|
}
|
|
4448
4524
|
},
|
|
4449
4525
|
{
|
|
@@ -4476,7 +4552,8 @@
|
|
|
4476
4552
|
"line": 183,
|
|
4477
4553
|
"character": 35
|
|
4478
4554
|
},
|
|
4479
|
-
"name": "CleanConfigFilesOptions"
|
|
4555
|
+
"name": "CleanConfigFilesOptions",
|
|
4556
|
+
"internalFilePath": "workspace-config-files.main.runtime.ts"
|
|
4480
4557
|
},
|
|
4481
4558
|
"isOptional": true,
|
|
4482
4559
|
"defaultValue": "{}",
|
|
@@ -4606,7 +4683,8 @@
|
|
|
4606
4683
|
"line": 205,
|
|
4607
4684
|
"character": 38
|
|
4608
4685
|
},
|
|
4609
|
-
"name": "EnvConfigWritersList"
|
|
4686
|
+
"name": "EnvConfigWritersList",
|
|
4687
|
+
"internalFilePath": "workspace-config-files.main.runtime.ts"
|
|
4610
4688
|
}
|
|
4611
4689
|
]
|
|
4612
4690
|
},
|
|
@@ -4681,7 +4759,8 @@
|
|
|
4681
4759
|
"line": 343,
|
|
4682
4760
|
"character": 44
|
|
4683
4761
|
},
|
|
4684
|
-
"name": "WriteConfigFilesOptions"
|
|
4762
|
+
"name": "WriteConfigFilesOptions",
|
|
4763
|
+
"internalFilePath": "workspace-config-files.main.runtime.ts"
|
|
4685
4764
|
},
|
|
4686
4765
|
"isOptional": false,
|
|
4687
4766
|
"objectBindingNodes": [
|
|
@@ -4863,7 +4942,8 @@
|
|
|
4863
4942
|
"line": 410,
|
|
4864
4943
|
"character": 33
|
|
4865
4944
|
},
|
|
4866
|
-
"name": "WorkspaceConfigFilesAspectConfig"
|
|
4945
|
+
"name": "WorkspaceConfigFilesAspectConfig",
|
|
4946
|
+
"internalFilePath": "workspace-config-files.main.runtime.ts"
|
|
4867
4947
|
}
|
|
4868
4948
|
]
|
|
4869
4949
|
},
|
|
@@ -4903,7 +4983,11 @@
|
|
|
4903
4983
|
"line": 415,
|
|
4904
4984
|
"character": 44
|
|
4905
4985
|
},
|
|
4906
|
-
"name": "CLIMain"
|
|
4986
|
+
"name": "CLIMain",
|
|
4987
|
+
"componentId": {
|
|
4988
|
+
"scope": "teambit.harmony",
|
|
4989
|
+
"name": "cli"
|
|
4990
|
+
}
|
|
4907
4991
|
},
|
|
4908
4992
|
{
|
|
4909
4993
|
"__schema": "TypeRefSchema",
|
|
@@ -4912,7 +4996,11 @@
|
|
|
4912
4996
|
"line": 415,
|
|
4913
4997
|
"character": 53
|
|
4914
4998
|
},
|
|
4915
|
-
"name": "Workspace"
|
|
4999
|
+
"name": "Workspace",
|
|
5000
|
+
"componentId": {
|
|
5001
|
+
"scope": "teambit.workspace",
|
|
5002
|
+
"name": "workspace"
|
|
5003
|
+
}
|
|
4916
5004
|
},
|
|
4917
5005
|
{
|
|
4918
5006
|
"__schema": "TypeRefSchema",
|
|
@@ -4921,7 +5009,11 @@
|
|
|
4921
5009
|
"line": 415,
|
|
4922
5010
|
"character": 64
|
|
4923
5011
|
},
|
|
4924
|
-
"name": "EnvsMain"
|
|
5012
|
+
"name": "EnvsMain",
|
|
5013
|
+
"componentId": {
|
|
5014
|
+
"scope": "teambit.envs",
|
|
5015
|
+
"name": "envs"
|
|
5016
|
+
}
|
|
4925
5017
|
},
|
|
4926
5018
|
{
|
|
4927
5019
|
"__schema": "TypeRefSchema",
|
|
@@ -4930,7 +5022,11 @@
|
|
|
4930
5022
|
"line": 415,
|
|
4931
5023
|
"character": 74
|
|
4932
5024
|
},
|
|
4933
|
-
"name": "LoggerMain"
|
|
5025
|
+
"name": "LoggerMain",
|
|
5026
|
+
"componentId": {
|
|
5027
|
+
"scope": "teambit.harmony",
|
|
5028
|
+
"name": "logger"
|
|
5029
|
+
}
|
|
4934
5030
|
}
|
|
4935
5031
|
]
|
|
4936
5032
|
},
|
|
@@ -4952,7 +5048,8 @@
|
|
|
4952
5048
|
"line": 416,
|
|
4953
5049
|
"character": 13
|
|
4954
5050
|
},
|
|
4955
|
-
"name": "WorkspaceConfigFilesAspectConfig"
|
|
5051
|
+
"name": "WorkspaceConfigFilesAspectConfig",
|
|
5052
|
+
"internalFilePath": "workspace-config-files.main.runtime.ts"
|
|
4956
5053
|
},
|
|
4957
5054
|
"isOptional": false,
|
|
4958
5055
|
"isSpread": false
|
|
@@ -5046,7 +5143,8 @@
|
|
|
5046
5143
|
"line": 50,
|
|
5047
5144
|
"character": 23
|
|
5048
5145
|
},
|
|
5049
|
-
"name": "EnvConfigWriterEntry"
|
|
5146
|
+
"name": "EnvConfigWriterEntry",
|
|
5147
|
+
"internalFilePath": "workspace-config-files.main.runtime.ts"
|
|
5050
5148
|
}
|
|
5051
5149
|
}
|
|
5052
5150
|
}
|
|
@@ -5297,7 +5395,8 @@
|
|
|
5297
5395
|
"line": 34,
|
|
5298
5396
|
"character": 48
|
|
5299
5397
|
},
|
|
5300
|
-
"name": "ExtendingConfigFileAdditionalProp"
|
|
5398
|
+
"name": "ExtendingConfigFileAdditionalProp",
|
|
5399
|
+
"internalFilePath": "config-writer-entry.ts"
|
|
5301
5400
|
}
|
|
5302
5401
|
]
|
|
5303
5402
|
}
|
|
@@ -5550,7 +5649,8 @@
|
|
|
5550
5649
|
"line": 57,
|
|
5551
5650
|
"character": 23
|
|
5552
5651
|
},
|
|
5553
|
-
"name": "WrittenConfigFile"
|
|
5652
|
+
"name": "WrittenConfigFile",
|
|
5653
|
+
"internalFilePath": "writers/real-config-files.ts"
|
|
5554
5654
|
}
|
|
5555
5655
|
},
|
|
5556
5656
|
"isOptional": false
|
|
@@ -5827,7 +5927,11 @@
|
|
|
5827
5927
|
"line": 97,
|
|
5828
5928
|
"character": 23
|
|
5829
5929
|
},
|
|
5830
|
-
"name": "ExecutionContext"
|
|
5930
|
+
"name": "ExecutionContext",
|
|
5931
|
+
"componentId": {
|
|
5932
|
+
"scope": "teambit.envs",
|
|
5933
|
+
"name": "envs"
|
|
5934
|
+
}
|
|
5831
5935
|
},
|
|
5832
5936
|
"isOptional": false,
|
|
5833
5937
|
"isSpread": false
|
|
@@ -5847,7 +5951,11 @@
|
|
|
5847
5951
|
"line": 98,
|
|
5848
5952
|
"character": 10
|
|
5849
5953
|
},
|
|
5850
|
-
"name": "Environment"
|
|
5954
|
+
"name": "Environment",
|
|
5955
|
+
"componentId": {
|
|
5956
|
+
"scope": "teambit.envs",
|
|
5957
|
+
"name": "envs"
|
|
5958
|
+
}
|
|
5851
5959
|
},
|
|
5852
5960
|
"isOptional": false,
|
|
5853
5961
|
"isSpread": false
|
|
@@ -5979,7 +6087,8 @@
|
|
|
5979
6087
|
"line": 110,
|
|
5980
6088
|
"character": 22
|
|
5981
6089
|
},
|
|
5982
|
-
"name": "MergeConfigFilesFunc"
|
|
6090
|
+
"name": "MergeConfigFilesFunc",
|
|
6091
|
+
"internalFilePath": "config-writer-entry.ts"
|
|
5983
6092
|
},
|
|
5984
6093
|
"isOptional": true
|
|
5985
6094
|
},
|
|
@@ -6149,7 +6258,8 @@
|
|
|
6149
6258
|
"line": 134,
|
|
6150
6259
|
"character": 29
|
|
6151
6260
|
},
|
|
6152
|
-
"name": "PostProcessExtendingConfigFilesOneFile"
|
|
6261
|
+
"name": "PostProcessExtendingConfigFilesOneFile",
|
|
6262
|
+
"internalFilePath": "config-writer-entry.ts"
|
|
6153
6263
|
}
|
|
6154
6264
|
]
|
|
6155
6265
|
},
|
|
@@ -6350,6 +6460,10 @@
|
|
|
6350
6460
|
"character": 12
|
|
6351
6461
|
},
|
|
6352
6462
|
"name": "EnvHandler",
|
|
6463
|
+
"componentId": {
|
|
6464
|
+
"scope": "teambit.envs",
|
|
6465
|
+
"name": "envs"
|
|
6466
|
+
},
|
|
6353
6467
|
"typeArgs": [
|
|
6354
6468
|
{
|
|
6355
6469
|
"__schema": "TypeRefSchema",
|
|
@@ -6764,7 +6878,11 @@
|
|
|
6764
6878
|
"line": 76,
|
|
6765
6879
|
"character": 20
|
|
6766
6880
|
},
|
|
6767
|
-
"name": "EnvContext"
|
|
6881
|
+
"name": "EnvContext",
|
|
6882
|
+
"componentId": {
|
|
6883
|
+
"scope": "teambit.envs",
|
|
6884
|
+
"name": "envs"
|
|
6885
|
+
}
|
|
6768
6886
|
},
|
|
6769
6887
|
"isOptional": false,
|
|
6770
6888
|
"isSpread": false
|
|
@@ -6889,7 +7007,7 @@
|
|
|
6889
7007
|
"componentId": {
|
|
6890
7008
|
"scope": "teambit.workspace",
|
|
6891
7009
|
"name": "workspace-config-files",
|
|
6892
|
-
"version": "1.0.
|
|
7010
|
+
"version": "1.0.229"
|
|
6893
7011
|
},
|
|
6894
7012
|
"taggedModuleExports": []
|
|
6895
7013
|
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { Environment, ExecutionContext } from '@teambit/envs';
|
|
2
|
+
import { EnvMapValue } from './workspace-config-files.main.runtime';
|
|
3
|
+
import { WrittenConfigFile } from './writers';
|
|
4
|
+
export type ConfigFile = {
|
|
5
|
+
/**
|
|
6
|
+
* Name of the config file.
|
|
7
|
+
* supports also using `{hash}` in the name, which will be replaced by the hash of the config file.
|
|
8
|
+
*/
|
|
9
|
+
name: string;
|
|
10
|
+
/**
|
|
11
|
+
* Content of the config file.
|
|
12
|
+
* I.E the content of the tsconfig.json file.
|
|
13
|
+
*/
|
|
14
|
+
content: string;
|
|
15
|
+
/**
|
|
16
|
+
* Hash of the config file.
|
|
17
|
+
*/
|
|
18
|
+
hash?: string;
|
|
19
|
+
};
|
|
20
|
+
export type ExtendingConfigFileAdditionalProp = {
|
|
21
|
+
/**
|
|
22
|
+
* the config file that this config file extends.
|
|
23
|
+
*/
|
|
24
|
+
extendingTarget: WrittenConfigFile;
|
|
25
|
+
/**
|
|
26
|
+
* When replacing the config file name with the actual path of the config file, use absolute paths.
|
|
27
|
+
*/
|
|
28
|
+
useAbsPaths?: boolean;
|
|
29
|
+
};
|
|
30
|
+
export type ExtendingConfigFile = ConfigFile & ExtendingConfigFileAdditionalProp;
|
|
31
|
+
export type PostProcessExtendingConfigFilesArgs = {
|
|
32
|
+
workspaceDir: string;
|
|
33
|
+
configsRootDir: string;
|
|
34
|
+
extendingConfigFile: ExtendingConfigFile;
|
|
35
|
+
/**
|
|
36
|
+
* Paths that the file will be written to.
|
|
37
|
+
*/
|
|
38
|
+
paths: string[];
|
|
39
|
+
envMapValue: EnvMapValue;
|
|
40
|
+
/**
|
|
41
|
+
* This is a flag for backward compatibility
|
|
42
|
+
* We used to return string from the post process, so old versions of bit only knows to handle string results
|
|
43
|
+
* while in new version we support getting array of objects
|
|
44
|
+
* we need to know if bit the user is using support the new format or not
|
|
45
|
+
*/
|
|
46
|
+
supportSpecificPathChange?: boolean;
|
|
47
|
+
};
|
|
48
|
+
export type GenerateExtendingConfigFilesArgs = {
|
|
49
|
+
workspaceDir: string;
|
|
50
|
+
configsRootDir: string;
|
|
51
|
+
writtenConfigFiles: WrittenConfigFile[];
|
|
52
|
+
envMapValue: EnvMapValue;
|
|
53
|
+
};
|
|
54
|
+
export type PostProcessExtendingConfigFilesOneFile = {
|
|
55
|
+
path: string;
|
|
56
|
+
content: string;
|
|
57
|
+
};
|
|
58
|
+
export type MergeConfigFilesFunc = (configFile: ConfigFile, configFile2: ConfigFile) => string;
|
|
59
|
+
export interface ConfigWriterEntry {
|
|
60
|
+
/**
|
|
61
|
+
* Id is used for few things:
|
|
62
|
+
* 1. merge/post process different configs files (from different envs) together.
|
|
63
|
+
* 2. filter the config writer by the cli when using --writers flag.
|
|
64
|
+
*/
|
|
65
|
+
id: string;
|
|
66
|
+
/**
|
|
67
|
+
* Name of the config writer.
|
|
68
|
+
* used for outputs and logging.
|
|
69
|
+
*/
|
|
70
|
+
name: string;
|
|
71
|
+
/**
|
|
72
|
+
* Get's the component env and return the config file content
|
|
73
|
+
* for example the eslint config to tsconfig.
|
|
74
|
+
* This also enable to return a hash of the config file, which will be used to determine if
|
|
75
|
+
* 2 config files are the same.
|
|
76
|
+
* If the hash is not provided, the content will be used as the hash.
|
|
77
|
+
* This enables the specific config type to ignore specific fields when calculating the
|
|
78
|
+
* hash in order to ignore theses fields when determining if 2 config files are the same.
|
|
79
|
+
* The calc function also get the target directory of the config file (calculated by this aspect) as sometime there
|
|
80
|
+
* is a need to change the config file content based on the target directory.
|
|
81
|
+
* for example, change the includes/excludes paths to be relative to the target directory.
|
|
82
|
+
* The calc can return undefined if the config file is not relevant for the component. or not supported by the subscriber.
|
|
83
|
+
* for example if the component uses babel to compile, then tsconfig is not relevant.
|
|
84
|
+
* @param env
|
|
85
|
+
*/
|
|
86
|
+
calcConfigFiles(executionContext: ExecutionContext, env: Environment, dir: string, workspaceDir?: string): ConfigFile[] | undefined;
|
|
87
|
+
/**
|
|
88
|
+
* Provide a function that knows how to merge 2 config files together.
|
|
89
|
+
* This is used when 2 different envs generate the same config file hash.
|
|
90
|
+
* sometime we want to merge the 2 config files together.
|
|
91
|
+
* @param configFile
|
|
92
|
+
* @param configFile2
|
|
93
|
+
*/
|
|
94
|
+
mergeConfigFiles?: MergeConfigFilesFunc;
|
|
95
|
+
/**
|
|
96
|
+
* This will be used to generate an extending file content.
|
|
97
|
+
* For example, the tsconfig.json file will extend the real tsconfig.{hash}.json file (that were coming from the env).
|
|
98
|
+
* That way we can avoid writing the same config file multiple times.
|
|
99
|
+
* It also reduces the risk of the user manually change the config file and then the changes will be lost.
|
|
100
|
+
* This function support returning a file with content with a dsl using `{}` to replace the config file name.
|
|
101
|
+
* for example:
|
|
102
|
+
* content = `{
|
|
103
|
+
* "extends": {configFile.name},
|
|
104
|
+
* }`
|
|
105
|
+
*/
|
|
106
|
+
generateExtendingFile(args: GenerateExtendingConfigFilesArgs): ExtendingConfigFile | undefined;
|
|
107
|
+
/**
|
|
108
|
+
* This enables the writer to do some post processing after the extending config files were calculated and deduped.
|
|
109
|
+
* this is important in case when we need to change a config file / extending config file after it was calculated
|
|
110
|
+
* based on all the environments in the ws
|
|
111
|
+
* or based on other config files that were written.
|
|
112
|
+
* @param args
|
|
113
|
+
*/
|
|
114
|
+
postProcessExtendingConfigFiles?(args: PostProcessExtendingConfigFilesArgs): Promise<string | Array<PostProcessExtendingConfigFilesOneFile> | undefined>;
|
|
115
|
+
/**
|
|
116
|
+
* Find all the files that are relevant for the config type.
|
|
117
|
+
* This is used to clean / delete these files
|
|
118
|
+
* This should return an array of glob patterns (that will passed to the globby/minimatch library)
|
|
119
|
+
* @param dir
|
|
120
|
+
*/
|
|
121
|
+
patterns: string[];
|
|
122
|
+
/**
|
|
123
|
+
* A function to determine if a file was generated by bit.
|
|
124
|
+
* This is useful to check if the config file was generated by bit to prevent delete user's file.
|
|
125
|
+
* @param filePath
|
|
126
|
+
* @returns
|
|
127
|
+
*/
|
|
128
|
+
isBitGenerated?: (filePath: string) => boolean;
|
|
129
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { EnvContext, EnvHandler } from '@teambit/envs';
|
|
2
|
+
import { ConfigWriterEntry } from './config-writer-entry';
|
|
3
|
+
export type ConfigWriterHandler = {
|
|
4
|
+
handler: EnvHandler<ConfigWriterEntry>;
|
|
5
|
+
name: string;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* create and maintain config writer list for component dev environments.
|
|
9
|
+
*/
|
|
10
|
+
export declare class ConfigWriterList {
|
|
11
|
+
private _writers;
|
|
12
|
+
constructor(_writers: ConfigWriterHandler[]);
|
|
13
|
+
/**
|
|
14
|
+
* list all congig writer handlers in the list.
|
|
15
|
+
*/
|
|
16
|
+
get writers(): ConfigWriterHandler[];
|
|
17
|
+
private initiateWriters;
|
|
18
|
+
/**
|
|
19
|
+
* add writers to the list.
|
|
20
|
+
*/
|
|
21
|
+
add(writers: ConfigWriterHandler[]): this;
|
|
22
|
+
/**
|
|
23
|
+
* remove writers from the list.
|
|
24
|
+
*/
|
|
25
|
+
remove(writerNames: string[]): this;
|
|
26
|
+
/**
|
|
27
|
+
* replace writers in the list.
|
|
28
|
+
*/
|
|
29
|
+
replace(writers: ConfigWriterHandler[]): this;
|
|
30
|
+
/**
|
|
31
|
+
* return a new list with the writers from the args added.
|
|
32
|
+
* @param pipeline
|
|
33
|
+
* @returns
|
|
34
|
+
*/
|
|
35
|
+
concat(writerList: ConfigWriterList): ConfigWriterList;
|
|
36
|
+
/**
|
|
37
|
+
* compute the list.
|
|
38
|
+
*/
|
|
39
|
+
compute(context: EnvContext): ConfigWriterEntry[];
|
|
40
|
+
static from(writersHandlers: ConfigWriterHandler[]): ConfigWriterList;
|
|
41
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { CompPathExtendingHashMap, EnvCompsDirsMap } from './workspace-config-files.main.runtime';
|
|
2
|
+
import { ExtendingConfigFilesMap } from './writers';
|
|
3
|
+
export type DedupedPaths = Array<{
|
|
4
|
+
fileHash: string;
|
|
5
|
+
paths: string[];
|
|
6
|
+
}>;
|
|
7
|
+
export declare function buildCompPathExtendingHashMap(extendingConfigFilesMap: ExtendingConfigFilesMap, envCompsDirsMap: EnvCompsDirsMap): CompPathExtendingHashMap;
|
|
8
|
+
/**
|
|
9
|
+
* easier to understand by an example:
|
|
10
|
+
* input:
|
|
11
|
+
* [
|
|
12
|
+
* { fileHash: hash1, paths: [ui/button, ui/form] },
|
|
13
|
+
* { fileHash: hash2, paths: [p/a1, p/a2] },
|
|
14
|
+
* { fileHash: hash3, paths: [p/n1] },
|
|
15
|
+
* ]
|
|
16
|
+
*
|
|
17
|
+
* output:
|
|
18
|
+
* [
|
|
19
|
+
* { fileHash: hash1, paths: [ui] },
|
|
20
|
+
* { fileHash: hash2, paths: [p] },
|
|
21
|
+
* { fileHash: hash3, paths: [p/n1] },
|
|
22
|
+
* ]
|
|
23
|
+
*
|
|
24
|
+
* the goal is to minimize the amount of files to write per env if possible.
|
|
25
|
+
* when multiple components of the same env share a root-dir, then, it's enough to write a file in that shared dir.
|
|
26
|
+
* if in a shared-dir, some components using env1 and some env2, it finds the env that has the max number of
|
|
27
|
+
* components, this env will be optimized. other components, will have the files written inside their dirs.
|
|
28
|
+
*/
|
|
29
|
+
export declare function dedupePaths(extendingConfigFilesMap: ExtendingConfigFilesMap, envCompsDirsMap: EnvCompsDirsMap): DedupedPaths;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { WorkspaceConfigFilesAspect } from './workspace-config-files.aspect';
|
|
2
|
+
export type { WorkspaceConfigFilesMain, WriteConfigFilesResult, EnvCompsDirsMap, EnvMapValue, OneConfigWriterIdResult, WriteResults, } from './workspace-config-files.main.runtime';
|
|
3
|
+
export type { ConfigWriterEntry, ExtendingConfigFile, ConfigFile, PostProcessExtendingConfigFilesArgs, GenerateExtendingConfigFilesArgs, } from './config-writer-entry';
|
|
4
|
+
export type { ConfigWriterHandler } from './config-writer-list';
|
|
5
|
+
export type { WorkspaceConfigEnv } from './workspace-config-env-type';
|
|
6
|
+
export { ConfigWriterList } from './config-writer-list';
|
|
7
|
+
export default WorkspaceConfigFilesAspect;
|
|
8
|
+
export { WorkspaceConfigFilesAspect };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { WriteConfigFilesResult } from '../workspace-config-files.main.runtime';
|
|
2
|
+
import type { WriteConfigCmdFlags } from '../ws-config.cmd';
|
|
3
|
+
export declare function verboseFormatWriteOutput(writeConfigFilesResult: WriteConfigFilesResult, flags: WriteConfigCmdFlags): string;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const WRITE_TITLE: (total: number) => string;
|
|
2
|
+
export declare const SUMMARY = "bit writes configuration files in different nested locations in your workspace to meet the configuration needs of different components.\nIDE is now in-sync with component configuration";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
;
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.workspace_workspace-config-files@1.0.
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.workspace_workspace-config-files@1.0.229/dist/workspace-config-files.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [];
|
|
5
5
|
export const overview = [overview_0];
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { CLIMain } from '@teambit/cli';
|
|
2
|
+
import type { Workspace } from '@teambit/workspace';
|
|
3
|
+
import { Environment, ExecutionContext } from '@teambit/envs';
|
|
4
|
+
import type { EnvsMain } from '@teambit/envs';
|
|
5
|
+
import { Logger } from '@teambit/logger';
|
|
6
|
+
import type { LoggerMain } from '@teambit/logger';
|
|
7
|
+
import { ConfigWriterEntry } from './config-writer-entry';
|
|
8
|
+
import { EnvsWrittenExtendingConfigFiles, EnvsWrittenRealConfigFiles } from './writers';
|
|
9
|
+
/**
|
|
10
|
+
* Configs that can be configured in the workspace.jsonc file
|
|
11
|
+
*/
|
|
12
|
+
export type WorkspaceConfigFilesAspectConfig = {
|
|
13
|
+
configsRootDir?: string;
|
|
14
|
+
enableWorkspaceConfigWrite?: boolean;
|
|
15
|
+
};
|
|
16
|
+
export type EnvConfigWriter = {
|
|
17
|
+
envId: string;
|
|
18
|
+
executionContext: ExecutionContext;
|
|
19
|
+
configWriters: ConfigWriterEntry[];
|
|
20
|
+
};
|
|
21
|
+
export type EnvConfigWriterEntry = {
|
|
22
|
+
envId: string;
|
|
23
|
+
configWriter: ConfigWriterEntry;
|
|
24
|
+
executionContext: ExecutionContext;
|
|
25
|
+
};
|
|
26
|
+
export type EnvConfigWritersList = Array<EnvConfigWriter>;
|
|
27
|
+
export type CleanConfigFilesOptions = {
|
|
28
|
+
silent?: boolean;
|
|
29
|
+
dryRun?: boolean;
|
|
30
|
+
writers?: string[];
|
|
31
|
+
};
|
|
32
|
+
export type WriteConfigFilesOptions = {
|
|
33
|
+
clean?: boolean;
|
|
34
|
+
silent?: boolean;
|
|
35
|
+
dedupe?: boolean;
|
|
36
|
+
dryRun?: boolean;
|
|
37
|
+
throw?: boolean;
|
|
38
|
+
writers?: string[];
|
|
39
|
+
};
|
|
40
|
+
export type CompPathExtendingHashMap = {
|
|
41
|
+
[compPath: string]: string;
|
|
42
|
+
};
|
|
43
|
+
export type EnvMapValue = {
|
|
44
|
+
env: Environment;
|
|
45
|
+
id: string[];
|
|
46
|
+
paths: string[];
|
|
47
|
+
};
|
|
48
|
+
export type EnvCompsDirsMap = {
|
|
49
|
+
[envId: string]: EnvMapValue;
|
|
50
|
+
};
|
|
51
|
+
export type OneConfigWriterIdResult = {
|
|
52
|
+
writerId: string;
|
|
53
|
+
totalWrittenFiles: number;
|
|
54
|
+
realConfigFiles: EnvsWrittenRealConfigFiles;
|
|
55
|
+
totalRealConfigFiles: number;
|
|
56
|
+
extendingConfigFiles: EnvsWrittenExtendingConfigFiles;
|
|
57
|
+
totalExtendingConfigFiles: number;
|
|
58
|
+
};
|
|
59
|
+
export type WriteResults = {
|
|
60
|
+
writersResult: OneConfigWriterIdResult[];
|
|
61
|
+
totalWrittenFiles: number;
|
|
62
|
+
totalRealConfigFiles: number;
|
|
63
|
+
totalExtendingConfigFiles: number;
|
|
64
|
+
};
|
|
65
|
+
export type WriteConfigFilesResult = {
|
|
66
|
+
cleanResults?: string[];
|
|
67
|
+
writeResults: WriteResults;
|
|
68
|
+
wsDir: string;
|
|
69
|
+
err?: Error;
|
|
70
|
+
};
|
|
71
|
+
export declare class WorkspaceConfigFilesMain {
|
|
72
|
+
private workspace;
|
|
73
|
+
private envs;
|
|
74
|
+
private logger;
|
|
75
|
+
private config;
|
|
76
|
+
private envsNotImplementing;
|
|
77
|
+
constructor(workspace: Workspace, envs: EnvsMain, logger: Logger, config: WorkspaceConfigFilesAspectConfig);
|
|
78
|
+
/**
|
|
79
|
+
* It writes the configuration files for the workspace
|
|
80
|
+
* for example: tsconfig, eslint config and prettier config files.
|
|
81
|
+
* @param {WriteConfigFilesOptions} options - WriteConfigFilesOptions = {}
|
|
82
|
+
* @returns An object with the following properties:
|
|
83
|
+
* - writeResults: An object with the following properties:
|
|
84
|
+
* - aspectsWritersResults: An array of objects with the following properties:
|
|
85
|
+
* - aspect: The aspect that was written
|
|
86
|
+
* - totalWrittenFiles: The number of files that were written
|
|
87
|
+
* - totalWrittenFiles: The total number of files that were written
|
|
88
|
+
* - cleanResults: array of deleted paths
|
|
89
|
+
*/
|
|
90
|
+
writeConfigFiles(options?: WriteConfigFilesOptions): Promise<WriteConfigFilesResult>;
|
|
91
|
+
/**
|
|
92
|
+
* This will check the config.enableWorkspaceConfigWrite before writing the config files.
|
|
93
|
+
*/
|
|
94
|
+
writeConfigFilesIfEnabled(options?: WriteConfigFilesOptions): Promise<WriteConfigFilesResult | undefined>;
|
|
95
|
+
/**
|
|
96
|
+
* It cleans (delete) the config files from the workspace.
|
|
97
|
+
* This will check each file and will only delete it in case it was generated by bit
|
|
98
|
+
* @param {CleanConfigFilesOptions} options - CleanConfigFilesOptions = {}
|
|
99
|
+
* @returns An array of strings.
|
|
100
|
+
*/
|
|
101
|
+
cleanConfigFiles(options?: CleanConfigFilesOptions): Promise<string[]>;
|
|
102
|
+
/**
|
|
103
|
+
* The function checks if the auto writing of workspace configuration is enabled.
|
|
104
|
+
* if it's enabled we will re-generate the configuration files upon bit create
|
|
105
|
+
* @returns the boolean value of `!!this.config.enableWorkspaceConfigWrite`.
|
|
106
|
+
*/
|
|
107
|
+
isWorkspaceConfigWriteEnabled(): boolean;
|
|
108
|
+
/**
|
|
109
|
+
* It returns a list of all the config writers that have been registered with the config writer slot
|
|
110
|
+
* @returns An array of objects with aspectId and configWriter properties.
|
|
111
|
+
*/
|
|
112
|
+
listConfigWriters(): Promise<EnvConfigWritersList>;
|
|
113
|
+
private groupByWriterId;
|
|
114
|
+
private write;
|
|
115
|
+
private handleOneIdWriter;
|
|
116
|
+
private getConfigsRootDir;
|
|
117
|
+
private getCacheDir;
|
|
118
|
+
private getExecContext;
|
|
119
|
+
private getEnvComponentsDirsMap;
|
|
120
|
+
private getConfigWriters;
|
|
121
|
+
private getFlatConfigWriters;
|
|
122
|
+
/**
|
|
123
|
+
* Clean config files written by the config-writers
|
|
124
|
+
* @param envsExecutionContext
|
|
125
|
+
* @param param1
|
|
126
|
+
* @returns Array of paths of deleted config files
|
|
127
|
+
*/
|
|
128
|
+
clean({ dryRun, silent, writers }: WriteConfigFilesOptions): Promise<string[]>;
|
|
129
|
+
private calcPathsToClean;
|
|
130
|
+
private addToEnvsNotImplementing;
|
|
131
|
+
getEnvsNotImplementing(): string[];
|
|
132
|
+
private promptForCleaning;
|
|
133
|
+
private deleteFiles;
|
|
134
|
+
static slots: never[];
|
|
135
|
+
static dependencies: import("@teambit/harmony").Aspect[];
|
|
136
|
+
static runtime: import("@teambit/harmony").RuntimeDefinition;
|
|
137
|
+
static defaultConfig: Partial<WorkspaceConfigFilesAspectConfig>;
|
|
138
|
+
static provider([cli, workspace, envs, loggerAspect]: [CLIMain, Workspace, EnvsMain, LoggerMain], config: WorkspaceConfigFilesAspectConfig): Promise<WorkspaceConfigFilesMain>;
|
|
139
|
+
}
|
|
140
|
+
export default WorkspaceConfigFilesMain;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Logger } from '@teambit/logger';
|
|
2
|
+
import { EnvService, Env, EnvContext, ServiceTransformationMap } from '@teambit/envs';
|
|
3
|
+
import { ConfigWriterEntry } from './config-writer-entry';
|
|
4
|
+
export type PkgDescriptor = {
|
|
5
|
+
id: string;
|
|
6
|
+
displayName: string;
|
|
7
|
+
config?: string;
|
|
8
|
+
};
|
|
9
|
+
type PkgTransformationMap = ServiceTransformationMap & {
|
|
10
|
+
workspaceConfig: () => ConfigWriterEntry[];
|
|
11
|
+
};
|
|
12
|
+
export declare class WorkspaceConfigFilesService implements EnvService<any> {
|
|
13
|
+
private logger;
|
|
14
|
+
name: string;
|
|
15
|
+
constructor(logger: Logger);
|
|
16
|
+
transform(env: Env, envContext: EnvContext): PkgTransformationMap | undefined;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ExtendingConfigFile } from '../config-writer-entry';
|
|
2
|
+
import { EnvCompsDirsMap, EnvConfigWriterEntry, WriteConfigFilesOptions } from '../workspace-config-files.main.runtime';
|
|
3
|
+
import { WrittenRealConfigFilesByHash } from './real-config-files';
|
|
4
|
+
export type WrittenExtendingConfigFile = ExtendingConfigFile & {
|
|
5
|
+
filePaths: string[];
|
|
6
|
+
};
|
|
7
|
+
export type EnvsWrittenExtendingConfigFile = {
|
|
8
|
+
envIds: string[];
|
|
9
|
+
extendingConfigFile: WrittenExtendingConfigFile;
|
|
10
|
+
};
|
|
11
|
+
export type EnvsWrittenExtendingConfigFiles = Array<EnvsWrittenExtendingConfigFile>;
|
|
12
|
+
export type ExtendingConfigFilesMap = {
|
|
13
|
+
[configFileHash: string]: {
|
|
14
|
+
envIds: string[];
|
|
15
|
+
extendingConfigFile: Required<ExtendingConfigFile>;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export declare function handleExtendingConfigFiles(envEntries: EnvConfigWriterEntry[], envCompsDirsMap: EnvCompsDirsMap, writtenRealConfigFiles: WrittenRealConfigFilesByHash, configsRootDir: string, workspaceDir: string, opts: WriteConfigFilesOptions): Promise<EnvsWrittenExtendingConfigFiles>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { handleExtendingConfigFiles } from './extending-config-files';
|
|
2
|
+
export { handleRealConfigFiles } from './real-config-files';
|
|
3
|
+
export type { EnvsWrittenRealConfigFiles, EnvsWrittenRealConfigFile, WrittenConfigFile } from './real-config-files';
|
|
4
|
+
export type { EnvsWrittenExtendingConfigFiles, EnvsWrittenExtendingConfigFile, ExtendingConfigFilesMap, } from './extending-config-files';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ConfigFile } from '../config-writer-entry';
|
|
2
|
+
import { EnvCompsDirsMap, EnvConfigWriterEntry, WriteConfigFilesOptions } from '../workspace-config-files.main.runtime';
|
|
3
|
+
export type EnvsWrittenRealConfigFiles = Array<EnvsWrittenRealConfigFile>;
|
|
4
|
+
export type EnvsWrittenRealConfigFile = {
|
|
5
|
+
envIds: string[];
|
|
6
|
+
writtenRealConfigFile: WrittenConfigFile;
|
|
7
|
+
};
|
|
8
|
+
export type WrittenRealConfigFilesByHash = {
|
|
9
|
+
[hash: string]: EnvsWrittenRealConfigFile;
|
|
10
|
+
};
|
|
11
|
+
export type WrittenConfigFile = Required<ConfigFile> & {
|
|
12
|
+
filePath: string;
|
|
13
|
+
};
|
|
14
|
+
export declare function handleRealConfigFiles(envEntries: EnvConfigWriterEntry[], envCompsDirsMap: EnvCompsDirsMap, configsRootDir: string, workspaceDir: string, opts: WriteConfigFilesOptions): Promise<WrittenRealConfigFilesByHash>;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Command, CommandOptions } from '@teambit/cli';
|
|
2
|
+
import { WorkspaceConfigFilesMain } from './workspace-config-files.main.runtime';
|
|
3
|
+
export type CleanConfigCmdFlags = {
|
|
4
|
+
dryRun?: boolean;
|
|
5
|
+
silent?: boolean;
|
|
6
|
+
};
|
|
7
|
+
export type WriteConfigCmdFlags = {
|
|
8
|
+
dryRun?: boolean;
|
|
9
|
+
writers?: string;
|
|
10
|
+
noDedupe?: boolean;
|
|
11
|
+
dryRunWithContent?: boolean;
|
|
12
|
+
clean?: boolean;
|
|
13
|
+
silent?: boolean;
|
|
14
|
+
verbose?: boolean;
|
|
15
|
+
};
|
|
16
|
+
export declare class WsConfigCmd implements Command {
|
|
17
|
+
name: string;
|
|
18
|
+
alias: string;
|
|
19
|
+
description: string;
|
|
20
|
+
options: never[];
|
|
21
|
+
group: string;
|
|
22
|
+
commands: Command[];
|
|
23
|
+
report([unrecognizedSubcommand]: [string]): Promise<string>;
|
|
24
|
+
}
|
|
25
|
+
export declare class WsConfigWriteCmd implements Command {
|
|
26
|
+
private workspaceConfigFilesMain;
|
|
27
|
+
name: string;
|
|
28
|
+
description: string;
|
|
29
|
+
alias: string;
|
|
30
|
+
group: string;
|
|
31
|
+
options: CommandOptions;
|
|
32
|
+
constructor(workspaceConfigFilesMain: WorkspaceConfigFilesMain);
|
|
33
|
+
report(_args: any, flags: WriteConfigCmdFlags): Promise<string>;
|
|
34
|
+
json(_args: any, flags: WriteConfigCmdFlags): Promise<{
|
|
35
|
+
wsDir: string;
|
|
36
|
+
cleanResults: string[] | undefined;
|
|
37
|
+
writeResults: import("./workspace-config-files.main.runtime").WriteResults;
|
|
38
|
+
}>;
|
|
39
|
+
}
|
|
40
|
+
export declare class WsConfigCleanCmd implements Command {
|
|
41
|
+
private workspaceConfigFilesMain;
|
|
42
|
+
name: string;
|
|
43
|
+
description: string;
|
|
44
|
+
alias: string;
|
|
45
|
+
group: string;
|
|
46
|
+
options: CommandOptions;
|
|
47
|
+
constructor(workspaceConfigFilesMain: WorkspaceConfigFilesMain);
|
|
48
|
+
report(_args: any, flags: CleanConfigCmdFlags): Promise<string>;
|
|
49
|
+
json(_args: any, flags: WriteConfigCmdFlags): Promise<string[]>;
|
|
50
|
+
}
|
|
51
|
+
export declare class WsConfigListCmd implements Command {
|
|
52
|
+
private workspaceConfigFilesMain;
|
|
53
|
+
name: string;
|
|
54
|
+
description: string;
|
|
55
|
+
alias: string;
|
|
56
|
+
group: string;
|
|
57
|
+
options: CommandOptions;
|
|
58
|
+
constructor(workspaceConfigFilesMain: WorkspaceConfigFilesMain);
|
|
59
|
+
report(): Promise<string>;
|
|
60
|
+
json(): Promise<import("./workspace-config-files.main.runtime").EnvConfigWritersList>;
|
|
61
|
+
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/workspace-config-files",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.229",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/workspace/workspace-config-files",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.workspace",
|
|
8
8
|
"name": "workspace-config-files",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.229"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"lodash": "4.17.21",
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
"string-format": "0.5.0",
|
|
20
20
|
"@teambit/harmony": "0.4.6",
|
|
21
21
|
"@teambit/bit-error": "0.0.404",
|
|
22
|
-
"@teambit/envs": "1.0.
|
|
23
|
-
"@teambit/cli": "0.0.
|
|
24
|
-
"@teambit/logger": "0.0.
|
|
25
|
-
"@teambit/workspace": "1.0.
|
|
22
|
+
"@teambit/envs": "1.0.229",
|
|
23
|
+
"@teambit/cli": "0.0.862",
|
|
24
|
+
"@teambit/logger": "0.0.955",
|
|
25
|
+
"@teambit/workspace": "1.0.229"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/lodash": "4.14.165",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@types/fs-extra": "9.0.7",
|
|
32
32
|
"@types/normalize-path": "^3.0.0",
|
|
33
33
|
"@types/mocha": "9.1.0",
|
|
34
|
-
"@teambit/harmony.envs.core-aspect-env": "0.0.
|
|
34
|
+
"@teambit/harmony.envs.core-aspect-env": "0.0.33"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"@teambit/legacy": "1.0.624"
|
package/tsconfig.json
CHANGED
|
@@ -20,8 +20,7 @@
|
|
|
20
20
|
"emitDeclarationOnly": true,
|
|
21
21
|
"strict": true,
|
|
22
22
|
"strictPropertyInitialization": false,
|
|
23
|
-
"noImplicitAny": false
|
|
24
|
-
"composite": true
|
|
23
|
+
"noImplicitAny": false
|
|
25
24
|
},
|
|
26
25
|
"exclude": [
|
|
27
26
|
"artifacts",
|
|
@@ -36,19 +35,5 @@
|
|
|
36
35
|
"include": [
|
|
37
36
|
"**/*",
|
|
38
37
|
"**/*.json"
|
|
39
|
-
],
|
|
40
|
-
"references": [
|
|
41
|
-
{
|
|
42
|
-
"path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.envs_envs@1.0.227"
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
"path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_cli@0.0.860"
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
"path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_logger@0.0.953"
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
"path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.workspace_workspace@1.0.227"
|
|
52
|
-
}
|
|
53
38
|
]
|
|
54
39
|
}
|