Supersedes #6178.
This branch keeps the exact same final content as #6178, but splits
history for reviewability:
1. `chore(companion): rename source and test files from .js to .ts`
(pure `git mv`, no content changes)
2. `feat(companion): port Companion to TypeScript` (actual
content/type/schema/build updates)
Validation note:
- Final tree is byte-for-byte identical to `ts-companion`
(`7b5b16a298690b0492de4cc4fab744f998b45570`).
---------
Co-authored-by: Mikael Finstad <finstaden@gmail.com>
* fix broken npm run test
* improve jest / companion
add `npm run test:companion:watch`
move env variables into code to make testing easier
this allows for watching (source is causing problems with npm scripts)
also now we can run `corepack yarn test:companion -t 'single test'`
* fix root project jest
make sure we don't run companion tests on npm run test:unit (as they don't work in a browser/jsdom environment)
* improve validation logic
previously incorrect options gives an Uploader object in an incorrect state
* rewrite uploader to make it more testable
* add test for xhr
* check that metadata values are strings
* fix nested meta
causing error #3477
* convert meta to strings instead
like the official FormData spec does
* fix broken companion dev #3473
* fix botched merge
* fix botched merge and remove --fix
* fix botchedf merge
* quick fix
* .
* remove eslint fix