You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When certain TS errors are encountered while compiling a module, the /dist/types/*.d.ts file may omit interfaces, or be missing entirely. Neither npm run-script problems or npm test ends up catching this, making it very easy to release broken library versions.
Run npm run-script problems & npm run-script build (note it exits successfully)
Check the contents of /dist/types. It will be empty
Change /src/index.ts
- type WithHello<T> = T & { hello: 'world' };+ export type WithHello<T> = T & { hello: 'world' };
Run npm run-script problems & npm run-script build (note it exits successfully)
Check the contents of /dist/types. It will contain the appropriate interfaces/types
This particular TS error is more likely to slip through -- it won't cause tests to fail. I suggest we either make npm run-script problems detect this kind of thing, or hard fail in the presence of any error that could result in incomplete output.
The text was updated successfully, but these errors were encountered:
mike-north
changed the title
It's very easy to accidentally release libs with missing .d.ts
It's very easy to accidentally release libs with missing types
Jul 27, 2018
When certain TS errors are encountered while compiling a module, the
/dist/types/*.d.ts
file may omit interfaces, or be missing entirely. Neithernpm run-script problems
ornpm test
ends up catching this, making it very easy to release broken library versions.To reproduce:
/src/index.ts
npm run-script problems & npm run-script build
(note it exits successfully)/dist/types
. It will be empty/src/index.ts
npm run-script problems & npm run-script build
(note it exits successfully)/dist/types
. It will contain the appropriate interfaces/typesThis particular TS error is more likely to slip through -- it won't cause tests to fail. I suggest we either make
npm run-script problems
detect this kind of thing, or hard fail in the presence of any error that could result in incomplete output.The text was updated successfully, but these errors were encountered: