@teambit/validator 0.0.148 → 0.0.150

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,8 +17,9 @@ 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, skipTasks }: {
20
+ report([pattern]: [string], { all, failFast, continueOnError, skipTasks, }: {
21
21
  all: boolean;
22
+ failFast: boolean;
22
23
  continueOnError: boolean;
23
24
  skipTasks?: string;
24
25
  }): Promise<{
@@ -38,7 +38,8 @@ class ValidateCmd {
38
38
  _defineProperty(this, "name", 'validate [component-pattern]');
39
39
  _defineProperty(this, "description", 'run type-checking, linting, and testing in sequence');
40
40
  _defineProperty(this, "extendedDescription", `validates components by running check-types, lint, and test commands in sequence.
41
- stops at the first failure and returns a non-zero exit code.
41
+ by default runs all checks even when errors are found.
42
+ use --fail-fast to stop at the first failure.
42
43
  by default validates only new and modified components. use --all to validate all components.`);
43
44
  _defineProperty(this, "arguments", [{
44
45
  name: 'component-pattern',
@@ -46,14 +47,18 @@ by default validates only new and modified components. use --all to validate all
46
47
  }]);
47
48
  _defineProperty(this, "alias", '');
48
49
  _defineProperty(this, "group", 'testing');
49
- _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'], ['', 'skip-tasks <string>', 'skip the given tasks. for multiple tasks, separate by a comma and wrap with quotes. available tasks: "check-types", "lint", "test"']]);
50
+ _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"']]);
50
51
  }
51
52
  async report([pattern], {
52
53
  all = false,
54
+ failFast = false,
53
55
  continueOnError = false,
54
56
  skipTasks
55
57
  }) {
56
58
  if (!this.workspace) throw new (_workspace().OutsideWorkspaceError)();
59
+ if (continueOnError) {
60
+ this.logger.consoleWarning('--continue-on-error is deprecated and will be removed in a future version. This is now the default behavior.');
61
+ }
57
62
  this.logger.console(_chalk().default.bold('\nšŸ” Running validation checks...\n'));
58
63
  const startTime = Date.now();
59
64
  const components = await this.workspace.getComponentsByUserInput(pattern ? false : all, pattern, true);
@@ -70,7 +75,7 @@ by default validates only new and modified components. use --all to validate all
70
75
  if (invalidTasks.length > 0) {
71
76
  throw new Error(`unknown skip-tasks: ${invalidTasks.join(', ')}. available tasks: ${VALID_TASKS.join(', ')}`);
72
77
  }
73
- const result = await this.validator.validate(components, continueOnError, skipTasksParsed);
78
+ const result = await this.validator.validate(components, failFast, skipTasksParsed);
74
79
  const totalTime = ((Date.now() - startTime) / 1000).toFixed(2);
75
80
  if (result.code !== 0) {
76
81
  this.logger.console(_chalk().default.red(`\nāœ— Validation failed\n`));
@@ -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","VALID_TASKS","ValidateCmd","constructor","validator","workspace","logger","name","description","COMPONENT_PATTERN_HELP","report","pattern","all","continueOnError","skipTasks","OutsideWorkspaceError","console","chalk","bold","startTime","Date","now","components","getComponentsByUserInput","length","yellow","code","skipTasksParsed","split","map","trim","filter","Boolean","invalidTasks","includes","Error","join","result","validate","totalTime","toFixed","red","skippedAll","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\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.\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 [\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 { all = false, continueOnError = false, skipTasks }: { all: boolean; continueOnError: boolean; skipTasks?: string }\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 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, continueOnError, skipTasksParsed);\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 if (result.skippedAll) {\n this.logger.console(chalk.yellow(`\\n⚠ All validation tasks were skipped\\n`));\n return { code: 0, data: 'All validation tasks were skipped' };\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,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,CAAC,CAAC;IAE9D,IAAIH,MAAM,CAACX,IAAI,KAAK,CAAC,EAAE;MACrB,IAAI,CAACpB,MAAM,CAACU,OAAO,CAACC,gBAAK,CAACwB,GAAG,CAAC,yBAAyB,CAAC,CAAC;MACzD,OAAO;QAAEf,IAAI,EAAEW,MAAM,CAACX,IAAI;QAAEnD,IAAI,EAAE,2BAA2BgE,SAAS;MAAW,CAAC;IACpF;IAEA,IAAIF,MAAM,CAACK,UAAU,EAAE;MACrB,IAAI,CAACpC,MAAM,CAACU,OAAO,CAACC,gBAAK,CAACQ,MAAM,CAAC,yCAAyC,CAAC,CAAC;MAC5E,OAAO;QAAEC,IAAI,EAAE,CAAC;QAAEnD,IAAI,EAAE;MAAoC,CAAC;IAC/D;IAEA,IAAI,CAAC+B,MAAM,CAACU,OAAO,CAACC,gBAAK,CAAC0B,KAAK,CAAC,uCAAuCJ,SAAS,YAAY,CAAC,CAAC;IAC9F,OAAO;MAAEb,IAAI,EAAE,CAAC;MAAEnD,IAAI,EAAE,wCAAwCgE,SAAS;IAAW,CAAC;EACvF;AACF;AAACK,OAAA,CAAA1C,WAAA,GAAAA,WAAA","ignoreList":[]}
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","VALID_TASKS","ValidateCmd","constructor","validator","workspace","logger","name","description","COMPONENT_PATTERN_HELP","report","pattern","all","failFast","continueOnError","skipTasks","OutsideWorkspaceError","consoleWarning","console","chalk","bold","startTime","Date","now","components","getComponentsByUserInput","length","yellow","code","skipTasksParsed","split","map","trim","filter","Boolean","invalidTasks","includes","Error","join","result","validate","totalTime","toFixed","red","skippedAll","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\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(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 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(chalk.red(`\\nāœ— Validation failed\\n`));\n return { code: result.code, data: `Validation failed after ${totalTime} seconds` };\n }\n\n if (result.skippedAll) {\n this.logger.console(chalk.yellow(`\\n⚠ All validation tasks were skipped\\n`));\n return { code: 0, data: 'All validation tasks were skipped' };\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,E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C,CAAC;IACnF,IAAIkD,YAAY,CAACT,MAAM,GAAG,CAAC,EAAE;MAC3B,MAAM,IAAIW,KAAK,CAAC,uBAAuBF,YAAY,CAACG,IAAI,CAAC,IAAI,CAAC,sBAAsBrC,WAAW,CAACqC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;IAC/G;IACA,MAAMC,MAAM,GAAG,MAAM,IAAI,CAACnC,SAAS,CAACoC,QAAQ,CAAChB,UAAU,EAAEX,QAAQ,EAAEgB,eAAe,CAAC;IACnF,MAAMY,SAAS,GAAG,CAAC,CAACnB,IAAI,CAACC,GAAG,CAAC,CAAC,GAAGF,SAAS,IAAI,IAAI,EAAEqB,OAAO,CAAC,CAAC,CAAC;IAE9D,IAAIH,MAAM,CAACX,IAAI,KAAK,CAAC,EAAE;MACrB,IAAI,CAACtB,MAAM,CAACY,OAAO,CAACC,gBAAK,CAACwB,GAAG,CAAC,yBAAyB,CAAC,CAAC;MACzD,OAAO;QAAEf,IAAI,EAAEW,MAAM,CAACX,IAAI;QAAErD,IAAI,EAAE,2BAA2BkE,SAAS;MAAW,CAAC;IACpF;IAEA,IAAIF,MAAM,CAACK,UAAU,EAAE;MACrB,IAAI,CAACtC,MAAM,CAACY,OAAO,CAACC,gBAAK,CAACQ,MAAM,CAAC,yCAAyC,CAAC,CAAC;MAC5E,OAAO;QAAEC,IAAI,EAAE,CAAC;QAAErD,IAAI,EAAE;MAAoC,CAAC;IAC/D;IAEA,IAAI,CAAC+B,MAAM,CAACY,OAAO,CAACC,gBAAK,CAAC0B,KAAK,CAAC,uCAAuCJ,SAAS,YAAY,CAAC,CAAC;IAC9F,OAAO;MAAEb,IAAI,EAAE,CAAC;MAAErD,IAAI,EAAE,wCAAwCkE,SAAS;IAAW,CAAC;EACvF;AACF;AAACK,OAAA,CAAA5C,WAAA,GAAAA,WAAA","ignoreList":[]}
@@ -19,7 +19,7 @@ export declare class ValidatorMain {
19
19
  static runtime: import("@teambit/harmony").RuntimeDefinition;
20
20
  static dependencies: import("@teambit/harmony").Aspect[];
21
21
  constructor(workspace: Workspace, typescript: TypescriptMain, linter: LinterMain, tester: TesterMain, logger: Logger);
22
- validate(components: Component[], continueOnError?: boolean, skipTasks?: string[]): Promise<ValidationResult>;
22
+ validate(components: Component[], failFast?: boolean, skipTasks?: string[]): Promise<ValidationResult>;
23
23
  private checkTypes;
24
24
  private lint;
25
25
  private test;
@@ -79,7 +79,7 @@ class ValidatorMain {
79
79
  this.tester = tester;
80
80
  this.logger = logger;
81
81
  }
82
- async validate(components, continueOnError = false, skipTasks = []) {
82
+ async validate(components, failFast = false, skipTasks = []) {
83
83
  const steps = [];
84
84
  if (!skipTasks.includes('check-types')) {
85
85
  steps.push({
@@ -114,10 +114,10 @@ class ValidatorMain {
114
114
  const result = await step.run();
115
115
  this.logger.console(result.message);
116
116
  results.push(result);
117
- if (result.code !== 0 && !continueOnError) return result;
117
+ if (result.code !== 0 && failFast) return result;
118
118
  }
119
119
 
120
- // When continueOnError is true, return the first error found, or success if all passed
120
+ // Return the first error found, or success if all passed
121
121
  const firstError = results.find(r => r.code !== 0);
122
122
  return firstError || results[results.length - 1];
123
123
  }
@@ -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","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(\n components: Component[],\n continueOnError = false,\n skipTasks: string[] = []\n ): 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 && !continueOnError) return result;\n }\n\n // When continueOnError is true, 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;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AAe,EAAEC,sBAAY,EAAEC,8BAAgB,EAAEC,sBAAY,EAAEC,sBAAY,CAAC;AAqJhHX,4BAAe,CAACY,UAAU,CAACvF,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,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAS,WAAA;EAAA,MAAAT,IAAA,GAAAC,OAAA;EAAAQ,UAAA,YAAAA,CAAA;IAAA,OAAAT,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAU,UA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AAM;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,24 +1,24 @@
1
1
  {
2
2
  "name": "@teambit/validator",
3
- "version": "0.0.148",
3
+ "version": "0.0.150",
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": "0.0.148"
9
+ "version": "0.0.150"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "4.1.2",
13
- "@teambit/cli": "0.0.1303",
14
13
  "@teambit/legacy.constants": "0.0.24",
15
- "@teambit/logger": "0.0.1396",
16
14
  "@teambit/harmony": "0.4.7",
17
- "@teambit/workspace": "1.0.913",
18
- "@teambit/component": "1.0.913",
19
- "@teambit/linter": "1.0.913",
20
- "@teambit/tester": "1.0.913",
21
- "@teambit/typescript": "1.0.913"
15
+ "@teambit/cli": "0.0.1304",
16
+ "@teambit/logger": "0.0.1397",
17
+ "@teambit/workspace": "1.0.914",
18
+ "@teambit/component": "1.0.914",
19
+ "@teambit/linter": "1.0.914",
20
+ "@teambit/tester": "1.0.914",
21
+ "@teambit/typescript": "1.0.914"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@teambit/harmony.envs.core-aspect-env": "0.1.4"