Skip to content

Commit 11bc9f0

Browse files
committed
iterate
1 parent be191ce commit 11bc9f0

File tree

36 files changed

+98
-220
lines changed

36 files changed

+98
-220
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ if (!class_exists(Application::class)) {
4747
}
4848

4949
$filesystem = new Filesystem();
50-
$kitSynchronizer = new KitSynchronizer($filesystem, new RecipeSynchronizer($filesystem));
50+
$kitSynchronizer = new KitSynchronizer(new RecipeSynchronizer($filesystem));
5151
$kitFactory = new KitFactory($filesystem, $kitSynchronizer);
5252

5353
(new Application())->add($command = new DebugKitCommand($kitFactory))

src/Toolkit/config/services.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@
7575

7676
->set('.ux_toolkit.kit.kit_synchronizer', KitSynchronizer::class)
7777
->args([
78-
service('filesystem'),
7978
service('.ux_toolkit.recipe.recipe_synchronizer'),
8079
])
8180

@@ -87,8 +86,5 @@
8786
])
8887

8988
->set('.ux_toolkit.recipe.recipe_synchronizer', RecipeSynchronizer::class)
90-
->args([
91-
service('filesystem'),
92-
])
9389
;
9490
};

src/Toolkit/src/Assert.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,4 @@ public static function phpPackageName(string $name): void
5555
throw new \InvalidArgumentException(\sprintf('Invalid PHP package name "%s".', $name));
5656
}
5757
}
58-
59-
public static function stimulusControllerName(string $name): void
60-
{
61-
if (1 !== preg_match('/^[a-z][a-z0-9-]*[a-z0-9]$/', $name)) {
62-
throw new \InvalidArgumentException(\sprintf('Invalid Stimulus controller name "%s".', $name));
63-
}
64-
}
6558
}

src/Toolkit/src/Command/CreateKitCommand.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
7878

7979
// Create the kit
8080
$this->filesystem->dumpFile('manifest.json', json_encode([
81+
'$schema' => '../vendor/symfony/ux-toolkit/schema-kit-v1.json',
8182
'name' => $kitName,
8283
'description' => 'A custom kit for Symfony UX Toolkit.',
8384
'homepage' => $kitHomepage,
@@ -117,7 +118,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
117118
);
118119

119120
$this->filesystem->dumpFile('Button/manifest.json', json_encode([
120-
'$schema' => '../vendor/symfony/ux-toolkit/schemas/component.schema.json',
121+
'$schema' => '../vendor/symfony/ux-toolkit/schema-kit-recipe-v1.json',
121122
'name' => 'Button',
122123
'description' => 'A clickable element that triggers actions or events, supporting various styles and states.',
123124
'dependencies' => (object) [
@@ -127,7 +128,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
127128
],
128129
], \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES));
129130

130-
$io->success('Your kit has been scaffolded, enjoy!');
131+
$io->success('Your kit has been scaffolded, happy crafting!');
131132

132133
return self::SUCCESS;
133134
}

src/Toolkit/src/Command/InstallComponentCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
use Symfony\Component\Console\Style\SymfonyStyle;
2121
use Symfony\Component\Filesystem\Filesystem;
2222
use Symfony\Component\Filesystem\Path;
23-
use Symfony\UX\Toolkit\File\File;
23+
use Symfony\UX\Toolkit\File;
2424
use Symfony\UX\Toolkit\Installer\Installer;
2525
use Symfony\UX\Toolkit\Kit\Kit;
2626
use Symfony\UX\Toolkit\Recipe\Recipe;

src/Toolkit/src/File/File.php renamed to src/Toolkit/src/File.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Symfony\UX\Toolkit\File;
12+
namespace Symfony\UX\Toolkit;
1313

1414
use Symfony\Component\Filesystem\Path;
1515

src/Toolkit/src/Installer/InstallationReport.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
namespace Symfony\UX\Toolkit\Installer;
1515

1616
use Symfony\UX\Toolkit\Dependency\PhpPackageDependency;
17-
use Symfony\UX\Toolkit\File\File;
17+
use Symfony\UX\Toolkit\File;
1818

1919
/**
2020
* Represents the output after an installation.

src/Toolkit/src/Installer/Pool.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
namespace Symfony\UX\Toolkit\Installer;
1515

1616
use Symfony\UX\Toolkit\Dependency\PhpPackageDependency;
17-
use Symfony\UX\Toolkit\File\File;
17+
use Symfony\UX\Toolkit\File;
1818
use Symfony\UX\Toolkit\Recipe\Recipe;
1919

2020
/**

src/Toolkit/src/Installer/PoolResolver.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818
use Symfony\UX\Toolkit\Kit\Kit;
1919
use Symfony\UX\Toolkit\Recipe\Recipe;
2020

21+
/**
22+
* @author Hugo Alliaume <[email protected]>
23+
*
24+
* @internal
25+
*/
2126
final class PoolResolver
2227
{
2328
public function resolveForRecipe(Kit $kit, Recipe $recipe): Pool

src/Toolkit/src/Kit/KitContextRunner.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ public function findAnonymousComponentTemplate(string $name): ?string
9696
// TODO: We assume that the component can be found in the recipe with the same name
9797
if ($recipe->manifest->name === $name) {
9898
foreach ($recipe->getFiles() as $file) {
99-
if (str_ends_with($file->toRelativePathName, $name.'.html.twig')) {
100-
return $file->toRelativePathName;
99+
if (str_ends_with($file->sourceRelativePathName, $name.'.html.twig')) {
100+
return $file->sourceRelativePathName;
101101
}
102102
}
103103
}

0 commit comments

Comments
 (0)