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

Reduce the need for re-running `scaffold package-*` commands #4751

Open
schlessera opened this Issue Mar 27, 2018 · 2 comments

Comments

1 participant
@schlessera
Member

schlessera commented Mar 27, 2018

Right now, the scaffold package-* commands not only provide scaffolding code. They actually "copy-paste" dependencies into the package that should be external libraries instead.

We need to look into reducing the need to constantly run update commits across all packages when framework code changes, most notably the utils/* functionality and the test suite. These should either be separate libraries or be directly used from the framework.

@schlessera schlessera added this to the 2.0.0 milestone Mar 27, 2018

@schlessera

This comment has been minimized.

Member

schlessera commented Jul 19, 2018

The new package https://github.com/wp-cli/regenerate-readme now takes care of this. By simply requiring this package as a development dependency, it will become active (through the use of the PHP Composter framework):

composer require --dev wp-cli/regenerate-readme

This will cause the following:

  • On precommit, it will compare the hash of the README.md file before and after a vendor/bin/wp scaffold package-readme . --force. If the hashes were different, it will create a file called .commit-readme-md.
  • On postcommit, it will check whether a file .commit-readme-md exists and if it does, it does a git add README.md followed by a git commit --amend -C HEAD --no-verify. This modifies the commit after the fact to include the modified README.md file.

This means that contributors don't need to take care of manually regenerating the README.md file anymore. If they change some doc blocks or some partial markdown files, the README.md file will automatically be adapted.

@schlessera schlessera modified the milestones: 2.0.0, 2.1.0 Aug 10, 2018

@schlessera

This comment has been minimized.

Member

schlessera commented Aug 10, 2018

The main functionality has been added with v2.0.0, but was only used within the wp-cli/wp-cli-tests repo.

This needs to be further tested and then implemented within all packages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment