[FEAT] Generate barrel export named modules and types (#11110)
# Introduction In this PR using the Ts AST dynamically compute what to export, gathering non-runtime types and interface in an `export type` [Export type TypeScript documentation](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html) From ```ts // index.ts export * from "submodule" ``` To ```ts export type { SomeType } from "submodule"; export { SomeFunction, SomeConst } from "submodule"; ``` close https://github.com/twentyhq/core-team-issues/issues/644 ## Motivations - Most explicit and maintainable - Best for tree-shaking - Clear dependency tracking - Prevents name collisions ## Important note Please keep in mind that I will create, very soon, a dedicated `generate-barrel` package in our yarn workspaces in order to: - Make it reusable for twenty-ui - Split in several files - Setup lint + tsconfig - Add tests ## Conclusion As usual any suggestions are more than welcomed !
This commit is contained in:
@ -7,4 +7,4 @@
|
||||
* |___/
|
||||
*/
|
||||
|
||||
export * from './types/EachTestingContext.type';
|
||||
export type { EachTestingContext } from './types/EachTestingContext.type';
|
||||
|
||||
Reference in New Issue
Block a user