chore: add script to generate twenty-ui barrels before build (#4707)

Split from https://github.com/twentyhq/twenty/pull/4518

Part of #4766 

Adds a script to auto-generate twenty-ui exports in `index.ts` files.

---------

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
This commit is contained in:
Thaïs
2024-04-04 12:14:20 +02:00
committed by GitHub
parent bf8ee99ebb
commit 932a8d68f5
9 changed files with 145 additions and 10 deletions

View File

@ -5,10 +5,19 @@
"projectType": "library",
"targets": {
"build": {
"executor": "@nx/vite:build",
"outputs": ["{options.outputPath}"],
"dependsOn": ["^build", "generateBarrels"]
},
"generateBarrels": {
"executor": "nx:run-commands",
"cache": true,
"inputs": [
"{projectRoot}/src/**/*.{ts,tsx}",
"!{projectRoot}/src/**/*.(spec|test).{ts,tsx}",
"!{projectRoot}/src/**/*.stories.{ts,tsx}"
],
"outputs": ["{projectRoot}/src/index.ts", "{projectRoot}/src/*/index.ts"],
"options": {
"outputPath": "packages/twenty-ui/dist"
"command": "npx ts-node --esm {projectRoot}/scripts/generateBarrels.ts"
}
},
"lint": {