Skip to content

Commit 251bb1d

Browse files
Initial commit
0 parents  commit 251bb1d

176 files changed

Lines changed: 30706 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Ensure deterministic line endings for generated test inventory
2+
/docs/tests.md text eol=lf

.githooks/pre-commit

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
#!/usr/bin/env bash
2+
# Pre-commit hygiene:
3+
# - Laravel Pint: checks only changed files and auto-fixes
4+
# - Composer Normalize: formats composer.json deterministically
5+
# - Test inventory doc: refreshes docs/tests.md
6+
7+
set -euo pipefail
8+
9+
# Ensure we're at repo root even if hook runs from .git/hooks
10+
cd "$(git rev-parse --show-toplevel)"
11+
12+
# Only run if composer.json exists and Pint is installed
13+
if [[ ! -f composer.json ]]; then
14+
exit 0
15+
fi
16+
17+
if [[ ! -x vendor/bin/pint ]]; then
18+
# Try running via Composer bin proxy if available
19+
if ! command -v composer >/dev/null 2>&1; then
20+
echo "composer not found; skipping Pint pre-commit" >&2
21+
exit 0
22+
fi
23+
fi
24+
25+
# First, operate only on staged PHP files to avoid touching unstaged work.
26+
# - Collect staged PHP files (Added/Copied/Modified)
27+
# - Run Pint only on that list (use --test first), then fix and re-add only those files
28+
_STAGED_PHP=()
29+
# Portable collection of staged PHP files (avoids mapfile/readarray so it works on macOS' default Bash)
30+
while IFS= read -r _f; do
31+
_STAGED_PHP+=("${_f}")
32+
done < <(git diff --name-only --cached --diff-filter=ACM -- '*.php' || true)
33+
if [[ ${#_STAGED_PHP[@]} -gt 0 ]]; then
34+
# Ensure Pint binary exists (we checked earlier) and run tests against staged files
35+
if ! vendor/bin/pint --test "${_STAGED_PHP[@]}" >/dev/null 2>&1; then
36+
echo "Pint found style issues in staged files. Applying fixes..." >&2
37+
# Run Pint to apply fixes to the same staged files only
38+
vendor/bin/pint "${_STAGED_PHP[@]}" || true
39+
# Re-add only the files we targeted (don't use a blanket add)
40+
git add -- "${_STAGED_PHP[@]}"
41+
fi
42+
else
43+
# No staged PHP files to lint/format
44+
:
45+
fi
46+
47+
# Composer Normalize (if available)
48+
if command -v composer >/dev/null 2>&1; then
49+
if composer normalize --dry-run --no-interaction >/dev/null 2>&1; then
50+
: # already normalized
51+
else
52+
echo "Normalizing composer.json..." >&2
53+
composer normalize --no-interaction || true
54+
if [[ -f composer.json ]]; then
55+
git add composer.json || true
56+
fi
57+
if [[ -f composer.lock ]]; then
58+
git add composer.lock || true
59+
fi
60+
fi
61+
fi
62+
63+
# Generate/refresh test inventory docs to keep docs/tests.md current
64+
if command -v composer >/dev/null 2>&1; then
65+
if composer run -q docs:tests >/dev/null 2>&1; then
66+
if ! git diff --quiet -- docs/tests.md; then
67+
git add docs/tests.md
68+
echo "Updated docs/tests.md (test inventory)." >&2
69+
fi
70+
fi
71+
fi
72+
73+
exit 0

.github/dependabot.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "composer"
4+
directory: "/"
5+
schedule:
6+
interval: "monthly"
7+
open-pull-requests-limit: 10
8+
versioning-strategy: increase
9+
- package-ecosystem: "github-actions"
10+
directory: "/"
11+
schedule:
12+
interval: "monthly"
13+
open-pull-requests-limit: 10

.github/pull_request_template.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
## Summary
2+
3+
Please provide a brief description of the change and its motivation.
4+
5+
## Checklist
6+
7+
- [ ] Public APIs use explicit array generics where applicable
8+
(e.g., `array<string,mixed>`, `array<int,string>`)
9+
- [ ] Interface methods with array parameters/returns include PHPDoc generics
10+
(`@param array<string,mixed> $params`, `@return array<string,mixed>`)
11+
- [ ] Redirects and responses return concrete Symfony `Response` types
12+
(e.g., use `redirect()->to(...)` for a `RedirectResponse`)
13+
- [ ] JSON encoding in new code paths cannot return `false`
14+
(e.g., use `JSON_THROW_ON_ERROR` when appropriate)
15+
- [ ] Composer files are normalized (`composer normalize --dry-run` is clean)
16+
- [ ] Static analysis passes locally (`composer stan` or `vendor/bin/phpstan`)
17+
- [ ] Tests pass locally (`composer test`)
18+
19+
## Notes
20+
21+
Add any additional context, migration notes, or follow-ups here.

.github/release-drafter-config.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name-template: "v$NEXT_PATCH_VERSION"
2+
tag-template: "v$NEXT_PATCH_VERSION"
3+
categories:
4+
- title: Breaking Changes
5+
labels:
6+
- breaking-change
7+
- BC
8+
- title: Features
9+
labels:
10+
- enhancement
11+
- feature
12+
- title: Bug Fixes
13+
labels:
14+
- bug
15+
- fix
16+
- title: Maintenance
17+
labels:
18+
- chore
19+
- dependencies
20+
- refactor
21+
- tests
22+
- title: Documentation
23+
labels:
24+
- docs
25+
change-template: "- $TITLE (#$NUMBER) @$AUTHOR"
26+
change-title-escapes: '"`' # escape double quotes and backticks
27+
exclude-labels:
28+
- skip-changelog
29+
template: |
30+
## What's Changed
31+
32+
$CHANGES
33+
34+
--
35+
Compare: $COMPARE_URL

.github/release-drafter.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name-template: "v$NEXT_PATCH_VERSION"
2+
tag-template: "v$NEXT_PATCH_VERSION"
3+
categories:
4+
- title: Breaking Changes
5+
labels:
6+
- breaking-change
7+
- BC
8+
- title: Features
9+
labels:
10+
- enhancement
11+
- feature
12+
- title: Bug Fixes
13+
labels:
14+
- bug
15+
- fix
16+
- title: Maintenance
17+
labels:
18+
- chore
19+
- dependencies
20+
- refactor
21+
- tests
22+
- title: Documentation
23+
labels:
24+
- docs
25+
change-template: "- $TITLE (#$NUMBER) @$AUTHOR"
26+
change-title-escapes: "\"`" # escape double quotes and backticks
27+
exclude-labels:
28+
- skip-changelog
29+
template: |
30+
## What Changed
31+
name-template: "v$NEXT_PATCH_VERSION"
32+
tag-template: "v$NEXT_PATCH_VERSION"
33+
categories:
34+
- title: Breaking Changes
35+
labels:
36+
- breaking-change
37+
- BC
38+
- title: Features
39+
labels:
40+
- enhancement
41+
- feature
42+
- title: Bug Fixes
43+
labels:
44+
- bug
45+
- fix
46+
- title: Maintenance
47+
labels:
48+
- chore
49+
- dependencies
50+
- refactor
51+
- tests
52+
- title: Documentation
53+
labels:
54+
- docs
55+
change-template: "- $TITLE (#$NUMBER) @$AUTHOR"
56+
change-title-escapes: "\"`" # escape double quotes and backticks
57+
exclude-labels:
58+
- skip-changelog
59+
template: |
60+
## What's Changed
61+
62+
$CHANGES
63+
64+
--
65+
Compare: $COMPARE_URL

.github/workflows/ci.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: CI
2+
# touching: trigger children sync when workflows change
3+
4+
on:
5+
push:
6+
branches: [main]
7+
pull_request:
8+
9+
permissions:
10+
contents: read
11+
12+
concurrency:
13+
group: ci-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
tests:
18+
name: PHP 8.3 • L12 • deps=highest • OS=ubuntu-latest
19+
runs-on: ubuntu-latest
20+
env:
21+
# Throttle parallel HTTP downloads to reduce GitHub codeload 429 rate limit occurrences for all child packages inheriting this workflow.
22+
COMPOSER_MAX_PARALLEL_HTTP: 6
23+
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v6
27+
28+
- name: Setup PHP (8.3)
29+
uses: shivammathur/setup-php@v2
30+
with:
31+
php-version: "8.3"
32+
extensions: mbstring, dom, pdo, sqlite3, pdo_sqlite, fileinfo
33+
coverage: none
34+
tools: composer:v2
35+
36+
- name: Validate composer.json
37+
run: composer validate --strict
38+
39+
- name: Configure GitHub OAuth for Composer (improves API rate limits)
40+
run: composer config -g github-oauth.github.com "${{ secrets.GITHUB_TOKEN }}"
41+
# GITHUB_TOKEN is automatically provided by Actions; using it boosts authenticated quota for metadata requests.
42+
43+
- name: Get Composer cache directory
44+
shell: bash
45+
id: composer-cache
46+
run: |
47+
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
48+
49+
- name: Cache Composer files
50+
uses: actions/cache@v5
51+
with:
52+
path: ${{ steps.composer-cache.outputs.dir }}
53+
key: ${{ runner.os }}-composer-php83-highest-${{ hashFiles('**/composer.lock') }}
54+
restore-keys: |
55+
${{ runner.os }}-composer-php83-highest-
56+
${{ runner.os }}-composer-php83-
57+
58+
- name: Install dependencies
59+
shell: bash
60+
run: |
61+
set -euo pipefail
62+
echo "Starting composer update with limited parallel HTTP=${COMPOSER_MAX_PARALLEL_HTTP}";
63+
for attempt in 1 2 3; do
64+
if composer update --no-interaction --prefer-dist --no-progress; then
65+
break
66+
fi
67+
echo "Composer update failed (attempt ${attempt}). Retrying after backoff..." >&2
68+
sleep $((attempt*15))
69+
done
70+
echo "Composer dependencies installed.";
71+
72+
- name: Clear testbench cache
73+
run: |
74+
rm -rf vendor/orchestra/testbench-core/laravel/bootstrap/cache/*
75+
rm -rf vendor/orchestra/testbench-core/laravel/database/database.sqlite
76+
77+
- name: Run test suite
78+
run: composer test

.github/workflows/code-style.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Code Style
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
permissions:
9+
contents: read
10+
11+
concurrency:
12+
group: style-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
pint:
17+
name: Laravel Pint
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v6
22+
23+
- name: Run Pint --test
24+
# Use the community Pint action to avoid managing installation.
25+
# Explicit version avoids invalid "latest" constraint errors.
26+
uses: aglipanci/laravel-pint-action@v2
27+
with:
28+
preset: laravel
29+
verboseMode: true
30+
pintVersion: "1.25.1"
31+
useComposer: false
32+
env:
33+
PINT_ARGS: --test
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Composer Normalize
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
permissions:
9+
contents: read
10+
11+
concurrency:
12+
group: normalize-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
normalize:
17+
name: Check composer.json normalization
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v6
22+
23+
- name: Setup PHP
24+
uses: shivammathur/setup-php@v2
25+
with:
26+
php-version: "8.3"
27+
coverage: none
28+
tools: composer:v2
29+
30+
- name: Install dev tools
31+
run: composer update --no-interaction --prefer-dist --no-progress
32+
33+
- name: Run composer-normalize (dry-run)
34+
run: composer normalize --dry-run --no-interaction
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Release Drafter
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
types: [opened, reopened, synchronize, labeled, unlabeled, closed]
8+
9+
permissions:
10+
contents: write
11+
12+
concurrency:
13+
group: release-drafter-${{ github.ref }}
14+
cancel-in-progress: false
15+
16+
jobs:
17+
update_release_draft:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: release-drafter/release-drafter@v6
21+
with:
22+
config-name: release-drafter-config.yml
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)