Skip to content

Commit

Permalink
Clean all code. (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
terabytesoftw committed May 19, 2023
1 parent 34da686 commit 691f77d
Show file tree
Hide file tree
Showing 21 changed files with 118,624 additions and 404,392 deletions.
2 changes: 1 addition & 1 deletion .styleci.yml
@@ -1,7 +1,7 @@
preset: psr12
risky: true

version: 8.1
version: 8.2

finder:
exclude:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -25,7 +25,7 @@ composer require yii-tools/tailwind-asset

## Usage

[Check the documentation docs](/docs/install.md) to learn about usage.
[Check the documentation docs](/docs/README.md) to learn about usage.

## Testing

Expand Down
8 changes: 6 additions & 2 deletions changelog.md
@@ -1,2 +1,6 @@
Change Log
==========
Tailwind Asset Change Log
=========================

## 1.0.0 May 19, 2023

- Initial release.
9 changes: 5 additions & 4 deletions composer.json
Expand Up @@ -18,20 +18,21 @@
"yiisoft/files": "^2.0"
},
"require-dev": {
"infection/infection": "^0.27",
"maglnet/composer-require-checker": "^4.3",
"phpunit/phpunit": "^10.0",
"roave/infection-static-analysis-plugin": "^1.29",
"phpunit/phpunit": "^10.1",
"roave/infection-static-analysis-plugin": "^1.31",
"vimeo/psalm": "^5.8",
"yii-tools/support": "^1.0@dev"
},
"autoload": {
"psr-4": {
"Yii\\Tailwind\\Asset\\": "src"
"Yii\\Assets\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"Yii\\Tailwind\\Asset\\Tests\\": "tests"
"Yii\\Assets\\Tests\\": "tests"
}
},
"extra": {
Expand Down
15 changes: 8 additions & 7 deletions docs/install.md → docs/README.md
@@ -1,4 +1,4 @@
## Using assets
# Using assets

Assets are files that are not processed by Webpack. They are copied directly to the output folder. This includes images, fonts, and any other files that you want to use in your project.

Expand All @@ -13,14 +13,14 @@ file: ./resources/views/layout/main.php

declare(strict_types=1);

use Yii\Tailwind\Asset\TailwindDevAsset;
use Yii\Assets\TailwindDev;

/**
* @var \Yiisoft\Assets\AssetManager $assetManager
*/

// Register the asset bundle with a asset manager component.
$assetManager->register(TailwindDevAsset::class);
$assetManager->register(TailwindDev::class);

// Set parameters for the registered asset bundle a view component.
$this->addCssFiles($assetManager->getCssFiles());
Expand All @@ -39,13 +39,13 @@ file: ./config/params.php

declare(strict_types=1);

use Yii\Tailwind\Asset\TailwindCdnAsset;
use Yii\Assets\TailwindCdn;

return [
'yiisoft/assets' => [
'assetManager' => [
'register' => [
TailwindCdnAsset::class,
TailwindCdn::class,
],
],
],
Expand All @@ -54,6 +54,7 @@ return [

## Using npm packages

[npm](https://www.npmjs.com/) packages are installed via [fxpio/foxy](https://github.com/fxpio/foxy) and are available in the `node_modules` directory.
You can install [npm](https://www.npmjs.com/) packages [fxpio/foxy](https://github.com/fxpio/foxy),
and they will be available in the `node_modules` directory.

**Note:** *This package generates all the CSS for [Tailwind CSS](https://tailwindcss.com/) and its plugins. It does not include any JavaScript. If you only need to generate the classes of your project, check the documentation of [Tailwind CSS](https://tailwindcss.com/docs/installation/).*
>Note: *This package generates all the CSS for [Tailwind CSS](https://tailwindcss.com/) and its plugins. It does not include any JavaScript. If you only need to generate the classes of your project, check the documentation of [Tailwind CSS](https://tailwindcss.com/docs/installation/).*
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -2,7 +2,7 @@
"name": "tailwind-asset",
"version": "1.0.0",
"dependencies": {
"tailwindcss": "^3.2.7"
"tailwindcss": "^3.3"
},
"license": "mit"
}
17 changes: 9 additions & 8 deletions phpunit.xml.dist
@@ -1,19 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" colors="true" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd" cacheDirectory=".phpunit.cache">
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" colors="true" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd" cacheDirectory=".phpunit.cache">
<php>
<ini name="error_reporting" value="-1"/>
</php>
<coverage>
<coverage/>
<testsuites>
<testsuite name="Tailwind-Asset">
<directory>./tests</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory>./src</directory>
</include>
<exclude>
<directory>./vendor</directory>
</exclude>
</coverage>
<testsuites>
<testsuite name="Tailwind-Asset">
<directory>./tests</directory>
</testsuite>
</testsuites>
</source>
</phpunit>
4 changes: 2 additions & 2 deletions src/TailwindCdnAsset.php → src/TailwindCdn.php
Expand Up @@ -2,11 +2,11 @@

declare(strict_types=1);

namespace Yii\Tailwind\Asset;
namespace Yii\Assets;

use Yiisoft\Assets\AssetBundle;

final class TailwindCdnAsset extends AssetBundle
final class TailwindCdn extends AssetBundle
{
public bool $cdn = true;
public array $css = ['https://cdn.jsdelivr.net/npm/tailwindcss/dist/tailwind.min.css'];
Expand Down
23 changes: 0 additions & 23 deletions src/TailwindDarkDevAsset.php

This file was deleted.

23 changes: 0 additions & 23 deletions src/TailwindDarkProdAsset.php

This file was deleted.

4 changes: 2 additions & 2 deletions src/TailwindDevAsset.php → src/TailwindDev.php
Expand Up @@ -2,12 +2,12 @@

declare(strict_types=1);

namespace Yii\Tailwind\Asset;
namespace Yii\Assets;

use Yiisoft\Assets\AssetBundle;
use Yiisoft\Files\PathMatcher\PathMatcher;

final class TailwindDevAsset extends AssetBundle
final class TailwindDev extends AssetBundle
{
public string|null $basePath = '@assets';
public string|null $baseUrl = '@assetsUrl';
Expand Down
4 changes: 2 additions & 2 deletions src/TailwindProdAsset.php → src/TailwindProd.php
Expand Up @@ -2,12 +2,12 @@

declare(strict_types=1);

namespace Yii\Tailwind\Asset;
namespace Yii\Assets;

use Yiisoft\Assets\AssetBundle;
use Yiisoft\Files\PathMatcher\PathMatcher;

final class TailwindProdAsset extends AssetBundle
final class TailwindProd extends AssetBundle
{
public string|null $basePath = '@assets';
public string|null $baseUrl = '@assetsUrl';
Expand Down

0 comments on commit 691f77d

Please sign in to comment.