Skip to content

Commit

Permalink
Finished V1
Browse files Browse the repository at this point in the history
  • Loading branch information
monitecture committed Feb 26, 2024
0 parents commit ecd0b7f
Show file tree
Hide file tree
Showing 187 changed files with 32,490 additions and 0 deletions.
Binary file added .DS_Store
Binary file not shown.
88 changes: 88 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Bug Report
description: |
File a bug report to be fixed.
title: "[X.x] What does happen that is considered an error or bug?"
labels: ["bug"]
assignees:
- ikechukwukalu
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
The more detailed this bug report is, the faster it can be reviewed and fixed.
- type: input
id: version-php-os
attributes:
label: PHP & Platform
description: Exact PHP and Platform (OS) versions using this package.
placeholder: 8.1.2 - Ubuntu 22.04 x64
validations:
required: true
- type: input
id: version-db
attributes:
label: Database
description: Exact DB version using this package, if applicable.
placeholder: MySQL 8.0.28
validations:
required: false
- type: input
id: version-laravel
attributes:
label: Laravel version
description: Exact Laravel version using this package.
placeholder: 9.2.3
validations:
required: true
- type: checkboxes
id: requirements
attributes:
label: Have you done this?
options:
- label: I have checked my logs and I'm sure is a bug in this package.
required: true
- label: I can reproduce this bug in isolation (vanilla Laravel install)
required: true
- label: I can suggest a workaround as a Pull Request
required: false
- type: textarea
id: expectation
attributes:
label: Expectation
description: Write what you expect to (correctly) happen.
placeholder: When I do this, I expect to happen that.
validations:
required: true
- type: textarea
id: description
attributes:
label: Description
description: Write what (incorrectly) happens instead.
placeholder: Instead, when I do this, I receive that.
validations:
required: true
- type: textarea
id: reproduction
attributes:
label: Reproduction
description: Paste the code to assert in a test, or just comment with the repository with the bug to download.
render: php
placeholder: |
$test = something()->causedAn()->earthQuake();
$this->assertFalse($test);
// or comment with "https://github.com/my-name/my-bug-report"
validations:
required: true
- type: textarea
id: logs
attributes:
label: Stack trace & logs
description: If you have a **full** stack trace, you can copy it here. You may hide sensible information.
placeholder: This is automatically formatted into code, no need for ``` backticks.
render: shell
validations:
required: false
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: false
49 changes: 49 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Feature request
description: |
Recommend a feature for this package.
title: "[X.x] I recommend this new feature for this package"
labels: ["enhancement"]
assignees:
- ikechukwukalu
body:
- type: markdown
attributes:
value: |
Thanks for contributing to this package!
New features keep this package fresh and fun for everybody to use.
- type: checkboxes
id: requirements
attributes:
label: Please check these requirements
options:
- label: This feature helps everyone using this package
required: true
- label: It's feasible and maintainable
required: true
- label: It's non breaking
required: true
- label: I issued a PR with the implementation (optional)
required: false
- type: textarea
id: description
attributes:
label: Description
description: Describe how the feature works
placeholder: |
This new feature would accomplish...
It could be implemented by doing...
And it would be cool because...
validations:
required: true
- type: textarea
id: sample
attributes:
label: Code sample
description: Sample a small snippet on how the feature works
placeholder: |
newFeature()->requireSomethingElse();
render: php
validations:
required: true
27 changes: 27 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!--
Thanks for contributing to this package! We only accept PR to the latest stable version.
If you're pushing a Feature:
- Title it: "[X.x] This new feature"
- Describe what the new feature enables
- Show a small code snippet of the new feature
- Ensure it doesn't break backward compatibility.
If you're pushing a Fix:
- Title it: "[X.x] FIX: The bug name"
- Describe how it fixes in a few words.
- Ensure it doesn't break backward compatibility.
All Pull Requests run with extensive tests for stable and latest versions of PHP and Laravel.
Ensure your tests pass or your PR may be taken down.
-->

# Description

This feature/fix allows to...

# Code samples

```php
Route::magicMake();
```
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: composer
directory: "/"
schedule:
interval: daily
time: "09:00"
open-pull-requests-limit: 10
60 changes: 60 additions & 0 deletions .github/workflows/magicmake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Magicmake Unit Tests

on:
push:
pull_request:

jobs:

byte_level:
name: "Byte-level"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout code"
uses: "actions/checkout@v3"
- name: "Check file permissions"
run: |
test "$(find . -type f -not -path './.git/*' -executable)" == ""
- name: "Find non-printable ASCII characters"
run: |
! LC_ALL=C.UTF-8 find ./src -type f -name "*.php" -print0 | xargs -0 -- grep -PHn "[^ -~]"
syntax_errors:
name: "Syntax errors"
runs-on: "ubuntu-latest"
steps:
- name: "Set up PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "8.2"
tools: "parallel-lint"
- name: "Checkout code"
uses: "actions/checkout@v3"
- name: "Validate Composer configuration"
run: "composer validate --strict"
- name: "Check source code for syntax errors"
run: "composer exec -- parallel-lint src/"
unit_tests:
name: "Unit Tests"
needs:
- "byte_level"
- "syntax_errors"
runs-on: "ubuntu-latest"
steps:
- name: Setup PHP
uses: shivammathur/setup-php@master
with:
php-version: 8.1
extension-csv: mbstring, bcmath
- name: "Checkout code"
uses: "actions/checkout@v3"
- name: Composer install
run: composer install
- name: "Execute unit tests"
run: "composer run-script test"
- name: Run Snyk to check for vulnerabilities
uses: snyk/actions/php@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
args: --all-projects
command: test
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/build
/vendor
/.idea
.php-cs-fixer.cache
.phpunit.result.cache
composer.lock
phpunit.xml.bak
/node_modules
20 changes: 20 additions & 0 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
build:
nodes:
analysis:
project_setup:
override:
- 'true'
image: default-bionic
environment:
php: 8.1.2
tests:
override:
- php-scrutinizer-run
checks:
php: true
coding_style:
php:
spaces:
within:
brackets: true
filter: { }
13 changes: 13 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2024 Kalu Ikechukwu

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
114 changes: 114 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# MAGIC MAKE

[![Latest Version on Packagist](https://img.shields.io/packagist/v/ikechukwukalu/magicmake?style=flat-square)](https://packagist.org/packages/ikechukwukalu/magicmake)
[![Quality Score](https://img.shields.io/scrutinizer/quality/g/ikechukwukalu/magicmake/main?style=flat-square)](https://scrutinizer-ci.com/g/ikechukwukalu/magicmake/)
[![Code Quality](https://img.shields.io/codefactor/grade/github/ikechukwukalu/magicmake?style=flat-square)](https://www.codefactor.io/repository/github/ikechukwukalu/magicmake)
[![Known Vulnerabilities](https://snyk.io/test/github/ikechukwukalu/magicmake/badge.svg?style=flat-square)](https://security.snyk.io/package/composer/ikechukwukalu%2Fmagicmake)
[![Github Workflow Status](https://img.shields.io/github/actions/workflow/status/ikechukwukalu/magicmake/magicmake.yml?branch=main&style=flat-square)](https://github.com/ikechukwukalu/magicmake/actions/workflows/magicmake.yml)
[![Total Downloads](https://img.shields.io/packagist/dt/ikechukwukalu/magicmake?style=flat-square)](https://packagist.org/packages/ikechukwukalu/magicmake)
[![Licence](https://img.shields.io/packagist/l/ikechukwukalu/magicmake?style=flat-square)](https://github.com/ikechukwukalu/magicmake/blob/main/LICENSE.md)

A Laravel scaffolding package for an opinionated Laravel coding style.

## REQUIREMENTS

- PHP 7.3+
- Laravel 8+

## STEPS TO INSTALL

``` shell
composer require ikechukwukalu/magicmake
```

## INIT CLASSES

To initialize prepared classes for a new laravel app.

``` shell
php artisan magic:init
```

This would only run when `env('APP_ENV') === local` and `env(MAGIC_INIT_LOCK) === false`.

## MODEL BASED CLASSES

To generate all model based prepared classes.

``` shell
php artisan magic:model UserKyc
```

To generate individual model based prepared classes.

``` shell
php artisan magic:contract UserKyc --variable=userKyc --underscore=user_kyc

php artisan magic:repository UserKyc --variable=userKyc --underscore=user_kyc

php artisan magic:service UserKyc --variable=userKyc --underscore=user_kyc

php artisan magic:controller UserKyc --variable=userKyc --underscore=user_kyc

php artisan magic:createRequest UserKyc --variable=userKyc --underscore=user_kyc

php artisan magic:updateRequest UserKyc --variable=userKyc --underscore=user_kyc

php artisan magic:deleteRequest UserKyc --variable=userKyc --underscore=user_kyc

php artisan magic:readRequest UserKyc --variable=userKyc --underscore=user_kyc

php artisan magic:api UserKyc --variable=userKyc --underscore=user_kyc

php artisan magic:test UserKyc --variable=userKyc --underscore=user_kyc

php artisan magic:factory UserKyc --variable=userKyc --underscore=user_kyc
```

## FINISHING SETUP

If you did run `php artisan magic:init`.

Add to the `composer.json` file.

```json
"autoload": {
"psr-4": {
"App\\": "app/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/"
},
"files": [
"app/Http/Helpers.php"
]
},
```

Add to the `config/app.php`.

```php
/*
* Package Service Providers...
*/
App\Providers\MacroServiceProvider::class,
App\Providers\RepositoryServiceProvider::class,
```

### Project setup

```shell
npm install
composer install
php artisan migrate:refresh --seed
```

### Run development server

```shell
npm run build
php artisan serve
```

## LICENSE

The MM package is a software licensed under the [Apache 2.0 license](https://www.apache.org/licenses/LICENSE-2.0).

0 comments on commit ecd0b7f

Please sign in to comment.