Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <[email protected]>
  • Loading branch information
crynobone committed Dec 10, 2024
2 parents 41386cf + 87a5aca commit be7b393
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 55 deletions.
21 changes: 21 additions & 0 deletions CHANGELOG-7.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,27 @@

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

## 7.14.0

Released: 2024-12-10

### Added

* Add `sync-skeleton` and `purge-skeleton` recipe for `workbench:build` command.
* Set default `laravel` configuration to either `@testbench` or `@testbench-dusk`
* Added following classes to interacts with Composer:
- `Orchestra\Workbench\Actions\DumpComposerAutoloads`
- `Orchestra\Workbench\Actions\ModifyComposer`

### Changes

* `workbench:install` should suggest creating `.env.dusk` equivalent file when `orchestra/testbench-dusk` is installed.
* Refactor `workbench:install` and add feature tests.

### Removed

* Remove `Orchestra\Workbench\Composer`.

## 7.13.0

Released: 2024-12-01
Expand Down
2 changes: 1 addition & 1 deletion src/Console/Concerns/InteractsWithFiles.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ trait InteractsWithFiles
protected function replaceInFile(Filesystem $filesystem, array|string $search, array|string $replace, string $path): void
{
/** @phpstan-ignore argument.type */
$filesystem->put($path, str_replace($search, $replace, $filesystem->get($path)));
$filesystem->replaceInFile($search, $replace, $path);
}
}
8 changes: 3 additions & 5 deletions src/Console/DevToolCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
#[AsCommand(name: 'workbench:devtool', description: 'Configure Workbench for package development')]
class DevToolCommand extends Command implements PromptsForMissingInput
{
use Concerns\InteractsWithFiles;

/**
* Execute the console command.
*
Expand Down Expand Up @@ -194,7 +192,7 @@ protected function appendScriptsToComposer(array $content, Filesystem $filesyste

if (InstalledVersions::isInstalled('laravel/pint')) {
$lintScripts[] = '@php vendor/bin/pint --ansi';
} elseif ($filesystem->exists(Workbench::packagePath('pint.json'))) {
} elseif ($filesystem->isFile(Workbench::packagePath('pint.json'))) {
$lintScripts[] = 'pint';
}

Expand All @@ -208,8 +206,8 @@ protected function appendScriptsToComposer(array $content, Filesystem $filesyste
}

if (
$filesystem->exists(Workbench::packagePath('phpunit.xml'))
|| $filesystem->exists(Workbench::packagePath('phpunit.xml.dist'))
$filesystem->isFile(Workbench::packagePath('phpunit.xml'))
|| $filesystem->isFile(Workbench::packagePath('phpunit.xml.dist'))
) {
if (! \array_key_exists('test', $content['scripts'])) {
$content['scripts']['test'] = [
Expand Down
4 changes: 1 addition & 3 deletions src/Console/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
#[AsCommand(name: 'workbench:install', description: 'Setup Workbench for package development')]
class InstallCommand extends Command implements PromptsForMissingInput
{
use Concerns\InteractsWithFiles;

/**
* The `testbench.yaml` default configuration file.
*/
Expand Down Expand Up @@ -165,7 +163,7 @@ protected function replaceDefaultLaravelSkeletonInTestbenchConfigurationFile(Fil
return;
}

$this->replaceInFile($filesystem, ["laravel: '@testbench'"], ["laravel: '@testbench-dusk'"], join_paths($workingPath, 'testbench.yaml'));
$filesystem->replaceInFile(["laravel: '@testbench'"], ["laravel: '@testbench-dusk'"], join_paths($workingPath, 'testbench.yaml'));
}

/**
Expand Down
46 changes: 0 additions & 46 deletions tests/Console/Concerns/InteractsWithFilesTest.php

This file was deleted.

0 comments on commit be7b393

Please sign in to comment.