The generated declaration file eui.d.ts is exposing some utility functions used only for tests like takeMountedSnapshot
declare module '@elastic/eui/src/test/take_mounted_snapshot' {
import { ReactWrapper } from 'enzyme';
import { Component } from 'react';
export const takeMountedSnapshot: (mountedComponent: ReactWrapper<{}, {}, Component<{}, {}, any>>) => ChildNode | null;
}
This requires to declare @types/enzyme in the deps instead of devDeps as you also noticed here: #2828
Do we really need these test utility to be exported as part of the public API?
I’m asking because this dependency can and is creating some resolution conflicts within @elastic/charts because of two different versions of @types/react. I've solved that updating reacts types here and there, but I think it can be also cleanly solved if EUI exposes only its own types.
In elastic-charts we are using to mark the dependencies we don't want in the generated files as @internals and use stripInternals in the tsconfig.json (it's something that at the moment is not documented, I don't have an idea on why it's not on the TS documentation anymore).
Some cleanup can also be possible with the other @types you have moved under deps
@chandlerprall @thompsongl
The generated declaration file
eui.d.tsis exposing some utility functions used only for tests liketakeMountedSnapshotThis requires to declare
@types/enzymein thedepsinstead ofdevDepsas you also noticed here: #2828Do we really need these test utility to be exported as part of the public API?
I’m asking because this dependency can and is creating some resolution conflicts within @elastic/charts because of two different versions of @types/react. I've solved that updating reacts types here and there, but I think it can be also cleanly solved if EUI exposes only its own types.
In elastic-charts we are using to mark the dependencies we don't want in the generated files as
@internalsand usestripInternalsin thetsconfig.json(it's something that at the moment is not documented, I don't have an idea on why it's not on the TS documentation anymore).Some cleanup can also be possible with the other
@typesyou have moved underdeps@chandlerprall @thompsongl