@teambit/formatter 0.0.287 → 0.0.290
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/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.aspect.js.map +1 -1
- package/dist/formatter.composition.js.map +1 -1
- 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/package-tar/teambit-formatter-0.0.290.tgz +0 -0
- package/package.json +6 -6
- package/{preview-1652844422371.js → preview-1653362849981.js} +2 -2
- package/tsconfig.json +1 -1
- package/package-tar/teambit-formatter-0.0.287.tgz +0 -0
package/dist/format.cmd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["format.cmd.ts"],"names":["FormatCmd","constructor","formatter","componentHost","workspace","report","components","formatterOptions","duration","data","componentsIdsToFormat","json","title","chalk","bold","cyan","length","toString","name","componentsOutputs","getAllComponentsResultOutput","results","check","seconds","summery","formatterCmdOptions","timer","Timer","create","start","componentsIds","getIdsToFormat","changed","componentsToFormat","getMany","opts","formatterResults","format","jsonFormatterResults","toJsonFormatResults","timerResponse","stop","map","comp","id","resolveMultipleComponentIds","getNewAndModifiedIds","listIds","componentsResult","context","allResults","getOneComponentResultOutput","join","componentResult","componentId","ignoreVersion","filesWithIssues","filter","fileResult","hasIssues","green","subTitle","red","files","getOneComponentFileResultOutput","filePath","newResults","res","resultsWithoutComponent","result","component","errors"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAgCO,MAAMA,SAAN,CAAmC;AAUxCC,EAAA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iG;AAC/F,QAAM6C,UAAU,GAAG7C,OAAO,CAACA,OAAR,CAAgBqB,GAAhB,CAAqByB,GAAD,IAAS;AAAA;;AAC9C,UAAMC,uBAAuB,gBAAGD,GAAG,CAAC1D,IAAP,8CAAG,UAAUY,OAAV,CAAkBqB,GAAlB,CAAuB2B,MAAD,IAAY;AAChE,aAAO;AACLf,QAAAA,WAAW,EAAEe,MAAM,CAACC,SAAP,CAAiB1B,EADzB;AAELvB,QAAAA,OAAO,EAAEgD,MAAM,CAAChD;AAFX,OAAP;AAID,KAL+B,CAAhC;AAMA,WAAO,uBAAQ+C,uBAAR,CAAP;AACD,GARkB,CAAnB;AASA,SAAO;AACL/C,IAAAA,OAAO,EAAE,uBAAQ,uBAAQ6C,UAAR,CAAR,CADJ;AAELK,IAAAA,MAAM,EAAElD,OAAF,aAAEA,OAAF,uBAAEA,OAAO,CAAEkD;AAFZ,GAAP;AAID","sourcesContent":["import { TimerResponse, Timer } from '@teambit/legacy/dist/toolbox/timer';\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 componentsIdsToFormat: string[];\n};\n\nexport class FormatCmd implements Command {\n name = 'format [component...]';\n description = 'format components in the development workspace';\n group = 'development';\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([components = []]: [string[]], formatterOptions: FormatCmdOptions) {\n const { duration, data, componentsIdsToFormat } = await this.json([components], 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 `${title}\\n\\n${componentsOutputs}\\n\\n${summery}`;\n }\n\n async json([components = []]: [string[]], formatterCmdOptions: FormatCmdOptions): Promise<JsonFormatResults> {\n const timer = Timer.create();\n timer.start();\n const componentsIds = await this.getIdsToFormat(components, 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 return {\n duration: timerResponse,\n data: jsonFormatterResults,\n componentsIdsToFormat: componentsToFormat.map((comp) => comp.id.toString()),\n };\n }\n\n private async getIdsToFormat(components: string[], changed = false): Promise<ComponentID[]> {\n if (components.length) {\n return this.workspace.resolveMultipleComponentIds(components);\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"]}
|
|
1
|
+
{"version":3,"names":["FormatCmd","constructor","formatter","componentHost","workspace","report","components","formatterOptions","duration","data","componentsIdsToFormat","json","title","chalk","bold","cyan","length","toString","name","componentsOutputs","getAllComponentsResultOutput","results","check","seconds","summery","formatterCmdOptions","timer","Timer","create","start","componentsIds","getIdsToFormat","changed","componentsToFormat","getMany","opts","formatterResults","format","jsonFormatterResults","toJsonFormatResults","timerResponse","stop","map","comp","id","resolveMultipleComponentIds","getNewAndModifiedIds","listIds","componentsResult","context","allResults","getOneComponentResultOutput","join","componentResult","componentId","ignoreVersion","filesWithIssues","filter","fileResult","hasIssues","green","subTitle","red","files","getOneComponentFileResultOutput","filePath","newResults","res","resultsWithoutComponent","result","component","compact","flatten","errors"],"sources":["format.cmd.ts"],"sourcesContent":["import { TimerResponse, Timer } from '@teambit/legacy/dist/toolbox/timer';\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 componentsIdsToFormat: string[];\n};\n\nexport class FormatCmd implements Command {\n name = 'format [component...]';\n description = 'format components in the development workspace';\n group = 'development';\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([components = []]: [string[]], formatterOptions: FormatCmdOptions) {\n const { duration, data, componentsIdsToFormat } = await this.json([components], 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 `${title}\\n\\n${componentsOutputs}\\n\\n${summery}`;\n }\n\n async json([components = []]: [string[]], formatterCmdOptions: FormatCmdOptions): Promise<JsonFormatResults> {\n const timer = Timer.create();\n timer.start();\n const componentsIds = await this.getIdsToFormat(components, 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 return {\n duration: timerResponse,\n data: jsonFormatterResults,\n componentsIdsToFormat: componentsToFormat.map((comp) => comp.id.toString()),\n };\n }\n\n private async getIdsToFormat(components: string[], changed = false): Promise<ComponentID[]> {\n if (components.length) {\n return this.workspace.resolveMultipleComponentIds(components);\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;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAgCO,MAAMA,SAAN,CAAmC;EAUxCC,WAAW,CACDC,SADC,EAEDC,aAFC,EAGDC,SAHC,EAIT;IAAA,KAHQF,SAGR,GAHQA,SAGR;IAAA,KAFQC,aAER,GAFQA,aAER;IAAA,KADQC,SACR,GADQA,SACR;IAAA,8CAbK,uBAaL;IAAA,qDAZY,gDAYZ;IAAA,+CAXM,aAWN;IAAA,iDAVQ,CACR,CAAC,GAAD,EAAM,SAAN,EAAiB,yCAAjB,CADQ,EAER,CAAC,EAAD,EAAK,OAAL,EAAc,8EAAd,CAFQ,EAGR,CAAC,GAAD,EAAM,MAAN,EAAc,0CAAd,CAHQ,CAUR;EAAE;;EAEQ,MAANC,MAAM,CAAC,CAACC,UAAU,GAAG,EAAd,CAAD,EAAgCC,gBAAhC,EAAoE;IAC9E,MAAM;MAAEC,QAAF;MAAYC,IAAZ;MAAkBC;IAAlB,IAA4C,MAAM,KAAKC,IAAL,CAAU,CAACL,UAAD,CAAV,EAAwBC,gBAAxB,CAAxD;;IAEA,MAAMK,KAAK,GAAGC,gBAAA,CAAMC,IAAN,CACX,uBAAsBD,gBAAA,CAAME,IAAN,CACrBL,qBAAqB,CAACM,MAAtB,CAA6BC,QAA7B,EADqB,CAErB,+BAA8BJ,gBAAA,CAAME,IAAN,CAAW,KAAKZ,aAAL,CAAmBe,IAA9B,CAAoC,EAHxD,CAAd;;IAMA,MAAMC,iBAAiB,GAAG,KAAKC,4BAAL,CAAkCX,IAAI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AV,CAAX;IACD;;IACD,MAAMC,KAAK,GAAGP,eAAe,CAACd,GAAhB,CAAoB,KAAKsB,+BAAzB,CAAd;IACA,OAAQ,GAAEpD,KAAM,KAAIiD,QAAS,KAAIE,KAAK,CAACX,IAAN,CAAW,IAAX,CAAiB,EAAlD;EACD;;EAEOY,+BAA+B,CAACN,UAAD,EAA+B;IACpE,OAAOA,UAAU,CAACO,QAAlB;EACD;;AApFuC;;;;AAuF1C,SAAS1B,mBAAT,CAA6BlB,OAA7B,EAAiG;EAC/F,MAAM6C,UAAU,GAAG7C,OAAO,CAACA,OAAR,CAAgBqB,GAAhB,CAAqByB,GAAD,IAAS;IAAA;;IAC9C,MAAMC,uBAAuB,gBAAGD,GAAG,CAAC1D,IAAP,8CAAG,UAAUY,OAAV,CAAkBqB,GAAlB,CAAuB2B,MAAD,IAAY;MAChE,OAAO;QACLf,WAAW,EAAEe,MAAM,CAACC,SAAP,CAAiB1B,EADzB;QAELvB,OAAO,EAAEgD,MAAM,CAAChD;MAFX,CAAP;IAID,CAL+B,CAAhC;IAMA,OAAO,IAAAkD,iBAAA,EAAQH,uBAAR,CAAP;EACD,CARkB,CAAnB;EASA,OAAO;IACL/C,OAAO,EAAE,IAAAkD,iBAAA,EAAQ,IAAAC,iBAAA,EAAQN,UAAR,CAAR,CADJ;IAELO,MAAM,EAAEpD,OAAF,aAAEA,OAAF,uBAAEA,OAAO,CAAEoD;EAFZ,CAAP;AAID"}
|
package/dist/format.task.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["FormatTask","constructor","aspectId","name","execute","context","formatter","env","getFormatter","results","check","componentsResults","map","formatResult","component","metadata","errors"],"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,UAAN,CAAsC;EAC3CC,WAAW,CAAUC,QAAV,EAAqCC,IAAI,GAAG,QAA5C,EAAsD;IAAA,KAA5CD,QAA4C,GAA5CA,QAA4C;IAAA,KAAjBC,IAAiB,GAAjBA,IAAiB;EAAE;;EAEtD,MAAPC,OAAO,CAACC,OAAD,EAAkD;IAC7D,MAAMC,SAAoB,GAAGD,OAAO,CAACE,GAAR,CAAYC,YAAZ,EAA7B,CAD6D,CAE7D;;IACA,MAAMC,OAAO,GAAG,MAAMH,SAAS,CAACI,KAAV,CAAgBL,OAAhB,CAAtB;IACA,MAAMM,iBAAiB,GAAGF,OAAO,CAACA,OAAR,CAAgBG,GAAhB,CAAqBC,YAAD,IAAmC;MAC/E,OAAO;QACLC,SAAS,EAAED,YAAY,CAACC,SADnB;QAELC,QAAQ,EAAE;UACRN,OAAO,EAAEI,YAAY,CAACJ;QADd,CAFL;QAKLO,MAAM,EAAE;MALH,CAAP;IAOD,CARyB,CAA1B;IAUA,OAAO;MACLL;IADK,CAAP;EAGD;;AApB0C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":[],"sources":["formatter-context.ts"],"sourcesContent":["import { ExecutionContext } from '@teambit/envs';\nimport { FormatterServiceOptions } from './formatter.service';\n\nexport type FormatterOptions = {};\nexport interface FormatterContext extends ExecutionContext, FormatterOptions, FormatterServiceOptions {}\n// export interface FormatterContext extends ExecutionContext {}\n// export type FormatterContext = ExecutionContext;\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["FormatterAspect","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;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEO,MAAMA,eAAe,GAAGC,iBAAA,CAAOC,MAAP,CAAc;EAC3CC,EAAE,EAAE;AADuC,CAAd,CAAxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["Logo","height","display","justifyContent","width"],"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;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEO,MAAMA,IAAI,GAAG,mBAClB;EAAK,KAAK,EAAE;IAAEC,MAAM,EAAE,MAAV;IAAkBC,OAAO,EAAE,MAA3B;IAAmCC,cAAc,EAAE;EAAnD;AAAZ,gBACE;EAAK,KAAK,EAAE;IAAEC,KAAK,EAAE;EAAT,CAAZ;EAA2B,GAAG,EAAC;AAA/B,EADF,CADK"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["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;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEO,SAASA,YAAT,GAAwB;EAC7B,OAAO;IACLC,QAAQ,EAAE,IAAAC,qBAAA,CAAI,EADT;IAELC,SAAS,EAAE;EAFN,CAAP;AAID"}
|
package/dist/formatter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
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 format(context: FormatterContext): Promise<FormatResults>;\n check(context: FormatterContext): Promise<FormatResults>;\n}\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["FormatterMain","constructor","envs","formatterService","format","components","opts","envsRuntime","createEnvironment","formatResults","run","toFormatServiceOptions","check","createTask","name","FormatTask","FormatterAspect","id","provider","cli","component","loggerAspect","workspace","config","logger","createLogger","FormatterService","formatterAspect","registerService","register","FormatCmd","getHost","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 } from '@teambit/envs';\nimport { LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { Workspace, WorkspaceAspect } from '@teambit/workspace';\nimport { FormatterAspect } from './formatter.aspect';\nimport { FormatterService, FormatterServiceOptions } from './formatter.service';\nimport { FormatTask } from './format.task';\nimport { FormatCmd } from './format.cmd';\nimport { FormatterOptions } from './formatter-context';\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 private toFormatServiceOptions(opts: FormatterOptions, check = false): FormatterServiceOptions {\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;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAA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mB,EAEnBC,MAFmB,EAGnB;IACA;IACA,MAAMC,MAAM,GAAGH,YAAY,CAACI,YAAb,CAA0BT,4BAAA,CAAgBC,EAA1C,CAAf;IACA,MAAMd,gBAAgB,GAAG,KAAIuB,8BAAJ,EAAqBH,MAArB,CAAzB;IACA,MAAMI,eAAe,GAAG,IAAI3B,aAAJ,CAAkBE,IAAlB,EAAwBC,gBAAxB,CAAxB;IACAD,IAAI,CAAC0B,eAAL,CAAqBzB,gBAArB;IACAgB,GAAG,CAACU,QAAJ,CAAa,KAAIC,oBAAJ,EAAcH,eAAd,EAA+BP,SAAS,CAACW,OAAV,EAA/B,EAAoDT,SAApD,CAAb;IAEA,OAAOK,eAAP;EACD;;AAtDwB;;;gCAAd3B,a,aACMgC,kB;gCADNhC,a,kBAsCW,CAACiC,kBAAD,EAAaC,gBAAb,EAAwBC,4BAAxB,EAAyCC,sBAAzC,EAAuDC,4BAAvD,C;gCAtCXrC,a,mBAwC6B,E;;AAiB1CgB,4BAAA,CAAgBsB,UAAhB,CAA2BtC,aAA3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["FormatterService","constructor","formatterConfig","run","context","options","mergedOpts","optionsWithDefaults","formatterContext","mergeContext","formatter","env","getFormatter","results","check","format","defaults","Object","assign","render","descriptor","getDescriptor","id","displayName","version","config","highlight","language","ignoreIllegals","undefined","icon","displayConfig"],"sources":["formatter.service.tsx"],"sourcesContent":["import { defaults } from 'lodash';\nimport React from 'react';\nimport { EnvService, ExecutionContext, EnvDefinition } from '@teambit/envs';\nimport { Text, Newline } from 'ink';\nimport highlight from 'cli-highlight';\nimport { Formatter, FormatResults } from './formatter';\nimport { FormatterContext, FormatterOptions } from './formatter-context';\nimport { FormatterConfig } from './formatter.main.runtime';\n\nexport type FormatterServiceOptions = FormatterOptions & {\n check?: boolean;\n};\n\nexport class FormatterService implements EnvService<FormatResults> {\n name = 'formatter';\n\n constructor(private formatterConfig: FormatterConfig) {}\n\n async run(context: ExecutionContext, options: FormatterServiceOptions): Promise<FormatResults> {\n const mergedOpts = this.optionsWithDefaults(options);\n const formatterContext: FormatterContext = this.mergeContext(mergedOpts, context);\n const formatter: Formatter = context.env.getFormatter(formatterContext);\n\n const results = options.check ? await formatter.check(formatterContext) : await formatter.format(formatterContext);\n return results;\n }\n\n private optionsWithDefaults(options: FormatterServiceOptions): FormatterServiceOptions {\n return defaults(options, this.formatterConfig);\n }\n\n private mergeContext(options: FormatterServiceOptions, 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\n return (\n <Text key={descriptor?.id}>\n <Text color=\"cyan\">configured formatter: </Text>\n <Text>\n {descriptor?.id} ({descriptor?.displayName} @ {descriptor?.version})\n </Text>\n <Newline />\n <Text color=\"cyan\">formatter config:</Text>\n <Newline />\n <Text>\n {descriptor?.config && highlight(descriptor?.config, { language: 'javascript', ignoreIllegals: true })}\n </Text>\n <Newline />\n </Text>\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;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AASO,MAAMA,gBAAN,CAA4D;EAGjEC,WAAW,CAASC,eAAT,EAA2C;IAAA,KAA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D,OALF,eAME,+BAAC,WAAD;MAAM,KAAK,EAAC;IAAZ,uBANF,eAOE,+BAAC,cAAD,OAPF,eAQE,+BAAC,WAAD,QACG,CAAAJ,UAAU,SAAV,IAAAA,UAAU,WAAV,YAAAA,UAAU,CAAEK,MAAZ,KAAsB,IAAAC,uBAAA,EAAUN,UAAV,aAAUA,UAAV,uBAAUA,UAAU,CAAEK,MAAtB,EAA8B;MAAEE,QAAQ,EAAE,YAAZ;MAA0BC,cAAc,EAAE;IAA1C,CAA9B,CADzB,CARF,eAWE,+BAAC,cAAD,OAXF,CADF;EAeD;;EAEDP,aAAa,CAACV,GAAD,EAAqB;IAChC,IAAI,CAACA,GAAG,CAACA,GAAJ,CAAQC,YAAb,EAA2B,OAAOiB,SAAP;IAC3B,MAAMvB,UAAU,GAAG,KAAKC,mBAAL,CAAyB,EAAzB,CAAnB;IACA,MAAMC,gBAAgB,GAAG,KAAKC,YAAL,CAAkBH,UAAlB,CAAzB;IACA,MAAMI,SAAS,GAAGC,GAAG,CAACA,GAAJ,CAAQC,YAAR,CAAqBJ,gBAArB,CAAlB;IAEA,OAAO;MACLc,EAAE,EAAEZ,SAAS,CAACY,EADT;MAELQ,IAAI,EAAEpB,SAAS,CAACoB,IAFX;MAGLL,MAAM,EAAEf,SAAS,CAACqB,aAAV,GAA0BrB,SAAS,CAACqB,aAAV,EAA1B,GAAsDF,SAHzD;MAILL,OAAO,EAAEd,SAAS,CAACc,OAAV,GAAoBd,SAAS,CAACc,OAAV,EAApB,GAA0C,GAJ9C;MAKLD,WAAW,EAAEb,SAAS,CAACa,WAAV,GAAwBb,SAAS,CAACa,WAAlC,GAAgD;IALxD,CAAP;EAOD;;AAxDgE"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["FormatterAspect"],"sources":["index.ts"],"sourcesContent":["import { FormatterAspect } from './formatter.aspect';\n\nexport { FormatterAspect };\nexport type { FormatterMain, FormatterConfig } from './formatter.main.runtime';\nexport { FormatResults, Formatter, FileFormatResult, ComponentFormatResult } from './formatter';\nexport type { FormatTask } from './format.task';\nexport type { FormatterContext, FormatterOptions } from './formatter-context';\nexport default FormatterAspect;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAIA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;eAGeA,4B"}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/formatter",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.290",
|
|
4
4
|
"homepage": "https://bit.dev/teambit/defender/formatter",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.defender",
|
|
8
8
|
"name": "formatter",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.290"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "2.4.2",
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
"core-js": "^3.0.0",
|
|
19
19
|
"@teambit/harmony": "0.3.3",
|
|
20
20
|
"@teambit/cli": "0.0.491",
|
|
21
|
-
"@teambit/component": "0.0.
|
|
22
|
-
"@teambit/envs": "0.0.
|
|
23
|
-
"@teambit/workspace": "0.0.
|
|
24
|
-
"@teambit/builder": "0.0.
|
|
21
|
+
"@teambit/component": "0.0.739",
|
|
22
|
+
"@teambit/envs": "0.0.739",
|
|
23
|
+
"@teambit/workspace": "0.0.739",
|
|
24
|
+
"@teambit/builder": "0.0.739",
|
|
25
25
|
"@teambit/logger": "0.0.583"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const compositions = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.defender_formatter@0.0.
|
|
2
|
-
export const overview = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.defender_formatter@0.0.
|
|
1
|
+
export const compositions = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.defender_formatter@0.0.290/dist/formatter.composition.js')]
|
|
2
|
+
export const overview = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.defender_formatter@0.0.290/dist/formatter.docs.mdx')]
|
package/tsconfig.json
CHANGED
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
"declaration": true,
|
|
16
16
|
"sourceMap": true,
|
|
17
17
|
"skipLibCheck": true,
|
|
18
|
+
"experimentalDecorators": true,
|
|
18
19
|
"outDir": "dist",
|
|
19
20
|
"moduleResolution": "node",
|
|
20
21
|
"esModuleInterop": true,
|
|
21
22
|
"rootDir": ".",
|
|
22
23
|
"resolveJsonModule": true,
|
|
23
24
|
"emitDeclarationOnly": true,
|
|
24
|
-
"experimentalDecorators": true,
|
|
25
25
|
"emitDecoratorMetadata": true,
|
|
26
26
|
"allowSyntheticDefaultImports": true,
|
|
27
27
|
"strictPropertyInitialization": false,
|
|
Binary file
|