Skip to content

Commit 2a5fc28

Browse files
authored
Merge pull request #4 from thelia/chore/beta1-alignment
Align the skills on the 3.0.0-beta1 release
2 parents 1268e32 + 05ee033 commit 2a5fc28

13 files changed

Lines changed: 106 additions & 75 deletions

File tree

plugins/thelia/.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "thelia",
33
"description": "Develop Thelia 3 with Claude Code: skills and agents for modules, Propel ORM, the API Platform bridge, the Flexy front-office, the default-twig back-office, and Thelia 2 to 3 migration.",
4-
"version": "0.2.0",
4+
"version": "0.3.0",
55
"author": {
66
"name": "Thelia"
77
},

plugins/thelia/skills/fresh-install-test/SKILL.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ description: >
44
Validates a fresh Thelia 3 install from an empty directory and empty database.
55
Use after a version bump, a merge, or any change to bin/install, bin/test-prepare,
66
bootstrap.php, or DatabaseSetup. Covers two scenarios: the thelia/thelia dev repo
7-
(with core/ as a path repository) and the thelia-project skeleton
8-
(simulating a new developer install via composer create-project).
7+
(with core/ as a path repository) and the thelia-project skeleton installed the way
8+
a new developer installs it, with composer create-project from the tagged releases.
99
---
1010

1111
# Skill: Fresh Install Test
@@ -22,9 +22,11 @@ Reusable validation protocol for a clean Thelia 3 installation. Run it after any
2222
## Prerequisites
2323

2424
- DDEV installed and running
25-
- SSH access to the GitHub repos under `thelia/*`
25+
- SSH access to the GitHub repos under `thelia/*` for the dev-repo scenario
2626
- The target workspace directory must be empty (the protocol deletes and recreates it)
2727

28+
Thelia 3 ships as tagged releases; there is no development branch to install from. Test 1 clones the development repository, whose default branch is `main`. Test 2 installs the published packages. While `3.0.0-beta1` is the newest tag, the skeleton needs `--stability=beta` (or an explicit `thelia/thelia-project:^3.0.0-beta1`), and a project's own `composer.json` needs `"minimum-stability": "beta"` with `"prefer-stable": true`.
29+
2830
---
2931

3032
## Test 1: thelia/thelia (dev repo with core/ as a path repository)
@@ -35,7 +37,7 @@ Reusable validation protocol for a clean Thelia 3 installation. Run it after any
3537
WORKSPACE=<path-to-your-workspace>
3638

3739
PROJECT=thelia-3
38-
BRANCH=twig # replace with the branch you want to test
40+
BRANCH=main # replace with the branch or tag you want to test
3941

4042
# 1. Full cleanup
4143
ddev stop --unlist $PROJECT 2>/dev/null
@@ -116,28 +118,28 @@ ddev exec php bin/console debug:container --deprecations | head -3
116118
## Test 2: thelia/thelia-project (simulates a new developer install)
117119

118120
```bash
119-
# Set WORKSPACE to the directory that will contain the cloned project.
121+
# Set WORKSPACE to the directory that will contain the project.
120122
WORKSPACE=<path-to-your-workspace>
121123

122124
PROJECT=thelia-project-test
123-
BRANCH=twig
124125

125126
# 1. Full cleanup
126127
ddev stop --unlist $PROJECT 2>/dev/null
127128
ddev delete -Oy $PROJECT 2>/dev/null
128129
rm -rf "$WORKSPACE/$PROJECT"
129130

130-
# 2. Clone
131+
# 2. Create the project from the tagged release
131132
cd "$WORKSPACE"
132-
git clone -b $BRANCH git@github.com:thelia/thelia-project.git $PROJECT
133+
composer create-project --stability=beta thelia/thelia-project $PROJECT
134+
# Equivalent, pinned: composer create-project thelia/thelia-project:^3.0.0-beta1 $PROJECT
133135
cd $PROJECT
134136

135137
# 3. Configure DDEV (MariaDB version can vary by host)
136138
ddev config --project-name=$PROJECT --project-type=symfony --docroot=public \
137139
--php-version=8.3 --webserver-type=nginx-fpm --database=mariadb:11.8
138140
ddev start
139141

140-
# 4. Install PHP dependencies
142+
# 4. Install PHP dependencies inside the container
141143
ddev exec composer install
142144

143145
# 5. Install Thelia with demo data and admin account
@@ -168,6 +170,7 @@ ddev exec php -r 'require "vendor/autoload.php"; echo Symfony\Component\HttpKern
168170
- `bootstrap.php` must NOT load `vendor/autoload.php` (doing so disables the Symfony Runtime via its `require_once` guard).
169171
- `public/index.php` must load `bootstrap.php` first, then `vendor/autoload_runtime.php`.
170172
- `bin/console` passes through `vendor/thelia/core/Thelia`, not the standard Symfony pattern.
173+
- Constraints in the generated `composer.json`: `^3.0.0-beta1` for `thelia/core` and the skeleton, `^1.0.0-beta1` for the templates, the module's current major for `thelia/*-module`, plus `"minimum-stability": "beta"` and `"prefer-stable": true`.
171174

172175
---
173176

plugins/thelia/skills/propel-thelia/SKILL.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,8 @@ public function setPassword($password) { ... }
563563
public function setPassword(?string $password = null): static { ... }
564564
```
565565

566+
Never widen a non-nullable Base signature: if the Base getter returns `string`, an override that returns `?string` is not a compatible signature and fails at load. Keep the Base contract and handle the empty case inside the method.
567+
566568
Common cases to align:
567569
- `getValue(): ?string` on Config, MetaData
568570
- `setPosition(?int $v = null): static` on Product, Content
@@ -633,7 +635,8 @@ Some methods that overrode Propel getters/setters with incompatible signatures w
633635
- **Singletons** `Translator::$instance` and `URL::$instance` must stay `?self = null` (fatal error in tests otherwise).
634636
- **`#[Ignore]` on `static` methods** crashes the Symfony Serializer. Never do this.
635637
- **Propel subprocess:** `PropelInitService` crashes when Propel is launched in a cold subprocess. Always boot `App\Kernel` in-process.
636-
- **`Base/` classes are regenerated.** Never edit them manually.
638+
- **`Base/` classes are regenerated.** Never edit them manually. Module models are generated under `var/propel/{APP_ENV}/model/`: a `Class not found` on `MyModuleQuery` usually means that cache is stale or was never built, not that the class is missing. Regenerate (`module:generate:model`, or re-run the post-activation) before looking for a namespace bug.
639+
- **Never widen a getter to nullable in a stub.** Overriding a non-nullable Base getter with a `?type` return is an incompatible signature and fails at load.
637640
- **`Collection` is no longer an iterator:** use `getIterator()`; the `current()`/`next()` methods are `@deprecated`.
638641
- **Strict setter typing:** setters now have native PHP types. Passing a `bool` to a `?int` setter (TINYINT) or a `float` to a `?string` setter (DECIMAL) raises a `TypeError`. Always cast explicitly.
639642
- **ENUM/SET are untyped:** ENUM/SET getters and properties have no native type (the getter returns a string, but Propel maps ENUM to int internally). Do not attempt to type them.

plugins/thelia/skills/thelia2/SKILL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
22
name: thelia2
3-
description: "Thelia 2.6 e-commerce framework (branch main, Symfony 6.4, API Platform 3.4, PHP 8.2+, Propel ORM, Smarty front + back + email + pdf). Covers module creation: BaseModule lifecycle 8 methods (install/update/preActivation/postActivation/registerHooks/preDeactivation/postDeactivation/destroy), config.xml/module.xml/schema.xml (XSD module-2_2.xsd, thelia-1.0.xsd), Propel-AP Bridge (PropelResourceInterface, PropelResourceTrait, ResourceAddonInterface, ResourceAddonTrait, AbstractTranslatableResource, I18nCollection, Relation/Column/CompositeIdentifiers attributes), 7 custom Propel filters (SearchFilter/OrderFilter/BooleanFilter/RangeFilter/DateFilter/NotInFilter/AbstractFilter), JWT Lexik 2.x without refresh, Smarty back+front hooks (BaseHook + getSubscribedHooks(), HookRenderEvent .add() vs HookRenderBlockEvent fragments), loops (BaseLoop + PropelSearchLoopInterface vs ArraySearchLoopInterface mutex, BaseI18nLoop, SearchLoopInterface, ArgumentCollection 10 factories), forms (BaseForm + init() non-constructor + getName() auto-FQCN snake_case + ParserContext, success_url/error_url hidden fields), 175 events TheliaEvents (ORDER_BEFORE_PAYMENT, AFTER_CARTADDITEM, FORM_BEFORE_BUILD/AFTER_BUILD, MODULE_PAY, MODULE_DELIVERY_GET_POSTAGE), 20 Smarty plugins / ~85 tags ({loop}, {ifloop}, {elseloop}, {pageloop}, {hook}, {hookblock}, {form}, {form_field}, {form_hidden_fields}, {intl}, {url}, {token_url}, {theme}, {theme_url}, {flash}, {check_auth}, {format_money}, {format_date}, {encore_entry_script_tags}), payment/delivery modules (AbstractPaymentModule pay()/isValidPayment(), AbstractDeliveryModule getPostage()), TheliaSmarty local module + SmartyParser, RegisterHookListenersPass, RegisterLoopPass. Use when working on Thelia 2.6 projects, branch main repo thelia/thelia, creating modules in local/modules, building Smarty front+back+email+pdf templates, exposing API resources, writing hooks/loops/forms, integrating payment/delivery modules. Triggers on: thelia 2, thelia 2.6, branch main, BaseModule, config.xml, module.xml, schema.xml, postActivation, registerHooks, TheliaEvents, BaseHook, getSubscribedHooks, HookRenderEvent, HookRenderBlockEvent, BaseLoop, PropelSearchLoopInterface, ArraySearchLoopInterface, BaseI18nLoop, BaseForm, ParserContext, SmartyParser, TheliaSmarty, Smarty, {loop}, {hook}, {hookblock}, {form}, {intl}, {url}, {pageloop}, {ifloop}, {elseloop}, {form_field}, {form_hidden_fields}, {check_auth}, {format_money}, PropelResourceInterface, PropelResourceTrait, ResourceAddonInterface, ResourceAddonTrait, AbstractTranslatableResource, I18nCollection, ApiFilter SearchFilter OrderFilter BooleanFilter RangeFilter DateFilter NotInFilter, Relation Column CompositeIdentifiers, local/modules, AbstractPaymentModule, AbstractDeliveryModule, ORDER_BEFORE_PAYMENT, AFTER_CARTADDITEM, CART_ADDITEM, Api/Resource/, normalizationContext per operation, GROUP_ADMIN_READ_SINGLE, BankCoordinatesForm, IBAN normalization, setPostage save, module.configuration save Controller, routing.xml admin module, token_url CSRF, final readonly tests Reflection, BaseAdminController checkAuth, validateForm, generateSuccessRedirect, generateErrorRedirect. Do NOT trigger for Thelia 3 projects (look for Twig .html.twig templates, FlexyBundle, LiveComponent, TwigComponent, AP 4.3 standalone, branch twig, IntegrationTestCase, FixtureFactory, resources(), attr(), CartFacade)."
3+
description: "Thelia 2.6 e-commerce framework (maintenance branch 2.6, Symfony 6.4, API Platform 3.4, PHP 8.2+, Propel ORM, Smarty front + back + email + pdf). Covers module creation: BaseModule lifecycle 8 methods (install/update/preActivation/postActivation/registerHooks/preDeactivation/postDeactivation/destroy), config.xml/module.xml/schema.xml (XSD module-2_2.xsd, thelia-1.0.xsd), Propel-AP Bridge (PropelResourceInterface, PropelResourceTrait, ResourceAddonInterface, ResourceAddonTrait, AbstractTranslatableResource, I18nCollection, Relation/Column/CompositeIdentifiers attributes), 7 custom Propel filters (SearchFilter/OrderFilter/BooleanFilter/RangeFilter/DateFilter/NotInFilter/AbstractFilter), JWT Lexik 2.x without refresh, Smarty back+front hooks (BaseHook + getSubscribedHooks(), HookRenderEvent .add() vs HookRenderBlockEvent fragments), loops (BaseLoop + PropelSearchLoopInterface vs ArraySearchLoopInterface mutex, BaseI18nLoop, SearchLoopInterface, ArgumentCollection 10 factories), forms (BaseForm + init() non-constructor + getName() auto-FQCN snake_case + ParserContext, success_url/error_url hidden fields), 175 events TheliaEvents (ORDER_BEFORE_PAYMENT, AFTER_CARTADDITEM, FORM_BEFORE_BUILD/AFTER_BUILD, MODULE_PAY, MODULE_DELIVERY_GET_POSTAGE), 20 Smarty plugins / ~85 tags ({loop}, {ifloop}, {elseloop}, {pageloop}, {hook}, {hookblock}, {form}, {form_field}, {form_hidden_fields}, {intl}, {url}, {token_url}, {theme}, {theme_url}, {flash}, {check_auth}, {format_money}, {format_date}, {encore_entry_script_tags}), payment/delivery modules (AbstractPaymentModule pay()/isValidPayment(), AbstractDeliveryModule getPostage()), TheliaSmarty local module + SmartyParser, RegisterHookListenersPass, RegisterLoopPass. Use when working on Thelia 2.6 projects, maintenance branch 2.6 of thelia/thelia, creating modules in local/modules, building Smarty front+back+email+pdf templates, exposing API resources, writing hooks/loops/forms, integrating payment/delivery modules. Triggers on: thelia 2, thelia 2.6, branch 2.6, thelia2 module branch, BaseModule, config.xml, module.xml, schema.xml, postActivation, registerHooks, TheliaEvents, BaseHook, getSubscribedHooks, HookRenderEvent, HookRenderBlockEvent, BaseLoop, PropelSearchLoopInterface, ArraySearchLoopInterface, BaseI18nLoop, BaseForm, ParserContext, SmartyParser, TheliaSmarty, Smarty, {loop}, {hook}, {hookblock}, {form}, {intl}, {url}, {pageloop}, {ifloop}, {elseloop}, {form_field}, {form_hidden_fields}, {check_auth}, {format_money}, PropelResourceInterface, PropelResourceTrait, ResourceAddonInterface, ResourceAddonTrait, AbstractTranslatableResource, I18nCollection, ApiFilter SearchFilter OrderFilter BooleanFilter RangeFilter DateFilter NotInFilter, Relation Column CompositeIdentifiers, local/modules, AbstractPaymentModule, AbstractDeliveryModule, ORDER_BEFORE_PAYMENT, AFTER_CARTADDITEM, CART_ADDITEM, Api/Resource/, normalizationContext per operation, GROUP_ADMIN_READ_SINGLE, BankCoordinatesForm, IBAN normalization, setPostage save, module.configuration save Controller, routing.xml admin module, token_url CSRF, final readonly tests Reflection, BaseAdminController checkAuth, validateForm, generateSuccessRedirect, generateErrorRedirect. Do NOT trigger for Thelia 3 projects (look for Twig .html.twig templates, FlexyBundle, LiveComponent, TwigComponent, AP 4.3 standalone, IntegrationTestCase, FixtureFactory, resources(), attr(), CartFacade)."
44
---
55

66
# Thelia 2.6: Module Development Guide
77

8-
> Stack: Symfony 6.4, API Platform 3.4 (bundle), PHP 8.2+, Propel ORM, branch `main`. Front + back + email + pdf in Smarty exclusively (no Twig). API JSON-LD only. JWT Lexik 2.x without refresh. No Doctrine, no Messenger, no Turbo/Mercure, no LiveComponent.
8+
> Stack: Symfony 6.4, API Platform 3.4 (bundle), PHP 8.2+, Propel ORM. Maintenance happens on the `2.6` branch of `thelia/thelia`; Thelia 2 module branches are named `thelia2`. Front + back + email + pdf in Smarty exclusively (no Twig). API JSON-LD only. JWT Lexik 2.x without refresh. No Doctrine, no Messenger, no Turbo/Mercure, no LiveComponent.
99
1010
## 1. Decision router "I want X"
1111

0 commit comments

Comments
 (0)