[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:
Paul Rastoin
2025-03-24 15:06:16 +01:00
committed by GitHub
parent e6dec51ca6
commit 8b2a90dea1
7 changed files with 282 additions and 123 deletions

View File

@ -7,4 +7,4 @@
* |___/
*/
export * from './types/EachTestingContext.type';
export type { EachTestingContext } from './types/EachTestingContext.type';