enriquepiatti / Magicento

PHPStorm plugin for Magento developers
115 stars 35 forks source link

Magicento 2: Add support for local composer package repository #323

Open kanevbg opened 1 year ago

kanevbg commented 1 year ago

Magicento 2 (v1.8.1) does not support Magento 2 modules added to local composer repository. To test and develop add local composer repository in the project's composer.json:

"repositories": {
  "development": {
      "type": "path",
      "url": "composer-repos/*"
  }
}

Now the composer-repos directory is a local composer repository (in the file system). So the structure looks like: image And that is example for composer.json of the composer package for magento 2 module:

{
    "name": "hd/example",
    "type": "magento2-module",
    "version": "1.0.0",
    "description": "HD Example.",
    "require": {
        "php": "~7.4.0||~8.0.0||~8.1.0||~8.2.0"
    },
    "autoload": {
        "files": [
            "src/registration.php"
        ],
        "psr-4": {
            "HD\\Example\\": "src"
        }
    },
    "extra": {},
    "license": [
        "proprietary"
    ],
    "suggest": {}
}

@enriquepiatti Please consider adding support for that. We are using that as part of our workflow and thus we are missing the Magicento2 plugin for modules developed as local composer packages. Thank you.

kanevbg commented 4 months ago

@enriquepiatti Please let me know the general perspective of implementing that according your view. I can make a PR with potential implementation if we start collaboration on that issue.