Skip to content

Commit

Permalink
feat: add rewriting jsconfig to tsconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
jordan-a-young committed Nov 14, 2024
1 parent c96de53 commit 7942f81
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/workflow-upgrade/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,18 @@ module.exports = async (cwd) => {
fs.unlinkSync(yarnLock);
}

const jsconfigPath = path.join(cwd, 'jsconfig.json');
const hasJsconfig = fs.existsSync(jsconfigPath);

if (hasJsconfig) {
// Copy jsconfig into tsconfig
const jsconfigData = fs.readFileSync(jsconfigPath);
fs.writeFileSync(jsconfigData, `${JSON.stringify(pkg, null, 2)}\n`, 'utf8');

// Delete jsconfig
fs.unlinkSync(jsconfigPath);
}

// Delete node_modules
Logger.info('Deleting node_modules...');
rimraf.sync(path.join(cwd, 'node_modules'));
Expand Down

0 comments on commit 7942f81

Please sign in to comment.