Skip to content

Commit 3353e66

Browse files
committed
Merge branch 'main' of https://github.com/twentyhq/twenty into morph-relation-new-runner
2 parents 1860144 + c7aa594 commit 3353e66

File tree

274 files changed

+4337
-3298
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

274 files changed

+4337
-3298
lines changed

nx.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@
133133
"outputs": ["{projectRoot}/{options.output-dir}"],
134134
"options": {
135135
"cwd": "{projectRoot}",
136-
"command": "VITE_DISABLE_TYPESCRIPT_CHECKER=true VITE_DISABLE_ESLINT_CHECKER=true storybook build --test",
136+
"command": "VITE_DISABLE_TYPESCRIPT_CHECKER=true storybook build --test",
137137
"output-dir": "storybook-static",
138138
"config-dir": ".storybook"
139139
},

packages/twenty-apps/hello-world/src/objects/postCard.ts

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1+
import { type Note } from '../../generated';
2+
13
import {
2-
BaseObject,
34
Field,
45
Object,
56
FieldType,
67
type FullNameField,
78
type AddressField,
9+
Relation,
10+
RelationType,
11+
OnDeleteAction,
12+
STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS,
813
} from 'twenty-sdk/application';
914

1015
enum PostCardStatus {
@@ -23,7 +28,7 @@ enum PostCardStatus {
2328
description: ' A post card object',
2429
icon: 'IconMail',
2530
})
26-
export class PostCard extends BaseObject {
31+
export class PostCard {
2732
@Field({
2833
universalIdentifier: '58a0a314-d7ea-4865-9850-7fb84e72f30b',
2934
type: FieldType.TEXT,
@@ -84,7 +89,16 @@ export class PostCard extends BaseObject {
8489
})
8590
status: PostCardStatus;
8691

87-
// notes?: string // optional internal notes or comments
92+
@Relation({
93+
universalIdentifier: 'c9e2b4f4-b9ad-4427-9b42-9971b785edfe',
94+
type: RelationType.ONE_TO_MANY,
95+
label: 'Notes',
96+
icon: 'IconComment',
97+
inverseSideTargetUniversalIdentifier:
98+
STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.note,
99+
onDelete: OnDeleteAction.CASCADE,
100+
})
101+
notes: Note[];
88102

89103
@Field({
90104
universalIdentifier: 'e06abe72-5b44-4e7f-93be-afc185a3c433',

packages/twenty-cli/src/commands/app-sync.command.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export class AppSyncCommand {
2828
}
2929

3030
private async synchronize({ appPath }: { appPath: string }) {
31-
const { manifest, packageJson, yarnLock, isTwentyClientUsed } =
31+
const { manifest, packageJson, yarnLock, shouldGenerate } =
3232
await loadManifest(appPath);
3333

3434
let serverlessSyncResult = await this.apiService.syncApplication({
@@ -37,7 +37,7 @@ export class AppSyncCommand {
3737
yarnLock,
3838
});
3939

40-
if (isTwentyClientUsed) {
40+
if (shouldGenerate) {
4141
await this.generateService.generateClient(appPath);
4242

4343
const { manifest: manifestWithClient } = await loadManifest(appPath);

packages/twenty-cli/src/utils/__tests__/load-manifest.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ export const format = async (params: any): Promise<any> => {
413413
});
414414

415415
it('manifest should contains typescript sources', async () => {
416-
const { isTwentyClientUsed } = await loadManifest(appDirectory);
417-
expect(isTwentyClientUsed).toBe(false);
416+
const { shouldGenerate } = await loadManifest(appDirectory);
417+
expect(shouldGenerate).toBe(false);
418418
});
419419
});

packages/twenty-cli/src/utils/load-manifest.ts

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import {
3131
isTemplateExpression,
3232
isVariableStatement,
3333
isImportDeclaration,
34-
NamedImports,
3534
} from 'typescript';
3635
import {
3736
AppManifest,
@@ -448,7 +447,7 @@ export const extractTwentyAppConfig = (program: Program): Application => {
448447
throw new Error('Could not find default exported ApplicationConfig');
449448
};
450449

451-
const isTwentyClientUsedInProgram = (program: Program): boolean => {
450+
const isGeneratedModuleUsedInProgram = (program: Program): boolean => {
452451
for (const sf of program.getSourceFiles()) {
453452
if (sf.isDeclarationFile) continue;
454453

@@ -468,24 +467,9 @@ const isTwentyClientUsedInProgram = (program: Program): boolean => {
468467
moduleText === GENERATED_FOLDER_NAME ||
469468
moduleText.endsWith(`/${GENERATED_FOLDER_NAME}`);
470469

471-
if (
472-
isGeneratedModule &&
473-
node.importClause &&
474-
node.importClause.namedBindings &&
475-
node.importClause.namedBindings.kind === SyntaxKind.NamedImports
476-
) {
477-
const namedImports = node.importClause
478-
.namedBindings as NamedImports;
479-
480-
for (const element of namedImports.elements) {
481-
const importedName =
482-
element.propertyName?.text ?? element.name.text;
483-
484-
if (importedName === 'createClient') {
485-
found = true;
486-
return;
487-
}
488-
}
470+
if (isGeneratedModule && node.importClause) {
471+
found = true;
472+
return;
489473
}
490474
}
491475
}
@@ -507,7 +491,7 @@ export const loadManifest = async (
507491
packageJson: PackageJson;
508492
yarnLock: string;
509493
manifest: AppManifest;
510-
isTwentyClientUsed: boolean;
494+
shouldGenerate: boolean;
511495
}> => {
512496
const packageJson = await parseJsoncFile(
513497
await findPathFile(appPath, 'package.json'),
@@ -532,7 +516,7 @@ export const loadManifest = async (
532516
await loadFolderContentIntoJson(program, appPath),
533517
];
534518

535-
const isTwentyClientUsed = isTwentyClientUsedInProgram(program);
519+
const shouldGenerate = isGeneratedModuleUsedInProgram(program);
536520

537521
return {
538522
packageJson,
@@ -543,6 +527,6 @@ export const loadManifest = async (
543527
serverlessFunctions,
544528
sources,
545529
},
546-
isTwentyClientUsed,
530+
shouldGenerate,
547531
};
548532
};

packages/twenty-docs/developers/self-hosting/troubleshooting.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ This should work out of the box with the eslint extension installed. If this doe
6969

7070
#### While running `npx nx start` or `npx nx start twenty-front`, Out of memory error is thrown
7171

72-
In `packages/twenty-front/.env` uncomment `VITE_DISABLE_TYPESCRIPT_CHECKER=true` and `VITE_DISABLE_ESLINT_CHECKER=true` to disable background checks thus reducing amount of needed RAM.
72+
In `packages/twenty-front/.env` uncomment `VITE_DISABLE_TYPESCRIPT_CHECKER=true` to disable background checks thus reducing amount of needed RAM.
7373

7474
**If it does not work:**
7575
Run only the services you need, instead of `npx nx start`. For instance, if you work on the server, run only `npx nx worker twenty-server`

packages/twenty-docs/l/ar/user-guide/workflows/workflow-troubleshooting.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ sectionInfo: أتمتة العمليات والاندماج مع الأدوات
5757

5858
**المشكلة**: الوصول إلى حد 100 سير عمل متزامن لكل مساحة عمل.
5959

60-
<Warning><Warning><Warning><Warning>لا يمكنك تشغيل أكثر من 100 سير عمل بالتوازي في أي وقت لكل مساحة عمل.</Warning> </Warning></Warning></Warning>
60+
<Warning><Warning><Warning><Warning><Warning><Warning>لا يمكنك تشغيل أكثر من 100 سير عمل بالتوازي في أي وقت لكل مساحة عمل.</Warning> </Warning></Warning></Warning></Warning></Warning>
6161

6262
**حلول**:
6363

packages/twenty-docs/l/es/user-guide/settings/settings-faq.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ Absolutamente. Puedes crear un nuevo espacio de trabajo haciendo clic en el men
1818

1919
<Accordion title="I accidentally created multiple workspaces but only need one. What should I do?"><Accordion title="How do I change my workspace appearance and regional settings?">Ve a `Configuración → Experiencia` para personalizar:
2020

21-
<Warning><Warning><Warning><Warning>No elimines tu cuenta (accesible en Configuración → Configuración de perfil): tu cuenta se comparte entre los diferentes espacios de trabajo.</Warning></Warning>
21+
<Warning><Warning><Warning><Warning><Warning><Warning>No elimines tu cuenta (accesible en Configuración → Configuración de perfil): tu cuenta se comparte entre los diferentes espacios de trabajo.</Warning></Warning>
2222
</Accordion>
2323

24-
<Accordion title="How can I disable my workspace?"><Accordion title="How can I disable my workspace?"><Accordion title="How can I disable my workspace?"><Accordion title="How can I disable my workspace?">Si solo deseas desactivar tu espacio de trabajo (no eliminarlo), ve a `Configuración → Facturación` y haz clic en `Cancelar plan`.</Accordion></Accordion>
24+
<Accordion title="How can I disable my workspace?"><Accordion title="How can I disable my workspace?"><Accordion title="How can I disable my workspace?"><Accordion title="How can I disable my workspace?"><Accordion title="How can I disable my workspace?">Si solo deseas desactivar tu espacio de trabajo (no eliminarlo), ve a `Configuración → Facturación` y haz clic en `Cancelar plan`.</Accordion></Accordion>
2525

2626
<Accordion title="How can I delete my workspace?">
2727
Puedes hacerlo en `Configuración → Configuración del espacio de trabajo`. ¡Esperamos verte pronto, gracias por probar Twenty!

packages/twenty-docs/l/es/user-guide/workflows/workflow-troubleshooting.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Los formularios están diseñados actualmente solo para disparadores manuales. P
5757

5858
**Problema**: Se alcanza el límite de 100 flujos de trabajo concurrentes por espacio de trabajo.
5959

60-
<Warning><Warning><Warning><Warning>No puedes ejecutar más de 100 flujos de trabajo en paralelo en cualquier momento por espacio de trabajo.</Warning> </Warning></Warning></Warning>
60+
<Warning><Warning><Warning><Warning><Warning><Warning>No puedes ejecutar más de 100 flujos de trabajo en paralelo en cualquier momento por espacio de trabajo.</Warning> </Warning></Warning></Warning></Warning></Warning>
6161

6262
**Soluciones**:
6363

packages/twenty-docs/l/fr/user-guide/getting-started/getting-around-twenty.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Vous pouvez **voir, modifier, supprimer des enregistrements** à partir de là a
2525
- Utilisez la **barre de recherche** (appuyez sur `/` pour y accéder instantanément)
2626
- Ouvrir la section **Paramètres**
2727

28-
<Warning><Warning><Warning><Warning><Warning>Veuillez noter que notre documentation API est accessible sous la section Paramètres et non dans le guide de l'utilisateur.</Warning> </Warning></Warning></Warning></Warning>
28+
<Warning><Warning><Warning><Warning><Warning><Warning>Veuillez noter que notre documentation API est accessible sous la section Paramètres et non dans le guide de l'utilisateur.</Warning></Warning>
2929

3030
- </Warning>
3131
Ayez un accès direct à vos **vues favorites**. Les favoris sont uniques pour chaque utilisateur.

0 commit comments

Comments
 (0)