Skip to content

Commit

Permalink
Add support for php-forge/foxy manager package.
Browse files Browse the repository at this point in the history
  • Loading branch information
terabytesoftw committed Jan 21, 2024
1 parent 463d141 commit 9cdbd98
Show file tree
Hide file tree
Showing 22 changed files with 85 additions and 86 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@

## Installation

This package requires [npm](https://www.npmjs.com/) for [php-forge/foxy](https://www.github.com/php-forge/foxy), which
manages the installation of npm packages and resource compilation.

The preferred way to install this extension is through [composer](https://getcomposer.org/download/).

Either run
Expand Down Expand Up @@ -82,6 +85,11 @@ root

[Check the documentation testing](/docs/testing.md) to learn about testing.

## Support versions

[![PHP81](https://img.shields.io/badge/PHP-%3E%3D8.1-787CB5)](https://www.php.net/releases/8.1/en.php)
[![Yii30](https://img.shields.io/badge/Yii%20version-3.0-blue)](https://yiiframework.com)

## License

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
Expand Down
23 changes: 3 additions & 20 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
"license": "mit",
"require": {
"php": "^8.1",
"npm-asset/fortawesome--fontawesome-free": "^6.5",
"oomphinc/composer-installers-extender": "^2.0",
"php-forge/foxy":"^0.1",
"yiisoft/assets": "^4.0",
"yiisoft/files": "^2.0"
},
Expand All @@ -22,7 +21,7 @@
"phpunit/phpunit": "^10.5",
"roave/infection-static-analysis-plugin": "^1.34",
"symplify/easy-coding-standard": "^12.1",
"vimeo/psalm": "^5.19",
"vimeo/psalm": "^5.20",
"yiisoft/aliases":"^3.0"
},
"autoload": {
Expand All @@ -36,7 +35,7 @@
"allow-plugins": {
"infection/extension-installer": true,
"composer/installers": true,
"oomphinc/composer-installers-extender": true
"php-forge/foxy": true
}
},
"extra": {
Expand All @@ -45,24 +44,8 @@
},
"config-plugin": {
"params": "yiisoft-aliases.php"
},
"installer-types": [
"bower-asset",
"npm-asset"
],
"installer-paths": {
"./node_modules/{$name}": [
"type:bower-asset",
"type:npm-asset"
]
}
},
"repositories": [
{
"type": "composer",
"url": "https://asset-packagist.org"
}
],
"scripts": {
"check-dependencies": "composer-require-checker",
"easy-coding-standard": "ecs check",
Expand Down
2 changes: 1 addition & 1 deletion config/yiisoft-aliases.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
return [
'yiisoft/aliases' => [
'aliases' => [
'@fontawesome-free' => '@npm/fortawesome--fontawesome-free',
'@fontawesome-free' => '@npm/@fortawesome/fontawesome-free',
],
],
];
52 changes: 23 additions & 29 deletions ecs.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,41 +7,35 @@
use PhpCsFixer\Fixer\ClassNotation\OrderedTraitsFixer;
use PhpCsFixer\Fixer\Import\NoUnusedImportsFixer;
use Symplify\EasyCodingStandard\Config\ECSConfig;
use Symplify\EasyCodingStandard\ValueObject\Set\SetList;

return function (ECSConfig $ecsConfig): void {
$ecsConfig->paths(
return ECSConfig::configure()
->withConfiguredRule(
ClassDefinitionFixer::class,
[
'space_before_parenthesis' => true,
],
)
->withFileExtensions(['php'])
->withPaths(
[
__DIR__ . '/src',
__DIR__ . '/tests',
]
);

// this way you add a single rule
$ecsConfig->rules(
],
)
->withPhpCsFixerSets(perCS20: true)
->withPreparedSets(
arrays: true,
cleanCode: true,
comments:true,
docblocks: true,
namespaces: true,
psr12: true,
strict: true
)
->withRules(
[
NoUnusedImportsFixer::class,
OrderedClassElementsFixer::class,
OrderedTraitsFixer::class,
NoUnusedImportsFixer::class,
]
);

// this way you can add sets - group of rules
$ecsConfig->sets(
[
// run and fix, one by one
SetList::DOCBLOCK,
SetList::NAMESPACES,
SetList::COMMENTS,
SetList::PSR_12,
]
);

// this way configures a rule
$ecsConfig->ruleWithConfiguration(
ClassDefinitionFixer::class,
[
'space_before_parenthesis' => true,
],
);
};
14 changes: 14 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "yii3-asset-fontawesome-free",
"version": "0.1.0",
"description": "The free and open source icon set from FortAwesome (fontawesome.com)",
"keywords": [
"yii3",
"fontawesome"
],
"author": "Wilmer Arambula <terabytesoftw@gmail.com>",
"license": "MIT",
"dependencies": {
"@fortawesome/fontawesome-free": "^6.5.0"
}
}
4 changes: 2 additions & 2 deletions tests/Css/FontAwesomeBrandCdnTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

use Yii\Asset\Css\Depend\DependCdn;
use Yii\Asset\Css\FontAwesomeBrandCdn;
use Yii\Asset\Tests\Support\TestTrait;
use Yii\Asset\Tests\Support\TestSupport;
use Yiisoft\Assets\AssetBundle;

final class FontAwesomeBrandCdnTest extends \PHPUnit\Framework\TestCase
{
use TestTrait;
use TestSupport;

public function testRegister(): void
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Css/FontAwesomeBrandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@

use PHPUnit\Framework\Attributes\RequiresPhp;
use Yii\Asset\Css\FontAwesomeBrand;
use Yii\Asset\Tests\Support\TestTrait;
use Yii\Asset\Tests\Support\TestSupport;
use Yiisoft\Assets\AssetBundle;

use function runkit_constant_redefine;

final class FontAwesomeBrandTest extends \PHPUnit\Framework\TestCase
{
use TestTrait;
use TestSupport;

public function testRegister(): void
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Css/FontAwesomeCdnTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
namespace Yii\Asset\Tests\Css;

use Yii\Asset\Css\FontAwesomeCdn;
use Yii\Asset\Tests\Support\TestTrait;
use Yii\Asset\Tests\Support\TestSupport;
use Yiisoft\Assets\AssetBundle;

final class FontAwesomeCdnTest extends \PHPUnit\Framework\TestCase
{
use TestTrait;
use TestSupport;

public function testRegister(): void
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Css/FontAwesomeRegularCdnTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

use Yii\Asset\Css\Depend\DependCdn;
use Yii\Asset\Css\FontAwesomeRegularCdn;
use Yii\Asset\Tests\Support\TestTrait;
use Yii\Asset\Tests\Support\TestSupport;
use Yiisoft\Assets\AssetBundle;

final class FontAwesomeRegularCdnTest extends \PHPUnit\Framework\TestCase
{
use TestTrait;
use TestSupport;

public function testRegister(): void
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Css/FontAwesomeRegularTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@

use PHPUnit\Framework\Attributes\RequiresPhp;
use Yii\Asset\Css\FontAwesomeRegular;
use Yii\Asset\Tests\Support\TestTrait;
use Yii\Asset\Tests\Support\TestSupport;
use Yiisoft\Assets\AssetBundle;

use function runkit_constant_redefine;

final class FontAwesomeRegularTest extends \PHPUnit\Framework\TestCase
{
use TestTrait;
use TestSupport;

public function testRegister(): void
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Css/FontAwesomeSolidCdnTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

use Yii\Asset\Css\Depend\DependCdn;
use Yii\Asset\Css\FontAwesomeSolidCdn;
use Yii\Asset\Tests\Support\TestTrait;
use Yii\Asset\Tests\Support\TestSupport;
use Yiisoft\Assets\AssetBundle;

final class FontAwesomeSolidCdnTest extends \PHPUnit\Framework\TestCase
{
use TestTrait;
use TestSupport;

public function testRegister(): void
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Css/FontAwesomeSolidTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@

use PHPUnit\Framework\Attributes\RequiresPhp;
use Yii\Asset\Css\FontAwesomeSolid;
use Yii\Asset\Tests\Support\TestTrait;
use Yii\Asset\Tests\Support\TestSupport;
use Yiisoft\Assets\AssetBundle;

use function runkit_constant_redefine;

final class FontAwesomeSolidTest extends \PHPUnit\Framework\TestCase
{
use TestTrait;
use TestSupport;

public function testRegister(): void
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Css/FontAwesomeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@

use PHPUnit\Framework\Attributes\RequiresPhp;
use Yii\Asset\Css\FontAwesome;
use Yii\Asset\Tests\Support\TestTrait;
use Yii\Asset\Tests\Support\TestSupport;
use Yiisoft\Assets\AssetBundle;

use function runkit_constant_redefine;

final class FontAwesomeTest extends \PHPUnit\Framework\TestCase
{
use TestTrait;
use TestSupport;

public function testRegister(): void
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Js/FontAwesomeBrandCdnTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

use Yii\Asset\Js\Depend\DependCdn;
use Yii\Asset\Js\FontAwesomeBrandCdn;
use Yii\Asset\Tests\Support\TestTrait;
use Yii\Asset\Tests\Support\TestSupport;
use Yiisoft\Assets\AssetBundle;

final class FontAwesomeBrandCdnTest extends \PHPUnit\Framework\TestCase
{
use TestTrait;
use TestSupport;

public function testRegister(): void
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Js/FontAwesomeBrandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@

use PHPUnit\Framework\Attributes\RequiresPhp;
use Yii\Asset\Js\FontAwesomeBrand;
use Yii\Asset\Tests\Support\TestTrait;
use Yii\Asset\Tests\Support\TestSupport;
use Yiisoft\Assets\AssetBundle;

use function runkit_constant_redefine;

final class FontAwesomeBrandTest extends \PHPUnit\Framework\TestCase
{
use TestTrait;
use TestSupport;

public function testRegister(): void
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Js/FontAwesomeCdnTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
namespace Yii\Asset\Tests\Js;

use Yii\Asset\Js\FontAwesomeCdn;
use Yii\Asset\Tests\Support\TestTrait;
use Yii\Asset\Tests\Support\TestSupport;
use Yiisoft\Assets\AssetBundle;

final class FontAwesomeCdnTest extends \PHPUnit\Framework\TestCase
{
use TestTrait;
use TestSupport;

public function testRegister(): void
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Js/FontAwesomeRegularCdnTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

use Yii\Asset\Js\Depend\DependCdn;
use Yii\Asset\Js\FontAwesomeRegularCdn;
use Yii\Asset\Tests\Support\TestTrait;
use Yii\Asset\Tests\Support\TestSupport;
use Yiisoft\Assets\AssetBundle;

final class FontAwesomeRegularCdnTest extends \PHPUnit\Framework\TestCase
{
use TestTrait;
use TestSupport;

public function testRegister(): void
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Js/FontAwesomeRegularTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@

use PHPUnit\Framework\Attributes\RequiresPhp;
use Yii\Asset\Js\FontAwesomeRegular;
use Yii\Asset\Tests\Support\TestTrait;
use Yii\Asset\Tests\Support\TestSupport;
use Yiisoft\Assets\AssetBundle;

use function runkit_constant_redefine;

final class FontAwesomeRegularTest extends \PHPUnit\Framework\TestCase
{
use TestTrait;
use TestSupport;

public function testRegister(): void
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Js/FontAwesomeSolidCdnTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

use Yii\Asset\Js\Depend\DependCdn;
use Yii\Asset\Js\FontAwesomeSolidCdn;
use Yii\Asset\Tests\Support\TestTrait;
use Yii\Asset\Tests\Support\TestSupport;
use Yiisoft\Assets\AssetBundle;

final class FontAwesomeSolidCdnTest extends \PHPUnit\Framework\TestCase
{
use TestTrait;
use TestSupport;

public function testRegister(): void
{
Expand Down

0 comments on commit 9cdbd98

Please sign in to comment.