9b8eacb7f7
- An app will declare its `twenty-sdk` version in the manifest. - `twenty-sdk` will be served by a CDN to be imported in front component host. - When we render the host we will load twenty-ui through the correct version of the sdk We will proceed this way because twenty-ui is not mature enough yet to be deployed as its own package. So instead, since the sdk is already deployed as its own package, we will serve the ui with it. It allows us to have versioning to handle breaking changes in twenty-ui.
113 lines
3.1 KiB
JSON
113 lines
3.1 KiB
JSON
{
|
|
"name": "twenty-sdk",
|
|
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
|
"sourceRoot": "packages/twenty-sdk/src",
|
|
"projectType": "library",
|
|
"tags": ["scope:sdk", "scope:shared"],
|
|
"targets": {
|
|
"build": {
|
|
"dependsOn": ["generateBarrels", "^build"],
|
|
"outputs": [
|
|
"{projectRoot}/dist",
|
|
"{projectRoot}/front-component/package.json",
|
|
"{projectRoot}/front-component/dist",
|
|
"{projectRoot}/front-component-constants/package.json",
|
|
"{projectRoot}/front-component-constants/dist",
|
|
"{projectRoot}/ui/package.json",
|
|
"{projectRoot}/ui/dist"
|
|
]
|
|
},
|
|
"dev": {
|
|
"executor": "nx:run-commands",
|
|
"dependsOn": ["generateBarrels", "^build"],
|
|
"options": {
|
|
"cwd": "packages/twenty-sdk",
|
|
"command": "npx rimraf dist && npx vite build --watch"
|
|
}
|
|
},
|
|
"start": {
|
|
"executor": "nx:run-commands",
|
|
"dependsOn": ["build"],
|
|
"options": {
|
|
"cwd": "packages/twenty-sdk",
|
|
"command": "node dist/cli.cjs"
|
|
}
|
|
},
|
|
"generateBarrels": {
|
|
"executor": "nx:run-commands",
|
|
"cache": true,
|
|
"inputs": ["production", "{projectRoot}/scripts/generateBarrels.ts"],
|
|
"outputs": [
|
|
"{projectRoot}/src/index.ts",
|
|
"{projectRoot}/src/*/index.ts",
|
|
"{projectRoot}/package.json"
|
|
],
|
|
"options": {
|
|
"command": "tsx {projectRoot}/scripts/generateBarrels.ts"
|
|
}
|
|
},
|
|
"typecheck": {},
|
|
"lint": {
|
|
"options": {
|
|
"lintFilePatterns": ["{projectRoot}/src/**/*.{ts,json}"],
|
|
"maxWarnings": 0
|
|
},
|
|
"configurations": {
|
|
"ci": {
|
|
"lintFilePatterns": ["{projectRoot}/src/**/*.{ts,json}"],
|
|
"maxWarnings": 0
|
|
},
|
|
"fix": {}
|
|
}
|
|
},
|
|
"test": {
|
|
"executor": "@nx/vitest:test",
|
|
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
|
|
"options": {
|
|
"config": "{projectRoot}/vitest.config.ts"
|
|
},
|
|
"configurations": {
|
|
"ci": {
|
|
"coverage": true,
|
|
"watch": false
|
|
}
|
|
}
|
|
},
|
|
"test:unit": {
|
|
"executor": "nx:run-commands",
|
|
"options": {
|
|
"cwd": "packages/twenty-sdk",
|
|
"command": "npx vitest run --config vitest.unit.config.ts"
|
|
}
|
|
},
|
|
"test:integration": {
|
|
"executor": "nx:run-commands",
|
|
"options": {
|
|
"cwd": "packages/twenty-sdk",
|
|
"command": "npx wait-on http://localhost:3000/healthz --timeout 600000 --interval 1000 --log && npx vitest run --config vitest.integration.config.ts"
|
|
}
|
|
},
|
|
"test:e2e": {
|
|
"executor": "nx:run-commands",
|
|
"options": {
|
|
"cwd": "packages/twenty-sdk",
|
|
"commands": [
|
|
"npx wait-on http://localhost:3000/healthz --timeout 600000 --interval 1000 --log && NODE_ENV=test npx vitest run --config ./vitest.e2e.config.ts"
|
|
]
|
|
},
|
|
"parallel": false,
|
|
"dependsOn": [
|
|
"build",
|
|
{
|
|
"target": "database:reset",
|
|
"projects": "twenty-server"
|
|
},
|
|
{
|
|
"target": "start:ci-if-needed",
|
|
"projects": "twenty-server"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|