Skip to content

Commit

Permalink
chore(tsconfig.types-cjs): Specify tsBuildInfoFile location (#10950)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobbe committed Jul 15, 2024
1 parent c1db834 commit d468192
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 11 deletions.
3 changes: 2 additions & 1 deletion packages/auth/tsconfig.types-cjs.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "./tsconfig.build.json",
"compilerOptions": {
"outDir": "dist/cjs"
"outDir": "dist/cjs",
"tsBuildInfoFile": "./tsconfig.types-cjs.tsbuildinfo"
}
}
5 changes: 3 additions & 2 deletions packages/project-config/tsconfig.types-cjs.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "dist/cjs",
"tsBuildInfoFile": "tsconfig.types-cjs.tsbuildinfo",
"module": "commonjs",
"moduleResolution": "node",
},
"moduleResolution": "node"
}
}
3 changes: 1 addition & 2 deletions packages/web/tsconfig.types-cjs.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"extends": "./tsconfig.build.json",
"compilerOptions": {
"outDir": "dist/cjs",
"module": "commonjs",
"moduleResolution": "node"
"tsBuildInfoFile": "tsconfig.types-cjs.tsbuildinfo"
}
}
4 changes: 4 additions & 0 deletions tasks/clean.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,7 @@ await rimraf('packages/**/tsconfig.tsbuildinfo', {
await rimraf('packages/**/tsconfig.build.tsbuildinfo', {
glob: true,
})

await rimraf('packages/**/tsconfig.types-cjs.tsbuildinfo', {
glob: true,
})
22 changes: 16 additions & 6 deletions tasks/framework-tools/frameworkSyncToProject.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ const ignored = [

/tsconfig.tsbuildinfo/,
/tsconfig.build.tsbuildinfo/,
/tsconfig.types-cjs.tsbuildinfo/,

(filePath) => IGNORE_EXTENSIONS.some((ext) => filePath.endsWith(ext)),
]
Expand Down Expand Up @@ -124,7 +125,7 @@ async function main() {
c.bgYellow(c.black('Heads up ')),
'',
"If this failed because Nx couldn't find its package.json file in node_modules, it's a known issue. The workaround is just trying again.",
].join('\n')
].join('\n'),
)
return
}
Expand All @@ -140,11 +141,11 @@ async function main() {
// Save the project's package.json so that we can restore it when this process exits.
const redwoodProjectPackageJsonPath = path.join(
redwoodProjectPath,
'package.json'
'package.json',
)
const redwoodProjectPackageJson = fs.readFileSync(
redwoodProjectPackageJsonPath,
'utf-8'
'utf-8',
)

const viteConfigPath = resolveViteConfigPath(redwoodProjectPath)
Expand Down Expand Up @@ -243,7 +244,7 @@ async function main() {
`${c.red('Warning:')} You modified a package.json file.`,
`If you've modified the ${c.underline('dependencies')}`,
`then you must run ${c.underline('yarn rwfw project:sync')} again.`,
].join(' ')
].join(' '),
)
}

Expand All @@ -256,7 +257,16 @@ async function main() {
logStatus(`Cleaning ${c.magenta(packageName)}...`)
await rimraf(path.join(path.dirname(packageJsonPath), 'dist'))
await rimraf(
path.join(path.dirname(packageJsonPath), 'tsconfig.tsbuildinfo')
path.join(path.dirname(packageJsonPath), 'tsconfig.tsbuildinfo'),
)
await rimraf(
path.join(path.dirname(packageJsonPath), 'tsconfig.build.tsbuildinfo'),
)
await rimraf(
path.join(
path.dirname(packageJsonPath),
'tsconfig.types-cjs.tsbuildinfo',
),
)

logStatus(`Building ${c.magenta(packageName)}...`)
Expand Down Expand Up @@ -324,7 +334,7 @@ function createCleanUp({
"- remove your project's node_modules directory",
"- run 'yarn install'",
'',
].join('\n')
].join('\n'),
)

cleanedUp = true
Expand Down

0 comments on commit d468192

Please sign in to comment.