Skip to content

Commit 8f41666

Browse files
authored
Initial release of package (#1)
* configure package * Initial setup to find icons and cache results * Ignore cache directory * Change workflows * Update workflow to install npm dependencies * Test workflow * Icons being found, cached, and tests passing * Pint format code * Clean up and get tests fixed * Blade directive to publish out config * Fix styling * Collection routes * Refactor to increase test coverage * Clean up and fix domain * Install command and cache refactor * Refactor to cache icon info separate from the icon data to lower repeated caches * Format code * Clean up * Tests passing * Unset data right away * Test expanding testing matrix * Only do version 11 and 12 * Update dependencies * Revert to only testing Laravel 11 * Remove declaring carbon version * Okay okay, bring back carbon version * Update dependencies * Clean up and correct types * Documentation and ability to turn off API * Add contributing docs * Update README.md * Clean up email --------- Co-authored-by: abetwothree <[email protected]>
1 parent 108480e commit 8f41666

File tree

77 files changed

+1789
-577
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+1789
-577
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
github: :vendor_name
1+
github: Abraham Arango

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
blank_issues_enabled: false
22
contact_links:
33
- name: Ask a question
4-
url: https://github.com/:vendor_slug/:package_name/discussions/new?category=q-a
4+
url: https://github.com/abetwothree/laravel-iconify-api/discussions/new?category=q-a
55
about: Ask the community for help
66
- name: Request a feature
7-
url: https://github.com/:vendor_slug/:package_name/discussions/new?category=ideas
7+
url: https://github.com/abetwothree/laravel-iconify-api/discussions/new?category=ideas
88
about: Share ideas for new features
99
- name: Report a security issue
10-
url: https://github.com/:vendor_slug/:package_name/security/policy
10+
url: https://github.com/abetwothree/laravel-iconify-api/security/policy
1111
about: Learn how to notify us for sensitive bugs

.github/workflows/run-tests.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,13 @@ jobs:
1717
fail-fast: true
1818
matrix:
1919
os: [ubuntu-latest, windows-latest]
20-
php: [8.4, 8.3]
21-
laravel: [11.*, 10.*]
20+
php: [8.4]
21+
laravel: [11.*]
2222
stability: [prefer-lowest, prefer-stable]
2323
include:
2424
- laravel: 11.*
2525
testbench: 9.*
2626
carbon: ^2.63
27-
- laravel: 10.*
28-
testbench: 8.*
29-
carbon: ^2.63
3027

3128
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
3229

@@ -54,5 +51,9 @@ jobs:
5451
- name: List Installed Dependencies
5552
run: composer show -D
5653

54+
- name: Install workflow npm dependencies
55+
run: |
56+
npm ci
57+
5758
- name: Execute tests
5859
run: vendor/bin/pest --ci

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ composer.lock
44

55
# Frontend Assets
66
/node_modules
7+
/workbench/node_modules
78

89
# Logs
910
npm-debug.log
@@ -13,6 +14,7 @@ yarn-error.log
1314
.phpunit.cache
1415
.phpunit.result.cache
1516
/build
17+
.DS_Store
1618

1719
# IDE Helper
1820
_ide_helper.php
@@ -30,3 +32,4 @@ phpstan.neon
3032
testbench.yaml
3133
/docs
3234
/coverage
35+
coverage.xml

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Changelog
22

3-
All notable changes to `:package_name` will be documented in this file.
3+
All notable changes to `laravel-iconify-api` will be documented in this file.

CONTRIBUTING.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Contributing
2+
3+
Contributions are welcomed in the for of a Pull Request.
4+
5+
In order for your contributions to be considered, please make sure the following steps are taken:
6+
7+
* Pipeline checks must pass
8+
* Code quality must not be degraded
9+
* Features must not be broken or removed
10+
* New features must be tested
11+
* Documentation must be updated where necessary

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) :vendor_name <[email protected]>
3+
Copyright (c) Abraham Arango
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 26 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,51 @@
1-
# :package_description
1+
# Laravel Iconify API
22

3-
[![Latest Version on Packagist](https://img.shields.io/packagist/v/:vendor_slug/:package_slug.svg?style=flat-square)](https://packagist.org/packages/:vendor_slug/:package_slug)
4-
[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/:vendor_slug/:package_slug/run-tests.yml?branch=main&label=tests&style=flat-square)](https://github.com/:vendor_slug/:package_slug/actions?query=workflow%3Arun-tests+branch%3Amain)
5-
[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/:vendor_slug/:package_slug/fix-php-code-style-issues.yml?branch=main&label=code%20style&style=flat-square)](https://github.com/:vendor_slug/:package_slug/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain)
6-
[![Total Downloads](https://img.shields.io/packagist/dt/:vendor_slug/:package_slug.svg?style=flat-square)](https://packagist.org/packages/:vendor_slug/:package_slug)
7-
<!--delete-->
8-
---
9-
This repo can be used to scaffold a Laravel package. Follow these steps to get started:
3+
[![Latest Version on Packagist](https://img.shields.io/packagist/v/abetwothree/laravel-iconify-api.svg?style=flat-square)](https://packagist.org/packages/abetwothree/laravel-iconify-api)
4+
[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/abetwothree/laravel-iconify-api/run-tests.yml?branch=main&label=tests&style=flat-square)](https://github.com/abetwothree/laravel-iconify-api/actions?query=workflow%3Arun-tests+branch%3Amain)
5+
[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/abetwothree/laravel-iconify-api/fix-php-code-style-issues.yml?branch=main&label=code%20style&style=flat-square)](https://github.com/abetwothree/laravel-iconify-api/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain)
6+
[![Total Downloads](https://img.shields.io/packagist/dt/abetwothree/laravel-iconify-api.svg?style=flat-square)](https://packagist.org/packages/abetwothree/laravel-iconify-api)
107

11-
1. Press the "Use this template" button at the top of this repo to create a new repo with the contents of this skeleton.
12-
2. Run "php ./configure.php" to run a script that will replace all placeholders throughout all the files.
13-
3. Have fun creating your package.
14-
4. If you need help creating a package, consider picking up our <a href="https://laravelpackage.training">Laravel Package Training</a> video course.
15-
---
16-
<!--/delete-->
17-
This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.
8+
This is a Laravel package for the [Iconify](https://iconify.design/index.html) icons [on demand API](https://iconify.design/docs/icon-components/). It allows you to easily use on demand icons and use your Laravel applicatioin as the Iconify API.
189

19-
## Support us
10+
It works similarly to the [Node Iconify API](https://github.com/iconify/api) and is a spiritual successor to their [PHP implementation](https://github.com/iconify/api.php).
2011

21-
[<img src="https://github-ads.s3.eu-central-1.amazonaws.com/:package_name.jpg?t=1" width="419px" />](https://spatie.be/github-ad-click/:package_name)
12+
On demand icons work great whether you use Livewire, Inertia, or just plain Blade views to render your Laravel application and want to render icons dynamically using a single component.
2213

23-
We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).
14+
## How To Use
2415

25-
We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards).
26-
27-
## Installation
28-
29-
You can install the package via composer:
16+
Install the package via composer:
3017

3118
```bash
32-
composer require :vendor_slug/:package_slug
19+
composer require abetwothree/laravel-iconify-api
3320
```
3421

35-
You can publish and run the migrations with:
22+
In your core application blade layout file add the following directive in the head section before your application's JS bundle:
3623

37-
```bash
38-
php artisan vendor:publish --tag=":package_slug-migrations"
39-
php artisan migrate
24+
```html
25+
@iconify
4026
```
4127

42-
You can publish the config file with:
28+
This will configure the [Iconify API](https://iconify.design/docs/api/providers.html#api-config) on demand icons to load the icons from your Laravel application instead of the Iconify API.
4329

44-
```bash
45-
php artisan vendor:publish --tag=":package_slug-config"
46-
```
30+
### How To Display Icons
4731

48-
This is the contents of the published config file:
32+
To displays icons follow the instructions on the [Iconify](https://iconify.design/docs/icon-components/) on demand docs and use any of their component libraries in your Laravel Application.
4933

50-
```php
51-
return [
52-
];
53-
```
34+
You also need icon set data to be available in your application. You'll need to install the icon set data using NPM. See more [info here](https://iconify.design/docs/icons/icon-data.html#sources).
5435

55-
Optionally, you can publish the views using
36+
We recommend installing individual icon sets instead of the entire Iconify JSON set to keep your application lightweight. However, you can install the entire set if you wish and this package will work with either approach.
5637

57-
```bash
58-
php artisan vendor:publish --tag=":package_slug-views"
59-
```
38+
## Advanced Configuration
6039

61-
## Usage
40+
To configure the package, you can publish the config file using the following command:
6241

63-
```php
64-
$variable = new VendorName\Skeleton();
65-
echo $variable->echoPhrase('Hello, VendorName!');
42+
```bash
43+
php artisan vendor:publish --tag="iconify-api-config"
6644
```
6745

68-
## Testing
46+
This will publish a `iconify-api.php` file in your `config` directory. You can then configure the package to your liking.
6947

70-
```bash
71-
composer test
72-
```
48+
For advanced setting details, please see the [config file](config/iconify-api.php).
7349

7450
## Changelog
7551

@@ -85,7 +61,7 @@ Please review [our security policy](../../security/policy) on how to report secu
8561

8662
## Credits
8763

88-
- [:author_name](https://github.com/:author_username)
64+
- [Abraham Arango](https://github.com/abetwothree)
8965
- [All Contributors](../../contributors)
9066

9167
## License

composer.json

Lines changed: 40 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,75 @@
11
{
2-
"name": ":vendor_slug/:package_slug",
3-
"description": ":package_description",
2+
"name": "abetwothree/laravel-iconify-api",
3+
"description": "A package to create a local API for the dynamic Iconify Icon components",
44
"keywords": [
5-
":vendor_name",
5+
"Abraham Arango",
66
"laravel",
7-
":package_slug"
7+
"laravel-iconify-api"
88
],
9-
"homepage": "https://github.com/:vendor_slug/:package_slug",
9+
"homepage": "https://github.com/abetwothree/laravel-iconify-api",
1010
"license": "MIT",
1111
"authors": [
1212
{
13-
"name": ":author_name",
14-
"email": "[email protected]",
13+
"name": "Abraham Arango",
1514
"role": "Developer"
1615
}
1716
],
1817
"require": {
1918
"php": "^8.4",
2019
"spatie/laravel-package-tools": "^1.16",
21-
"illuminate/contracts": "^10.0||^11.0"
20+
"illuminate/contracts": "^11.0"
2221
},
2322
"require-dev": {
23+
"larastan/larastan": "^3.0",
2424
"laravel/pint": "^1.14",
2525
"nunomaduro/collision": "^8.1.1||^7.10.0",
26-
"larastan/larastan": "^2.9",
2726
"orchestra/testbench": "^9.0.0||^8.22.0",
2827
"pestphp/pest": "^3.0",
2928
"pestphp/pest-plugin-arch": "^3.0",
3029
"pestphp/pest-plugin-laravel": "^3.0",
31-
"phpstan/extension-installer": "^1.3",
32-
"phpstan/phpstan-deprecation-rules": "^1.1",
33-
"phpstan/phpstan-phpunit": "^1.3",
34-
"spatie/laravel-ray": "^1.35"
30+
"phpstan/extension-installer": "^1.4",
31+
"phpstan/phpstan-deprecation-rules": "^2.0",
32+
"phpstan/phpstan-phpunit": "^2.0"
3533
},
3634
"autoload": {
3735
"psr-4": {
38-
"VendorName\\Skeleton\\": "src/",
39-
"VendorName\\Skeleton\\Database\\Factories\\": "database/factories/"
36+
"AbeTwoThree\\LaravelIconifyApi\\": "src/",
37+
"AbeTwoThree\\LaravelIconifyApi\\Database\\Factories\\": "database/factories/"
4038
}
4139
},
4240
"autoload-dev": {
4341
"psr-4": {
44-
"VendorName\\Skeleton\\Tests\\": "tests/",
45-
"Workbench\\App\\": "workbench/app/"
42+
"AbeTwoThree\\LaravelIconifyApi\\Tests\\": "tests/",
43+
"Workbench\\App\\": "workbench/app/",
44+
"Workbench\\Database\\Factories\\": "workbench/database/factories/",
45+
"Workbench\\Database\\Seeders\\": "workbench/database/seeders/"
4646
}
4747
},
4848
"scripts": {
49-
"post-autoload-dump": "@composer run prepare",
49+
"post-autoload-dump": [
50+
"@prepare",
51+
"@composer run prepare"
52+
],
5053
"prepare": "@php vendor/bin/testbench package:discover --ansi",
5154
"analyse": "vendor/bin/phpstan analyse",
5255
"test": "vendor/bin/pest",
53-
"test-coverage": "vendor/bin/pest --coverage",
54-
"format": "vendor/bin/pint"
56+
"testbench": "vendor/bin/testbench",
57+
"test-coverage": "export XDEBUG_MODE=coverage && vendor/bin/pest --coverage",
58+
"test-coverage-html": "export XDEBUG_MODE=coverage && vendor/bin/pest --coverage-html coverage",
59+
"test-coverage-xml": "export XDEBUG_MODE=coverage && vendor/bin/pest --coverage-xml coverage",
60+
"test-coverage-cov": "export XDEBUG_MODE=coverage && vendor/bin/pest --coverage-clover coverage.xml",
61+
"format": "vendor/bin/pint",
62+
"clear": "@php vendor/bin/testbench package:purge-skeleton --ansi",
63+
"build": "@php vendor/bin/testbench workbench:build --ansi",
64+
"serve": [
65+
"Composer\\Config::disableProcessTimeout",
66+
"@build",
67+
"@php vendor/bin/testbench serve --ansi"
68+
],
69+
"lint": [
70+
"@php vendor/bin/pint --ansi",
71+
"@php vendor/bin/phpstan analyse --verbose --ansi"
72+
]
5573
},
5674
"config": {
5775
"sort-packages": true,
@@ -63,10 +81,10 @@
6381
"extra": {
6482
"laravel": {
6583
"providers": [
66-
"VendorName\\Skeleton\\SkeletonServiceProvider"
84+
"AbeTwoThree\\LaravelIconifyApi\\LaravelIconifyApiServiceProvider"
6785
],
6886
"aliases": {
69-
"Skeleton": "VendorName\\Skeleton\\Facades\\Skeleton"
87+
"LaravelIconifyApi": "AbeTwoThree\\LaravelIconifyApi\\Facades\\LaravelIconifyApi"
7088
}
7189
}
7290
},

0 commit comments

Comments
 (0)