Skip to content

Commit

Permalink
Add example package skeleton
Browse files Browse the repository at this point in the history
  • Loading branch information
relliv committed May 29, 2022
1 parent b7d3730 commit c245078
Show file tree
Hide file tree
Showing 24 changed files with 1,224 additions and 0 deletions.
1 change: 1 addition & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
comment: off
766 changes: 766 additions & 0 deletions .editorconfig

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
* text=auto

.github/ export-ignore
tests/ export-ignore

.codecov.yml export-ignore
.editorconfig export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.scrutinizer.yml export-ignore
.styleci.yml export-ignore

phpunit.xml export-ignore
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
custom: [ ]
26 changes: 26 additions & 0 deletions .github/ISSUE_TEMPLATE/1_Bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: "Bug report"
about: "Report something that's broken"
---

<!-- DO NOT THROW THIS AWAY -->
<!-- Fill out the FULL versions with patch versions -->

- Laravel Theme Manager Version: #.#.#
- PHP Version: #.#.#
- Laravel/Lumen Framework Version: #.#.#
- Database Driver & Version:

### Description:


### Steps To Reproduce:


### Execution result:

<details>
<summary>Show result</summary>

// paste result here
</details>
9 changes: 9 additions & 0 deletions .github/ISSUE_TEMPLATE/2_Feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
name: "Feature request"
about: "New functionality proposal."
---

<!-- DO NOT THROW THIS AWAY -->
<!-- Fill out the FULL versions with patch versions -->

### Description:
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Support Questions & Other
url: {{repository_url}}/discussions
about: Discuss any issues related to the application or templates working with it.
5 changes: 5 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!--
Pull requests without a descriptive title, thorough description, or tests will be closed.
In addition, please describe the benefit to end users; the reasons it does not break any existing features; how it makes building web applications easier, etc.
-->
39 changes: 39 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: coverage
on:
push:
branches:
- main
- coverage

jobs:
scrutinizer:
runs-on: ubuntu-20.04

name: Coverage

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

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
extensions: curl, mbstring, zip, pcntl, pdo, pdo_sqlite, iconv, bcmath
coverage: xdebug

- name: Composer self update
run: composer self-update

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

- name: Execute tests
run: |
mkdir -p build/logs
sudo vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover
- name: Export
run: |
wget https://scrutinizer-ci.com/ocular.phar
sudo php ocular.phar code-coverage:upload --format=php-clover coverage.clover
33 changes: 33 additions & 0 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: phpunit
on: [ push ]

jobs:
build:
runs-on: ubuntu-20.04

strategy:
fail-fast: true
matrix:
php: [ "8.0" ]

name: PHP ${{ matrix.php }}

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

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: curl, mbstring, zip, pcntl, pdo, pdo_sqlite, iconv, bcmath
coverage: none

- name: Composer self update
run: composer self-update

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

- name: Execute tests
run: sudo vendor/bin/phpunit
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.idea/

build/
node_modules/
vendor/
dist/

*.bak
*.cache
*.clover
*.orig

*.lock

mix-manifest.json
.vscode/settings.json
67 changes: 67 additions & 0 deletions .styleci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
preset: psr12

risky: true

enabled:
- align_double_arrow
- align_equals
- align_phpdoc
- alpha_ordered_imports
- binary_operator_spaces
- blank_line_before_continue
- blank_line_before_declare
- blank_line_before_return
- blank_line_before_throw
- blank_line_before_try
- cast_spaces
- combine_consecutive_issets
- const_separation
- dir_constant
- fully_qualified_strict_types
- logical_operators
- method_separation
- no_alias_functions
- no_blank_lines_after_phpdoc
- no_blank_lines_between_traits
- no_empty_comment
- no_empty_phpdoc
- no_extra_block_blank_lines
- no_extra_consecutive_blank_lines
- no_short_bool_cast
- no_trailing_comma_in_singleline_array
- no_unneeded_control_parentheses
- no_unused_imports
- ordered_class_elements
- php_unit_construct
- php_unit_fqcn_annotation
- phpdoc_indent
- phpdoc_inline_tag
- phpdoc_link_to_see
- phpdoc_no_access
- phpdoc_no_empty_return
- phpdoc_no_package
- phpdoc_no_useless_inheritdoc
- phpdoc_order
- phpdoc_property
- phpdoc_return_self_reference
- phpdoc_scalar
- phpdoc_separation
- phpdoc_summary
- phpdoc_to_comment
- phpdoc_trim
- phpdoc_type_to_var
- phpdoc_types
- phpdoc_types_order
- phpdoc_var_without_name
- property_separation
- self_accessor
- short_array_syntax
- short_list_syntax
- single_line_class_definition
- single_line_throw
- single_quote
- space_after_semicolon
- standardize_not_equals
- ternary_to_null_coalescing
- trailing_comma_in_multiline_array
- trim_array_spaces
10 changes: 10 additions & 0 deletions config/package-name.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

return [
/**
* This is special config for package.
*
* Add more description here.
*/
'add_some_config' => true
];
7 changes: 7 additions & 0 deletions routes/admin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

use Illuminate\Support\Facades\Route;
use Illuminate\Support\Facades\Config;

Route::name('package-name.admin.')->prefix('admin/package-name')->group(function () {
});
7 changes: 7 additions & 0 deletions routes/api.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

use Illuminate\Support\Facades\Route;
use Illuminate\Support\Facades\Config;

Route::name('package-name.api.')->prefix('api/v1/package-name')->group(function () {
});
7 changes: 7 additions & 0 deletions routes/web.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

use Illuminate\Support\Facades\Route;
use Illuminate\Support\Facades\Config;

Route::name('package-name.web.')->prefix('package-name')->group(function () {
});
9 changes: 9 additions & 0 deletions src/Exceptions/ThemeStoreException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

namespace LaravelReady\PackageStarter\Exceptions;

use Exception;

final class MyCustomException extends Exception
{
}
13 changes: 13 additions & 0 deletions src/Facades/PackageName.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace LaravelReady\PackageStarter\Facades;

use Illuminate\Support\Facades\Facade;

class PackageName extends Facade
{
protected static function getFacadeAccessor()
{
return 'package-name';
}
}
14 changes: 14 additions & 0 deletions src/Http/Controllers/Admin/Controller.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

namespace LaravelReady\PackageStarter\Http\Controllers\Admin;

use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;

use Illuminate\Routing\Controller;

class AdminBaseController extends Controller
{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
}
14 changes: 14 additions & 0 deletions src/Http/Controllers/Api/Controller.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

namespace LaravelReady\PackageStarter\Http\Controllers\Api;

use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;

use Illuminate\Routing\Controller;

class ApiBaseController extends Controller
{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
}
14 changes: 14 additions & 0 deletions src/Http/Controllers/Web/Controller.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

namespace LaravelReady\PackageStarter\Http\Controllers\Web;

use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;

use Illuminate\Routing\Controller;

class WebBaseController extends Controller
{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
}
Loading

0 comments on commit c245078

Please sign in to comment.