Skip to content

Commit

Permalink
fix: require typescript@^3.8.0 for build: true mode (#672)
Browse files Browse the repository at this point in the history
SolutionBuilder API is buggy for TypeScript < 3.8.0. To reduce maintenance burden, we bump minimal TypeScript version for { build: true } mode to 3.8.0.

BREAKING CHANGE: 馃Ж Minimal version of TypeScript with { build: true } mode changed from 3.6.0 to 3.8.0
  • Loading branch information
piotr-oles committed Oct 24, 2021
1 parent ad466df commit 871bfe8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/typescript-reporter/TypeScriptSupport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ function assertTypeScriptSupport(configuration: TypeScriptReporterConfiguration)
].join(os.EOL)
);
}
if (configuration.build && semver.lt(typescriptVersion, '3.8.0')) {
throw new Error(
[
`ForkTsCheckerWebpackPlugin doesn't support build option for the current typescript version of ${typescriptVersion}.`,
'The minimum required version is 3.8.0.',
].join(os.EOL)
);
}

if (!fs.existsSync(configuration.configFile)) {
throw new Error(
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/TypeScriptSolutionBuilderApi.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import semver from 'semver';

describe('TypeScript SolutionBuilder API', () => {
it.each([
{ async: false, typescript: '~3.6.0', mode: 'readonly' },
{ async: false, typescript: '~3.8.0', mode: 'readonly' },
{ async: true, typescript: '~3.8.0', mode: 'write-tsbuildinfo' },
{ async: false, typescript: '~4.0.0', mode: 'write-references' },
{ async: true, typescript: '~4.3.0', mode: 'readonly' },
Expand Down

0 comments on commit 871bfe8

Please sign in to comment.