Originally created by: jeffposnick
R: @tropicadri
There's obviously a lot going on in this PR. Sorry!
At a high level, this migrates workbox-build to TypeScript. (Following this PR, only workbox-webpack-plugin and workbox-sw are written in JavaScript.)
The goal was to preserve functionality during this migration, and not require a major semver bump. The biggest change under the hood is swapping out @hapi/joi option validation for a two-part system that generates JSON schema based on our TypeScript definitions at build time, and then uses https://ajv.js.org/ to validate at runtime against that schema. @hapi/joi is a bit more sophisticated in terms of complex runtime validation (e.g. ensuring that if one option is set, another option needs to also be set, making options mutually exclusive, etc.) so some of those relationships needed to be expressed at runtime via custom functions, meaning that the generated JSON schema are not 100% the source of truth.
Many of the test changes across all the packages reflect the fact that validation now throws slightly different errors due to the above mentioned change.
There are other small changes sprinkled throughout this PR as well, based on things that I found necessary while working with the additional TypeScript code. Please flag anything that looks amiss!
Originally posted by: jeffposnick
Thanks! Regarding the linting errors, I'm not going to be able to resolve the three instances of
Parsing error: Cannot read property 'map' of undefinedin this PR. As per https://stackoverflow.com/a/64626605/385997, we're going to have to upgrade our TypeScript eslint dependencies to resolve them, and that's a larger effort being done in the other PR that you're working on.The other errors should be resolved now, though.
Ticket changed by: jeffposnick