Skip to content

Commit 94649ce

Browse files
authored
Merge pull request #256 from wayofdev/feat/updates
2 parents c17b02d + 78c5753 commit 94649ce

File tree

9 files changed

+113
-47
lines changed

9 files changed

+113
-47
lines changed

.github/.release-please-config.json

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
{
2+
"release-type": "php",
3+
"packages": {
4+
".": {
5+
"package-name": "laravel-open-docs",
6+
"changelog-path": "/CHANGELOG.md"
7+
}
8+
},
9+
"include-component-in-tag": false,
10+
"changelog-sections": [
11+
{
12+
"type": "feat",
13+
"section": "Features",
14+
"hidden": false
15+
},
16+
{
17+
"type": "fix",
18+
"section": "Bug Fixes",
19+
"hidden": false
20+
},
21+
{
22+
"type": "perf",
23+
"section": "Performance Improvements",
24+
"hidden": false
25+
},
26+
{
27+
"type": "docs",
28+
"section": "Documentation",
29+
"hidden": false
30+
},
31+
{
32+
"type": "deps",
33+
"section": "Dependencies",
34+
"hidden": false
35+
},
36+
{
37+
"type": "refactor",
38+
"section": "Code Refactoring",
39+
"hidden": false
40+
},
41+
{
42+
"type": "test",
43+
"section": "Tests",
44+
"hidden": true
45+
},
46+
{
47+
"type": "build",
48+
"section": "Build System",
49+
"hidden": true
50+
},
51+
{
52+
"type": "ci",
53+
"section": "Continuous Integration",
54+
"hidden": true
55+
},
56+
{
57+
"type": "chore",
58+
"section": "Miscellaneous",
59+
"hidden": true
60+
},
61+
{
62+
"type": "style",
63+
"section": "Styles",
64+
"hidden": true
65+
},
66+
{
67+
"type": "revert",
68+
"section": "Reverts",
69+
"hidden": true
70+
}
71+
]
72+
}

.github/.release-please-manifest.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "2.0.108"
3+
}

.github/ISSUE_TEMPLATE.md

-13
This file was deleted.

.github/labeler.yml

+13-8
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,18 @@
33
# this file is for the labeler workflow job
44
# Documentation https://github.com/marketplace/actions/labeler
55

6-
'type: documentation':
7-
- assets/**/*
8-
- .github/*
9-
- ./*.md
10-
11-
'type: maintenance':
12-
- .github/**/*
13-
- tests/**/*
6+
"type: bug":
7+
- head-branch: ['^bug', '^fix', 'bug', 'fix']
8+
9+
"type: enhancement":
10+
- head-branch: ['^feature', '^feat', 'feature']
11+
12+
"type: documentation":
13+
- changed-files:
14+
- any-glob-to-any-file: ['assets/**/*', '.github/*', './*.md']
15+
16+
"type: maintenance":
17+
- changed-files:
18+
- any-glob-to-any-file: ['tests/**/*', '.github/workflows/*']
1419

1520
...

.github/workflows/apply-labels.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ name: 🏷️ Add labels
1414

1515
jobs:
1616
label:
17-
uses: wayofdev/gh-actions/.github/workflows/apply-labels.yml@master
17+
uses: wayofdev/gh-actions/.github/workflows/apply-labels.yml@v3.1.0
1818
with:
1919
os: ubuntu-latest
2020
secrets:

.github/workflows/create-release.yml

+11-7
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
# https://github.com/wayofdev/gh-actions/blob/master/.github/workflows/create-release.yml
44
# https://github.com/google-github-actions/release-please-action#release-types-supported
5+
# https://github.com/googleapis/release-please/blob/main/docs/customizing.md
56

67
on: # yamllint disable-line rule:truthy
78
push:
@@ -12,12 +13,15 @@ name: 📦 Create release
1213

1314
jobs:
1415
release:
15-
uses: wayofdev/gh-actions/.github/workflows/create-release.yml@master
16-
with:
17-
os: ubuntu-latest
18-
branch: master
19-
package-name: laravel-open-docs
20-
secrets:
21-
token: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: 🎉 Create release
19+
uses: googleapis/[email protected]
20+
id: release
21+
with:
22+
token: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
23+
config-file: .github/.release-please-config.json
24+
manifest-file: .github/.release-please-manifest.json
25+
target-branch: master
2226

2327
...

package.json

-6
This file was deleted.

src/Bridge/Laravel/Console/Commands/GenerateCommand.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function handle(ConfigRepository $config): int
2222
$collection = $this->argument('collection');
2323
$collectionExists = $config->collections()->has($collection);
2424

25-
if (false === $collectionExists) {
25+
if ($collectionExists === false) {
2626
$this->error('Collection "' . $collection . '" does not exist.');
2727

2828
return self::FAILURE;

src/Config.php

+12-11
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,26 @@ final class Config implements ConfigRepository
2121
];
2222

2323
private readonly bool $onFly;
24+
2425
private readonly array $frontend;
2526

2627
private readonly Collection $collections;
2728

29+
public function __construct(
30+
bool $onFly,
31+
array $frontend,
32+
array $collections,
33+
) {
34+
$this->onFly = $onFly;
35+
$this->frontend = $frontend;
36+
$this->collections = new Collection($collections);
37+
}
38+
2839
public static function fromArray(array $config): self
2940
{
3041
$missingAttributes = array_diff(self::REQUIRED_FIELDS, array_keys($config));
3142

32-
if ([] !== $missingAttributes) {
43+
if ($missingAttributes !== []) {
3344
throw MissingRequiredAttributes::fromArray(
3445
implode(',', $missingAttributes)
3546
);
@@ -42,16 +53,6 @@ public static function fromArray(array $config): self
4253
);
4354
}
4455

45-
public function __construct(
46-
bool $onFly,
47-
array $frontend,
48-
array $collections,
49-
) {
50-
$this->onFly = $onFly;
51-
$this->frontend = $frontend;
52-
$this->collections = new Collection($collections);
53-
}
54-
5556
public function onFly(): bool
5657
{
5758
return $this->onFly;

0 commit comments

Comments
 (0)