136 lines
55 KiB
JavaScript
136 lines
55 KiB
JavaScript
// The Symfony tutorial, as data for the tour engine (tour.js): chapters and steps, texts in English and French (the other languages
|
|
// of the IDE show the English text; the panel's own buttons and titles are translated in the 14 languages by t()).
|
|
// Targets are data-tour names (index.html, app.js); `tool-<id>` is the stripe button of a tool window. Commands of "Do it for me":
|
|
// {tool: id} {action: id} {open: path} {write: {path, content}} {console: 'make:controller ...'} {docs: page} {click: target} {fill: {target, value}}.
|
|
// Every step points at the REAL control (a data-tour attribute in the tool window itself): `before` opens its window / dialog, `wait` verifies the
|
|
// real result (a file, a route, a migration, the schema check, a 2xx answer); see tour.js.
|
|
|
|
const step = (id, en, fr, extra = {}) => ({ id, title: { en: en[0], fr: fr[0] }, text: { en: en[1], fr: fr[1] }, ...(extra.tip ? { tip: { en: extra.tip[0], fr: extra.tip[1] } } : {}), ...omitTip(extra) });
|
|
const omitTip = ({ tip, ...rest }) => rest;
|
|
|
|
|
|
const C = (id, en, fr, steps) => ({ id, title: { en: en, fr: fr }, steps });
|
|
const exists = (path) => ({ exists: path });
|
|
const CONTROLLER = 'src/Controller/HomeController.php';
|
|
|
|
export const symfonyTutorial = {
|
|
id: 'symfony',
|
|
title: { en: 'Symfony tutorial', fr: 'Tutoriel Symfony' },
|
|
chapters: [
|
|
C('tour', '0. The IDE tour', '0. Visite de l\'IDE', [
|
|
step('tour-welcome', ['Welcome', 'This tutorial walks you through the IDE on a real Symfony project, **one action per step**. Each step tells you exactly what to click or type, why, and what you should see. When you do it, the step ticks itself and the next one opens. **Show me** opens the right window and points a ghost mouse at the exact control; **Do it for me** does the step; if you get lost, press **Show me** again.'], ['Bienvenue', 'Ce tutoriel vous fait découvrir l\'IDE sur un vrai projet Symfony, **une action par étape**. Chaque étape dit exactement quoi cliquer ou taper, pourquoi, et ce que vous devez voir. Quand vous l\'avez fait, l\'étape se coche et la suivante s\'ouvre. **Montre-moi** ouvre la bonne fenêtre et désigne le contrôle exact avec une souris fantôme ; **Fais-le pour moi** réalise l\'étape ; si vous êtes perdu, rappuyez sur **Montre-moi**.'], { target: 'panel-left', ready: 'panel-left' }),
|
|
step('tour-tree', ['The project tree', 'On the left, the **Project** window: your files. Double-click a file to open it, right-click for New, Rename, Delete, Git... The column of buttons at the far left opens the other windows. **Click the Project button** (top of that column) to see the tree.'], ['L\'arbre du projet', 'À gauche, la fenêtre **Project** : vos fichiers. Double-clic pour ouvrir un fichier, clic droit pour Nouveau, Renommer, Supprimer, Git... La colonne de boutons tout à gauche ouvre les autres fenêtres. **Cliquez sur le bouton Project** (en haut de cette colonne) pour voir l\'arbre.'], { target: 'tool-project', ghost: [{ target: 'tool-project', click: true }], do: { tool: 'project' }, wait: { tool: 'project' } }),
|
|
step('tour-editor', ['The editor', '**Double-click composer.json** in the tree (or press Do it for me). It opens in the editor (Monaco, the one of VS Code) with PHP, Twig, YAML and JSON intelligence. You should see its JSON in the middle. Ctrl+click on a name jumps to its definition.'], ['L\'éditeur', '**Double-cliquez sur composer.json** dans l\'arbre (ou Fais-le pour moi). Il s\'ouvre dans l\'éditeur (Monaco, celui de VS Code) avec l\'intelligence PHP, Twig, YAML et JSON. Vous devez voir son JSON au milieu. Ctrl+clic sur un nom saute à sa définition.'], { target: 'editors', do: { open: 'composer.json' }, wait: { opened: 'composer\\.json$' } }),
|
|
step('tour-tools', ['Tool windows', 'Every feature has its own window: Console, Doctrine, Database, Tests, HTTP Client... Two columns of buttons, left and right of the screen, open them (hover a button to read its name). We will open them one by one. Press **Next** when you have looked.'], ['Les fenêtres d\'outils', 'Chaque fonction a sa fenêtre : Console, Doctrine, Database, Tests, HTTP Client... Deux colonnes de boutons, à gauche et à droite de l\'écran, les ouvrent (survolez un bouton pour lire son nom). Nous les ouvrirons une par une. Appuyez sur **Suivant** quand vous avez regardé.'], { target: 'right-stripe', ghost: [{ target: 'right-stripe' }, { target: 'left-stripe' }], auto: false }),
|
|
step('tour-reindex', ['Re-index', 'The IDE indexes your code and the libraries to complete and navigate. If a class you just added is not suggested, **click the circular arrow at the bottom right of the status bar** (Re-index the project): it reads everything again.'], ['Ré-indexer', 'L\'IDE indexe votre code et les bibliothèques pour compléter et naviguer. Si une classe que vous venez d\'ajouter n\'est pas proposée, **cliquez sur la flèche circulaire en bas à droite de la barre d\'état** (Ré-indexer le projet) : tout est relu.'], { target: 'sb-reindex', ghost: [{ target: 'sb-reindex', click: true }], auto: false }),
|
|
step('tour-search', ['Search Everywhere', '**Click the magnifier at the top right** (or press Shift twice): files, classes, symbols, actions and settings in one box. If you do not know where a feature is, type its name here. You should see a search box open.'], ['Recherche partout', '**Cliquez sur la loupe en haut à droite** (ou appuyez deux fois sur Maj) : fichiers, classes, symboles, actions et réglages dans une seule boîte. Si vous ne savez pas où est une fonction, tapez son nom ici. Une boîte de recherche doit s\'ouvrir.'], { target: 'search-button', ghost: [{ target: 'search-button', click: true }], do: { action: 'searchEverywhere' }, wait: { action: 'searchEverywhere' } }),
|
|
step('tour-doc', ['The Doc button', '**Click Doc** at the top right: the documentation of the IDE, one page per feature, searchable. The **?** of a tool window\'s header opens its page. This tutorial points to the pages when you need more. Close it when you have seen it.'], ['Le bouton Doc', '**Cliquez sur Doc** en haut à droite : la documentation de l\'IDE, une page par fonction, avec recherche. Le **?** de l\'en-tête d\'une fenêtre ouvre sa page. Ce tutoriel renvoie aux pages quand il en faut plus. Fermez-la quand vous l\'avez vue.'], { target: 'doc-button', ghost: [{ target: 'doc-button', click: true }], do: { click: 'doc-button' }, wait: { click: 'doc-button' } }),
|
|
]),
|
|
C('run', '1. Run the site', '1. Lancer le site', [
|
|
step('run-config', ['Pick the run configuration', '**Click the Run configurations button** (top bar, left of the green arrow) and choose **Serve the site**. It starts FrankenPHP in Docker (with the database and live reload); nothing is installed on your computer.'], ['Choisir la configuration', '**Cliquez sur le bouton des configurations de lancement** (barre du haut, à gauche de la flèche verte) et choisissez **Serve the site**. Cela démarre FrankenPHP dans Docker (avec la base et le rechargement en direct) ; rien n\'est installé sur votre ordinateur.'], { target: 'run-config', ghost: [{ target: 'run-config', click: true }], do: { action: 'runConfigs' }, wait: { action: 'runConfigs' } }),
|
|
step('run-go', ['Start it', '**Click the green Run arrow** next to it. The first start pulls Docker images (a few minutes, once), then your browser opens on the site. Press Next when it runs, or if Docker is not available here.'], ['Démarrer', '**Cliquez sur la flèche verte Run** à côté. Le premier démarrage télécharge les images Docker (quelques minutes, une fois), puis votre navigateur s\'ouvre sur le site. Appuyez sur Suivant quand il tourne, ou si Docker n\'est pas disponible ici.'], { target: 'run-button', ghost: [{ target: 'run-button', click: true }], auto: false }),
|
|
step('run-docker', ['PHP version and Docker setup', '**Click the Docker button** in the right-hand column: containers of the site, PHP version per site, setup (compose file, ports, logs). You should see the Docker window slide in.'], ['Version de PHP et Docker', '**Cliquez sur le bouton Docker** de la colonne de droite : conteneurs du site, version de PHP par site, configuration (compose, ports, journaux). La fenêtre Docker doit s\'ouvrir.'], { target: 'tool-docker', ghost: [{ target: 'tool-docker', click: true }], do: { tool: 'docker' }, wait: { tool: 'docker' } }),
|
|
]),
|
|
C('console', '2. The New… hub, the Console and a controller', '2. Le hub Nouveau…, la Console et un contrôleur', [
|
|
step('console-open', ['The Console window', '**Click the Console button** (right column, or Alt+S). It lists every command of bin/console; the form on the right shows the arguments and options of the chosen one: no more guessing flags.'], ['La fenêtre Console', '**Cliquez sur le bouton Console** (colonne de droite, ou Alt+S). Elle liste toutes les commandes de bin/console ; le formulaire à droite montre les arguments et options de celle choisie : plus besoin de deviner les options.'], { target: 'tool-console', ghost: [{ target: 'tool-console', click: true }], do: { tool: 'console' }, wait: { tool: 'console' } }),
|
|
step('console-filter', ['Find a command', '**Click the "Filter commands" field** at the top of the list and type **make:** : the list narrows as you type. Double-click a command runs it in a terminal, one click shows its form.'], ['Trouver une commande', '**Cliquez dans le champ « Filter commands »** en haut de la liste et tapez **make:** : la liste se réduit pendant la frappe. Un double-clic lance la commande dans un terminal, un clic montre son formulaire.'], { target: 'console-filter', before: { tool: 'console' }, ghost: [{ target: 'console-filter', click: true }], do: { fill: { target: 'console-filter', value: 'make:' } }, wait: { value: { target: 'console-filter', match: 'make' } } }),
|
|
step('hub-open', ['The New… hub', '**Click the + New button** in the top bar (or press Alt+N). Everything you can create is in this one palette: controllers, entities, forms, commands, events, messages, security classes, API resources, HTTP requests, scripts, translations... with a search field. You should see a list grouped by category.'], ['Le hub Nouveau…', '**Cliquez sur le bouton + New** de la barre du haut (ou Alt+N). Tout ce que vous pouvez créer est dans cette palette : contrôleurs, entités, formulaires, commandes, événements, messages, classes de sécurité, ressources d\'API, requêtes HTTP, scripts, traductions... avec un champ de recherche. Vous devez voir une liste classée par catégorie.'], { target: 'new-button', ghost: [{ target: 'new-button', click: true }], do: { action: 'newHub' }, wait: { action: 'newHub' } }),
|
|
step('hub-controller', ['New > Symfony > Controller', 'In the palette, **click "Controller…"** (under Symfony; or type "controller" and press Enter). The Console opens with **make:controller** already selected and its form ready.'], ['Nouveau > Symfony > Controller', 'Dans la palette, **cliquez sur « Controller… »** (sous Symfony ; ou tapez « controller » puis Entrée). La Console s\'ouvre avec **make:controller** déjà choisie et son formulaire prêt.'], { target: 'new-controller', before: { action: 'newHub' }, ghost: [{ target: 'new-controller', click: true }], do: [{ click: 'new-controller' }], wait: { check: 'visible:console-arg-controller-class' }, back: { en: 'The palette closed: press Alt+N, or Show me again.', fr: 'La palette s\'est fermée : Alt+N, ou rappuyez sur Montre-moi.' } }),
|
|
step('console-name', ['Name the controller', 'In the form, **type Home in the "controller-class" field**. Its preview line below shows the exact command that will run: `make:controller Home`.'], ['Nommer le contrôleur', 'Dans le formulaire, **tapez Home dans le champ « controller-class »**. La ligne d\'aperçu en dessous montre la commande exacte : `make:controller Home`.'], { target: 'console-arg-controller-class', before: [{ tool: 'console' }, { action: 'newHub' }, { click: 'new-controller' }], ghost: [{ target: 'console-arg-controller-class', click: true }], do: { fill: { target: 'console-arg-controller-class', value: 'Home' } }, wait: { value: { target: 'console-arg-controller-class', match: '^Home' } } }),
|
|
step('console-run', ['Run it', '**Click "Run here"** (next to the blue Run button, bottom of the form): it runs without questions and shows the output in the window. Expected: a green output and the file **src/Controller/HomeController.php** appears in the tree. (The blue Run opens a terminal tab for commands that ask questions.)'], ['Lancer la commande', '**Cliquez sur « Run here »** (à côté du bouton bleu Run, en bas du formulaire) : elle s\'exécute sans questions et affiche la sortie dans la fenêtre. Attendu : une sortie verte et le fichier **src/Controller/HomeController.php** apparaît dans l\'arbre. (Le bouton bleu Run ouvre un terminal pour les commandes qui posent des questions.)'], { target: 'console-run-here', ghost: [{ target: 'console-run-here', click: true }], do: { click: 'console-run-here' }, wait: exists(CONTROLLER), back: { en: 'The form is gone: use New… > Controller again and name it Home.', fr: 'Le formulaire a disparu : refaites Nouveau… > Controller et nommez-le Home.' } }),
|
|
step('console-open-controller', ['Read the controller', '**Double-click src/Controller/HomeController.php** in the tree. The #[Route] attribute is the URL; Ctrl+click on the template name jumps to the Twig file.'], ['Lire le contrôleur', '**Double-cliquez sur src/Controller/HomeController.php** dans l\'arbre. L\'attribut #[Route] est l\'URL ; Ctrl+clic sur le nom du template saute au fichier Twig.'], { target: 'editors', do: { open: CONTROLLER }, wait: { opened: 'HomeController\\.php$' } }),
|
|
step('controller-routes', ['The controller routes panel', 'Below the code, the **Controller routes** bar lists this controller\'s routes (name, methods, path, template, security). **Click the "1 routes" header** to open it: a click on a route jumps to its line. The IDE checked the route really exists: it ticks by itself.'], ['Le panneau des routes du contrôleur', 'Sous le code, la barre **Controller routes** liste les routes de ce contrôleur (nom, méthodes, chemin, template, sécurité). **Cliquez sur l\'en-tête « 1 routes »** pour l\'ouvrir : un clic sur une route saute à sa ligne. L\'IDE a vérifié que la route existe vraiment : l\'étape se coche seule.'], { target: 'controller-routes', before: { open: CONTROLLER }, ghost: [{ target: 'controller-routes', click: true }], wait: { check: 'route:' + CONTROLLER } }),
|
|
step('console-complete', ['Completion with auto-import', 'In the controller, put the cursor in the class body, type **new Resp** and accept **Response** with Tab: the IDE adds the missing `use` line by itself (sorted; an alias if the name clashes). A class that is not found gets a quick fix (Alt+Enter: Import). Press Next when you tried.'], ['Complétion avec import automatique', 'Dans le contrôleur, placez le curseur dans le corps de la classe, tapez **new Resp** et acceptez **Response** avec Tab : l\'IDE ajoute tout seul la ligne `use` manquante (triée ; un alias si le nom est déjà pris). Une classe introuvable propose un correctif rapide (Alt+Entrée : Importer). Appuyez sur Suivant quand vous avez essayé.'], { target: 'editors', before: { open: CONTROLLER }, auto: false }),
|
|
step('cmd-open', ['New Symfony command', 'Your own console command, made from a form. **Open New… and click "Command…"** under Symfony (also Tools > New Symfony Command…, the + of the Console window, or Ctrl+Alt+Shift+C). The command wizard opens.'], ['Nouvelle commande Symfony', 'Votre propre commande console, faite depuis un formulaire. **Ouvrez Nouveau… et cliquez sur « Command… »** sous Symfony (aussi Outils > New Symfony Command…, le + de la fenêtre Console, ou Ctrl+Alt+Shift+C). L\'assistant de commande s\'ouvre.'], { target: 'new-command', before: { action: 'newHub' }, ghost: [{ target: 'new-command', click: true }], do: [{ action: 'newHub', unless: 'new-command' }, { click: 'new-command' }], wait: { check: 'visible:cmd-name' }, back: { en: 'The palette closed: press Alt+N, or Show me again.', fr: 'La palette s\'est fermée : Alt+N, ou rappuyez sur Montre-moi.' } }),
|
|
step('cmd-name', ['Name the command', 'In the wizard, **type app:hello in the "Name" field**. On the right, the code of the command is rewritten as you type.'], ['Nommer la commande', 'Dans l\'assistant, **tapez app:hello dans le champ « Name »**. À droite, le code de la commande est réécrit pendant que vous tapez.'], { target: 'cmd-name', ghost: [{ target: 'cmd-name', click: true }], do: { fill: { target: 'cmd-name', value: 'app:hello' } }, wait: { value: { target: 'cmd-name', match: '^app:hello$' } }, back: { en: 'The wizard is closed: open it again (Ctrl+Alt+Shift+C).', fr: 'L\'assistant est fermé : rouvrez-le (Ctrl+Alt+Shift+C).' } }),
|
|
step('cmd-argument', ['Add an argument', 'Under Arguments, **click the "Argument" button**: a row appears for an argument of the command.'], ['Ajouter un argument', 'Sous Arguments, **cliquez sur le bouton « Argument »** : une ligne apparaît pour un argument de la commande.'], { target: 'cmd-add-argument', ghost: [{ target: 'cmd-add-argument', click: true }], do: { click: 'cmd-add-argument' }, wait: { check: 'visible:cmd-arg-name' }, back: { en: 'The wizard is closed: open it again (Ctrl+Alt+Shift+C).', fr: 'L\'assistant est fermé : rouvrez-le (Ctrl+Alt+Shift+C).' } }),
|
|
step('cmd-arg-name', ['Name the argument', '**Type who in the argument\'s "Name" field.** The code gets a `#[Argument] string $who` parameter.'], ['Nommer l\'argument', '**Tapez who dans le champ « Name » de l\'argument.** Le code reçoit un paramètre `#[Argument] string $who`.'], { target: 'cmd-arg-name', ghost: [{ target: 'cmd-arg-name', click: true }], do: { fill: { target: 'cmd-arg-name', value: 'who' } }, wait: { value: { target: 'cmd-arg-name', match: '^who$' } }, back: { en: 'The wizard is closed: open it again (Ctrl+Alt+Shift+C).', fr: 'L\'assistant est fermé : rouvrez-le (Ctrl+Alt+Shift+C).' } }),
|
|
step('cmd-body', ['Add a step to the body', 'Under Body, **click "Success message"** in the palette of steps: an `$io->success(...)` line is added to the code, in this order.'], ['Ajouter une étape au corps', 'Sous Body, **cliquez sur « Success message »** dans la palette d\'étapes : une ligne `$io->success(...)` est ajoutée au code, dans cet ordre.'], { target: 'cmd-step-success', ghost: [{ target: 'cmd-step-success', click: true }], do: { click: 'cmd-step-success' }, wait: { click: 'cmd-step-success' }, back: { en: 'The wizard is closed: open it again (Ctrl+Alt+Shift+C).', fr: 'L\'assistant est fermé : rouvrez-le (Ctrl+Alt+Shift+C).' } }),
|
|
step('cmd-write', ['Write the command', 'The right side shows the file that will be created. **Click "Write the File"**: src/Command/HelloCommand.php is written and opens in the editor.'], ['Écrire la commande', 'La partie droite montre le fichier qui sera créé. **Cliquez sur « Write the File »** : src/Command/HelloCommand.php est écrit et s\'ouvre dans l\'éditeur.'], { target: 'cmd-write', ghost: [{ target: 'cmd-write', click: true }], do: { click: 'cmd-write' }, wait: exists('src/Command/HelloCommand.php'), back: { en: 'The wizard is closed: open it again (Ctrl+Alt+Shift+C).', fr: 'L\'assistant est fermé : rouvrez-le (Ctrl+Alt+Shift+C).' } }),
|
|
step('cmd-find', ['Find it in the Console', 'In the Console window, **click app:hello** in the list (type app:hello in the filter to find it): its form shows the argument you made.'], ['La retrouver dans la Console', 'Dans la fenêtre Console, **cliquez sur app:hello** dans la liste (tapez app:hello dans le filtre pour la trouver) : son formulaire montre l\'argument créé.'], { target: 'console-cmd-app:hello', before: [{ tool: 'console' }, { fill: { target: 'console-filter', value: 'app:hello' } }], ghost: [{ target: 'console-cmd-app:hello', click: true }], do: [{ tool: 'console' }, { fill: { target: 'console-filter', value: 'app:hello' } }, { click: 'console-cmd-app:hello' }], wait: { check: 'visible:console-arg-who' } }),
|
|
step('cmd-who', ['Give the argument', '**Type Ada in the "who" field** of the form: the command line below it follows.'], ['Donner l\'argument', '**Tapez Ada dans le champ « who »** du formulaire : la ligne de commande en dessous suit.'], { target: 'console-arg-who', before: { tool: 'console' }, ghost: [{ target: 'console-arg-who', click: true }], do: { fill: { target: 'console-arg-who', value: 'Ada' } }, wait: { value: { target: 'console-arg-who', match: '^Ada$' } } }),
|
|
step('cmd-run', ['Run your command', '**Click "Run here"**: the command runs in the site\'s container and its output appears below. Expected: **Exit code 0** and a green **[OK] Done.** block.'], ['Lancer votre commande', '**Cliquez sur « Run here »** : la commande s\'exécute dans le conteneur du site et sa sortie apparaît dessous. Attendu : **Exit code 0** et un bloc vert **[OK] Done.**'], { target: 'console-run-here', before: { tool: 'console' }, ghost: [{ target: 'console-run-here', click: true }], do: { click: 'console-run-here' }, wait: { check: 'text:.sfc-output~\\[OK\\] Done' } }),
|
|
]),
|
|
C('twig', '3. Twig templates', '3. Templates Twig', [
|
|
step('twig-edit', ['Edit the template', '**Double-click templates/home/index.html.twig** in the tree. Twig is highlighted and completed (variables, filters, blocks, routes with path()). **Change the title text, then press Ctrl+S**: the step ticks when the file is saved.'], ['Modifier le template', '**Double-cliquez sur templates/home/index.html.twig** dans l\'arbre. Twig est coloré et complété (variables, filtres, blocs, routes avec path()). **Changez le texte du titre, puis Ctrl+S** : l\'étape se coche à l\'enregistrement du fichier.'], { target: 'editors', do: { edit: { path: 'templates/home/index.html.twig', find: 'Hello HomeController!', replace: 'Welcome to my site!' } }, wait: { saved: 'index\\.html\\.twig$' } }),
|
|
step('twig-preview-open', ['Open the preview', '**Click Preview** in the bar above the code (Code | Preview): the template drawn next to its code, without starting the site.'], ['Ouvrir l\'aperçu', '**Cliquez sur Preview** dans la barre au-dessus du code (Code | Preview) : le template dessiné à côté du code, sans démarrer le site.'], { target: 'editor-preview', before: { open: 'templates/home/index.html.twig' }, ghost: [{ target: 'editor-preview', click: true }], do: { click: 'editor-preview' }, wait: { check: 'visible:twig-layout' } }),
|
|
step('twig-layout', ['Layout + CSS', 'In the preview\'s toolbar, **tick "Layout + CSS"**: the page is laid out as Symfony would ({% extends %}, {% include %}) with your project\'s stylesheets linked. You should see the template inside its base layout.'], ['Layout + CSS', 'Dans la barre de l\'aperçu, **cochez « Layout + CSS »** : la page est composée comme Symfony le ferait ({% extends %}, {% include %}) avec les feuilles de style du projet. Vous devez voir le template dans son layout de base.'], { target: 'twig-layout', before: [{ open: 'templates/home/index.html.twig' }, { click: 'editor-preview' }], ghost: [{ target: 'twig-layout', click: true }], do: { click: 'twig-layout' }, wait: { click: 'twig-layout' } }),
|
|
]),
|
|
C('css', '4. CSS and Bootstrap', '4. CSS et Bootstrap', [
|
|
step('css-editor', ['Visual CSS editor', '**Double-click assets/styles/app.css**: the visual CSS designer shows its rules as forms and previews them on your page. If the site uses Bootstrap, the **Bootstrap editor** adds classes and components from a catalogue. Press Next when you looked.'], ['Éditeur CSS visuel', '**Double-cliquez sur assets/styles/app.css** : le designer CSS visuel montre ses règles sous forme de formulaires et les prévisualise sur votre page. Si le site utilise Bootstrap, l\'**éditeur Bootstrap** ajoute classes et composants depuis un catalogue. Appuyez sur Suivant quand vous avez regardé.'], { target: 'editors', do: [{ open: 'assets/styles/app.css' }, { docs: 'css-editor' }], wait: { opened: 'app\\.css$' } }),
|
|
]),
|
|
C('doctrine', '5. Doctrine entities', '5. Entités Doctrine', [
|
|
step('doctrine-open', ['The Doctrine window', '**Click the Doctrine button** in the right column: entities, the diagram, DQL and migrations in one window.'], ['La fenêtre Doctrine', '**Cliquez sur le bouton Doctrine** de la colonne de droite : entités, diagramme, DQL et migrations dans une seule fenêtre.'], { target: 'tool-doctrine', ghost: [{ target: 'tool-doctrine', click: true }], do: { tool: 'doctrine' }, wait: { tool: 'doctrine' } }),
|
|
step('doctrine-new', ['New entity', '**Click the "+" at the top of the Doctrine window** (tooltip "New entity…"). A dialog opens: you should see "Class name", a Fields list and a blue "Show the change" button.'], ['Nouvelle entité', '**Cliquez sur le « + » en haut de la fenêtre Doctrine** (infobulle « New entity… »). Un dialogue s\'ouvre : vous devez voir « Class name », une liste Fields et un bouton bleu « Show the change ».'], { target: 'doctrine-new-entity', before: { tool: 'doctrine' }, ghost: [{ target: 'doctrine-new-entity', click: true }], do: { action: 'doctrineNewEntity' }, wait: { check: 'visible:entity-class' } }),
|
|
step('doctrine-class', ['Name the class', 'In the dialog, **click the "Class name" field and type Product**. The "Generated PHP" preview at the bottom of the dialog updates as you type.'], ['Nommer la classe', 'Dans le dialogue, **cliquez dans le champ « Class name » et tapez Product**. L\'aperçu « Generated PHP » en bas du dialogue se met à jour pendant la frappe.'], { target: 'entity-class', before: { action: 'doctrineNewEntity' }, ghost: [{ target: 'entity-class', click: true }], do: { fill: { target: 'entity-class', value: 'Product' } }, wait: { value: { target: 'entity-class', match: '^Product$' } }, back: { en: 'The dialog is closed: press Show me and I reopen it.', fr: 'Le dialogue est fermé : appuyez sur Montre-moi, je le rouvre.' } }),
|
|
step('doctrine-field-name', ['The first field', 'The first row of Fields is already named **name**, type **string**: that is our product name. Nothing to do: **click into it** to see it is a normal field you can rename (name, then type, then options such as Length and Nullable).'], ['Le premier champ', 'La première ligne de Fields s\'appelle déjà **name**, de type **string** : c\'est le nom du produit. Rien à faire : **cliquez dedans** pour voir que c\'est un champ normal que vous pouvez renommer (nom, type, puis options comme Length et Nullable).'], { target: 'field-name-1', before: { action: 'doctrineNewEntity' }, ghost: [{ target: 'field-name-1', click: true }], wait: { click: 'field-name-1' } }),
|
|
step('doctrine-add-field', ['Add a field', '**Click "+ Add a field"** under the list. A second row appears.'], ['Ajouter un champ', '**Cliquez sur « + Add a field »** sous la liste. Une deuxième ligne apparaît.'], { target: 'entity-add-field', before: { action: 'doctrineNewEntity' }, ghost: [{ target: 'entity-add-field', click: true }], do: { click: 'entity-add-field' }, wait: { check: 'visible:field-name-2' } }),
|
|
step('doctrine-field-price', ['Name it price', '**Type price** in the name box of the second row.'], ['Le nommer price', '**Tapez price** dans la case nom de la deuxième ligne.'], { target: 'field-name-2', before: { action: 'doctrineNewEntity' }, ghost: [{ target: 'field-name-2', click: true }], do: { fill: { target: 'field-name-2', value: 'price' } }, wait: { value: { target: 'field-name-2', match: '^price$' } } }),
|
|
step('doctrine-field-type', ['Choose its type', '**Open the type list of that row and choose float** (a decimal number). Note the other choices: relation, enum, datetime...'], ['Choisir son type', '**Ouvrez la liste de types de cette ligne et choisissez float** (un nombre décimal). Notez les autres choix : relation, enum, datetime...'], { target: 'field-type-2', before: { action: 'doctrineNewEntity' }, ghost: [{ target: 'field-type-2', click: true }], do: { fill: { target: 'field-type-2', value: 'float' } }, wait: { value: { target: 'field-type-2', match: '^float$' } } }),
|
|
step('doctrine-show-change', ['Show the change', '**Click the blue "Show the change" button** at the bottom right of the dialog. Nothing is written yet: you get a diff of every file that will be created (the entity, its repository).'], ['Voir le changement', '**Cliquez sur le bouton bleu « Show the change »** en bas à droite du dialogue. Rien n\'est écrit encore : vous obtenez un diff de chaque fichier qui sera créé (l\'entité, son repository).'], { target: 'entity-show-change', before: { action: 'doctrineNewEntity' }, ghost: [{ target: 'entity-show-change', click: true }], do: { click: 'entity-show-change' }, wait: { check: 'visible:change-apply' } }),
|
|
step('doctrine-apply', ['Apply', 'Read the diffs, then **click the blue "Apply (2 files)" button** at the bottom right. Expected: a green notification "files written" and **src/Entity/Product.php** in the tree.'], ['Appliquer', 'Lisez les diffs, puis **cliquez sur le bouton bleu « Apply (2 files) »** en bas à droite. Attendu : une notification verte « files written » et **src/Entity/Product.php** dans l\'arbre.'], { target: 'change-apply', ghost: [{ target: 'change-apply', click: true }], do: { click: 'change-apply' }, wait: exists('src/Entity/Product.php'), back: { en: 'The dialog closed without applying: click "+" again; the fields are kept as you typed them only while it is open.', fr: 'Le dialogue s\'est fermé sans appliquer : recliquez sur « + » ; les champs ne sont gardés que tant qu\'il est ouvert.' } }),
|
|
step('doctrine-diagram', ['The entities diagram', '**Click the "Diagram" tab** of the Doctrine window: entities and their relations as boxes. Drag a box, double-click an entity to edit it.'], ['Le diagramme des entités', '**Cliquez sur l\'onglet « Diagram »** de la fenêtre Doctrine : les entités et leurs relations en boîtes. Déplacez une boîte, double-clic sur une entité pour l\'éditer.'], { target: 'doctrine-tab-diagram', before: { tool: 'doctrine' }, ghost: [{ target: 'doctrine-tab-diagram', click: true }], do: { action: 'doctrineDiagram' }, wait: { any: [{ click: 'doctrine-tab-diagram' }, { action: 'doctrineDiagram' }] } }),
|
|
]),
|
|
C('env', '6. The .env editor', '6. L\'éditeur .env', [
|
|
step('env-dsn', ['DATABASE_URL', '**Double-click .env** in the tree: a form lists the variables, with the **DSN builder** for DATABASE_URL (driver, host, user, password, database). Secrets stay in .env.local.'], ['DATABASE_URL', '**Double-cliquez sur .env** dans l\'arbre : un formulaire liste les variables, avec le **constructeur de DSN** pour DATABASE_URL (pilote, hôte, utilisateur, mot de passe, base). Les secrets restent dans .env.local.'], { target: 'dotenv-table', before: { open: '.env' }, ghost: [{ target: 'dotenv-table' }], do: { open: '.env' }, wait: { opened: '\\.env$' } }),
|
|
]),
|
|
C('migrations', '7. The schema check and migrations', '7. Vérification du schéma et migrations', [
|
|
step('schema-badge', ['The database health check', 'The **status bar** (bottom) shows "Database OK" or the number of problems; a banner above the editor offers the fixes. **Click the database badge** in the status bar to check now: entities against the database. Right after creating Product, the table does not exist yet, so expect a banner.'], ['La vérification de la base', 'La **barre d\'état** (en bas) affiche « Database OK » ou le nombre de problèmes ; un bandeau au-dessus de l\'éditeur propose les correctifs. **Cliquez sur le badge base de données** de la barre d\'état pour vérifier maintenant : entités contre base. Juste après la création de Product, la table n\'existe pas encore : attendez-vous à un bandeau.'], { target: 'schema-badge', ghost: [{ target: 'schema-badge', click: true }], do: { action: 'checkDatabaseSchema' }, wait: { action: 'checkDatabaseSchema' }, back: { en: 'The badge shows once a check ran: press Do it for me to run it.', fr: 'Le badge apparaît après une vérification : appuyez sur Fais-le pour moi pour la lancer.' }, tip: ['Needs the site started (Run chapter) and Docker.', 'Demande le site démarré (chapitre Run) et Docker.'] }),
|
|
step('migrations-open', ['The Migrations tab', '**Click the "Migrations" tab** of the Doctrine window: versions executed or pending, with Migrate / Roll back.'], ['L\'onglet Migrations', '**Cliquez sur l\'onglet « Migrations »** de la fenêtre Doctrine : versions exécutées ou en attente, avec Migrate / Roll back.'], { target: 'doctrine-tab-migrations', before: { tool: 'doctrine' }, ghost: [{ target: 'doctrine-tab-migrations', click: true }], do: { action: 'doctrineMigrations' }, wait: { any: [{ click: 'doctrine-tab-migrations' }, { action: 'doctrineMigrations' }] } }),
|
|
step('migrations-diff', ['Make a migration', '**Click "Make a migration (diff)"** in the Migrations tab: Doctrine compares your entities with the database and shows the SQL (CREATE TABLE product...) first.'], ['Créer une migration', '**Cliquez sur « Make a migration (diff) »** dans l\'onglet Migrations : Doctrine compare vos entités à la base et montre d\'abord le SQL (CREATE TABLE product...).'], { target: 'migrations-diff', before: { action: 'doctrineMigrations' }, ghost: [{ target: 'migrations-diff', click: true }], do: { click: 'migrations-diff' }, wait: { check: 'visible:migration-write' } }),
|
|
step('migrations-write', ['Write the migration', 'Read the statements, then **click the blue "Write the migration" button**. Expected: a new file **migrations/Version….php** opens in the editor.'], ['Écrire la migration', 'Lisez les instructions, puis **cliquez sur le bouton bleu « Write the migration »**. Attendu : un nouveau fichier **migrations/Version….php** s\'ouvre dans l\'éditeur.'], { target: 'migration-write', ghost: [{ target: 'migration-write', click: true }], do: { click: 'migration-write' }, wait: { check: 'migration' }, back: { en: 'The dialog closed: click "Make a migration (diff)" again.', fr: 'Le dialogue s\'est fermé : recliquez sur « Make a migration (diff) ».' } }),
|
|
step('migrations-migrate', ['Migrate', 'Back in the Migrations tab, **click "Migrate to the latest"** (the blue button, first of the bar), then **Run** in the confirmation: it runs the pending migration. To undo, "Roll back one". The tutorial ticks when the database check says the schema matches.'], ['Migrer', 'De retour dans l\'onglet Migrations, **cliquez sur « Migrate to the latest »** (le bouton bleu, premier de la barre), puis **Run** dans la confirmation : la migration en attente s\'exécute. Pour annuler, « Roll back one ». L\'étape se coche quand la vérification de la base dit que le schéma correspond.'], { target: 'migrations-migrate', before: { action: 'doctrineMigrations' }, ghost: [{ target: 'migrations-migrate', click: true }], do: [{ click: 'migrations-migrate' }, { click: 'confirm-ok' }], wait: { check: 'schema-ok' } }),
|
|
step('schema-fix', ['Or fix everything in one click', 'When the schema banner shows (database missing, pending migration, schema differing), its **"Fix everything"** button plays the plan in order (create the database, migrate, update the schema), asking before each risky step. Never on a production database. Press Next; if the banner is on screen now, it is pointed at.'], ['Ou tout réparer en un clic', 'Quand le bandeau du schéma s\'affiche (base manquante, migration en attente, schéma différent), son bouton **« Fix everything »** joue le plan dans l\'ordre (créer la base, migrer, mettre à jour le schéma) en demandant avant chaque étape risquée. Jamais sur une base de production. Appuyez sur Suivant ; si le bandeau est à l\'écran, il est désigné.'], { target: ['schema-fix-all', 'schema-banner', 'schema-badge'], ready: ['schema-fix-all', 'schema-banner', 'schema-badge'], before: { action: 'checkDatabaseSchema' }, auto: false }),
|
|
]),
|
|
C('database', '8. The Database window', '8. La fenêtre Database', [
|
|
step('db-open', ['Open the Database window', '**Click the Database button** in the right column: it lists the connections of the project, and the ones it found in .env or in the compose file.'], ['Ouvrir la fenêtre Database', '**Cliquez sur le bouton Database** de la colonne de droite : elle liste les connexions du projet, et celles qu\'elle a trouvées dans .env ou dans le fichier compose.'], { target: 'tool-database', ghost: [{ target: 'tool-database', click: true }], do: { tool: 'database' }, wait: { tool: 'database' } }),
|
|
step('db-add', ['Add the site\'s connection', 'Under **Found in this project**, **click Add** next to the connection of your site (found from .env.local / compose, its password kept on this computer only): it is added to the project and connected, and its tables are listed.'], ['Ajouter la connexion du site', 'Sous **Found in this project**, **cliquez sur Add** à côté de la connexion de votre site (trouvée dans .env.local / compose, son mot de passe gardé sur cet ordinateur seulement) : elle est ajoutée au projet et connectée, et ses tables sont listées.'], { target: 'db-add-found', before: { tool: 'database' }, ghost: [{ target: 'db-add-found', click: true }], do: { click: 'db-add-found' }, wait: { check: 'visible:db-table-product' }, tip: ['Needs the site started (Run chapter): the database container.', 'Demande le site démarré (chapitre Lancer le site) : le conteneur de la base.'] }),
|
|
step('db-browse', ['Browse the table', '**Double-click the "product" table** in the tree (Tables > product): rows, columns, filters, editing in a grid. Expected: a grid with your columns (id, name, price) opens. If you do not see the table, click the connection (db) to connect it, or the refresh button of the window.'], ['Parcourir la table', '**Double-cliquez sur la table « product »** dans l\'arbre (Tables > product) : lignes, colonnes, filtres, édition dans une grille. Attendu : une grille avec vos colonnes (id, name, price) s\'ouvre. Si la table n\'apparaît pas, cliquez sur la connexion (db) pour la connecter, ou sur le bouton d\'actualisation de la fenêtre.'], { target: 'db-table-product', before: [{ tool: 'database' }, { click: 'db-connection' }], ghost: [{ target: 'db-table-product', click: true }], do: { dblclick: 'db-table-product' }, wait: { check: 'text:.db-tab.on~product' } }),
|
|
step('db-sql', ['SQL console', '**Click the console button** at the top of the Database window: a SQL console with completion of tables and columns (run with Ctrl+Enter). The button next to it opens the **visual SQL builder**.'], ['Console SQL', '**Cliquez sur le bouton console** en haut de la fenêtre Database : une console SQL avec complétion des tables et colonnes (exécution avec Ctrl+Entrée). Le bouton voisin ouvre le **constructeur SQL visuel**.'], { target: 'db-console', before: { tool: 'database' }, ghost: [{ target: 'db-console', click: true }], do: { click: 'db-console' }, wait: { click: 'db-console' } }),
|
|
]),
|
|
C('dql', '9. DQL in a repository', '9. DQL dans un repository', [
|
|
step('dql-builder', ['DQL builder', '**Click the "DQL" tab** of the Doctrine window: compose a query visually (entity, fields, conditions) and get the PHP code. In ProductRepository.php, query strings also complete entity and field names.'], ['Constructeur DQL', '**Cliquez sur l\'onglet « DQL »** de la fenêtre Doctrine : composez une requête visuellement (entité, champs, conditions) et obtenez le code PHP. Dans ProductRepository.php, les chaînes de requête complètent aussi les noms d\'entités et de champs.'], { target: 'doctrine-tab-dql', before: { tool: 'doctrine' }, ghost: [{ target: 'doctrine-tab-dql', click: true }], do: [{ action: 'doctrineDql' }], wait: { any: [{ click: 'doctrine-tab-dql' }, { action: 'doctrineDql' }] } }),
|
|
]),
|
|
C('forms', '10. Forms', '10. Formulaires', [
|
|
step('forms-open', ['The Forms window', '**Click the Symfony Forms button** in the right column.'], ['La fenêtre Formulaires', '**Cliquez sur le bouton Symfony Forms** de la colonne de droite.'], { target: 'tool-sfForms', ghost: [{ target: 'tool-sfForms', click: true }], do: { action: 'symfonyForms' }, wait: { tool: 'sfForms' } }),
|
|
step('forms-new', ['New form type', '**Click the blue "New form type…" button** at the top of the window and name it **ProductType** (the form of the Product entity). The form builder opens.'], ['Nouveau type de formulaire', '**Cliquez sur le bouton bleu « New form type… »** en haut de la fenêtre et nommez-le **ProductType** (le formulaire de l\'entité Product). Le constructeur de formulaire s\'ouvre.'], { target: 'forms-new-type', before: { tool: 'sfForms' }, ghost: [{ target: 'forms-new-type', click: true }], do: [{ click: 'forms-new-type' }, { fill: { target: 'prompt-input', value: 'ProductType' } }, { click: 'prompt-ok' }], wait: { check: 'visible:forms-add-fields' } }),
|
|
step('forms-fields', ['Fields from the entity', 'The builder offers the properties of Product with the type each one suggests (id, name, price). **Click "Add the checked fields"**: they become the fields of the form, previewed on the right.'], ['Champs de l\'entité', 'Le constructeur propose les propriétés de Product avec le type suggéré pour chacune (id, name, price). **Cliquez sur « Add the checked fields »** : elles deviennent les champs du formulaire, montré en aperçu à droite.'], { target: 'forms-add-fields', ghost: [{ target: 'forms-add-fields', click: true }], do: { click: 'forms-add-fields' }, wait: { click: 'forms-add-fields' }, back: { en: 'This dialog opens when you name the form type: Show me on the previous step, or click "New form type…" again.', fr: 'Cette boîte s\'ouvre quand vous nommez le type de formulaire : Montre-moi à l\'étape précédente, ou cliquez de nouveau sur « New form type… ».' } }),
|
|
step('forms-save', ['Write the form type', '**Click "Save…"** (top right of the builder), read the diff, then **Apply**: the file src/Form/ProductType.php is written. "Generate controller and template…" next to it writes the action and the Twig file the same way.'], ['Écrire le type de formulaire', '**Cliquez sur « Save… »** (en haut à droite du constructeur), lisez le diff, puis **Apply** : le fichier src/Form/ProductType.php est écrit. « Generate controller and template… » à côté écrit de la même façon l\'action et le fichier Twig.'], { target: 'forms-save', before: { tool: 'sfForms' }, ghost: [{ target: 'forms-save', click: true }], do: [{ click: 'forms-save' }, { click: 'change-apply' }], wait: exists('src/Form/ProductType.php') }),
|
|
]),
|
|
C('validation', '11. Validation', '11. Validation', [
|
|
step('validation-constraints', ['Constraints on the entity', '**Click the Validation button**: constraints (NotBlank, Length, Email, your own...) edited as forms and written as attributes on the entity.'], ['Contraintes sur l\'entité', '**Cliquez sur le bouton Validation** : les contraintes (NotBlank, Length, Email, les vôtres...) éditées en formulaires et écrites en attributs sur l\'entité.'], { target: 'tool-validation', ghost: [{ target: 'tool-validation', click: true }], do: { action: 'symfonyValidation' }, wait: { tool: 'validation' } }),
|
|
]),
|
|
C('security', '12. Security', '12. Sécurité', [
|
|
step('security-window', ['The Security window', '**Click the Security button**: security.yaml as forms. Then **click the "Access control" tab**: the rules, and a **tester** (give a URL and roles, see which rule matches).'], ['La fenêtre Sécurité', '**Cliquez sur le bouton Security** : security.yaml en formulaires. Puis **cliquez sur l\'onglet « Access control »** : les règles, et un **testeur** (donnez une URL et des rôles, voyez la règle qui s\'applique).'], { target: 'tool-security', ghost: [{ target: 'tool-security', click: true }, { target: 'security-tab-access', click: true }], do: [{ action: 'symfonySecurity' }, { click: 'security-tab-access' }], wait: { tool: 'security' } }),
|
|
]),
|
|
C('events', '13. Events and Messenger', '13. Événements et Messenger', [
|
|
step('events-window', ['Events and subscribers', '**Click the Events button**: the project\'s events, listeners and subscribers, and a form to create a subscriber from a template.'], ['Événements et subscribers', '**Cliquez sur le bouton Events** : les événements, listeners et subscribers du projet, et un formulaire pour créer un subscriber depuis un modèle.'], { target: 'tool-sfEvents', ghost: [{ target: 'tool-sfEvents', click: true }], do: { action: 'symfonyEvents' }, wait: { tool: 'sfEvents' } }),
|
|
step('messenger-window', ['Messenger', '**Click the Messenger button**: messages, handlers, transports and routing, and a **worker** you start to consume the queue. Create a message and its handler from the window, or from New… > Message and handler.'], ['Messenger', '**Cliquez sur le bouton Messenger** : messages, handlers, transports et routage, et un **worker** à démarrer pour consommer la file. Créez un message et son handler depuis la fenêtre, ou depuis Nouveau… > Message and handler.'], { target: 'tool-messenger', ghost: [{ target: 'tool-messenger', click: true }], do: { action: 'messengerTool' }, wait: { tool: 'messenger' } }),
|
|
]),
|
|
C('api', '14. API Platform, OpenAPI and HTTP Client', '14. API Platform, OpenAPI et client HTTP', [
|
|
step('api-install', ['Install API Platform', 'API Platform turns an entity into a REST API. If it is not installed yet: **click + New, then "Install API Platform…"** and confirm (Composer runs with live output, no restart). The step ticks when config/packages/api_platform.yaml exists; if it already does, it ticks at once.'], ['Installer API Platform', 'API Platform transforme une entité en API REST. S\'il n\'est pas installé : **cliquez sur + New puis « Install API Platform… »** et confirmez (Composer s\'exécute avec la sortie en direct, sans redémarrage). L\'étape se coche quand config/packages/api_platform.yaml existe ; s\'il existe déjà, elle se coche tout de suite.'], { target: 'new-button', ghost: [{ target: 'new-button', click: true }], do: [{ action: 'newHub' }, { click: 'new-install-api-platform' }, { click: 'confirm-ok' }], wait: exists('config/packages/api_platform.yaml') }),
|
|
step('api-open', ['The API Platform window', '**Click the API Platform button** (bottom row of buttons, or in the right column) to list the classes.'], ['La fenêtre API Platform', '**Cliquez sur le bouton API Platform** pour lister les classes.'], { target: 'tool-apiplatform', ghost: [{ target: 'tool-apiplatform', click: true }], do: { action: 'apiPlatformTool' }, wait: { tool: 'apiplatform' } }),
|
|
step('api-expose', ['Expose Product', '**Click Product** in the class list on the left, then **click "Expose it with #[ApiResource]"**: the attribute is written (a preview first, then **Apply**) and the options (operations, groups, pagination, filters) appear.'], ['Exposer Product', '**Cliquez sur Product** dans la liste des classes à gauche, puis **sur « Expose it with #[ApiResource] »** : l\'attribut est écrit (aperçu d\'abord, puis **Apply**) et les options (opérations, groupes, pagination, filtres) apparaissent.'], { target: 'api-class-Product', before: { tool: 'apiplatform' }, ghost: [{ target: 'api-class-Product', click: true }, { target: 'api-expose', click: true }], do: [{ click: 'api-class-Product' }, { click: 'api-expose' }, { click: 'change-apply' }], wait: { check: 'contains:src/Entity/Product.php~#\\[ApiResource' } }),
|
|
step('api-http', ['The HTTP Client', '**Click the HTTP Client button**: requests with variables, environments and tests on the response.'], ['Le client HTTP', '**Cliquez sur le bouton HTTP Client** : des requêtes avec variables, environnements et tests sur la réponse.'], { target: 'tool-httpClient', ghost: [{ target: 'tool-httpClient', click: true }], do: { action: 'httpClientTool' }, wait: { tool: 'httpClient' } }),
|
|
step('api-refresh', ['Refresh from the API', '**Click the blue "Refresh from the API (OpenAPI / API Platform)" button**: the IDE reads the OpenAPI description of your local site (or the code) and makes a collection: a folder per resource, a request per operation. The site must be running.'], ['Actualiser depuis l\'API', '**Cliquez sur le bouton bleu « Refresh from the API (OpenAPI / API Platform) »** : l\'IDE lit la description OpenAPI de votre site local (ou le code) et crée une collection : un dossier par ressource, une requête par opération. Le site doit tourner.'], { target: 'http-refresh-api', before: { tool: 'httpClient' }, ghost: [{ target: 'http-refresh-api', click: true }], do: { click: 'http-refresh-api' }, wait: { click: 'http-refresh-api' } }),
|
|
step('api-pick', ['Pick a request', 'In the collection on the left, **open the Product folder and click a GET request** (for example the list of /api/products): it opens on the right, ready to send.'], ['Choisir une requête', 'Dans la collection à gauche, **ouvrez le dossier Product et cliquez sur une requête GET** (par exemple la liste de /api/products) : elle s\'ouvre à droite, prête à partir.'], { target: 'http-request-GET', before: [{ tool: 'httpClient' }, { click: 'http-folder-Product', unless: 'http-request-GET' }], ghost: [{ target: 'http-request-GET', click: true }], do: [{ click: 'http-folder-Product', unless: 'http-request-GET' }, { click: 'http-request-GET' }], wait: { click: 'http-request-GET' }, back: { en: 'The folder is closed: open Product in the collection list.', fr: 'Le dossier est fermé : ouvrez Product dans la liste de la collection.' } }),
|
|
step('api-send', ['Send it', '**Click the blue "Send" button.** Expected: a green **200** under the request: the step ticks when the answer is 2xx (the site must be running).'], ['Envoyer', '**Cliquez sur le bouton bleu « Send ».** Attendu : un **200** vert sous la requête : l\'étape se coche quand la réponse est en 2xx (le site doit être démarré).'], { target: 'http-send', before: { tool: 'httpClient' }, ghost: [{ target: 'http-send', click: true }], do: { click: 'http-send' }, wait: { check: 'http-2xx' } }),
|
|
]),
|
|
C('tests', '15. Tests', '15. Tests', [
|
|
step('tests-open', ['The Tests window', '**Click the Tests button** (bottom): PHPUnit tests as a tree.'], ['La fenêtre Tests', '**Cliquez sur le bouton Tests** (en bas) : les tests PHPUnit en arbre.'], { target: 'tool-tests', ghost: [{ target: 'tool-tests', click: true }], do: { action: 'testsTool' }, wait: { tool: 'tests' } }),
|
|
step('tests-new', ['A first test', 'A new Symfony project has no test yet, so the Tests window has nothing to run. **Open New… and click "File…"**, and create tests/ProductTest.php with a first test of the Product entity (**Do it for me** writes it).'], ['Un premier test', 'Un nouveau projet Symfony n\'a pas encore de test : la fenêtre Tests n\'a rien à lancer. **Ouvrez Nouveau… et cliquez sur « File… »**, et créez tests/ProductTest.php avec un premier test de l\'entité Product (**Faites-le pour moi** l\'écrit).'], { target: 'new-button', ghost: [{ target: 'new-button', click: true }], do: { write: { path: 'tests/ProductTest.php', content: '<?php\n\nnamespace App\\Tests;\n\nuse App\\Entity\\Product;\nuse PHPUnit\\Framework\\TestCase;\n\nfinal class ProductTest extends TestCase\n{\n public function testThePriceIsKept(): void\n {\n $product = (new Product())->setName(\'Cake\')->setPrice(4.5);\n\n self::assertSame(4.5, $product->getPrice());\n }\n}\n' } }, wait: exists('tests/ProductTest.php') }),
|
|
step('tests-run', ['Run all', '**Click the green play arrow** at the top of the Tests window: all the tests run. Rerun the failed ones, or run with **coverage**: covered lines are marked in the editor gutter.'], ['Tout lancer', '**Cliquez sur la flèche verte** en haut de la fenêtre Tests : tous les tests s\'exécutent. Relancez les échecs, ou lancez avec la **couverture** : les lignes couvertes sont marquées dans la gouttière.'], { target: 'tests-run-all', before: { tool: 'tests' }, ghost: [{ target: 'tests-run-all', click: true }], do: { click: 'tests-run-all' }, wait: { click: 'tests-run-all' } }),
|
|
]),
|
|
C('translations', '16. Translations', '16. Traductions', [
|
|
step('translations-window', ['Keys by language', '**Click the Translations button**: the code is scanned and keys shown by language (missing, unused, same as the source). Add a key in every language at once; translate with AI.'], ['Clés par langue', '**Cliquez sur le bouton Translations** : le code est analysé et les clés affichées par langue (manquantes, inutilisées, identiques à la source). Ajoutez une clé dans toutes les langues d\'un coup ; traduisez avec l\'IA.'], { target: 'tool-translations', ghost: [{ target: 'tool-translations', click: true }], do: { action: 'translationsTool' }, wait: { tool: 'translations' }, tip: ['A new Symfony project has no translation file yet: the window then offers "Add a language…"; the keys appear once translations/*.yaml files exist (messages.fr.yaml...).', 'Un nouveau projet Symfony n\'a pas encore de fichier de traduction : la fenêtre propose alors « Add a language… » ; les clés apparaissent dès que des fichiers translations/*.yaml existent (messages.fr.yaml...).'] }),
|
|
]),
|
|
C('scripts', '17. Scripts and Security Audit', '17. Scripts et audit de sécurité', [
|
|
step('scripts-window', ['Scripts', '**Click the Scripts button**: the Makefile, Castor, composer and npm tasks of the project; pin one to the tool bar or give it a shortcut.'], ['Scripts', '**Cliquez sur le bouton Scripts** : les tâches Makefile, Castor, composer et npm du projet ; épinglez-en une dans la barre d\'outils ou donnez-lui un raccourci.'], { target: 'tool-scripts', ghost: [{ target: 'tool-scripts', click: true }], do: { action: 'scriptsTool' }, wait: { tool: 'scripts' } }),
|
|
step('audit-window', ['Security Audit', '**Click the Security Audit button**: checks on the code (injection, SSRF, secrets...), an AI review if you want, patches. Exploit proofs only target your local site.'], ['Audit de sécurité', '**Cliquez sur le bouton Security Audit** : des vérifications du code (injection, SSRF, secrets...), une revue par IA si vous le voulez, des correctifs. Les preuves d\'exploitation ne visent que votre site local.'], { target: 'tool-audit', ghost: [{ target: 'tool-audit', click: true }], do: { action: 'securityAuditTool' }, wait: { tool: 'audit' } }),
|
|
]),
|
|
C('next', '18. Where to go next', '18. Pour aller plus loin', [
|
|
step('next-docs', ['The documentation', 'Every window has a page in the **Doc**: read the ones that interest you. You can restart this tutorial or jump to any step from the contents list, and find it again in **Help > Symfony tutorial**.'], ['La documentation', 'Chaque fenêtre a une page dans la **Doc** : lisez celles qui vous intéressent. Vous pouvez recommencer ce tutoriel ou sauter à une étape depuis la table des matières, et le retrouver dans **Help > Symfony tutorial**.'], { target: 'doc-button', ghost: [{ target: 'doc-button', click: true }], do: { docs: 'index' } }),
|
|
step('next-board-git', ['Board and Git', 'The **Board** (Kanban of tasks and notes) and **Git** (commit with Ctrl+K, history, branches) finish the tour. Congratulations: you have seen the IDE\'s Symfony tools!'], ['Board et Git', 'Le **Board** (Kanban de tâches et notes) et **Git** (commit avec Ctrl+K, historique, branches) terminent la visite. Bravo : vous avez vu les outils Symfony de l\'IDE !'], { target: ['tool-board', 'tool-commit'], do: { tool: 'board' } }),
|
|
]),
|
|
],
|
|
};
|