Some checks failed
App Prod-Parity E2E Dispatch / dispatch (push) Failing after 10s
CD Storybook UI / build (push) Failing after 3m25s
CD Storybook UI / dispatch (push) Has been skipped
CD deploy main / website-changed-files (push) Successful in 18m8s
CI Agent Skills / changed-files-check (push) Successful in 18m9s
CI Create App E2E minimal / changed-files-check (push) Successful in 24s
CI Create App / changed-files-check (push) Successful in 26s
CI Docs / changed-files-check (push) Successful in 26s
CI Emails / changed-files-check (push) Successful in 28s
CI Example App Hello World / changed-files-check (push) Successful in 23s
CI Front / changed-files-check (push) Has been skipped
CI Example App Postcard / changed-files-check (push) Successful in 27s
CI UI / changed-files-check (push) Has been skipped
CI Utils Test / changed-files-check (push) Successful in 45s
CI Twenty Apps / discover (push) Successful in 1m3s
CD deploy main / deploy-main (push) Failing after 3s
CI Agent Skills / agent-skills-validate (push) Has been skipped
CI Create App / create-app-test (lint) (push) Has been skipped
CI Emails / emails-test (push) Has been skipped
CI Front / front-task (lingui:compile) (push) Has been skipped
CI Front / front-task (lint) (push) Has been skipped
CI Example App Postcard / example-app-postcard (push) Has been skipped
CI UI / ui-task (lint) (push) Has been skipped
CI UI / ui-task (pack-size) (push) Has been skipped
CI UI / ui-task (size) (push) Has been skipped
CI UI / ui-task (test) (push) Has been skipped
CI UI / ui-task (typecheck) (push) Has been skipped
CI Utils Test / utils-test (push) Has been skipped
CI Twenty Apps / ${{ matrix.app.name }} (push) Has been skipped
CI Emails / ci-emails-status-check (push) Successful in 2s
CI Example App Hello World / ci-example-app-hello-world-status-check (push) Successful in 2s
CI Example App Postcard / ci-example-app-postcard-status-check (push) Successful in 3s
CI UI / ui-sb-test (push) Has been skipped
CI Utils Test / ci-utils-test-status-check (push) Successful in 2s
CI Twenty Apps / ci-twenty-apps-status-check (push) Successful in 2s
CI UI / ci-ui-status-check (push) Successful in 2s
CI Desktop / desktop (push) Failing after 1m8s
Push docs to Crowdin / Push documentation to Crowdin (push) Failing after 55s
Push translations to Crowdin / Extract and upload translations (push) Failing after 5s
Push website translations to Crowdin / Extract and upload website translations (push) Failing after 5s
CI Create App / create-app-test (test) (push) Has been skipped
CI Create App / create-app-test (typecheck) (push) Has been skipped
CI Docs / docs-lint (push) Has been skipped
CI Example App Hello World / example-app-hello-world (push) Has been skipped
CI Front / front-task (lingui:extract) (push) Has been skipped
CI Front / front-task (test) (push) Has been skipped
CI Front / front-task (typecheck) (push) Has been skipped
CI UI / ui-sb-build (push) Failing after 1m32s
CI Twenty Apps / ${{ matrix.app.name }} (${{ matrix.server-source }}) (push) Has been skipped
CI Agent Skills / agent-skills-publish (push) Has been skipped
CI Create App / ci-create-app-status-check (push) Successful in 2s
CI Agent Skills / agent-skills-remote-source (push) Has been skipped
CI Create App E2E minimal / create-app-e2e-minimal (push) Has been cancelled
CI E2E Main / e2e-test (push) Has been cancelled
CI Front / front-sb-build (push) Has been cancelled
CI Front / front-build (push) Has been cancelled
CI Create App E2E minimal / ci-create-app-e2e-minimal-status-check (push) Has been cancelled
CI E2E Main / ci-e2e-main-status-check (push) Has been cancelled
CI E2E Main / notify-main-ci-failure (push) Has been cancelled
CI E2E Main / qa-scout-comment (push) Has been cancelled
CI Front / front-sb-test (push) Has been cancelled
CI Front / front-sb-screenshots (push) Has been cancelled
CI Front / ci-front-status-check (push) Has been cancelled
DPA Sub-Processor Sync / sync-subprocessors (push) Failing after 3s
AI Catalog Sync / sync-catalog (push) Failing after 2s
64 lines
4.1 KiB
Plaintext
64 lines
4.1 KiB
Plaintext
---
|
||
title: Génération
|
||
description: Générez des fichiers d'entité de manière interactive avec `yarn twenty dev:add` — objets, champs, vues, fonctions logiques et plus encore.
|
||
icon: wand-magic-sparkles
|
||
---
|
||
|
||
Au lieu de créer manuellement les fichiers d'entité, utilisez l'outil de génération interactif :
|
||
|
||
```bash filename="Terminal"
|
||
yarn twenty dev:add
|
||
```
|
||
|
||
Il vous invite à choisir un type d'entité, vous guide à travers les champs requis, puis écrit un fichier prêt à l'emploi avec un `universalIdentifier` stable et l'appel `defineEntity()` correct.
|
||
|
||
Vous pouvez également passer directement le type d'entité pour ignorer la première invite :
|
||
|
||
```bash filename="Terminal"
|
||
yarn twenty dev:add object
|
||
yarn twenty dev:add logicFunction
|
||
yarn twenty dev:add frontComponent
|
||
```
|
||
|
||
## Types d’entités disponibles
|
||
|
||
| Type d’entité | Commande | Fichier généré |
|
||
| --------------------------------- | ------------------------------------------ | --------------------------------------------------------- |
|
||
| Objet | `yarn twenty dev:add object` | `src/objects/\<name>.ts` |
|
||
| Champ | `yarn twenty dev:add field` | `src/fields/\<name>.ts` |
|
||
| Fonction logique | `yarn twenty dev:add logicFunction` | `src/logic-functions/\<name>.ts` |
|
||
| Composant frontal | `yarn twenty dev:add frontComponent` | `src/front-components/\<name>.tsx` |
|
||
| Rôle | `yarn twenty dev:add role` | `src/roles/\<name>.ts` |
|
||
| Compétence | `yarn twenty dev:add skill` | `src/skills/\<name>.ts` |
|
||
| Agent | `yarn twenty dev:add agent` | `src/agents/\<name>.ts` |
|
||
| Vue | `yarn twenty dev:add view` | `src/views/\<name>.ts` |
|
||
| Élément de menu de navigation | `yarn twenty dev:add navigationMenuItem` | `src/navigation-menu-items/\<name>.ts` |
|
||
| Mise en page | `yarn twenty dev:add pageLayout` | `src/page-layouts/\<name>.ts` |
|
||
| Onglet Mise en page | `yarn twenty dev:add pageLayoutTab` | `src/page-layout-tabs/\<name>.ts` |
|
||
| Élément du menu de commande | `yarn twenty dev:add commandMenuItem` | `src/command-menu-items/\<name>.ts` |
|
||
| Champ de vue | `yarn twenty dev:add viewField` | `src/view-fields/\<name>.ts` |
|
||
| Fournisseur de connexion | `yarn twenty dev:add connectionProvider` | `src/connection-providers/\<name>.ts` |
|
||
| Type d'activité de la chronologie | `yarn twenty dev:add timelineActivityType` | `src/timeline-activity-types/\<name>.ts` |
|
||
|
||
## Ce que génère l'outil de génération
|
||
|
||
Chaque type d'entité a son propre modèle. Par exemple, `yarn twenty dev:add object` demande :
|
||
|
||
1. **Nom (singulier)** — p. ex., `invoice`
|
||
2. **Nom (pluriel)** — p. ex., `invoices`
|
||
3. **Libellé (singulier)** — rempli automatiquement depuis le nom (p. ex., `Invoice`)
|
||
4. **Libellé (pluriel)** — rempli automatiquement (p. ex., `Invoices`)
|
||
5. **Créer une vue et un élément de navigation ?** — si vous répondez oui, l'outil génère également une vue correspondante et un lien de barre latérale pour le nouvel objet.
|
||
|
||
Les autres types d'entités ont des invites plus simples — la plupart ne demandent qu'un nom.
|
||
|
||
Le type d'entité `field` est plus détaillé : il demande le nom du champ, son libellé, son type (à partir d'une liste de tous les types de champs disponibles comme `TEXT`, `NUMBER`, `SELECT`, `RELATION`, etc.), et le `universalIdentifier` de l'objet cible.
|
||
|
||
## Chemin de sortie personnalisé
|
||
|
||
Utilisez l'option `--path` pour placer le fichier généré à un emplacement personnalisé :
|
||
|
||
```bash filename="Terminal"
|
||
yarn twenty dev:add logicFunction --path src/custom-folder
|
||
```
|