Skip to content

Commit eb9d397

Browse files
committed
minor #2725 [Toolkit] Remove Kit "authors" (Kocal)
This PR was merged into the 2.x branch. Discussion ---------- [Toolkit] Remove Kit "authors" | Q | A | ------------- | --- | Bug fix? | no | New feature? | no <!-- 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). --> At the moment, knowing the "authors" kit has no interest at all and is not well implemented. Let's keep things simple and remove it, we can re-add it later if necessary. Commits ------- a46c456 [Toolkit] Remove Kit "authors"
2 parents f8466fb + a46c456 commit eb9d397

File tree

9 files changed

+14
-34
lines changed

9 files changed

+14
-34
lines changed

src/Toolkit/kits/shadcn/manifest.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@
33
"description": "Component based on the Shadcn UI library, one of the most popular design systems in JavaScript world.",
44
"license": "MIT",
55
"homepage": "https://ux.symfony.com/components",
6-
"authors": ["Shadcn", "Symfony Community"],
76
"ux-icon": "simple-icons:shadcnui"
87
}

src/Toolkit/src/Command/CreateKitCommand.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
6565
});
6666
$kitHomepage = $io->askQuestion($question);
6767

68-
// Get the kit author name
69-
$question = new Question("What's the name of the author?");
70-
$question->setValidator(function (?string $value) {
71-
if (empty($value)) {
72-
throw new \Exception('The author name cannot be empty.');
73-
}
74-
75-
return $value;
76-
});
77-
$kitAuthorName = $io->askQuestion($question);
78-
7968
// Get the kit license
8069
$question = new Question('What is the license of your kit?');
8170
$question->setValidator(function (string $value) {
@@ -91,7 +80,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
9180
$this->filesystem->dumpFile('manifest.json', json_encode([
9281
'name' => $kitName,
9382
'homepage' => $kitHomepage,
94-
'authors' => [$kitAuthorName],
9583
'license' => $kitLicense,
9684
], \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES));
9785
$this->filesystem->dumpFile('templates/components/Button.html.twig', <<<TWIG

src/Toolkit/src/Command/DebugKitCommand.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
6969
$io->definitionList(
7070
['Name' => $kit->name],
7171
['Homepage' => $kit->homepage],
72-
['Authors' => implode(', ', $kit->authors)],
7372
['License' => $kit->license],
7473
new TableSeparator(),
7574
['Path' => $kit->path],

src/Toolkit/src/Kit/Kit.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,17 @@
2424
final class Kit
2525
{
2626
/**
27-
* @param non-empty-string $path
28-
* @param non-empty-string $name
29-
* @param non-empty-string|null $homepage
30-
* @param list<array{name: string, email?: string}>|null $authors
31-
* @param non-empty-string|null $license
32-
* @param list<Component> $components
33-
* @param list<StimulusController> $stimulusControllers
27+
* @param non-empty-string $path
28+
* @param non-empty-string $name
29+
* @param non-empty-string|null $homepage
30+
* @param non-empty-string|null $license
31+
* @param list<Component> $components
32+
* @param list<StimulusController> $stimulusControllers
3433
*/
3534
public function __construct(
3635
public readonly string $path,
3736
public readonly string $name,
3837
public readonly ?string $homepage = null,
39-
public readonly array $authors = [],
4038
public readonly ?string $license = null,
4139
public readonly ?string $description = null,
4240
public readonly ?string $uxIcon = null,

src/Toolkit/src/Kit/KitFactory.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ public function createKitFromAbsolutePath(string $absolutePath): Kit
5151
path: $absolutePath,
5252
name: $manifest['name'] ?? throw new \InvalidArgumentException('Manifest file is missing "name" key.'),
5353
homepage: $manifest['homepage'] ?? throw new \InvalidArgumentException('Manifest file is missing "homepage" key.'),
54-
authors: $manifest['authors'] ?? throw new \InvalidArgumentException('Manifest file is missing "authors" key.'),
5554
license: $manifest['license'] ?? throw new \InvalidArgumentException('Manifest file is missing "license" key.'),
5655
description: $manifest['description'] ?? null,
5756
uxIcon: $manifest['ux-icon'] ?? null,

src/Toolkit/tests/Command/DebugKitCommandTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ public function testShouldBeAbleToDebug(): void
2727
// Kit details
2828
->assertOutputContains('Name Shadcn')
2929
->assertOutputContains('Homepage https://ux.symfony.com/components')
30-
->assertOutputContains('Authors Shadcn, Symfony Community')
3130
->assertOutputContains('License MIT')
3231
// A component details
3332
->assertOutputContains(<<<'EOF'

src/Toolkit/tests/Fixtures/kits/with-circular-components-dependencies/manifest.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@
22
"name": "With Circular Components Dependencies",
33
"description": "Kit used as a test fixture.",
44
"license": "MIT",
5-
"homepage": "https://ux.symfony.com/",
6-
"authors": ["Symfony UX Community"]
5+
"homepage": "https://ux.symfony.com/"
76
}

src/Toolkit/tests/Fixtures/kits/with-stimulus-controllers/manifest.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@
22
"name": "With Stimulus Controllers",
33
"description": "Kit used as a test fixture.",
44
"license": "MIT",
5-
"homepage": "https://ux.symfony.com/",
6-
"authors": ["Symfony UX Community"]
5+
"homepage": "https://ux.symfony.com/"
76
}

src/Toolkit/tests/Kit/KitTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,20 @@ public function testShouldFailIfKitNameIsInvalid(): void
2424
$this->expectException(\InvalidArgumentException::class);
2525
$this->expectExceptionMessage('Invalid kit name "-foobar".');
2626

27-
new Kit(__DIR__, '-foobar', 'https://example.com', [], 'MIT');
27+
new Kit(__DIR__, '-foobar', 'https://example.com', 'MIT');
2828
}
2929

3030
public function testShouldFailIfKitPathIsNotAbsolute(): void
3131
{
3232
$this->expectException(\InvalidArgumentException::class);
3333
$this->expectExceptionMessage(\sprintf('Kit path "./%s" is not absolute.', __DIR__));
3434

35-
new Kit(\sprintf('./%s', __DIR__), 'foo', 'https://example.com', [], 'MIT');
35+
new Kit(\sprintf('./%s', __DIR__), 'foo', 'https://example.com', 'MIT');
3636
}
3737

3838
public function testCanAddComponentsToTheKit(): void
3939
{
40-
$kit = new Kit(__DIR__, 'foo', 'https://example.com', [], 'MIT');
40+
$kit = new Kit(__DIR__, 'foo', 'https://example.com', 'MIT');
4141
$kit->addComponent(new Component('Table', [new File(FileType::Twig, 'Table.html.twig', 'Table.html.twig')], null));
4242
$kit->addComponent(new Component('Table:Row', [new File(FileType::Twig, 'Table/Row.html.twig', 'Table/Row.html.twig')], null));
4343

@@ -49,14 +49,14 @@ public function testShouldFailIfComponentIsAlreadyRegisteredInTheKit(): void
4949
$this->expectException(\InvalidArgumentException::class);
5050
$this->expectExceptionMessage('Component "Table" is already registered in the kit.');
5151

52-
$kit = new Kit(__DIR__, 'foo', 'https://example.com', [], 'MIT');
52+
$kit = new Kit(__DIR__, 'foo', 'https://example.com', 'MIT');
5353
$kit->addComponent(new Component('Table', [new File(FileType::Twig, 'Table.html.twig', 'Table.html.twig')], null));
5454
$kit->addComponent(new Component('Table', [new File(FileType::Twig, 'Table.html.twig', 'Table.html.twig')], null));
5555
}
5656

5757
public function testCanGetComponentByName(): void
5858
{
59-
$kit = new Kit(__DIR__, 'foo', 'https://example.com', [], 'MIT');
59+
$kit = new Kit(__DIR__, 'foo', 'https://example.com', 'MIT');
6060
$kit->addComponent(new Component('Table', [new File(FileType::Twig, 'Table.html.twig', 'Table.html.twig')], null));
6161
$kit->addComponent(new Component('Table:Row', [new File(FileType::Twig, 'Table/Row.html.twig', 'Table/Row.html.twig')], null));
6262

@@ -66,7 +66,7 @@ public function testCanGetComponentByName(): void
6666

6767
public function testShouldReturnNullIfComponentIsNotFound(): void
6868
{
69-
$kit = new Kit(__DIR__, 'foo', 'https://example.com', [], 'MIT');
69+
$kit = new Kit(__DIR__, 'foo', 'https://example.com', 'MIT');
7070

7171
$this->assertNull($kit->getComponent('Table:Cell'));
7272
}

0 commit comments

Comments
 (0)