mirror of
https://github.com/twentyhq/twenty
synced 2026-04-21 13:37:22 +00:00
# Introduction Important note: for the moment testing this locally will require some hack due to latest twenty-sdk not being published. You will need to build twenty-cli and `cd packages/twenty-cli && yarn link` To finally sync the app in your app folder as `cd app-folder && twenty app sync` close https://github.com/twentyhq/core-team-issues/issues/1863 In this PR is introduced the generate sdk programmatic call to [genql](https://genql.dev/) exposed in a `client` barrel of `twenty-sdk` located in this package as there's high chances that will add a codegen layer above it at some point ? The cli calls this method after a sync application and writes a client in a generated folder. It will make a graql introspection query on the whole workspace. We should later improve that and only filter by current applicationId and its dependencies ( when twenty-standard application is introduced ) Fully typesafe ( input, output, filters etc ) auto-completed client ## Hello-world app serverless refactor <img width="2480" height="1326" alt="image" src="https://github.com/user-attachments/assets/b18ea372-b21d-4560-8fbc-1dc348427a95" /> --------- Co-authored-by: martmull <martmull@hotmail.fr>
102 lines
2.6 KiB
JSON
102 lines
2.6 KiB
JSON
{
|
|
"name": "twenty-cli",
|
|
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
|
"projectType": "application",
|
|
"tags": ["scope:cli"],
|
|
"targets": {
|
|
"before-build": {
|
|
"executor": "nx:run-commands",
|
|
"cache": true,
|
|
"options": {
|
|
"cwd": "packages/twenty-cli",
|
|
"commands": ["rimraf dist", "tsc --project tsconfig.lib.json"]
|
|
},
|
|
"dependsOn": ["^build"]
|
|
},
|
|
"build": {
|
|
"executor": "nx:run-commands",
|
|
"cache": true,
|
|
"options": {
|
|
"cwd": "packages/twenty-cli",
|
|
"commands": [
|
|
"cp -R src/constants/base-application-project dist/constants",
|
|
"cp -R src/constants/schemas dist/constants"
|
|
]
|
|
},
|
|
"dependsOn": ["before-build"]
|
|
},
|
|
"dev": {
|
|
"executor": "nx:run-commands",
|
|
"dependsOn": ["build"],
|
|
"options": {
|
|
"cwd": "packages/twenty-cli",
|
|
"command": "tsx src/cli.ts"
|
|
}
|
|
},
|
|
"start": {
|
|
"executor": "nx:run-commands",
|
|
"dependsOn": ["build"],
|
|
"options": {
|
|
"cwd": "packages/twenty-cli",
|
|
"command": "node dist/cli.js"
|
|
}
|
|
},
|
|
"typecheck": {
|
|
"executor": "nx:run-commands",
|
|
"options": {
|
|
"cwd": "packages/twenty-cli",
|
|
"command": "tsc --noEmit --project tsconfig.lib.json"
|
|
},
|
|
"dependsOn": ["build"]
|
|
},
|
|
"lint": {
|
|
"options": {
|
|
"lintFilePatterns": ["{projectRoot}/src/**/*.{ts,json}"],
|
|
"maxWarnings": 0
|
|
},
|
|
"configurations": {
|
|
"ci": {
|
|
"lintFilePatterns": ["{projectRoot}/src/**/*.{ts,json}"],
|
|
"maxWarnings": 0
|
|
},
|
|
"fix": {}
|
|
}
|
|
},
|
|
"test": {
|
|
"executor": "@nx/jest:jest",
|
|
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
|
|
"options": {
|
|
"jestConfig": "{projectRoot}/jest.config.mjs"
|
|
},
|
|
"configurations": {
|
|
"ci": {
|
|
"ci": true,
|
|
"coverage": true,
|
|
"watchAll": false
|
|
}
|
|
}
|
|
},
|
|
"test:e2e": {
|
|
"executor": "nx:run-commands",
|
|
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
|
|
"options": {
|
|
"cwd": "packages/twenty-cli",
|
|
"commands": [
|
|
"npx wait-on http://localhost:3000/healthz --timeout 600000 --interval 1000 --log && NODE_ENV=test npx jest --config ./jest.e2e.config.ts"
|
|
]
|
|
},
|
|
"parallel": false,
|
|
"dependsOn": [
|
|
"build",
|
|
{
|
|
"target": "database:reset",
|
|
"projects": "twenty-server"
|
|
},
|
|
{
|
|
"target": "start:ci-if-needed",
|
|
"projects": "twenty-server"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|