0

I want to use satis to provide dependencies of projects I am developing.
So I know I can use options: require-dependencies, require-dev-dependencies and only-dependencies to include dependencies of my project.
But this will add all dependencies including laravel, symfony and all the third party libraries.

Is there a way to tell Satis to include dependencies but only from a single vendor?

So if project's composer.json has:

"require": [
    "laravel/framework": "^9.0",
    "hubertnnn/foo": "^1.0",
    "hubertnnn/bar": "^2.0"
]

Satis should only contain hubertnnn/foo and hubertnnn/bar, but not laravel/framework

HubertNNN
  • 1,727
  • 1
  • 14
  • 29
  • You can directly provide a repository from where you want to install packages: https://getcomposer.org/doc/articles/handling-private-packages.md#setup – Alive to die - Anant Aug 03 '23 at 13:28

1 Answers1

0

how to work with private packages or packages from specific vendors using the repositories configuration in your composer.json file??

In the context of your original question about limiting Satis (a static Composer repository generator) to a single vendor, the documentation provides valuable insights.

To achieve the desired behavior, you can use the repositories configuration to point to a specific package repository that contains the packages from the single vendor you want to use. Here's an example of how you can set it up:

Create a composer.json file for your project: //AFTER

{
    "name": "your/project",
    "require": {
        "laravel/framework": "^9.0",
        "hubertnnn/foo": "^1.0",
        "hubertnnn/bar": "^2.0"
    },
    "repositories": [
        {
            "type": "composer",
            "url": "https://example.com/packages.json"
        }
    ]
}

// BEFORE CODE

{
"packages": {
    "hubertnnn/foo": {
        "1.0.0": {
            "name": "hubertnnn/foo",
            "version": "1.0.0",
            "dist": {
                "url": "https://example.com/hubertnnn/foo-1.0.0.zip",
                "type": "zip"
            }
        }
    },
    "hubertnnn/bar": {
        "2.0.0": {
            "name": "hubertnnn/bar",
            "version": "2.0.0",
            "dist": {
                "url": "https://example.com/hubertnnn/bar-2.0.0.zip",
                "type": "zip"
            }
        }
    }
}

}

Follow the URL: https://getcomposer.org/doc/articles/handling-private-packages.md#setup

theaminuldev
  • 109
  • 8