Skip to content

Commit

Permalink
feat(build): support typescript v5.3 (#114)
Browse files Browse the repository at this point in the history
Release-as: 0.8.4
  • Loading branch information
ValeraS authored Jan 3, 2024
1 parent 50f0755 commit 7de7c87
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
"terser-webpack-plugin": "5.3.9",
"ts-node": "10.9.1",
"tslib": "^2.6.2",
"typescript": "^5.2.2",
"typescript": "^5.3.3",
"webpack": "^5.88.2",
"webpack-assets-manifest": "^5.1.0",
"webpack-bundle-analyzer": "^4.9.1",
Expand Down
4 changes: 2 additions & 2 deletions src/common/typescript/compile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ export function compile(
logger.verbose("We're about to create the program");
const compilerHost = ts.createCompilerHost(parsedConfig.options);
compilerHost.readFile = displayFilename(compilerHost.readFile, 'Reading', logger);
// @ts-ignore
// @ts-expect-error
compilerHost.readFile.enableDisplay();
const program = ts.createProgram(parsedConfig.fileNames, parsedConfig.options, compilerHost);
// @ts-ignore
// @ts-expect-error
const filesCount = compilerHost.readFile.disableDisplay();
const allDiagnostics = ts.getPreEmitDiagnostics(program).slice();
logger.verbose(`Program created, read ${filesCount} files`);
Expand Down
6 changes: 3 additions & 3 deletions src/common/typescript/transformers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ function updateImportDeclaration(
node.modifiers,
node.importClause,
context.factory.createStringLiteral(resolvedPath),
node.assertClause,
node.attributes || node.assertClause,
);
}

Expand Down Expand Up @@ -173,7 +173,7 @@ function updateExportDeclaration(
node.isTypeOnly,
node.exportClause,
context.factory.createStringLiteral(resolvedPath),
node.assertClause,
node.attributes || node.assertClause,
);
}

Expand All @@ -199,7 +199,7 @@ function updateImportTypeNode(
return context.factory.updateImportTypeNode(
node,
context.factory.createLiteralTypeNode(context.factory.createStringLiteral(resolvedPath)),
node.assertions,
node.attributes || (node.assertions as any),
node.qualifier,
node.typeArguments,
node.isTypeOf,
Expand Down
4 changes: 2 additions & 2 deletions src/common/typescript/watch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ export function watch(
'createProgram',
() => {
logger.verbose("We're about to create the program");
// @ts-ignore
// @ts-expect-error
host.readFile.enableDisplay();
},
() => {
// @ts-ignore
// @ts-expect-error
const count = host.readFile.disableDisplay();
logger.verbose(`Program created, read ${count} files`);
},
Expand Down

0 comments on commit 7de7c87

Please sign in to comment.