WordPress.org

Make WordPress Core

Opened 6 months ago

Closed 6 months ago

Last modified 4 weeks ago

#47380 closed task (blessed) (fixed)

Remove the dependency on globally installed Grunt

Reported by: johnbillion Owned by: johnbillion
Milestone: 5.3 Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords: has-patch commit needs-docs has-dev-note
Focuses: Cc:
PR Number:

Description

There's no need for Grunt to be installed globally in order to run the build tasks because package.json already includes "grunt": "grunt" in its scripts property, which means npm run grunt [task] can be called and the local Grunt binary will be used.

Attachments (3)

47380.diff (6.8 KB) - added by johnbillion 6 months ago.
47380.2.diff (7.0 KB) - added by johnbillion 6 months ago.
47380.3.diff (7.0 KB) - added by johnbillion 6 months ago.

Download all attachments as: .zip

Change History (16)

@johnbillion
6 months ago

#1 @johnbillion
6 months ago

  • Keywords has-patch added; needs-patch removed

@netweb Fancy giving 47380.diff a sanity check?

@johnbillion
6 months ago

#2 @johnbillion
6 months ago

47380.2.diff goes a step further and introduces shortened npm run [build|test|watch] commands.

#3 @SergeyBiryukov
6 months ago

Looks good to me.

@johnbillion
6 months ago

#4 @johnbillion
6 months ago

47380.3.diff introduces and switches to using npm run dev because I forgot that npm run foo --bar won't pass the associative argument through without the -- separator.

#5 @netweb
6 months ago

  • Keywords commit needs-docs added
  • Type changed from enhancement to task (blessed)

#6 @johnbillion
6 months ago

I've updated all those handbook pages to use the npm run grunt ... syntax as the commands can all be run without a globally installed Grunt.

#7 @johnbillion
6 months ago

  • Owner set to johnbillion
  • Resolution set to fixed
  • Status changed from new to closed

In 45445:

Build/Test Tools: Remove the dependency on a globally installed Grunt.

The existing "grunt": "grunt" script in package.json allows for the use of npm run grunt ... which uses the local grunt binary in the project's node_modules.

Fixes #47380

#8 @johnbillion
6 months ago

In 45446:

Build/Test Tools: Revert an accidental change to Node dependencies.

See #47380

#9 @johnbillion
6 months ago

  • Keywords needs-dev-note added

This ticket was mentioned in Slack in #core by sergey. View the logs.


3 months ago

This ticket was mentioned in Slack in #core by sergey. View the logs.


3 months ago

#12 follow-up: @desrosj
4 weeks ago

  • Keywords has-dev-note added; needs-dev-note removed

Mentioned in the Miscellaneous Developer Focused Changes dev note for 5.3: https://make.wordpress.org/core/2019/10/15/miscellaneous-developer-focused-changes-in-5-3/

@johnbillion if you had something more verbose in mind, please just let me know and we can expand on that bullet point.

#13 in reply to: ↑ 12 @johnbillion
4 weeks ago

Replying to desrosj:

Mentioned in the Miscellaneous Developer Focused Changes dev note for 5.3

LGTM

Note: See TracTickets for help on using tickets.