Revert "Fix SDK typecheck: add type declaration for twenty-sdk/generated"

This reverts commit bf3f606ad1.
This commit is contained in:
Félix Malfait
2026-03-10 09:12:10 +01:00
parent bf3f606ad1
commit e858b0c75b
2 changed files with 1 additions and 31 deletions
@@ -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');
});
});
-10
View File
@@ -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<R>(request: R): Promise<unknown>;
mutation<R>(request: R): Promise<unknown>;
}
export class MetadataApiClient {}
}