Skip to content

Commit

Permalink
Merge branch '1.x' into generator-presets
Browse files Browse the repository at this point in the history
  • Loading branch information
crynobone committed Oct 25, 2023
2 parents 54ae600 + b78eccf commit cd90acd
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 28 deletions.
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
/phpstan.neon.dist export-ignore
/phpunit.xml export-ignore
/pint.json export-ignore
/sync.sh export-ignore
/testbench.yaml export-ignore
/CHANGELOG-*.md export-ignore
/CODE_OF_CONDUCT.md export-ignore
Expand Down
16 changes: 16 additions & 0 deletions CHANGELOG-1.x.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Changes for 1.x

This changelog references the relevant changes (bug and security fixes) done to `orchestra/workbench`.

## 1.0.0

Released: 2023-10-24

### Added

* Generate `workbench/routes/web.php`, `workbench/routes/api.php` and `workbench/routes/console.php` files from `workbench:install` command.
* Generate `Workbench\App\Providers\WorkbenchServiceProvider` from `workbench:install` command.

### Removed

* Removed `Orchestra\Workbench\Workbench::discover()` method, replaced in `orchestra/testbench-core` using `Orchestra\Testbench\Foundation\Bootstrap\DiscoverRoutes`.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ $ vendor/bin/phpunit

If the test suite passes on your local machine you should be good to go.

When you make a pull request, the tests will automatically be run again by [Travis CI](https://travis-ci.org/) on multiple php versions and hhvm.
When you make a pull request, the tests will automatically be run again by [GitHub Actions](https://github.com/orchestral/workbench/actions) on multiple php versions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (C) 2023 Mior Muhammad Zaki <http://git.io/crynobone>
Copyright (C) 2023 Mior Muhammad Zaki <https://github.com/crynobone>

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
1 change: 1 addition & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<coverage includeUncoveredFiles="false">
<include>
<directory suffix=".php">src/</directory>
<file>vendor/orchestra/testbench-core/src/Workbench/Workbench.php</file>
</include>
<exclude>
<file>src/Console/BuildCommand.php</file>
Expand Down
7 changes: 0 additions & 7 deletions src/Console/BuildCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,6 @@
#[AsCommand(name: 'workbench:build', description: 'Run builds for workbench')]
class BuildCommand extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'workbench:build';

/**
* Execute the console command.
*
Expand Down
16 changes: 5 additions & 11 deletions src/Console/DevToolCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
use Orchestra\Testbench\Foundation\Console\Actions\GeneratesFile;
use Symfony\Component\Console\Attribute\AsCommand;

use function Laravel\Prompts\select;
use function Orchestra\Testbench\laravel_version_compare;
use function Orchestra\Testbench\package_path;

#[AsCommand(name: 'workbench:devtool', description: 'Configure Workbench for package development')]
Expand All @@ -20,13 +22,6 @@ class DevToolCommand extends Command
*/
protected $signature = 'workbench:devtool {--force : Overwrite any existing files}';

/**
* The console command description.
*
* @var string
*/
protected $description = 'Configure Workbench for package development';

/**
* Execute the console command.
*
Expand Down Expand Up @@ -87,10 +82,9 @@ protected function copyTestbenchDotEnvFile(Filesystem $filesystem, string $worki
return;
}

$choice = $this->components->choice(
"Export '.env' file as?",
$choices,
);
$choice = laravel_version_compare('10.17', '>=')
? select("Export '.env' file as?", $choices)
: $this->components->choice("Export '.env' file as?", $choices);

if ($choice === 'Skip exporting .env') {
return;
Expand Down
7 changes: 0 additions & 7 deletions src/Console/DropSqliteDbCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@
#[AsCommand(name: 'workbench:drop-sqlite-db', description: 'Drop sqlite database file')]
class DropSqliteDbCommand extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'workbench:drop-sqlite-db';

/**
* Execute the console command.
*
Expand Down
6 changes: 6 additions & 0 deletions src/WorkbenchServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

namespace Orchestra\Workbench;

use Composer\InstalledVersions;
use Illuminate\Console\Generators\PresetManager;
use Illuminate\Contracts\Events\Dispatcher as EventDispatcher;
use Illuminate\Contracts\Foundation\Application;
use Illuminate\Contracts\Http\Kernel as HttpKernel;
use Illuminate\Foundation\Console\AboutCommand;
use Illuminate\Support\ServiceProvider;
use Orchestra\Testbench\Foundation\Events\ServeCommandEnded;
use Orchestra\Testbench\Foundation\Events\ServeCommandStarted;
Expand All @@ -30,6 +32,10 @@ public function register(): void
$manager->setDefaultDriver('workbench');
});
}

AboutCommand::add('Workbench', fn () => array_filter([
'Version' => InstalledVersions::getPrettyVersion('orchestra/workbench'),
]));
}

/**
Expand Down
1 change: 1 addition & 0 deletions tests/WorkbenchTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public function it_can_resolve_workbench_config()
);

$this->assertSame([
'config' => false,
'web' => true,
'api' => true,
'commands' => true,
Expand Down

0 comments on commit cd90acd

Please sign in to comment.