Skip to content

Commit

Permalink
Initial commit. (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
terabytesoftw committed Jul 2, 2023
1 parent 02f43fe commit f124ad7
Show file tree
Hide file tree
Showing 43 changed files with 1,137 additions and 46 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p align="center">
<a href="https://github.com/yii-tools/template" target="_blank">
<a href="https://github.com/yii-tools/filepond-asset" target="_blank">
<img src="https://avatars.githubusercontent.com/u/121752654?s=200&v=4" height="100px">
</a>
<h1 align="center">Template.</h1>
Expand All @@ -22,12 +22,12 @@ For install this package, you need [composer](https://getcomposer.org/).

## CI status

[![build](https://github.com/yii-tools/template/actions/workflows/build.yml/badge.svg)](https://github.com/yii-tools/template/actions/workflows/build.yml)
[![codecov](https://codecov.io/gh/yii-tools/template/branch/main/graph/badge.svg?token=MF0XUGVLYC)](https://codecov.io/gh/yii-tools/template)
[![Mutation testing badge](https://img.shields.io/endpoint?style=flat&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fyii-tools%2Ftemplate%2Fmain)](https://dashboard.stryker-mutator.io/reports/github.com/yii-tools/template/main)
[![static analysis](https://github.com/yii-tools/template/actions/workflows/static.yml/badge.svg)](https://github.com/yii-tools/template/actions/workflows/static.yml)
[![type-coverage](https://shepherd.dev/github/yii-tools/template/coverage.svg)](https://shepherd.dev/github/yii-tools/template)
[![StyleCI](https://github.styleci.io/repos/494495136/shield?branch=main)](https://github.styleci.io/repos/494495136?branch=main)
[![build](https://github.com/yii-tools/filepond-asset/actions/workflows/build.yml/badge.svg)](https://github.com/yii-tools/filepond-asset/actions/workflows/build.yml)
[![codecov](https://codecov.io/gh/yii-tools/filepond-asset/branch/main/graph/badge.svg?token=MF0XUGVLYC)](https://codecov.io/gh/yii-tools/filepond-asset)
[![Mutation testing badge](https://img.shields.io/endpoint?style=flat&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fyii-tools%2Ffilepond-asset%2Fmain)](https://dashboard.stryker-mutator.io/reports/github.com/yii-tools/filepond-asset/main)
[![static analysis](https://github.com/yii-tools/filepond-asset/actions/workflows/static.yml/badge.svg)](https://github.com/yii-tools/filepond-asset/actions/workflows/static.yml)
[![type-coverage](https://shepherd.dev/github/yii-tools/filepond-asset/coverage.svg)](https://shepherd.dev/github/yii-tools/filepond-asset)
[![StyleCI](https://github.styleci.io/repos/661366645/shield?branch=main)](https://github.styleci.io/repos/661366645?branch=main)

## Our social networks

Expand Down
28 changes: 21 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,41 +1,55 @@
{
"name": "yii-tools/template",
"name": "yii-tools/filepond-asset",
"type": "library",
"description": "_____",
"description": "Filepond Asset for YiiFramework v.3.0.",
"keywords": [
"_____"
"yii-tools",
"asset",
"filepond",
"yii3"
],
"license": "mit",
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": "^8.1"
"php": "^8.1",
"foxy/foxy": "^1.3",
"yiisoft/assets": "^4.0",
"yiisoft/files":"^2.0"
},
"require-dev": {
"maglnet/composer-require-checker": "^4.6",
"php-forge/support": "^1.0@dev",
"phpunit/phpunit": "^10.2",
"roave/infection-static-analysis-plugin": "^1.32",
"vimeo/psalm": "^5.1"
},
"autoload": {
"psr-4": {
"Template\\": "src"
"Yii\\Assets\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"Template\\Tests\\": "tests"
"Yii\\Assets\\Tests\\": "tests"
}
},
"extra": {
"branch-alias": {
"dev-main": "1.0.x-dev"
},
"config-plugin-options": {
"source-directory": "config"
},
"config-plugin": {
"params": "common/param/*.php"
}
},
"config": {
"sort-packages": true,
"allow-plugins": {
"infection/extension-installer": true
"infection/extension-installer": true,
"foxy/foxy": true
}
},
"scripts": {
Expand Down
20 changes: 20 additions & 0 deletions config/common/param/yiisoft-aliases.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

declare(strict_types=1);

return [
'yiisoft/aliases' => [
'aliases' => [
'@filepond-asset' => '@npm/filepond/dist',
'@filepond-file-encode-plugin' => '@npm/filepond-plugin-file-encode/dist',
'@filepond-file-rename-plugin' => '@npm/filepond-plugin-file-rename/dist',
'@filepond-file-validate-size-plugin' => '@npm/filepond-plugin-file-validate-size/dist',
'@filepond-file-validate-type-plugin' => '@npm/filepond-plugin-file-validate-type/dist',
'@filepond-file-image-crop-plugin' => '@npm/filepond-plugin-image-crop/dist',
'@filepond-image-exif-orientation-plugin' => '@npm/filepond-plugin-image-exif-orientation/dist',
'@filepond-image-preview-plugin' => '@npm/filepond-plugin-image-preview/dist',
'@filepond-image-transform-plugin' => '@npm/filepond-plugin-image-transform/dist',
'@filepond-pdf-preview-plugin' => '@npm/filepond-plugin-pdf-preview/dist',
],
],
];
17 changes: 17 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "filepond-asset",
"version": "1.0.0",
"dependencies": {
"filepond": "^4.30.4",
"filepond-plugin-file-encode": "^2.1.10",
"filepond-plugin-file-rename": "^1.1.8",
"filepond-plugin-file-validate-size": "^2.2.8",
"filepond-plugin-file-validate-type": "^1.2.8",
"filepond-plugin-image-crop": "^2.0.6",
"filepond-plugin-image-exif-orientation": "^1.0.11",
"filepond-plugin-image-preview": "^4.6.11",
"filepond-plugin-image-transform": "^3.8.7",
"filepond-plugin-pdf-preview": "^1.0.4"
},
"license": "mit"
}
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
stopOnFailure="false"
>
<testsuites>
<testsuite name="Template">
<testsuite name="FilePondAsset">
<directory>tests</directory>
</testsuite>
</testsuites>
Expand Down
13 changes: 0 additions & 13 deletions src/Example.php

This file was deleted.

40 changes: 40 additions & 0 deletions src/FilePond.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php

declare(strict_types=1);

namespace Yii\Assets;

use Yii\Assets\Js\FilePondEncodePlugin;
use Yii\Assets\Js\FilePondImageExifOrientationPlugin;
use Yii\Assets\Js\FilePondValidateSizePlugin;
use Yii\Assets\Js\FilePondValidateTypePlugin;
use Yiisoft\Assets\AssetBundle;
use Yiisoft\Files\PathMatcher\PathMatcher;

/**
* Asset bundle for the filepond widget in development mode, mainly used for publishing assets.
*/
final class FilePond extends AssetBundle
{
public string|null $basePath = '@assets';
public string|null $baseUrl = '@assetsUrl';
public string|null $sourcePath = '@filepond-asset';
public array $css = ['filepond.css'];
public array $js = ['filepond.js'];
public array $depends = [
FilePondEncodePlugin::class,
FilePondValidateSizePlugin::class,
FilePondValidateTypePlugin::class,
FilePondImageExifOrientationPlugin::class,
FilePondImagePreviewPlugin::class,
];

public function __construct()
{
$pathMatcher = new PathMatcher();

$this->publishOptions = [
'filter' => $pathMatcher->only('**/filepond.css', '**/filepond.js'),
];
}
}
28 changes: 28 additions & 0 deletions src/FilePondCdn.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

declare(strict_types=1);

namespace Yii\Assets;

use Yii\Assets\Js\FilePondEncodePluginCdn;
use Yii\Assets\Js\FilePondImageExifOrientationPluginCdn;
use Yii\Assets\Js\FilePondValidateSizePluginCdn;
use Yii\Assets\Js\FilePondValidateTypePluginCdn;
use Yiisoft\Assets\AssetBundle;

/**
* Asset bundle for the filepond widget in content delivery network, mainly used for publishing assets.
*/
final class FilePondCdn extends AssetBundle
{
public bool $cdn = true;
public array $css = ['https://unpkg.com/filepond@^4/dist/filepond.min.css'];
public array $js = ['https://unpkg.com/filepond@^4/dist/filepond.min.js'];
public array $depends = [
FilepondEncodePluginCdn::class,
FilePondValidateSizePluginCdn::class,
FilePondValidateTypePluginCdn::class,
FilePondImageExifOrientationPluginCdn::class,
FilePondImagePreviewPluginCdn::class,
];
}
32 changes: 32 additions & 0 deletions src/FilePondImagePreviewPlugin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

declare(strict_types=1);

namespace Yii\Assets;

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

/**
* Asset bundle for the filepond image preview plugin in development mode, mainly used for publishing assets.
*/
final class FilePondImagePreviewPlugin extends AssetBundle
{
public string|null $basePath = '@assets';
public string|null $baseUrl = '@assetsUrl';
public string|null $sourcePath = '@filepond-image-preview-plugin';
public array $css = ['filepond-plugin-image-preview.css'];
public array $js = ['filepond-plugin-image-preview.js'];

public function __construct()
{
$pathMatcher = new PathMatcher();

$this->publishOptions = [
'filter' => $pathMatcher->only(
'**/filepond-plugin-image-preview.css',
'**/filepond-plugin-image-preview.js',
),
];
}
}
18 changes: 18 additions & 0 deletions src/FilePondImagePreviewPluginCdn.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

declare(strict_types=1);

namespace Yii\Assets;

use Yiisoft\Assets\AssetBundle;

/**
* Asset bundle for the filepond image preview plugin in content delivery network (CDN) mode, mainly used for publishing
* assets.
*/
final class FilePondImagePreviewPluginCdn extends AssetBundle
{
public bool $cdn = true;
public array $css = ['https://unpkg.com/filepond-plugin-image-preview/dist/filepond-plugin-image-preview.min.css'];
public array $js = ['https://unpkg.com/filepond-plugin-image-preview/dist/filepond-plugin-image-preview.min.js'];
}
32 changes: 32 additions & 0 deletions src/FilePondImagePreviewPluginProd.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

declare(strict_types=1);

namespace Yii\Assets;

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

/**
* Asset bundle for the filepond image preview plugin in production mode, mainly used for publishing assets.
*/
final class FilePondImagePreviewPluginProd extends AssetBundle
{
public string|null $basePath = '@assets';
public string|null $baseUrl = '@assetsUrl';
public string|null $sourcePath = '@filepond-image-preview-plugin';
public array $css = ['filepond-plugin-image-preview.min.css'];
public array $js = ['filepond-plugin-image-preview.min.js'];

public function __construct()
{
$pathMatcher = new PathMatcher();

$this->publishOptions = [
'filter' => $pathMatcher->only(
'**/filepond-plugin-image-preview.min.css',
'**/filepond-plugin-image-preview.min.js',
),
];
}
}
29 changes: 29 additions & 0 deletions src/FilePondPdfPreviewPlugin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

declare(strict_types=1);

namespace Yii\Assets;

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

/**
* Asset bundle for the filepond pdf preview plugin in development mode, mainly used for publishing assets.
*/
final class FilePondPdfPreviewPlugin extends AssetBundle
{
public string|null $basePath = '@assets';
public string|null $baseUrl = '@assetsUrl';
public string|null $sourcePath = '@filepond-pdf-preview-plugin';
public array $css = ['filepond-plugin-pdf-preview.css'];
public array $js = ['filepond-plugin-pdf-preview.js'];

public function __construct()
{
$pathMatcher = new PathMatcher();

$this->publishOptions = [
'filter' => $pathMatcher->only('**/filepond-plugin-pdf-preview.css', '**/filepond-plugin-pdf-preview.js'),
];
}
}
18 changes: 18 additions & 0 deletions src/FilePondPdfPreviewPluginCdn.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

declare(strict_types=1);

namespace Yii\Assets;

use Yiisoft\Assets\AssetBundle;

/**
* Asset bundle for the filepond pdf preview plugin in content delivery network (CDN) mode, mainly used for publishing
* assets.
*/
final class FilePondPdfPreviewPluginCdn extends AssetBundle
{
public bool $cdn = true;
public array $css = ['https://unpkg.com/filepond-plugin-pdf-preview/dist/filepond-plugin-pdf-preview.min.css'];
public array $js = ['https://unpkg.com/filepond-plugin-pdf-preview/dist/filepond-plugin-pdf-preview.min.js'];
}
32 changes: 32 additions & 0 deletions src/FilePondPdfPreviewPluginProd.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

declare(strict_types=1);

namespace Yii\Assets;

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

/**
* Asset bundle for the filepond pdf preview plugin in production mode, mainly used for publishing assets.
*/
final class FilePondPdfPreviewPluginProd extends AssetBundle
{
public string|null $basePath = '@assets';
public string|null $baseUrl = '@assetsUrl';
public string|null $sourcePath = '@filepond-pdf-preview-plugin';
public array $css = ['filepond-plugin-pdf-preview.min.css'];
public array $js = ['filepond-plugin-pdf-preview.min.js'];

public function __construct()
{
$pathMatcher = new PathMatcher();

$this->publishOptions = [
'filter' => $pathMatcher->only(
'**/filepond-plugin-pdf-preview.min.css',
'**/filepond-plugin-pdf-preview.min.js',
),
];
}
}

0 comments on commit f124ad7

Please sign in to comment.