diff --git a/.github/.release-please-config.json b/.github/.release-please-config.json new file mode 100644 index 00000000..fffa1edb --- /dev/null +++ b/.github/.release-please-config.json @@ -0,0 +1,72 @@ +{ + "release-type": "php", + "packages": { + ".": { + "package-name": "laravel-open-docs", + "changelog-path": "/CHANGELOG.md" + } + }, + "include-component-in-tag": false, + "changelog-sections": [ + { + "type": "feat", + "section": "Features", + "hidden": false + }, + { + "type": "fix", + "section": "Bug Fixes", + "hidden": false + }, + { + "type": "perf", + "section": "Performance Improvements", + "hidden": false + }, + { + "type": "docs", + "section": "Documentation", + "hidden": false + }, + { + "type": "deps", + "section": "Dependencies", + "hidden": false + }, + { + "type": "refactor", + "section": "Code Refactoring", + "hidden": false + }, + { + "type": "test", + "section": "Tests", + "hidden": true + }, + { + "type": "build", + "section": "Build System", + "hidden": true + }, + { + "type": "ci", + "section": "Continuous Integration", + "hidden": true + }, + { + "type": "chore", + "section": "Miscellaneous", + "hidden": true + }, + { + "type": "style", + "section": "Styles", + "hidden": true + }, + { + "type": "revert", + "section": "Reverts", + "hidden": true + } + ] +} diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json new file mode 100644 index 00000000..8556ac27 --- /dev/null +++ b/.github/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "2.0.108" +} diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index 51b060a2..00000000 --- a/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,13 +0,0 @@ -#### Steps required to reproduce the problem - -1. -2. -3. - -#### Expected Result - -* - -#### Actual Result - -* diff --git a/.github/labeler.yml b/.github/labeler.yml index 0055ace3..e5d40386 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -3,13 +3,18 @@ # this file is for the labeler workflow job # Documentation https://github.com/marketplace/actions/labeler -'type: documentation': - - assets/**/* - - .github/* - - ./*.md - -'type: maintenance': - - .github/**/* - - tests/**/* +"type: bug": + - head-branch: ['^bug', '^fix', 'bug', 'fix'] + +"type: enhancement": + - head-branch: ['^feature', '^feat', 'feature'] + +"type: documentation": + - changed-files: + - any-glob-to-any-file: ['assets/**/*', '.github/*', './*.md'] + +"type: maintenance": + - changed-files: + - any-glob-to-any-file: ['tests/**/*', '.github/workflows/*'] ... diff --git a/.github/workflows/apply-labels.yml b/.github/workflows/apply-labels.yml index c9b1196b..f2b6f59b 100644 --- a/.github/workflows/apply-labels.yml +++ b/.github/workflows/apply-labels.yml @@ -14,7 +14,7 @@ name: 🏷️ Add labels jobs: label: - uses: wayofdev/gh-actions/.github/workflows/apply-labels.yml@master + uses: wayofdev/gh-actions/.github/workflows/apply-labels.yml@v3.1.0 with: os: ubuntu-latest secrets: diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index 36f3b9f1..c9aed094 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -2,6 +2,7 @@ # https://github.com/wayofdev/gh-actions/blob/master/.github/workflows/create-release.yml # https://github.com/google-github-actions/release-please-action#release-types-supported +# https://github.com/googleapis/release-please/blob/main/docs/customizing.md on: # yamllint disable-line rule:truthy push: @@ -12,12 +13,15 @@ name: 📦 Create release jobs: release: - uses: wayofdev/gh-actions/.github/workflows/create-release.yml@master - with: - os: ubuntu-latest - branch: master - package-name: laravel-open-docs - secrets: - token: ${{ secrets.PERSONAL_GITHUB_TOKEN }} + runs-on: ubuntu-latest + steps: + - name: 🎉 Create release + uses: googleapis/release-please-action@v4.1.1 + id: release + with: + token: ${{ secrets.PERSONAL_GITHUB_TOKEN }} + config-file: .github/.release-please-config.json + manifest-file: .github/.release-please-manifest.json + target-branch: master ... diff --git a/package.json b/package.json deleted file mode 100644 index d47170c4..00000000 --- a/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "version": "2.0.108", - "repository": { - "url": "https://github.com/wayofdev/laravel-open-docs.git" - } -} diff --git a/src/Bridge/Laravel/Console/Commands/GenerateCommand.php b/src/Bridge/Laravel/Console/Commands/GenerateCommand.php index 6a735c90..6145bf3d 100644 --- a/src/Bridge/Laravel/Console/Commands/GenerateCommand.php +++ b/src/Bridge/Laravel/Console/Commands/GenerateCommand.php @@ -22,7 +22,7 @@ public function handle(ConfigRepository $config): int $collection = $this->argument('collection'); $collectionExists = $config->collections()->has($collection); - if (false === $collectionExists) { + if ($collectionExists === false) { $this->error('Collection "' . $collection . '" does not exist.'); return self::FAILURE; diff --git a/src/Config.php b/src/Config.php index 47025f3d..bcb60716 100644 --- a/src/Config.php +++ b/src/Config.php @@ -21,15 +21,26 @@ final class Config implements ConfigRepository ]; private readonly bool $onFly; + private readonly array $frontend; private readonly Collection $collections; + public function __construct( + bool $onFly, + array $frontend, + array $collections, + ) { + $this->onFly = $onFly; + $this->frontend = $frontend; + $this->collections = new Collection($collections); + } + public static function fromArray(array $config): self { $missingAttributes = array_diff(self::REQUIRED_FIELDS, array_keys($config)); - if ([] !== $missingAttributes) { + if ($missingAttributes !== []) { throw MissingRequiredAttributes::fromArray( implode(',', $missingAttributes) ); @@ -42,16 +53,6 @@ public static function fromArray(array $config): self ); } - public function __construct( - bool $onFly, - array $frontend, - array $collections, - ) { - $this->onFly = $onFly; - $this->frontend = $frontend; - $this->collections = new Collection($collections); - } - public function onFly(): bool { return $this->onFly;