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

cleanup release vendor dir #7842

Closed
staabm opened this issue Mar 16, 2023 · 10 comments
Closed

cleanup release vendor dir #7842

staabm opened this issue Mar 16, 2023 · 10 comments
Labels

Comments

@staabm
Copy link
Contributor

staabm commented Mar 16, 2023

Feature Request

the rector release contains a bunch of not-release relevant files from dependencies within its prefixed inner-vendor/ dir

Examples:

grafik

I think there are at least some

  • doc
  • docs
  • tests
  • examples
  • templates

folders, which should be stripped while the release is build.

something like these bash commands would work:

            find vendor -name doc -type d -exec rm -r {} +
            find vendor -name docs -type d -exec rm -r {} +
            find vendor -name tests -type d -exec rm -r {} +
            find vendor -name examples -type d -exec rm -r {} +
            find vendor -name templates -type d -exec rm -r {} +

this would reduce filesize/filecount and reduce therefore installation and download/upload time via composer etc

@samsonasik
Copy link
Member

samsonasik commented Mar 16, 2023

templates is used for:

The docs exitsts for pointer to website doc

The left over directories can be removed from build ci https://github.com/rectorphp/rector-src/blob/e11572a6f1004d905766ae88ee7ce8f667009007/.github/workflows/build_scoped_rector.yaml#L61

@samsonasik
Copy link
Member

docs directory also place for rules list overview so used:

https://github.com/rectorphp/rector/blob/main/docs/rector_rules_overview.md

@staabm
Copy link
Contributor Author

staabm commented Mar 21, 2023

to clarify: the mentioned folders are useful in the main repo on github, but they should not be contained within the rector installation in a local project.

people don't search for docs in the local vendor/ usually and all files contained in a release need to be downloaded/copied over hundreds and thousands of times in CI builds, deployments, dev-environments etc

@staabm
Copy link
Contributor Author

staabm commented Mar 21, 2023

another question. is

  • symplify/rule-doc-generator-contracts
  • tracy/tracy

actually a dev-dependency and is not required within the final release?

@samsonasik
Copy link
Member

tracy is used to be able to debug, see rectorphp/rector-src#3354

@samsonasik
Copy link
Member

rule doc generator implements contract, used to define rule example, the one that need to be required probably https://github.com/symplify/rule-doc-generator

@samsonasik
Copy link
Member

Removing docs on installation only will require another process: post-install or pre-install

or register to .gitattributes

@stof
Copy link

stof commented Mar 29, 2023

or register to .gitattributes

that's the way it should be done, to avoid downloading them (and avoiding the need to turn the package into a composer plugin to be able to run some post-install logic)

@TomasVotruba
Copy link
Member

Feel free to send PR to handle this 👍

@TomasVotruba
Copy link
Member

Closing as accepted to avoid issue staling 👍 Thanks for the suggestions and PRs are still welcomed 💯

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

No branches or pull requests

4 participants