@teambit/formatter 1.0.225 → 1.0.227

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.
@@ -95,11 +95,7 @@
95
95
  "line": 17,
96
96
  "character": 29
97
97
  },
98
- "name": "EnvsMain",
99
- "componentId": {
100
- "scope": "teambit.envs",
101
- "name": "envs"
102
- }
98
+ "name": "EnvsMain"
103
99
  },
104
100
  "isOptional": false,
105
101
  "isSpread": false
@@ -119,8 +115,7 @@
119
115
  "line": 17,
120
116
  "character": 65
121
117
  },
122
- "name": "FormatterService",
123
- "internalFilePath": "formatter.service.ts"
118
+ "name": "FormatterService"
124
119
  },
125
120
  "isOptional": false,
126
121
  "isSpread": false
@@ -179,11 +174,7 @@
179
174
  "line": 22,
180
175
  "character": 28
181
176
  },
182
- "name": "Component",
183
- "componentId": {
184
- "scope": "teambit.component",
185
- "name": "component"
186
- }
177
+ "name": "Component"
187
178
  }
188
179
  },
189
180
  "isOptional": false,
@@ -265,11 +256,7 @@
265
256
  "line": 31,
266
257
  "character": 27
267
258
  },
268
- "name": "Component",
269
- "componentId": {
270
- "scope": "teambit.component",
271
- "name": "component"
272
- }
259
+ "name": "Component"
273
260
  }
274
261
  },
275
262
  "isOptional": false,
@@ -334,11 +321,7 @@
334
321
  "line": 37,
335
322
  "character": 25
336
323
  },
337
- "name": "ExecutionContext",
338
- "componentId": {
339
- "scope": "teambit.envs",
340
- "name": "envs"
341
- }
324
+ "name": "ExecutionContext"
342
325
  },
343
326
  "isOptional": false,
344
327
  "isSpread": false
@@ -515,11 +498,7 @@
515
498
  "line": 61,
516
499
  "character": 55
517
500
  },
518
- "name": "EnvsMain",
519
- "componentId": {
520
- "scope": "teambit.envs",
521
- "name": "envs"
522
- }
501
+ "name": "EnvsMain"
523
502
  },
524
503
  {
525
504
  "__schema": "TypeRefSchema",
@@ -528,11 +507,7 @@
528
507
  "line": 61,
529
508
  "character": 65
530
509
  },
531
- "name": "CLIMain",
532
- "componentId": {
533
- "scope": "teambit.harmony",
534
- "name": "cli"
535
- }
510
+ "name": "CLIMain"
536
511
  },
537
512
  {
538
513
  "__schema": "TypeRefSchema",
@@ -541,11 +516,7 @@
541
516
  "line": 61,
542
517
  "character": 74
543
518
  },
544
- "name": "ComponentMain",
545
- "componentId": {
546
- "scope": "teambit.component",
547
- "name": "component"
548
- }
519
+ "name": "ComponentMain"
549
520
  },
550
521
  {
551
522
  "__schema": "TypeRefSchema",
@@ -554,11 +525,7 @@
554
525
  "line": 61,
555
526
  "character": 89
556
527
  },
557
- "name": "LoggerMain",
558
- "componentId": {
559
- "scope": "teambit.harmony",
560
- "name": "logger"
561
- }
528
+ "name": "LoggerMain"
562
529
  },
563
530
  {
564
531
  "__schema": "TypeRefSchema",
@@ -567,11 +534,7 @@
567
534
  "line": 61,
568
535
  "character": 101
569
536
  },
570
- "name": "Workspace",
571
- "componentId": {
572
- "scope": "teambit.workspace",
573
- "name": "workspace"
574
- }
537
+ "name": "Workspace"
575
538
  }
576
539
  ]
577
540
  },
@@ -1224,11 +1187,7 @@
1224
1187
  "line": 7,
1225
1188
  "character": 26
1226
1189
  },
1227
- "name": "BuildContext",
1228
- "componentId": {
1229
- "scope": "teambit.pipelines",
1230
- "name": "builder"
1231
- }
1190
+ "name": "BuildContext"
1232
1191
  },
1233
1192
  "isOptional": false,
1234
1193
  "isSpread": false
@@ -1250,11 +1209,7 @@
1250
1209
  "line": 7,
1251
1210
  "character": 49
1252
1211
  },
1253
- "name": "BuiltTaskResult",
1254
- "componentId": {
1255
- "scope": "teambit.pipelines",
1256
- "name": "builder"
1257
- }
1212
+ "name": "BuiltTaskResult"
1258
1213
  }
1259
1214
  ]
1260
1215
  },
@@ -1286,7 +1241,7 @@
1286
1241
  "_legacy": {
1287
1242
  "scope": "teambit.defender",
1288
1243
  "name": "formatter",
1289
- "version": "1.0.225"
1244
+ "version": "1.0.227"
1290
1245
  },
1291
1246
  "_scope": "teambit.defender"
1292
1247
  }
@@ -1332,10 +1287,6 @@
1332
1287
  "character": 16
1333
1288
  },
1334
1289
  "name": "EnvHandler",
1335
- "componentId": {
1336
- "scope": "teambit.envs",
1337
- "name": "envs"
1338
- },
1339
1290
  "typeArgs": [
1340
1291
  {
1341
1292
  "__schema": "TypeRefSchema",
@@ -1385,7 +1336,7 @@
1385
1336
  "_legacy": {
1386
1337
  "scope": "teambit.defender",
1387
1338
  "name": "formatter",
1388
- "version": "1.0.225"
1339
+ "version": "1.0.227"
1389
1340
  },
1390
1341
  "_scope": "teambit.defender"
1391
1342
  }
@@ -1617,11 +1568,7 @@
1617
1568
  "line": 17,
1618
1569
  "character": 29
1619
1570
  },
1620
- "name": "EnvsMain",
1621
- "componentId": {
1622
- "scope": "teambit.envs",
1623
- "name": "envs"
1624
- }
1571
+ "name": "EnvsMain"
1625
1572
  },
1626
1573
  "isOptional": false,
1627
1574
  "isSpread": false
@@ -1641,8 +1588,7 @@
1641
1588
  "line": 17,
1642
1589
  "character": 65
1643
1590
  },
1644
- "name": "FormatterService",
1645
- "internalFilePath": "formatter.service.ts"
1591
+ "name": "FormatterService"
1646
1592
  },
1647
1593
  "isOptional": false,
1648
1594
  "isSpread": false
@@ -1701,11 +1647,7 @@
1701
1647
  "line": 22,
1702
1648
  "character": 28
1703
1649
  },
1704
- "name": "Component",
1705
- "componentId": {
1706
- "scope": "teambit.component",
1707
- "name": "component"
1708
- }
1650
+ "name": "Component"
1709
1651
  }
1710
1652
  },
1711
1653
  "isOptional": false,
@@ -1787,11 +1729,7 @@
1787
1729
  "line": 31,
1788
1730
  "character": 27
1789
1731
  },
1790
- "name": "Component",
1791
- "componentId": {
1792
- "scope": "teambit.component",
1793
- "name": "component"
1794
- }
1732
+ "name": "Component"
1795
1733
  }
1796
1734
  },
1797
1735
  "isOptional": false,
@@ -1856,11 +1794,7 @@
1856
1794
  "line": 37,
1857
1795
  "character": 25
1858
1796
  },
1859
- "name": "ExecutionContext",
1860
- "componentId": {
1861
- "scope": "teambit.envs",
1862
- "name": "envs"
1863
- }
1797
+ "name": "ExecutionContext"
1864
1798
  },
1865
1799
  "isOptional": false,
1866
1800
  "isSpread": false
@@ -2037,11 +1971,7 @@
2037
1971
  "line": 61,
2038
1972
  "character": 55
2039
1973
  },
2040
- "name": "EnvsMain",
2041
- "componentId": {
2042
- "scope": "teambit.envs",
2043
- "name": "envs"
2044
- }
1974
+ "name": "EnvsMain"
2045
1975
  },
2046
1976
  {
2047
1977
  "__schema": "TypeRefSchema",
@@ -2050,11 +1980,7 @@
2050
1980
  "line": 61,
2051
1981
  "character": 65
2052
1982
  },
2053
- "name": "CLIMain",
2054
- "componentId": {
2055
- "scope": "teambit.harmony",
2056
- "name": "cli"
2057
- }
1983
+ "name": "CLIMain"
2058
1984
  },
2059
1985
  {
2060
1986
  "__schema": "TypeRefSchema",
@@ -2063,11 +1989,7 @@
2063
1989
  "line": 61,
2064
1990
  "character": 74
2065
1991
  },
2066
- "name": "ComponentMain",
2067
- "componentId": {
2068
- "scope": "teambit.component",
2069
- "name": "component"
2070
- }
1992
+ "name": "ComponentMain"
2071
1993
  },
2072
1994
  {
2073
1995
  "__schema": "TypeRefSchema",
@@ -2076,11 +1998,7 @@
2076
1998
  "line": 61,
2077
1999
  "character": 89
2078
2000
  },
2079
- "name": "LoggerMain",
2080
- "componentId": {
2081
- "scope": "teambit.harmony",
2082
- "name": "logger"
2083
- }
2001
+ "name": "LoggerMain"
2084
2002
  },
2085
2003
  {
2086
2004
  "__schema": "TypeRefSchema",
@@ -2089,11 +2007,7 @@
2089
2007
  "line": 61,
2090
2008
  "character": 101
2091
2009
  },
2092
- "name": "Workspace",
2093
- "componentId": {
2094
- "scope": "teambit.workspace",
2095
- "name": "workspace"
2096
- }
2010
+ "name": "Workspace"
2097
2011
  }
2098
2012
  ]
2099
2013
  },
@@ -2760,11 +2674,7 @@
2760
2674
  "line": 7,
2761
2675
  "character": 26
2762
2676
  },
2763
- "name": "BuildContext",
2764
- "componentId": {
2765
- "scope": "teambit.pipelines",
2766
- "name": "builder"
2767
- }
2677
+ "name": "BuildContext"
2768
2678
  },
2769
2679
  "isOptional": false,
2770
2680
  "isSpread": false
@@ -2786,11 +2696,7 @@
2786
2696
  "line": 7,
2787
2697
  "character": 49
2788
2698
  },
2789
- "name": "BuiltTaskResult",
2790
- "componentId": {
2791
- "scope": "teambit.pipelines",
2792
- "name": "builder"
2793
- }
2699
+ "name": "BuiltTaskResult"
2794
2700
  }
2795
2701
  ]
2796
2702
  },
@@ -2822,7 +2728,7 @@
2822
2728
  "_legacy": {
2823
2729
  "scope": "teambit.defender",
2824
2730
  "name": "formatter",
2825
- "version": "1.0.225"
2731
+ "version": "1.0.227"
2826
2732
  },
2827
2733
  "_scope": "teambit.defender"
2828
2734
  }
@@ -2879,10 +2785,6 @@
2879
2785
  "character": 16
2880
2786
  },
2881
2787
  "name": "EnvHandler",
2882
- "componentId": {
2883
- "scope": "teambit.envs",
2884
- "name": "envs"
2885
- },
2886
2788
  "typeArgs": [
2887
2789
  {
2888
2790
  "__schema": "TypeRefSchema",
@@ -2907,7 +2809,7 @@
2907
2809
  "componentId": {
2908
2810
  "scope": "teambit.defender",
2909
2811
  "name": "formatter",
2910
- "version": "1.0.225"
2812
+ "version": "1.0.227"
2911
2813
  },
2912
2814
  "taggedModuleExports": []
2913
2815
  }
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.defender_formatter@1.0.225/dist/formatter.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.defender_formatter@1.0.225/dist/formatter.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.defender_formatter@1.0.227/dist/formatter.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.defender_formatter@1.0.227/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.225",
3
+ "version": "1.0.227",
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.225"
9
+ "version": "1.0.227"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "2.4.2",
@@ -14,19 +14,19 @@
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.859",
18
- "@teambit/component": "1.0.225",
19
- "@teambit/envs": "1.0.225",
20
- "@teambit/workspace": "1.0.225",
21
- "@teambit/builder": "1.0.225",
22
- "@teambit/logger": "0.0.952"
17
+ "@teambit/cli": "0.0.860",
18
+ "@teambit/component": "1.0.227",
19
+ "@teambit/envs": "1.0.227",
20
+ "@teambit/workspace": "1.0.227",
21
+ "@teambit/builder": "1.0.227",
22
+ "@teambit/logger": "0.0.953"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@types/lodash": "4.14.165",
26
26
  "@types/mocha": "9.1.0",
27
27
  "chai": "4.3.0",
28
28
  "@teambit/defender.content.formatter-overview": "1.96.1",
29
- "@teambit/harmony.envs.core-aspect-env": "0.0.27"
29
+ "@teambit/harmony.envs.core-aspect-env": "0.0.30"
30
30
  },
31
31
  "peerDependencies": {
32
32
  "react": "^17.0.0 || ^18.0.0",
package/tsconfig.json CHANGED
@@ -20,7 +20,8 @@
20
20
  "emitDeclarationOnly": true,
21
21
  "strict": true,
22
22
  "strictPropertyInitialization": false,
23
- "noImplicitAny": false
23
+ "noImplicitAny": false,
24
+ "composite": true
24
25
  },
25
26
  "exclude": [
26
27
  "artifacts",
@@ -35,5 +36,25 @@
35
36
  "include": [
36
37
  "**/*",
37
38
  "**/*.json"
39
+ ],
40
+ "references": [
41
+ {
42
+ "path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_cli@0.0.860"
43
+ },
44
+ {
45
+ "path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_component@1.0.227"
46
+ },
47
+ {
48
+ "path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.envs_envs@1.0.227"
49
+ },
50
+ {
51
+ "path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.workspace_workspace@1.0.227"
52
+ },
53
+ {
54
+ "path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.pipelines_builder@1.0.227"
55
+ },
56
+ {
57
+ "path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_logger@0.0.953"
58
+ }
38
59
  ]
39
60
  }
@@ -1,54 +0,0 @@
1
- import { TimerResponse } from '@teambit/legacy/dist/toolbox/timer';
2
- import { Command, CommandOptions } from '@teambit/cli';
3
- import { ComponentFactory, ComponentID } from '@teambit/component';
4
- import { Workspace } from '@teambit/workspace';
5
- import { FormatterMain } from './formatter.main.runtime';
6
- import { ComponentFormatResult, FormatResults } from './formatter';
7
- export type FormatCmdOptions = {
8
- changed?: boolean;
9
- json?: boolean;
10
- check?: boolean;
11
- };
12
- /**
13
- * 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
14
- */
15
- export type JsonComponentFormatResult = Omit<ComponentFormatResult, 'component'> & {
16
- componentId: ComponentID;
17
- };
18
- export type JsonFormatDataResults = Omit<FormatResults, 'results'> & {
19
- results: JsonComponentFormatResult[];
20
- };
21
- /**
22
- * 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
23
- */
24
- export type JsonFormatResults = {
25
- duration: TimerResponse;
26
- data: JsonFormatDataResults;
27
- code: number;
28
- componentsIdsToFormat: string[];
29
- };
30
- export declare class FormatCmd implements Command {
31
- private formatter;
32
- private componentHost;
33
- private workspace;
34
- name: string;
35
- description: string;
36
- arguments: {
37
- name: string;
38
- description: string;
39
- }[];
40
- group: string;
41
- helpUrl: string;
42
- options: CommandOptions;
43
- constructor(formatter: FormatterMain, componentHost: ComponentFactory, workspace: Workspace);
44
- report([pattern]: [string], formatterOptions: FormatCmdOptions): Promise<{
45
- data: string;
46
- code: number;
47
- }>;
48
- json([pattern]: [string], formatterCmdOptions: FormatCmdOptions): Promise<JsonFormatResults>;
49
- private getStatusCode;
50
- private getIdsToFormat;
51
- private getAllComponentsResultOutput;
52
- private getOneComponentResultOutput;
53
- private getOneComponentFileResultOutput;
54
- }
@@ -1,7 +0,0 @@
1
- import { BuildTask, BuiltTaskResult, BuildContext } from '@teambit/builder';
2
- export declare class FormatTask implements BuildTask {
3
- readonly aspectId: string;
4
- readonly name: string;
5
- constructor(aspectId: string, name?: string);
6
- execute(context: BuildContext): Promise<BuiltTaskResult>;
7
- }
@@ -1,6 +0,0 @@
1
- import { ExecutionContext } from '@teambit/envs';
2
- export type FormatterOptions = {
3
- check?: boolean;
4
- };
5
- export interface FormatterContext extends ExecutionContext, FormatterOptions {
6
- }
@@ -1,8 +0,0 @@
1
- import { EnvHandler } from '@teambit/envs';
2
- import { Formatter } from './formatter';
3
- export interface FormatterEnv {
4
- /**
5
- * return a Formatter instance.
6
- */
7
- formatter(): EnvHandler<Formatter>;
8
- }
@@ -1,2 +0,0 @@
1
- import { Aspect } from '@teambit/harmony';
2
- export declare const FormatterAspect: Aspect;
@@ -1 +0,0 @@
1
- export declare const Logo: () => import("react/jsx-runtime").JSX.Element;
@@ -1,36 +0,0 @@
1
- import { Component } from '@teambit/component';
2
- import { FormatterContext } from './formatter-context';
3
- export type ComponentFormatResult = {
4
- /**
5
- * the formatted component.
6
- */
7
- component: Component;
8
- /**
9
- * format results for each file of the component.
10
- */
11
- results: FileFormatResult[];
12
- };
13
- export type FileFormatResult = {
14
- /**
15
- * path of the formatted file.
16
- */
17
- filePath: string;
18
- /**
19
- * Does the file has formatting issues (needs format)
20
- */
21
- hasIssues: boolean;
22
- /**
23
- * The new file content after the formatting
24
- */
25
- newContent?: string;
26
- };
27
- export type FormatResults = {
28
- results: ComponentFormatResult[];
29
- errors: Error[];
30
- };
31
- export interface Formatter {
32
- id: string;
33
- format(context: FormatterContext): Promise<FormatResults>;
34
- formatSnippet(snippet: string, filepath?: string): Promise<string>;
35
- check(context: FormatterContext): Promise<FormatResults>;
36
- }
@@ -1,4 +0,0 @@
1
- export declare function linterSchema(): {
2
- typeDefs: import("graphql").DocumentNode;
3
- resolvers: {};
4
- };
@@ -1,34 +0,0 @@
1
- import { CLIMain } from '@teambit/cli';
2
- import { Component, ComponentMain } from '@teambit/component';
3
- import { EnvsMain, ExecutionContext } from '@teambit/envs';
4
- import { LoggerMain } from '@teambit/logger';
5
- import { Workspace } from '@teambit/workspace';
6
- import { FormatterService } from './formatter.service';
7
- import { FormatTask } from './format.task';
8
- import { FormatterOptions } from './formatter-context';
9
- import { Formatter } from './formatter';
10
- export type FormatterConfig = {};
11
- export declare class FormatterMain {
12
- private envs;
13
- private formatterService;
14
- static runtime: import("@teambit/harmony").RuntimeDefinition;
15
- constructor(envs: EnvsMain, formatterService: FormatterService);
16
- /**
17
- * format an array of components.
18
- */
19
- format(components: Component[], opts: FormatterOptions): Promise<import("@teambit/envs").EnvsExecutionResult<import("./formatter").FormatResults>>;
20
- /**
21
- * check format an array of components.
22
- */
23
- check(components: Component[], opts: FormatterOptions): Promise<import("@teambit/envs").EnvsExecutionResult<import("./formatter").FormatResults>>;
24
- getFormatter(context: ExecutionContext, options: FormatterOptions): Formatter;
25
- private toFormatServiceOptions;
26
- /**
27
- * create a format task for build pipelines.
28
- * @param name name of the task.
29
- */
30
- createTask(name?: string): FormatTask;
31
- static dependencies: import("@teambit/harmony").Aspect[];
32
- static defaultConfig: FormatterConfig;
33
- static provider([envs, cli, component, loggerAspect, workspace]: [EnvsMain, CLIMain, ComponentMain, LoggerMain, Workspace], config: FormatterConfig): Promise<FormatterMain>;
34
- }
@@ -1,26 +0,0 @@
1
- import { EnvService, ExecutionContext, EnvDefinition, Env, EnvContext, ServiceTransformationMap } from '@teambit/envs';
2
- import { Formatter, FormatResults } from './formatter';
3
- import { FormatterOptions } from './formatter-context';
4
- import { FormatterConfig } from './formatter.main.runtime';
5
- type FormatterTransformationMap = ServiceTransformationMap & {
6
- getFormatter: () => Formatter;
7
- };
8
- export declare class FormatterService implements EnvService<FormatResults> {
9
- private formatterConfig;
10
- name: string;
11
- constructor(formatterConfig: FormatterConfig);
12
- run(context: ExecutionContext, options: FormatterOptions): Promise<FormatResults>;
13
- getFormatter(context: ExecutionContext, options: FormatterOptions): Formatter;
14
- private optionsWithDefaults;
15
- private mergeContext;
16
- render(env: EnvDefinition): string;
17
- transform(env: Env, context: EnvContext): FormatterTransformationMap | undefined;
18
- getDescriptor(env: EnvDefinition): {
19
- id: any;
20
- icon: any;
21
- config: any;
22
- version: any;
23
- displayName: any;
24
- } | undefined;
25
- }
26
- export {};
package/dist/index.d.ts DELETED
@@ -1,8 +0,0 @@
1
- import { FormatterAspect } from './formatter.aspect';
2
- export { FormatterAspect };
3
- export type { FormatterMain, FormatterConfig } from './formatter.main.runtime';
4
- export type { FormatResults, Formatter, FileFormatResult, ComponentFormatResult } from './formatter';
5
- export type { FormatTask } from './format.task';
6
- export type { FormatterEnv } from './formatter-env-type';
7
- export type { FormatterContext, FormatterOptions } from './formatter-context';
8
- export default FormatterAspect;