Skip to content

Commit

Permalink
fix: improve build logs related to plugin event handlers (#3721)
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky authored Oct 14, 2021
1 parent 3105842 commit e1a33fe
Show file tree
Hide file tree
Showing 15 changed files with 413 additions and 415 deletions.
4 changes: 1 addition & 3 deletions packages/build/src/log/messages/steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ const logStepStart = function ({ logs, event, packageName, coreStepDescription,
}

const getDescription = function ({ coreStepDescription, netlifyConfig, packageName, event }) {
return coreStepDescription === undefined
? `${event} step from ${packageName}`
: coreStepDescription({ netlifyConfig })
return coreStepDescription === undefined ? `${packageName} (${event} event)` : coreStepDescription({ netlifyConfig })
}

const logBuildCommandStart = function (logs, buildCommand) {
Expand Down
6 changes: 3 additions & 3 deletions packages/build/tests/core/snapshots/tests.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -1065,7 +1065,7 @@ Generated by [AVA](https://avajs.dev).
- ./plugin.js@1.0.0 from netlify.toml␊
────────────────────────────────────────────────────────────────␊
1. onPreBuild step from ./plugin.js ␊
1. ./plugin.js (onPreBuild event)
────────────────────────────────────────────────────────────────␊
expect execPath to NOT equal TEST_NODE_PATH. Got 'true'␊
Expand Down Expand Up @@ -1120,7 +1120,7 @@ Generated by [AVA](https://avajs.dev).
- netlify-plugin-test@1.0.0 from netlify.toml and package.json␊
────────────────────────────────────────────────────────────────␊
1. onPreBuild step from netlify-plugin-test ␊
1. netlify-plugin-test (onPreBuild event)
────────────────────────────────────────────────────────────────␊
expect execPath to NOT equal TEST_NODE_PATH. Got 'true'␊
Expand Down Expand Up @@ -1345,7 +1345,7 @@ Generated by [AVA](https://avajs.dev).
- ./plugin.js@1.0.0 from netlify.toml␊
────────────────────────────────────────────────────────────────␊
1. onBuild step from ./plugin.js ␊
1. ./plugin.js (onBuild event)
────────────────────────────────────────────────────────────────␊
Expand Down
Binary file modified packages/build/tests/core/snapshots/tests.js.snap
Binary file not shown.
12 changes: 6 additions & 6 deletions packages/build/tests/env/snapshots/tests.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Generated by [AVA](https://avajs.dev).
- ./plugin@1.0.0 from netlify.toml␊
────────────────────────────────────────────────────────────────␊
1. onPreBuild step from ./plugin
1. ./plugin (onPreBuild event)
────────────────────────────────────────────────────────────────␊
en_US.UTF-8␊
Expand Down Expand Up @@ -151,7 +151,7 @@ Generated by [AVA](https://avajs.dev).
- ./plugin@1.0.0 from netlify.toml␊
────────────────────────────────────────────────────────────────␊
1. onPreBuild step from ./plugin
1. ./plugin (onPreBuild event)
────────────────────────────────────────────────────────────────␊
test␊
Expand Down Expand Up @@ -258,7 +258,7 @@ Generated by [AVA](https://avajs.dev).
- ./plugin@1.0.0 from netlify.toml␊
────────────────────────────────────────────────────────────────␊
1. onPreBuild step from ./plugin
1. ./plugin (onPreBuild event)
────────────────────────────────────────────────────────────────␊
test␊
Expand Down Expand Up @@ -315,7 +315,7 @@ Generated by [AVA](https://avajs.dev).
- ./plugin@1.0.0 from netlify.toml␊
────────────────────────────────────────────────────────────────␊
1. onPreBuild step from ./plugin
1. ./plugin (onPreBuild event)
────────────────────────────────────────────────────────────────␊
test␊
Expand Down Expand Up @@ -372,7 +372,7 @@ Generated by [AVA](https://avajs.dev).
- ./plugin@1.0.0 from netlify.toml␊
────────────────────────────────────────────────────────────────␊
1. onPreBuild step from ./plugin
1. ./plugin (onPreBuild event)
────────────────────────────────────────────────────────────────␊
test-build␊
Expand Down Expand Up @@ -429,7 +429,7 @@ Generated by [AVA](https://avajs.dev).
- ./plugin@1.0.0 from netlify.toml␊
────────────────────────────────────────────────────────────────␊
1. onPreBuild step from ./plugin
1. ./plugin (onPreBuild event)
────────────────────────────────────────────────────────────────␊
test␊
Expand Down
Binary file modified packages/build/tests/env/snapshots/tests.js.snap
Binary file not shown.
Loading

0 comments on commit e1a33fe

Please sign in to comment.