Skip to content

Commit 363eaf1

Browse files
committed
feat: add package scaffolding
0 parents  commit 363eaf1

File tree

15 files changed

+521
-0
lines changed

15 files changed

+521
-0
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: calebdw

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
version: 2
3+
updates:
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"
8+
- package-ecosystem: "composer"
9+
directory: "/"
10+
schedule:
11+
interval: "weekly"

.github/workflows/tests.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
name: Tests
3+
4+
on:
5+
push:
6+
paths-ignore:
7+
- '**.md'
8+
- 'docs/**'
9+
branches:
10+
- '**'
11+
pull_request:
12+
types: [ready_for_review, synchronize, opened]
13+
paths-ignore:
14+
- '**.md'
15+
- 'docs/**'
16+
17+
jobs:
18+
tests:
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
php: [8.4]
23+
laravel: ['^11.0', '^12.0']
24+
name: PHP${{ matrix.php }} - Laravel${{ matrix.laravel }}
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout code
28+
uses: actions/checkout@v4
29+
30+
- name: Setup PHP
31+
uses: shivammathur/setup-php@v2
32+
with:
33+
php-version: ${{ matrix.php }}
34+
extensions: dom, curl, libxml, mbstring, zip, fileinfo, pdo_sqlite, iconv
35+
tools: composer:v2
36+
coverage: xdebug
37+
38+
- name: Check Composer configuration
39+
run: composer validate --strict
40+
41+
- name: Get composer cache directory
42+
id: composer-cache
43+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
44+
45+
- name: Cache composer dependencies
46+
uses: actions/cache@v4
47+
with:
48+
path: ${{ steps.composer-cache.outputs.dir }}
49+
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
50+
restore-keys: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-
51+
52+
- name: Install dependencies from composer.json
53+
run: composer update --with='laravel/framework:${{ matrix.laravel }}' --no-interaction --no-progress
54+
55+
- name: Check PSR-4 mapping
56+
run: composer dump-autoload --optimize --strict-psr
57+
58+
- name: Execute tests
59+
run: composer test
60+
61+
- name: Upload coverage reports to Codecov
62+
uses: codecov/codecov-action@v5.4.0
63+
with:
64+
token: ${{ secrets.CODECOV_TOKEN }}

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.phpunit.cache/
2+
coverage/
3+
vendor/
4+
.phpunit.result.cache
5+
.pint.cache
6+
composer.lock

CONTRIBUTING.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# CONTRIBUTING
2+
3+
Contributions are welcome, and are accepted via pull requests.
4+
Please review these guidelines before submitting any pull requests.
5+
6+
## Process
7+
8+
1. Fork the project
9+
1. Create a new branch
10+
1. Code, test, commit and push
11+
1. Open a pull request detailing your changes.
12+
13+
## Guidelines
14+
15+
- Please follow the [PSR-12 Coding Style Guide](http://www.php-fig.org/psr/psr-12/), enforced by [Pint](https://github.com/laravel/pint).
16+
- Send a coherent commit history, making sure each individual commit in your pull request is meaningful.
17+
- You may need to [rebase](https://git-scm.com/book/en/v2/Git-Branching-Rebasing) to avoid merge conflicts.
18+
- Please remember that we follow [SemVer](http://semver.org/).
19+
20+
## Setup
21+
22+
Clone your fork, then install the dependencies:
23+
24+
```bash
25+
composer install
26+
```
27+
28+
## Tests
29+
30+
Run all tests:
31+
32+
```bash
33+
composer test
34+
```
35+
36+
Linting:
37+
38+
```bash
39+
composer test:lint
40+
```
41+
42+
Static analysis:
43+
44+
```bash
45+
composer test:static
46+
```
47+
48+
PHPUnit tests:
49+
50+
```bash
51+
composer test:coverage
52+
```

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright © 2024 Caleb White
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<div align="center">
2+
<p>
3+
<img src="/art/sql-entities.webp" alt="SQL Entities" width="40%">
4+
</p>
5+
<p>Manage SQL entities in [Laravel](https://laravel.com) with ease!</p>
6+
<p>
7+
<a href="https://github.com/calebdw/laravel-sql-entities/actions/workflows/tests.yml"><img src="https://github.com/calebdw/laravel-sql-entities/actions/workflows/tests.yml/badge.svg" alt="Test Results"></a>
8+
<a href="https://codecov.io/github/calebdw/laravel-sql-entities"><img src="https://codecov.io/github/calebdw/laravel-sql-entities/graph/badge.svg?token=RPLQKWDM5G" alt="Code Coverage"></a>
9+
<a href="https://github.com/calebdw/laravel-sql-entities"><img src="https://img.shields.io/github/license/calebdw/laravel-sql-entities" alt="License"></a>
10+
<a href="https://packagist.org/packages/calebdw/laravel-sql-entities"><img src="https://img.shields.io/packagist/v/calebdw/laravel-sql-entities.svg" alt="Packagist Version"></a>
11+
<a href="https://packagist.org/packages/calebdw/laravel-sql-entities"><img src="https://img.shields.io/packagist/dt/calebdw/laravel-sql-entities.svg" alt="Total Downloads"></a>
12+
</p>
13+
</div>
14+
15+
## Installation
16+
17+
First pull in the package using Composer:
18+
19+
```bash
20+
composer require calebdw/laravel-sql-entities
21+
```
22+
23+
And then publish the package's configuration file:
24+
25+
```bash
26+
php artisan vendor:publish --provider="CalebDW\SqlEntities\ServiceProvider"
27+
```
28+
29+
## Configuration
30+
31+
## Usage
32+
33+
## Contributing
34+
35+
Thank you for considering contributing! You can read the contribution guide [here](CONTRIBUTING.md).
36+
37+
## License
38+
39+
This is open-sourced software licensed under the [MIT license](LICENSE).
40+
41+
## Alternatives

art/sql-entities.webp

22.3 KB
Loading

composer.json

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
{
2+
"name": "calebdw/sql-entities",
3+
"description": "Manage SQL entities in Laravel with ease.",
4+
"keywords": [
5+
"php",
6+
"laravel",
7+
"database",
8+
"sql",
9+
"entities"
10+
],
11+
"type": "library",
12+
"license": "MIT",
13+
"authors": [
14+
{
15+
"name": "Caleb White",
16+
"email": "cdwhite3@pm.me"
17+
}
18+
],
19+
"homepage": "https://github.com/calebdw/laravel-sql-entities",
20+
"autoload": {
21+
"psr-4": {
22+
"CalebDW\\SqlEntities\\": "src/"
23+
}
24+
},
25+
"autoload-dev": {
26+
"psr-4": {
27+
"CalebDW\\SqlEntities\\Tests\\": "tests/",
28+
"Workbench\\App\\": "workbench/app/",
29+
"Workbench\\Database\\Entities\\": "workbench/database/entities/"
30+
}
31+
},
32+
"require": {
33+
"php": "^8.4",
34+
"illuminate/contracts": "^11.0 || ^12.0",
35+
"illuminate/database": "^11.0 || ^12.0",
36+
"illuminate/support": "^11.0 || ^12.0"
37+
},
38+
"require-dev": {
39+
"calebdw/larastan": "^3.0",
40+
"laravel/pint": "^1.16.2",
41+
"orchestra/testbench": "^9.0 || ^10.0",
42+
"pestphp/pest": "^3.0"
43+
},
44+
"extra": {
45+
"laravel": {
46+
"providers": [
47+
"CalebDW\\SqlEntities\\ServiceProvider"
48+
]
49+
}
50+
},
51+
"config": {
52+
"sort-packages": true,
53+
"preferred-install": "dist",
54+
"allow-plugins": {
55+
"pestphp/pest-plugin": true
56+
}
57+
},
58+
"scripts": {
59+
"test:lint": "pint --test",
60+
"test:lint-fix": "pint",
61+
"test:static": "phpstan analyze --ansi -v",
62+
"test:unit": "pest",
63+
"test:coverage": [
64+
"@putenv XDEBUG_MODE=coverage",
65+
"pest --coverage"
66+
],
67+
"test": [
68+
"@test:static",
69+
"@test:coverage"
70+
],
71+
"post-autoload-dump": [
72+
"@prepare"
73+
],
74+
"prepare": "@php vendor/bin/testbench package:discover --ansi"
75+
},
76+
"prefer-stable": true,
77+
"minimum-stability": "dev"
78+
}

phpstan.neon.dist

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
parameters:
2+
level: max
3+
paths:
4+
- src
5+
- workbench/app

0 commit comments

Comments
 (0)