Skip to content

Commit

Permalink
Upgrade to TypeScript 5.3, emit incremental build info for faster sub…
Browse files Browse the repository at this point in the history
…sequent type checking (#938)
  • Loading branch information
askoufis committed Mar 21, 2024
1 parent cc5750f commit 01c0015
Show file tree
Hide file tree
Showing 6 changed files with 144 additions and 105 deletions.
9 changes: 9 additions & 0 deletions .changeset/late-seahorses-worry.md
@@ -0,0 +1,9 @@
---
'sku': minor
---

Update TypeScript to 5.3

This release includes breaking changes. See the [TypeScript 5.3 announcement] for more information.

[TypeScript 5.3 announcement]: https://devblogs.microsoft.com/typescript/announcing-typescript-5-3/
5 changes: 5 additions & 0 deletions .changeset/real-vans-care.md
@@ -0,0 +1,5 @@
---
'sku': patch
---

Emit incremental TypeScript build info for faster subsequent type checking
10 changes: 7 additions & 3 deletions packages/sku/config/typescript/tsconfig.js
Expand Up @@ -4,11 +4,15 @@ const { rootResolution, tsconfigDecorator } = require('../../context');
module.exports = () => {
const config = {
compilerOptions: {
// This flag allows tsc to be invoked directly by VS Code (via Cmd+Shift+B),
// otherwise it would emit a bunch of useless JS/JSX files in your project.
// We emit compiled JavaScript into `dist` via webpack + Babel, not tsc.
// Don't compile anything, only perform type checking
noEmit: true,

// Emit build information for faster subsequent type checking
incremental: true,
// Emit build information to `node_modules` to avoid bloating the project root
// and ignore files
outDir: 'node_modules',

// Fixes https://github.com/cypress-io/cypress/issues/1087
skipLibCheck: true,

Expand Down
28 changes: 12 additions & 16 deletions packages/sku/lib/configure.js
Expand Up @@ -32,27 +32,23 @@ const writeFileToCWD = async (fileName, content, { banner = true } = {}) => {
};

module.exports = async () => {
// Ignore webpack bundle report output
// Ignore target directories
const webpackTargetDirectory = addSep(
paths.target.replace(addSep(cwd()), ''),
);
const storybookTargetDirectory = addSep(
paths.storybookTarget.replace(addSep(cwd()), ''),
);

const gitIgnorePatterns = [
// Ignore webpack bundle report output
addSep(bundleReportFolder),
addSep(coverageFolder),
webpackTargetDirectory,
storybookTargetDirectory,
storybookMainConfigPath,
];
const lintIgnorePatterns = [
addSep(bundleReportFolder),
addSep(coverageFolder),
'*.less.d.ts',
storybookMainConfigPath,
];

// Ignore webpack target directories
const targetDirectory = addSep(paths.target.replace(addSep(cwd()), ''));
const storybookTargetDirectory = addSep(
paths.storybookTarget.replace(addSep(cwd()), ''),
);

gitIgnorePatterns.push(targetDirectory, storybookTargetDirectory);
lintIgnorePatterns.push(targetDirectory, storybookTargetDirectory);
const lintIgnorePatterns = [...gitIgnorePatterns, '*.less.d.ts'];

// Generate ESLint configuration
const eslintConfigFilename = '.eslintrc';
Expand Down
2 changes: 1 addition & 1 deletion packages/sku/package.json
Expand Up @@ -117,7 +117,7 @@
"svgo-loader": "^4.0.0",
"terser-webpack-plugin": "^5.1.4",
"tree-kill": "^1.2.1",
"typescript": "~5.2.0",
"typescript": "~5.3.0",
"validate-npm-package-name": "^5.0.0",
"webpack": "^5.52.0",
"webpack-bundle-analyzer": "^4.6.1",
Expand Down

0 comments on commit 01c0015

Please sign in to comment.