From e858b0c75bb9fb1a8ea4adbba909be5a5ccfe613 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Malfait?= Date: Tue, 10 Mar 2026 09:12:10 +0100 Subject: [PATCH] Revert "Fix SDK typecheck: add type declaration for twenty-sdk/generated" This reverts commit bf3f606ad131c14c1af56a5c2849a90bb539c8e7. --- .../app-build/app-build.integration.spec.ts | 22 +------------------ .../twenty-sdk/src/twenty-sdk-generated.d.ts | 10 --------- 2 files changed, 1 insertion(+), 31 deletions(-) delete mode 100644 packages/twenty-sdk/src/twenty-sdk-generated.d.ts diff --git a/packages/twenty-sdk/src/app-seeds/rich-app/__integration__/app-build/app-build.integration.spec.ts b/packages/twenty-sdk/src/app-seeds/rich-app/__integration__/app-build/app-build.integration.spec.ts index a99235b6e76..f815dd62909 100644 --- a/packages/twenty-sdk/src/app-seeds/rich-app/__integration__/app-build/app-build.integration.spec.ts +++ b/packages/twenty-sdk/src/app-seeds/rich-app/__integration__/app-build/app-build.integration.spec.ts @@ -1,4 +1,4 @@ -import { readdir, readFile, rm } from 'node:fs/promises'; +import { readdir, rm } from 'node:fs/promises'; import { join } from 'path'; import { appBuild } from '@/cli/public-operations/app-build'; @@ -43,24 +43,4 @@ describe('rich-app app:build', () => { expect(functionFiles.length).toBeGreaterThan(0); }); - - // app:build only creates client stubs (empty CoreApiClient / MetadataApiClient) - // because it doesn't sync with the server or generate the real API client. - // Logic functions that use CoreApiClient will get an empty class at runtime. - // When this is fixed, update this test to assert the client IS fully generated. - // See: https://github.com/twentyhq/twenty/pull/18460 - it('should only produce client stubs (not a fully generated CoreApiClient)', async () => { - const clientIndexPath = join( - APP_PATH, - 'node_modules', - 'twenty-sdk', - GENERATED_DIR, - 'core', - 'index.ts', - ); - - const content = await readFile(clientIndexPath, 'utf-8'); - - expect(content).toBe('export class CoreApiClient {}\n'); - }); }); diff --git a/packages/twenty-sdk/src/twenty-sdk-generated.d.ts b/packages/twenty-sdk/src/twenty-sdk-generated.d.ts deleted file mode 100644 index c22134468fe..00000000000 --- a/packages/twenty-sdk/src/twenty-sdk-generated.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -// Type stubs for the generated API client module. -// At build time, esbuild resolves twenty-sdk/generated to the actual -// generated client (or stubs) in the app's node_modules. -declare module 'twenty-sdk/generated' { - export class CoreApiClient { - query(request: R): Promise; - mutation(request: R): Promise; - } - export class MetadataApiClient {} -}