Make WordPress Core

Opened 8 years ago

Closed 6 years ago

Last modified 6 years ago

#46099 closed defect (bug) (duplicate)

Twenty Nineteen: Ignore theme based node_modules

Reported by: nielslange Owned by: nielslange
Priority: normal Milestone:
Component: Build/Test Tools Version: 5.0
Severity: minor Keywords: has-patch needs-testing
Cc: Focuses:

Description

Recently, the Twenty Nineteen theme was moved from Github into Trac. Twenty Nineteen is the first theme that is using npm and therefore has a node_modules directory within the theme folder.

When running grunt, grunt build or grunt watch multiple errors occur and the command gets aborted. While this could be bypassed using grunt --force, grunt build --force and grunt watch --force, a better approach would be to ignore the theme based node_module folder.

Steps to reproduce

  1. Navigate to /src/wp-content/themes/twentyninteen
  2. Run npm install
  3. Navigate to /
  4. Run grunt

Expected result

  • No error occurs.

Current result

  • The following error occurs:
Running "jsvalidate:build" (jsvalidate) task
...
...
...
Encountered 292 errors.
Warning: Task "jsvalidate:build" failed. Use --force to continue.
Aborted due to warnings.

Attachments (1)

46099.diff​ (529 bytes ) - added by nielslange 8 years ago.

Download all attachments as: .zip

Change History (9)

@nielslange
8 years ago

#1 @nielslange
8 years ago

  • Severity normal → minor

@allancole & @kjellr: Feel free to test my patch. 😉

PS: While I created this patch to solve the concrete issue I ran into while working on Twenty Nineteen related tickets, I created the patch in a way that it affects all themes that have a node_modules directory.

PPS: The quickest way to test this patch is by running grunt jsvalidate:build directly.

Last edited 8 years ago by nielslange (previous) (diff)

#2 follow-up: @kjellr
8 years ago

  • Component Bundled Theme → Build/Test Tools

Awesome, thank you @nielslange!

This works on my end, but I'd like for someone with some experience in that Gruntfile to take a closer look. Going to reassign this to the "Build/Test Tools" component for some more eyes there.

#3 in reply to: ↑ 2 @nielslange
8 years ago

You’re very welcome, @kjellr, and thanks for changing the component to Build/Test tools. That’s definitely a better component for this change. 😉

#4 @desrosj
8 years ago

  • Milestone Awaiting Review → Future Release
  • Version trunk → 5.0

#5 @nielslange
7 years ago

  • Summary Ignore theme based node_modules → Twenty Nineteen: Ignore theme based node_modules

#6 @isabel_brison
6 years ago

  • Resolution → fixed
  • Status assigned → closed

This seems to be a duplicate of #46706 . In any case, the issue has since been fixed, so I'll go ahead and close this ticket.

#7 @desrosj
6 years ago

  • Resolution fixed → duplicate

Duplicate of #46706.

#8 @desrosj
6 years ago

  • Milestone Future Release
Note: See TracTickets for help on using tickets.