2017 © Pedro Peláez
 

yii2-extension yii2-composer-bower-skip

A Composer package that allows you to install or update Yii2 without Bower-Asset

image

maiscrm/yii2-composer-bower-skip

A Composer package that allows you to install or update Yii2 without Bower-Asset

  • Monday, March 26, 2018
  • by tonyzheng
  • Repository
  • 2 Watchers
  • 0 Stars
  • 144 Installations
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 0 Open issues
  • 6 Versions
  • 500 % Grown

The README.md

, (*1)

Yii2 Composer Bower Skip


A Composer package that allows you to install or update Yii2 without Bower-Asset., (*2)

Latest Stable Version Total Downloads Latest Unstable Version License, (*3)

FEATURES

  • Prevent the error of Bower packages when using Composer install & update for Yii2, (*4)

    Problem 1, (*5)

    - 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., (*6)

  • Skip Bower packages installation or update, No fxp/composer-asset-plugin needed, (*7)

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., (*8)

If you are using Yii2 core Bower, the recommended way is using yidas/yii2-bower-asset which could install or update Bower for Yii2 without plugin., (*9)


INSTALLATION

1. Require Package

In Yii2 composer.json, require yidas/yii2-composer-bower-skip before yiisoft/yii2., (*10)

Example composer.json:, (*11)

"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., (*12)

Example segament to delete in composer.json :, (*13)

"repositories": [
    {
        "type": "composer",
        "url": "https://asset-packagist.org"
    }
]

After that, you can run composer update or composer install without handling Bower-Asset., (*14)


CREATE PROJECT

If you doesn't has Yii2 project yet, choose one of below ways to create:, (*15)

Create Project via Composer

You can use Composer to create Yii2 project by using following package:, (*16)

yidas/yii2-app-basic

composer create-project --prefer-dist yidas/yii2-app-basic

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 already., (*17)

Creating Project from Official Site

You could download Yii2 project from official Archive File, then manally install yii2-composer-bower-skip on it by following above instruction., (*18)


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:, (*19)

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:, (*20)

# 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., (*21)

If you want keep whole vendor ignored, you could take a look for yidas/yii2-bower-asset which support auto-install for Bower., (*22)


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., (*23)

If you are using Yii2 Bower, there are some smooth ways to require or update Bower for Yii2:, (*24)

Yii2 Bower Asset Package

yidas/yii2-bower-asset goals to install Bower for Yii2 app by original Composer repository, and makes Bower and Composer separated., (*25)

This is the recommended way to handle Bower with Yii2., (*26)

Asset-Packagist Solution

Asset-Packagist is the new solution of Yii2, you may install Bower smoothly in Yii2 with new version until release., (*27)

The Versions

26/03 2018

dev-master

9999999-dev

A Composer package that allows you to install or update Yii2 without Bower-Asset

  Sources   Download

MIT

framework yii2 bower bower asset

26/03 2018

v2.0.14

2.0.14.0

A Composer package that allows you to install or update Yii2 without Bower-Asset

  Sources   Download

MIT

framework yii2 bower bower asset

27/01 2018

dev-add-license-1

dev-add-license-1

A Composer package that allows you to install or update Yii2 without Bower-Asset

  Sources   Download

MIT

framework yii2 bower bower asset

03/11 2017

2.0.13

2.0.13.0

A Composer package that allows you to install or update Yii2 without Bower-Asset

  Sources   Download

MIT

framework yii2 bower bower asset

06/10 2017

2.0.12

2.0.12.0

A Composer package that allows you to install or update Yii2 without Bower-Asset

  Sources   Download

MIT

framework yii2 bower bower asset

20/11 2016

2.0.0

2.0.0.0

A meta package that allows you to install yii2 without bower-asset (without composer-asset-plugin).

  Sources   Download

BSD-3-Clause