custom-post-type-ui icon indicating copy to clipboard operation
custom-post-type-ui copied to clipboard

Composer installation not working

Open OzzyTheGiant opened this issue 4 years ago • 4 comments

Been trying to get composer to install the plugin into a wordpress project managed by composer. When running composer update, it keeps telling me there is either a typo, not available in a stable enough version or did not add custom repository. Here's part of my composer.json file:

{
    "extra": {
        "installer-paths": {
            "wp-content/plugins/{$name}/": [
                "type:wordpress-plugin"
            ],
            "wp-content/themes/{$name}/": [
                "type:wordpress-theme"
            ]
        },
        "wordpress-install-dir": "wordpress",
        "repositories": [
            {
                "type": "composer",
                "url": "https://wpackagist.org"
            },
            {
                "type": "vcs",
                "url": "https://github.com/webdevstudios/custom-post-type-ui.git"
            }
        ]
    },
    "require": {
        "johnpbloch/wordpress": ">=5.6",
        "vlucas/phpdotenv": "^5.2",
        "elliotcondon/acf": "^4.4",
        "airesvsg/acf-to-rest-api": "^3.3",
        "webdevstudios/custom-post-type-ui": "1.8.2"
    }
}

Even tried using minimum-stability property as dev and nothing works.

OzzyTheGiant avatar Jan 12 '21 22:01 OzzyTheGiant

Looks like your version is trying to pull from https://packagist.org which we don't have CPTUI on https://packagist.org/?query=webdevstudios

However, it would be available via https://wpackagist.org via: composer require wpackagist-plugin/custom-post-type-ui:1.8.2

Hope this helps.

tw2113 avatar Jan 13 '21 15:01 tw2113

Ahh, suddenly it all makes sense. I couldn't find the plugin because I typed it in with spaces so I assumed it didn't exist there, but I had to hyphenate it: custom-post-type-ui. Managed to find all the other plugins this way.

Either way, still doesn't work. Same error :/

Composer version: 2.0.8

Current composer.json:

{
    "require": {
        "johnpbloch/wordpress": ">=5.6",
        "vlucas/phpdotenv": "^5.2",
        "airesvsg/acf-to-rest-api": "^3.3",
        "wpackagist-plugin/advanced-custom-fields": "5.9.3",
        "wpackagist-plugin/custom-post-type-ui": "1.8.2",
        "wpackagist-plugin/wp-revisions-control": "1.3.0"
    },
    "extra": {
        "installer-paths": {
            "wp-content/plugins/{$name}/": [
                "type:wordpress-plugin"
            ],
            "wp-content/themes/{$name}/": [
                "type:wordpress-theme"
            ]
        },
        "wordpress-install-dir": "wordpress",
        "repositories": [
            {
                "type": "composer",
                "url": "https://wpackagist.org",
                "only": [
                    "wpackagist-plugin/*",
                    "wpackagist-theme/*"
                ]
            }
        ]
    }
}

OzzyTheGiant avatar Jan 13 '21 16:01 OzzyTheGiant

Best I maybe have at the moment is the Composer 2.x detail. My test earlier worked just fine with 1.x and I haven't reviewed recently what's changing for process between 1.x and 2.x. I'd need to do some trial/error there as well as reviewing upgrade processes.

tw2113 avatar Jan 13 '21 17:01 tw2113

Hi, Here my findings:

1- webdevstudios/custom-post-type-ui package is added correctly with either composer 1 or composer 2, but when it clones the code, the folder is empty

image

My composer file for this test: { "name": "azulblanco/wp-content", "description": "Testing local site", "repositories": [ { "type": "composer", "url": "https://wpackagist.org" }, { "type": "vcs", "url": "https://github.com/WebDevStudios/custom-post-type-ui.git" } ], "require": { "perfopsone/decalog": "^3.0", "webdevstudios/custom-post-type-ui": "1.12.1" }, "require-dev": { "monolog/monolog": "2.x-dev" }, "license": "MTL", "authors": [], "minimum-stability": "dev", "config": { "allow-plugins": { "composer/installers": true } } }

2- CPTui is not listed in packagist,

image

3- The package needs to be added by composer with prior requisite of adding the repositories section in composer.json and specifying the git repository of CPTui.

"repositories": [ ... { "type": "vcs", "url": "https://github.com/WebDevStudios/custom-post-type-ui.git" } ],

emilse-webdev avatar Jun 14 '22 13:06 emilse-webdev

I'm marking this as wontfix as we don't have CPTUI on packagist.org and wpackagist.org is just fine at the moment.

tw2113 avatar Sep 12 '22 23:09 tw2113