Skip to content

Commit

Permalink
build(core): initial
Browse files Browse the repository at this point in the history
  • Loading branch information
hsbmaulana committed Dec 1, 2022
0 parents commit f90b6e4
Show file tree
Hide file tree
Showing 54 changed files with 1,656 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Laravel.php Foundation

on: push

jobs:
cd:
runs-on: ubuntu-latest
steps:
- name: cd
uses: tripteki/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
repotoken: ${{ secrets.REPOSITORY_TOKEN }}
repouser: tripteki
repository: https://packagist.org
language: php
artifact: composer.json
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 Trip Teknologi

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<h1 align="center">Foundation</h1>

Foundation is a core for Trip Teknologi's Laravel.php Codebase.

Getting Started
---

Installation :

```
$ composer require tripteki/laravelphp-foundation
```

How to use :

- Publish config file in the root of your project's directory with running :

```
php artisan vendor:publish --tag=tripteki-laravelphp-foundation
```

- Put this to your `composer.json` file in the root of your project's directory :

```json
"autoload": {

"psr-4": {

"Src\\": "src/"
}
}
```

Author
---

- Trip Teknologi ([@tripteki](https://linkedin.com/company/tripteki))
- Hasby Maulana ([@hsbmaulana](https://linkedin.com/in/hsbmaulana))
49 changes: 49 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"name": "tripteki/laravelphp-foundation",
"version": "1.0.0",
"description": "Trip Teknologi's Laravel.php Foundation",

"readme": "README.md",
"license": "MIT",
"authors": [ { "name": "Trip Teknologi", "email": "[email protected]" } ],
"homepage": "https://github.com/tripteki/laravelphp-foundation",
"support": { "issues": "https://github.com/tripteki/laravelphp-foundation/issues" },

"require": {

"php": "^8.0.2",

"laravel/framework": "^9.41.0",
"nwidart/laravel-modules": "^9.0.6",
"laravel/tinker": "^2.7.3",
"doctrine/dbal": "^3.5.1",
"predis/predis": "^2.0.3"
},

"require-dev": {},

"autoload": {

"psr-4": {

"Tripteki\\Foundation\\": "src/"
}
},

"autoload-dev": {},

"extra": {

"laravel": {

"dont-discover": [],

"providers": [

"Tripteki\\Foundation\\Providers\\FoundationServiceProvider"
],

"aliases": []
}
}
}
188 changes: 188 additions & 0 deletions config/modules.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
<?php

use Nwidart\Modules\Activators\FileActivator;
use Nwidart\Modules\Commands;

return [

"namespace" => "Src",

"paths" => [

"modules" => base_path("src"),

"assets" => public_path("src"),

"migration" => base_path("database/migrations"),

"generator" => [

"config" => [ "path" => "Config", "generate" => true, ],
"command" => [ "path" => "Console", "generate" => true, ],
"migration" => [ "path" => "Database/Migrations", "generate" => true, ],
"seeder" => [ "path" => "Database/Seeders", "generate" => true, ],
"factory" => [ "path" => "Database/Factories", "generate" => true, ],
"model" => [ "path" => "Models", "generate" => true, ],
"routes" => [ "path" => "Routes", "generate" => true, ],
"filter" => [ "path" => "Http/Middleware", "generate" => true, ],
"controller" => [ "path" => "Http/Controllers", "generate" => true, ],
"request" => [ "path" => "Http/Requests", "generate" => true, ],
"response" => [ "path" => "Http/Responses", "generate" => true, ],
"provider" => [ "path" => "Providers", "generate" => true, ],
"lang" => [ "path" => "Lang", "generate" => true, ],
"assets" => [ "path" => "Resources/assets", "generate" => false, ],
"views" => [ "path" => "Resources/views", "generate" => true, ],
"test" => [ "path" => "Tests", "generate" => true, ],
"test-feature" => [ "path" => "Tests", "generate" => false, ],
"repository" => [ "path" => "Repositories", "generate" => true, ],
"event" => [ "path" => "Events", "generate" => true, ],
"listener" => [ "path" => "Listeners", "generate" => true, ],
"policies" => [ "path" => "Policies", "generate" => true, ],
"rules" => [ "path" => "Rules", "generate" => false, ],
"jobs" => [ "path" => "Jobs", "generate" => false, ],
"emails" => [ "path" => "Mails", "generate" => false, ],
"notifications" => [ "path" => "Notifications", "generate" => true, ],
"resource" => [ "path" => "Transformers", "generate" => false, ],
"component-view" => [ "path" => "Resources/views/components", "generate" => false, ],
"component-class" => [ "path" => "View/Components", "generate" => false, ],
],
],

"commands" => [

Commands\CommandMakeCommand::class,
Commands\ComponentClassMakeCommand::class,
Commands\ComponentViewMakeCommand::class,
Commands\ControllerMakeCommand::class,
Commands\DisableCommand::class,
Commands\DumpCommand::class,
Commands\EnableCommand::class,
Commands\EventMakeCommand::class,
Commands\JobMakeCommand::class,
Commands\ListenerMakeCommand::class,
Commands\MailMakeCommand::class,
Commands\MiddlewareMakeCommand::class,
Commands\NotificationMakeCommand::class,
Commands\ProviderMakeCommand::class,
Commands\RouteProviderMakeCommand::class,
Commands\InstallCommand::class,
Commands\ListCommand::class,
Commands\ModuleDeleteCommand::class,
Commands\ModuleMakeCommand::class,
Commands\FactoryMakeCommand::class,
Commands\PolicyMakeCommand::class,
Commands\RequestMakeCommand::class,
Commands\RuleMakeCommand::class,
Commands\MigrateCommand::class,
Commands\MigrateFreshCommand::class,
Commands\MigrateRefreshCommand::class,
Commands\MigrateResetCommand::class,
Commands\MigrateRollbackCommand::class,
Commands\MigrateStatusCommand::class,
Commands\MigrationMakeCommand::class,
Commands\ModelMakeCommand::class,
Commands\PublishCommand::class,
Commands\PublishConfigurationCommand::class,
Commands\PublishMigrationCommand::class,
Commands\PublishTranslationCommand::class,
Commands\SeedCommand::class,
Commands\SeedMakeCommand::class,
Commands\SetupCommand::class,
Commands\UnUseCommand::class,
Commands\UpdateCommand::class,
Commands\UseCommand::class,
Commands\ResourceMakeCommand::class,
Commands\TestMakeCommand::class,
Commands\LaravelModulesV6Migrator::class,
],



"composer" => [

"composer-output" => false,
],

"stubs" => [

"enabled" => false,
"gitkeep" => false,

"path" => base_path("vendor/tripteki/laravelphp-foundation/stubs"),

"files" => [

"composer" => "composer.json",
"package" => "package.json",
"vite" => "vite.config.js",

"scaffold/config" => "Config/config.php",

"routes/api" => "Routes/api.php",
"routes/web" => "Routes/web.php",

"views/index" => "Resources/views/index.blade.php",
"views/master" => "Resources/views/layouts/master.blade.php",
],

"replacements" => [

"composer" => [

"MODULE_NAMESPACE",
"STUDLY_NAME",
],

// "package" => [],

"vite" => [

"LOWER_NAME",
],

"scaffold/config" => [ "STUDLY_NAME", ], "json" => [ "LOWER_NAME", "STUDLY_NAME", "MODULE_NAMESPACE", "PROVIDER_NAMESPACE", ],

"routes/web" => [ "LOWER_NAME", "STUDLY_NAME", ],
"routes/api" => [ "LOWER_NAME", ],

"views/index" => [ "LOWER_NAME", ],
"views/master" => [ "LOWER_NAME", "STUDLY_NAME", ],
],
],

"scan" => [

"enabled" => false,
"paths" => [],
],



"cache" => [

"enabled" => true,
"driver" => "file",
"key" => "modules",
"lifetime" => 60,
],

"register" => [

"translations" => true,
"files" => "register",
],

"activator" => "file",

"activators" => [

"file" => [

"class" => FileActivator::class,
"statuses-file" => base_path("src/modules_statuses.json"),
"cache-key" => "activator.installed",
"cache-lifetime" => 604800,
],
],

];
29 changes: 29 additions & 0 deletions src/Providers/FoundationServiceProvider.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

namespace Tripteki\Foundation\Providers;

use Illuminate\Support\ServiceProvider;

class FoundationServiceProvider extends ServiceProvider
{
/**
* @return void
*/
public function boot()
{
$this->registerPublishers();
}

/**
* @return void
*/
protected function registerPublishers()
{
$this->publishes(
[
__DIR__."/../../config/modules.php" => config_path("modules.php"),
],

"tripteki-laravelphp-foundation");
}
};
Empty file added stubs/assets/css/app.stub
Empty file.
Empty file added stubs/assets/js/app.stub
Empty file.
Empty file added stubs/assets/sass/app.stub
Empty file.
Empty file added stubs/assets/scss/app.stub
Empty file.
Loading

0 comments on commit f90b6e4

Please sign in to comment.