## Description This PR improves the developer experience for the `twenty-sdk` and `create-twenty-app` packages by reorganizing commands, adding development tooling, and improving documentation. ## Changes ### twenty-sdk #### Command Refactoring - **Renamed `app-watch` → `app-dev`**: Renamed `AppWatchCommand` to `AppDevCommand` and moved to `app-dev.ts` for consistent naming with the CLI command `app:dev` - **Moved `app-add` → `entity-add`**: Relocated entity creation logic from `app/app-add.ts` to `entity/entity-add.ts` and renamed `AppAddCommand` to `EntityAddCommand` for better separation of concerns #### Development Tooling - **Added `dev` target**: New Nx target `npx nx run twenty-sdk:dev` that runs the build in watch mode for faster development iteration ### create-twenty-app #### Improved Scaffolded Project - **Enhanced base-application README** with: - Updated Getting Started to recommend `yarn dev` for development - Added "Available Commands" section listing all available scripts #### Better Onboarding - **Improved success message** after app creation with formatted next steps:
113 lines
2.5 KiB
JSON
113 lines
2.5 KiB
JSON
{
|
|
"name": "twenty-sdk",
|
|
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
|
"sourceRoot": "packages/twenty-sdk/src",
|
|
"projectType": "library",
|
|
"tags": [
|
|
"scope:sdk"
|
|
],
|
|
"targets": {
|
|
"build": {
|
|
"dependsOn": [
|
|
"generateBarrels",
|
|
"^build"
|
|
],
|
|
"outputs": [
|
|
"{projectRoot}/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/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",
|
|
"options": {
|
|
"cwd": "packages/twenty-sdk",
|
|
"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"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|