@teambit/formatter 1.0.1272 → 1.0.1274

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.
@@ -1,33 +1,6 @@
1
- import type { Component } from '@teambit/component';
2
1
  import type { 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
- };
2
+ import type { FormatResults } from '@teambit/envs.contracts';
3
+ export type { ComponentFormatResult, FileFormatResult, FormatResults } from '@teambit/envs.contracts';
31
4
  export interface Formatter {
32
5
  id: string;
33
6
  format(context: FormatterContext): Promise<FormatResults>;
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["formatter.ts"],"sourcesContent":["import type { Component } from '@teambit/component';\nimport type { 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
+ {"version":3,"names":[],"sources":["formatter.ts"],"sourcesContent":["import type { FormatterContext } from './formatter-context';\nimport type { FormatResults } from '@teambit/envs.contracts';\n\nexport type { ComponentFormatResult, FileFormatResult, FormatResults } from '@teambit/envs.contracts';\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":[]}
@@ -20,11 +20,11 @@ export declare class FormatterMain {
20
20
  /**
21
21
  * format an array of components.
22
22
  */
23
- format(components: Component[], opts: FormatterOptions): Promise<import("@teambit/envs").EnvsExecutionResult<import("./formatter").FormatResults>>;
23
+ format(components: Component[], opts: FormatterOptions): Promise<import("@teambit/envs").EnvsExecutionResult<import("@teambit/envs.contracts").FormatResults>>;
24
24
  /**
25
25
  * check format an array of components.
26
26
  */
27
- check(components: Component[], opts: FormatterOptions): Promise<import("@teambit/envs").EnvsExecutionResult<import("./formatter").FormatResults>>;
27
+ check(components: Component[], opts: FormatterOptions): Promise<import("@teambit/envs").EnvsExecutionResult<import("@teambit/envs.contracts").FormatResults>>;
28
28
  getFormatter(context: ExecutionContext, options: FormatterOptions): Formatter | undefined;
29
29
  private toFormatServiceOptions;
30
30
  /**
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.defender_formatter@1.0.1272/dist/formatter.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.defender_formatter@1.0.1272/dist/formatter.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.defender_formatter@1.0.1274/dist/formatter.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.defender_formatter@1.0.1274/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.1272",
3
+ "version": "1.0.1274",
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.1272"
9
+ "version": "1.0.1274"
10
10
  },
11
11
  "dependencies": {
12
12
  "lodash": "4.18.1",
@@ -14,16 +14,17 @@
14
14
  "chalk": "4.1.2",
15
15
  "cli-highlight": "2.1.9",
16
16
  "@teambit/cli": "0.0.1432",
17
+ "@teambit/component": "1.0.1246",
17
18
  "@teambit/legacy.constants": "0.0.50",
18
19
  "@teambit/toolbox.time.timer": "0.0.23",
19
20
  "@teambit/harmony": "0.4.12",
20
21
  "@teambit/harmony.modules.runtimes": "0.0.4",
21
22
  "@teambit/logger": "0.0.1502",
22
- "@teambit/component": "1.0.1246",
23
- "@teambit/envs": "1.0.1246",
24
- "@teambit/workspace": "1.0.1266",
25
- "@teambit/builder": "1.0.1266",
26
- "@teambit/snapping": "1.0.1272"
23
+ "@teambit/envs.contracts": "0.0.1",
24
+ "@teambit/envs": "1.0.1248",
25
+ "@teambit/workspace": "1.0.1268",
26
+ "@teambit/builder": "1.0.1268",
27
+ "@teambit/snapping": "1.0.1274"
27
28
  },
28
29
  "devDependencies": {
29
30
  "@types/lodash": "4.14.165",