Skip to content

Commit

Permalink
✨ Configure Package
Browse files Browse the repository at this point in the history
  • Loading branch information
darrencoutts118 committed Dec 12, 2023
1 parent d5bff10 commit 6ad192c
Show file tree
Hide file tree
Showing 14 changed files with 44 additions and 126 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
blank_issues_enabled: false
contact_links:
- name: Documentation
url: https://appkit.coutts.io/packages/:package_name/docs
url: https://appkit.coutts.io/packages/ui/docs
about: View the documentation

- name: Community
url: https://appkit.coutts.io/packages/:package_name/community
url: https://appkit.coutts.io/packages/ui/community
about: Ask the community for help
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

All notable changes to `:package_name` will be documented in this file
All notable changes to `ui` will be documented in this file

## 1.0.0 - 201X-XX-XX

Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Very short description of the package

[![Latest Version on Packagist](https://img.shields.io/packagist/v/laravel-appkit/:package_name.svg?style=flat-square)](https://packagist.org/packages/laravel-appkit/:package_name)
[![Build Status](https://img.shields.io/github/workflow/status/laravel-appkit/:package_name/Automated%20Tests?style=flat-square)](https://github.com/laravel-appkit/:package_name/actions?query=workflow%3A%22Automated+Tests%22)
[![Quality Score](https://img.shields.io/github/workflow/status/laravel-appkit/:package_name/Check%20&%20fix%20styling?label=code%20quality&style=flat-square)](https://github.com/laravel-appkit/:package_name/actions?query=workflow%3A%22Check+%26+fix+styling%22)
[![Total Downloads](https://img.shields.io/packagist/dt/laravel-appkit/:package_name.svg?style=flat-square)](https://packagist.org/packages/laravel-appkit/:package_name)
[![Licence](https://img.shields.io/packagist/l/laravel-appkit/:package_name.svg?style=flat-square)](https://packagist.org/packages/laravel-appkit/:package_name)
[![Latest Version on Packagist](https://img.shields.io/packagist/v/laravel-appkit/ui.svg?style=flat-square)](https://packagist.org/packages/laravel-appkit/ui)
[![Build Status](https://img.shields.io/github/workflow/status/laravel-appkit/ui/Automated%20Tests?style=flat-square)](https://github.com/laravel-appkit/ui/actions?query=workflow%3A%22Automated+Tests%22)
[![Quality Score](https://img.shields.io/github/workflow/status/laravel-appkit/ui/Check%20&%20fix%20styling?label=code%20quality&style=flat-square)](https://github.com/laravel-appkit/ui/actions?query=workflow%3A%22Check+%26+fix+styling%22)
[![Total Downloads](https://img.shields.io/packagist/dt/laravel-appkit/ui.svg?style=flat-square)](https://packagist.org/packages/laravel-appkit/ui)
[![Licence](https://img.shields.io/packagist/l/laravel-appkit/ui.svg?style=flat-square)](https://packagist.org/packages/laravel-appkit/ui)

This is where your description should go. Try and limit it to a paragraph or two, and maybe throw in a mention of what PSRs you support to avoid any confusion with users and contributors.

Expand All @@ -13,7 +13,7 @@ This is where your description should go. Try and limit it to a paragraph or two
You can install the package via composer:

```bash
composer require laravel-appkit/:package_name
composer require laravel-appkit/ui
```

## Usage
Expand Down
14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "laravel-appkit/:package_name",
"name": "laravel-appkit/ui",
"description": "",
"keywords": [
"laravel",
"appkit",
":package_name"
"ui"
],
"homepage": "https://github.com/laravel-appkit/:package_name",
"homepage": "https://github.com/laravel-appkit/ui",
"license": "MIT",
"type": "library",
"authors": [
Expand All @@ -27,12 +27,12 @@
},
"autoload": {
"psr-4": {
"AppKit\\:package_name_php\\": "src"
"AppKit\\Ui\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"AppKit\\:package_name_php\\Tests\\": "tests"
"AppKit\\Ui\\Tests\\": "tests"
}
},
"scripts": {
Expand All @@ -42,10 +42,10 @@
"extra": {
"laravel": {
"providers": [
"AppKit\\:package_name_php\\:package_name_phpServiceProvider"
"AppKit\\Ui\\UiServiceProvider"
],
"aliases": {
":package_name_php": "AppKit\\:package_name_php\\Facades\\:package_name_php"
"Ui": "AppKit\\Ui\\Facades\\Ui"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion config/config.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* :package_name configuration
* ui configuration
*/
return [

Expand Down
File renamed without changes.
82 changes: 0 additions & 82 deletions setup.sh

This file was deleted.

8 changes: 4 additions & 4 deletions src/Facades/Package.php → src/Facades/Ui.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php

namespace AppKit\:package_name_php\Facades;
namespace AppKit\Ui\Facades;

use Illuminate\Support\Facades\Facade;

/**
* @see \AppKit\:package_name_php\:package_name_php
* @see \AppKit\Ui\Ui
*/
class :package_name_php extends Facade
class Ui extends Facade
{
/**
* Get the registered name of the component.
Expand All @@ -16,6 +16,6 @@ class :package_name_php extends Facade
*/
protected static function getFacadeAccessor()
{
return ':package_name';
return 'ui';
}
}
4 changes: 2 additions & 2 deletions src/Package.php → src/Ui.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace AppKit\:package_name_php;
namespace AppKit\Ui;

class :package_name_php
class Ui
{
private $app;

Expand Down
24 changes: 12 additions & 12 deletions src/PackageServiceProvider.php → src/UiServiceProvider.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace AppKit\:package_name_php;
namespace AppKit\Ui;

use Illuminate\Support\ServiceProvider;

class :package_name_phpServiceProvider extends ServiceProvider
class UiServiceProvider extends ServiceProvider
{
/**
* Bootstrap the application services.
Expand All @@ -14,29 +14,29 @@ public function boot()
/*
* Optional methods to load your package assets
*/
// $this->loadTranslationsFrom(__DIR__ . '/../resources/lang', ':package_name');
// $this->loadViewsFrom(__DIR__ . '/../resources/views', ':package_name');
// $this->loadTranslationsFrom(__DIR__ . '/../resources/lang', 'ui');
// $this->loadViewsFrom(__DIR__ . '/../resources/views', 'ui');
// $this->loadMigrationsFrom(__DIR__ . '/../database/migrations');
// $this->loadRoutesFrom(__DIR__ . '/../routes/:package_name.php');
// $this->loadRoutesFrom(__DIR__ . '/../routes/ui.php');

if ($this->app->runningInConsole()) {
$this->publishes([
__DIR__ . '/../config/config.php' => config_path(':package_name.php'),
__DIR__ . '/../config/config.php' => config_path('ui.php'),
], 'config');

// Publishing the views.
/*$this->publishes([
__DIR__ . '/../resources/views' => resource_path('views/vendor/:package_name'),
__DIR__ . '/../resources/views' => resource_path('views/vendor/ui'),
], 'views');*/

// Publishing assets.
/*$this->publishes([
__DIR__ . '/../resources/assets' => public_path('vendor/:package_name'),
__DIR__ . '/../resources/assets' => public_path('vendor/ui'),
], 'assets');*/

// Publishing the translation files.
/*$this->publishes([
__DIR__ . '/../resources/lang' => resource_path('lang/vendor/:package_name'),
__DIR__ . '/../resources/lang' => resource_path('lang/vendor/ui'),
], 'lang');*/

// Registering package commands.
Expand All @@ -50,11 +50,11 @@ public function boot()
public function register()
{
// Automatically apply the package configuration
$this->mergeConfigFrom(__DIR__ . '/../config/config.php', ':package_name');
$this->mergeConfigFrom(__DIR__ . '/../config/config.php', 'ui');

// Register the main class to use with the facade
$this->app->singleton(':package_name', function () {
return new :package_name_php();
$this->app->singleton('ui', function () {
return new Ui();
});
}
}
4 changes: 2 additions & 2 deletions tests/ExampleTest.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace AppKit\:package_name_php\Tests;
namespace AppKit\Ui\Tests;

use AppKit\:package_name_php\Tests\Models\Article;
use AppKit\Ui\Tests\Models\Article;

class ExampleTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Models/Article.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace AppKit\:package_name_php\Tests\Models;
namespace AppKit\Ui\Tests\Models;

use Illuminate\Database\Eloquent\Model;

Expand Down
10 changes: 5 additions & 5 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace AppKit\:package_name_php\Tests;
namespace AppKit\Ui\Tests;

use Orchestra\Testbench\TestCase as OrchestraTestCase;
use AppKit\:package_name_php\:package_name_phpServiceProvider;
use AppKit\:package_name_php\Facades\:package_name_php;
use AppKit\Ui\UiServiceProvider;
use AppKit\Ui\Facades\Ui;

class TestCase extends OrchestraTestCase
{
Expand Down Expand Up @@ -33,7 +33,7 @@ protected function setUp(): void
*/
protected function getPackageProviders($app)
{
return [:package_name_phpServiceProvider::class];
return [UiServiceProvider::class];
}

/**
Expand All @@ -45,7 +45,7 @@ protected function getPackageProviders($app)
protected function getPackageAliases($app)
{
return [
':package_name_php' => :package_name_php::class
'Ui' => Ui::class
];
}

Expand Down
2 changes: 1 addition & 1 deletion tests/database/factories/ArticlesFactory.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/** @var \Illuminate\Database\Eloquent\Factory $factory */
use AppKit\:package_name_php\Tests\Models\Article;
use AppKit\Ui\Tests\Models\Article;
use Faker\Generator as Faker;

/*
Expand Down

0 comments on commit 6ad192c

Please sign in to comment.