yiisoft / yii-gii

Yii code generator extension
https://www.yiiframework.com/
BSD 3-Clause "New" or "Revised" License
33 stars 19 forks source link

Separate Core and Command-line into separate package #97

Open mtangoo opened 1 year ago

mtangoo commented 1 year ago

Currently when you install Gii, it installs a lot of dependencies, like view. In many cases it might be okay, but in some cases like in API, these dependencies are not desirable. It would be nice if you could only use command-line with core of Gii without all these extra dependencies.

samdark commented 1 year ago

Interesting. Are you sure it installs view package? https://github.com/yiisoft/yii-gii/blob/master/composer.json#L21

mtangoo commented 1 year ago

Yes it did despite what is in the JSON. I don't understand the magic happening. To test it, install the API template and then try installing Gii and see what happens!

xepozz commented 1 year ago

Which one, yiisoft/app-api?

mtangoo commented 1 year ago

Yes

mtangoo commented 1 year ago

Here is full composer.json

{
    "name": "yiisoft/app-api",
    "type": "project",
    "description": "Yii Framework API project template",
    "keywords": [
        "yii3",
        "app",
        "api",
        "rest"
    ],
    "homepage": "https://github.com/yiisoft/app-api/",
    "license": "BSD-3-Clause",
    "support": {
        "issues": "https://github.com/yiisoft/app-api/issues?state=open",
        "forum": "https://www.yiiframework.com/forum/",
        "wiki": "https://www.yiiframework.com/wiki/",
        "irc": "irc://irc.freenode.net/yii",
        "source": "https://github.com/yiisoft/app-api"
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "require": {
        "php": "^8.0",
        "cebe/markdown": "^1.2@dev",
        "httpsoft/http-message": "^1.0.5",
        "myclabs/php-enum": "^1.7",
        "psr/container": "^2.0",
        "psr/http-factory": "^1.0",
        "psr/http-message": "^1.0",
        "psr/http-server-handler": "^1.0",
        "psr/http-server-middleware": "^1.0",
        "psr/log": "^3.0",
        "vlucas/phpdotenv": "^5.3",
        "yiisoft/access": "^1.0",
        "yiisoft/active-record": "^3.0@dev",
        "yiisoft/auth": "^3.0",
        "yiisoft/cache": "^3.0",
        "yiisoft/cache-file": "^3.0",
        "yiisoft/config": "^1.0",
        "yiisoft/data": "^1.0",
        "yiisoft/data-response": "^2.0",
        "yiisoft/db-pgsql": "@dev",
        "yiisoft/definitions": "^3.0",
        "yiisoft/di": "^1.2",
        "yiisoft/error-handler": "^3.0",
        "yiisoft/factory": "^1.1",
        "yiisoft/files": "^2.0",
        "yiisoft/http": "^1.2",
        "yiisoft/injector": "^1.1",
        "yiisoft/log": "^2.0",
        "yiisoft/log-target-file": "^3.0",
        "yiisoft/request-body-parser": "^1.1",
        "yiisoft/request-model": "^1.0@dev",
        "yiisoft/router": "^3.0",
        "yiisoft/router-fastroute": "^3.0",
        "yiisoft/security": "^1.0",
        "yiisoft/translator": "^3.0",
        "yiisoft/translator-message-php": "^1.1",
        "yiisoft/user": "^2.0",
        "yiisoft/validator": "^1.0",
        "yiisoft/yii-console": "^2.0",
        "yiisoft/yii-debug": "^3.0@dev",
        "yiisoft/yii-debug-api": "^3.0@dev",
        "yiisoft/yii-event": "^2.0",
        "yiisoft/yii-http": "^1.0",
        "yiisoft/yii-middleware": "dev-master",
        "yiisoft/yii-runner-console": "^2.0",
        "yiisoft/yii-runner-http": "^2.0",
        "yiisoft/yii-swagger": "^2.0"
    },
    "require-dev": {
        "codeception/c3": "^2.6",
        "codeception/codeception": "^5.0",
        "codeception/lib-innerbrowser": "^3.0",
        "codeception/module-asserts": "^3.0",
        "codeception/module-cli": "^2.0",
        "codeception/module-db": "^3.0",
        "codeception/module-phpbrowser": "^3.0",
        "codeception/module-rest": "^3.0",
        "phpunit/phpunit": "^9.5",
        "roave/infection-static-analysis-plugin": "^1.16",
        "spatie/phpunit-watcher": "^1.23",
        "vimeo/psalm": "^4.18",
        "yiisoft/json": "^1.0",
        "yiisoft/yii-debug-viewer": "^3.0@dev",
        "yiisoft/yii-testing": "dev-master"
    },
    "autoload": {
        "psr-4": {
            "App\\": "src"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "App\\Tests\\": "tests/",
            "App\\Tests\\Acceptance\\": "tests/acceptance/",
            "App\\Tests\\Functional\\": "tests/functional/"
        }
    },
    "scripts": {
        "serve": "./yii serve",
        "post-update-cmd": [
            "App\\Installer::postUpdate",
            "App\\Installer::copyEnvFile"
        ],
        "post-create-project-cmd": [
            "App\\Installer::copyEnvFile"
        ],
        "test": "codecept run",
        "test-watch": "phpunit-watcher watch"
    },
    "extra": {
        "branch-alias": {
            "dev-master": "1.0.x-dev"
        },
        "config-plugin-file": "configuration.php"
    },
    "config": {
        "sort-packages": true,
        "allow-plugins": {
            "codeception/c3": true,
            "infection/extension-installer": true,
            "composer/package-versions-deprecated": true,
            "yiisoft/config": true
        }
    }
}