Skip to content

Commit

Permalink
Merge branch '8.x' into generator-presets
Browse files Browse the repository at this point in the history
  • Loading branch information
crynobone committed Nov 14, 2023
2 parents cd90acd + bd7d0ee commit 838723b
Show file tree
Hide file tree
Showing 12 changed files with 52 additions and 139 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/analyse.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/audits.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ name: audits
on:
push:
pull_request:
schedule:
- cron: '0 0 1 * *'
workflow_dispatch:

jobs:
audit-dependencies:
Expand All @@ -15,17 +14,17 @@ jobs:
os:
- "ubuntu-latest"
php:
# - '8.0'
- 8.1
- 8.2
- 8.3
experimental:
- true

name: PHP${{ matrix.php }} on ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/coveralls.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down
50 changes: 0 additions & 50 deletions .github/workflows/test-on-windows.yaml

This file was deleted.

58 changes: 5 additions & 53 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@ name: tests
on:
push:
pull_request:
workflow_dispatch:

jobs:
tests-on-laravel-10:
tests:
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
os:
- "ubuntu-latest"
- "windows-latest"
php:
- 8.1
- 8.2
Expand All @@ -22,11 +24,11 @@ jobs:
experimental:
- false

name: PHP${{ matrix.php }}-${{ matrix.os }} with Laravel 10 (${{ matrix.dependencies }})
name: PHP${{ matrix.php }} on ${{ matrix.os }} (${{ matrix.dependencies }})

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -35,10 +37,6 @@ jobs:
extensions: dom, curl, libxml, mbstring, zip, pcntl, sqlite3, pdo_sqlite, bcmath, fileinfo
coverage: none

- name: Install Laravel 10
run: |
composer require "illuminate/contracts:10.x" --no-interaction --no-update
- name: Install dependencies
uses: "ramsey/composer-install@v2"
with:
Expand All @@ -50,49 +48,3 @@ jobs:

- name: Execute tests
run: vendor/bin/phpunit --testdox

# tests-on-laravel-9:
# runs-on: ${{ matrix.os }}
# continue-on-error: ${{ matrix.experimental }}
# strategy:
# matrix:
# os:
# - "ubuntu-latest"
# php:
# - '8.0'
# - 8.1
# - 8.2
# dependencies:
# - "highest"
# - "lowest"
# experimental:
# - false

# name: PHP${{ matrix.php }}-${{ matrix.os }} with Laravel 9 (${{ matrix.dependencies }})

# steps:
# - name: Checkout code
# uses: actions/checkout@v3

# - name: Setup PHP
# uses: shivammathur/setup-php@v2
# with:
# php-version: ${{ matrix.php }}
# extensions: dom, curl, libxml, mbstring, zip, pcntl, sqlite3, pdo_sqlite, bcmath, fileinfo
# coverage: none

# - name: Install Laravel 9
# run: |
# composer require "illuminate/contracts:9.x" --no-interaction --no-update

# - name: Install dependencies
# uses: "ramsey/composer-install@v2"
# with:
# dependency-versions: "${{ matrix.dependencies }}"
# composer-options: "--prefer-dist --no-cache"

# - name: Installed dependencies
# run: composer show -D

# - name: Execute tests
# run: vendor/bin/phpunit --testdox
12 changes: 12 additions & 0 deletions CHANGELOG-1.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

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

## 1.0.1

Released: 2023-10-31

### Added

* Added Workbench information to `about` artisan command.

### Changes

* Disable Composer script timeout to `composer run serve` generator.

## 1.0.0

Released: 2023-10-24
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG-7.x.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Changes for 7.x

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

## 7.0.0

Released: 2023-11-07

### Changes

Restructure releases for Workbench to follow Testbench version. `7.x` releases will only be compatible with Testbench `7.x` and Laravel `9.x`.
11 changes: 11 additions & 0 deletions CHANGELOG-8.x.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Changes for 8.x

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

## 8.0.0

Released: 2023-11-07

### Changes

Restructure releases for Workbench to follow Testbench version. `8.x` releases will only be compatible with Testbench `8.x` and Laravel `10.x`.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"laravel/framework": "dev-generator-presets as 10.x-dev",
"laravel/tinker": "^2.8.2",
"orchestra/canvas": "dev-generator-presets as 8.12.0",
"orchestra/testbench-core": "^7.34.0 || ^8.14.0",
"orchestra/testbench-core": "^8.14",
"symfony/yaml": "^6.0.9"
},
"require-dev": {
Expand Down
28 changes: 4 additions & 24 deletions src/Composer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,10 @@

namespace Orchestra\Workbench;

use RuntimeException;

/**
* @deprecated use `Illuminate\Support\Composer` instead
*/
class Composer extends \Illuminate\Support\Composer
{
/**
* Modify composer content.
*
* @param callable(array):array $callback
*/
public function modify(callable $callback): void
{
$composerFile = "{$this->workingPath}/composer.json";

if (! file_exists($composerFile)) {
throw new RuntimeException("Unable to locate `composer.json` file at [{$this->workingPath}].");
}

$composer = json_decode((string) file_get_contents($composerFile), true, 512, JSON_THROW_ON_ERROR);

$composer = \call_user_func($callback, $composer);

file_put_contents(
$composerFile,
json_encode($composer, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE)
);
}
//
}
5 changes: 1 addition & 4 deletions src/Console/DevToolCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
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 Down Expand Up @@ -82,9 +81,7 @@ protected function copyTestbenchDotEnvFile(Filesystem $filesystem, string $worki
return;
}

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

if ($choice === 'Skip exporting .env') {
return;
Expand Down
3 changes: 2 additions & 1 deletion src/Console/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
use Illuminate\Filesystem\Filesystem;
use Illuminate\Support\Arr;
use Illuminate\Support\Collection;
use Illuminate\Support\Composer;
use Orchestra\Testbench\Foundation\Console\Actions\EnsureDirectoryExists;
use Orchestra\Testbench\Foundation\Console\Actions\GeneratesFile;
use Orchestra\Workbench\Composer;
use Orchestra\Workbench\Events\InstallEnded;
use Orchestra\Workbench\Events\InstallStarted;
use Orchestra\Workbench\Workbench;
Expand Down Expand Up @@ -147,6 +147,7 @@ protected function appendScriptsToComposer(array $content, Filesystem $filesyste

$content['scripts']['build'] = '@php vendor/bin/testbench workbench:build --ansi';
$content['scripts']['serve'] = [
'Composer\\Config::disableProcessTimeout',
'@build',
'@php vendor/bin/testbench serve',
];
Expand Down

0 comments on commit 838723b

Please sign in to comment.