hiqdev / asset-packagist

Asset Packagist
https://asset-packagist.org
BSD 3-Clause "New" or "Revised" License
247 stars 25 forks source link

failed bower/adminlte: Invalid path alias: @composer/composer.json #7

Closed devthejo closed 8 years ago

devthejo commented 8 years ago

I think I have to add

Yii::setAlias('@composer/composer.json', ... );

to bugfix this error, but where this alias have to target ?

devthejo commented 8 years ago

For information, I didn't knew yii until today, my yii noob approach was to make

composer require hiqdev/asset-packagist"

and after I maked a file named yii at my doc root:

#!/usr/bin/env php
<?php
define('YII_DEBUG', true);
define('HISITE_VENDOR_DIR',__DIR__.'/vendor');

require_once HISITE_VENDOR_DIR . '/autoload.php';
require_once HISITE_VENDOR_DIR . '/yiisoft/yii2/Yii.php';

Yii::setAlias('hiqdev/assetpackagist', HISITE_VENDOR_DIR.'/hiqdev/asset-packagist/src');
Yii::setAlias('@hiqdev/assetpackagist/console', HISITE_VENDOR_DIR.'/hiqdev/asset-packagist/src/console');

$application = new yii\console\Application([
    'id' => 'yii-console',
    'basePath' => HISITE_VENDOR_DIR.'/hiqdev/asset-packagist/src/console',
    'controllerNamespace' => 'hiqdev\assetpackagist\console',
]);
$application->setVendorPath(HISITE_VENDOR_DIR);
$exitCode = $application->run();
exit($exitCode);

and then calling

php yii asset-package/update-all

and I got this

failed bower/adminlte: Invalid path alias: @composer/composer.json
failed bower/autosize: Invalid path alias: @composer/composer.json
failed bower/bootstrap: Invalid path alias: @composer/composer.json
failed bower/bootstrap-daterangepicker: Invalid path alias: @composer/composer.json
failed bower/bootstrap-switch: Invalid path alias: @composer/composer.json
failed bower/chartjs: Invalid path alias: @composer/composer.json
failed bower/drmonty-datatables-plugins: Invalid path alias: @composer/composer.json
failed bower/flag-icon-css: Invalid path alias: @composer/composer.json
failed bower/icheck: Invalid path alias: @composer/composer.json
failed bower/jquery: Invalid path alias: @composer/composer.json
failed bower/jquery-resizable-columns: Invalid path alias: @composer/composer.json
failed bower/jquery-ui: Invalid path alias: @composer/composer.json
failed bower/jquery.inputmask: Invalid path alias: @composer/composer.json
failed bower/less-space: Invalid path alias: @composer/composer.json
failed bower/lightbox2: Invalid path alias: @composer/composer.json
failed bower/matchheight: Invalid path alias: @composer/composer.json
failed bower/moment: Invalid path alias: @composer/composer.json
failed bower/octicons: Invalid path alias: @composer/composer.json
failed bower/paulzi-form: Invalid path alias: @composer/composer.json
failed bower/pnotify: Invalid path alias: @composer/composer.json
failed bower/punycode: Invalid path alias: @composer/composer.json
failed bower/select2: Invalid path alias: @composer/composer.json
failed bower/store-js: Invalid path alias: @composer/composer.json
failed bower/typeahead.js: Invalid path alias: @composer/composer.json
failed bower/visibilityjs: Invalid path alias: @composer/composer.json
failed bower/x-editable: Invalid path alias: @composer/composer.json
failed bower/yii2-pjax: Invalid path alias: @composer/composer.json
failed npm/jquery: Invalid path alias: @composer/composer.json
The following packages were not updated due to unrecoverable errors:
bower-asset/adminlte
bower-asset/autosize
bower-asset/bootstrap
bower-asset/bootstrap-daterangepicker
bower-asset/bootstrap-switch
bower-asset/chartjs
bower-asset/drmonty-datatables-plugins
bower-asset/flag-icon-css
bower-asset/icheck
bower-asset/jquery
bower-asset/jquery-resizable-columns
bower-asset/jquery-ui
bower-asset/jquery.inputmask
bower-asset/less-space
bower-asset/lightbox2
bower-asset/matchheight
bower-asset/moment
bower-asset/octicons
bower-asset/paulzi-form
bower-asset/pnotify
bower-asset/punycode
bower-asset/select2
bower-asset/store-js
bower-asset/typeahead.js
bower-asset/visibilityjs
bower-asset/x-editable
bower-asset/yii2-pjax
npm-asset/jquery
hiqsol commented 8 years ago

I plan to publish another project demonstrating how to setup your own version of asset-packagist. But it will take some time.

Add near other aliases:

Yii::setAlias('@composer', __DIR__);

This may help, but better wait for I publish asset-packagist.dev I'll try to finish it today. It will work out of the box.

devthejo commented 8 years ago

OK thanks, it's great, that deblocking my situation, now I have an other error (Unknown component ID: packageStorage) but I will try to debugging myself and let you work quiet on asset-packagist-dev ;)

hiqsol commented 8 years ago

Please could you let me know why do you want your local asset-packagist ?

devthejo commented 8 years ago

Off course, I use composer-asset-plugin and will continue to use it for private repos, but on large projects with many bower components, it slow done the composer install/update/require (15 minutes in some cases !) and asset-packagist speed up a lot, but there is no all bower components from bower registry in asset-packagist.org and I want to be free to add all that I need.

hiqsol commented 8 years ago

You are free to add all that you need using the form at the asset-packagist.org And it will be there as long as asset-packagist will exist. And asset-packagist will exist as long as it will have any sense.

hiqsol commented 8 years ago

Now I think that it may have a sense to add all the bower and npm packages :)

devthejo commented 8 years ago

Oh ! I didn't see that, I'm so focused on code that I don't look at ui, lol, so I will add my needs to asset-packagist.org instead of mounting my own repo, whatever, having the possibility to be fully autonome if I need it a day, is a pleasant idea to me, and I just got my asset-packagist.dev to work, I have some bugfix to share, I will do today, do you prefere a single pull request with all bugfix and my cli or separated for each file ?

devthejo commented 8 years ago

Yep ;) If you think you can add all the bower registry without slow down or reach github api limit it'll be great !

hiqsol commented 8 years ago

Concerning PR: please split by a subject if needed.