WordPress.org

Make WordPress Core

Opened 7 weeks ago

Closed 7 weeks ago

Last modified 7 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 needs-dev-note
Focuses: Cc:

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 7 weeks ago.
47380.2.diff (7.0 KB) - added by johnbillion 7 weeks ago.
47380.3.diff (7.0 KB) - added by johnbillion 7 weeks ago.

Download all attachments as: .zip

Change History (12)

@johnbillion
7 weeks ago

#1 @johnbillion
7 weeks ago

  • Keywords has-patch added; needs-patch removed

@netweb Fancy giving 47380.diff a sanity check?

@johnbillion
7 weeks ago

#2 @johnbillion
7 weeks ago

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

#3 @SergeyBiryukov
7 weeks ago

Looks good to me.

@johnbillion
7 weeks ago

#4 @johnbillion
7 weeks 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
7 weeks ago

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

#6 @johnbillion
7 weeks 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
7 weeks 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
7 weeks ago

In 45446:

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

See #47380

#9 @johnbillion
7 weeks ago

  • Keywords needs-dev-note added
Note: See TracTickets for help on using tickets.