-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Make rollup warnings build errors. #6850
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,35 +45,28 @@ function addonBuildConfigForDataPackage(PackageName) { | |
} | ||
}, | ||
|
||
_suppressUneededRollupWarnings(message, next) { | ||
_handleRollupWarning(message) { | ||
if (message.code === 'CIRCULAR_DEPENDENCY') { | ||
return; | ||
} else if (message.code === 'NON_EXISTENT_EXPORT') { | ||
} else if (message.code === 'NON_EXISTENT_EXPORT' && message.message.includes('ts-interfaces')) { | ||
// ignore ts-interface imports | ||
if (message.message.indexOf(`/ts-interfaces/`) !== -1) { | ||
return; | ||
} | ||
} else if (message.code === 'UNRESOLVED_IMPORT') { | ||
if (!this.isDevelopingAddon()) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we shouldn't remove this check as rollup, babel, rollup plugins, broccoli, and broccoli-rollup may all be a different version in a consuming app than what we test and ship with. It's better to print an unnecessary warning than to break the build for those folks. |
||
// don't print these for consumers | ||
return; | ||
} else { | ||
const chalk = require('chalk'); | ||
// make warning actionable | ||
// eslint-disable-next-line no-console | ||
console.log( | ||
chalk.yellow( | ||
`\n\n⚠️ Add ${chalk.white( | ||
message.source | ||
)} to the array returned by externalDependenciesForPrivateModule in index.js of ${chalk.white( | ||
this.name | ||
)}\n\n` | ||
) | ||
); | ||
throw message.message; | ||
} | ||
return; | ||
} else { | ||
const chalk = require('chalk'); | ||
// make warning actionable | ||
// eslint-disable-next-line no-console | ||
console.log( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this warning (which is nicely actionable) would not pertain to any errors that don't match the removed |
||
chalk.yellow( | ||
`\n\n⚠️ Add ${chalk.white( | ||
message.source | ||
)} to the array returned by externalDependenciesForPrivateModule in index.js of ${chalk.white( | ||
this.name | ||
)}\n\n` | ||
) | ||
); | ||
|
||
throw message.message; | ||
} | ||
next(message); | ||
}, | ||
|
||
getOutputDirForVersion() { | ||
|
@@ -141,7 +134,7 @@ function addonBuildConfigForDataPackage(PackageName) { | |
packageName: PackageName, | ||
babelCompiler: babel, | ||
babelOptions: this.options.babel, | ||
onWarn: this._suppressUneededRollupWarnings.bind(this), | ||
onWarn: this._handleRollupWarning.bind(this), | ||
externalDependencies: this.externalDependenciesForPrivateModule(), | ||
destDir: this.getOutputDirForVersion(), | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the removed slashes were there intentionally although I do see how it might look like a borked regex ;)
It's unlikely for this shorter string to match anything the longer string didn't match but the slashes were insurance we were finding a warning that included this string as part of a file path.
On the code style change I'm mixed. Folks rushed into using
contains
andincludes
andstartsWith
in our library and test code and I recently had to revert all of that to get us back to IE11 support. I like using new things but I dislike mixing styles. Overall though this is clearly a build file so its a bit more clear that it works here.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ya, but this is Node code and has no requirement for IE11 support.