@teambit/formatter 1.0.329 → 1.0.331

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.
@@ -112,11 +112,7 @@
112
112
  "line": 17,
113
113
  "character": 29
114
114
  },
115
- "name": "EnvsMain",
116
- "componentId": {
117
- "scope": "teambit.envs",
118
- "name": "envs"
119
- }
115
+ "name": "EnvsMain"
120
116
  },
121
117
  "isOptional": false,
122
118
  "isSpread": false
@@ -136,8 +132,7 @@
136
132
  "line": 17,
137
133
  "character": 65
138
134
  },
139
- "name": "FormatterService",
140
- "internalFilePath": "formatter.service.ts"
135
+ "name": "FormatterService"
141
136
  },
142
137
  "isOptional": false,
143
138
  "isSpread": false
@@ -197,11 +192,7 @@
197
192
  "line": 22,
198
193
  "character": 28
199
194
  },
200
- "name": "Component",
201
- "componentId": {
202
- "scope": "teambit.component",
203
- "name": "component"
204
- }
195
+ "name": "Component"
205
196
  }
206
197
  },
207
198
  "isOptional": false,
@@ -284,11 +275,7 @@
284
275
  "line": 31,
285
276
  "character": 27
286
277
  },
287
- "name": "Component",
288
- "componentId": {
289
- "scope": "teambit.component",
290
- "name": "component"
291
- }
278
+ "name": "Component"
292
279
  }
293
280
  },
294
281
  "isOptional": false,
@@ -353,11 +340,7 @@
353
340
  "line": 37,
354
341
  "character": 25
355
342
  },
356
- "name": "ExecutionContext",
357
- "componentId": {
358
- "scope": "teambit.envs",
359
- "name": "envs"
360
- }
343
+ "name": "ExecutionContext"
361
344
  },
362
345
  "isOptional": false,
363
346
  "isSpread": false
@@ -534,11 +517,7 @@
534
517
  "line": 61,
535
518
  "character": 55
536
519
  },
537
- "name": "EnvsMain",
538
- "componentId": {
539
- "scope": "teambit.envs",
540
- "name": "envs"
541
- }
520
+ "name": "EnvsMain"
542
521
  },
543
522
  {
544
523
  "__schema": "TypeRefSchema",
@@ -547,11 +526,7 @@
547
526
  "line": 61,
548
527
  "character": 65
549
528
  },
550
- "name": "CLIMain",
551
- "componentId": {
552
- "scope": "teambit.harmony",
553
- "name": "cli"
554
- }
529
+ "name": "CLIMain"
555
530
  },
556
531
  {
557
532
  "__schema": "TypeRefSchema",
@@ -560,11 +535,7 @@
560
535
  "line": 61,
561
536
  "character": 74
562
537
  },
563
- "name": "ComponentMain",
564
- "componentId": {
565
- "scope": "teambit.component",
566
- "name": "component"
567
- }
538
+ "name": "ComponentMain"
568
539
  },
569
540
  {
570
541
  "__schema": "TypeRefSchema",
@@ -573,11 +544,7 @@
573
544
  "line": 61,
574
545
  "character": 89
575
546
  },
576
- "name": "LoggerMain",
577
- "componentId": {
578
- "scope": "teambit.harmony",
579
- "name": "logger"
580
- }
547
+ "name": "LoggerMain"
581
548
  },
582
549
  {
583
550
  "__schema": "TypeRefSchema",
@@ -586,11 +553,7 @@
586
553
  "line": 61,
587
554
  "character": 101
588
555
  },
589
- "name": "Workspace",
590
- "componentId": {
591
- "scope": "teambit.workspace",
592
- "name": "workspace"
593
- }
556
+ "name": "Workspace"
594
557
  }
595
558
  ]
596
559
  },
@@ -1302,11 +1265,7 @@
1302
1265
  "line": 7,
1303
1266
  "character": 26
1304
1267
  },
1305
- "name": "BuildContext",
1306
- "componentId": {
1307
- "scope": "teambit.pipelines",
1308
- "name": "builder"
1309
- }
1268
+ "name": "BuildContext"
1310
1269
  },
1311
1270
  "isOptional": false,
1312
1271
  "isSpread": false
@@ -1328,11 +1287,7 @@
1328
1287
  "line": 7,
1329
1288
  "character": 49
1330
1289
  },
1331
- "name": "BuiltTaskResult",
1332
- "componentId": {
1333
- "scope": "teambit.pipelines",
1334
- "name": "builder"
1335
- }
1290
+ "name": "BuiltTaskResult"
1336
1291
  }
1337
1292
  ]
1338
1293
  },
@@ -1364,7 +1319,7 @@
1364
1319
  "_legacy": {
1365
1320
  "scope": "teambit.defender",
1366
1321
  "name": "formatter",
1367
- "version": "1.0.329"
1322
+ "version": "1.0.331"
1368
1323
  },
1369
1324
  "_scope": "teambit.defender"
1370
1325
  }
@@ -1420,10 +1375,6 @@
1420
1375
  "character": 16
1421
1376
  },
1422
1377
  "name": "EnvHandler",
1423
- "componentId": {
1424
- "scope": "teambit.envs",
1425
- "name": "envs"
1426
- },
1427
1378
  "typeArgs": [
1428
1379
  {
1429
1380
  "__schema": "TypeRefSchema",
@@ -1482,7 +1433,7 @@
1482
1433
  "_legacy": {
1483
1434
  "scope": "teambit.defender",
1484
1435
  "name": "formatter",
1485
- "version": "1.0.329"
1436
+ "version": "1.0.331"
1486
1437
  },
1487
1438
  "_scope": "teambit.defender"
1488
1439
  }
@@ -1724,11 +1675,7 @@
1724
1675
  "line": 17,
1725
1676
  "character": 29
1726
1677
  },
1727
- "name": "EnvsMain",
1728
- "componentId": {
1729
- "scope": "teambit.envs",
1730
- "name": "envs"
1731
- }
1678
+ "name": "EnvsMain"
1732
1679
  },
1733
1680
  "isOptional": false,
1734
1681
  "isSpread": false
@@ -1748,8 +1695,7 @@
1748
1695
  "line": 17,
1749
1696
  "character": 65
1750
1697
  },
1751
- "name": "FormatterService",
1752
- "internalFilePath": "formatter.service.ts"
1698
+ "name": "FormatterService"
1753
1699
  },
1754
1700
  "isOptional": false,
1755
1701
  "isSpread": false
@@ -1809,11 +1755,7 @@
1809
1755
  "line": 22,
1810
1756
  "character": 28
1811
1757
  },
1812
- "name": "Component",
1813
- "componentId": {
1814
- "scope": "teambit.component",
1815
- "name": "component"
1816
- }
1758
+ "name": "Component"
1817
1759
  }
1818
1760
  },
1819
1761
  "isOptional": false,
@@ -1896,11 +1838,7 @@
1896
1838
  "line": 31,
1897
1839
  "character": 27
1898
1840
  },
1899
- "name": "Component",
1900
- "componentId": {
1901
- "scope": "teambit.component",
1902
- "name": "component"
1903
- }
1841
+ "name": "Component"
1904
1842
  }
1905
1843
  },
1906
1844
  "isOptional": false,
@@ -1965,11 +1903,7 @@
1965
1903
  "line": 37,
1966
1904
  "character": 25
1967
1905
  },
1968
- "name": "ExecutionContext",
1969
- "componentId": {
1970
- "scope": "teambit.envs",
1971
- "name": "envs"
1972
- }
1906
+ "name": "ExecutionContext"
1973
1907
  },
1974
1908
  "isOptional": false,
1975
1909
  "isSpread": false
@@ -2146,11 +2080,7 @@
2146
2080
  "line": 61,
2147
2081
  "character": 55
2148
2082
  },
2149
- "name": "EnvsMain",
2150
- "componentId": {
2151
- "scope": "teambit.envs",
2152
- "name": "envs"
2153
- }
2083
+ "name": "EnvsMain"
2154
2084
  },
2155
2085
  {
2156
2086
  "__schema": "TypeRefSchema",
@@ -2159,11 +2089,7 @@
2159
2089
  "line": 61,
2160
2090
  "character": 65
2161
2091
  },
2162
- "name": "CLIMain",
2163
- "componentId": {
2164
- "scope": "teambit.harmony",
2165
- "name": "cli"
2166
- }
2092
+ "name": "CLIMain"
2167
2093
  },
2168
2094
  {
2169
2095
  "__schema": "TypeRefSchema",
@@ -2172,11 +2098,7 @@
2172
2098
  "line": 61,
2173
2099
  "character": 74
2174
2100
  },
2175
- "name": "ComponentMain",
2176
- "componentId": {
2177
- "scope": "teambit.component",
2178
- "name": "component"
2179
- }
2101
+ "name": "ComponentMain"
2180
2102
  },
2181
2103
  {
2182
2104
  "__schema": "TypeRefSchema",
@@ -2185,11 +2107,7 @@
2185
2107
  "line": 61,
2186
2108
  "character": 89
2187
2109
  },
2188
- "name": "LoggerMain",
2189
- "componentId": {
2190
- "scope": "teambit.harmony",
2191
- "name": "logger"
2192
- }
2110
+ "name": "LoggerMain"
2193
2111
  },
2194
2112
  {
2195
2113
  "__schema": "TypeRefSchema",
@@ -2198,11 +2116,7 @@
2198
2116
  "line": 61,
2199
2117
  "character": 101
2200
2118
  },
2201
- "name": "Workspace",
2202
- "componentId": {
2203
- "scope": "teambit.workspace",
2204
- "name": "workspace"
2205
- }
2119
+ "name": "Workspace"
2206
2120
  }
2207
2121
  ]
2208
2122
  },
@@ -2874,11 +2788,7 @@
2874
2788
  "line": 7,
2875
2789
  "character": 26
2876
2790
  },
2877
- "name": "BuildContext",
2878
- "componentId": {
2879
- "scope": "teambit.pipelines",
2880
- "name": "builder"
2881
- }
2791
+ "name": "BuildContext"
2882
2792
  },
2883
2793
  "isOptional": false,
2884
2794
  "isSpread": false
@@ -2900,11 +2810,7 @@
2900
2810
  "line": 7,
2901
2811
  "character": 49
2902
2812
  },
2903
- "name": "BuiltTaskResult",
2904
- "componentId": {
2905
- "scope": "teambit.pipelines",
2906
- "name": "builder"
2907
- }
2813
+ "name": "BuiltTaskResult"
2908
2814
  }
2909
2815
  ]
2910
2816
  },
@@ -2936,7 +2842,7 @@
2936
2842
  "_legacy": {
2937
2843
  "scope": "teambit.defender",
2938
2844
  "name": "formatter",
2939
- "version": "1.0.329"
2845
+ "version": "1.0.331"
2940
2846
  },
2941
2847
  "_scope": "teambit.defender"
2942
2848
  }
@@ -2994,10 +2900,6 @@
2994
2900
  "character": 16
2995
2901
  },
2996
2902
  "name": "EnvHandler",
2997
- "componentId": {
2998
- "scope": "teambit.envs",
2999
- "name": "envs"
3000
- },
3001
2903
  "typeArgs": [
3002
2904
  {
3003
2905
  "__schema": "TypeRefSchema",
@@ -3022,7 +2924,7 @@
3022
2924
  "componentId": {
3023
2925
  "scope": "teambit.defender",
3024
2926
  "name": "formatter",
3025
- "version": "1.0.329"
2927
+ "version": "1.0.331"
3026
2928
  },
3027
2929
  "taggedModuleExports": []
3028
2930
  }
@@ -1,4 +1,4 @@
1
- import { TimerResponse } from '@teambit/legacy/dist/toolbox/timer';
1
+ import { TimerResponse } from '@teambit/toolbox.time.timer';
2
2
  import { Command, CommandOptions } from '@teambit/cli';
3
3
  import { ComponentFactory, ComponentID } from '@teambit/component';
4
4
  import { Workspace } from '@teambit/workspace';
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.FormatCmd = void 0;
7
- function _timer() {
8
- const data = require("@teambit/legacy/dist/toolbox/timer");
9
- _timer = function () {
7
+ function _toolboxTime() {
8
+ const data = require("@teambit/toolbox.time.timer");
9
+ _toolboxTime = function () {
10
10
  return data;
11
11
  };
12
12
  return data;
@@ -80,7 +80,7 @@ class FormatCmd {
80
80
  };
81
81
  }
82
82
  async json([pattern], formatterCmdOptions) {
83
- const timer = _timer().Timer.create();
83
+ const timer = _toolboxTime().Timer.create();
84
84
  timer.start();
85
85
  const componentsIds = await this.getIdsToFormat(pattern, formatterCmdOptions.changed);
86
86
  const componentsToFormat = await this.workspace.getMany(componentsIds);
@@ -1 +1 @@
1
- {"version":3,"names":["_timer","data","require","_constants","_chalk","_interopRequireDefault","_lodash","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","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,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,gBAAAH,CAAA,EAAAI,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAJ,CAAA,GAAAO,MAAA,CAAAC,cAAA,CAAAR,CAAA,EAAAI,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAZ,CAAA,CAAAI,CAAA,IAAAC,CAAA,EAAAL,CAAA;AAAA,SAAAM,eAAAD,CAAA,QAAAQ,CAAA,GAAAC,YAAA,CAAAT,CAAA,uCAAAQ,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAA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AAO;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":[]}
1
+ {"version":3,"names":["_toolboxTime","data","require","_constants","_chalk","_interopRequireDefault","_lodash","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","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/toolbox.time.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,aAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,YAAA,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,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,gBAAAH,CAAA,EAAAI,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAJ,CAAA,GAAAO,MAAA,CAAAC,cAAA,CAAAR,CAAA,EAAAI,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAZ,CAAA,CAAAI,CAAA,IAAAC,CAAA,EAAAL,CAAA;AAAA,SAAAM,eAAAD,CAAA,QAAAQ,CAAA,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AuB,GAAGD,GAAG,CAACrG,IAAI,EAAEkD,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":[]}
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.defender_formatter@1.0.329/dist/formatter.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.defender_formatter@1.0.329/dist/formatter.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.defender_formatter@1.0.331/dist/formatter.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.defender_formatter@1.0.331/dist/formatter.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/formatter",
3
- "version": "1.0.329",
3
+ "version": "1.0.331",
4
4
  "homepage": "https://bit.cloud/teambit/defender/formatter",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.defender",
8
8
  "name": "formatter",
9
- "version": "1.0.329"
9
+ "version": "1.0.331"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "2.4.2",
@@ -14,19 +14,20 @@
14
14
  "graphql-tag": "2.12.1",
15
15
  "cli-highlight": "2.1.9",
16
16
  "@teambit/harmony": "0.4.6",
17
- "@teambit/cli": "0.0.906",
18
- "@teambit/component": "1.0.329",
19
- "@teambit/envs": "1.0.329",
20
- "@teambit/workspace": "1.0.329",
21
- "@teambit/builder": "1.0.329",
22
- "@teambit/logger": "0.0.999"
17
+ "@teambit/cli": "0.0.908",
18
+ "@teambit/component": "1.0.331",
19
+ "@teambit/envs": "1.0.331",
20
+ "@teambit/toolbox.time.timer": "0.0.1",
21
+ "@teambit/workspace": "1.0.331",
22
+ "@teambit/builder": "1.0.331",
23
+ "@teambit/logger": "0.0.1001"
23
24
  },
24
25
  "devDependencies": {
25
26
  "@types/lodash": "4.14.165",
26
27
  "@types/mocha": "9.1.0",
27
28
  "chai": "4.3.0",
28
29
  "@teambit/defender.content.formatter-overview": "1.96.1",
29
- "@teambit/harmony.envs.core-aspect-env": "0.0.39"
30
+ "@teambit/harmony.envs.core-aspect-env": "0.0.42"
30
31
  },
31
32
  "peerDependencies": {
32
33
  "react": "^17.0.0 || ^18.0.0",