@teambit/linter 0.0.0-d014c9ccd34da32fd2a68e02f4563e7fba4339f8 → 0.0.0-d6a03d9498890fafa1e9eb37afac6d74668157fb
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/lint.cmd.d.ts +6 -6
- package/dist/lint.cmd.js.map +1 -1
- package/dist/lint.task.d.ts +1 -1
- package/dist/lint.task.js.map +1 -1
- package/dist/linter-context.d.ts +2 -2
- package/dist/linter-context.js.map +1 -1
- package/dist/linter-env-type.d.ts +2 -2
- package/dist/linter-env-type.js.map +1 -1
- package/dist/linter.d.ts +3 -3
- package/dist/linter.js.map +1 -1
- package/dist/linter.main.runtime.d.ts +7 -7
- package/dist/linter.main.runtime.js.map +1 -1
- package/dist/linter.service.d.ts +5 -5
- package/dist/linter.service.js.map +1 -1
- package/dist/{preview-1752698383833.js → preview-1753881650385.js} +2 -2
- package/package.json +11 -11
package/dist/lint.cmd.d.ts
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
import { TimerResponse } from '@teambit/toolbox.time.timer';
|
2
|
-
import { Command, CommandOptions } from '@teambit/cli';
|
3
|
-
import { ComponentFactory, ComponentID } from '@teambit/component';
|
4
|
-
import { Workspace } from '@teambit/workspace';
|
5
|
-
import { LinterMain } from './linter.main.runtime';
|
6
|
-
import { ComponentLintResult, LintResults } from './linter';
|
1
|
+
import type { TimerResponse } from '@teambit/toolbox.time.timer';
|
2
|
+
import type { Command, CommandOptions } from '@teambit/cli';
|
3
|
+
import type { ComponentFactory, ComponentID } from '@teambit/component';
|
4
|
+
import type { Workspace } from '@teambit/workspace';
|
5
|
+
import type { LinterMain } from './linter.main.runtime';
|
6
|
+
import type { ComponentLintResult, LintResults } from './linter';
|
7
7
|
export type LintCmdOptions = {
|
8
8
|
changed?: boolean;
|
9
9
|
fix?: boolean;
|
package/dist/lint.cmd.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_toolboxTime","data","require","_legacy","_chalk","_interopRequireDefault","_lodash","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","LintCmd","constructor","linter","componentHost","workspace","name","description","COMPONENT_PATTERN_HELP","report","pattern","linterOptions","code","json","lintResults","componentsIdsToLint","title","chalk","bold","cyan","length","toString","groupedByIsClean","groupBy","results","res","isClean","undefined","totalErrorCount","totalFatalErrorCount","totalWarningCount","dirtyComponentsOutputs","false","map","lintRes","compTitle","componentId","ignoreVersion","compOutput","output","join","cleanComponentsCount","true","cleanComponentsOutput","green","summary","getSummarySection","finalOutput","compact","duration","seconds","summaryTitle","totalFieldsMap","itemsDataField","componentsDataField","label","summaryTotals","item","renderTotalLine","filter","Boolean","componentsCount","itemsCount","fieldLabel","timer","Timer","create","start","componentsIds","getIdsToLint","changed","componentsToLint","getMany","opts","fix","fixTypes","fixType","split","linterResults","lint","jsonLinterResults","toJsonLintResults","timerResponse","stop","comp","id","idsByPattern","getNewAndModifiedIds","listIds","exports","totalFixableErrorCount","totalFixableWarningCount","totalComponentsWithErrorCount","totalComponentsWithFatalErrorCount","totalComponentsWithFixableErrorCount","totalComponentsWithFixableWarningCount","totalComponentsWithWarningCount","newResults","resultsWithoutComponent","result","assign","component","omit","flatten","errors"],"sources":["lint.cmd.ts"],"sourcesContent":["import { TimerResponse, Timer } from '@teambit/toolbox.time.timer';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy.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, groupBy, omit } from 'lodash';\nimport { LinterMain } from './linter.main.runtime';\nimport { ComponentLintResult, LintResults } from './linter';\nimport { FixTypes, LinterOptions } from './linter-context';\n\nexport type LintCmdOptions = {\n changed?: boolean;\n fix?: boolean;\n fixType?: string;\n json?: 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 JsonComponentLintResult = Omit<ComponentLintResult, 'component'> & {\n componentId: ComponentID;\n};\n\nexport type JsonLintDataResults = Omit<LintResults, 'results'> & { results: JsonComponentLintResult[] };\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 JsonLintResultsData = {\n duration: TimerResponse;\n lintResults: JsonLintDataResults;\n componentsIdsToLint: string[];\n};\n\nexport type JsonLintResults = {\n code: number;\n data: JsonLintResultsData;\n};\n\nexport class LintCmd implements Command {\n name = 'lint [component-pattern]';\n description = 'lint components in the development workspace';\n arguments = [{ name: 'component-pattern', description: COMPONENT_PATTERN_HELP }];\n helpUrl = 'reference/linting/linter-overview';\n group = 'testing';\n options = [\n ['c', 'changed', 'lint only new and modified components'],\n ['f', 'fix', 'automatically fix problems'],\n ['', 'fix-type <fixType>', 'specify the types of fixes to apply (problem, suggestion, layout)'],\n ['j', 'json', 'return the lint results in json format'],\n ] as CommandOptions;\n\n constructor(\n private linter: LinterMain,\n private componentHost: ComponentFactory,\n private workspace: Workspace\n ) {}\n\n async report([pattern]: [string], linterOptions: LintCmdOptions) {\n const { code, data } = await this.json([pattern], linterOptions);\n const { lintResults, componentsIdsToLint } = data;\n const title = chalk.bold(\n `linting total of ${chalk.cyan(componentsIdsToLint.length.toString())} component(s) in workspace '${chalk.cyan(\n this.componentHost.name\n )}'`\n );\n\n const groupedByIsClean = groupBy(lintResults.results, (res) => {\n if (res.isClean !== undefined) {\n return res.isClean;\n }\n // The is clean field was added in a later version of the linter, so if it's not there, we will calculate it\n // based on the errors/warnings count\n return res.totalErrorCount + (res.totalFatalErrorCount || 0) + res.totalWarningCount === 0;\n });\n\n const dirtyComponentsOutputs = (groupedByIsClean.false || [])\n .map((lintRes) => {\n const compTitle = chalk.bold.cyan(lintRes.componentId.toString({ ignoreVersion: true }));\n const compOutput = lintRes.output;\n return `${compTitle}\\n${compOutput}`;\n })\n .join('\\n');\n\n const cleanComponentsCount = groupedByIsClean.true?.length || 0;\n const cleanComponentsOutput = cleanComponentsCount\n ? `total of ${chalk.green(cleanComponentsCount.toString())} component(s) has no linting issues`\n : '';\n\n const summary = this.getSummarySection(data);\n const finalOutput = compact([title, dirtyComponentsOutputs, cleanComponentsOutput, summary]).join('\\n\\n');\n return { code, data: finalOutput };\n }\n\n private getSummarySection(data: JsonLintResultsData) {\n const { duration, lintResults, componentsIdsToLint } = data;\n const { seconds } = duration;\n const summaryTitle = `linted ${chalk.cyan(componentsIdsToLint.length.toString())} components in ${chalk.cyan(\n seconds.toString()\n )} seconds`;\n\n const totalFieldsMap = [\n { itemsDataField: 'totalErrorCount', componentsDataField: 'totalComponentsWithErrorCount', label: 'Errors' },\n {\n itemsDataField: 'totalFatalErrorCount',\n componentsDataField: 'totalComponentsWithFatalErrorCount',\n label: 'FatalErrors',\n },\n {\n itemsDataField: 'totalFixableErrorCount',\n componentsDataField: 'totalComponentsWithFixableErrorCount',\n label: 'FixableErrors',\n },\n {\n itemsDataField: 'totalFixableWarningCount',\n componentsDataField: 'totalComponentsWithFixableWarningCount',\n label: 'FixableWarnings',\n },\n {\n itemsDataField: 'totalWarningCount',\n componentsDataField: 'totalComponentsWithWarningCount',\n label: 'Warnings',\n },\n ];\n\n const summaryTotals = totalFieldsMap\n .map((item) =>\n this.renderTotalLine(lintResults[item.componentsDataField], lintResults[item.itemsDataField], item.label)\n )\n .filter(Boolean)\n .join('\\n');\n const summary = `${summaryTitle}\\n${summaryTotals}`;\n return summary;\n }\n\n private renderTotalLine(componentsCount: number, itemsCount: number, fieldLabel: string): string | undefined {\n if (itemsCount === 0) return undefined;\n return `total of ${chalk.green(itemsCount.toString())} ${chalk.cyan(fieldLabel)} (from ${chalk.green(\n componentsCount.toString()\n )} components)`;\n }\n\n async json([pattern]: [string], linterOptions: LintCmdOptions): Promise<JsonLintResults> {\n const timer = Timer.create();\n timer.start();\n const componentsIds = await this.getIdsToLint(pattern, linterOptions.changed);\n const componentsToLint = await this.workspace.getMany(componentsIds);\n const opts: LinterOptions = {\n fix: linterOptions.fix,\n fixTypes: linterOptions.fixType ? (linterOptions.fixType.split(',') as FixTypes) : undefined,\n };\n const linterResults = await this.linter.lint(componentsToLint, opts);\n const jsonLinterResults = toJsonLintResults(linterResults);\n const timerResponse = timer.stop();\n let code = 0;\n if (jsonLinterResults.totalErrorCount || jsonLinterResults.totalFatalErrorCount) {\n code = 1;\n }\n return {\n code,\n data: {\n duration: timerResponse,\n lintResults: jsonLinterResults,\n componentsIdsToLint: componentsToLint.map((comp) => comp.id.toString()),\n },\n };\n }\n\n private async getIdsToLint(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\nfunction toJsonLintResults(results: EnvsExecutionResult<LintResults>): JsonLintDataResults {\n let totalErrorCount = 0;\n let totalFatalErrorCount = 0;\n let totalFixableErrorCount = 0;\n let totalFixableWarningCount = 0;\n let totalWarningCount = 0;\n let totalComponentsWithErrorCount = 0;\n let totalComponentsWithFatalErrorCount = 0;\n let totalComponentsWithFixableErrorCount = 0;\n let totalComponentsWithFixableWarningCount = 0;\n let totalComponentsWithWarningCount = 0;\n\n const newResults = results.results.map((res) => {\n const resultsWithoutComponent = res.data?.results.map((result) => {\n return Object.assign({}, { componentId: result.component.id }, omit(result, ['component']));\n });\n\n if (res.data) {\n if (res.data.totalErrorCount) {\n totalErrorCount += res.data.totalErrorCount;\n totalComponentsWithErrorCount += res.data.totalComponentsWithErrorCount ?? 0;\n }\n if (res.data.totalFatalErrorCount) {\n totalFatalErrorCount += res.data.totalFatalErrorCount;\n totalComponentsWithFatalErrorCount += res.data.totalComponentsWithFatalErrorCount ?? 0;\n }\n if (res.data.totalFixableErrorCount) {\n totalFixableErrorCount += res.data.totalFixableErrorCount;\n totalComponentsWithFixableErrorCount += res.data.totalComponentsWithFixableErrorCount ?? 0;\n }\n if (res.data.totalFixableWarningCount) {\n totalFixableWarningCount += res.data.totalFixableWarningCount;\n totalComponentsWithFixableWarningCount += res.data.totalComponentsWithFixableWarningCount ?? 0;\n }\n if (res.data.totalWarningCount) {\n totalWarningCount += res.data.totalWarningCount;\n totalComponentsWithWarningCount += res.data.totalComponentsWithWarningCount ?? 0;\n }\n }\n\n return compact(resultsWithoutComponent);\n });\n\n const isClean =\n totalComponentsWithErrorCount === 0 &&\n totalComponentsWithWarningCount === 0 &&\n totalComponentsWithFatalErrorCount === 0;\n\n return {\n results: compact(flatten(newResults)),\n totalErrorCount,\n totalFatalErrorCount,\n totalFixableErrorCount,\n totalFixableWarningCount,\n totalWarningCount,\n totalComponentsWithErrorCount,\n totalComponentsWithFatalErrorCount,\n totalComponentsWithFixableErrorCount,\n totalComponentsWithFixableWarningCount,\n totalComponentsWithWarningCount,\n isClean,\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,QAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,OAAA,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;AAAyD,SAAAI,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,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oH,sBAAsB,EAAE;QACnCA,sBAAsB,IAAIjE,GAAG,CAACnD,IAAI,CAACoH,sBAAsB;QACzDI,oCAAoC,IAAIrE,GAAG,CAACnD,IAAI,CAACwH,oCAAoC,IAAI,CAAC;MAC5F;MACA,IAAIrE,GAAG,CAACnD,IAAI,CAACqH,wBAAwB,EAAE;QACrCA,wBAAwB,IAAIlE,GAAG,CAACnD,IAAI,CAACqH,wBAAwB;QAC7DI,sCAAsC,IAAItE,GAAG,CAACnD,IAAI,CAACyH,sCAAsC,IAAI,CAAC;MAChG;MACA,IAAItE,GAAG,CAACnD,IAAI,CAACwD,iBAAiB,EAAE;QAC9BA,iBAAiB,IAAIL,GAAG,CAACnD,IAAI,CAACwD,iBAAiB;QAC/CkE,+BAA+B,IAAIvE,GAAG,CAACnD,IAAI,CAAC0H,+BAA+B,IAAI,CAAC;MAClF;IACF;IAEA,OAAO,IAAAhD,iBAAO,EAACkD,uBAAuB,CAAC;EACzC,CAAC,CAAC;EAEF,MAAMxE,OAAO,GACXkE,6BAA6B,KAAK,CAAC,IACnCI,+BAA+B,KAAK,CAAC,IACrCH,kCAAkC,KAAK,CAAC;EAE1C,OAAO;IACLrE,OAAO,EAAE,IAAAwB,iBAAO,EAAC,IAAAuD,iBAAO,EAACN,UAAU,CAAC,CAAC;IACrCrE,eAAe;IACfC,oBAAoB;IACpB6D,sBAAsB;IACtBC,wBAAwB;IACxB7D,iBAAiB;IACjB8D,6BAA6B;IAC7BC,kCAAkC;IAClCC,oCAAoC;IACpCC,sCAAsC;IACtCC,+BAA+B;IAC/BtE,OAAO;IACP8E,MAAM,EAAEhF,OAAO,EAAEgF;EACnB,CAAC;AACH","ignoreList":[]}
|
1
|
+
{"version":3,"names":["_toolboxTime","data","require","_legacy","_chalk","_interopRequireDefault","_lodash","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","LintCmd","constructor","linter","componentHost","workspace","name","description","COMPONENT_PATTERN_HELP","report","pattern","linterOptions","code","json","lintResults","componentsIdsToLint","title","chalk","bold","cyan","length","toString","groupedByIsClean","groupBy","results","res","isClean","undefined","totalErrorCount","totalFatalErrorCount","totalWarningCount","dirtyComponentsOutputs","false","map","lintRes","compTitle","componentId","ignoreVersion","compOutput","output","join","cleanComponentsCount","true","cleanComponentsOutput","green","summary","getSummarySection","finalOutput","compact","duration","seconds","summaryTitle","totalFieldsMap","itemsDataField","componentsDataField","label","summaryTotals","item","renderTotalLine","filter","Boolean","componentsCount","itemsCount","fieldLabel","timer","Timer","create","start","componentsIds","getIdsToLint","changed","componentsToLint","getMany","opts","fix","fixTypes","fixType","split","linterResults","lint","jsonLinterResults","toJsonLintResults","timerResponse","stop","comp","id","idsByPattern","getNewAndModifiedIds","listIds","exports","totalFixableErrorCount","totalFixableWarningCount","totalComponentsWithErrorCount","totalComponentsWithFatalErrorCount","totalComponentsWithFixableErrorCount","totalComponentsWithFixableWarningCount","totalComponentsWithWarningCount","newResults","resultsWithoutComponent","result","assign","component","omit","flatten","errors"],"sources":["lint.cmd.ts"],"sourcesContent":["import type { TimerResponse } from '@teambit/toolbox.time.timer';\nimport { Timer } from '@teambit/toolbox.time.timer';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy.constants';\nimport type { Command, CommandOptions } from '@teambit/cli';\nimport type { ComponentFactory, ComponentID } from '@teambit/component';\nimport chalk from 'chalk';\nimport type { EnvsExecutionResult } from '@teambit/envs';\nimport type { Workspace } from '@teambit/workspace';\nimport { compact, flatten, groupBy, omit } from 'lodash';\nimport type { LinterMain } from './linter.main.runtime';\nimport type { ComponentLintResult, LintResults } from './linter';\nimport type { FixTypes, LinterOptions } from './linter-context';\n\nexport type LintCmdOptions = {\n changed?: boolean;\n fix?: boolean;\n fixType?: string;\n json?: 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 JsonComponentLintResult = Omit<ComponentLintResult, 'component'> & {\n componentId: ComponentID;\n};\n\nexport type JsonLintDataResults = Omit<LintResults, 'results'> & { results: JsonComponentLintResult[] };\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 JsonLintResultsData = {\n duration: TimerResponse;\n lintResults: JsonLintDataResults;\n componentsIdsToLint: string[];\n};\n\nexport type JsonLintResults = {\n code: number;\n data: JsonLintResultsData;\n};\n\nexport class LintCmd implements Command {\n name = 'lint [component-pattern]';\n description = 'lint components in the development workspace';\n arguments = [{ name: 'component-pattern', description: COMPONENT_PATTERN_HELP }];\n helpUrl = 'reference/linting/linter-overview';\n group = 'testing';\n options = [\n ['c', 'changed', 'lint only new and modified components'],\n ['f', 'fix', 'automatically fix problems'],\n ['', 'fix-type <fixType>', 'specify the types of fixes to apply (problem, suggestion, layout)'],\n ['j', 'json', 'return the lint results in json format'],\n ] as CommandOptions;\n\n constructor(\n private linter: LinterMain,\n private componentHost: ComponentFactory,\n private workspace: Workspace\n ) {}\n\n async report([pattern]: [string], linterOptions: LintCmdOptions) {\n const { code, data } = await this.json([pattern], linterOptions);\n const { lintResults, componentsIdsToLint } = data;\n const title = chalk.bold(\n `linting total of ${chalk.cyan(componentsIdsToLint.length.toString())} component(s) in workspace '${chalk.cyan(\n this.componentHost.name\n )}'`\n );\n\n const groupedByIsClean = groupBy(lintResults.results, (res) => {\n if (res.isClean !== undefined) {\n return res.isClean;\n }\n // The is clean field was added in a later version of the linter, so if it's not there, we will calculate it\n // based on the errors/warnings count\n return res.totalErrorCount + (res.totalFatalErrorCount || 0) + res.totalWarningCount === 0;\n });\n\n const dirtyComponentsOutputs = (groupedByIsClean.false || [])\n .map((lintRes) => {\n const compTitle = chalk.bold.cyan(lintRes.componentId.toString({ ignoreVersion: true }));\n const compOutput = lintRes.output;\n return `${compTitle}\\n${compOutput}`;\n })\n .join('\\n');\n\n const cleanComponentsCount = groupedByIsClean.true?.length || 0;\n const cleanComponentsOutput = cleanComponentsCount\n ? `total of ${chalk.green(cleanComponentsCount.toString())} component(s) has no linting issues`\n : '';\n\n const summary = this.getSummarySection(data);\n const finalOutput = compact([title, dirtyComponentsOutputs, cleanComponentsOutput, summary]).join('\\n\\n');\n return { code, data: finalOutput };\n }\n\n private getSummarySection(data: JsonLintResultsData) {\n const { duration, lintResults, componentsIdsToLint } = data;\n const { seconds } = duration;\n const summaryTitle = `linted ${chalk.cyan(componentsIdsToLint.length.toString())} components in ${chalk.cyan(\n seconds.toString()\n )} seconds`;\n\n const totalFieldsMap = [\n { itemsDataField: 'totalErrorCount', componentsDataField: 'totalComponentsWithErrorCount', label: 'Errors' },\n {\n itemsDataField: 'totalFatalErrorCount',\n componentsDataField: 'totalComponentsWithFatalErrorCount',\n label: 'FatalErrors',\n },\n {\n itemsDataField: 'totalFixableErrorCount',\n componentsDataField: 'totalComponentsWithFixableErrorCount',\n label: 'FixableErrors',\n },\n {\n itemsDataField: 'totalFixableWarningCount',\n componentsDataField: 'totalComponentsWithFixableWarningCount',\n label: 'FixableWarnings',\n },\n {\n itemsDataField: 'totalWarningCount',\n componentsDataField: 'totalComponentsWithWarningCount',\n label: 'Warnings',\n },\n ];\n\n const summaryTotals = totalFieldsMap\n .map((item) =>\n this.renderTotalLine(lintResults[item.componentsDataField], lintResults[item.itemsDataField], item.label)\n )\n .filter(Boolean)\n .join('\\n');\n const summary = `${summaryTitle}\\n${summaryTotals}`;\n return summary;\n }\n\n private renderTotalLine(componentsCount: number, itemsCount: number, fieldLabel: string): string | undefined {\n if (itemsCount === 0) return undefined;\n return `total of ${chalk.green(itemsCount.toString())} ${chalk.cyan(fieldLabel)} (from ${chalk.green(\n componentsCount.toString()\n )} components)`;\n }\n\n async json([pattern]: [string], linterOptions: LintCmdOptions): Promise<JsonLintResults> {\n const timer = Timer.create();\n timer.start();\n const componentsIds = await this.getIdsToLint(pattern, linterOptions.changed);\n const componentsToLint = await this.workspace.getMany(componentsIds);\n const opts: LinterOptions = {\n fix: linterOptions.fix,\n fixTypes: linterOptions.fixType ? (linterOptions.fixType.split(',') as FixTypes) : undefined,\n };\n const linterResults = await this.linter.lint(componentsToLint, opts);\n const jsonLinterResults = toJsonLintResults(linterResults);\n const timerResponse = timer.stop();\n let code = 0;\n if (jsonLinterResults.totalErrorCount || jsonLinterResults.totalFatalErrorCount) {\n code = 1;\n }\n return {\n code,\n data: {\n duration: timerResponse,\n lintResults: jsonLinterResults,\n componentsIdsToLint: componentsToLint.map((comp) => comp.id.toString()),\n },\n };\n }\n\n private async getIdsToLint(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\nfunction toJsonLintResults(results: EnvsExecutionResult<LintResults>): JsonLintDataResults {\n let totalErrorCount = 0;\n let totalFatalErrorCount = 0;\n let totalFixableErrorCount = 0;\n let totalFixableWarningCount = 0;\n let totalWarningCount = 0;\n let totalComponentsWithErrorCount = 0;\n let totalComponentsWithFatalErrorCount = 0;\n let totalComponentsWithFixableErrorCount = 0;\n let totalComponentsWithFixableWarningCount = 0;\n let totalComponentsWithWarningCount = 0;\n\n const newResults = results.results.map((res) => {\n const resultsWithoutComponent = res.data?.results.map((result) => {\n return Object.assign({}, { componentId: result.component.id }, omit(result, ['component']));\n });\n\n if (res.data) {\n if (res.data.totalErrorCount) {\n totalErrorCount += res.data.totalErrorCount;\n totalComponentsWithErrorCount += res.data.totalComponentsWithErrorCount ?? 0;\n }\n if (res.data.totalFatalErrorCount) {\n totalFatalErrorCount += res.data.totalFatalErrorCount;\n totalComponentsWithFatalErrorCount += res.data.totalComponentsWithFatalErrorCount ?? 0;\n }\n if (res.data.totalFixableErrorCount) {\n totalFixableErrorCount += res.data.totalFixableErrorCount;\n totalComponentsWithFixableErrorCount += res.data.totalComponentsWithFixableErrorCount ?? 0;\n }\n if (res.data.totalFixableWarningCount) {\n totalFixableWarningCount += res.data.totalFixableWarningCount;\n totalComponentsWithFixableWarningCount += res.data.totalComponentsWithFixableWarningCount ?? 0;\n }\n if (res.data.totalWarningCount) {\n totalWarningCount += res.data.totalWarningCount;\n totalComponentsWithWarningCount += res.data.totalComponentsWithWarningCount ?? 0;\n }\n }\n\n return compact(resultsWithoutComponent);\n });\n\n const isClean =\n totalComponentsWithErrorCount === 0 &&\n totalComponentsWithWarningCount === 0 &&\n totalComponentsWithFatalErrorCount === 0;\n\n return {\n results: compact(flatten(newResults)),\n totalErrorCount,\n totalFatalErrorCount,\n totalFixableErrorCount,\n totalFixableWarningCount,\n totalWarningCount,\n totalComponentsWithErrorCount,\n totalComponentsWithFatalErrorCount,\n totalComponentsWithFixableErrorCount,\n totalComponentsWithFixableWarningCount,\n totalComponentsWithWarningCount,\n isClean,\n errors: results?.errors,\n };\n}\n"],"mappings":";;;;;;AACA,SAAAA,aAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,YAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,QAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,OAAA,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;AAAyD,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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H,oCAAoC,IAAI,CAAC;MAC5F;MACA,IAAIrE,GAAG,CAACnD,IAAI,CAACqH,wBAAwB,EAAE;QACrCA,wBAAwB,IAAIlE,GAAG,CAACnD,IAAI,CAACqH,wBAAwB;QAC7DI,sCAAsC,IAAItE,GAAG,CAACnD,IAAI,CAACyH,sCAAsC,IAAI,CAAC;MAChG;MACA,IAAItE,GAAG,CAACnD,IAAI,CAACwD,iBAAiB,EAAE;QAC9BA,iBAAiB,IAAIL,GAAG,CAACnD,IAAI,CAACwD,iBAAiB;QAC/CkE,+BAA+B,IAAIvE,GAAG,CAACnD,IAAI,CAAC0H,+BAA+B,IAAI,CAAC;MAClF;IACF;IAEA,OAAO,IAAAhD,iBAAO,EAACkD,uBAAuB,CAAC;EACzC,CAAC,CAAC;EAEF,MAAMxE,OAAO,GACXkE,6BAA6B,KAAK,CAAC,IACnCI,+BAA+B,KAAK,CAAC,IACrCH,kCAAkC,KAAK,CAAC;EAE1C,OAAO;IACLrE,OAAO,EAAE,IAAAwB,iBAAO,EAAC,IAAAuD,iBAAO,EAACN,UAAU,CAAC,CAAC;IACrCrE,eAAe;IACfC,oBAAoB;IACpB6D,sBAAsB;IACtBC,wBAAwB;IACxB7D,iBAAiB;IACjB8D,6BAA6B;IAC7BC,kCAAkC;IAClCC,oCAAoC;IACpCC,sCAAsC;IACtCC,+BAA+B;IAC/BtE,OAAO;IACP8E,MAAM,EAAEhF,OAAO,EAAEgF;EACnB,CAAC;AACH","ignoreList":[]}
|
package/dist/lint.task.d.ts
CHANGED
package/dist/lint.task.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_path","data","_interopRequireDefault","require","_component","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","LintTask","constructor","aspectId","name","execute","context","env","getLinter","componentsResults","linter","rootDir","capsuleNetwork","capsulesRootDir","componentsDirMap","getComponentsDirectory","originalSeedersCapsules","linterContext","results","lint","map","lintResult","component","metadata","output","errors","capsuleRootDir","capsuleList","ComponentMap","as","getAllComponents","fullPath","getCapsule","id","path","relativePath","relative","exports"],"sources":["lint.task.ts"],"sourcesContent":["import path from 'path';\nimport { BuildTask, BuiltTaskResult, BuildContext, ComponentResult } from '@teambit/builder';\nimport { ComponentMap } from '@teambit/component';\nimport { CapsuleList } from '@teambit/isolator';\nimport { Linter } from './linter';\nimport { LinterContext } from './linter-context';\n\nexport class LintTask implements BuildTask {\n constructor(\n readonly aspectId: string,\n readonly name = 'lint'\n ) {}\n\n async execute(context: BuildContext): Promise<BuiltTaskResult> {\n if (!context.env.getLinter) {\n return { componentsResults: [] };\n }\n const linter: Linter = context.env.getLinter();\n const rootDir = context.capsuleNetwork.capsulesRootDir;\n const componentsDirMap = this.getComponentsDirectory(rootDir, context.capsuleNetwork.originalSeedersCapsules);\n\n // @ts-ignore TODO: fix this\n const linterContext: LinterContext = {\n rootDir,\n componentsDirMap,\n ...context,\n };\n const results = await linter.lint(linterContext);\n const componentsResults = results.results.map((lintResult): ComponentResult => {\n return {\n component: lintResult.component,\n metadata: {\n output: lintResult.output,\n results: lintResult.results,\n },\n errors: [],\n };\n });\n\n return {\n componentsResults,\n };\n }\n\n private getComponentsDirectory(capsuleRootDir: string, capsuleList: CapsuleList): ComponentMap<string> {\n return ComponentMap.as<string>(capsuleList.getAllComponents(), (component) => {\n const fullPath = capsuleList.getCapsule(component.id)?.path || '';\n const relativePath = path.relative(capsuleRootDir, fullPath);\n return relativePath;\n });\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA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L,OAAO,CAACM,cAAc,CAACI,uBAAuB,CAAC;;IAE7G;IACA,MAAMC,aAA4B,GAAApC,aAAA;MAChC8B,OAAO;MACPG;IAAgB,GACbR,OAAO,CACX;IACD,MAAMY,OAAO,GAAG,MAAMR,MAAM,CAACS,IAAI,CAACF,aAAa,CAAC;IAChD,MAAMR,iBAAiB,GAAGS,OAAO,CAACA,OAAO,CAACE,GAAG,CAAEC,UAAU,IAAsB;MAC7E,OAAO;QACLC,SAAS,EAAED,UAAU,CAACC,SAAS;QAC/BC,QAAQ,EAAE;UACRC,MAAM,EAAEH,UAAU,CAACG,MAAM;UACzBN,OAAO,EAAEG,UAAU,CAACH;QACtB,CAAC;QACDO,MAAM,EAAE;MACV,CAAC;IACH,CAAC,CAAC;IAEF,OAAO;MACLhB;IACF,CAAC;EACH;EAEQM,sBAAsBA,CAACW,cAAsB,EAAEC,WAAwB,EAAwB;IACrG,OAAOC,yBAAY,CAACC,EAAE,CAASF,WAAW,CAACG,gBAAgB,CAAC,CAAC,EAAGR,SAAS,IAAK;MAC5E,MAAMS,QAAQ,GAAGJ,WAAW,CAACK,UAAU,CAACV,SAAS,CAACW,EAAE,CAAC,EAAEC,IAAI,IAAI,EAAE;MACjE,MAAMC,YAAY,GAAGD,eAAI,CAACE,QAAQ,CAACV,cAAc,EAAEK,QAAQ,CAAC;MAC5D,OAAOI,YAAY;IACrB,CAAC,CAAC;EACJ;AACF;AAACE,OAAA,CAAApC,QAAA,GAAAA,QAAA","ignoreList":[]}
|
1
|
+
{"version":3,"names":["_path","data","_interopRequireDefault","require","_component","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","LintTask","constructor","aspectId","name","execute","context","env","getLinter","componentsResults","linter","rootDir","capsuleNetwork","capsulesRootDir","componentsDirMap","getComponentsDirectory","originalSeedersCapsules","linterContext","results","lint","map","lintResult","component","metadata","output","errors","capsuleRootDir","capsuleList","ComponentMap","as","getAllComponents","fullPath","getCapsule","id","path","relativePath","relative","exports"],"sources":["lint.task.ts"],"sourcesContent":["import path from 'path';\nimport type { BuildTask, BuiltTaskResult, BuildContext, ComponentResult } from '@teambit/builder';\nimport { ComponentMap } from '@teambit/component';\nimport type { CapsuleList } from '@teambit/isolator';\nimport type { Linter } from './linter';\nimport type { LinterContext } from './linter-context';\n\nexport class LintTask implements BuildTask {\n constructor(\n readonly aspectId: string,\n readonly name = 'lint'\n ) {}\n\n async execute(context: BuildContext): Promise<BuiltTaskResult> {\n if (!context.env.getLinter) {\n return { componentsResults: [] };\n }\n const linter: Linter = context.env.getLinter();\n const rootDir = context.capsuleNetwork.capsulesRootDir;\n const componentsDirMap = this.getComponentsDirectory(rootDir, context.capsuleNetwork.originalSeedersCapsules);\n\n // @ts-ignore TODO: fix this\n const linterContext: LinterContext = {\n rootDir,\n componentsDirMap,\n ...context,\n };\n const results = await linter.lint(linterContext);\n const componentsResults = results.results.map((lintResult): ComponentResult => {\n return {\n component: lintResult.component,\n metadata: {\n output: lintResult.output,\n results: lintResult.results,\n },\n errors: [],\n };\n });\n\n return {\n componentsResults,\n };\n }\n\n private getComponentsDirectory(capsuleRootDir: string, capsuleList: CapsuleList): ComponentMap<string> {\n return ComponentMap.as<string>(capsuleList.getAllComponents(), (component) => {\n const fullPath = capsuleList.getCapsule(component.id)?.path || '';\n const relativePath = path.relative(capsuleRootDir, fullPath);\n return relativePath;\n });\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,WAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,U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AAMC,aAA4B,GAAApC,aAAA;MAChC8B,OAAO;MACPG;IAAgB,GACbR,OAAO,CACX;IACD,MAAMY,OAAO,GAAG,MAAMR,MAAM,CAACS,IAAI,CAACF,aAAa,CAAC;IAChD,MAAMR,iBAAiB,GAAGS,OAAO,CAACA,OAAO,CAACE,GAAG,CAAEC,UAAU,IAAsB;MAC7E,OAAO;QACLC,SAAS,EAAED,UAAU,CAACC,SAAS;QAC/BC,QAAQ,EAAE;UACRC,MAAM,EAAEH,UAAU,CAACG,MAAM;UACzBN,OAAO,EAAEG,UAAU,CAACH;QACtB,CAAC;QACDO,MAAM,EAAE;MACV,CAAC;IACH,CAAC,CAAC;IAEF,OAAO;MACLhB;IACF,CAAC;EACH;EAEQM,sBAAsBA,CAACW,cAAsB,EAAEC,WAAwB,EAAwB;IACrG,OAAOC,yBAAY,CAACC,EAAE,CAASF,WAAW,CAACG,gBAAgB,CAAC,CAAC,EAAGR,SAAS,IAAK;MAC5E,MAAMS,QAAQ,GAAGJ,WAAW,CAACK,UAAU,CAACV,SAAS,CAACW,EAAE,CAAC,EAAEC,IAAI,IAAI,EAAE;MACjE,MAAMC,YAAY,GAAGD,eAAI,CAACE,QAAQ,CAACV,cAAc,EAAEK,QAAQ,CAAC;MAC5D,OAAOI,YAAY;IACrB,CAAC,CAAC;EACJ;AACF;AAACE,OAAA,CAAApC,QAAA,GAAAA,QAAA","ignoreList":[]}
|
package/dist/linter-context.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import { ComponentMap } from '@teambit/component';
|
2
|
-
import { ExecutionContext } from '@teambit/envs';
|
1
|
+
import type { ComponentMap } from '@teambit/component';
|
2
|
+
import type { ExecutionContext } from '@teambit/envs';
|
3
3
|
export type EslintFixType = 'problem' | 'suggestion' | 'layout';
|
4
4
|
export type OxlintFixType = 'all' | 'suggestions' | 'dangerously';
|
5
5
|
export type FixType = EslintFixType | OxlintFixType | string;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":[],"sources":["linter-context.ts"],"sourcesContent":["import { ComponentMap } from '@teambit/component';\nimport { ExecutionContext } from '@teambit/envs';\n\nexport type EslintFixType = 'problem' | 'suggestion' | 'layout';\nexport type OxlintFixType = 'all' | 'suggestions' | 'dangerously';\nexport type FixType = EslintFixType | OxlintFixType | string;\nexport type FixTypes = Array<FixType>;\n\nexport interface LinterOptions {\n /**\n * extensions formats to lint. (e.g. .ts, .tsx, etc.)\n */\n extensionFormats?: string[];\n\n /**\n * automatically fix problems\n */\n fix?: boolean;\n\n /**\n * specify the types of fixes to apply (problem, suggestion, layout)\n */\n fixTypes?: FixTypes;\n}\nexport interface LinterContext extends ExecutionContext, LinterOptions {\n quiet?: boolean;\n /**\n * Root dir that contains all the components in the fs that are about to be linted\n * Usually it's the workspace root dir or the capsule root dir\n */\n rootDir?: string;\n\n /**\n * Component map with the path to the component in the fs\n */\n componentsDirMap: ComponentMap<string>;\n}\n"],"mappings":"","ignoreList":[]}
|
1
|
+
{"version":3,"names":[],"sources":["linter-context.ts"],"sourcesContent":["import type { ComponentMap } from '@teambit/component';\nimport type { ExecutionContext } from '@teambit/envs';\n\nexport type EslintFixType = 'problem' | 'suggestion' | 'layout';\nexport type OxlintFixType = 'all' | 'suggestions' | 'dangerously';\nexport type FixType = EslintFixType | OxlintFixType | string;\nexport type FixTypes = Array<FixType>;\n\nexport interface LinterOptions {\n /**\n * extensions formats to lint. (e.g. .ts, .tsx, etc.)\n */\n extensionFormats?: string[];\n\n /**\n * automatically fix problems\n */\n fix?: boolean;\n\n /**\n * specify the types of fixes to apply (problem, suggestion, layout)\n */\n fixTypes?: FixTypes;\n}\nexport interface LinterContext extends ExecutionContext, LinterOptions {\n quiet?: boolean;\n /**\n * Root dir that contains all the components in the fs that are about to be linted\n * Usually it's the workspace root dir or the capsule root dir\n */\n rootDir?: string;\n\n /**\n * Component map with the path to the component in the fs\n */\n componentsDirMap: ComponentMap<string>;\n}\n"],"mappings":"","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":[],"sources":["linter-env-type.ts"],"sourcesContent":["import { EnvHandler } from '@teambit/envs';\nimport { Linter } from './linter';\n\nexport interface LinterEnv {\n /**\n * return a Linter instance.\n */\n linter(): EnvHandler<Linter>;\n}\n"],"mappings":"","ignoreList":[]}
|
1
|
+
{"version":3,"names":[],"sources":["linter-env-type.ts"],"sourcesContent":["import type { EnvHandler } from '@teambit/envs';\nimport type { Linter } from './linter';\n\nexport interface LinterEnv {\n /**\n * return a Linter instance.\n */\n linter(): EnvHandler<Linter>;\n}\n"],"mappings":"","ignoreList":[]}
|
package/dist/linter.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
import { BuildContext } from '@teambit/builder';
|
2
|
-
import { Component } from '@teambit/component';
|
3
|
-
import { LinterContext } from './linter-context';
|
1
|
+
import type { BuildContext } from '@teambit/builder';
|
2
|
+
import type { Component } from '@teambit/component';
|
3
|
+
import type { LinterContext } from './linter-context';
|
4
4
|
export type ComponentLintResult = {
|
5
5
|
/**
|
6
6
|
* the linted component.
|
package/dist/linter.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":[],"sources":["linter.ts"],"sourcesContent":["import { BuildContext } from '@teambit/builder';\nimport { Component } from '@teambit/component';\nimport { LinterContext } from './linter-context';\n\nexport type ComponentLintResult = {\n /**\n * the linted component.\n */\n component: Component;\n\n /**\n * CLI output of the linter.\n */\n output: string;\n\n /**\n * total errors count of the component (from all of the files).\n */\n totalErrorCount: number;\n /**\n * total fatal errors count of the component (from all of the files).\n */\n totalFatalErrorCount?: number;\n /**\n * total fixable errors count of the component (from all of the files).\n */\n totalFixableErrorCount?: number;\n /**\n * total fatal warning count of the component (from all of the files).\n */\n totalFixableWarningCount?: number;\n /**\n * total warning count of the component (from all of the files).\n */\n totalWarningCount: number;\n\n /**\n * whether the component is clean (have no issues at all)\n */\n isClean: boolean;\n\n /**\n * lint results for each one of the component files\n */\n results: LintResult[];\n};\n\nexport type LintResult = {\n /**\n * path of the linted file.\n */\n filePath: string;\n\n /**\n * numbers of errors found.\n */\n errorCount: number;\n\n /**\n * numbers of errors found.\n */\n fatalErrorCount?: number;\n\n /**\n * numbers of fixable errors found.\n */\n fixableErrorCount?: number;\n\n /**\n * numbers of fixable warning found.\n */\n fixableWarningCount?: number;\n\n /**\n * number of found warnings.\n */\n warningCount: number;\n\n /**\n * lint messages.\n */\n messages: LintMessage[];\n\n /**\n * Raw data as returned from the linter\n */\n raw: any;\n};\n\nexport type LintMessage = {\n /**\n * severity of the issue.\n */\n severity: string;\n /**\n * stating column of the issue.\n */\n column: number;\n\n /**\n * line of the issue.\n */\n line: number;\n\n /**\n * end column of the issue.\n */\n endColumn?: number;\n\n /**\n * end line of the issue.\n */\n endLine?: number;\n\n /**\n * message of the issue.\n */\n message: string;\n\n /**\n * lint suggestions.\n */\n suggestions?: string[];\n};\n\nexport type LintResults = {\n results: ComponentLintResult[];\n /**\n * total errors count of the component (from all of the components).\n */\n totalErrorCount?: number;\n /**\n * total fatal errors count of the component (from all of the components).\n */\n totalFatalErrorCount?: number;\n /**\n * total fixable errors count of the component (from all of the components).\n */\n totalFixableErrorCount?: number;\n /**\n * total fatal warning count of the component (from all of the components).\n */\n totalFixableWarningCount?: number;\n /**\n * total warning count of the component (from all of the components).\n */\n totalWarningCount?: number;\n\n totalComponentsWithErrorCount?: number;\n totalComponentsWithFatalErrorCount?: number;\n totalComponentsWithFixableErrorCount?: number;\n totalComponentsWithFixableWarningCount?: number;\n totalComponentsWithWarningCount?: number;\n\n /**\n * whether all the linted components is clean (have no issues at all)\n */\n isClean?: boolean;\n\n errors: Error[];\n};\n\nexport interface Linter {\n id: string;\n /**\n * serialized config of the linter.\n */\n displayConfig?(): string;\n\n /**\n * returns the version of the current linter instance (e.g. '4.0.1').\n */\n version?(): string;\n\n /**\n * returns the display name of the current linter instance (e.g. 'ESlint')\n */\n displayName?: string;\n\n /**\n * lint the given component.\n */\n lint(context: LinterContext, buildContext?: BuildContext): Promise<LintResults>;\n}\n"],"mappings":"","ignoreList":[]}
|
1
|
+
{"version":3,"names":[],"sources":["linter.ts"],"sourcesContent":["import type { BuildContext } from '@teambit/builder';\nimport type { Component } from '@teambit/component';\nimport type { LinterContext } from './linter-context';\n\nexport type ComponentLintResult = {\n /**\n * the linted component.\n */\n component: Component;\n\n /**\n * CLI output of the linter.\n */\n output: string;\n\n /**\n * total errors count of the component (from all of the files).\n */\n totalErrorCount: number;\n /**\n * total fatal errors count of the component (from all of the files).\n */\n totalFatalErrorCount?: number;\n /**\n * total fixable errors count of the component (from all of the files).\n */\n totalFixableErrorCount?: number;\n /**\n * total fatal warning count of the component (from all of the files).\n */\n totalFixableWarningCount?: number;\n /**\n * total warning count of the component (from all of the files).\n */\n totalWarningCount: number;\n\n /**\n * whether the component is clean (have no issues at all)\n */\n isClean: boolean;\n\n /**\n * lint results for each one of the component files\n */\n results: LintResult[];\n};\n\nexport type LintResult = {\n /**\n * path of the linted file.\n */\n filePath: string;\n\n /**\n * numbers of errors found.\n */\n errorCount: number;\n\n /**\n * numbers of errors found.\n */\n fatalErrorCount?: number;\n\n /**\n * numbers of fixable errors found.\n */\n fixableErrorCount?: number;\n\n /**\n * numbers of fixable warning found.\n */\n fixableWarningCount?: number;\n\n /**\n * number of found warnings.\n */\n warningCount: number;\n\n /**\n * lint messages.\n */\n messages: LintMessage[];\n\n /**\n * Raw data as returned from the linter\n */\n raw: any;\n};\n\nexport type LintMessage = {\n /**\n * severity of the issue.\n */\n severity: string;\n /**\n * stating column of the issue.\n */\n column: number;\n\n /**\n * line of the issue.\n */\n line: number;\n\n /**\n * end column of the issue.\n */\n endColumn?: number;\n\n /**\n * end line of the issue.\n */\n endLine?: number;\n\n /**\n * message of the issue.\n */\n message: string;\n\n /**\n * lint suggestions.\n */\n suggestions?: string[];\n};\n\nexport type LintResults = {\n results: ComponentLintResult[];\n /**\n * total errors count of the component (from all of the components).\n */\n totalErrorCount?: number;\n /**\n * total fatal errors count of the component (from all of the components).\n */\n totalFatalErrorCount?: number;\n /**\n * total fixable errors count of the component (from all of the components).\n */\n totalFixableErrorCount?: number;\n /**\n * total fatal warning count of the component (from all of the components).\n */\n totalFixableWarningCount?: number;\n /**\n * total warning count of the component (from all of the components).\n */\n totalWarningCount?: number;\n\n totalComponentsWithErrorCount?: number;\n totalComponentsWithFatalErrorCount?: number;\n totalComponentsWithFixableErrorCount?: number;\n totalComponentsWithFixableWarningCount?: number;\n totalComponentsWithWarningCount?: number;\n\n /**\n * whether all the linted components is clean (have no issues at all)\n */\n isClean?: boolean;\n\n errors: Error[];\n};\n\nexport interface Linter {\n id: string;\n /**\n * serialized config of the linter.\n */\n displayConfig?(): string;\n\n /**\n * returns the version of the current linter instance (e.g. '4.0.1').\n */\n version?(): string;\n\n /**\n * returns the display name of the current linter instance (e.g. 'ESlint')\n */\n displayName?: string;\n\n /**\n * lint the given component.\n */\n lint(context: LinterContext, buildContext?: BuildContext): Promise<LintResults>;\n}\n"],"mappings":"","ignoreList":[]}
|
@@ -1,12 +1,12 @@
|
|
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';
|
1
|
+
import type { CLIMain } from '@teambit/cli';
|
2
|
+
import type { Component, ComponentMain } from '@teambit/component';
|
3
|
+
import type { EnvsMain, ExecutionContext } from '@teambit/envs';
|
4
|
+
import type { LoggerMain } from '@teambit/logger';
|
5
|
+
import type { Workspace } from '@teambit/workspace';
|
6
6
|
import { LinterService } from './linter.service';
|
7
7
|
import { LintTask } from './lint.task';
|
8
|
-
import { FixTypes, LinterOptions } from './linter-context';
|
9
|
-
import { Linter } from './linter';
|
8
|
+
import type { FixTypes, LinterOptions } from './linter-context';
|
9
|
+
import type { Linter } from './linter';
|
10
10
|
export type LinterConfig = {
|
11
11
|
/**
|
12
12
|
* extension formats to lint.
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_cli","data","require","_component","_envs","_logger","_workspace","_linter","_linter2","_lint","_lint2","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","LinterMain","constructor","envs","linterService","lint","components","opts","envsRuntime","createEnvironment","lintResults","run","getLinter","context","options","createTask","name","LintTask","LinterAspect","id","provider","cli","component","loggerAspect","workspace","config","logger","createLogger","LinterService","linterAspect","registerService","register","LintCmd","getHost","exports","MainRuntime","EnvsAspect","CLIAspect","ComponentAspect","LoggerAspect","WorkspaceAspect","extensionFormats","fixTypes","addRuntime"],"sources":["linter.main.runtime.ts"],"sourcesContent":["import { CLIAspect,
|
1
|
+
{"version":3,"names":["_cli","data","require","_component","_envs","_logger","_workspace","_linter","_linter2","_lint","_lint2","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","LinterMain","constructor","envs","linterService","lint","components","opts","envsRuntime","createEnvironment","lintResults","run","getLinter","context","options","createTask","name","LintTask","LinterAspect","id","provider","cli","component","loggerAspect","workspace","config","logger","createLogger","LinterService","linterAspect","registerService","register","LintCmd","getHost","exports","MainRuntime","EnvsAspect","CLIAspect","ComponentAspect","LoggerAspect","WorkspaceAspect","extensionFormats","fixTypes","addRuntime"],"sources":["linter.main.runtime.ts"],"sourcesContent":["import type { CLIMain } from '@teambit/cli';\nimport { CLIAspect, MainRuntime } from '@teambit/cli';\nimport type { Component, ComponentMain } from '@teambit/component';\nimport { ComponentAspect } from '@teambit/component';\nimport type { EnvsMain, ExecutionContext } from '@teambit/envs';\nimport { EnvsAspect } from '@teambit/envs';\nimport type { LoggerMain } from '@teambit/logger';\nimport { LoggerAspect } from '@teambit/logger';\nimport type { Workspace } from '@teambit/workspace';\nimport { WorkspaceAspect } from '@teambit/workspace';\nimport { LinterAspect } from './linter.aspect';\nimport { LinterService } from './linter.service';\nimport { LintTask } from './lint.task';\nimport { LintCmd } from './lint.cmd';\nimport type { FixTypes, LinterOptions } from './linter-context';\nimport type { Linter } from './linter';\n\nexport type LinterConfig = {\n /**\n * extension formats to lint.\n */\n extensionFormats: string[];\n fixTypes?: FixTypes;\n};\n\nexport class LinterMain {\n static runtime = MainRuntime;\n\n constructor(\n private envs: EnvsMain,\n private linterService: LinterService\n ) {}\n\n /**\n * lint an array of components.\n */\n async lint(components: Component[], opts: LinterOptions) {\n const envsRuntime = await this.envs.createEnvironment(components);\n const lintResults = envsRuntime.run(this.linterService, opts);\n return lintResults;\n }\n\n getLinter(context: ExecutionContext, options: LinterOptions): Linter | undefined {\n return this.linterService.getLinter(context, options);\n }\n\n /**\n * create a lint task for build pipelines.\n * @param name name of the task.\n */\n createTask(name?: string): LintTask {\n return new LintTask(LinterAspect.id, name);\n }\n\n static dependencies = [EnvsAspect, CLIAspect, ComponentAspect, LoggerAspect, WorkspaceAspect];\n\n static defaultConfig: LinterConfig = {\n extensionFormats: ['.ts', '.tsx', '.js', '.jsx', '.mjs'],\n fixTypes: ['layout', 'problem', 'suggestion'],\n };\n\n static async provider(\n [envs, cli, component, loggerAspect, workspace]: [EnvsMain, CLIMain, ComponentMain, LoggerMain, Workspace],\n config: LinterConfig\n ) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const logger = loggerAspect.createLogger(LinterAspect.id);\n const linterService = new LinterService(config, workspace);\n const linterAspect = new LinterMain(envs, linterService);\n envs.registerService(linterService);\n cli.register(new LintCmd(linterAspect, component.getHost(), workspace));\n\n return linterAspect;\n }\n}\n\nLinterAspect.addRuntime(LinterMain);\n"],"mappings":";;;;;;AACA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,WAAA;EAAA,MAAAF,IA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,CAA4D,EAC1GC,MAAoB,EACpB;IACA;IACA,MAAMC,MAAM,GAAGH,YAAY,CAACI,YAAY,CAACT,sBAAY,CAACC,EAAE,CAAC;IACzD,MAAMf,aAAa,GAAG,KAAIwB,wBAAa,EAACH,MAAM,EAAED,SAAS,CAAC;IAC1D,MAAMK,YAAY,GAAG,IAAI5B,UAAU,CAACE,IAAI,EAAEC,aAAa,CAAC;IACxDD,IAAI,CAAC2B,eAAe,CAAC1B,aAAa,CAAC;IACnCiB,GAAG,CAACU,QAAQ,CAAC,KAAIC,gBAAO,EAACH,YAAY,EAAEP,SAAS,CAACW,OAAO,CAAC,CAAC,EAAET,SAAS,CAAC,CAAC;IAEvE,OAAOK,YAAY;EACrB;AACF;AAACK,OAAA,CAAAjC,UAAA,GAAAA,UAAA;AAAAnB,eAAA,CAjDYmB,UAAU,aACJkC,kBAAW;AAAArD,eAAA,CADjBmB,UAAU,kBA6BC,CAACmC,kBAAU,EAAEC,gBAAS,EAAEC,4BAAe,EAAEC,sBAAY,EAAEC,4BAAe,CAAC;AAAA1D,eAAA,CA7BlFmB,UAAU,mBA+BgB;EACnCwC,gBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC;EACxDC,QAAQ,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,YAAY;AAC9C,CAAC;AAiBHxB,sBAAY,CAACyB,UAAU,CAAC1C,UAAU,CAAC","ignoreList":[]}
|
package/dist/linter.service.d.ts
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
import { EnvService, ExecutionContext, EnvDefinition, ServiceTransformationMap, EnvContext, Env } from '@teambit/envs';
|
2
|
-
import { Workspace } from '@teambit/workspace';
|
3
|
-
import { Linter, LintResults } from './linter';
|
4
|
-
import { LinterOptions } from './linter-context';
|
5
|
-
import { LinterConfig } from './linter.main.runtime';
|
1
|
+
import type { EnvService, ExecutionContext, EnvDefinition, ServiceTransformationMap, EnvContext, Env } from '@teambit/envs';
|
2
|
+
import type { Workspace } from '@teambit/workspace';
|
3
|
+
import type { Linter, LintResults } from './linter';
|
4
|
+
import type { LinterOptions } from './linter-context';
|
5
|
+
import type { LinterConfig } from './linter.main.runtime';
|
6
6
|
type LinterTransformationMap = ServiceTransformationMap & {
|
7
7
|
getLinter: () => Linter;
|
8
8
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_lodash","_cliHighlight","_component","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","LinterService","constructor","linterConfig","workspace","run","context","options","mergedOpts","optionsWithDefaults","linterContext","mergeContext","linter","getLinter","results","errors","lint","env","undefined","defaults","componentsDirMap","components","getComponentsDirectory","ComponentMap","create","assign","rootDir","path","quiet","extensionFormats","fixTypes","fix","as","component","componentDir","id","relative","render","descriptor","getDescriptor","name","chalk","green","displayName","version","configLabel","configObj","config","highlight","language","ignoreIllegals","transform","icon","displayConfig","exports"],"sources":["linter.service.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { defaults } from 'lodash';\nimport {
|
1
|
+
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_lodash","_cliHighlight","_component","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","LinterService","constructor","linterConfig","workspace","run","context","options","mergedOpts","optionsWithDefaults","linterContext","mergeContext","linter","getLinter","results","errors","lint","env","undefined","defaults","componentsDirMap","components","getComponentsDirectory","ComponentMap","create","assign","rootDir","path","quiet","extensionFormats","fixTypes","fix","as","component","componentDir","id","relative","render","descriptor","getDescriptor","name","chalk","green","displayName","version","configLabel","configObj","config","highlight","language","ignoreIllegals","transform","icon","displayConfig","exports"],"sources":["linter.service.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { defaults } from 'lodash';\nimport type {\n EnvService,\n ExecutionContext,\n EnvDefinition,\n ServiceTransformationMap,\n EnvContext,\n Env,\n} from '@teambit/envs';\nimport type { Workspace } from '@teambit/workspace';\nimport highlight from 'cli-highlight';\nimport type { Component } from '@teambit/component';\nimport { ComponentMap } from '@teambit/component';\nimport type { Linter, LintResults } from './linter';\nimport type { LinterContext, LinterOptions } from './linter-context';\nimport type { LinterConfig } from './linter.main.runtime';\n\ntype LinterTransformationMap = ServiceTransformationMap & {\n getLinter: () => Linter;\n};\n\nexport class LinterService implements EnvService<LintResults> {\n name = 'linter';\n\n constructor(\n private linterConfig: LinterConfig,\n private workspace: Workspace\n ) {}\n\n async run(context: ExecutionContext, options: LinterOptions): Promise<LintResults> {\n const mergedOpts = this.optionsWithDefaults(options);\n const linterContext = this.mergeContext(mergedOpts, context);\n const linter = this.getLinter(context, options);\n if (!linter) {\n return {\n results: [],\n errors: [],\n };\n }\n\n const results = await linter.lint(linterContext);\n return results;\n }\n\n getLinter(context: ExecutionContext, options: LinterOptions): Linter | undefined {\n if (!context.env.getLinter) {\n return undefined;\n }\n const mergedOpts = this.optionsWithDefaults(options);\n const linterContext = this.mergeContext(mergedOpts, context);\n const linter: Linter = context.env.getLinter(linterContext);\n return linter;\n }\n\n private optionsWithDefaults(options: LinterOptions): LinterOptions {\n return defaults(options, this.linterConfig);\n }\n\n private mergeContext(options: LinterOptions, context?: ExecutionContext): LinterContext {\n const componentsDirMap = context?.components\n ? this.getComponentsDirectory(context.components)\n : ComponentMap.create<string>([]);\n const linterContext: LinterContext = Object.assign(\n {},\n {\n rootDir: this.workspace?.path,\n quiet: false,\n extensionFormats: options.extensionFormats,\n fixTypes: options.fixTypes,\n fix: options.fix,\n componentsDirMap,\n },\n context\n );\n return linterContext;\n }\n\n private getComponentsDirectory(components: Component[]): ComponentMap<string> {\n return ComponentMap.as<string>(components, (component) =>\n this.workspace.componentDir(component.id, undefined, { relative: true })\n );\n }\n\n render(env: EnvDefinition) {\n const descriptor = this.getDescriptor(env);\n const name = `${chalk.green('configured linter:')} ${descriptor?.id} (${descriptor?.displayName} @ ${\n descriptor?.version\n })`;\n const configLabel = chalk.green('linter 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): LinterTransformationMap | undefined {\n // Old env\n if (!env?.linter) return undefined;\n return {\n getLinter: () => env.linter()(context),\n };\n }\n\n getDescriptor(env: EnvDefinition) {\n if (!env.env.getLinter) return undefined;\n const mergedOpts = this.optionsWithDefaults({});\n const linterContext = this.mergeContext(mergedOpts);\n const linter = env.env.getLinter(linterContext);\n\n return {\n id: linter.id,\n icon: linter.icon,\n config: linter.displayConfig ? linter.displayConfig() : undefined,\n version: linter.version ? linter.version() : '?',\n displayName: linter.displayName ? linter.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;AAUA,SAAAI,cAAA;EAAA,MAAAJ,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAE,aAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,WAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,UAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAkD,SAAAC,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AA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,CAAC;IAE/C,OAAO;MACLyB,EAAE,EAAEvB,MAAM,CAACuB,EAAE;MACbiB,IAAI,EAAExC,MAAM,CAACwC,IAAI;MACjBL,MAAM,EAAEnC,MAAM,CAACyC,aAAa,GAAGzC,MAAM,CAACyC,aAAa,CAAC,CAAC,GAAGnC,SAAS;MACjE0B,OAAO,EAAEhC,MAAM,CAACgC,OAAO,GAAGhC,MAAM,CAACgC,OAAO,CAAC,CAAC,GAAG,GAAG;MAChDD,WAAW,EAAE/B,MAAM,CAAC+B,WAAW,GAAG/B,MAAM,CAAC+B,WAAW,GAAG;IACzD,CAAC;EACH;AACF;AAACW,OAAA,CAAArD,aAAA,GAAAA,aAAA","ignoreList":[]}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.defender_linter@
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.defender_linter@
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.defender_linter@d6a03d9498890fafa1e9eb37afac6d74668157fb/dist/linter.composition.js';
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.defender_linter@d6a03d9498890fafa1e9eb37afac6d74668157fb/dist/linter.docs.mdx';
|
3
3
|
|
4
4
|
export const compositions = [compositions_0];
|
5
5
|
export const overview = [overview_0];
|
package/package.json
CHANGED
@@ -1,28 +1,28 @@
|
|
1
1
|
{
|
2
2
|
"name": "@teambit/linter",
|
3
|
-
"version": "0.0.0-
|
3
|
+
"version": "0.0.0-d6a03d9498890fafa1e9eb37afac6d74668157fb",
|
4
4
|
"homepage": "https://bit.cloud/teambit/defender/linter",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"componentId": {
|
7
7
|
"scope": "teambit.defender",
|
8
8
|
"name": "linter",
|
9
|
-
"version": "
|
9
|
+
"version": "d6a03d9498890fafa1e9eb37afac6d74668157fb"
|
10
10
|
},
|
11
11
|
"dependencies": {
|
12
12
|
"chalk": "4.1.2",
|
13
13
|
"lodash": "4.17.21",
|
14
14
|
"graphql-tag": "2.12.1",
|
15
15
|
"cli-highlight": "2.1.9",
|
16
|
-
"@teambit/
|
17
|
-
"@teambit/cli": "0.0.0-753edfae4927d01365b5e83bee5f80a73bc0fc47",
|
18
|
-
"@teambit/component": "0.0.0-7de10de3de5d21733f39d23b96ed41f1ee0b6c85",
|
19
|
-
"@teambit/envs": "0.0.0-b3c9a69d4ed91375bf74bbdcc28e0cb8dfcfbdba",
|
20
|
-
"@teambit/legacy.constants": "0.0.12",
|
16
|
+
"@teambit/legacy.constants": "0.0.13",
|
21
17
|
"@teambit/toolbox.time.timer": "0.0.5",
|
22
|
-
"@teambit/
|
23
|
-
"@teambit/
|
24
|
-
"@teambit/
|
25
|
-
"@teambit/
|
18
|
+
"@teambit/harmony": "0.4.7",
|
19
|
+
"@teambit/cli": "0.0.0-04a862266e20413a78997348c1a3c678041f4d20",
|
20
|
+
"@teambit/component": "0.0.0-4eccca0e0708bcda57c3af61738324b3bac76aea",
|
21
|
+
"@teambit/envs": "0.0.0-cba537472e42fbda7b820bfb21fdf19050046f4d",
|
22
|
+
"@teambit/workspace": "0.0.0-40ac16a1cb812dc6f02f65e66462a0a4bd656908",
|
23
|
+
"@teambit/builder": "0.0.0-c4ef684dde50e93da445553d1eebe65d8766bddc",
|
24
|
+
"@teambit/isolator": "0.0.0-2ad704443a7c9da8c7b0244b7ea40154a5acac4d",
|
25
|
+
"@teambit/logger": "0.0.0-0cba3953870291fc104796ce7391f7906c0dae8c"
|
26
26
|
},
|
27
27
|
"devDependencies": {
|
28
28
|
"@types/lodash": "4.14.165",
|