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

Upgrade grunt to 10up-toolkit #97

Merged
merged 24 commits into from
Aug 19, 2022
Merged

Upgrade grunt to 10up-toolkit #97

merged 24 commits into from
Aug 19, 2022

Conversation

cadic
Copy link
Contributor

@cadic cadic commented May 11, 2022

Description of the Change

This PR changes the build tool from grunt to https://github.com/10up/10up-toolkit

  • The resulting scripts path changed to dist (added to .gitignore)
  • Added new scripts npm run build, npm run dev and npm run makepot
  • Updated enqueue functions in the main PHP plugin file.
  • Removed old compiled assets from git
  • Updated cypress and push-deploy workflows to include the build step

Closes #79

Possible Drawbacks

1

Keep attention to the push-deploy GitHub Actions workflow. Before this change, compiled assets were hold in the repository and was ready to deploy without any additional steps. After this change, a build step is required.

2

Before this change, the SCRIPT_DEBUG php constant was used to force enqueueing the source JS. After this change, the npm run dev command starts the watch process, saves the debugging version of the JS and CSS files with sourcemaps. No additional setup needed for assets debugging.

Verification Process

  1. Clone the repo
  2. Run npm install
  3. Perform npm run build
  4. Expected to have assets in dist and pot file in localization
  5. Expected all plugin features to work

The push-deploy workflow was tested with a set of commands:

  • npm install
  • npm run build
  • rsync -rc --exclude-from=".distignore" . trunk/ --delete --delete-excluded

The resulting trunk folder contain the correct list of files.

Checklist:

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests passed.

Changelog Entry

Changed - Replaced Grunt with 10up-toolkit

Credits

Props @cadic

@cadic cadic self-assigned this May 11, 2022
@cadic cadic added this to the 2.4.1 milestone May 11, 2022
@cadic cadic requested review from a team and peterwilsoncc and removed request for a team May 11, 2022 10:07
@cadic cadic marked this pull request as ready for review May 11, 2022 10:07
@cadic cadic modified the milestones: 2.4.1, Future Release May 11, 2022
@cadic cadic marked this pull request as draft May 11, 2022 14:46
@cadic
Copy link
Contributor Author

cadic commented May 11, 2022

Converting to draft as it needs improvement in push-deploy GitHub Action: change .gitattributes to .distignore workflow

@cadic cadic marked this pull request as ready for review May 12, 2022 10:40
@cadic
Copy link
Contributor Author

cadic commented May 12, 2022

The deploy process was tested with command:

rsync -rc --exclude-from=".distignore" . trunk/ --delete --delete-excluded

@peterwilsoncc this is ready to review now

@jeffpaul jeffpaul modified the milestones: Future Release, 2.4.1 May 13, 2022
@jeffpaul
Copy link
Member

@cadic looks like a merge conflict that needs to be resolved. @peterwilsoncc pinging you for reminder on code review here... thanks!

Copy link
Contributor

@peterwilsoncc peterwilsoncc left a comment

Choose a reason for hiding this comment

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

I've added a few notes, the code looks good so it's mainly defensive development to protect ourselves against future errors.

Are you able to resolve the merge conflicts while making any changes?

simple-page-ordering.php Outdated Show resolved Hide resolved
@@ -0,0 +1,30 @@
# Directories to ignore
Copy link
Contributor

Choose a reason for hiding this comment

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

My understanding of the 10up WP.org deploy actions is that it observes export-ignore from the git attributes file if it is set. Is this needed too?

This is absolutely a question rather than a passive aggressive change request!! I'm still learning about the deploy actions.

assets/js/src/simple-page-ordering.js Show resolved Hide resolved
simple-page-ordering.php Outdated Show resolved Hide resolved
@@ -2,8 +2,11 @@
/.git export-ignore
/.github export-ignore
/.wordpress-org export-ignore
/assets export-ignore
Copy link
Contributor

Choose a reason for hiding this comment

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

✅ Plugin repo guideline four (readable code) met by inclusion of the link to the GitHub repo.

@Sidsector9 Sidsector9 modified the milestones: 2.4.1, 2.4.2 Jun 14, 2022
@jeffpaul
Copy link
Member

@cadic some feedback for you here, if you're not able to get to this please ping the OSP for someone else to pick this up and help finish it off... thanks!

@cadic cadic requested a review from peterwilsoncc August 18, 2022 07:28
Copy link
Contributor

@peterwilsoncc peterwilsoncc left a comment

Choose a reason for hiding this comment

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

Looks good to me, thank you!

Manual testing passed.

@jeffpaul jeffpaul merged commit ed90844 into develop Aug 19, 2022
@jeffpaul jeffpaul deleted the change/10up-toolkit branch August 19, 2022 14:05
@jeffpaul jeffpaul linked an issue Nov 8, 2022 that may be closed by this pull request
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.

Switching to @wordpress/scripts Automate the build process
4 participants