Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
swapnilsarwe committed Jun 6, 2024
0 parents commit 7193432
Show file tree
Hide file tree
Showing 22 changed files with 715 additions and 0 deletions.
1 change: 1 addition & 0 deletions .commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ddf6326ec83f8fc92479382ad8dc6d3a99967e1d
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
REPOSITORY=iconify/icon-sets
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
77 changes: 77 additions & 0 deletions .github/workflows/auto-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
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: 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 <noreply@github.com>
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
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Changelog

This changelog follows [the Keep a Changelog standard](https://keepachangelog.com).

## [Unreleased](https://github.com/codeat3/blade-solar-icons/compare/1.0.0...HEAD)

## [1.0.0](https://github.com/codeat3/blade-solar-icons/compare/1.0.0...1.0.0) - 2024-06-06

### What's Changed
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-solar-icons.png" width="1280" title="Social Card Blade Solar Icons">
</p>

# Blade Solar Icons

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

A package to easily make use of [Solar Icons](https://github.com/480-Design/Solar-Icon-Set) in your Laravel Blade views.

For a full list of available icons see [the SVG directory](resources/svg) or check the figma file [figma.com](https://www.figma.com/community/file/1166831539721848736/solar-icons-set).

## Requirements

- PHP 7.4 or higher
- Laravel 8.0 or higher

## Installation

```bash
composer require codeat3/blade-solar-icons
```

## Updating

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

## Blade Icons

Blade Solar Icons 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 Solar Icons 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-solar-icons.php` config file:

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

## Usage

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

```blade
<x-solar-4k-bold/>
```

You can also pass classes to your icon components:

```blade
<x-solar-4k-bold class="w-6 h-6 text-gray-500"/>
```

And even use inline styles:

```blade
<x-solar-4k-bold 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-solar-icons --force
```

Then use them in your views like:

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

## Changelog

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

## Maintainers

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

## License

Blade Solar Icons 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-solar-icons --force
```

The new way to reference them is:

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

0 comments on commit 7193432

Please sign in to comment.