Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
b377527
feat: enhance Versioning class with caching and multiple version formats
Williamug Dec 1, 2025
ccb65fb
feat: add versioning configuration file
Williamug Dec 1, 2025
c1c865f
feat: implement StandaloneVersioning class
Williamug Dec 1, 2025
ce253bf
feat: implement UniversalVersioning class with framework-agnostic cac…
Williamug Dec 1, 2025
2d23323
docs: completely rewrite and enhance README.md
Williamug Dec 1, 2025
c0a4bea
docs: add comprehensive framework integration guide
Williamug Dec 1, 2025
552fc7c
docs: add comprehensive vanilla PHP usage guide
Williamug Dec 1, 2025
4ddaf98
docs: add class selection guide
Williamug Dec 1, 2025
57f4398
docs: add CONTRIBUTING.md with contribution guidelines
Williamug Dec 1, 2025
20276d3
docs: add SECURITY.md with security policy
Williamug Dec 1, 2025
355a393
test: add comprehensive test suite for versioning classes
Williamug Dec 1, 2025
fcf7a6c
docs: add comprehensive example files
Williamug Dec 1, 2025
eae8e71
chore: update GitHub Actions workflow for testing
Williamug Dec 1, 2025
dd16dc1
chore: update CHANGELOG.md
Williamug Dec 1, 2025
229da9c
chore: update composer.json dependencies and configuration
Williamug Dec 1, 2025
1aac078
feat: enhance VersioningServiceProvider with new features
Williamug Dec 1, 2025
324bc03
feat: add utility functions for versioning
Williamug Dec 1, 2025
ce86901
test: update example tests with comprehensive test cases
Williamug Dec 1, 2025
e0aab2c
chore: remove deprecated skeleton configuration file
Williamug Dec 1, 2025
3e1d9f5
test: update Pest test configuration
Williamug Dec 1, 2025
01cb49a
chore: update .gitignore with additional build and config files
Williamug Dec 1, 2025
2606d9b
chore: update test report with latest test results
Williamug Dec 1, 2025
6c4fbc7
chore: add Laravel Pint configuration
Williamug Dec 1, 2025
97fed92
style: fix indentation in versioning config
Williamug Dec 1, 2025
ce52199
style: standardize indentation in CodeIgniter example
Williamug Dec 1, 2025
2327fa0
style: update path concatenation in index.php
Williamug Dec 1, 2025
331ad71
style: update code style in Slim integration example
Williamug Dec 1, 2025
8377a76
refactor: improve code formatting and indentation in Versioning class
Williamug Dec 1, 2025
a74b0c6
refactor: improve code formatting and readability in StandaloneVersio…
Williamug Dec 1, 2025
098370b
refactor: improve code organization and caching in UniversalVersioning
Williamug Dec 1, 2025
e266733
refactor: improve code formatting in VersioningServiceProvider
Williamug Dec 1, 2025
24d1b75
refactor: improve code formatting in functions.php
Williamug Dec 1, 2025
4678be7
test: improve BladeDirectivesTest formatting
Williamug Dec 1, 2025
2c10c9c
test: improve ExampleTest formatting and readability
Williamug Dec 1, 2025
6db3e31
test: improve FunctionTest formatting and readability
Williamug Dec 1, 2025
eeb7b28
test: improve StandaloneVersioningTest formatting and readability
Williamug Dec 1, 2025
880deee
style: improve UniversalVersioningTest formatting
Williamug Dec 1, 2025
5b5b754
style: improve UniversalVersioningTest formatting
Williamug Dec 1, 2025
4c3a1da
wip
Williamug Dec 1, 2025
11f6123
wip
Williamug Dec 1, 2025
1d0b330
wip
Williamug Dec 1, 2025
f2b3a26
wip
Williamug Dec 1, 2025
caec2b6
wip
Williamug Dec 1, 2025
b1f59af
wip
Williamug Dec 1, 2025
57d63e3
fix
Williamug Dec 1, 2025
b88169d
fix
Williamug Dec 1, 2025
9c096db
Fix errors
Williamug Dec 1, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 59 additions & 9 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,18 @@ name: run-tests
on:
push:
paths:
- '**.php'
- '.github/workflows/run-tests.yml'
- 'phpunit.xml.dist'
- 'composer.json'
- 'composer.lock'
- "**.php"
- ".github/workflows/run-tests.yml"
- "phpunit.xml.dist"
- "composer.json"
- "composer.lock"
pull_request:
paths:
- "**.php"
- ".github/workflows/run-tests.yml"
- "phpunit.xml.dist"
- "composer.json"
- "composer.lock"

jobs:
test:
Expand All @@ -17,13 +24,14 @@ jobs:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest]
php: [8.3, 8.2, 8.1]
laravel: [10.*]
php: [8.3, 8.2]
laravel: [11.*, 10.*]
stability: [prefer-lowest, prefer-stable]
include:
- laravel: 11.*
testbench: 9.*
- laravel: 10.*
testbench: 8.*
carbon: ^2.63

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}

Expand All @@ -45,11 +53,53 @@ jobs:

- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "nesbot/carbon:${{ matrix.carbon }}" --no-interaction --no-update
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --${{ matrix.stability }} --prefer-dist --no-interaction

- name: List Installed Dependencies
run: composer show -D

- name: Execute tests
run: vendor/bin/pest --ci

static-analysis:
runs-on: ubuntu-latest
timeout-minutes: 5

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

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv
coverage: none

- name: Install dependencies
run: composer update --prefer-stable --prefer-dist --no-interaction

- name: Run PHPStan
run: vendor/bin/phpstan analyse --error-format=github

code-style:
runs-on: ubuntu-latest
timeout-minutes: 5

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

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
extensions: dom, curl, libxml, mbstring, zip
coverage: none

- name: Install dependencies
run: composer update --prefer-stable --prefer-dist --no-interaction

- name: Check code style
run: vendor/bin/pint --test
11 changes: 7 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
.idea
.phpunit.cache
composer.lock
coverage
docs
coverage/
docs/
phpunit.xml
phpunit.xml.dist
phpstan.neon
testbench.yaml
vendor
node_modules
vendor/
node_modules/
build/report.junit.xml
coverage/
36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,42 @@

All notable changes to `versioning` will be documented in this file.

## v3.0.0 - 2025-12-01

### Major Updates 🎉

* **BREAKING**: Dropped PHP 8.1 support, now requires PHP 8.2+
* **BREAKING**: Updated Laravel support to v10 and v11
* Added comprehensive configuration file support
* Added built-in caching mechanism for performance
* Added multiple version format options (tag, full, commit, tag-commit)
* Added proper error handling and security improvements
* Added extensive test coverage with Pest
* Added PHPStan for static analysis (level 8)
* Added additional Blade directives (@app_version_tag, @app_version_full, @app_version_commit)
* Added cache clearing functionality
* Updated CI/CD workflow with separate jobs for tests, static analysis, and code style
* Improved documentation with examples and troubleshooting
* Security: Proper command sanitization using escapeshellarg
* Security: Added fallback version support for non-git environments

### New Features

* `Versioning::full()` - Get full git describe output
* `Versioning::commit()` - Get commit hash
* `Versioning::tagWithCommit()` - Get tag with commit
* `Versioning::clearCache()` - Clear version cache
* Configuration file with extensive options
* Environment variable support for fallback version
* Configurable version prefix (v or no v)

### Developer Experience

* Added Larastan for Laravel-specific static analysis
* Updated Pint to latest version
* Added comprehensive test suite
* Improved code quality and maintainability

## v2.0.3 - 2024-04-18

### What's Changed
Expand Down
107 changes: 107 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# Contributing

Contributions are **welcome** and will be fully **credited**.

We accept contributions via Pull Requests on [Github](https://github.com/williamug/versioning).

## Pull Requests

- **Add tests!** - Your patch won't be accepted if it doesn't have tests.

- **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date.

- **Consider our release cycle** - We try to follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option.

- **Create feature branches** - Don't ask us to pull from your main branch.

- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.

- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](http://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting.

## Running Tests

```bash
composer test
```

## Running Static Analysis

```bash
composer analyse
```

## Code Style

We use [Laravel Pint](https://github.com/laravel/pint) for code styling.

```bash
composer format
```

To check code style without fixing:

```bash
vendor/bin/pint --test
```

## Development Setup

1. Fork the repository
2. Clone your fork: `git clone https://github.com/your-username/versioning.git`
3. Install dependencies: `composer install`
4. Create a branch: `git checkout -b my-new-feature`
5. Make your changes
6. Run tests: `composer test`
7. Run static analysis: `composer analyse`
8. Format code: `composer format`
9. Commit your changes: `git commit -am 'Add some feature'`
10. Push to the branch: `git push origin my-new-feature`
11. Submit a pull request

## Guidelines

### Coding Standards

- Follow PSR-12 coding standards
- Use type hints wherever possible
- Add docblocks for classes and methods
- Keep methods small and focused

### Testing

- Write tests for all new features
- Ensure tests are clear and descriptive
- Use Pest syntax for consistency
- Aim for high test coverage

### Documentation

- Update README.md if you change functionality
- Add PHPDoc blocks to new methods
- Include usage examples for new features

### Commit Messages

- Use clear and meaningful commit messages
- Start with a verb in present tense (Add, Update, Fix, Remove)
- Reference issue numbers when applicable

Example:
```
Add cache clearing functionality

- Implement clearCache() method
- Add tests for cache clearing
- Update documentation

Fixes #123
```

## Questions?

If you have any questions about contributing, feel free to:
- Open an issue
- Start a discussion
- Contact the maintainer

**Happy coding!**
Loading
Loading