Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
kevindierkx committed Jul 9, 2024
0 parents commit b46f804
Show file tree
Hide file tree
Showing 8 changed files with 169 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
* text=auto

/.github export-ignore
/tests export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.php-cs-fixer.dist.php export-ignore
49 changes: 49 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: CI-CD

on: [push, pull_request]

jobs:
php-test:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
php: [8.0, 8.1]
stability: [prefer-stable]
experimental: [false]

continue-on-error: ${{ matrix.experimental }}

name: PHP ${{ matrix.php }} (${{ matrix.stability }})

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

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

- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache Composer Dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Composer Install
run: |
composer validate
composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress
- name: PHPCS
run: composer phpcs
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/.idea
/.vscode
/coverage
/phpunit.xml
/vendor
.DS_Store
.php-cs-fixer.cache
.phpunit.result.cache
clover.xml
composer.lock
composer.phar
Thumbs.db
8 changes: 8 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

$finder = (new PhpCsFixer\Finder())
->in(__DIR__.'/src')
// ->in(__DIR__.'/tests/src')
->ignoreVCSIgnored(true);

return (new \DistortedFusion\PhpCsFixerConfig\Config())->setFinder($finder);
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Blade Colors

CSS variable color management.
44 changes: 44 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"name": "distortedfusion/blade-colors",
"description": "CSS variable color management.",
"license": "MIT",
"keywords": ["laravel", "tailwind", "colors", "distortedfusion"],
"authors": [
{
"name": "Kevin Dierkx",
"email": "[email protected]"
}
],
"require": {
"php": "^8.0",
"illuminate/support": "^7.0|^8.0|^9.0|^10.0|^11.0"
},
"require-dev": {
"distortedfusion/php-cs-fixer-config": "^2.1"
},
"autoload": {
"psr-4": {
"DistortedFusion\\BladeForms\\": "src/"
}
},
"scripts": {
"phpcs-fix" : "php-cs-fixer fix --using-cache=no --allow-risky=yes --ansi",
"phpcs": "php-cs-fixer fix -v --diff --dry-run --allow-risky=yes --ansi",
"test": [
"@phpcs"
]
},
"scripts-descriptions": {
"phpcs": "Runs coding style test suite",
"test": "Runs all tests"
},
"extra": {
"laravel": {
"providers": [
"DistortedFusion\\BladeColors\\BladeColorsServiceProvider"
]
}
},
"minimum-stability": "dev",
"prefer-stable": true
}
Empty file added resources/.gitkeep
Empty file.
46 changes: 46 additions & 0 deletions src/BladeColorsServiceProvider.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php

namespace DistortedFusion\BladeForms;

use Illuminate\Support\ServiceProvider;
use Illuminate\View\Compilers\BladeCompiler;

class BladeFormsServiceProvider extends ServiceProvider
{
/**
* Register the service provider.
*
* @return void
*/
public function register(): void
{
if (! defined('DF_BC_PATH')) {
define('DF_BC_PATH', realpath(__DIR__.'/../'));
}
}

/**
* Boot the service provider.
*
* @return void
*/
public function boot(): void
{
$this->offerPublishing();
$this->registerResources();
}

private function offerPublishing(): void
{
if ($this->app->runningInConsole()) {
$this->publishes([
DF_BC_PATH.'/resources/views' => resource_path('views/vendor/blade-colors'),
], 'blade-colors-views');
}
}

private function registerResources(): void
{
$this->loadViewsFrom(DF_BC_PATH.'/resources/views', 'blade-colors');
}
}

0 comments on commit b46f804

Please sign in to comment.