[wasm] Add infrastructure for building WebWorkers (#70220)
* [wasm] Add infrastructure for building WebWorkers
- Modify the rollup.config.js script to look for webworkers and to
roll them up into IIFE js files in the ${nativeBinDir}/src artifacts
directory
- A "webworker" is any file in `src/mono/wasm/runtime/workers/` that
looks like `dotnet-{workerName}-worker.ts` or `.js`. It can also
include other files (ideally by defining them in files in
subdirectories for that worker
`src/mono/wasm/runtime/workers/dotnet-{workerName}-worker/utility.ts`)
- Other changes still have to be done manually in wasm.proj, and
elsewhere in order to place the bundled JS file in the right place.
- Adds a tsconfig.json for the workers to typecheck using the
DedicatedWorkerGlobalScope and without the DOM globals (`window`, etc)
- This doesn't convert dotnet-crypto-worker.js into TypeScript, but it
does turn on TypeScript checking using a JSDoc comment.
To convert that file to typescript:
1. rename `workers/dotnet-crypto-worker.js` to
`workers/dotnet-crypto-worker.ts`
2. replace uses of `var` by `let` or `const`
3. add `:any` in various places.
* use fast-glob instead of fs.readdir
* add fast-glob to devDependencies