Skip to content

Commit

Permalink
Merge pull request #1143 from bryceosterhaus/LPS-186142
Browse files Browse the repository at this point in the history
fix(npm-scripts): wipe the tsbuildinfo file to ensure consistent types
  • Loading branch information
bryceosterhaus authored Jun 20, 2023
2 parents 011a5ec + 6d892a7 commit ca5e7a0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
13 changes: 0 additions & 13 deletions projects/npm-tools/packages/npm-scripts/src/scripts/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* SPDX-License-Identifier: BSD-3-Clause
*/

const fs = require('fs');
const path = require('path');

const getTypeScriptBuildOrder = require('../typescript/getTypeScriptBuildOrder');
Expand Down Expand Up @@ -42,18 +41,6 @@ async function types() {
try {
process.chdir(directory);

const buildInfoPath = path.join(
process.cwd(),
'tmp',
'tsconfig.tsbuildinfo'
);

// Remove previous type information to ensure a consistent build

if (fs.existsSync(buildInfoPath)) {
fs.unlinkSync(buildInfoPath);
}

const config = getMergedConfig('npmscripts');

const {build: BUILD_CONFIG} = config;
Expand Down
12 changes: 12 additions & 0 deletions projects/npm-tools/packages/npm-scripts/src/typescript/runTSC.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,18 @@ async function runTSC() {

const config = configureTypeScript(graph);

const buildInfoPath = path.join(
process.cwd(),
'tmp',
'tsconfig.tsbuildinfo'
);

// Remove previous type information to ensure a consistent build

if (fs.existsSync(buildInfoPath)) {
fs.unlinkSync(buildInfoPath);
}

spawnSync('tsc', ['--emitDeclarationOnly']);

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

0 comments on commit ca5e7a0

Please sign in to comment.