@teambit/formatter 1.0.187 → 1.0.189
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 +1 -1
- package/artifacts/preview/static/css/teambit.defender/formatter-preview.185325b2.css +252 -0
- package/artifacts/preview/teambit_defender_formatter-preview.js +6 -6
- package/artifacts/schema.json +126 -28
- package/dist/format.cmd.js.map +1 -1
- package/dist/format.task.js.map +1 -1
- package/dist/formatter-context.js.map +1 -1
- package/dist/formatter-env-type.js.map +1 -1
- package/dist/formatter.aspect.js.map +1 -1
- package/dist/formatter.composition.js.map +1 -1
- package/dist/formatter.graphql.js +2 -3
- package/dist/formatter.graphql.js.map +1 -1
- package/dist/formatter.js.map +1 -1
- package/dist/formatter.main.runtime.js.map +1 -1
- package/dist/formatter.service.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/preview-1710224484125.js +7 -0
- package/package.json +9 -9
- package/artifacts/preview/static/css/teambit.defender/formatter-preview.3dd0bae3.css +0 -252
- package/dist/preview-1709867881461.js +0 -7
package/artifacts/schema.json
CHANGED
|
@@ -95,7 +95,11 @@
|
|
|
95
95
|
"line": 17,
|
|
96
96
|
"character": 29
|
|
97
97
|
},
|
|
98
|
-
"name": "EnvsMain"
|
|
98
|
+
"name": "EnvsMain",
|
|
99
|
+
"componentId": {
|
|
100
|
+
"scope": "teambit.envs",
|
|
101
|
+
"name": "envs"
|
|
102
|
+
}
|
|
99
103
|
},
|
|
100
104
|
"isOptional": false,
|
|
101
105
|
"isSpread": false
|
|
@@ -115,7 +119,8 @@
|
|
|
115
119
|
"line": 17,
|
|
116
120
|
"character": 65
|
|
117
121
|
},
|
|
118
|
-
"name": "FormatterService"
|
|
122
|
+
"name": "FormatterService",
|
|
123
|
+
"internalFilePath": "formatter.service.ts"
|
|
119
124
|
},
|
|
120
125
|
"isOptional": false,
|
|
121
126
|
"isSpread": false
|
|
@@ -174,7 +179,11 @@
|
|
|
174
179
|
"line": 22,
|
|
175
180
|
"character": 28
|
|
176
181
|
},
|
|
177
|
-
"name": "Component"
|
|
182
|
+
"name": "Component",
|
|
183
|
+
"componentId": {
|
|
184
|
+
"scope": "teambit.component",
|
|
185
|
+
"name": "component"
|
|
186
|
+
}
|
|
178
187
|
}
|
|
179
188
|
},
|
|
180
189
|
"isOptional": false,
|
|
@@ -256,7 +265,11 @@
|
|
|
256
265
|
"line": 31,
|
|
257
266
|
"character": 27
|
|
258
267
|
},
|
|
259
|
-
"name": "Component"
|
|
268
|
+
"name": "Component",
|
|
269
|
+
"componentId": {
|
|
270
|
+
"scope": "teambit.component",
|
|
271
|
+
"name": "component"
|
|
272
|
+
}
|
|
260
273
|
}
|
|
261
274
|
},
|
|
262
275
|
"isOptional": false,
|
|
@@ -321,7 +334,11 @@
|
|
|
321
334
|
"line": 37,
|
|
322
335
|
"character": 25
|
|
323
336
|
},
|
|
324
|
-
"name": "ExecutionContext"
|
|
337
|
+
"name": "ExecutionContext",
|
|
338
|
+
"componentId": {
|
|
339
|
+
"scope": "teambit.envs",
|
|
340
|
+
"name": "envs"
|
|
341
|
+
}
|
|
325
342
|
},
|
|
326
343
|
"isOptional": false,
|
|
327
344
|
"isSpread": false
|
|
@@ -498,7 +515,11 @@
|
|
|
498
515
|
"line": 61,
|
|
499
516
|
"character": 55
|
|
500
517
|
},
|
|
501
|
-
"name": "EnvsMain"
|
|
518
|
+
"name": "EnvsMain",
|
|
519
|
+
"componentId": {
|
|
520
|
+
"scope": "teambit.envs",
|
|
521
|
+
"name": "envs"
|
|
522
|
+
}
|
|
502
523
|
},
|
|
503
524
|
{
|
|
504
525
|
"__schema": "TypeRefSchema",
|
|
@@ -507,7 +528,11 @@
|
|
|
507
528
|
"line": 61,
|
|
508
529
|
"character": 65
|
|
509
530
|
},
|
|
510
|
-
"name": "CLIMain"
|
|
531
|
+
"name": "CLIMain",
|
|
532
|
+
"componentId": {
|
|
533
|
+
"scope": "teambit.harmony",
|
|
534
|
+
"name": "cli"
|
|
535
|
+
}
|
|
511
536
|
},
|
|
512
537
|
{
|
|
513
538
|
"__schema": "TypeRefSchema",
|
|
@@ -516,7 +541,11 @@
|
|
|
516
541
|
"line": 61,
|
|
517
542
|
"character": 74
|
|
518
543
|
},
|
|
519
|
-
"name": "ComponentMain"
|
|
544
|
+
"name": "ComponentMain",
|
|
545
|
+
"componentId": {
|
|
546
|
+
"scope": "teambit.component",
|
|
547
|
+
"name": "component"
|
|
548
|
+
}
|
|
520
549
|
},
|
|
521
550
|
{
|
|
522
551
|
"__schema": "TypeRefSchema",
|
|
@@ -525,7 +554,11 @@
|
|
|
525
554
|
"line": 61,
|
|
526
555
|
"character": 89
|
|
527
556
|
},
|
|
528
|
-
"name": "LoggerMain"
|
|
557
|
+
"name": "LoggerMain",
|
|
558
|
+
"componentId": {
|
|
559
|
+
"scope": "teambit.harmony",
|
|
560
|
+
"name": "logger"
|
|
561
|
+
}
|
|
529
562
|
},
|
|
530
563
|
{
|
|
531
564
|
"__schema": "TypeRefSchema",
|
|
@@ -534,7 +567,11 @@
|
|
|
534
567
|
"line": 61,
|
|
535
568
|
"character": 101
|
|
536
569
|
},
|
|
537
|
-
"name": "Workspace"
|
|
570
|
+
"name": "Workspace",
|
|
571
|
+
"componentId": {
|
|
572
|
+
"scope": "teambit.workspace",
|
|
573
|
+
"name": "workspace"
|
|
574
|
+
}
|
|
538
575
|
}
|
|
539
576
|
]
|
|
540
577
|
},
|
|
@@ -1187,7 +1224,11 @@
|
|
|
1187
1224
|
"line": 7,
|
|
1188
1225
|
"character": 26
|
|
1189
1226
|
},
|
|
1190
|
-
"name": "BuildContext"
|
|
1227
|
+
"name": "BuildContext",
|
|
1228
|
+
"componentId": {
|
|
1229
|
+
"scope": "teambit.pipelines",
|
|
1230
|
+
"name": "builder"
|
|
1231
|
+
}
|
|
1191
1232
|
},
|
|
1192
1233
|
"isOptional": false,
|
|
1193
1234
|
"isSpread": false
|
|
@@ -1209,7 +1250,11 @@
|
|
|
1209
1250
|
"line": 7,
|
|
1210
1251
|
"character": 49
|
|
1211
1252
|
},
|
|
1212
|
-
"name": "BuiltTaskResult"
|
|
1253
|
+
"name": "BuiltTaskResult",
|
|
1254
|
+
"componentId": {
|
|
1255
|
+
"scope": "teambit.pipelines",
|
|
1256
|
+
"name": "builder"
|
|
1257
|
+
}
|
|
1213
1258
|
}
|
|
1214
1259
|
]
|
|
1215
1260
|
},
|
|
@@ -1241,7 +1286,7 @@
|
|
|
1241
1286
|
"_legacy": {
|
|
1242
1287
|
"scope": "teambit.defender",
|
|
1243
1288
|
"name": "formatter",
|
|
1244
|
-
"version": "1.0.
|
|
1289
|
+
"version": "1.0.189"
|
|
1245
1290
|
},
|
|
1246
1291
|
"_scope": "teambit.defender"
|
|
1247
1292
|
}
|
|
@@ -1287,6 +1332,10 @@
|
|
|
1287
1332
|
"character": 16
|
|
1288
1333
|
},
|
|
1289
1334
|
"name": "EnvHandler",
|
|
1335
|
+
"componentId": {
|
|
1336
|
+
"scope": "teambit.envs",
|
|
1337
|
+
"name": "envs"
|
|
1338
|
+
},
|
|
1290
1339
|
"typeArgs": [
|
|
1291
1340
|
{
|
|
1292
1341
|
"__schema": "TypeRefSchema",
|
|
@@ -1336,7 +1385,7 @@
|
|
|
1336
1385
|
"_legacy": {
|
|
1337
1386
|
"scope": "teambit.defender",
|
|
1338
1387
|
"name": "formatter",
|
|
1339
|
-
"version": "1.0.
|
|
1388
|
+
"version": "1.0.189"
|
|
1340
1389
|
},
|
|
1341
1390
|
"_scope": "teambit.defender"
|
|
1342
1391
|
}
|
|
@@ -1568,7 +1617,11 @@
|
|
|
1568
1617
|
"line": 17,
|
|
1569
1618
|
"character": 29
|
|
1570
1619
|
},
|
|
1571
|
-
"name": "EnvsMain"
|
|
1620
|
+
"name": "EnvsMain",
|
|
1621
|
+
"componentId": {
|
|
1622
|
+
"scope": "teambit.envs",
|
|
1623
|
+
"name": "envs"
|
|
1624
|
+
}
|
|
1572
1625
|
},
|
|
1573
1626
|
"isOptional": false,
|
|
1574
1627
|
"isSpread": false
|
|
@@ -1588,7 +1641,8 @@
|
|
|
1588
1641
|
"line": 17,
|
|
1589
1642
|
"character": 65
|
|
1590
1643
|
},
|
|
1591
|
-
"name": "FormatterService"
|
|
1644
|
+
"name": "FormatterService",
|
|
1645
|
+
"internalFilePath": "formatter.service.ts"
|
|
1592
1646
|
},
|
|
1593
1647
|
"isOptional": false,
|
|
1594
1648
|
"isSpread": false
|
|
@@ -1647,7 +1701,11 @@
|
|
|
1647
1701
|
"line": 22,
|
|
1648
1702
|
"character": 28
|
|
1649
1703
|
},
|
|
1650
|
-
"name": "Component"
|
|
1704
|
+
"name": "Component",
|
|
1705
|
+
"componentId": {
|
|
1706
|
+
"scope": "teambit.component",
|
|
1707
|
+
"name": "component"
|
|
1708
|
+
}
|
|
1651
1709
|
}
|
|
1652
1710
|
},
|
|
1653
1711
|
"isOptional": false,
|
|
@@ -1729,7 +1787,11 @@
|
|
|
1729
1787
|
"line": 31,
|
|
1730
1788
|
"character": 27
|
|
1731
1789
|
},
|
|
1732
|
-
"name": "Component"
|
|
1790
|
+
"name": "Component",
|
|
1791
|
+
"componentId": {
|
|
1792
|
+
"scope": "teambit.component",
|
|
1793
|
+
"name": "component"
|
|
1794
|
+
}
|
|
1733
1795
|
}
|
|
1734
1796
|
},
|
|
1735
1797
|
"isOptional": false,
|
|
@@ -1794,7 +1856,11 @@
|
|
|
1794
1856
|
"line": 37,
|
|
1795
1857
|
"character": 25
|
|
1796
1858
|
},
|
|
1797
|
-
"name": "ExecutionContext"
|
|
1859
|
+
"name": "ExecutionContext",
|
|
1860
|
+
"componentId": {
|
|
1861
|
+
"scope": "teambit.envs",
|
|
1862
|
+
"name": "envs"
|
|
1863
|
+
}
|
|
1798
1864
|
},
|
|
1799
1865
|
"isOptional": false,
|
|
1800
1866
|
"isSpread": false
|
|
@@ -1971,7 +2037,11 @@
|
|
|
1971
2037
|
"line": 61,
|
|
1972
2038
|
"character": 55
|
|
1973
2039
|
},
|
|
1974
|
-
"name": "EnvsMain"
|
|
2040
|
+
"name": "EnvsMain",
|
|
2041
|
+
"componentId": {
|
|
2042
|
+
"scope": "teambit.envs",
|
|
2043
|
+
"name": "envs"
|
|
2044
|
+
}
|
|
1975
2045
|
},
|
|
1976
2046
|
{
|
|
1977
2047
|
"__schema": "TypeRefSchema",
|
|
@@ -1980,7 +2050,11 @@
|
|
|
1980
2050
|
"line": 61,
|
|
1981
2051
|
"character": 65
|
|
1982
2052
|
},
|
|
1983
|
-
"name": "CLIMain"
|
|
2053
|
+
"name": "CLIMain",
|
|
2054
|
+
"componentId": {
|
|
2055
|
+
"scope": "teambit.harmony",
|
|
2056
|
+
"name": "cli"
|
|
2057
|
+
}
|
|
1984
2058
|
},
|
|
1985
2059
|
{
|
|
1986
2060
|
"__schema": "TypeRefSchema",
|
|
@@ -1989,7 +2063,11 @@
|
|
|
1989
2063
|
"line": 61,
|
|
1990
2064
|
"character": 74
|
|
1991
2065
|
},
|
|
1992
|
-
"name": "ComponentMain"
|
|
2066
|
+
"name": "ComponentMain",
|
|
2067
|
+
"componentId": {
|
|
2068
|
+
"scope": "teambit.component",
|
|
2069
|
+
"name": "component"
|
|
2070
|
+
}
|
|
1993
2071
|
},
|
|
1994
2072
|
{
|
|
1995
2073
|
"__schema": "TypeRefSchema",
|
|
@@ -1998,7 +2076,11 @@
|
|
|
1998
2076
|
"line": 61,
|
|
1999
2077
|
"character": 89
|
|
2000
2078
|
},
|
|
2001
|
-
"name": "LoggerMain"
|
|
2079
|
+
"name": "LoggerMain",
|
|
2080
|
+
"componentId": {
|
|
2081
|
+
"scope": "teambit.harmony",
|
|
2082
|
+
"name": "logger"
|
|
2083
|
+
}
|
|
2002
2084
|
},
|
|
2003
2085
|
{
|
|
2004
2086
|
"__schema": "TypeRefSchema",
|
|
@@ -2007,7 +2089,11 @@
|
|
|
2007
2089
|
"line": 61,
|
|
2008
2090
|
"character": 101
|
|
2009
2091
|
},
|
|
2010
|
-
"name": "Workspace"
|
|
2092
|
+
"name": "Workspace",
|
|
2093
|
+
"componentId": {
|
|
2094
|
+
"scope": "teambit.workspace",
|
|
2095
|
+
"name": "workspace"
|
|
2096
|
+
}
|
|
2011
2097
|
}
|
|
2012
2098
|
]
|
|
2013
2099
|
},
|
|
@@ -2674,7 +2760,11 @@
|
|
|
2674
2760
|
"line": 7,
|
|
2675
2761
|
"character": 26
|
|
2676
2762
|
},
|
|
2677
|
-
"name": "BuildContext"
|
|
2763
|
+
"name": "BuildContext",
|
|
2764
|
+
"componentId": {
|
|
2765
|
+
"scope": "teambit.pipelines",
|
|
2766
|
+
"name": "builder"
|
|
2767
|
+
}
|
|
2678
2768
|
},
|
|
2679
2769
|
"isOptional": false,
|
|
2680
2770
|
"isSpread": false
|
|
@@ -2696,7 +2786,11 @@
|
|
|
2696
2786
|
"line": 7,
|
|
2697
2787
|
"character": 49
|
|
2698
2788
|
},
|
|
2699
|
-
"name": "BuiltTaskResult"
|
|
2789
|
+
"name": "BuiltTaskResult",
|
|
2790
|
+
"componentId": {
|
|
2791
|
+
"scope": "teambit.pipelines",
|
|
2792
|
+
"name": "builder"
|
|
2793
|
+
}
|
|
2700
2794
|
}
|
|
2701
2795
|
]
|
|
2702
2796
|
},
|
|
@@ -2728,7 +2822,7 @@
|
|
|
2728
2822
|
"_legacy": {
|
|
2729
2823
|
"scope": "teambit.defender",
|
|
2730
2824
|
"name": "formatter",
|
|
2731
|
-
"version": "1.0.
|
|
2825
|
+
"version": "1.0.189"
|
|
2732
2826
|
},
|
|
2733
2827
|
"_scope": "teambit.defender"
|
|
2734
2828
|
}
|
|
@@ -2785,6 +2879,10 @@
|
|
|
2785
2879
|
"character": 16
|
|
2786
2880
|
},
|
|
2787
2881
|
"name": "EnvHandler",
|
|
2882
|
+
"componentId": {
|
|
2883
|
+
"scope": "teambit.envs",
|
|
2884
|
+
"name": "envs"
|
|
2885
|
+
},
|
|
2788
2886
|
"typeArgs": [
|
|
2789
2887
|
{
|
|
2790
2888
|
"__schema": "TypeRefSchema",
|
|
@@ -2809,7 +2907,7 @@
|
|
|
2809
2907
|
"componentId": {
|
|
2810
2908
|
"scope": "teambit.defender",
|
|
2811
2909
|
"name": "formatter",
|
|
2812
|
-
"version": "1.0.
|
|
2910
|
+
"version": "1.0.189"
|
|
2813
2911
|
},
|
|
2814
2912
|
"taggedModuleExports": []
|
|
2815
2913
|
}
|
package/dist/format.cmd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_timer","data","require","_constants","_chalk","_interopRequireDefault","_lodash","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","FormatCmd","constructor","formatter","componentHost","workspace","name","description","COMPONENT_PATTERN_HELP","report","pattern","formatterOptions","duration","code","componentsIdsToFormat","json","title","chalk","bold","cyan","length","toString","componentsOutputs","getAllComponentsResultOutput","results","check","seconds","summery","formatterCmdOptions","timer","Timer","create","start","componentsIds","getIdsToFormat","changed","componentsToFormat","getMany","opts","formatterResults","format","jsonFormatterResults","toJsonFormatResults","timerResponse","stop","statusCode","getStatusCode","map","comp","id","hasIssues","some","file","idsByPattern","getNewAndModifiedIds","listIds","componentsResult","context","allResults","getOneComponentResultOutput","join","componentResult","componentId","ignoreVersion","filesWithIssues","filter","fileResult","green","subTitle","red","files","getOneComponentFileResultOutput","filePath","exports","newResults","res","resultsWithoutComponent","result","component","compact","flatten","errors"],"sources":["format.cmd.ts"],"sourcesContent":["import { TimerResponse, Timer } from '@teambit/legacy/dist/toolbox/timer';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy/dist/constants';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { ComponentFactory, ComponentID } from '@teambit/component';\nimport chalk from 'chalk';\nimport { EnvsExecutionResult } from '@teambit/envs';\nimport { Workspace } from '@teambit/workspace';\nimport { compact, flatten } from 'lodash';\nimport { FormatterMain } from './formatter.main.runtime';\nimport { ComponentFormatResult, FormatResults, FileFormatResult } from './formatter';\nimport { FormatterOptions } from './formatter-context';\n\nexport type FormatCmdOptions = {\n changed?: boolean;\n json?: boolean;\n check?: boolean;\n};\n\ntype OutputContext = {\n check?: boolean;\n};\n\n/**\n * A type for result with componentId instead of the entire component, as when output to console, we don't want to print all the component\n */\nexport type JsonComponentFormatResult = Omit<ComponentFormatResult, 'component'> & {\n componentId: ComponentID;\n};\n\nexport type JsonFormatDataResults = Omit<FormatResults, 'results'> & { results: JsonComponentFormatResult[] };\n/**\n * A type for result with componentId instead of the entire component, as when output to console, we don't want to print all the component\n */\nexport type JsonFormatResults = {\n duration: TimerResponse;\n data: JsonFormatDataResults;\n code: number;\n componentsIdsToFormat: string[];\n};\n\nexport class FormatCmd implements Command {\n name = 'format [component-pattern]';\n description = 'format components in the development workspace';\n arguments = [{ name: 'component-pattern', description: COMPONENT_PATTERN_HELP }];\n group = 'development';\n helpUrl = 'reference/formatting/formatter-overview';\n options = [\n ['c', 'changed', 'format only new and modified components'],\n ['', 'check', 'will output a human-friendly message and a list of unformatted files, if any'],\n ['j', 'json', 'return the format results in json format'],\n ] as CommandOptions;\n\n constructor(\n private formatter: FormatterMain,\n private componentHost: ComponentFactory,\n private workspace: Workspace\n ) {}\n\n async report([pattern]: [string], formatterOptions: FormatCmdOptions) {\n const { duration, data, code, componentsIdsToFormat } = await this.json([pattern], formatterOptions);\n\n const title = chalk.bold(\n `formatting total of ${chalk.cyan(\n componentsIdsToFormat.length.toString()\n )} component(s) in workspace '${chalk.cyan(this.componentHost.name)}`\n );\n\n const componentsOutputs = this.getAllComponentsResultOutput(data.results, { check: formatterOptions.check });\n\n const { seconds } = duration;\n const summery = `formatted ${chalk.cyan(componentsIdsToFormat.length.toString())} components in ${chalk.cyan(\n seconds.toString()\n )}.`;\n\n return {\n data: `${title}\\n\\n${componentsOutputs}\\n\\n${summery}`,\n code,\n };\n }\n\n async json([pattern]: [string], formatterCmdOptions: FormatCmdOptions): Promise<JsonFormatResults> {\n const timer = Timer.create();\n timer.start();\n const componentsIds = await this.getIdsToFormat(pattern, formatterCmdOptions.changed);\n const componentsToFormat = await this.workspace.getMany(componentsIds);\n const opts: FormatterOptions = {};\n const formatterResults = formatterCmdOptions.check\n ? await this.formatter.check(componentsToFormat, opts)\n : await this.formatter.format(componentsToFormat, opts);\n const jsonFormatterResults = toJsonFormatResults(formatterResults);\n const timerResponse = timer.stop();\n const statusCode = this.getStatusCode(jsonFormatterResults, formatterCmdOptions.check);\n\n return {\n duration: timerResponse,\n data: jsonFormatterResults,\n code: statusCode,\n componentsIdsToFormat: componentsToFormat.map((comp) => comp.id.toString()),\n };\n }\n\n private getStatusCode(results: JsonFormatDataResults, check = false): number {\n if (!check) return 0;\n const hasIssues = results.results.some((comp) => comp.results.some((file) => file.hasIssues));\n if (hasIssues) return 1;\n return 0;\n }\n\n private async getIdsToFormat(pattern: string, changed = false): Promise<ComponentID[]> {\n if (pattern) {\n return this.workspace.idsByPattern(pattern);\n }\n if (changed) {\n return this.workspace.getNewAndModifiedIds();\n }\n return this.componentHost.listIds();\n }\n\n private getAllComponentsResultOutput(componentsResult: JsonComponentFormatResult[], context: OutputContext) {\n const allResults = componentsResult.map((comp) => this.getOneComponentResultOutput(comp, context));\n return allResults.join('\\n\\n');\n }\n\n private getOneComponentResultOutput(componentResult: JsonComponentFormatResult, context: OutputContext) {\n const title = chalk.bold.cyan(componentResult.componentId.toString({ ignoreVersion: true }));\n const filesWithIssues = componentResult.results.filter((fileResult) => fileResult.hasIssues);\n if (!filesWithIssues || !filesWithIssues.length) {\n return `${title}\\n${chalk.green('no issues found')}`;\n }\n let subTitle = chalk.green('the following files have been re-formatted:');\n if (context.check) {\n subTitle = chalk.red('issues found in the following files:');\n }\n const files = filesWithIssues.map(this.getOneComponentFileResultOutput);\n return `${title}\\n${subTitle}\\n${files.join('\\n')}`;\n }\n\n private getOneComponentFileResultOutput(fileResult: FileFormatResult) {\n return fileResult.filePath;\n }\n}\n\nfunction toJsonFormatResults(results: EnvsExecutionResult<FormatResults>): JsonFormatDataResults {\n const newResults = results.results.map((res) => {\n const resultsWithoutComponent = res.data?.results.map((result) => {\n return {\n componentId: result.component.id,\n results: result.results,\n };\n });\n return compact(resultsWithoutComponent);\n });\n return {\n results: compact(flatten(newResults)),\n errors: results?.errors,\n };\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,WAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,UAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAG,OAAA;EAAA,MAAAH,IAAA,GAAAI,sBAAA,CAAAH,OAAA;EAAAE,MAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAK,QAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,OAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA0C,SAAAI,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,gBAAAH,GAAA,EAAAI,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAJ,GAAA,IAAAO,MAAA,CAAAC,cAAA,CAAAR,GAAA,EAAAI,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAX,GAAA,CAAAI,GAAA,IAAAC,KAAA,WAAAL,GAAA;AAAA,SAAAM,eAAAM,CAAA,QAAAC,CAAA,GAAAC,YAAA,CAAAF,CAAA,uCA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AACvG,IAAI,EAAEoD,OAAO,CAACuB,GAAG,CAAE8B,MAAM,IAAK;MAChE,OAAO;QACLf,WAAW,EAAEe,MAAM,CAACC,SAAS,CAAC7B,EAAE;QAChCzB,OAAO,EAAEqD,MAAM,CAACrD;MAClB,CAAC;IACH,CAAC,CAAC;IACF,OAAO,IAAAuD,iBAAO,EAACH,uBAAuB,CAAC;EACzC,CAAC,CAAC;EACF,OAAO;IACLpD,OAAO,EAAE,IAAAuD,iBAAO,EAAC,IAAAC,iBAAO,EAACN,UAAU,CAAC,CAAC;IACrCO,MAAM,EAAEzD,OAAO,EAAEyD;EACnB,CAAC;AACH"}
|
|
1
|
+
{"version":3,"names":["_timer","data","require","_constants","_chalk","_interopRequireDefault","_lodash","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","FormatCmd","constructor","formatter","componentHost","workspace","name","description","COMPONENT_PATTERN_HELP","report","pattern","formatterOptions","duration","code","componentsIdsToFormat","json","title","chalk","bold","cyan","length","toString","componentsOutputs","getAllComponentsResultOutput","results","check","seconds","summery","formatterCmdOptions","timer","Timer","create","start","componentsIds","getIdsToFormat","changed","componentsToFormat","getMany","opts","formatterResults","format","jsonFormatterResults","toJsonFormatResults","timerResponse","stop","statusCode","getStatusCode","map","comp","id","hasIssues","some","file","idsByPattern","getNewAndModifiedIds","listIds","componentsResult","context","allResults","getOneComponentResultOutput","join","componentResult","componentId","ignoreVersion","filesWithIssues","filter","fileResult","green","subTitle","red","files","getOneComponentFileResultOutput","filePath","exports","newResults","res","resultsWithoutComponent","result","component","compact","flatten","errors"],"sources":["format.cmd.ts"],"sourcesContent":["import { TimerResponse, Timer } from '@teambit/legacy/dist/toolbox/timer';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy/dist/constants';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { ComponentFactory, ComponentID } from '@teambit/component';\nimport chalk from 'chalk';\nimport { EnvsExecutionResult } from '@teambit/envs';\nimport { Workspace } from '@teambit/workspace';\nimport { compact, flatten } from 'lodash';\nimport { FormatterMain } from './formatter.main.runtime';\nimport { ComponentFormatResult, FormatResults, FileFormatResult } from './formatter';\nimport { FormatterOptions } from './formatter-context';\n\nexport type FormatCmdOptions = {\n changed?: boolean;\n json?: boolean;\n check?: boolean;\n};\n\ntype OutputContext = {\n check?: boolean;\n};\n\n/**\n * A type for result with componentId instead of the entire component, as when output to console, we don't want to print all the component\n */\nexport type JsonComponentFormatResult = Omit<ComponentFormatResult, 'component'> & {\n componentId: ComponentID;\n};\n\nexport type JsonFormatDataResults = Omit<FormatResults, 'results'> & { results: JsonComponentFormatResult[] };\n/**\n * A type for result with componentId instead of the entire component, as when output to console, we don't want to print all the component\n */\nexport type JsonFormatResults = {\n duration: TimerResponse;\n data: JsonFormatDataResults;\n code: number;\n componentsIdsToFormat: string[];\n};\n\nexport class FormatCmd implements Command {\n name = 'format [component-pattern]';\n description = 'format components in the development workspace';\n arguments = [{ name: 'component-pattern', description: COMPONENT_PATTERN_HELP }];\n group = 'development';\n helpUrl = 'reference/formatting/formatter-overview';\n options = [\n ['c', 'changed', 'format only new and modified components'],\n ['', 'check', 'will output a human-friendly message and a list of unformatted files, if any'],\n ['j', 'json', 'return the format results in json format'],\n ] as CommandOptions;\n\n constructor(\n private formatter: FormatterMain,\n private componentHost: ComponentFactory,\n private workspace: Workspace\n ) {}\n\n async report([pattern]: [string], formatterOptions: FormatCmdOptions) {\n const { duration, data, code, componentsIdsToFormat } = await this.json([pattern], formatterOptions);\n\n const title = chalk.bold(\n `formatting total of ${chalk.cyan(\n componentsIdsToFormat.length.toString()\n )} component(s) in workspace '${chalk.cyan(this.componentHost.name)}`\n );\n\n const componentsOutputs = this.getAllComponentsResultOutput(data.results, { check: formatterOptions.check });\n\n const { seconds } = duration;\n const summery = `formatted ${chalk.cyan(componentsIdsToFormat.length.toString())} components in ${chalk.cyan(\n seconds.toString()\n )}.`;\n\n return {\n data: `${title}\\n\\n${componentsOutputs}\\n\\n${summery}`,\n code,\n };\n }\n\n async json([pattern]: [string], formatterCmdOptions: FormatCmdOptions): Promise<JsonFormatResults> {\n const timer = Timer.create();\n timer.start();\n const componentsIds = await this.getIdsToFormat(pattern, formatterCmdOptions.changed);\n const componentsToFormat = await this.workspace.getMany(componentsIds);\n const opts: FormatterOptions = {};\n const formatterResults = formatterCmdOptions.check\n ? await this.formatter.check(componentsToFormat, opts)\n : await this.formatter.format(componentsToFormat, opts);\n const jsonFormatterResults = toJsonFormatResults(formatterResults);\n const timerResponse = timer.stop();\n const statusCode = this.getStatusCode(jsonFormatterResults, formatterCmdOptions.check);\n\n return {\n duration: timerResponse,\n data: jsonFormatterResults,\n code: statusCode,\n componentsIdsToFormat: componentsToFormat.map((comp) => comp.id.toString()),\n };\n }\n\n private getStatusCode(results: JsonFormatDataResults, check = false): number {\n if (!check) return 0;\n const hasIssues = results.results.some((comp) => comp.results.some((file) => file.hasIssues));\n if (hasIssues) return 1;\n return 0;\n }\n\n private async getIdsToFormat(pattern: string, changed = false): Promise<ComponentID[]> {\n if (pattern) {\n return this.workspace.idsByPattern(pattern);\n }\n if (changed) {\n return this.workspace.getNewAndModifiedIds();\n }\n return this.componentHost.listIds();\n }\n\n private getAllComponentsResultOutput(componentsResult: JsonComponentFormatResult[], context: OutputContext) {\n const allResults = componentsResult.map((comp) => this.getOneComponentResultOutput(comp, context));\n return allResults.join('\\n\\n');\n }\n\n private getOneComponentResultOutput(componentResult: JsonComponentFormatResult, context: OutputContext) {\n const title = chalk.bold.cyan(componentResult.componentId.toString({ ignoreVersion: true }));\n const filesWithIssues = componentResult.results.filter((fileResult) => fileResult.hasIssues);\n if (!filesWithIssues || !filesWithIssues.length) {\n return `${title}\\n${chalk.green('no issues found')}`;\n }\n let subTitle = chalk.green('the following files have been re-formatted:');\n if (context.check) {\n subTitle = chalk.red('issues found in the following files:');\n }\n const files = filesWithIssues.map(this.getOneComponentFileResultOutput);\n return `${title}\\n${subTitle}\\n${files.join('\\n')}`;\n }\n\n private getOneComponentFileResultOutput(fileResult: FileFormatResult) {\n return fileResult.filePath;\n }\n}\n\nfunction toJsonFormatResults(results: EnvsExecutionResult<FormatResults>): JsonFormatDataResults {\n const newResults = results.results.map((res) => {\n const resultsWithoutComponent = res.data?.results.map((result) => {\n return {\n componentId: result.component.id,\n results: result.results,\n };\n });\n return compact(resultsWithoutComponent);\n });\n return {\n results: compact(flatten(newResults)),\n errors: results?.errors,\n };\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,WAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,UAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAG,OAAA;EAAA,MAAAH,IAAA,GAAAI,sBAAA,CAAAH,OAAA;EAAAE,MAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAK,QAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,OAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA0C,SAAAI,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,gBAAAH,GAAA,EAAAI,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAJ,GAAA,IAAAO,MAAA,CAAAC,cAAA,CAAAR,GAAA,EAAAI,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAX,GA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,MAAMkD,UAAU,GAAGlD,OAAO,CAACA,OAAO,CAACuB,GAAG,CAAE4B,GAAG,IAAK;IAC9C,MAAMC,uBAAuB,GAAGD,GAAG,CAACvG,IAAI,EAAEoD,OAAO,CAACuB,GAAG,CAAE8B,MAAM,IAAK;MAChE,OAAO;QACLf,WAAW,EAAEe,MAAM,CAACC,SAAS,CAAC7B,EAAE;QAChCzB,OAAO,EAAEqD,MAAM,CAACrD;MAClB,CAAC;IACH,CAAC,CAAC;IACF,OAAO,IAAAuD,iBAAO,EAACH,uBAAuB,CAAC;EACzC,CAAC,CAAC;EACF,OAAO;IACLpD,OAAO,EAAE,IAAAuD,iBAAO,EAAC,IAAAC,iBAAO,EAACN,UAAU,CAAC,CAAC;IACrCO,MAAM,EAAEzD,OAAO,EAAEyD;EACnB,CAAC;AACH","ignoreList":[]}
|
package/dist/format.task.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["FormatTask","constructor","aspectId","name","execute","context","formatter","env","getFormatter","results","check","componentsResults","map","formatResult","component","metadata","errors","exports"],"sources":["format.task.ts"],"sourcesContent":["import { BuildTask, BuiltTaskResult, BuildContext, ComponentResult } from '@teambit/builder';\nimport { Formatter } from './formatter';\n\nexport class FormatTask implements BuildTask {\n constructor(readonly aspectId: string, readonly name = 'format') {}\n\n async execute(context: BuildContext): Promise<BuiltTaskResult> {\n const formatter: Formatter = context.env.getFormatter();\n // TODO: add option to select between check and format here\n const results = await formatter.check(context);\n const componentsResults = results.results.map((formatResult): ComponentResult => {\n return {\n component: formatResult.component,\n metadata: {\n results: formatResult.results,\n },\n errors: [],\n };\n });\n\n return {\n componentsResults,\n };\n }\n}\n"],"mappings":";;;;;;AAGO,MAAMA,UAAU,CAAsB;EAC3CC,WAAWA,CAAUC,QAAgB,EAAWC,IAAI,GAAG,QAAQ,EAAE;IAAA,KAA5CD,QAAgB,GAAhBA,QAAgB;IAAA,KAAWC,IAAI,GAAJA,IAAI;EAAc;EAElE,MAAMC,OAAOA,CAACC,OAAqB,EAA4B;IAC7D,MAAMC,SAAoB,GAAGD,OAAO,CAACE,GAAG,CAACC,YAAY,CAAC,CAAC;IACvD;IACA,MAAMC,OAAO,GAAG,MAAMH,SAAS,CAACI,KAAK,CAACL,OAAO,CAAC;IAC9C,MAAMM,iBAAiB,GAAGF,OAAO,CAACA,OAAO,CAACG,GAAG,CAAEC,YAAY,IAAsB;MAC/E,OAAO;QACLC,SAAS,EAAED,YAAY,CAACC,SAAS;QACjCC,QAAQ,EAAE;UACRN,OAAO,EAAEI,YAAY,CAACJ;QACxB,CAAC;QACDO,MAAM,EAAE;MACV,CAAC;IACH,CAAC,CAAC;IAEF,OAAO;MACLL;IACF,CAAC;EACH;AACF;AAACM,OAAA,CAAAjB,UAAA,GAAAA,UAAA"}
|
|
1
|
+
{"version":3,"names":["FormatTask","constructor","aspectId","name","execute","context","formatter","env","getFormatter","results","check","componentsResults","map","formatResult","component","metadata","errors","exports"],"sources":["format.task.ts"],"sourcesContent":["import { BuildTask, BuiltTaskResult, BuildContext, ComponentResult } from '@teambit/builder';\nimport { Formatter } from './formatter';\n\nexport class FormatTask implements BuildTask {\n constructor(readonly aspectId: string, readonly name = 'format') {}\n\n async execute(context: BuildContext): Promise<BuiltTaskResult> {\n const formatter: Formatter = context.env.getFormatter();\n // TODO: add option to select between check and format here\n const results = await formatter.check(context);\n const componentsResults = results.results.map((formatResult): ComponentResult => {\n return {\n component: formatResult.component,\n metadata: {\n results: formatResult.results,\n },\n errors: [],\n };\n });\n\n return {\n componentsResults,\n };\n }\n}\n"],"mappings":";;;;;;AAGO,MAAMA,UAAU,CAAsB;EAC3CC,WAAWA,CAAUC,QAAgB,EAAWC,IAAI,GAAG,QAAQ,EAAE;IAAA,KAA5CD,QAAgB,GAAhBA,QAAgB;IAAA,KAAWC,IAAI,GAAJA,IAAI;EAAc;EAElE,MAAMC,OAAOA,CAACC,OAAqB,EAA4B;IAC7D,MAAMC,SAAoB,GAAGD,OAAO,CAACE,GAAG,CAACC,YAAY,CAAC,CAAC;IACvD;IACA,MAAMC,OAAO,GAAG,MAAMH,SAAS,CAACI,KAAK,CAACL,OAAO,CAAC;IAC9C,MAAMM,iBAAiB,GAAGF,OAAO,CAACA,OAAO,CAACG,GAAG,CAAEC,YAAY,IAAsB;MAC/E,OAAO;QACLC,SAAS,EAAED,YAAY,CAACC,SAAS;QACjCC,QAAQ,EAAE;UACRN,OAAO,EAAEI,YAAY,CAACJ;QACxB,CAAC;QACDO,MAAM,EAAE;MACV,CAAC;IACH,CAAC,CAAC;IAEF,OAAO;MACLL;IACF,CAAC;EACH;AACF;AAACM,OAAA,CAAAjB,UAAA,GAAAA,UAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["formatter-context.ts"],"sourcesContent":["import { ExecutionContext } from '@teambit/envs';\n\nexport type FormatterOptions = { check?: boolean };\nexport interface FormatterContext extends ExecutionContext, FormatterOptions {}\n// export interface FormatterContext extends ExecutionContext {}\n// export type FormatterContext = ExecutionContext;\n"],"mappings":""}
|
|
1
|
+
{"version":3,"names":[],"sources":["formatter-context.ts"],"sourcesContent":["import { ExecutionContext } from '@teambit/envs';\n\nexport type FormatterOptions = { check?: boolean };\nexport interface FormatterContext extends ExecutionContext, FormatterOptions {}\n// export interface FormatterContext extends ExecutionContext {}\n// export type FormatterContext = ExecutionContext;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["formatter-env-type.ts"],"sourcesContent":["import { EnvHandler } from '@teambit/envs';\nimport { Formatter } from './formatter';\n\nexport interface FormatterEnv {\n /**\n * return a Formatter instance.\n */\n formatter(): EnvHandler<Formatter>;\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"names":[],"sources":["formatter-env-type.ts"],"sourcesContent":["import { EnvHandler } from '@teambit/envs';\nimport { Formatter } from './formatter';\n\nexport interface FormatterEnv {\n /**\n * return a Formatter instance.\n */\n formatter(): EnvHandler<Formatter>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_harmony","data","require","FormatterAspect","exports","Aspect","create","id"],"sources":["formatter.aspect.ts"],"sourcesContent":["import { Aspect } from '@teambit/harmony';\n\nexport const FormatterAspect = Aspect.create({\n id: 'teambit.defender/formatter',\n});\n"],"mappings":";;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAME,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAGE,iBAAM,CAACC,MAAM,CAAC;EAC3CC,EAAE,EAAE;AACN,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"names":["_harmony","data","require","FormatterAspect","exports","Aspect","create","id"],"sources":["formatter.aspect.ts"],"sourcesContent":["import { Aspect } from '@teambit/harmony';\n\nexport const FormatterAspect = Aspect.create({\n id: 'teambit.defender/formatter',\n});\n"],"mappings":";;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAME,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAGE,iBAAM,CAACC,MAAM,CAAC;EAC3CC,EAAE,EAAE;AACN,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","data","_interopRequireDefault","require","obj","__esModule","default","Logo","createElement","style","height","display","justifyContent","width","src","exports"],"sources":["formatter.composition.tsx"],"sourcesContent":["import React from 'react';\n\nexport const Logo = () => (\n <div style={{ height: '100%', display: 'flex', justifyContent: 'center' }}>\n <img style={{ width: 70 }} src=\"https://static.bit.dev/extensions-icons/formatter.svg\" />\n </div>\n);\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA0B,SAAAC,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEnB,MAAMG,IAAI,GAAGA,CAAA,kBAClBP,MAAA,GAAAM,OAAA,CAAAE,aAAA;EAAKC,KAAK,EAAE;IAAEC,MAAM,EAAE,MAAM;IAAEC,OAAO,EAAE,MAAM;IAAEC,cAAc,EAAE;EAAS;AAAE,gBACxEZ,MAAA,GAAAM,OAAA,CAAAE,aAAA;EAAKC,KAAK,EAAE;IAAEI,KAAK,EAAE;EAAG,CAAE;EAACC,GAAG,EAAC;AAAuD,CAAE,CACrF,CACN;AAACC,OAAA,CAAAR,IAAA,GAAAA,IAAA"}
|
|
1
|
+
{"version":3,"names":["_react","data","_interopRequireDefault","require","obj","__esModule","default","Logo","createElement","style","height","display","justifyContent","width","src","exports"],"sources":["formatter.composition.tsx"],"sourcesContent":["import React from 'react';\n\nexport const Logo = () => (\n <div style={{ height: '100%', display: 'flex', justifyContent: 'center' }}>\n <img style={{ width: 70 }} src=\"https://static.bit.dev/extensions-icons/formatter.svg\" />\n </div>\n);\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA0B,SAAAC,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEnB,MAAMG,IAAI,GAAGA,CAAA,kBAClBP,MAAA,GAAAM,OAAA,CAAAE,aAAA;EAAKC,KAAK,EAAE;IAAEC,MAAM,EAAE,MAAM;IAAEC,OAAO,EAAE,MAAM;IAAEC,cAAc,EAAE;EAAS;AAAE,gBACxEZ,MAAA,GAAAM,OAAA,CAAAE,aAAA;EAAKC,KAAK,EAAE;IAAEI,KAAK,EAAE;EAAG,CAAE;EAACC,GAAG,EAAC;AAAuD,CAAE,CACrF,CACN;AAACC,OAAA,CAAAR,IAAA,GAAAA,IAAA","ignoreList":[]}
|
|
@@ -5,16 +5,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.linterSchema = linterSchema;
|
|
7
7
|
function _graphqlTag() {
|
|
8
|
-
const data =
|
|
8
|
+
const data = require("graphql-tag");
|
|
9
9
|
_graphqlTag = function () {
|
|
10
10
|
return data;
|
|
11
11
|
};
|
|
12
12
|
return data;
|
|
13
13
|
}
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
14
|
function linterSchema() {
|
|
16
15
|
return {
|
|
17
|
-
typeDefs: (0, _graphqlTag().
|
|
16
|
+
typeDefs: (0, _graphqlTag().gql)``,
|
|
18
17
|
resolvers: {}
|
|
19
18
|
};
|
|
20
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_graphqlTag","data","
|
|
1
|
+
{"version":3,"names":["_graphqlTag","data","require","linterSchema","typeDefs","gql","resolvers"],"sources":["formatter.graphql.ts"],"sourcesContent":["import { gql } from 'graphql-tag';\n\nexport function linterSchema() {\n return {\n typeDefs: gql``,\n resolvers: {},\n };\n}\n"],"mappings":";;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,SAASE,YAAYA,CAAA,EAAG;EAC7B,OAAO;IACLC,QAAQ,EAAE,IAAAC,iBAAG,CAAC,EAAC;IACfC,SAAS,EAAE,CAAC;EACd,CAAC;AACH","ignoreList":[]}
|
package/dist/formatter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["formatter.ts"],"sourcesContent":["import { Component } from '@teambit/component';\nimport { FormatterContext } from './formatter-context';\n\nexport type ComponentFormatResult = {\n /**\n * the formatted component.\n */\n component: Component;\n\n /**\n * format results for each file of the component.\n */\n results: FileFormatResult[];\n};\n\nexport type FileFormatResult = {\n /**\n * path of the formatted file.\n */\n filePath: string;\n\n /**\n * Does the file has formatting issues (needs format)\n */\n hasIssues: boolean;\n\n /**\n * The new file content after the formatting\n */\n newContent?: string;\n};\n\nexport type FormatResults = {\n results: ComponentFormatResult[];\n errors: Error[];\n};\n\nexport interface Formatter {\n id: string;\n format(context: FormatterContext): Promise<FormatResults>;\n formatSnippet(snippet: string, filepath?: string): Promise<string>;\n check(context: FormatterContext): Promise<FormatResults>;\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"names":[],"sources":["formatter.ts"],"sourcesContent":["import { Component } from '@teambit/component';\nimport { FormatterContext } from './formatter-context';\n\nexport type ComponentFormatResult = {\n /**\n * the formatted component.\n */\n component: Component;\n\n /**\n * format results for each file of the component.\n */\n results: FileFormatResult[];\n};\n\nexport type FileFormatResult = {\n /**\n * path of the formatted file.\n */\n filePath: string;\n\n /**\n * Does the file has formatting issues (needs format)\n */\n hasIssues: boolean;\n\n /**\n * The new file content after the formatting\n */\n newContent?: string;\n};\n\nexport type FormatResults = {\n results: ComponentFormatResult[];\n errors: Error[];\n};\n\nexport interface Formatter {\n id: string;\n format(context: FormatterContext): Promise<FormatResults>;\n formatSnippet(snippet: string, filepath?: string): Promise<string>;\n check(context: FormatterContext): Promise<FormatResults>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_cli","data","require","_component","_envs","_logger","_workspace","_formatter","_formatter2","_format","_format2","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","obj","key","value","_toPropertyKey","configurable","writable","i","_toPrimitive","String","Symbol","toPrimitive","call","TypeError","Number","FormatterMain","constructor","envs","formatterService","format","components","opts","envsRuntime","createEnvironment","formatResults","run","toFormatServiceOptions","check","getFormatter","context","options","createTask","name","FormatTask","FormatterAspect","id","provider","cli","component","loggerAspect","workspace","config","logger","createLogger","FormatterService","formatterAspect","registerService","register","FormatCmd","getHost","exports","MainRuntime","EnvsAspect","CLIAspect","ComponentAspect","LoggerAspect","WorkspaceAspect","addRuntime"],"sources":["formatter.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { Component, ComponentAspect, ComponentMain } from '@teambit/component';\nimport { EnvsAspect, EnvsMain, ExecutionContext } from '@teambit/envs';\nimport { LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { Workspace, WorkspaceAspect } from '@teambit/workspace';\nimport { FormatterAspect } from './formatter.aspect';\nimport { FormatterService } from './formatter.service';\nimport { FormatTask } from './format.task';\nimport { FormatCmd } from './format.cmd';\nimport { FormatterOptions } from './formatter-context';\nimport { Formatter } from './formatter';\n\nexport type FormatterConfig = {};\nexport class FormatterMain {\n static runtime = MainRuntime;\n\n constructor(private envs: EnvsMain, private formatterService: FormatterService) {}\n\n /**\n * format an array of components.\n */\n async format(components: Component[], opts: FormatterOptions) {\n const envsRuntime = await this.envs.createEnvironment(components);\n const formatResults = envsRuntime.run(this.formatterService, this.toFormatServiceOptions(opts, false));\n return formatResults;\n }\n\n /**\n * check format an array of components.\n */\n async check(components: Component[], opts: FormatterOptions) {\n const envsRuntime = await this.envs.createEnvironment(components);\n const formatResults = envsRuntime.run(this.formatterService, this.toFormatServiceOptions(opts, true));\n return formatResults;\n }\n\n getFormatter(context: ExecutionContext, options: FormatterOptions): Formatter {\n return this.formatterService.getFormatter(context, options);\n }\n\n private toFormatServiceOptions(opts: FormatterOptions, check = false): FormatterOptions {\n return {\n ...opts,\n check,\n };\n }\n\n /**\n * create a format task for build pipelines.\n * @param name name of the task.\n */\n createTask(name?: string): FormatTask {\n return new FormatTask(FormatterAspect.id, name);\n }\n\n static dependencies = [EnvsAspect, CLIAspect, ComponentAspect, LoggerAspect, WorkspaceAspect];\n\n static defaultConfig: FormatterConfig = {};\n\n static async provider(\n [envs, cli, component, loggerAspect, workspace]: [EnvsMain, CLIMain, ComponentMain, LoggerMain, Workspace],\n config: FormatterConfig\n ) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const logger = loggerAspect.createLogger(FormatterAspect.id);\n const formatterService = new FormatterService(config);\n const formatterAspect = new FormatterMain(envs, formatterService);\n envs.registerService(formatterService);\n cli.register(new FormatCmd(formatterAspect, component.getHost(), workspace));\n\n return formatterAspect;\n }\n}\n\nFormatterAspect.addRuntime(FormatterMain);\n"],"mappings":";;;;;;AAAA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,WAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,UAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,MAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,KAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,QAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,OAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,WAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,UAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,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AMI,eAAe,GAAG,IAAI9B,aAAa,CAACE,IAAI,EAAEC,gBAAgB,CAAC;IACjED,IAAI,CAAC6B,eAAe,CAAC5B,gBAAgB,CAAC;IACtCmB,GAAG,CAACU,QAAQ,CAAC,KAAIC,oBAAS,EAACH,eAAe,EAAEP,SAAS,CAACW,OAAO,CAAC,CAAC,EAAET,SAAS,CAAC,CAAC;IAE5E,OAAOK,eAAe;EACxB;AACF;AAACK,OAAA,CAAAnC,aAAA,GAAAA,aAAA;AAAAlB,eAAA,CA3DYkB,aAAa,aACPoC,kBAAW;AAAAtD,eAAA,CADjBkB,aAAa,kBA0CF,CAACqC,kBAAU,EAAEC,gBAAS,EAAEC,4BAAe,EAAEC,sBAAY,EAAEC,4BAAe,CAAC;AAAA3D,eAAA,CA1ClFkB,aAAa,mBA4CgB,CAAC,CAAC;AAiB5CmB,4BAAe,CAACuB,UAAU,CAAC1C,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"names":["_cli","data","require","_component","_envs","_logger","_workspace","_formatter","_formatter2","_format","_format2","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","obj","key","value","_toPropertyKey","configurable","writable","i","_toPrimitive","String","Symbol","toPrimitive","call","TypeError","Number","FormatterMain","constructor","envs","formatterService","format","components","opts","envsRuntime","createEnvironment","formatResults","run","toFormatServiceOptions","check","getFormatter","context","options","createTask","name","FormatTask","FormatterAspect","id","provider","cli","component","loggerAspect","workspace","config","logger","createLogger","FormatterService","formatterAspect","registerService","register","FormatCmd","getHost","exports","MainRuntime","EnvsAspect","CLIAspect","ComponentAspect","LoggerAspect","WorkspaceAspect","addRuntime"],"sources":["formatter.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { Component, ComponentAspect, ComponentMain } from '@teambit/component';\nimport { EnvsAspect, EnvsMain, ExecutionContext } from '@teambit/envs';\nimport { LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { Workspace, WorkspaceAspect } from '@teambit/workspace';\nimport { FormatterAspect } from './formatter.aspect';\nimport { FormatterService } from './formatter.service';\nimport { FormatTask } from './format.task';\nimport { FormatCmd } from './format.cmd';\nimport { FormatterOptions } from './formatter-context';\nimport { Formatter } from './formatter';\n\nexport type FormatterConfig = {};\nexport class FormatterMain {\n static runtime = MainRuntime;\n\n constructor(private envs: EnvsMain, private formatterService: FormatterService) {}\n\n /**\n * format an array of components.\n */\n async format(components: Component[], opts: FormatterOptions) {\n const envsRuntime = await this.envs.createEnvironment(components);\n const formatResults = envsRuntime.run(this.formatterService, this.toFormatServiceOptions(opts, false));\n return formatResults;\n }\n\n /**\n * check format an array of components.\n */\n async check(components: Component[], opts: FormatterOptions) {\n const envsRuntime = await this.envs.createEnvironment(components);\n const formatResults = envsRuntime.run(this.formatterService, this.toFormatServiceOptions(opts, true));\n return formatResults;\n }\n\n getFormatter(context: ExecutionContext, options: FormatterOptions): Formatter {\n return this.formatterService.getFormatter(context, options);\n }\n\n private toFormatServiceOptions(opts: FormatterOptions, check = false): FormatterOptions {\n return {\n ...opts,\n check,\n };\n }\n\n /**\n * create a format task for build pipelines.\n * @param name name of the task.\n */\n createTask(name?: string): FormatTask {\n return new FormatTask(FormatterAspect.id, name);\n }\n\n static dependencies = [EnvsAspect, CLIAspect, ComponentAspect, LoggerAspect, WorkspaceAspect];\n\n static defaultConfig: FormatterConfig = {};\n\n static async provider(\n [envs, cli, component, loggerAspect, workspace]: [EnvsMain, CLIMain, ComponentMain, LoggerMain, Workspace],\n config: FormatterConfig\n ) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const logger = loggerAspect.createLogger(FormatterAspect.id);\n const formatterService = new FormatterService(config);\n const formatterAspect = new FormatterMain(envs, formatterService);\n envs.registerService(formatterService);\n cli.register(new FormatCmd(formatterAspect, component.getHost(), workspace));\n\n return formatterAspect;\n }\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B,4BAAe,CAACuB,UAAU,CAAC1C,aAAa,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_lodash","_cliHighlight","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","FormatterService","constructor","formatterConfig","run","context","options","mergedOpts","optionsWithDefaults","formatterContext","mergeContext","formatter","getFormatter","results","check","format","env","defaults","assign","render","descriptor","getDescriptor","name","chalk","green","id","displayName","version","configLabel","configObj","config","highlight","language","ignoreIllegals","transform","undefined","icon","displayConfig","exports"],"sources":["formatter.service.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { defaults } from 'lodash';\nimport { EnvService, ExecutionContext, EnvDefinition, Env, EnvContext, ServiceTransformationMap } from '@teambit/envs';\nimport highlight from 'cli-highlight';\nimport { Formatter, FormatResults } from './formatter';\nimport { FormatterContext, FormatterOptions } from './formatter-context';\nimport { FormatterConfig } from './formatter.main.runtime';\n\ntype FormatterTransformationMap = ServiceTransformationMap & {\n getFormatter: () => Formatter;\n};\nexport class FormatterService implements EnvService<FormatResults> {\n name = 'formatter';\n\n constructor(private formatterConfig: FormatterConfig) {}\n\n async run(context: ExecutionContext, options: FormatterOptions): Promise<FormatResults> {\n const mergedOpts = this.optionsWithDefaults(options);\n const formatterContext: FormatterContext = this.mergeContext(mergedOpts, context);\n const formatter = this.getFormatter(context, options);\n\n const results = options.check ? await formatter.check(formatterContext) : await formatter.format(formatterContext);\n return results;\n }\n\n getFormatter(context: ExecutionContext, options: FormatterOptions): Formatter {\n const mergedOpts = this.optionsWithDefaults(options);\n const formatterContext: FormatterContext = this.mergeContext(mergedOpts, context);\n const formatter: Formatter = context.env.getFormatter(formatterContext);\n\n return formatter;\n }\n\n private optionsWithDefaults(options: FormatterOptions): FormatterOptions {\n return defaults(options, this.formatterConfig);\n }\n\n private mergeContext(options: FormatterOptions, context?: ExecutionContext): FormatterContext {\n const formatterContext: FormatterContext = Object.assign({}, options, context);\n return formatterContext;\n }\n\n render(env: EnvDefinition) {\n const descriptor = this.getDescriptor(env);\n const name = `${chalk.green('configured formatter:')} ${descriptor?.id} (${descriptor?.displayName} @ ${\n descriptor?.version\n })`;\n const configLabel = chalk.green('formatter config:');\n const configObj = descriptor?.config\n ? highlight(descriptor?.config, { language: 'json', ignoreIllegals: true })\n : '';\n return `${name}\\n${configLabel}\\n${configObj}`;\n }\n\n transform(env: Env, context: EnvContext): FormatterTransformationMap | undefined {\n // Old env\n if (!env?.formatter) return undefined;\n return {\n getFormatter: () => env.formatter()(context),\n };\n }\n\n getDescriptor(env: EnvDefinition) {\n if (!env.env.getFormatter) return undefined;\n const mergedOpts = this.optionsWithDefaults({});\n const formatterContext = this.mergeContext(mergedOpts);\n const formatter = env.env.getFormatter(formatterContext);\n\n return {\n id: formatter.id,\n icon: formatter.icon,\n config: formatter.displayConfig ? formatter.displayConfig() : undefined,\n version: formatter.version ? formatter.version() : '?',\n displayName: formatter.displayName ? formatter.displayName : '?',\n };\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,cAAA;EAAA,MAAAJ,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAE,aAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAsC,SAAAC,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAA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;EAEAK,SAASA,CAAClB,GAAQ,EAAEX,OAAmB,EAA0C;IAC/E;IACA,IAAI,CAACW,GAAG,EAAEL,SAAS,EAAE,OAAOwB,SAAS;IACrC,OAAO;MACLvB,YAAY,EAAEA,CAAA,KAAMI,GAAG,CAACL,SAAS,CAAC,CAAC,CAACN,OAAO;IAC7C,CAAC;EACH;EAEAgB,aAAaA,CAACL,GAAkB,EAAE;IAChC,IAAI,CAACA,GAAG,CAACA,GAAG,CAACJ,YAAY,EAAE,OAAOuB,SAAS;IAC3C,MAAM5B,UAAU,GAAG,IAAI,CAACC,mBAAmB,CAAC,CAAC,CAAC,CAAC;IAC/C,MAAMC,gBAAgB,GAAG,IAAI,CAACC,YAAY,CAACH,UAAU,CAAC;IACtD,MAAMI,SAAS,GAAGK,GAAG,CAACA,GAAG,CAACJ,YAAY,CAACH,gBAAgB,CAAC;IAExD,OAAO;MACLgB,EAAE,EAAEd,SAAS,CAACc,EAAE;MAChBW,IAAI,EAAEzB,SAAS,CAACyB,IAAI;MACpBN,MAAM,EAAEnB,SAAS,CAAC0B,aAAa,GAAG1B,SAAS,CAAC0B,aAAa,CAAC,CAAC,GAAGF,SAAS;MACvER,OAAO,EAAEhB,SAAS,CAACgB,OAAO,GAAGhB,SAAS,CAACgB,OAAO,CAAC,CAAC,GAAG,GAAG;MACtDD,WAAW,EAAEf,SAAS,CAACe,WAAW,GAAGf,SAAS,CAACe,WAAW,GAAG;IAC/D,CAAC;EACH;AACF;AAACY,OAAA,CAAArC,gBAAA,GAAAA,gBAAA"}
|
|
1
|
+
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_lodash","_cliHighlight","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","FormatterService","constructor","formatterConfig","run","context","options","mergedOpts","optionsWithDefaults","formatterContext","mergeContext","formatter","getFormatter","results","check","format","env","defaults","assign","render","descriptor","getDescriptor","name","chalk","green","id","displayName","version","configLabel","configObj","config","highlight","language","ignoreIllegals","transform","undefined","icon","displayConfig","exports"],"sources":["formatter.service.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { defaults } from 'lodash';\nimport { EnvService, ExecutionContext, EnvDefinition, Env, EnvContext, ServiceTransformationMap } from '@teambit/envs';\nimport highlight from 'cli-highlight';\nimport { Formatter, FormatResults } from './formatter';\nimport { FormatterContext, FormatterOptions } from './formatter-context';\nimport { FormatterConfig } from './formatter.main.runtime';\n\ntype FormatterTransformationMap = ServiceTransformationMap & {\n getFormatter: () => Formatter;\n};\nexport class FormatterService implements EnvService<FormatResults> {\n name = 'formatter';\n\n constructor(private formatterConfig: FormatterConfig) {}\n\n async run(context: ExecutionContext, options: FormatterOptions): Promise<FormatResults> {\n const mergedOpts = this.optionsWithDefaults(options);\n const formatterContext: FormatterContext = this.mergeContext(mergedOpts, context);\n const formatter = this.getFormatter(context, options);\n\n const results = options.check ? await formatter.check(formatterContext) : await formatter.format(formatterContext);\n return results;\n }\n\n getFormatter(context: ExecutionContext, options: FormatterOptions): Formatter {\n const mergedOpts = this.optionsWithDefaults(options);\n const formatterContext: FormatterContext = this.mergeContext(mergedOpts, context);\n const formatter: Formatter = context.env.getFormatter(formatterContext);\n\n return formatter;\n }\n\n private optionsWithDefaults(options: FormatterOptions): FormatterOptions {\n return defaults(options, this.formatterConfig);\n }\n\n private mergeContext(options: FormatterOptions, context?: ExecutionContext): FormatterContext {\n const formatterContext: FormatterContext = Object.assign({}, options, context);\n return formatterContext;\n }\n\n render(env: EnvDefinition) {\n const descriptor = this.getDescriptor(env);\n const name = `${chalk.green('configured formatter:')} ${descriptor?.id} (${descriptor?.displayName} @ ${\n descriptor?.version\n })`;\n const configLabel = chalk.green('formatter config:');\n const configObj = descriptor?.config\n ? highlight(descriptor?.config, { language: 'json', ignoreIllegals: true })\n : '';\n return `${name}\\n${configLabel}\\n${configObj}`;\n }\n\n transform(env: Env, context: EnvContext): FormatterTransformationMap | undefined {\n // Old env\n if (!env?.formatter) return undefined;\n return {\n getFormatter: () => env.formatter()(context),\n };\n }\n\n getDescriptor(env: EnvDefinition) {\n if (!env.env.getFormatter) return undefined;\n const mergedOpts = this.optionsWithDefaults({});\n const formatterContext = this.mergeContext(mergedOpts);\n const formatter = env.env.getFormatter(formatterContext);\n\n return {\n id: formatter.id,\n icon: formatter.icon,\n config: formatter.displayConfig ? formatter.displayConfig() : undefined,\n version: formatter.version ? formatter.version() : '?',\n displayName: formatter.displayName ? formatter.displayName : '?',\n };\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,cAAA;EAAA,MAAAJ,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAE,aAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAsC,SAAAC,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,gBAAAH,GAAA,EAAAI,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAJ,GAAA,IAAAO,MAAA,CAAAC,cAAA,CAAAR,GAAA,EAAAI,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAX,GAAA,CAAAI,GAAA,IAAAC,KAAA,WAAAL,GAAA;AAAA,SAAAM,eAAAM,CAAA,QAAAC,CAAA,GAAAC,YAA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AAI,CAACC,mBAAmB,CAAC,CAAC,CAAC,CAAC;IAC/C,MAAMC,gBAAgB,GAAG,IAAI,CAACC,YAAY,CAACH,UAAU,CAAC;IACtD,MAAMI,SAAS,GAAGK,GAAG,CAACA,GAAG,CAACJ,YAAY,CAACH,gBAAgB,CAAC;IAExD,OAAO;MACLgB,EAAE,EAAEd,SAAS,CAACc,EAAE;MAChBW,IAAI,EAAEzB,SAAS,CAACyB,IAAI;MACpBN,MAAM,EAAEnB,SAAS,CAAC0B,aAAa,GAAG1B,SAAS,CAAC0B,aAAa,CAAC,CAAC,GAAGF,SAAS;MACvER,OAAO,EAAEhB,SAAS,CAACgB,OAAO,GAAGhB,SAAS,CAACgB,OAAO,CAAC,CAAC,GAAG,GAAG;MACtDD,WAAW,EAAEf,SAAS,CAACe,WAAW,GAAGf,SAAS,CAACe,WAAW,GAAG;IAC/D,CAAC;EACH;AACF;AAACY,OAAA,CAAArC,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_formatter","data","require","_default","exports","default","FormatterAspect"],"sources":["index.ts"],"sourcesContent":["import { FormatterAspect } from './formatter.aspect';\n\nexport { FormatterAspect };\nexport type { FormatterMain, FormatterConfig } from './formatter.main.runtime';\nexport type { FormatResults, Formatter, FileFormatResult, ComponentFormatResult } from './formatter';\nexport type { FormatTask } from './format.task';\nexport type { FormatterEnv } from './formatter-env-type';\nexport type { FormatterContext, FormatterOptions } from './formatter-context';\nexport default FormatterAspect;\n"],"mappings":";;;;;;;;;;;;AAAA,SAAAA,WAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,UAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAqD,IAAAE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAQtCC,4BAAe"}
|
|
1
|
+
{"version":3,"names":["_formatter","data","require","_default","exports","default","FormatterAspect"],"sources":["index.ts"],"sourcesContent":["import { FormatterAspect } from './formatter.aspect';\n\nexport { FormatterAspect };\nexport type { FormatterMain, FormatterConfig } from './formatter.main.runtime';\nexport type { FormatResults, Formatter, FileFormatResult, ComponentFormatResult } from './formatter';\nexport type { FormatTask } from './format.task';\nexport type { FormatterEnv } from './formatter-env-type';\nexport type { FormatterContext, FormatterOptions } from './formatter-context';\nexport default FormatterAspect;\n"],"mappings":";;;;;;;;;;;;AAAA,SAAAA,WAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,UAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAqD,IAAAE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAQtCC,4BAAe","ignoreList":[]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as compositions_0 from '/Users/giladshoham/Library/Caches/Bit/capsules/root/b5ea46ec36fa42b9dbedfc12ecb7bb63e03fcfe6/teambit.defender_formatter@1.0.189/dist/formatter.composition.js';
|
|
2
|
+
import * as overview_0 from '/Users/giladshoham/Library/Caches/Bit/capsules/root/b5ea46ec36fa42b9dbedfc12ecb7bb63e03fcfe6/teambit.defender_formatter@1.0.189/dist/formatter.docs.mdx';
|
|
3
|
+
|
|
4
|
+
export const compositions = [compositions_0];
|
|
5
|
+
export const overview = [overview_0];
|
|
6
|
+
|
|
7
|
+
export const compositions_metadata = {"compositions":[{"displayName":"Logo","identifier":"Logo"}]};
|