diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e6d0709..160d817 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,7 +12,7 @@ jobs: release: uses: saucebase-dev/saucebase/.github/workflows/semantic-release.yml@main with: - version_file: 'module.json' + version_file: 'composer.json' version_file_path: '.version' prerelease: false secrets: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0592f69..922ad44 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,5 +13,5 @@ jobs: test: uses: saucebase-dev/saucebase/.github/workflows/test-module.yml@main with: - module: Roadmap + module: roadmap dependencies: saucebase/auth diff --git a/LICENSE b/LICENSE index f9a509b..cf78a69 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2025 Saucebase +Copyright (c) 2026 Saucebase Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/Taskfile.yml b/Taskfile.yml index 0a70a83..88f598b 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -9,11 +9,17 @@ tasks: test:e2e: desc: Run E2E tests for Roadmap module - cmd: npx playwright test --project="@Roadmap*" {{.CLI_ARGS}} + cmd: npx playwright test --project="@roadmap*" {{.CLI_ARGS}} interactive: true + # ── Database ────────────────────────────────────────────────── + + db:seed: + desc: Seed the Roadmap module database + cmd: php artisan modules:seed --module=roadmap + # ── Code Generation ──────────────────────────────────────────── types:generate: desc: Generate TypeScript types from PHP DTOs and enums - cmd: php artisan module:generate-types Roadmap + cmd: php artisan module:generate-types roadmap diff --git a/app/Providers/RoadmapServiceProvider.php b/app/Providers/RoadmapServiceProvider.php deleted file mode 100644 index a7dfa05..0000000 --- a/app/Providers/RoadmapServiceProvider.php +++ /dev/null @@ -1,16 +0,0 @@ -group(module_path('Roadmap', '/routes/web.php')); - } -} diff --git a/composer.json b/composer.json index fbe9464..cc0506e 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,9 @@ { "name": "saucebase/roadmap", - "description": "", + "description": "Roadmap module", "type": "saucebase-module", + "license": "proprietary", + "version": "0.3.4", "authors": [ { "name": "Saucebase", @@ -10,20 +12,24 @@ ], "extra": { "laravel": { - "providers": [], + "providers": [ + "Modules\\Roadmap\\Providers\\RoadmapServiceProvider" + ], "aliases": {} } }, "autoload": { "psr-4": { - "Modules\\Roadmap\\": "app/", + "Modules\\Roadmap\\": "src/", "Modules\\Roadmap\\Database\\Factories\\": "database/factories/", - "Modules\\Roadmap\\Database\\Seeders\\": "database/seeders/" + "Modules\\Roadmap\\Database\\Seeders\\": "database/seeders/", + "Modules\\Roadmap\\Tests\\Support\\": "tests/Support/" } }, "autoload-dev": { "psr-4": { "Modules\\Roadmap\\Tests\\": "tests/" } - } + }, + "minimum-stability": "stable" } diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php new file mode 100644 index 0000000..9e5c42d --- /dev/null +++ b/database/seeders/DatabaseSeeder.php @@ -0,0 +1,13 @@ +call(RoadmapDatabaseSeeder::class); + } +} diff --git a/module.json b/module.json deleted file mode 100644 index 4186046..0000000 --- a/module.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "Roadmap", - "alias": "roadmap", - "description": "Roadmap module", - "author": "Saucebase", - "version": "v0.3.4", - "keywords": [ - "roadmap" - ], - "priority": 0, - "providers": [ - "Modules\\Roadmap\\Providers\\RoadmapServiceProvider" - ], - "files": [] -} diff --git a/resources/js/app.ts b/resources/js/app.ts index c4500f8..3043f15 100644 --- a/resources/js/app.ts +++ b/resources/js/app.ts @@ -1,22 +1 @@ -import { registerIcon } from '@/lib/navigation'; -import IconMap from '~icons/heroicons/map'; - -import '../css/style.css'; - -/** - * Roadmap module setup - * Called during app initialization before mounting - */ -export function setup() { - console.debug('Roadmap module loaded'); - - registerIcon('roadmap', IconMap); -} - -/** - * Roadmap module after mount logic - * Called after the app has been mounted - */ -export function afterMount() { - console.debug('Roadmap module after mount logic executed'); -} +export * from './vue/app'; diff --git a/resources/js/vue/app.ts b/resources/js/vue/app.ts new file mode 100644 index 0000000..18022df --- /dev/null +++ b/resources/js/vue/app.ts @@ -0,0 +1,22 @@ +import { registerIcon } from '@/lib/navigation'; +import IconMap from '~icons/heroicons/map'; + +import '@modules/roadmap/resources/css/style.css'; + +/** + * Roadmap module setup + * Called during app initialization before mounting + */ +export function setup() { + console.debug('Roadmap module loaded'); + + registerIcon('roadmap', IconMap); +} + +/** + * Roadmap module after mount logic + * Called after the app has been mounted + */ +export function afterMount() { + console.debug('Roadmap module after mount logic executed'); +} diff --git a/resources/js/pages/Index.vue b/resources/js/vue/pages/Index.vue similarity index 100% rename from resources/js/pages/Index.vue rename to resources/js/vue/pages/Index.vue diff --git a/routes/navigation.php b/routes/navigation.php index 9d2508a..acfbdb9 100644 --- a/routes/navigation.php +++ b/routes/navigation.php @@ -13,7 +13,7 @@ | */ -Navigation::add('Roadmap', route('roadmap.index'), function (Section $section) { +Navigation::add('Roadmap', fn () => route('roadmap.index'), function (Section $section) { $section->attributes([ 'group' => 'main', 'slug' => 'roadmap', diff --git a/routes/web.php b/routes/web.php index ee3765a..233a962 100644 --- a/routes/web.php +++ b/routes/web.php @@ -4,8 +4,10 @@ use Modules\Roadmap\Http\Controllers\RoadmapController; use Modules\Roadmap\Http\Controllers\RoadmapVoteController; -Route::middleware('auth')->group(function () { - Route::get('/roadmap', [RoadmapController::class, 'index'])->name('roadmap.index'); - Route::post('/roadmap', [RoadmapController::class, 'store'])->middleware('throttle:10,1')->name('roadmap.store'); - Route::post('/roadmap/{item}/vote', [RoadmapVoteController::class, 'store'])->middleware('throttle:30,1')->name('roadmap.vote'); +Route::middleware('web')->group(function (): void { + Route::middleware('auth')->group(function (): void { + Route::get('/roadmap', [RoadmapController::class, 'index'])->name('roadmap.index'); + Route::post('/roadmap', [RoadmapController::class, 'store'])->middleware('throttle:10,1')->name('roadmap.store'); + Route::post('/roadmap/{item}/vote', [RoadmapVoteController::class, 'store'])->middleware('throttle:30,1')->name('roadmap.vote'); + }); }); diff --git a/app/Enums/RoadmapStatus.php b/src/Enums/RoadmapStatus.php similarity index 100% rename from app/Enums/RoadmapStatus.php rename to src/Enums/RoadmapStatus.php diff --git a/app/Enums/RoadmapType.php b/src/Enums/RoadmapType.php similarity index 100% rename from app/Enums/RoadmapType.php rename to src/Enums/RoadmapType.php diff --git a/app/Enums/VoteType.php b/src/Enums/VoteType.php similarity index 100% rename from app/Enums/VoteType.php rename to src/Enums/VoteType.php diff --git a/app/Events/StatusChanged.php b/src/Events/StatusChanged.php similarity index 100% rename from app/Events/StatusChanged.php rename to src/Events/StatusChanged.php diff --git a/app/Filament/Resources/Roadmap/Pages/CreateRoadmapItem.php b/src/Filament/Resources/Roadmap/Pages/CreateRoadmapItem.php similarity index 100% rename from app/Filament/Resources/Roadmap/Pages/CreateRoadmapItem.php rename to src/Filament/Resources/Roadmap/Pages/CreateRoadmapItem.php diff --git a/app/Filament/Resources/Roadmap/Pages/EditRoadmapItem.php b/src/Filament/Resources/Roadmap/Pages/EditRoadmapItem.php similarity index 100% rename from app/Filament/Resources/Roadmap/Pages/EditRoadmapItem.php rename to src/Filament/Resources/Roadmap/Pages/EditRoadmapItem.php diff --git a/app/Filament/Resources/Roadmap/Pages/ListRoadmapItems.php b/src/Filament/Resources/Roadmap/Pages/ListRoadmapItems.php similarity index 100% rename from app/Filament/Resources/Roadmap/Pages/ListRoadmapItems.php rename to src/Filament/Resources/Roadmap/Pages/ListRoadmapItems.php diff --git a/app/Filament/Resources/Roadmap/RoadmapItemResource.php b/src/Filament/Resources/Roadmap/RoadmapItemResource.php similarity index 96% rename from app/Filament/Resources/Roadmap/RoadmapItemResource.php rename to src/Filament/Resources/Roadmap/RoadmapItemResource.php index 0989bb2..ba593c1 100644 --- a/app/Filament/Resources/Roadmap/RoadmapItemResource.php +++ b/src/Filament/Resources/Roadmap/RoadmapItemResource.php @@ -18,7 +18,7 @@ class RoadmapItemResource extends Resource protected static string|\BackedEnum|null $navigationIcon = 'heroicon-o-map'; - protected static ?int $navigationSort = 1; + protected static ?int $navigationSort = 3; public static function form(Schema $schema): Schema { diff --git a/app/Filament/Resources/Roadmap/Schemas/RoadmapItemForm.php b/src/Filament/Resources/Roadmap/Schemas/RoadmapItemForm.php similarity index 100% rename from app/Filament/Resources/Roadmap/Schemas/RoadmapItemForm.php rename to src/Filament/Resources/Roadmap/Schemas/RoadmapItemForm.php diff --git a/app/Filament/Resources/Roadmap/Tables/RoadmapItemsTable.php b/src/Filament/Resources/Roadmap/Tables/RoadmapItemsTable.php similarity index 100% rename from app/Filament/Resources/Roadmap/Tables/RoadmapItemsTable.php rename to src/Filament/Resources/Roadmap/Tables/RoadmapItemsTable.php diff --git a/app/Filament/RoadmapPlugin.php b/src/Filament/RoadmapPlugin.php similarity index 100% rename from app/Filament/RoadmapPlugin.php rename to src/Filament/RoadmapPlugin.php diff --git a/app/Http/Controllers/RoadmapController.php b/src/Http/Controllers/RoadmapController.php similarity index 100% rename from app/Http/Controllers/RoadmapController.php rename to src/Http/Controllers/RoadmapController.php diff --git a/app/Http/Controllers/RoadmapVoteController.php b/src/Http/Controllers/RoadmapVoteController.php similarity index 100% rename from app/Http/Controllers/RoadmapVoteController.php rename to src/Http/Controllers/RoadmapVoteController.php diff --git a/app/Listeners/NotifySubmitter.php b/src/Listeners/NotifySubmitter.php similarity index 100% rename from app/Listeners/NotifySubmitter.php rename to src/Listeners/NotifySubmitter.php diff --git a/app/Models/RoadmapItem.php b/src/Models/RoadmapItem.php similarity index 100% rename from app/Models/RoadmapItem.php rename to src/Models/RoadmapItem.php diff --git a/app/Models/RoadmapVote.php b/src/Models/RoadmapVote.php similarity index 100% rename from app/Models/RoadmapVote.php rename to src/Models/RoadmapVote.php diff --git a/app/Notifications/RoadmapItemStatusChangedNotification.php b/src/Notifications/RoadmapItemStatusChangedNotification.php similarity index 100% rename from app/Notifications/RoadmapItemStatusChangedNotification.php rename to src/Notifications/RoadmapItemStatusChangedNotification.php diff --git a/src/Providers/RoadmapServiceProvider.php b/src/Providers/RoadmapServiceProvider.php new file mode 100644 index 0000000..e26e8fb --- /dev/null +++ b/src/Providers/RoadmapServiceProvider.php @@ -0,0 +1,9 @@ +