Skip to content

Commit

Permalink
fix: handle tsconfig.tsbuildinfo in clean, sync (#9415)
Browse files Browse the repository at this point in the history
Follow up to #9390. Previously,
framework sync would remove all of a package's dist, then rebuild it.
This meant the `tsconfig.tsbuildinfo` was removed too.

#9390 moved the `tsconfig.tsbuildinfo`, saving megabytes of space for
user's projects, but didn't update `yarn build:clean` or `yarn rwfw
project:sync`. This PR restores their behavior. Paired with
@Josh-Walker-GM on this one.
  • Loading branch information
jtoar committed Nov 16, 2023
1 parent 19f4349 commit 154173b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tasks/clean.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,8 @@ await rimraf('packages/**/dist', {
ignore: 'packages/**/{fixtures,__fixtures__}/**/dist',
},
})

// Remove all `tsconfig.tsbuildinfo` files.
await rimraf('packages/**/tsconfig.tsbuildinfo', {
glob: true,
})
5 changes: 5 additions & 0 deletions tasks/framework-tools/frameworkSyncToProject.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ const ignored = [
// esbuild emits meta.json files that we sometimes suffix.
/meta.(\w*\.?)json/,

/tsconfig.tsbuildinfo/,

(filePath) => IGNORE_EXTENSIONS.some((ext) => filePath.endsWith(ext)),
]

Expand Down Expand Up @@ -241,6 +243,9 @@ async function main() {
try {
logStatus(`Cleaning ${c.magenta(packageName)}...`)
await rimraf(path.join(path.dirname(packageJsonPath), 'dist'))
await rimraf(
path.join(path.dirname(packageJsonPath), 'tsconfig.tsbuildinfo')
)

logStatus(`Building ${c.magenta(packageName)}...`)
execSync('yarn build', {
Expand Down

0 comments on commit 154173b

Please sign in to comment.