-
Notifications
You must be signed in to change notification settings - Fork 0
Update README with advanced usage and improve form handling #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
8dc7732
docs: update README.md with advanced usage examples and improved form…
amasiye f289c8b
chore(forms): align package for 0.9.0
amasiye 4f99817
chore: add pre-push quality gate
amasiye f56a589
chore(forms): refresh lock for 0.9 dependencies
amasiye 1856d8f
Merge branch 'main' into develop
amasiye d983084
chore(forms): bootstrap committed git hooks
amasiye 551dea7
Merge branch 'develop' of github.com:assegaiphp/forms into develop
amasiye File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| repo_root="$(git rev-parse --show-toplevel)" | ||
| cd "$repo_root" | ||
|
|
||
| if [ ! -f composer.json ]; then | ||
| exit 0 | ||
| fi | ||
|
|
||
| has_composer_script() { | ||
| php -r ' | ||
| $composer = json_decode(file_get_contents("composer.json"), true); | ||
| exit(isset($composer["scripts"][$argv[1]]) ? 0 : 1); | ||
| ' "$1" | ||
| } | ||
|
|
||
| run_composer_script() { | ||
| local script="$1" | ||
|
|
||
| if has_composer_script "$script"; then | ||
| printf "\n==> composer %s\n" "$script" | ||
| composer "$script" | ||
| fi | ||
| } | ||
|
|
||
| run_composer_script analyze | ||
| run_composer_script test | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| # GitHub Copilot Instructions | ||
|
|
||
| Use these repository instructions when helping with code, commits, or pull requests in this repository. | ||
|
|
||
| ## Release and milestone discipline | ||
|
|
||
| - Follow the milestone-driven workflow described in the shared Assegai release playbook. | ||
| - Keep work aligned to one milestone at a time. | ||
| - Do not bundle unrelated feature work into one change. | ||
|
|
||
| ## Commit guidance | ||
|
|
||
| When suggesting a commit message, prefer: | ||
|
|
||
| ```text | ||
| type(scope): short summary | ||
| ``` | ||
|
|
||
| Examples: | ||
|
|
||
| - `fix(forms): preserve submitted checkbox values` | ||
| - `feature(forms): add field rendering option defaults` | ||
| - `test(forms): cover validation error rendering` | ||
|
|
||
| Preferred types: | ||
|
|
||
| - `fix` | ||
| - `feature` | ||
| - `docs` | ||
| - `test` | ||
| - `refactor` | ||
| - `chore` | ||
|
|
||
| Keep commits small and single-purpose. | ||
|
|
||
| ## Pull request guidance | ||
|
|
||
| When suggesting or drafting a pull request, use these sections: | ||
|
|
||
| - `Milestone` | ||
| - `Type` | ||
| - `Why this belongs in this milestone` | ||
| - `What changed` | ||
| - `What did not change` | ||
| - `Verification` | ||
| - `User impact` | ||
| - `Release notes` | ||
| - `Upgrade notes` | ||
|
|
||
| ## Verification guidance | ||
|
|
||
| The default check is usually: | ||
|
|
||
| - `composer test` | ||
|
|
||
| Do not claim work is green unless the relevant checks actually passed. | ||
|
|
||
| ## 1.0.0 framing | ||
|
|
||
| Treat `1.0.0` as the minimum viable identity of AssegaiPHP, not the complete list of everything the framework could eventually become. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| ## Milestone | ||
| <!-- Example: 0.9.0, 1.0.0, 1.0+ --> | ||
|
|
||
| ## Type | ||
| <!-- Example labels: feature, bug, docs, test, refactor, breaking --> | ||
|
|
||
| ## Why this belongs in this milestone | ||
| <!-- Explain why this work belongs here instead of another milestone. --> | ||
|
|
||
| ## What changed | ||
| - | ||
|
|
||
| ## What did not change | ||
| - | ||
|
|
||
| ## Verification | ||
| - `composer test` | ||
|
|
||
| ## User impact | ||
| - | ||
|
|
||
| ## Release notes | ||
| <!-- Use: Needed / Not needed --> | ||
|
|
||
| ## Upgrade notes | ||
| <!-- Use: Needed / Not needed --> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| name: PHP Composer | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ "main", "develop" ] | ||
| pull_request: | ||
| branches: [ "main", "develop" ] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-24.04 | ||
|
|
||
| strategy: | ||
| matrix: | ||
| php-version: | ||
| - "8.4" | ||
| - "latest" | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup PHP | ||
| uses: shivammathur/setup-php@v2 | ||
| with: | ||
| php-version: ${{ matrix.php-version }} | ||
| coverage: none | ||
| tools: composer:v2 | ||
|
|
||
| - name: Validate composer.json and composer.lock | ||
| run: composer validate --strict | ||
|
|
||
| - name: Cache Composer packages | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: vendor | ||
| key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-php-${{ matrix.php-version }}- | ||
| ${{ runner.os }}-php- | ||
|
|
||
| - name: Install dependencies | ||
| run: composer install --prefer-dist --no-progress | ||
|
|
||
| - name: Run test suite | ||
| run: composer test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This hook is added under
.githooks/pre-push, but Git executes hooks from$GIT_DIR/hooksunlesscore.hooksPathis configured to point elsewhere; in this commit I only found the hook file itself and no repo bootstrap/config/docs that setcore.hooksPath, so most contributors will never run these checks and can push without the intendedcomposer analyze/composer testgate.Useful? React with 👍 / 👎.