Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
swapnilsarwe committed Jun 1, 2024
0 parents commit 93fa6dd
Show file tree
Hide file tree
Showing 269 changed files with 914 additions and 0 deletions.
1 change: 1 addition & 0 deletions .commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0aa64f6ce8b892a83aeeafa42c74fb9c1f22ec84
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
REPOSITORY=stephenhutchings/Humbleicons.font
BRANCH=master
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
/bin export-ignore
/dist export-ignore
/tests export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.php_cs.dist export-ignore
CHANGELOG.md export-ignore
phpunit.xml.dist export-ignore
README.md export-ignore
UPGRADE.md export-ignore
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: swapnilsarwe
82 changes: 82 additions & 0 deletions .github/workflows/auto-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Auto Update Icons

on:
schedule:
- cron: '0 12 * * 1'

jobs:
generate:
runs-on: ubuntu-latest

strategy:
fail-fast: true
matrix:
php: [8.2]
laravel: [^8.2]

name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }}

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}

- name: Read DotEnv File
uses: c-py/action-dotenv-to-setenv@v2
with:
env-file: .env

- name: Checkout dependent repo
uses: actions/checkout@v3
with:
repository: ${{ env.REPOSITORY }}
ref: ${{ env.BRANCH }}
path: ./dist

- id: latest-commit
name: Get the latest commit
run: |
echo 'LATEST_COMMIT<<EOF' >> $GITHUB_ENV
cd ./dist && git log --format="%H" -n 1 >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- id: current-commit
name: Get current commot
uses: juliangruber/read-file-action@v1
with:
path: ./.commit

- name: Add versions to environment
run: |
echo "CURRENT_COMMIT=${{ steps.current-commit.outputs.content }}" >> $GITHUB_ENV
- name: Output versions
run: |
echo "Current commit: ${{ env.CURRENT_COMMIT }}"
echo "Latest commit: ${{ env.LATEST_COMMIT }}"
- name: Install dependencies
run: composer update --no-interaction --no-progress --dev

- name: Compile icons to resources directory
if: env.CURRENT_COMMIT != env.LATEST_COMMIT
run: ./vendor/bin/blade-icons-generate

- name: Update commit hash in ".commit"
if: env.CURRENT_COMMIT != env.LATEST_COMMIT
run: echo ${{ env.LATEST_COMMIT }}>./.commit

- name: Create PR for latest version
if: env.CURRENT_COMMIT != env.LATEST_COMMIT
uses: peter-evans/create-pull-request@v3
with:
commit-message: "auto-update: update icons with the latest commit ${{ env.LATEST_COMMIT }}"
committer: GitHub Action <[email protected]>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
title: "chore: update icons with the latest commit v${{ env.LATEST_COMMIT }}"
body: |
This updates from [${{ env.CURRENT_COMMIT }}](https://github.com/${{ env.REPOSITORY }}/commit/${{ env.CURRENT_COMMIT }}) to [${{ env.LATEST_COMMIT }}](https://github.com/${{ env.REPOSITORY }}/commit/${{ env.LATEST_COMMIT }}).
Check out the differences: [`${{ env.CURRENT_COMMIT }}` ... `${{ env.LATEST_COMMIT }}`](https://github.com/${{ env.REPOSITORY }}/compare/${{ env.CURRENT_COMMIT }}...${{ env.LATEST_COMMIT }})
branch: feature/update-${{ env.LATEST_COMMIT }}

40 changes: 40 additions & 0 deletions .github/workflows/php-cs-fixer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Check & fix styling

on: [push]

jobs:
php-cs-fixer:
runs-on: ubuntu-latest

strategy:
fail-fast: true
matrix:
php: [8.1]
laravel: [^10.0]

name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }}

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}

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

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

- name: Run PHP CS Fixer
run: vendor/bin/php-cs-fixer fix

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Fix styling

55 changes: 55 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Tests

on:
pull_request:

jobs:
tests:
runs-on: ubuntu-latest

strategy:
fail-fast: true
matrix:
php: [7.4, '8.0', 8.1, 8.2, 8.3]
laravel: [8, 9, 10, 11]
exclude:
- php: 7.4
laravel: 9
- php: 7.4
laravel: 10
- php: 7.4
laravel: 11
- php: '8.0'
laravel: 10
- php: '8.0'
laravel: 11
- php: 8.1
laravel: 11
- php: 8.2
laravel: 8
- php: 8.3
laravel: 8
- php: 8.3
laravel: 9

name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }}


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

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

- name: Install dependencies
run: |
composer require "illuminate/contracts=^${{ matrix.laravel }}" --prefer-dist --no-interaction --no-update
composer update --prefer-dist --no-interaction --no-progress
- name: Execute tests
run: vendor/bin/phpunit
28 changes: 28 additions & 0 deletions .github/workflows/update-changelog.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: "Update Changelog"

on:
release:
types: [released]

jobs:
update:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: main

- name: Update Changelog
uses: stefanzweifel/changelog-updater-action@v1
with:
latest-version: ${{ github.event.release.name }}
release-notes: ${{ github.event.release.body }}

- name: Commit updated CHANGELOG
uses: stefanzweifel/git-auto-commit-action@v4
with:
branch: main
commit_message: Update CHANGELOG
file_pattern: CHANGELOG.md
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dist/
composer.lock
phpunit.xml
vendor
.php-cs-fixer.cache
.phpunit.result.cache
13 changes: 13 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

use PhpCsFixer\Finder;

$finder = Finder::create()
->notPath('vendor')
->in(getcwd(). '/src')
->name('*.php')
->ignoreDotFiles(true)
->ignoreVCS(true);

return Codeat3\styles($finder);

4 changes: 4 additions & 0 deletions .styleci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
preset: laravel
enabled:
- heredoc_indentation
- trailing_comma_in_multiline_call
Empty file added CHANGELOG.md
Empty file.
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) Swapnil Sarwe

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.
92 changes: 92 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
<p align="center">
<img src="./socialcard-blade-humbleicons.png" width="1280" title="Social Card Blade Humbleicons">
</p>

# Blade Humbleicons

<a href="https://github.com/codeat3/blade-humbleicons/actions?query=workflow%3ATests">
<img src="https://github.com/codeat3/blade-humbleicons/workflows/Tests/badge.svg" alt="Tests">
</a>
<a href="https://packagist.org/packages/codeat3/blade-humbleicons">
<img src="https://img.shields.io/packagist/v/codeat3/blade-humbleicons" alt="Latest Stable Version">
</a>
<a href="https://packagist.org/packages/codeat3/blade-humbleicons">
<img src="https://img.shields.io/packagist/dt/codeat3/blade-humbleicons" alt="Total Downloads">
</a>

A package to easily make use of [Humbleicons](https://github.com/zraly/humbleicons) in your Laravel Blade views.

For a full list of available icons see [the SVG directory](resources/svg) or preview them at [humbleicons.com](https://humbleicons.com/).

## Requirements

- PHP 7.4 or higher
- Laravel 8.0 or higher

## Installation

```bash
composer require codeat3/blade-humbleicons
```

## Updating

Please refer to [`the upgrade guide`](UPGRADE.md) when updating the library.

## Blade Icons

Blade Humbleicons uses Blade Icons under the hood. Please refer to [the Blade Icons readme](https://github.com/blade-ui-kit/blade-icons) for additional functionality. We also recommend to [enable icon caching](https://github.com/blade-ui-kit/blade-icons#caching) with this library.

## Configuration

Blade Humbleicons also offers the ability to use features from Blade Icons like default classes, default attributes, etc. If you'd like to configure these, publish the `blade-humbleicons.php` config file:

```bash
php artisan vendor:publish --tag=blade-humbleicons-config
```

## Usage

Icons can be used as self-closing Blade components which will be compiled to SVG icons:

```blade
<x-humble-aid/>
```

You can also pass classes to your icon components:

```blade
<x-humble-aid class="w-6 h-6 text-gray-500"/>
```

And even use inline styles:

```blade
<x-humble-aid style="color: #555"/>
```

### Raw SVG Icons

If you want to use the raw SVG icons as assets, you can publish them using:

```bash
php artisan vendor:publish --tag=blade-humbleicons --force
```

Then use them in your views like:

```blade
<img src="{{ asset('vendor/blade-humbleicons/aid.svg') }}" width="10" height="10"/>
```

## Changelog

Check out the [CHANGELOG](CHANGELOG.md) in this repository for all the recent changes.

## Maintainers

Blade Humbleicons is developed and maintained by [Swapnil Sarwe](https://swapnilsarwe.com).

## License

Blade Humbleicons is open-sourced software licensed under [the MIT license](LICENSE.md).
23 changes: 23 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Upgrade Guide

General steps for every update:

- Run `php artisan view:clear`

## Upgrading from Blade Icons

If you're upgrading from the original Blade Icons package there's very little steps you would need to take. The syntax for the Blade components has remained the same.

### Raw Icons

If you were using the raw exported icons you'll need to re-publish them with:

```bash
php artisan vendor:publish --tag=blade-humbleicons --force
```

The new way to reference them is:

```blade
<img src="{{ asset('vendor/blade-humbleicons/aid.svg') }}" width="10" height="10"/>
```
Loading

0 comments on commit 93fa6dd

Please sign in to comment.