Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yidas/yii2-composer-bower-skip
A Composer package that allows you to install or update Yii2 without Bower-Asset
https://github.com/yidas/yii2-composer-bower-skip
bower-asset composer packagist yii2
Last synced: 3 months ago
JSON representation
A Composer package that allows you to install or update Yii2 without Bower-Asset
- Host: GitHub
- URL: https://github.com/yidas/yii2-composer-bower-skip
- Owner: yidas
- License: mit
- Created: 2016-11-20T21:28:38.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-12-21T05:25:14.000Z (about 6 years ago)
- Last Synced: 2024-10-02T08:14:29.271Z (4 months ago)
- Topics: bower-asset, composer, packagist, yii2
- Homepage: http://www.yiiframework.com/
- Size: 11.7 KB
- Stars: 41
- Watchers: 2
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Yii2 Composer Bower Skip
A Composer package that allows you to install or update Yii2 without Bower-Asset.
[![Latest Stable Version](https://poser.pugx.org/yidas/yii2-composer-bower-skip/v/stable?format=flat-square)](https://packagist.org/packages/yidas/yii2-composer-bower-skip)
[![License](https://poser.pugx.org/yidas/yii2-composer-bower-skip/license?format=flat-square)](https://packagist.org/packages/yidas/yii2-composer-bower-skip)
[![Total Downloads](https://poser.pugx.org/yidas/yii2-composer-bower-skip/downloads?format=flat-square)](https://packagist.org/packages/yidas/yii2-composer-bower-skip)
[![Monthly Downloads](https://poser.pugx.org/yidas/yii2-composer-bower-skip/d/monthly?format=flat-square)](https://packagist.org/packages/yidas/yii2-composer-bower-skip)FEATURES
--------- ***Prevent the error of Bower packages** when using Composer install & update for Yii2*
> Problem 1
>
> \- yiisoft/yii2 2.0.12 requires bower-asset/jquery 2.2.*@stable | 2.1.*@stable | 1.11.*@stable | 1.12.*@stable -> no matching package found.- *Skip Bower packages installation or update, **No fxp/composer-asset-plugin needed***
Bower packages are not original Packagist source from Composer, so it will cause error when you install or update Bower without a plugin (`fxp/composer-asset-plugin` or `Asset-Packagist`). After requiring this package, Bower packages will not be required or updated, which you will keep the current version of Bower or even no Bower in the project vendor.
If you are using Yii2 core Bower, the recommended way is using [yidas/yii2-bower-asset](https://github.com/yidas/yii2-bower-asset) which could install or update Bower for Yii2 without plugin.
---
INSTALLATION
------------### 1. Require Package
In Yii2 `composer.json`, require `yidas/yii2-composer-bower-skip` before `yiisoft/yii2`.
Example `composer.json`:
```
"require": {
"php": ">=5.4.0",
"yidas/yii2-composer-bower-skip": "~2.0.5",
"yiisoft/yii2": "~2.0.5",
"yiisoft/yii2-bootstrap": "~2.0.0"
}
```### 2. Remove Composer Asset-Packagist Repositories Optionally
If you are using the version 2.0.13 or higher of Yii, you may optional remove the `repositories` setting of `composer.json` to use original Composer repository.
Example segament to delete in `composer.json` :
```
"repositories": [
{
"type": "composer",
"url": "https://asset-packagist.org"
}
]
```After that, you can run `composer update` or `composer install` without handling Bower-Asset.
---
CREATE PROJECT
--------------If you doesn't has Yii2 project yet, choose one of below ways to create:
### Create Project via Composer
You can use Composer to create Yii2 project by using following package:
#### [yidas/yii2-app-basic](https://github.com/yidas/yii2-app-basic)
```
composer create-project --prefer-dist yidas/yii2-app-basic
```#### [yidas/yii2-app-advanced](https://github.com/yidas/yii2-app-advanced)
```
composer create-project --prefer-dist yidas/yii2-app-advanced
```These packages are Yii 2 Application Template with fixed Bower, which including [`yidas/yii2-bower-asset`](https://github.com/yidas/yii2-bower-asset) already.
### Creating Project from Official Site
You could download Yii2 project from official [Archive File](http://www.yiiframework.com/download/), then manally install `yii2-composer-bower-skip` on it by following above instruction.
---
FAQ
---### Still Stuck when Composer Update
If you still get trouble with Bower after install this package, try to delete `composer.lock` file and make sure the asset plugin is disabled:
```
composer global remove fxp/composer-asset-plugin
composer update
```### Keep Current Bower
If you still want to keep `vendor\bower`, you could set reverse Git-ignore for that folder:
```
# composer vendor dir
/vendor/*
!/vendor/bower
```For example, you may lose Bower vendor after the project is pushed to Git server then re-install Composer from the clone one.
If you want keep whole `vendor` ignored, you could take a look for [yidas/yii2-bower-asset](https://github.com/yidas/yii2-bower-asset) which support auto-install for Bower.
---
LIMITATIONS
-----------This solution is for the situation that you won't require or update Bower asset of Yii2 for development such as using `yii2-debug` and `yii2-gii`.
If you are using Yii2 Bower, there are some smooth ways to require or update Bower for Yii2:
### Yii2 Bower Asset Package
[yidas/yii2-bower-asset](https://github.com/yidas/yii2-bower-asset) goals to install Bower for Yii2 app by original Composer repository, and makes Bower and Composer separated.
This is the recommended way to handle Bower with Yii2.
### Asset-Packagist Solution
[Asset-Packagist](https://asset-packagist.org/) is the new solution of Yii2, you may install Bower smoothly in Yii2 from [2.0.14 version](https://github.com/yiisoft/yii2-app-basic/commit/fc2ec7dfee9313288171e2fe8a5b80e22c1e1509) until release.