By using the `strings` re-export from `@angular-devkit/schematics` instead of from `@angular-devkit/core`,
the number of imports from `@angular-devkit/core` has been reduced and lowers the direct dependency count
for many of the individual schematics.
The `no-useless-escape` eslint rule has now been enabled which removes unneeded characters and complexity from string literals and regular expressions. All files that were in violation of this rule have also been corrected.
Webpack 5 now includes web worker support. However, the structure of the URL within the `Worker` constructor must be in a specific format.
Before: `new Worker('./app.worker', ...)`
After: `new Worker(new URL('./app.worker', import.meta.url), ...)`
This change provides more fine-grained warnings during the `update-module-and-target-compiler-options` migration for V10.0 in the event a TypeScript configuration file could not be updated. The `JSONFile` utility class was also augmented to directly throw when created to ensure that the `content` property is always initialized.
This is to align with the folder structure of version 8, were tsconfigs are outside of the `src` folder
Also, this change remove the dud `tsconfig.json` in the `src` folder and instead we add the triple slash lib reference `/// <reference lib="webworker" />` for IDE support.
The generated snippet was:
worker.onmessage = ({ data }) => {
console.log('page got message: $\{data\}');
};
which doesn't use a template string and so does not log `data`.
Fixes the generated snippet to be `console.log(`page got message: ${data}`);`.
Also adds a newline at the end of the web worker template to not fail the default TSLint rules if the schematic is used.