@teambit/linter 0.0.1157 → 0.0.1159
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.js +14 -26
- package/dist/lint.cmd.js.map +1 -1
- package/dist/lint.task.js +5 -10
- package/dist/lint.task.js.map +1 -1
- package/dist/linter.composition.js +1 -1
- package/dist/linter.composition.js.map +1 -1
- package/dist/linter.graphql.js +1 -1
- package/dist/linter.graphql.js.map +1 -1
- package/dist/linter.main.runtime.js +6 -13
- package/dist/linter.main.runtime.js.map +1 -1
- package/dist/linter.service.js +5 -10
- package/dist/linter.service.js.map +1 -1
- package/dist/{preview-1694488626516.js → preview-1694624356552.js} +2 -2
- package/package.json +10 -12
package/dist/lint.cmd.js
CHANGED
@@ -1,20 +1,9 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
-
require("core-js/modules/es.array.iterator.js");
|
5
|
-
require("core-js/modules/es.promise.js");
|
6
|
-
require("core-js/modules/es.regexp.exec.js");
|
7
3
|
Object.defineProperty(exports, "__esModule", {
|
8
4
|
value: true
|
9
5
|
});
|
10
6
|
exports.LintCmd = void 0;
|
11
|
-
function _defineProperty2() {
|
12
|
-
const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
13
|
-
_defineProperty2 = function () {
|
14
|
-
return data;
|
15
|
-
};
|
16
|
-
return data;
|
17
|
-
}
|
18
7
|
function _timer() {
|
19
8
|
const data = require("@teambit/legacy/dist/toolbox/timer");
|
20
9
|
_timer = function () {
|
@@ -36,6 +25,10 @@ function _lodash() {
|
|
36
25
|
};
|
37
26
|
return data;
|
38
27
|
}
|
28
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
29
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
30
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
31
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
39
32
|
/**
|
40
33
|
* 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
|
41
34
|
*/
|
@@ -49,11 +42,11 @@ class LintCmd {
|
|
49
42
|
this.linter = linter;
|
50
43
|
this.componentHost = componentHost;
|
51
44
|
this.workspace = workspace;
|
52
|
-
(
|
53
|
-
(
|
54
|
-
(
|
55
|
-
(
|
56
|
-
(
|
45
|
+
_defineProperty(this, "name", 'lint [component...]');
|
46
|
+
_defineProperty(this, "description", 'lint components in the development workspace');
|
47
|
+
_defineProperty(this, "helpUrl", 'reference/linting/linter-overview');
|
48
|
+
_defineProperty(this, "group", 'development');
|
49
|
+
_defineProperty(this, "options", [['c', 'changed', 'lint only new and modified components'], ['f', 'fix', 'automatically fix problems'], ['', 'fix-type <fixType>', 'specify the types of fixes to apply (problem, suggestion, layout)'], ['j', 'json', 'return the lint results in json format']]);
|
57
50
|
}
|
58
51
|
async report([components = []], linterOptions) {
|
59
52
|
const {
|
@@ -173,29 +166,24 @@ function toJsonLintResults(results) {
|
|
173
166
|
});
|
174
167
|
if (res.data) {
|
175
168
|
if (res.data.totalErrorCount) {
|
176
|
-
var _res$data$totalCompon;
|
177
169
|
totalErrorCount += res.data.totalErrorCount;
|
178
|
-
totalComponentsWithErrorCount +=
|
170
|
+
totalComponentsWithErrorCount += res.data.totalComponentsWithErrorCount ?? 0;
|
179
171
|
}
|
180
172
|
if (res.data.totalFatalErrorCount) {
|
181
|
-
var _res$data$totalCompon2;
|
182
173
|
totalFatalErrorCount += res.data.totalFatalErrorCount;
|
183
|
-
totalComponentsWithFatalErrorCount +=
|
174
|
+
totalComponentsWithFatalErrorCount += res.data.totalComponentsWithFatalErrorCount ?? 0;
|
184
175
|
}
|
185
176
|
if (res.data.totalFixableErrorCount) {
|
186
|
-
var _res$data$totalCompon3;
|
187
177
|
totalFixableErrorCount += res.data.totalFixableErrorCount;
|
188
|
-
totalComponentsWithFixableErrorCount +=
|
178
|
+
totalComponentsWithFixableErrorCount += res.data.totalComponentsWithFixableErrorCount ?? 0;
|
189
179
|
}
|
190
180
|
if (res.data.totalFixableWarningCount) {
|
191
|
-
var _res$data$totalCompon4;
|
192
181
|
totalFixableWarningCount += res.data.totalFixableWarningCount;
|
193
|
-
totalComponentsWithFixableWarningCount +=
|
182
|
+
totalComponentsWithFixableWarningCount += res.data.totalComponentsWithFixableWarningCount ?? 0;
|
194
183
|
}
|
195
184
|
if (res.data.totalWarningCount) {
|
196
|
-
var _res$data$totalCompon5;
|
197
185
|
totalWarningCount += res.data.totalWarningCount;
|
198
|
-
totalComponentsWithWarningCount +=
|
186
|
+
totalComponentsWithWarningCount += res.data.totalComponentsWithWarningCount ?? 0;
|
199
187
|
}
|
200
188
|
}
|
201
189
|
return (0, _lodash().compact)(resultsWithoutComponent);
|
package/dist/lint.cmd.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_timer","data","require","_chalk","_interopRequireDefault","_lodash","LintCmd","constructor","linter","componentHost","workspace","_defineProperty2","default","report","components","linterOptions","code","json","lintResults","componentsIdsToLint","title","chalk","bold","cyan","length","toString","name","componentsOutputs","results","map","lintRes","compTitle","componentId","ignoreVersion","compOutput","output","join","summary","getSummarySection","duration","seconds","summaryTitle","totalFieldsMap","itemsDataField","componentsDataField","label","summaryTotals","item","renderTotalLine","filter","Boolean","componentsCount","itemsCount","fieldLabel","undefined","green","timer","Timer","create","start","componentsIds","getIdsToLint","changed","componentsToLint","getMany","opts","fix","fixTypes","fixType","split","linterResults","lint","jsonLinterResults","toJsonLintResults","timerResponse","stop","totalErrorCount","totalFatalErrorCount","comp","id","resolveMultipleComponentIds","getNewAndModifiedIds","listIds","exports","totalFixableErrorCount","totalFixableWarningCount","totalWarningCount","totalComponentsWithErrorCount","totalComponentsWithFatalErrorCount","totalComponentsWithFixableErrorCount","totalComponentsWithFixableWarningCount","totalComponentsWithWarningCount","newResults","res","_res$data","resultsWithoutComponent","result","Object","assign","component","omit","_res$data$totalCompon","_res$data$totalCompon2","_res$data$totalCompon3","_res$data$totalCompon4","_res$data$totalCompon5","compact","flatten","errors"],"sources":["lint.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, 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...]';\n description = 'lint components in the development workspace';\n helpUrl = 'reference/linting/linter-overview';\n group = 'development';\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(private linter: LinterMain, private componentHost: ComponentFactory, private workspace: Workspace) {}\n\n async report([components = []]: [string[]], linterOptions: LintCmdOptions) {\n const { code, data } = await this.json([components], 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 componentsOutputs = lintResults.results\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 summary = this.getSummarySection(data);\n return { code, data: `${title}\\n\\n${componentsOutputs}\\n\\n${summary}` };\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([components = []]: [string[]], linterOptions: LintCmdOptions): Promise<JsonLintResults> {\n const timer = Timer.create();\n timer.start();\n const componentsIds = await this.getIdsToLint(components, 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(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\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 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 errors: results?.errors,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAE,OAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,MAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAI,QAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,OAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAA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odash","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","LintCmd","constructor","linter","componentHost","workspace","report","components","linterOptions","code","json","lintResults","componentsIdsToLint","title","chalk","bold","cyan","length","toString","name","componentsOutputs","results","map","lintRes","compTitle","componentId","ignoreVersion","compOutput","output","join","summary","getSummarySection","duration","seconds","summaryTitle","totalFieldsMap","itemsDataField","componentsDataField","label","summaryTotals","item","renderTotalLine","filter","Boolean","componentsCount","itemsCount","fieldLabel","green","timer","Timer","create","start","componentsIds","getIdsToLint","changed","componentsToLint","getMany","opts","fix","fixTypes","fixType","split","linterResults","lint","jsonLinterResults","toJsonLintResults","timerResponse","stop","totalErrorCount","totalFatalErrorCount","comp","id","resolveMultipleComponentIds","getNewAndModifiedIds","listIds","exports","totalFixableErrorCount","totalFixableWarningCount","totalWarningCount","totalComponentsWithErrorCount","totalComponentsWithFatalErrorCount","totalComponentsWithFixableErrorCount","totalComponentsWithFixableWarningCount","totalComponentsWithWarningCount","newResults","_res$data","resultsWithoutComponent","result","assign","component","omit","compact","flatten","errors"],"sources":["lint.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, 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...]';\n description = 'lint components in the development workspace';\n helpUrl = 'reference/linting/linter-overview';\n group = 'development';\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(private linter: LinterMain, private componentHost: ComponentFactory, private workspace: Workspace) {}\n\n async report([components = []]: [string[]], linterOptions: LintCmdOptions) {\n const { code, data } = await this.json([components], 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 componentsOutputs = lintResults.results\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 summary = this.getSummarySection(data);\n return { code, data: `${title}\\n\\n${componentsOutputs}\\n\\n${summary}` };\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([components = []]: [string[]], linterOptions: LintCmdOptions): Promise<JsonLintResults> {\n const timer = Timer.create();\n timer.start();\n const componentsIds = await this.getIdsToLint(components, 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(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\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 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 errors: results?.errors,\n };\n}\n"],"mappings":";;;;;;AAAA,SAAAA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F,GAAG,CAAC1B,IAAI,CAAC0G,wBAAwB,EAAE;QACrCA,wBAAwB,IAAIhF,GAAG,CAAC1B,IAAI,CAAC0G,wBAAwB;QAC7DK,sCAAsC,IAAIrF,GAAG,CAAC1B,IAAI,CAAC+G,sCAAsC,IAAI,CAAC;MAChG;MACA,IAAIrF,GAAG,CAAC1B,IAAI,CAAC2G,iBAAiB,EAAE;QAC9BA,iBAAiB,IAAIjF,GAAG,CAAC1B,IAAI,CAAC2G,iBAAiB;QAC/CK,+BAA+B,IAAItF,GAAG,CAAC1B,IAAI,CAACgH,+BAA+B,IAAI,CAAC;MAClF;IACF;IAEA,OAAO,IAAAQ,iBAAO,EAACL,uBAAuB,CAAC;EACzC,CAAC,CAAC;EACF,OAAO;IACLjE,OAAO,EAAE,IAAAsE,iBAAO,EAAC,IAAAC,iBAAO,EAACR,UAAU,CAAC,CAAC;IACrChB,eAAe;IACfC,oBAAoB;IACpBO,sBAAsB;IACtBC,wBAAwB;IACxBC,iBAAiB;IACjBC,6BAA6B;IAC7BC,kCAAkC;IAClCC,oCAAoC;IACpCC,sCAAsC;IACtCC,+BAA+B;IAC/BU,MAAM,EAAExE,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEwE;EACnB,CAAC;AACH"}
|
package/dist/lint.task.js
CHANGED
@@ -1,18 +1,9 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
-
require("core-js/modules/es.promise.js");
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
6
4
|
value: true
|
7
5
|
});
|
8
6
|
exports.LintTask = void 0;
|
9
|
-
function _defineProperty2() {
|
10
|
-
const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
11
|
-
_defineProperty2 = function () {
|
12
|
-
return data;
|
13
|
-
};
|
14
|
-
return data;
|
15
|
-
}
|
16
7
|
function _path() {
|
17
8
|
const data = _interopRequireDefault(require("path"));
|
18
9
|
_path = function () {
|
@@ -27,8 +18,12 @@ function _component() {
|
|
27
18
|
};
|
28
19
|
return data;
|
29
20
|
}
|
21
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
30
22
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
31
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (
|
23
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
24
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
25
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
26
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
32
27
|
class LintTask {
|
33
28
|
constructor(aspectId, name = 'lint') {
|
34
29
|
this.aspectId = aspectId;
|
package/dist/lint.task.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_path","data","_interopRequireDefault","require","_component","ownKeys","object","enumerableOnly","keys","Object","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","target","i","arguments","length","source","forEach","key","
|
1
|
+
{"version":3,"names":["_path","data","_interopRequireDefault","require","_component","obj","__esModule","default","ownKeys","object","enumerableOnly","keys","Object","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","target","i","arguments","length","source","forEach","key","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","value","_toPropertyKey","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","LintTask","constructor","aspectId","name","execute","context","linter","env","getLinter","rootDir","capsuleNetwork","capsulesRootDir","componentsDirMap","getComponentsDirectory","components","graphCapsules","linterContext","results","lint","componentsResults","map","lintResult","component","metadata","output","errors","capsuleRootDir","capsuleList","ComponentMap","as","_capsuleList$getCapsu","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 { Component, 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(readonly aspectId: string, readonly name = 'lint') {}\n\n async execute(context: BuildContext): Promise<BuiltTaskResult> {\n const linter: Linter = context.env.getLinter();\n const rootDir = context.capsuleNetwork.capsulesRootDir;\n const componentsDirMap = this.getComponentsDirectory(\n rootDir,\n context.components,\n context.capsuleNetwork.graphCapsules\n );\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(\n capsuleRootDir: string,\n components: Component[],\n capsuleList: CapsuleList\n ): ComponentMap<string> {\n return ComponentMap.as<string>(components, (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,UAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA6D,SAAAC,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,QAAAC,MAAA,EAAAC,cAAA,QAAAC,IAAA,GAAAC,MAAA,CAAAD,IAAA,CAAAF,MAAA,OAAAG,MAAA,CAAAC,qBAAA,QAAAC,OAAA,GAAAF,MAAA,CAAAC,qBAAA,CAAAJ,MAAA,GAAAC,cAAA,KAAAI,OAAA,GAAAA,OAAA,CAAAC,MAAA,WAAAC,GAAA,WAAAJ,MAAA,CAAAK,wBAAA,CAAAR,MAAA,EAAAO,GAAA,EAAAE,UAAA,OAAAP,IAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,IAAA,EAAAG,OAAA,YAAAH,IAAA;AAAA,SAAAU,cAAAC,MAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAF,CAAA,UAAAG,MAAA,WAAAF,SAAA,CAAAD,CAAA,IAAAC,SAAA,CAAAD,CAAA,QAAAA,CAAA,OAAAf,OAAA,CAAAI,MAAA,CAAAc,MAAA,OAAAC,OA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;MAC5D,OAAOI,YAAY;IACrB,CAAC,CAAC;EACJ;AACF;AAACE,OAAA,CAAArC,QAAA,GAAAA,QAAA"}
|
@@ -1,6 +1,5 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
5
4
|
value: true
|
6
5
|
});
|
@@ -12,6 +11,7 @@ function _react() {
|
|
12
11
|
};
|
13
12
|
return data;
|
14
13
|
}
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
15
15
|
const Logo = () => /*#__PURE__*/_react().default.createElement("div", {
|
16
16
|
style: {
|
17
17
|
height: '100%',
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_react","data","_interopRequireDefault","require","
|
1
|
+
{"version":3,"names":["_react","data","_interopRequireDefault","require","obj","__esModule","default","Logo","createElement","style","height","display","justifyContent","width","src","exports"],"sources":["linter.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/linter.svg\" />\n </div>\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;AAA0B,SAAAC,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEnB,MAAMG,IAAI,GAAGA,CAAA,kBAClBP,MAAA,GAAAM,OAAA,CAAAE,aAAA;EAAKC,KAAK,EAAE;IAAEC,MAAM,EAAE,MAAM;IAAEC,OAAO,EAAE,MAAM;IAAEC,cAAc,EAAE;EAAS;AAAE,gBACxEZ,MAAA,GAAAM,OAAA,CAAAE,aAAA;EAAKC,KAAK,EAAE;IAAEI,KAAK,EAAE;EAAG,CAAE;EAACC,GAAG,EAAC;AAAoD,CAAE,CAClF,CACN;AAACC,OAAA,CAAAR,IAAA,GAAAA,IAAA"}
|
package/dist/linter.graphql.js
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
5
4
|
value: true
|
6
5
|
});
|
@@ -12,6 +11,7 @@ function _graphqlTag() {
|
|
12
11
|
};
|
13
12
|
return data;
|
14
13
|
}
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
15
15
|
function linterSchema() {
|
16
16
|
return {
|
17
17
|
typeDefs: (0, _graphqlTag().default)``,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_graphqlTag","data","_interopRequireDefault","require","linterSchema","typeDefs","gql","resolvers"],"sources":["linter.graphql.ts"],"sourcesContent":["import gql from 'graphql-tag';\n\nexport function linterSchema() {\n return {\n typeDefs: gql``,\n resolvers: {},\n };\n}\n"],"mappings":"
|
1
|
+
{"version":3,"names":["_graphqlTag","data","_interopRequireDefault","require","obj","__esModule","default","linterSchema","typeDefs","gql","resolvers"],"sources":["linter.graphql.ts"],"sourcesContent":["import gql from 'graphql-tag';\n\nexport function linterSchema() {\n return {\n typeDefs: gql``,\n resolvers: {},\n };\n}\n"],"mappings":";;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA8B,SAAAC,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEvB,SAASG,YAAYA,CAAA,EAAG;EAC7B,OAAO;IACLC,QAAQ,EAAE,IAAAC,qBAAG,CAAC,EAAC;IACfC,SAAS,EAAE,CAAC;EACd,CAAC;AACH"}
|
@@ -1,19 +1,9 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
-
require("core-js/modules/es.array.iterator.js");
|
5
|
-
require("core-js/modules/es.promise.js");
|
6
3
|
Object.defineProperty(exports, "__esModule", {
|
7
4
|
value: true
|
8
5
|
});
|
9
6
|
exports.LinterMain = void 0;
|
10
|
-
function _defineProperty2() {
|
11
|
-
const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
12
|
-
_defineProperty2 = function () {
|
13
|
-
return data;
|
14
|
-
};
|
15
|
-
return data;
|
16
|
-
}
|
17
7
|
function _cli() {
|
18
8
|
const data = require("@teambit/cli");
|
19
9
|
_cli = function () {
|
@@ -77,6 +67,9 @@ function _lint2() {
|
|
77
67
|
};
|
78
68
|
return data;
|
79
69
|
}
|
70
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
71
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
72
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
80
73
|
class LinterMain {
|
81
74
|
constructor(envs, linterService) {
|
82
75
|
this.envs = envs;
|
@@ -113,9 +106,9 @@ class LinterMain {
|
|
113
106
|
}
|
114
107
|
}
|
115
108
|
exports.LinterMain = LinterMain;
|
116
|
-
(
|
117
|
-
(
|
118
|
-
(
|
109
|
+
_defineProperty(LinterMain, "runtime", _cli().MainRuntime);
|
110
|
+
_defineProperty(LinterMain, "dependencies", [_envs().EnvsAspect, _cli().CLIAspect, _component().ComponentAspect, _logger().LoggerAspect, _workspace().WorkspaceAspect]);
|
111
|
+
_defineProperty(LinterMain, "defaultConfig", {
|
119
112
|
extensionFormats: ['.ts', '.tsx', '.js', '.jsx', '.mjs'],
|
120
113
|
fixTypes: ['layout', 'problem', 'suggestion']
|
121
114
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_cli","data","require","_component","_envs","_logger","_workspace","_linter","_linter2","_lint","_lint2","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","
|
1
|
+
{"version":3,"names":["_cli","data","require","_component","_envs","_logger","_workspace","_linter","_linter2","_lint","_lint2","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","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, CLIMain, MainRuntime } from '@teambit/cli';\nimport { Component, ComponentAspect, ComponentMain } from '@teambit/component';\nimport { EnvsAspect, EnvsMain, ExecutionContext } from '@teambit/envs';\nimport { LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { Workspace, 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 { FixTypes, LinterOptions } from './linter-context';\nimport { 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(private envs: EnvsMain, private linterService: LinterService) {}\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 {\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":";;;;;;AAAA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,WAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,UAAA,YAAAA,CAAA;IAAA,OAA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C,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;AAAAvB,eAAA,CA9CYuB,UAAU,aACJkC,kBAAW;AAAAzD,eAAA,CADjBuB,UAAU,kBA0BC,CAACmC,kBAAU,EAAEC,gBAAS,EAAEC,4BAAe,EAAEC,sBAAY,EAAEC,4BAAe,CAAC;AAAA9D,eAAA,CA1BlFuB,UAAU,mBA4BgB;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"}
|
package/dist/linter.service.js
CHANGED
@@ -1,18 +1,9 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
-
require("core-js/modules/es.promise.js");
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
6
4
|
value: true
|
7
5
|
});
|
8
6
|
exports.LinterService = void 0;
|
9
|
-
function _defineProperty2() {
|
10
|
-
const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
11
|
-
_defineProperty2 = function () {
|
12
|
-
return data;
|
13
|
-
};
|
14
|
-
return data;
|
15
|
-
}
|
16
7
|
function _react() {
|
17
8
|
const data = _interopRequireDefault(require("react"));
|
18
9
|
_react = function () {
|
@@ -48,11 +39,15 @@ function _component() {
|
|
48
39
|
};
|
49
40
|
return data;
|
50
41
|
}
|
42
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
43
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
44
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
45
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
51
46
|
class LinterService {
|
52
47
|
constructor(linterConfig, workspace) {
|
53
48
|
this.linterConfig = linterConfig;
|
54
49
|
this.workspace = workspace;
|
55
|
-
(
|
50
|
+
_defineProperty(this, "name", 'linter');
|
56
51
|
}
|
57
52
|
async run(context, options) {
|
58
53
|
const mergedOpts = this.optionsWithDefaults(options);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_react","data","_interopRequireDefault","require","_lodash","_ink","_cliHighlight","_component","
|
1
|
+
{"version":3,"names":["_react","data","_interopRequireDefault","require","_lodash","_ink","_cliHighlight","_component","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","LinterService","constructor","linterConfig","workspace","run","context","options","mergedOpts","optionsWithDefaults","linterContext","mergeContext","linter","getLinter","results","lint","env","defaults","_this$workspace","componentsDirMap","components","getComponentsDirectory","ComponentMap","create","assign","rootDir","path","quiet","extensionFormats","fixTypes","fix","as","component","componentDir","id","relative","render","descriptor","getDescriptor","createElement","Text","color","displayName","version","Newline","config","highlight","language","ignoreIllegals","transform","icon","displayConfig","exports"],"sources":["linter.service.tsx"],"sourcesContent":["import React from 'react';\nimport { defaults } from 'lodash';\nimport { EnvService, ExecutionContext, EnvDefinition, ServiceTransformationMap, EnvContext, Env } from '@teambit/envs';\nimport { Text, Newline } from 'ink';\nimport { Workspace } from '@teambit/workspace';\nimport highlight from 'cli-highlight';\nimport { Component, ComponentMap } from '@teambit/component';\nimport { Linter, LintResults } from './linter';\nimport { LinterContext, LinterOptions } from './linter-context';\nimport { 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(private linterConfig: LinterConfig, private workspace: Workspace) {}\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: Linter = this.getLinter(context, options);\n\n const results = await linter.lint(linterContext);\n return results;\n }\n\n getLinter(context: ExecutionContext, options: LinterOptions): Linter {\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\n return (\n <Text key={descriptor?.id}>\n <Text color=\"cyan\">configured linter: </Text>\n <Text>\n {descriptor?.id} ({descriptor?.displayName} @ {descriptor?.version})\n </Text>\n <Newline />\n <Text color=\"cyan\">linter 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 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;AAEA,SAAAI,KAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,IAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,cAAA;EAAA,MAAAL,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAG,aAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA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CAAC,GAAG,GAAG;MAChDD,WAAW,EAAE9B,MAAM,CAAC8B,WAAW,GAAG9B,MAAM,CAAC8B,WAAW,GAAG;IACzD,CAAC;EACH;AACF;AAACU,OAAA,CAAAnD,aAAA,GAAAA,aAAA"}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.defender_linter@0.0.
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.defender_linter@0.0.
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.defender_linter@0.0.1159/dist/linter.composition.js';
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.defender_linter@0.0.1159/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,12 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "@teambit/linter",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.1159",
|
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": "0.0.
|
9
|
+
"version": "0.0.1159"
|
10
10
|
},
|
11
11
|
"dependencies": {
|
12
12
|
"chalk": "2.4.2",
|
@@ -14,16 +14,14 @@
|
|
14
14
|
"graphql-tag": "2.12.1",
|
15
15
|
"cli-highlight": "2.1.9",
|
16
16
|
"ink": "3.2.0",
|
17
|
-
"core-js": "^3.0.0",
|
18
|
-
"@babel/runtime": "7.20.0",
|
19
17
|
"@teambit/harmony": "0.4.6",
|
20
|
-
"@teambit/cli": "0.0.
|
21
|
-
"@teambit/component": "0.0.
|
22
|
-
"@teambit/envs": "0.0.
|
23
|
-
"@teambit/workspace": "0.0.
|
24
|
-
"@teambit/builder": "0.0.
|
25
|
-
"@teambit/isolator": "0.0.
|
26
|
-
"@teambit/logger": "0.0.
|
18
|
+
"@teambit/cli": "0.0.773",
|
19
|
+
"@teambit/component": "0.0.1159",
|
20
|
+
"@teambit/envs": "0.0.1159",
|
21
|
+
"@teambit/workspace": "0.0.1159",
|
22
|
+
"@teambit/builder": "0.0.1159",
|
23
|
+
"@teambit/isolator": "0.0.1159",
|
24
|
+
"@teambit/logger": "0.0.866"
|
27
25
|
},
|
28
26
|
"devDependencies": {
|
29
27
|
"@types/lodash": "4.14.165",
|
@@ -36,7 +34,7 @@
|
|
36
34
|
"@teambit/defender.content.linter-overview": "1.95.0"
|
37
35
|
},
|
38
36
|
"peerDependencies": {
|
39
|
-
"@teambit/legacy": "1.0.
|
37
|
+
"@teambit/legacy": "1.0.558",
|
40
38
|
"react": "^16.8.0 || ^17.0.0",
|
41
39
|
"react-dom": "^16.8.0 || ^17.0.0"
|
42
40
|
},
|