8000 [Toolkit] Remove Kit "authors" by Kocal · Pull Request #2725 · symfony/ux · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[Toolkit] Remove Kit "authors" #2725

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/Toolkit/kits/shadcn/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@
"description": "Component based on the Shadcn UI library, one of the most popular design systems in JavaScript world.",
"license": "MIT",
"homepage": "https://ux.symfony.com/components",
"authors": ["Shadcn", "Symfony Community"],
"ux-icon": "simple-icons:shadcnui"
}
12 changes: 0 additions & 12 deletions src/Toolkit/src/Command/CreateKitCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
});
$kitHomepage = $io->askQuestion($question);

// Get the kit author name
$question = new Question("What's the name of the author?");
$question->setValidator(function (?string $value) {
if (empty($value)) {
throw new \Exception('The author name cannot be empty.');
}

return $value;
});
$kitAuthorName = $io->askQuestion($question);

// Get the kit license
$question = new Question('What is the license of your kit?');
$question->setValidator(function (string $value) {
Expand All @@ -91,7 +80,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$this->filesystem->dumpFile('manifest.json', json_encode([
'name' => $kitName,
'homepage' => $kitHomepage,
'authors' => [$kitAuthorName],
'license' => $kitLicense,
], \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES));
$this->filesystem->dumpFile('templates/components/Button.html.twig', <<<TWIG
Expand Down
1 change: 0 additions & 1 deletion src/Toolkit/src/Command/DebugKitCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$io->definitionList(
['Name' => $kit->name],
['Homepage' => $kit->homepage],
['Authors' => implode(', ', $kit->authors)],
['License' => $kit->license],
new TableSeparator(),
['Path' => $kit->path],
Expand Down
14 changes: 6 additions & 8 deletions src/Toolkit/src/Kit/Kit.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,17 @@
final class Kit
{
/**
* @param non-empty-string $path
* @param non-empty-string $name
* @param non-empty-string|null $homepage
* @param list<array{name: string, email?: string}>|null $authors
* @param non-empty-string|null $license
* @param list<Component> $components
* @param list<StimulusController> $stimulusControllers
* @param non-empty-string $path
* @param non-empty-string $name
* @param non-empty-string|null $homepage
* @param non-empty-string|null $license
* @param list<Component> $components
* @param list<StimulusController> $stimulusControllers
*/
public function __construct(
public readonly string $path,
public readonly string $name,
public readonly ?string $homepage = null,
public readonly array $authors = [],
public readonly ?string $license = null,
public readonly ?string $description = null,
public readonly ?string $uxIcon = null,
Expand Down
1 change: 0 additions & 1 deletion src/Toolkit/src/Kit/KitFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ public function createKitFromAbsolutePath(string $absolutePath): Kit
path: $absolutePath,
name: $manifest['name'] ?? throw new \InvalidArgumentException('Manifest file is missing "name" key.'),
homepage: $manifest['homepage'] ?? throw new \InvalidArgumentException('Manifest file is missing "homepage" key.'),
authors: $manifest['authors'] ?? throw new \InvalidArgumentException('Manifest file is missing "authors" key.'),
license: $manifest['license'] ?? throw new \InvalidArgumentException('Manifest file is missing "license" key.'),
description: $manifest['description'] ?? null,
uxIcon: $manifest['ux-icon'] ?? null,
Expand Down
1 change: 0 additions & 1 deletion src/Toolkit/tests/Command/DebugKitCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ public function testShouldBeAbleToDebug(): void
// Kit details
->assertOutputContains('Name Shadcn')
->assertOutputContains('Homepage https://ux.symfony.com/components')
->assertOutputContains('Authors Shadcn, Symfony Community')
->assertOutputContains('License MIT')
// A component details
->assertOutputContains(<<<'EOF'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
"name": "With Circular Components Dependencies",
"description": "Kit used as a test fixture.",
"license": "MIT",
"homepage": "https://ux.symfony.com/",
"authors": ["Symfony UX Community"]
"homepage": "https://ux.symfony.com/"
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
"name": "With Stimulus Controllers",
"description": "Kit used as a test fixture.",
"license": "MIT",
"homepage": "https://ux.symfony.com/",
"authors": ["Symfony UX Community"]
"homepage": "https://ux.symfony.com/"
}
12 changes: 6 additions & 6 deletions src/Toolkit/tests/Kit/KitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,20 @@ public function testShouldFailIfKitNameIsInvalid(): void
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('Invalid kit name "-foobar".');

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

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

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

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

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

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

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

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

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

$this->assertNull($kit->getComponent('Table:Cell'));
}
Expand Down
Loading
0