## Add API client generation to SDK dev mode and refactor orchestrator into step-based pipeline ### Why The SDK dev mode lacked typed API client generation, forcing developers to work without auto-generated GraphQL types when building applications. Additionally, the orchestrator was a monolithic class that mixed watcher management, token handling, and sync logic — making it difficult to extend with new steps like client generation. ### How - **Refactored the orchestrator** into a step-based pipeline with dedicated classes: `CheckServer`, `EnsureValidTokens`, `ResolveApplication`, `BuildManifest`, `UploadFiles`, `GenerateApiClient`, `SyncApplication`, and `StartWatchers`. Each step has typed input/output/status, managed by a new `OrchestratorState` class. - **Added `GenerateApiClientOrchestratorStep`** that detects object/field schema changes and regenerates a typed GraphQL client (via `@genql/cli`) into `node_modules/twenty-sdk/generated` for seamless imports. - **Replaced `checkApplicationExist`** with `findOneApplication` on both server resolver and SDK API service, returning the entity data instead of a boolean. - **Added application token pair mutations** (`generateApplicationToken`, `renewApplicationToken`) to the API service, with the server now returning `ApplicationTokenPairDTO` containing both access and refresh tokens. - **Restructured the dev UI** into `dev/ui/components/` with dedicated panel, section, and event log components. - **Simplified `AppDevCommand`** from ~180 lines of watcher management down to ~40 lines that delegate entirely to the orchestrator.
36 lines
1.0 KiB
JSON
36 lines
1.0 KiB
JSON
{
|
|
"name": "self-hosting",
|
|
"version": "0.0.1",
|
|
"license": "MIT",
|
|
"engines": {
|
|
"node": "^24.5.0",
|
|
"npm": "please-use-yarn",
|
|
"yarn": ">=4.0.2"
|
|
},
|
|
"packageManager": "yarn@4.9.2",
|
|
"scripts": {
|
|
"auth:login": "twenty auth login",
|
|
"auth:logout": "twenty auth logout",
|
|
"auth:status": "twenty auth status",
|
|
"auth:switch": "twenty auth switch",
|
|
"auth:list": "twenty auth list",
|
|
"app:dev": "twenty app dev",
|
|
"app:sync": "twenty app sync",
|
|
"entity:add": "twenty entity add",
|
|
"function:logs": "twenty function logs",
|
|
"function:execute": "twenty function execute",
|
|
"app:uninstall": "twenty app uninstall",
|
|
"help": "twenty help",
|
|
"lint": "eslint",
|
|
"lint:fix": "eslint --fix"
|
|
},
|
|
"dependencies": {
|
|
"twenty-sdk": "0.3.1"
|
|
},
|
|
"devDependencies": {
|
|
"@types/node": "^24.7.2"
|
|
},
|
|
"$schema": "https://raw.githubusercontent.com/twentyhq/twenty/main/packages/twenty-cli/src/constants/schemas/appManifest.schema.json",
|
|
"universalIdentifier": "a7070f46-3158-4b40-828f-8e6b1febc233"
|
|
}
|