Skip to content

Commit 46689fe

Browse files
committed
[Toolkit] Rework kits architecture
1 parent 7014713 commit 46689fe

File tree

69 files changed

+631
-457
lines changed

Some content is hidden

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

69 files changed

+631
-457
lines changed

src/Toolkit/bin/ux-toolkit-kit-debug

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ use Symfony\Contracts\Service\ServiceProviderInterface;
2222
use Symfony\UX\Toolkit\Command\DebugKitCommand;
2323
use Symfony\UX\Toolkit\Kit\KitSynchronizer;
2424
use Symfony\UX\Toolkit\Kit\KitFactory;
25+
use Symfony\UX\Toolkit\Recipe\RecipeSynchronizer;
2526
use Symfony\UX\Toolkit\Registry\GitHubRegistry;
2627
use Symfony\UX\Toolkit\Registry\LocalRegistry;
2728
use Symfony\UX\Toolkit\Registry\RegistryFactory;
@@ -46,7 +47,8 @@ if (!class_exists(Application::class)) {
4647
}
4748

4849
$filesystem = new Filesystem();
49-
$kitFactory = new KitFactory($filesystem, new KitSynchronizer($filesystem));
50+
$kitSynchronizer = new KitSynchronizer($filesystem, new RecipeSynchronizer($filesystem));
51+
$kitFactory = new KitFactory($filesystem, $kitSynchronizer);
5052

5153
(new Application())->add($command = new DebugKitCommand($kitFactory))
5254
->getApplication()

src/Toolkit/config/services.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Symfony\UX\Toolkit\Kit\KitContextRunner;
1717
use Symfony\UX\Toolkit\Kit\KitFactory;
1818
use Symfony\UX\Toolkit\Kit\KitSynchronizer;
19+
use Symfony\UX\Toolkit\Recipe\RecipeSynchronizer;
1920
use Symfony\UX\Toolkit\Registry\GitHubRegistry;
2021
use Symfony\UX\Toolkit\Registry\LocalRegistry;
2122
use Symfony\UX\Toolkit\Registry\RegistryFactory;
@@ -75,6 +76,7 @@
7576
->set('.ux_toolkit.kit.kit_synchronizer', KitSynchronizer::class)
7677
->args([
7778
service('filesystem'),
79+
service('.ux_toolkit.recipe.recipe_synchronizer'),
7880
])
7981

8082
->set('ux_toolkit.kit.kit_context_runner', KitContextRunner::class)
@@ -83,5 +85,10 @@
8385
service('twig'),
8486
service('ux.twig_component.component_factory'),
8587
])
88+
89+
->set('.ux_toolkit.recipe.recipe_synchronizer', RecipeSynchronizer::class)
90+
->args([
91+
service('filesystem'),
92+
])
8693
;
8794
};

src/Toolkit/kits/shadcn/Alert/manifest.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
{
2-
"$schema": "../../../schemas/component.json",
2+
"$schema": "../../../schema-kit-recipe-v1.json",
3+
"type": "component",
34
"name": "Alert",
45
"description": "A notification component that displays important messages with an icon, title, and description.",
6+
"copy-files": {
7+
"templates/": "templates/"
8+
},
9+
"examples-dir": "examples/",
510
"dependencies": [
611
{
712
"type": "php",
@@ -16,4 +21,4 @@
1621
"package": "tales-from-a-dev/twig-tailwind-extra"
1722
}
1823
]
19-
}
24+
}
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
{
2-
"$schema": "../../../schemas/component.json",
2+
"$schema": "../../../schema-kit-recipe-v1.json",
3+
"type": "component",
34
"name": "AspectRatio",
45
"description": "A container that maintains a specific width-to-height ratio for its content.",
6+
"copy-files": {
7+
"templates/": "templates/"
8+
},
9+
"examples-dir": "examples/",
510
"dependencies": [
611
{
712
"type": "php",
813
"package": "twig/extra-bundle"
914
}
1015
]
11-
}
16+
}
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
{
2-
"$schema": "../../../schemas/component.json",
2+
"$schema": "../../../schema-kit-recipe-v1.json",
3+
"type": "component",
34
"name": "Avatar",
45
"description": "A circular element that displays a user's profile image or initials as a fallback.",
6+
"copy-files": {
7+
"templates/": "templates/"
8+
},
9+
"examples-dir": "examples/",
510
"dependencies": [
611
{
712
"type": "php",
813
"package": "tales-from-a-dev/twig-tailwind-extra"
914
}
1015
]
11-
}
16+
}

src/Toolkit/kits/shadcn/Badge/manifest.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
{
2-
"$schema": "../../../schemas/component.json",
2+
"$schema": "../../../schema-kit-recipe-v1.json",
3+
"type": "component",
34
"name": "Badge",
45
"description": "A small element that displays status, counts, or labels with optional icons.",
6+
"copy-files": {
7+
"templates/": "templates/"
8+
},
9+
"examples-dir": "examples/",
510
"dependencies": [
611
{
712
"type": "php",
@@ -16,4 +21,4 @@
1621
"package": "tales-from-a-dev/twig-tailwind-extra"
1722
}
1823
]
19-
}
24+
}
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
{
2-
"$schema": "../../../schemas/component.json",
2+
"$schema": "../../../schema-kit-recipe-v1.json",
3+
"type": "component",
34
"name": "Breadcrumb",
45
"description": "A navigation element that shows the current page's location in the site hierarchy with clickable links.",
6+
"copy-files": {
7+
"templates/": "templates/"
8+
},
9+
"examples-dir": "examples/",
510
"dependencies": [
611
{
712
"type": "php",
813
"package": "tales-from-a-dev/twig-tailwind-extra"
914
}
1015
]
11-
}
16+
}

src/Toolkit/kits/shadcn/Button/manifest.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
{
2-
"$schema": "../../../schemas/component.json",
2+
"$schema": "../../../schema-kit-recipe-v1.json",
3+
"type": "component",
34
"name": "Button",
45
"description": "A clickable element that triggers actions or events, supporting various styles and states.",
6+
"copy-files": {
7+
"templates/": "templates/"
8+
},
9+
"examples-dir": "examples/",
510
"dependencies": [
611
{
712
"type": "php",
@@ -16,4 +21,4 @@
1621
"package": "tales-from-a-dev/twig-tailwind-extra"
1722
}
1823
]
19-
}
24+
}
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
{
2-
"$schema": "../../../schemas/component.json",
2+
"$schema": "../../../schema-kit-recipe-v1.json",
3+
"type": "component",
34
"name": "Card",
45
"description": "A container that groups related content and actions into a box with optional header, content, and footer sections.",
6+
"copy-files": {
7+
"templates/": "templates/"
8+
},
9+
"examples-dir": "examples/",
510
"dependencies": [
611
{
712
"type": "php",
813
"package": "tales-from-a-dev/twig-tailwind-extra"
914
}
1015
]
11-
}
16+
}
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
{
2-
"$schema": "../../../schemas/component.json",
2+
"$schema": "../../../schema-kit-recipe-v1.json",
3+
"type": "component",
34
"name": "Checkbox",
45
"description": "A form control that allows the user to toggle between checked and unchecked states.",
6+
"copy-files": {
7+
"templates/": "templates/"
8+
},
9+
"examples-dir": "examples/",
510
"dependencies": [
611
{
712
"type": "php",
813
"package": "tales-from-a-dev/twig-tailwind-extra"
914
}
1015
]
11-
}
16+
}

0 commit comments

Comments
 (0)