Unverified Commit 21f4c9f4 authored by Tim Neutkens's avatar Tim Neutkens Committed by GitHub

Development: Move all TypeScript related work in watcher together (#83912)

## What?

Work in progress. Checking if tests fail.

Moving these `.d.ts` file writes and TS checks together so that they can
be moved to not block in a follow-up PR.
parent 4d047b28
...@@ -406,7 +406,7 @@ export default abstract class Server< ...@@ -406,7 +406,7 @@ export default abstract class Server<
protected abstract loadEnvConfig(params: { protected abstract loadEnvConfig(params: {
dev: boolean dev: boolean
forceReload?: boolean forceReload: boolean
}): void }): void
// TODO-APP: (wyattjoh): Make protected again. Used for turbopack in route-resolver.ts right now. // TODO-APP: (wyattjoh): Make protected again. Used for turbopack in route-resolver.ts right now.
...@@ -448,7 +448,7 @@ export default abstract class Server< ...@@ -448,7 +448,7 @@ export default abstract class Server<
this.dir = path.resolve(/* turbopackIgnore: true */ dir) this.dir = path.resolve(/* turbopackIgnore: true */ dir)
this.quiet = quiet this.quiet = quiet
this.loadEnvConfig({ dev }) this.loadEnvConfig({ dev, forceReload: false })
// TODO: should conf be normalized to prevent missing // TODO: should conf be normalized to prevent missing
// values from causing issues as this can be user provided // values from causing issues as this can be user provided
......
...@@ -40,8 +40,7 @@ export {}` ...@@ -40,8 +40,7 @@ export {}`
try { try {
// we expect the types directory to already exist // we expect the types directory to already exist
const envDtsPath = join(distDir, 'types', 'env.d.ts') const envDtsPath = join(distDir, 'types', 'env.d.ts')
// do not await, this is not essential for further process await writeFile(envDtsPath, definitionStr, 'utf-8')
writeFile(envDtsPath, definitionStr, 'utf-8')
} catch (e) { } catch (e) {
console.error('Failed to write env.d.ts:', e) console.error('Failed to write env.d.ts:', e)
} }
......
...@@ -434,17 +434,20 @@ export default class NextNodeServer extends BaseServer< ...@@ -434,17 +434,20 @@ export default class NextNodeServer extends BaseServer<
protected loadEnvConfig({ protected loadEnvConfig({
dev, dev,
forceReload, forceReload,
silent,
}: { }: {
dev: boolean dev: boolean
forceReload?: boolean forceReload: boolean
silent?: boolean
}) { }) {
loadEnvConfig( loadEnvConfig(
this.dir, this.dir,
dev, dev,
silent ? { info: () => {}, error: () => {} } : Log, Log,
forceReload,
forceReload forceReload
? (envFilePath) => {
Log.info(`Reload env: ${envFilePath}`)
}
: undefined
) )
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment