Skip to content

Commit

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

redwoodjs#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 authored Nov 13, 2023
1 parent e4f0f89 commit d8266e5
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 @@ -252,6 +254,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 d8266e5

Please sign in to comment.