rsnext/test/integration/typescript-app-type-declarations
Chris Lloyd 52c2f8b4dd
Avoid fs write next-env.d.ts on read-only filesystems (#28206)
Next.js currently writes the TS type declarations on startup, regardless of the existing content of the file. This is good for ensuring the file content stays consistent. However, if the file content is already correct, this will perform an unnessecary write.

When running Next in read-only filesystems (such as the Bazel sandbox) this can cause the build to fail even if the content of the type declaration file is already correct.

This fixes this by only writing the contents of the file if the current contents don't match.

## Test Plan

Added an integration test for the general behavior of writing `next-env.d.ts`.
2021-08-18 00:41:51 +00:00
..
pages Avoid fs write next-env.d.ts on read-only filesystems (#28206) 2021-08-18 00:41:51 +00:00
test Avoid fs write next-env.d.ts on read-only filesystems (#28206) 2021-08-18 00:41:51 +00:00
next-env.d.ts Avoid fs write next-env.d.ts on read-only filesystems (#28206) 2021-08-18 00:41:51 +00:00
tsconfig.json Avoid fs write next-env.d.ts on read-only filesystems (#28206) 2021-08-18 00:41:51 +00:00