Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Remove unused services #2456

Merged
merged 5 commits into from
Jul 5, 2022

Conversation

stobrien89
Copy link
Member

@stobrien89 stobrien89 commented Jun 1, 2022

Description of changes:

In response to requests in #2420, #2369, #808.

A composer script which runs at pre-autoload-dump. Removes AWS services that aren't specified by the user in their composer.json file. Usage is as follows:

 "require": {
        "aws/aws-sdk-php": "<version>",
    },
    "scripts": {
        "pre-autoload-dump": "Aws\\Script\\Composer\\Composer::removeUnusedServices"
    },
    "extra": {
        "aws/aws-sdk-php": [
            "S3"
        ]
    }
}

For this example, running composer install or composer update will remove all AWS services but S3. More information can be found in the ReadMe.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@akondas
Copy link

akondas commented Jun 12, 2022

How can I help to move this forward. I really need this feature. Thanks 🍻

README.md Outdated Show resolved Hide resolved
src/Script/Composer/README.md Outdated Show resolved Hide resolved
@aws aws deleted a comment from SamRemis Jun 13, 2022
@stobrien89 stobrien89 force-pushed the remove-unused-services branch from 1ff557b to da00929 Compare June 13, 2022 21:28
Copy link

@akondas akondas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's go 🚀

@stobrien89 stobrien89 merged commit 2400a5a into aws:master Jul 5, 2022
@akondas
Copy link

akondas commented Jul 6, 2022

Release it 🚀 🙏

@kayw-geek
Copy link
Contributor

kayw-geek commented Sep 28, 2022

Description of changes:

In response to requests in #2420, #2369, #808.

A composer script which runs at pre-autoload-dump. Removes AWS services that aren't specified by the user in their composer.json file. Usage is as follows:

 "require": {
        "aws/aws-sdk-php": "<version>",
    },
    "scripts": {
        "pre-autoload-dump": "Aws\\Script\\Composer\\Composer::removeUnusedServices"
    },
    "extra": {
        "aws/aws-sdk-php": [
            "S3"
        ]
    }
}

For this example, running composer install or composer update will remove all AWS services but S3. More information can be found in the ReadMe.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Excuse me, I want to know the best practice of the feature, this feature had some risk now. for example, I cannot to know packages of project depend have which depend on AWS services, if you have a good suggestion?

@stobrien89

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants