Beaten-Sect0r / yii2-core

Yii2 Core project template
BSD 3-Clause "New" or "Revised" License
79 stars 34 forks source link

AdminLTE assets issue #18

Closed grrinch closed 6 years ago

grrinch commented 6 years ago

There's an issue with dmstr/yii2-adminlte-asset or bower-asset/admin-lte spitting out an exception:

[Composer\Repository\InvalidRepositoryException]                                                                     
  No valid bower.json was found in any branch or tag of https://github.com/DmitryBaranovskiy/eve.git, could not load   
  a package from it.

According to https://github.com/dmstr/yii2-adminlte-asset/issues/133#issuecomment-337179853 it should be fixed by ensuring that the version of adminlte-asset is ">2".

Tried changing this line to: "bower-asset/admin-lte": ">2", but still nothing.

I also tried updating the fpx-asset-plugin to: composer global require "fxp/composer-asset-plugin:~1.3" Not much of a help

Any suggestions?

Beaten-Sect0r commented 6 years ago

https://github.com/dmstr/yii2-adminlte-asset/issues/133#issuecomment-337179853 "bower-asset/admin-lte": ">2" != "dmstr/yii2-adminlte-asset": ">2"

https://github.com/Beaten-Sect0r/yii2-core/blob/master/docs/installation.md#before-you-begin https://github.com/Beaten-Sect0r/yii2-core/blob/master/composer.json#L55

bower package - https://github.com/Beaten-Sect0r/yii2-core/blob/master/composer.json#L32 composer package - https://github.com/dmstr/yii2-adminlte-asset/blob/master/composer.json#L21

try to remove the line https://github.com/Beaten-Sect0r/yii2-core/blob/master/composer.json#L32

show me composer.json

grrinch commented 6 years ago

Hi,

Removed the line: https://github.com/Beaten-Sect0r/yii2-core/blob/master/composer.json#L32

And it worked, however these files aren't then available (404):

This is my composer:

{
    "name": "beaten-sect0r/yii2-core",
    "description": "Yii2 Core project template",
    "keywords": ["yii2", "framework", "advanced", "project template"],
    "authors": [
        {
            "name": "Alexander Volkov",
            "email": "beatensect0r@gmail.com",
            "role": "Developer"
        }
    ],
    "type": "project",
    "license": "BSD-3-Clause",
    "minimum-stability": "dev",
    "require": {
        "php": ">=5.4.0",
        "yiisoft/yii2": "~2.0.13",
        "yiisoft/yii2-bootstrap": "*",
        "yiisoft/yii2-swiftmailer": "*",
        "vlucas/phpdotenv": "*",
        "beaten-sect0r/yii2-db-manager": "*",
        "beaten-sect0r/yii2-flatpickr": "*",
        "beaten-sect0r/yii2-phpsysinfo": "*",
        "samdark/sitemap": "*",
        "developeruz/yii2-db-rbac": "*",
        "vova07/yii2-fileapi-widget": "*",
        "creocoder/yii2-taggable": "*",
        "2amigos/yii2-tinymce-widget": "*",
        "2amigos/yii2-selectize-widget": "*",
        "mihaildev/yii2-elfinder": "*",
        "loveorigami/yii2-notification-wrapper": "*",
        "bower-asset/admin-lte": ">2",
        "bower-asset/html5shiv": "*",
        "bower-asset/timecircles": "*",
        "bower-asset/font-awesome": "*",
        "bower-asset/open-sans-fontface": "*",
        "bower-asset/highlightjs": "*",
        "bower-asset/jquery-slimscroll": "*"
    },
    "require-dev": {
        "yiisoft/yii2-debug": "*",
        "yiisoft/yii2-gii": "*",
        "friendsofphp/php-cs-fixer": "*"
    },
    "scripts": {
        "post-update-cmd": [
            "php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ]
    },
    "config": {
        "process-timeout": 1800,
        "preferred-install": "dist",
        "optimize-autoloader": true
    },
    "repositories": [
        {
            "type": "composer",
            "url": "https://asset-packagist.org"
        }
    ]
}
Beaten-Sect0r commented 6 years ago

https://github.com/Beaten-Sect0r/yii2-core/blob/master/backend/assets/AppAsset.php#L22 //'common\assets\AdminLte',

grrinch commented 6 years ago

Don't think so - doesn't seem to fix the actual issue

http://backend.yii2-core.dev/

image

Beaten-Sect0r commented 6 years ago

https://github.com/dmstr/yii2-adminlte-asset#quick-start

Beaten-Sect0r commented 6 years ago

Why do you dmstr/yii2-adminlte-asset? admin-lte here already installed.

sinfuljosh commented 6 years ago

This issue is happening because you have the old fxpio/composer-asset-plugin still installed globally.

I tracked it down about a week ago on a Russian forum when looking into that missing repo. One of the dependent repo's is registered and working properly when using bower-asset but has not been registered and does not work properly through composer-asset-plugin. I can't recall which specific repo but I worked out and tested a fix.

Tested clean install and the updated composer.json ensures that composer-asset-plugin does not get used when using composer within this project. Also removed composer-asset-plugin and attempted a clean install with the updated composer.json and did not have any issues.

Created a pull request with the updated composer.json

Updated composer text below:

    "config": {
        "process-timeout": 1800,
        "preferred-install": "dist",
        "optimize-autoloader": true,
        "fxp-asset": {
            "enabled": false
        }
    },