@teambit/validator 0.0.0-b949ceb4400bbc23d0cfcff787cf18aef15332f9 → 0.0.0-b94de199416512150828e65780d244cbf31da861

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.
@@ -17,9 +17,11 @@ export declare class ValidateCmd implements Command {
17
17
  group: string;
18
18
  options: CommandOptions;
19
19
  constructor(validator: ValidatorMain, workspace: Workspace, logger: Logger);
20
- report([pattern]: [string], { all, continueOnError }: {
20
+ report([pattern]: [string], { all, failFast, continueOnError, skipTasks, }: {
21
21
  all: boolean;
22
+ failFast: boolean;
22
23
  continueOnError: boolean;
24
+ skipTasks?: string;
23
25
  }): Promise<{
24
26
  code: number;
25
27
  data: string;
@@ -4,16 +4,16 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.ValidateCmd = void 0;
7
- function _workspace() {
8
- const data = require("@teambit/workspace");
9
- _workspace = function () {
7
+ function _cli() {
8
+ const data = require("@teambit/cli");
9
+ _cli = function () {
10
10
  return data;
11
11
  };
12
12
  return data;
13
13
  }
14
- function _chalk() {
15
- const data = _interopRequireDefault(require("chalk"));
16
- _chalk = function () {
14
+ function _workspace() {
15
+ const data = require("@teambit/workspace");
16
+ _workspace = function () {
17
17
  return data;
18
18
  };
19
19
  return data;
@@ -25,10 +25,10 @@ function _legacy() {
25
25
  };
26
26
  return data;
27
27
  }
28
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
29
28
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
30
29
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
31
30
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
31
+ const VALID_TASKS = ['check-types', 'lint', 'test'];
32
32
  class ValidateCmd {
33
33
  constructor(validator, workspace, logger) {
34
34
  this.validator = validator;
@@ -37,7 +37,8 @@ class ValidateCmd {
37
37
  _defineProperty(this, "name", 'validate [component-pattern]');
38
38
  _defineProperty(this, "description", 'run type-checking, linting, and testing in sequence');
39
39
  _defineProperty(this, "extendedDescription", `validates components by running check-types, lint, and test commands in sequence.
40
- stops at the first failure and returns a non-zero exit code.
40
+ by default runs all checks even when errors are found.
41
+ use --fail-fast to stop at the first failure.
41
42
  by default validates only new and modified components. use --all to validate all components.`);
42
43
  _defineProperty(this, "arguments", [{
43
44
  name: 'component-pattern',
@@ -45,34 +46,51 @@ by default validates only new and modified components. use --all to validate all
45
46
  }]);
46
47
  _defineProperty(this, "alias", '');
47
48
  _defineProperty(this, "group", 'testing');
48
- _defineProperty(this, "options", [['a', 'all', 'validate all components, not only modified and new'], ['c', 'continue-on-error', 'run all validation checks even when errors are found']]);
49
+ _defineProperty(this, "options", [['a', 'all', 'validate all components, not only modified and new'], ['', 'fail-fast', 'stop at the first failure instead of running all checks'], ['c', 'continue-on-error', 'DEPRECATED: this is now the default behavior'], ['', 'skip-tasks <string>', 'skip the given tasks. for multiple tasks, separate by a comma and wrap with quotes. available tasks: "check-types", "lint", "test"']]);
49
50
  }
50
51
  async report([pattern], {
51
52
  all = false,
52
- continueOnError = false
53
+ failFast = false,
54
+ continueOnError = false,
55
+ skipTasks
53
56
  }) {
54
57
  if (!this.workspace) throw new (_workspace().OutsideWorkspaceError)();
55
- this.logger.console(_chalk().default.bold('\nšŸ” Running validation checks...\n'));
58
+ if (continueOnError) {
59
+ this.logger.consoleWarning('--continue-on-error is deprecated and will be removed in a future version. This is now the default behavior.');
60
+ }
61
+ this.logger.console(`\n${(0, _cli().formatTitle)('Running validation checks...')}\n`);
56
62
  const startTime = Date.now();
57
63
  const components = await this.workspace.getComponentsByUserInput(pattern ? false : all, pattern, true);
58
64
  if (components.length === 0) {
59
- this.logger.console(_chalk().default.yellow('No components found to validate'));
65
+ this.logger.console((0, _cli().formatHint)('No components found to validate'));
60
66
  return {
61
67
  code: 0,
62
68
  data: 'No components found to validate'
63
69
  };
64
70
  }
65
71
  this.logger.console(`Validating ${components.length} component(s)\n`);
66
- const result = await this.validator.validate(components, continueOnError);
72
+ const skipTasksParsed = skipTasks ? skipTasks.split(',').map(t => t.trim()).filter(Boolean) : [];
73
+ const invalidTasks = skipTasksParsed.filter(t => !VALID_TASKS.includes(t));
74
+ if (invalidTasks.length > 0) {
75
+ throw new Error(`unknown skip-tasks: ${invalidTasks.join(', ')}. available tasks: ${VALID_TASKS.join(', ')}`);
76
+ }
77
+ const result = await this.validator.validate(components, failFast, skipTasksParsed);
67
78
  const totalTime = ((Date.now() - startTime) / 1000).toFixed(2);
68
79
  if (result.code !== 0) {
69
- this.logger.console(_chalk().default.red(`\nāœ— Validation failed\n`));
80
+ this.logger.console(`\n${_cli().errorSymbol} Validation failed\n`);
70
81
  return {
71
82
  code: result.code,
72
83
  data: `Validation failed after ${totalTime} seconds`
73
84
  };
74
85
  }
75
- this.logger.console(_chalk().default.green(`\nāœ“ All validation checks passed in ${totalTime} seconds\n`));
86
+ if (result.skippedAll) {
87
+ this.logger.console(`\n${(0, _cli().formatWarningSummary)('All validation tasks were skipped')}\n`);
88
+ return {
89
+ code: 0,
90
+ data: 'All validation tasks were skipped'
91
+ };
92
+ }
93
+ this.logger.console(`\n${(0, _cli().formatSuccessSummary)(`All validation checks passed in ${totalTime} seconds`)}\n`);
76
94
  return {
77
95
  code: 0,
78
96
  data: `Validation completed successfully in ${totalTime} seconds`
@@ -1 +1 @@
1
- {"version":3,"names":["_workspace","data","require","_chalk","_interopRequireDefault","_legacy","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","ValidateCmd","constructor","validator","workspace","logger","name","description","COMPONENT_PATTERN_HELP","report","pattern","all","continueOnError","OutsideWorkspaceError","console","chalk","bold","startTime","Date","now","components","getComponentsByUserInput","length","yellow","code","result","validate","totalTime","toFixed","red","green","exports"],"sources":["validate.cmd.ts"],"sourcesContent":["import type { Command, CommandOptions } from '@teambit/cli';\nimport type { Logger } from '@teambit/logger';\nimport type { Workspace } from '@teambit/workspace';\nimport { OutsideWorkspaceError } from '@teambit/workspace';\nimport chalk from 'chalk';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy.constants';\nimport type { ValidatorMain } from './validator.main.runtime';\n\nexport class ValidateCmd implements Command {\n name = 'validate [component-pattern]';\n description = 'run type-checking, linting, and testing in sequence';\n extendedDescription = `validates components by running check-types, lint, and test commands in sequence.\nstops at the first failure and returns a non-zero exit code.\nby default validates only new and modified components. use --all to validate all components.`;\n arguments = [{ name: 'component-pattern', description: COMPONENT_PATTERN_HELP }];\n alias = '';\n group = 'testing';\n options = [\n ['a', 'all', 'validate all components, not only modified and new'],\n ['c', 'continue-on-error', 'run all validation checks even when errors are found'],\n ] as CommandOptions;\n\n constructor(\n private validator: ValidatorMain,\n private workspace: Workspace,\n private logger: Logger\n ) {}\n\n async report(\n [pattern]: [string],\n { all = false, continueOnError = false }: { all: boolean; continueOnError: boolean }\n ) {\n if (!this.workspace) throw new OutsideWorkspaceError();\n\n this.logger.console(chalk.bold('\\nšŸ” Running validation checks...\\n'));\n\n const startTime = Date.now();\n const components = await this.workspace.getComponentsByUserInput(pattern ? false : all, pattern, true);\n\n if (components.length === 0) {\n this.logger.console(chalk.yellow('No components found to validate'));\n return { code: 0, data: 'No components found to validate' };\n }\n\n this.logger.console(`Validating ${components.length} component(s)\\n`);\n\n const result = await this.validator.validate(components, continueOnError);\n const totalTime = ((Date.now() - startTime) / 1000).toFixed(2);\n\n if (result.code !== 0) {\n this.logger.console(chalk.red(`\\nāœ— Validation failed\\n`));\n return { code: result.code, data: `Validation failed after ${totalTime} seconds` };\n }\n\n this.logger.console(chalk.green(`\\nāœ“ All validation checks passed in ${totalTime} seconds\\n`));\n return { code: 0, data: `Validation completed successfully in ${totalTime} seconds` };\n }\n}\n"],"mappings":";;;;;;AAGA,SAAAA,WAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,UAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,OAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,MAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,QAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,OAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAmE,SAAAG,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,CAAAF,CAAA,MAAAJ,CAAA,GAAAO,MAAA,CAAAC,cAAA,CAAAR,CAAA,EAAAI,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAZ,CAAA,CAAAI,CAAA,IAAAC,CAAA,EAAAL,CAAA;AAAA,SAAAM,eAAAD,CAAA,QAAAQ,CAAA,GAAAC,YAAA,CAAAT,CAAA,uCAAAQ,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAT,CAAA,EAAAD,CAAA,2BAAAC,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAL,CAAA,GAAAK,CAAA,CAAAU,MAAA,CAAAC,WAAA,kBAAAhB,CAAA,QAAAa,CAAA,GAAAb,CAAA,CAAAiB,IAAA,CAAAZ,CAA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AM,CAACS,OAAO,CAACC,gBAAK,CAACQ,MAAM,CAAC,iCAAiC,CAAC,CAAC;MACpE,OAAO;QAAEC,IAAI,EAAE,CAAC;QAAEjD,IAAI,EAAE;MAAkC,CAAC;IAC7D;IAEA,IAAI,CAAC8B,MAAM,CAACS,OAAO,CAAC,cAAcM,UAAU,CAACE,MAAM,iBAAiB,CAAC;IAErE,MAAMG,MAAM,GAAG,MAAM,IAAI,CAACtB,SAAS,CAACuB,QAAQ,CAACN,UAAU,EAAER,eAAe,CAAC;IACzE,MAAMe,SAAS,GAAG,CAAC,CAACT,IAAI,CAACC,GAAG,CAAC,CAAC,GAAGF,SAAS,IAAI,IAAI,EAAEW,OAAO,CAAC,CAAC,CAAC;IAE9D,IAAIH,MAAM,CAACD,IAAI,KAAK,CAAC,EAAE;MACrB,IAAI,CAACnB,MAAM,CAACS,OAAO,CAACC,gBAAK,CAACc,GAAG,CAAC,yBAAyB,CAAC,CAAC;MACzD,OAAO;QAAEL,IAAI,EAAEC,MAAM,CAACD,IAAI;QAAEjD,IAAI,EAAE,2BAA2BoD,SAAS;MAAW,CAAC;IACpF;IAEA,IAAI,CAACtB,MAAM,CAACS,OAAO,CAACC,gBAAK,CAACe,KAAK,CAAC,uCAAuCH,SAAS,YAAY,CAAC,CAAC;IAC9F,OAAO;MAAEH,IAAI,EAAE,CAAC;MAAEjD,IAAI,EAAE,wCAAwCoD,SAAS;IAAW,CAAC;EACvF;AACF;AAACI,OAAA,CAAA9B,WAAA,GAAAA,WAAA","ignoreList":[]}
1
+ {"version":3,"names":["_cli","data","require","_workspace","_legacy","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","VALID_TASKS","ValidateCmd","constructor","validator","workspace","logger","name","description","COMPONENT_PATTERN_HELP","report","pattern","all","failFast","continueOnError","skipTasks","OutsideWorkspaceError","consoleWarning","console","formatTitle","startTime","Date","now","components","getComponentsByUserInput","length","formatHint","code","skipTasksParsed","split","map","trim","filter","Boolean","invalidTasks","includes","Error","join","result","validate","totalTime","toFixed","errorSymbol","skippedAll","formatWarningSummary","formatSuccessSummary","exports"],"sources":["validate.cmd.ts"],"sourcesContent":["import type { Command, CommandOptions } from '@teambit/cli';\nimport { formatTitle, formatSuccessSummary, formatHint, formatWarningSummary, errorSymbol } from '@teambit/cli';\nimport type { Logger } from '@teambit/logger';\nimport type { Workspace } from '@teambit/workspace';\nimport { OutsideWorkspaceError } from '@teambit/workspace';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy.constants';\nimport type { ValidatorMain } from './validator.main.runtime';\n\nconst VALID_TASKS = ['check-types', 'lint', 'test'] as const;\n\nexport class ValidateCmd implements Command {\n name = 'validate [component-pattern]';\n description = 'run type-checking, linting, and testing in sequence';\n extendedDescription = `validates components by running check-types, lint, and test commands in sequence.\nby default runs all checks even when errors are found.\nuse --fail-fast to stop at the first failure.\nby default validates only new and modified components. use --all to validate all components.`;\n arguments = [{ name: 'component-pattern', description: COMPONENT_PATTERN_HELP }];\n alias = '';\n group = 'testing';\n options = [\n ['a', 'all', 'validate all components, not only modified and new'],\n ['', 'fail-fast', 'stop at the first failure instead of running all checks'],\n ['c', 'continue-on-error', 'DEPRECATED: this is now the default behavior'],\n [\n '',\n 'skip-tasks <string>',\n 'skip the given tasks. for multiple tasks, separate by a comma and wrap with quotes. available tasks: \"check-types\", \"lint\", \"test\"',\n ],\n ] as CommandOptions;\n\n constructor(\n private validator: ValidatorMain,\n private workspace: Workspace,\n private logger: Logger\n ) {}\n\n async report(\n [pattern]: [string],\n {\n all = false,\n failFast = false,\n continueOnError = false,\n skipTasks,\n }: { all: boolean; failFast: boolean; continueOnError: boolean; skipTasks?: string }\n ) {\n if (!this.workspace) throw new OutsideWorkspaceError();\n\n if (continueOnError) {\n this.logger.consoleWarning(\n '--continue-on-error is deprecated and will be removed in a future version. This is now the default behavior.'\n );\n }\n\n this.logger.console(`\\n${formatTitle('Running validation checks...')}\\n`);\n\n const startTime = Date.now();\n const components = await this.workspace.getComponentsByUserInput(pattern ? false : all, pattern, true);\n\n if (components.length === 0) {\n this.logger.console(formatHint('No components found to validate'));\n return { code: 0, data: 'No components found to validate' };\n }\n\n this.logger.console(`Validating ${components.length} component(s)\\n`);\n\n const skipTasksParsed = skipTasks\n ? skipTasks\n .split(',')\n .map((t) => t.trim())\n .filter(Boolean)\n : [];\n const invalidTasks = skipTasksParsed.filter((t) => !VALID_TASKS.includes(t as any));\n if (invalidTasks.length > 0) {\n throw new Error(`unknown skip-tasks: ${invalidTasks.join(', ')}. available tasks: ${VALID_TASKS.join(', ')}`);\n }\n const result = await this.validator.validate(components, failFast, skipTasksParsed);\n const totalTime = ((Date.now() - startTime) / 1000).toFixed(2);\n\n if (result.code !== 0) {\n this.logger.console(`\\n${errorSymbol} Validation failed\\n`);\n return { code: result.code, data: `Validation failed after ${totalTime} seconds` };\n }\n\n if (result.skippedAll) {\n this.logger.console(`\\n${formatWarningSummary('All validation tasks were skipped')}\\n`);\n return { code: 0, data: 'All validation tasks were skipped' };\n }\n\n this.logger.console(`\\n${formatSuccessSummary(`All validation checks passed in ${totalTime} seconds`)}\\n`);\n return { code: 0, data: `Validation completed successfully in ${totalTime} seconds` };\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAE,WAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,UAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAmE,SAAAI,gBAAAC,CAAA,EAAAC,CAAA,EA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C;EACvF;AACF;AAACM,OAAA,CAAA5C,WAAA,GAAAA,WAAA","ignoreList":[]}
@@ -8,6 +8,7 @@ import type { Component } from '@teambit/component';
8
8
  export type ValidationResult = {
9
9
  code: number;
10
10
  message: string;
11
+ skippedAll?: boolean;
11
12
  };
12
13
  export declare class ValidatorMain {
13
14
  private workspace;
@@ -18,7 +19,7 @@ export declare class ValidatorMain {
18
19
  static runtime: import("@teambit/harmony").RuntimeDefinition;
19
20
  static dependencies: import("@teambit/harmony").Aspect[];
20
21
  constructor(workspace: Workspace, typescript: TypescriptMain, linter: LinterMain, tester: TesterMain, logger: Logger);
21
- validate(components: Component[], continueOnError?: boolean): Promise<ValidationResult>;
22
+ validate(components: Component[], failFast?: boolean, skipTasks?: string[]): Promise<ValidationResult>;
22
23
  private checkTypes;
23
24
  private lint;
24
25
  private test;
@@ -79,30 +79,47 @@ class ValidatorMain {
79
79
  this.tester = tester;
80
80
  this.logger = logger;
81
81
  }
82
- async validate(components, continueOnError = false) {
83
- // Step 1: Check types
84
- this.logger.console(_chalk().default.cyan('1/3 Type Checking...'));
85
- const checkTypesResult = await this.checkTypes(components);
86
- this.logger.console(checkTypesResult.message);
87
- if (checkTypesResult.code !== 0 && !continueOnError) return checkTypesResult;
88
-
89
- // Step 2: Lint
90
- this.logger.console(_chalk().default.cyan('\n2/3 Linting...'));
91
- const lintResult = await this.lint(components);
92
- this.logger.console(lintResult.message);
93
- if (lintResult.code !== 0 && !continueOnError) return lintResult;
94
-
95
- // Step 3: Test
96
- this.logger.console(_chalk().default.cyan('\n3/3 Testing...'));
97
- const testResult = await this.test(components);
98
- this.logger.console(testResult.message);
99
-
100
- // When continueOnError is true, return the first error found, or success if all passed
101
- if (continueOnError) {
102
- if (checkTypesResult.code !== 0) return checkTypesResult;
103
- if (lintResult.code !== 0) return lintResult;
82
+ async validate(components, failFast = false, skipTasks = []) {
83
+ const steps = [];
84
+ if (!skipTasks.includes('check-types')) {
85
+ steps.push({
86
+ label: 'Type Checking',
87
+ run: () => this.checkTypes(components)
88
+ });
89
+ }
90
+ if (!skipTasks.includes('lint')) {
91
+ steps.push({
92
+ label: 'Linting',
93
+ run: () => this.lint(components)
94
+ });
95
+ }
96
+ if (!skipTasks.includes('test')) {
97
+ steps.push({
98
+ label: 'Testing',
99
+ run: () => this.test(components)
100
+ });
101
+ }
102
+ if (steps.length === 0) {
103
+ return {
104
+ code: 0,
105
+ message: 'all tasks were skipped',
106
+ skippedAll: true
107
+ };
104
108
  }
105
- return testResult;
109
+ const total = steps.length;
110
+ const results = [];
111
+ for (let i = 0; i < steps.length; i++) {
112
+ const step = steps[i];
113
+ this.logger.console(_chalk().default.cyan(`${i > 0 ? '\n' : ''}${i + 1}/${total} ${step.label}...`));
114
+ const result = await step.run();
115
+ this.logger.console(result.message);
116
+ results.push(result);
117
+ if (result.code !== 0 && failFast) return result;
118
+ }
119
+
120
+ // Return the first error found, or success if all passed
121
+ const firstError = results.find(r => r.code !== 0);
122
+ return firstError || results[results.length - 1];
106
123
  }
107
124
  async checkTypes(components) {
108
125
  const files = this.typescript.getSupportedFilesForTsserver(components);
@@ -112,7 +129,17 @@ class ValidatorMain {
112
129
  }, files);
113
130
  const tsserver = this.typescript.getTsserverClient();
114
131
  if (!tsserver) throw new Error('unable to start tsserver');
115
- await tsserver.getDiagnostic(files);
132
+ try {
133
+ const BATCH_SIZE = 50;
134
+ await tsserver.getDiagnostic(files, files.length > BATCH_SIZE ? BATCH_SIZE : undefined);
135
+ } catch (err) {
136
+ tsserver.killTsServer();
137
+ const errMsg = err instanceof Error ? err.message : String(err);
138
+ return {
139
+ code: 1,
140
+ message: `type checking failed: ${errMsg}`
141
+ };
142
+ }
116
143
  const errorCount = tsserver.lastDiagnostics.length;
117
144
  tsserver.killTsServer();
118
145
  return {
@@ -1 +1 @@
1
- {"version":3,"names":["_cli","data","require","_logger","_workspace","_typescript","_linter","_tester","_chalk","_interopRequireDefault","_validator","_validate","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","ValidatorMain","constructor","workspace","typescript","linter","tester","logger","validate","components","continueOnError","console","chalk","cyan","checkTypesResult","checkTypes","message","code","lintResult","lint","testResult","test","files","getSupportedFilesForTsserver","initTsserverClientFromWorkspace","aggregateDiagnosticData","printTypeErrors","tsserver","getTsserverClient","Error","getDiagnostic","errorCount","lastDiagnostics","length","killTsServer","linterResults","totalErrors","totalWarnings","dirtyComponents","results","forEach","res","componentErrors","totalErrorCount","totalFatalErrorCount","totalWarningCount","compResult","hasErrors","output","compTitle","bold","component","id","toString","ignoreVersion","push","join","tests","watch","debug","provider","cli","loggerAspect","createLogger","ValidatorAspect","validator","register","ValidateCmd","exports","MainRuntime","CLIAspect","WorkspaceAspect","LoggerAspect","TypescriptAspect","LinterAspect","TesterAspect","addRuntime"],"sources":["validator.main.runtime.ts"],"sourcesContent":["import type { CLIMain } from '@teambit/cli';\nimport { CLIAspect, MainRuntime } from '@teambit/cli';\nimport type { LoggerMain, Logger } from '@teambit/logger';\nimport { LoggerAspect } from '@teambit/logger';\nimport type { Workspace } from '@teambit/workspace';\nimport { WorkspaceAspect } from '@teambit/workspace';\nimport type { TypescriptMain } from '@teambit/typescript';\nimport { TypescriptAspect } from '@teambit/typescript';\nimport type { LinterMain } from '@teambit/linter';\nimport { LinterAspect } from '@teambit/linter';\nimport type { TesterMain } from '@teambit/tester';\nimport { TesterAspect } from '@teambit/tester';\nimport type { Component } from '@teambit/component';\nimport chalk from 'chalk';\nimport { ValidatorAspect } from './validator.aspect';\nimport { ValidateCmd } from './validate.cmd';\n\nexport type ValidationResult = {\n code: number;\n message: string;\n};\n\nexport class ValidatorMain {\n static runtime = MainRuntime;\n static dependencies = [CLIAspect, WorkspaceAspect, LoggerAspect, TypescriptAspect, LinterAspect, TesterAspect];\n\n constructor(\n private workspace: Workspace,\n private typescript: TypescriptMain,\n private linter: LinterMain,\n private tester: TesterMain,\n private logger: Logger\n ) {}\n\n async validate(components: Component[], continueOnError = false): Promise<ValidationResult> {\n // Step 1: Check types\n this.logger.console(chalk.cyan('1/3 Type Checking...'));\n const checkTypesResult = await this.checkTypes(components);\n this.logger.console(checkTypesResult.message);\n if (checkTypesResult.code !== 0 && !continueOnError) return checkTypesResult;\n\n // Step 2: Lint\n this.logger.console(chalk.cyan('\\n2/3 Linting...'));\n const lintResult = await this.lint(components);\n this.logger.console(lintResult.message);\n if (lintResult.code !== 0 && !continueOnError) return lintResult;\n\n // Step 3: Test\n this.logger.console(chalk.cyan('\\n3/3 Testing...'));\n const testResult = await this.test(components);\n this.logger.console(testResult.message);\n\n // When continueOnError is true, return the first error found, or success if all passed\n if (continueOnError) {\n if (checkTypesResult.code !== 0) return checkTypesResult;\n if (lintResult.code !== 0) return lintResult;\n }\n return testResult;\n }\n\n private async checkTypes(components: Component[]): Promise<ValidationResult> {\n const files = this.typescript.getSupportedFilesForTsserver(components);\n\n await this.typescript.initTsserverClientFromWorkspace(\n { aggregateDiagnosticData: false, printTypeErrors: true },\n files\n );\n\n const tsserver = this.typescript.getTsserverClient();\n if (!tsserver) throw new Error('unable to start tsserver');\n\n await tsserver.getDiagnostic(files);\n const errorCount = tsserver.lastDiagnostics.length;\n tsserver.killTsServer();\n\n return {\n code: errorCount > 0 ? 1 : 0,\n message: errorCount > 0 ? `found errors in ${errorCount} files` : 'no type errors found',\n };\n }\n\n private async lint(components: Component[]): Promise<ValidationResult> {\n const linterResults = await this.linter.lint(components, {});\n\n let totalErrors = 0;\n let totalWarnings = 0;\n const dirtyComponents: string[] = [];\n\n linterResults.results.forEach((res) => {\n if (res.data) {\n const componentErrors = (res.data.totalErrorCount || 0) + (res.data.totalFatalErrorCount || 0);\n totalErrors += componentErrors;\n totalWarnings += res.data.totalWarningCount || 0;\n\n // Show detailed output for components with errors\n res.data.results.forEach((compResult) => {\n const hasErrors = compResult.totalErrorCount > 0 || (compResult.totalFatalErrorCount || 0) > 0;\n if (hasErrors && compResult.output) {\n const compTitle = chalk.bold.cyan(compResult.component.id.toString({ ignoreVersion: true }));\n dirtyComponents.push(`${compTitle}\\n${compResult.output}`);\n }\n });\n }\n });\n\n let message = '';\n if (dirtyComponents.length > 0) {\n message = dirtyComponents.join('\\n\\n') + '\\n\\n';\n }\n message +=\n totalErrors > 0\n ? `found ${totalErrors} error(s) and ${totalWarnings} warning(s)`\n : totalWarnings > 0\n ? `found ${totalWarnings} warning(s), no errors`\n : 'no linting issues found';\n\n return {\n code: totalErrors > 0 ? 1 : 0,\n message,\n };\n }\n\n private async test(components: Component[]): Promise<ValidationResult> {\n if (components.length === 0) {\n return { code: 0, message: 'no components found to test' };\n }\n\n const tests = await this.tester.test(components, { watch: false, debug: false });\n const hasErrors = tests.hasErrors();\n\n return {\n code: hasErrors ? 1 : 0,\n message: hasErrors ? 'tests failed' : `all tests passed for ${components.length} component(s)`,\n };\n }\n\n static async provider([cli, workspace, loggerAspect, typescript, linter, tester]: [\n CLIMain,\n Workspace,\n LoggerMain,\n TypescriptMain,\n LinterMain,\n TesterMain,\n ]) {\n const logger = loggerAspect.createLogger(ValidatorAspect.id);\n const validator = new ValidatorMain(workspace, typescript, linter, tester, logger);\n cli.register(new ValidateCmd(validator, workspace, logger));\n return validator;\n }\n}\n\nValidatorAspect.addRuntime(ValidatorMain);\n"],"mappings":";;;;;;AACA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,QAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,WAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,UAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,YA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AS,EAAEI,MAAM,CAAC,CAAC;IAC3D,OAAO0D,SAAS;EAClB;AACF;AAACG,OAAA,CAAAnE,aAAA,GAAAA,aAAA;AAAAlB,eAAA,CA/HYkB,aAAa,aACPoE,kBAAW;AAAAtF,eAAA,CADjBkB,aAAa,kBAEF,CAACqE,gBAAS,EAAEC,4BAAe,EAAEC,sBAAY,EAAEC,8BAAgB,EAAEC,sBAAY,EAAEC,sBAAY,CAAC;AA+HhHX,4BAAe,CAACY,UAAU,CAAC3E,aAAa,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_cli","data","require","_logger","_workspace","_typescript","_linter","_tester","_chalk","_interopRequireDefault","_validator","_validate","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","ValidatorMain","constructor","workspace","typescript","linter","tester","logger","validate","components","failFast","skipTasks","steps","includes","push","label","run","checkTypes","lint","test","length","code","message","skippedAll","total","results","step","console","chalk","cyan","result","firstError","find","files","getSupportedFilesForTsserver","initTsserverClientFromWorkspace","aggregateDiagnosticData","printTypeErrors","tsserver","getTsserverClient","Error","BATCH_SIZE","getDiagnostic","undefined","err","killTsServer","errMsg","errorCount","lastDiagnostics","linterResults","totalErrors","totalWarnings","dirtyComponents","forEach","res","componentErrors","totalErrorCount","totalFatalErrorCount","totalWarningCount","compResult","hasErrors","output","compTitle","bold","component","id","toString","ignoreVersion","join","tests","watch","debug","provider","cli","loggerAspect","createLogger","ValidatorAspect","validator","register","ValidateCmd","exports","MainRuntime","CLIAspect","WorkspaceAspect","LoggerAspect","TypescriptAspect","LinterAspect","TesterAspect","addRuntime"],"sources":["validator.main.runtime.ts"],"sourcesContent":["import type { CLIMain } from '@teambit/cli';\nimport { CLIAspect, MainRuntime } from '@teambit/cli';\nimport type { LoggerMain, Logger } from '@teambit/logger';\nimport { LoggerAspect } from '@teambit/logger';\nimport type { Workspace } from '@teambit/workspace';\nimport { WorkspaceAspect } from '@teambit/workspace';\nimport type { TypescriptMain } from '@teambit/typescript';\nimport { TypescriptAspect } from '@teambit/typescript';\nimport type { LinterMain } from '@teambit/linter';\nimport { LinterAspect } from '@teambit/linter';\nimport type { TesterMain } from '@teambit/tester';\nimport { TesterAspect } from '@teambit/tester';\nimport type { Component } from '@teambit/component';\nimport chalk from 'chalk';\nimport { ValidatorAspect } from './validator.aspect';\nimport { ValidateCmd } from './validate.cmd';\n\nexport type ValidationResult = {\n code: number;\n message: string;\n skippedAll?: boolean;\n};\n\nexport class ValidatorMain {\n static runtime = MainRuntime;\n static dependencies = [CLIAspect, WorkspaceAspect, LoggerAspect, TypescriptAspect, LinterAspect, TesterAspect];\n\n constructor(\n private workspace: Workspace,\n private typescript: TypescriptMain,\n private linter: LinterMain,\n private tester: TesterMain,\n private logger: Logger\n ) {}\n\n async validate(components: Component[], failFast = false, skipTasks: string[] = []): Promise<ValidationResult> {\n const steps: { label: string; run: () => Promise<ValidationResult> }[] = [];\n\n if (!skipTasks.includes('check-types')) {\n steps.push({ label: 'Type Checking', run: () => this.checkTypes(components) });\n }\n if (!skipTasks.includes('lint')) {\n steps.push({ label: 'Linting', run: () => this.lint(components) });\n }\n if (!skipTasks.includes('test')) {\n steps.push({ label: 'Testing', run: () => this.test(components) });\n }\n\n if (steps.length === 0) {\n return { code: 0, message: 'all tasks were skipped', skippedAll: true };\n }\n\n const total = steps.length;\n const results: ValidationResult[] = [];\n\n for (let i = 0; i < steps.length; i++) {\n const step = steps[i];\n this.logger.console(chalk.cyan(`${i > 0 ? '\\n' : ''}${i + 1}/${total} ${step.label}...`));\n const result = await step.run();\n this.logger.console(result.message);\n results.push(result);\n if (result.code !== 0 && failFast) return result;\n }\n\n // Return the first error found, or success if all passed\n const firstError = results.find((r) => r.code !== 0);\n return firstError || results[results.length - 1];\n }\n\n private async checkTypes(components: Component[]): Promise<ValidationResult> {\n const files = this.typescript.getSupportedFilesForTsserver(components);\n\n await this.typescript.initTsserverClientFromWorkspace(\n { aggregateDiagnosticData: false, printTypeErrors: true },\n files\n );\n\n const tsserver = this.typescript.getTsserverClient();\n if (!tsserver) throw new Error('unable to start tsserver');\n\n try {\n const BATCH_SIZE = 50;\n await tsserver.getDiagnostic(files, files.length > BATCH_SIZE ? BATCH_SIZE : undefined);\n } catch (err: any) {\n tsserver.killTsServer();\n const errMsg = err instanceof Error ? err.message : String(err);\n return {\n code: 1,\n message: `type checking failed: ${errMsg}`,\n };\n }\n const errorCount = tsserver.lastDiagnostics.length;\n tsserver.killTsServer();\n\n return {\n code: errorCount > 0 ? 1 : 0,\n message: errorCount > 0 ? `found errors in ${errorCount} files` : 'no type errors found',\n };\n }\n\n private async lint(components: Component[]): Promise<ValidationResult> {\n const linterResults = await this.linter.lint(components, {});\n\n let totalErrors = 0;\n let totalWarnings = 0;\n const dirtyComponents: string[] = [];\n\n linterResults.results.forEach((res) => {\n if (res.data) {\n const componentErrors = (res.data.totalErrorCount || 0) + (res.data.totalFatalErrorCount || 0);\n totalErrors += componentErrors;\n totalWarnings += res.data.totalWarningCount || 0;\n\n // Show detailed output for components with errors\n res.data.results.forEach((compResult) => {\n const hasErrors = compResult.totalErrorCount > 0 || (compResult.totalFatalErrorCount || 0) > 0;\n if (hasErrors && compResult.output) {\n const compTitle = chalk.bold.cyan(compResult.component.id.toString({ ignoreVersion: true }));\n dirtyComponents.push(`${compTitle}\\n${compResult.output}`);\n }\n });\n }\n });\n\n let message = '';\n if (dirtyComponents.length > 0) {\n message = dirtyComponents.join('\\n\\n') + '\\n\\n';\n }\n message +=\n totalErrors > 0\n ? `found ${totalErrors} error(s) and ${totalWarnings} warning(s)`\n : totalWarnings > 0\n ? `found ${totalWarnings} warning(s), no errors`\n : 'no linting issues found';\n\n return {\n code: totalErrors > 0 ? 1 : 0,\n message,\n };\n }\n\n private async test(components: Component[]): Promise<ValidationResult> {\n if (components.length === 0) {\n return { code: 0, message: 'no components found to test' };\n }\n\n const tests = await this.tester.test(components, { watch: false, debug: false });\n const hasErrors = tests.hasErrors();\n\n return {\n code: hasErrors ? 1 : 0,\n message: hasErrors ? 'tests failed' : `all tests passed for ${components.length} component(s)`,\n };\n }\n\n static async provider([cli, workspace, loggerAspect, typescript, linter, tester]: [\n CLIMain,\n Workspace,\n LoggerMain,\n TypescriptMain,\n LinterMain,\n TesterMain,\n ]) {\n const logger = loggerAspect.createLogger(ValidatorAspect.id);\n const validator = new ValidatorMain(workspace, typescript, linter, tester, logger);\n cli.register(new ValidateCmd(validator, workspace, logger));\n return validator;\n }\n}\n\nValidatorAspect.addRuntime(ValidatorMain);\n"],"mappings":";;;;;;AACA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,QAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,WAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,UAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,YAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,WAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,QAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,OAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,QAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,OAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAO,OAAA;EAAA,MAAAP,IAAA,GAAAQ,sBAAA,CAAAP,OAAA;EAAAM,MAAA,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M,CAAC,CAAC;IAChF,MAAMX,SAAS,GAAGS,KAAK,CAACT,SAAS,CAAC,CAAC;IAEnC,OAAO;MACLvC,IAAI,EAAEuC,SAAS,GAAG,CAAC,GAAG,CAAC;MACvBtC,OAAO,EAAEsC,SAAS,GAAG,cAAc,GAAG,wBAAwBnD,UAAU,CAACW,MAAM;IACjF,CAAC;EACH;EAEA,aAAaoD,QAAQA,CAAC,CAACC,GAAG,EAAEtE,SAAS,EAAEuE,YAAY,EAAEtE,UAAU,EAAEC,MAAM,EAAEC,MAAM,CAO9E,EAAE;IACD,MAAMC,MAAM,GAAGmE,YAAY,CAACC,YAAY,CAACC,4BAAe,CAACX,EAAE,CAAC;IAC5D,MAAMY,SAAS,GAAG,IAAI5E,aAAa,CAACE,SAAS,EAAEC,UAAU,EAAEC,MAAM,EAAEC,MAAM,EAAEC,MAAM,CAAC;IAClFkE,GAAG,CAACK,QAAQ,CAAC,KAAIC,uBAAW,EAACF,SAAS,EAAE1E,SAAS,EAAEI,MAAM,CAAC,CAAC;IAC3D,OAAOsE,SAAS;EAClB;AACF;AAACG,OAAA,CAAA/E,aAAA,GAAAA,aAAA;AAAAlB,eAAA,CAjJYkB,aAAa,aACPgF,kBAAW;AAAAlG,eAAA,CADjBkB,aAAa,kBAEF,CAACiF,gBAAS,EAAEC,4BAAe,EAAEC,sBAAY,EAAEC,8BAAgB,EAAEC,sBAAY,EAAEC,sBAAY,CAAC;AAiJhHX,4BAAe,CAACY,UAAU,CAACvF,aAAa,CAAC","ignoreList":[]}
package/package.json CHANGED
@@ -1,27 +1,27 @@
1
1
  {
2
2
  "name": "@teambit/validator",
3
- "version": "0.0.0-b949ceb4400bbc23d0cfcff787cf18aef15332f9",
3
+ "version": "0.0.0-b94de199416512150828e65780d244cbf31da861",
4
4
  "homepage": "https://bit.cloud/teambit/defender/validator",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.defender",
8
8
  "name": "validator",
9
- "version": "b949ceb4400bbc23d0cfcff787cf18aef15332f9"
9
+ "version": "b94de199416512150828e65780d244cbf31da861"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "4.1.2",
13
- "@teambit/cli": "0.0.1303",
14
- "@teambit/legacy.constants": "0.0.24",
15
- "@teambit/logger": "0.0.1396",
16
13
  "@teambit/harmony": "0.4.7",
17
- "@teambit/workspace": "0.0.0-a1ca9d1298312eeebe12d962602a93cdfafdd1a9",
18
- "@teambit/component": "0.0.0-4a742f3fe0b0c56ccb62cbb864adc509585af72c",
19
- "@teambit/linter": "0.0.0-ab3d5927b12792bfdf60c00df765cf0f88aa7762",
20
- "@teambit/tester": "0.0.0-bafe84fef57a34aa270e2cb993375ef8365b99b4",
21
- "@teambit/typescript": "0.0.0-5da03c91c7e011bdd00060f19d9e1d387e91a3c2"
14
+ "@teambit/cli": "0.0.0-e3db36fd8d1bdb35a28b8a857afab58aeda0d6f2",
15
+ "@teambit/legacy.constants": "0.0.0-9492c6fc271b5810ea757765d5f63d566b5dc54a",
16
+ "@teambit/logger": "0.0.0-15435ab04129c41faf6c1c19e982d4b6c25a212b",
17
+ "@teambit/workspace": "0.0.0-7692e878bbccfbdf2f2bf7354e2c0f5f29c3df31",
18
+ "@teambit/component": "0.0.0-2ce66c286a974e5ea222759dd76b2b812e772952",
19
+ "@teambit/linter": "0.0.0-329a07e545a04cb58bfeff8d42fed98a24c060c1",
20
+ "@teambit/tester": "0.0.0-843831e74d952088fd3ddec880ce8e201541d4f8",
21
+ "@teambit/typescript": "0.0.0-7bcdba1409d355e41a3a3226783a0f2ecade8c7c"
22
22
  },
23
23
  "devDependencies": {
24
- "@teambit/harmony.envs.core-aspect-env": "0.1.4"
24
+ "@teambit/harmony.envs.core-aspect-env": "0.1.7"
25
25
  },
26
26
  "peerDependencies": {},
27
27
  "license": "Apache-2.0",
@@ -29,6 +29,7 @@
29
29
  "peerDependenciesMeta": {},
30
30
  "exports": {
31
31
  ".": {
32
+ "types": "./index.ts",
32
33
  "node": {
33
34
  "require": "./dist/index.js",
34
35
  "import": "./dist/esm.mjs"