Commit abc3d74
committed
feature #2986 [Toolkit] Rework kits architecture, change term for "recipe" (Kocal)
This PR was squashed before being merged into the 2.x branch.
Discussion
----------
[Toolkit] Rework kits architecture, change term for "recipe"
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | yes <!-- please update src/**/CHANGELOG.md files -->
| Docs? | no <!-- required for new features -->
| Issues | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License | MIT
<!--
Replace this notice by a description of your feature/bugfix.
This will help reviewers and should be a good start for the documentation.
Additionally (see https://symfony.com/releases):
- Always add tests and ensure they pass.
- For new features, provide some code snippets to help understand usage.
- Features and deprecations must be submitted against branch main.
- Update/add documentation as required (we can help!)
- Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry
- Never break backward compatibility (see https://symfony.com/bc).
-->
This big PR modify the kits architecture from Toolkit, I get a lot of inspiration from Symfony Recipes and I think we are on something really really good.
The actual architecture was too coupled to a Symfony application structure, which made things easy for the website but not for working on "Recipes" (previously known as Components").
Before:
```
➜ Toolkit git:(2.x) tree kits/shadcn/
kits/shadcn/
├── AspectRatio
│ └── examples
├── docs
│ └── components
│ ├── Alert.md
│ ├── AspectRatio.md
│ ├── Avatar.md
│ ├── Badge.md
│ ├── Breadcrumb.md
│ ├── Button.md
│ ├── Card.md
│ ├── Checkbox.md
│ ├── Input.md
│ ├── Label.md
│ ├── Pagination.md
│ ├── Progress.md
│ ├── Select.md
│ ├── Separator.md
│ ├── Skeleton.md
│ ├── Switch.md
│ ├── Table.md
│ └── Textarea.md
├── INSTALL.md
├── manifest.json
└── templates
└── components
├── Alert
│ ├── Description.html.twig
│ ├── Description.meta.json
│ ├── Title.html.twig
│ └── Title.meta.json
├── Alert.html.twig
├── Alert.meta.json
├── AspectRatio.html.twig
├── AspectRatio.meta.json
├── Avatar
│ ├── Image.html.twig
│ ├── Image.meta.json
│ ├── Text.html.twig
│ └── Text.meta.json
├── Avatar.html.twig
├── Avatar.meta.json
├── Badge.html.twig
├── Badge.meta.json
├── Breadcrumb
│ ├── Ellipsis.html.twig
│ ├── Ellipsis.meta.json
│ ├── Item.html.twig
│ ├── Item.meta.json
│ ├── Link.html.twig
│ ├── Link.meta.json
│ ├── List.html.twig
│ ├── List.meta.json
│ ├── Page.html.twig
│ ├── Page.meta.json
│ ├── Separator.html.twig
│ └── Separator.meta.json
├── Breadcrumb.html.twig
├── Breadcrumb.meta.json
├── Button.html.twig
├── Button.meta.json
├── Card
│ ├── Content.html.twig
│ ├── Content.meta.json
│ ├── Description.html.twig
│ ├── Description.meta.json
│ ├── Footer.html.twig
│ ├── Footer.meta.json
│ ├── Header.html.twig
│ ├── Header.meta.json
│ ├── Title.html.twig
│ └── Title.meta.json
├── Card.html.twig
├── Card.meta.json
├── Checkbox.html.twig
├── Checkbox.meta.json
├── Input.html.twig
├── Input.meta.json
├── Label.html.twig
├── Label.meta.json
├── Pagination
│ ├── Content.html.twig
│ ├── Content.meta.json
│ ├── Ellipsis.html.twig
│ ├── Ellipsis.meta.json
│ ├── Item.html.twig
│ ├── Item.meta.json
│ ├── Link.html.twig
│ ├── Link.meta.json
│ ├── Next.html.twig
│ ├── Next.meta.json
│ ├── Previous.html.twig
│ └── Previous.meta.json
├── Pagination.html.twig
├── Pagination.meta.json
├── Progress.html.twig
├── Progress.meta.json
├── Select.html.twig
├── Select.meta.json
├── Separator.html.twig
├── Separator.meta.json
├── Skeleton.html.twig
├── Skeleton.meta.json
├── Switch.html.twig
├── Switch.meta.json
├── Table
│ ├── Body.html.twig
│ ├── Body.meta.json
│ ├── Caption.html.twig
│ ├── Caption.meta.json
│ ├── Cell.html.twig
│ ├── Cell.meta.json
│ ├── Footer.html.twig
│ ├── Footer.meta.json
│ ├── Head.html.twig
│ ├── Head.meta.json
│ ├── Header.html.twig
│ ├── Header.meta.json
│ ├── Row.html.twig
│ └── Row.meta.json
├── Table.html.twig
├── Table.meta.json
├── Textarea.html.twig
└── Textarea.meta.json
```
after:
```
➜ Toolkit git:(toolkit-rework-component-for-recipe) tree kits/shadcn/
├── Alert
│ ├── EXAMPLES.md
│ ├── manifest.json
│ └── templates
│ └── components
│ ├── Alert
│ │ ├── Description.html.twig
│ │ └── Title.html.twig
│ └── Alert.html.twig
├── AspectRatio
│ ├── EXAMPLES.md
│ ├── manifest.json
│ └── templates
│ └── components
│ └── AspectRatio.html.twig
├── Avatar
│ ├── EXAMPLES.md
│ ├── manifest.json
│ └── templates
│ └── components
│ ├── Avatar
│ │ ├── Image.html.twig
│ │ └── Text.html.twig
│ └── Avatar.html.twig
├── Badge
│ ├── EXAMPLES.md
│ ├── manifest.json
│ └── templates
│ └── components
│ └── Badge.html.twig
├── Breadcrumb
│ ├── EXAMPLES.md
│ ├── manifest.json
│ └── templates
│ └── components
│ ├── Breadcrumb
│ │ ├── Ellipsis.html.twig
│ │ ├── Item.html.twig
│ │ ├── Link.html.twig
│ │ ├── List.html.twig
│ │ ├── Page.html.twig
│ │ └── Separator.html.twig
│ └── Breadcrumb.html.twig
├── Button
│ ├── EXAMPLES.md
│ ├── manifest.json
│ └── templates
│ └── components
│ └── Button.html.twig
├── Card
│ ├── EXAMPLES.md
│ ├── manifest.json
│ └── templates
│ └── components
│ ├── Card
│ │ ├── Content.html.twig
│ │ ├── Description.html.twig
│ │ ├── Footer.html.twig
│ │ ├── Header.html.twig
│ │ └── Title.html.twig
│ └── Card.html.twig
├── Checkbox
│ ├── EXAMPLES.md
│ ├── manifest.json
│ └── templates
│ └── components
│ └── Checkbox.html.twig
├── Input
│ ├── EXAMPLES.md
│ ├── manifest.json
│ └── templates
│ └── components
│ └── Input.html.twig
├── INSTALL.md
├── Label
│ ├── EXAMPLES.md
│ ├── manifest.json
│ └── templates
│ └── components
│ └── Label.html.twig
├── manifest.json
├── Pagination
│ ├── EXAMPLES.md
│ ├── manifest.json
│ └── templates
│ └── components
│ ├── Pagination
│ │ ├── Content.html.twig
│ │ ├── Ellipsis.html.twig
│ │ ├── Item.html.twig
│ │ ├── Link.html.twig
│ │ ├── Next.html.twig
│ │ └── Previous.html.twig
│ └── Pagination.html.twig
├── Progress
│ ├── EXAMPLES.md
│ ├── manifest.json
│ └── templates
│ └── components
│ └── Progress.html.twig
├── Select
│ ├── EXAMPLES.md
│ ├── manifest.json
│ └── templates
│ └── components
│ └── Select.html.twig
├── Separator
│ ├── EXAMPLES.md
│ ├── manifest.json
│ └── templates
│ └── components
│ └── Separator.html.twig
├── Skeleton
│ ├── EXAMPLES.md
│ ├── manifest.json
│ └── templates
│ └── components
│ └── Skeleton.html.twig
├── Switch
│ ├── EXAMPLES.md
│ ├── manifest.json
│ └── templates
│ └── components
│ └── Switch.html.twig
├── Table
│ ├── EXAMPLES.md
│ ├── manifest.json
│ └── templates
│ └── components
│ ├── Table
│ │ ├── Body.html.twig
│ │ ├── Caption.html.twig
│ │ ├── Cell.html.twig
│ │ ├── Footer.html.twig
│ │ ├── Head.html.twig
│ │ ├── Header.html.twig
│ │ └── Row.html.twig
│ └── Table.html.twig
└── Textarea
├── EXAMPLES.md
├── manifest.json
└── templates
└── components
└── Textarea.html.twig
```
Now, everything under `kits/*/` **is a recipe**. There is no `Asset\Component` nor `Asset\StimulusController` anymore, everything was simplified a lot.
A Recipe:
- requires more files, but the organization is really better and more extensible
- has a `manifest.json` file, for describing its name, description, some dependencies (either PHP packages or other **Recipes**, which files to copy (and where), its **type** (either a `component`, or something else in the future), etc...
- has a `EXAMPLES.md` file, it's mainly internal for the Website
The CLI still works as expected:
https://github.com/user-attachments/assets/e954b783-b27a-4ffb-a3e8-e30621b667c2
The website too:
https://github.com/user-attachments/assets/4353dbba-8052-499e-a658-2e6ca6b5f39f
Commits
-------
39fb692 [Toolkit] Rework kits architecture, change term for "recipe"File tree
250 files changed
+2514
-2682
lines changed- src/Toolkit
- bin
- config
- doc
- kits/shadcn
- Alert
- templates/components
- Alert
- AspectRatio
- templates/components
- Avatar
- templates/components
- Avatar
- Badge
- templates/components
- Breadcrumb
- templates/components
- Breadcrumb
- Button
- templates/components
- Card
- templates/components
- Card
- Checkbox
- templates/components
- Input
- templates/components
- Label
- templates/components
- Pagination
- templates/components
- Pagination
- Progress
- templates/components
- Select
- templates/components
- Separator
- templates/components
- Skeleton
- templates/components
- Switch
- templates/components
- Table
- templates/components
- Table
- Textarea
- templates/components
- templates/components
- Alert
- Avatar
- Breadcrumb
- Card
- Pagination
- Table
- schemas
- src
- Asset
- Command
- Dependency
- File
- Installer
- Kit
- Recipe
- Registry
- tests
- Asset
- Command
- Dependency
- File
- Fixtures/kits
- with-circular-components-dependencies
- A
- templates/components
- B
- templates/components
- C
- templates/components
- with-stimulus-controllers
- assets/controllers
- users
- templates/components
- Functional
- __snapshots__
- Installer
- Kit
- Recipe
- Registry
- ux.symfony.com
- src
- Controller
- Toolkit
- UxPackage
- Service/Toolkit
- Twig/Components/Toolkit
- templates
- toolkit
- ux_packages
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
250 files changed
+2514
-2682
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
49 | | - | |
| 50 | + | |
| 51 | + | |
50 | 52 | | |
51 | 53 | | |
52 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | | - | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| 20 | + | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
| |||
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
37 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
38 | 46 | | |
39 | 47 | | |
40 | 48 | | |
| |||
75 | 83 | | |
76 | 84 | | |
77 | 85 | | |
| 86 | + | |
78 | 87 | | |
79 | 88 | | |
80 | 89 | | |
| |||
83 | 92 | | |
84 | 93 | | |
85 | 94 | | |
| 95 | + | |
| 96 | + | |
86 | 97 | | |
87 | 98 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
12 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | 28 | | |
31 | 29 | | |
32 | 30 | | |
| |||
37 | 35 | | |
38 | 36 | | |
39 | 37 | | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | 38 | | |
44 | 39 | | |
45 | 40 | | |
46 | | - | |
| 41 | + | |
47 | 42 | | |
48 | 43 | | |
49 | 44 | | |
50 | 45 | | |
51 | 46 | | |
52 | | - | |
| 47 | + | |
53 | 48 | | |
54 | | - | |
| 49 | + | |
| 50 | + | |
55 | 51 | | |
56 | 52 | | |
57 | 53 | | |
58 | 54 | | |
59 | 55 | | |
60 | | - | |
| 56 | + | |
61 | 57 | | |
62 | 58 | | |
63 | 59 | | |
| |||
96 | 92 | | |
97 | 93 | | |
98 | 94 | | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
112 | 144 | | |
113 | 145 | | |
114 | 146 | | |
| |||
117 | 149 | | |
118 | 150 | | |
119 | 151 | | |
120 | | - | |
| 152 | + | |
121 | 153 | | |
122 | 154 | | |
123 | | - | |
| 155 | + | |
124 | 156 | | |
125 | 157 | | |
126 | 158 | | |
| |||
Lines changed: 3 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
| 15 | + | |
38 | 16 | | |
39 | 17 | | |
40 | 18 | | |
| |||
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
3 | 9 | | |
4 | 10 | | |
5 | 11 | | |
| |||
Lines changed: 4 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
| 15 | + | |
26 | 16 | | |
27 | 17 | | |
28 | 18 | | |
| |||
34 | 24 | | |
35 | 25 | | |
36 | 26 | | |
37 | | - | |
| 27 | + | |
38 | 28 | | |
39 | 29 | | |
40 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
0 commit comments