Skip to content

Commit ca5e7a0

Browse files
Merge pull request #1143 from bryceosterhaus/LPS-186142
fix(npm-scripts): wipe the tsbuildinfo file to ensure consistent types
2 parents 011a5ec + 6d892a7 commit ca5e7a0

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

projects/npm-tools/packages/npm-scripts/src/scripts/types.js

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* SPDX-License-Identifier: BSD-3-Clause
44
*/
55

6-
const fs = require('fs');
76
const path = require('path');
87

98
const getTypeScriptBuildOrder = require('../typescript/getTypeScriptBuildOrder');
@@ -42,18 +41,6 @@ async function types() {
4241
try {
4342
process.chdir(directory);
4443

45-
const buildInfoPath = path.join(
46-
process.cwd(),
47-
'tmp',
48-
'tsconfig.tsbuildinfo'
49-
);
50-
51-
// Remove previous type information to ensure a consistent build
52-
53-
if (fs.existsSync(buildInfoPath)) {
54-
fs.unlinkSync(buildInfoPath);
55-
}
56-
5744
const config = getMergedConfig('npmscripts');
5845

5946
const {build: BUILD_CONFIG} = config;

projects/npm-tools/packages/npm-scripts/src/typescript/runTSC.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,18 @@ async function runTSC() {
3333

3434
const config = configureTypeScript(graph);
3535

36+
const buildInfoPath = path.join(
37+
process.cwd(),
38+
'tmp',
39+
'tsconfig.tsbuildinfo'
40+
);
41+
42+
// Remove previous type information to ensure a consistent build
43+
44+
if (fs.existsSync(buildInfoPath)) {
45+
fs.unlinkSync(buildInfoPath);
46+
}
47+
3648
spawnSync('tsc', ['--emitDeclarationOnly']);
3749

3850
// Format the generated files, because: https://git.io/JYNZp

0 commit comments

Comments
 (0)