puppeteer/utils
Jack Franklin a614bc45aa
chore: migrate src/Connection to TypeScript (#5694)
* chore: migrate `src/Connection` to TypeScript

This commit migrates `src/Connection` to TypeScript. It also changes its
exports to be ESM because TypeScript's support for exporting values to
use as types via CommonJS is poor (by design) and so rather than battle
that it made more sense to migrate the file to ESM.

The good news is that TypeScript is still outputting to `lib/` as
CommonJS, so the fact that we author in ESM is actually not a breaking
change at all.

So going forwards we will:

* migrate TS files to use ESM for importing and exporting
* continue to output to `lib/` as CommonJS
* continue to use CommonJS requires when in a `src/*.js` file

I'd also like to split `Connection.ts` into two; I think the
`CDPSession` class belongs in its own file, but I will do that in
another PR to avoid this one becoming bigger than it already is.

I also turned off `@typescript-eslint/no-use-before-define` as I don't
think it was adding value and Puppeteer's codebase seems to have a style
of declaring helper functions at the bottom which is fine by me.

Finally, I updated the DocLint tool so it knows of expected method
mismatches. It was either that or come up with a smart way to support
TypeScript generics in DocLint and given we don't want to use DocLint
that much longer that didn't feel worth it.

* Fix params being required
2020-04-21 09:20:25 +01:00
..
browser chore: migrate remaining tests to Mocha (#5616) 2020-04-09 20:12:32 +02:00
doclint chore: migrate src/Connection to TypeScript (#5694) 2020-04-21 09:20:25 +01:00
protocol-types-generator chore: move code to src/ and emit with TypeScript (#5568) 2020-04-02 16:25:19 +02:00
testserver chore: update URLs (#5185) 2019-11-26 13:12:25 +01:00
apply_next_version.js chore: update URLs (#5185) 2019-11-26 13:12:25 +01:00
bisect.js chore(bisect): inherit parent ENV when launching script (#4842) 2019-08-13 16:28:09 -07:00
check_availability.js chore: improve //utils/check_availability.js (#4770) 2019-07-29 14:29:50 -07:00
ESTreeWalker.js feat(launcher): add experimental "transport" option to pptr.connect (#3265) 2018-09-20 11:55:23 -07:00
fetch_devices.js fix(devicedescriptors): fix UA in DeviceDescriptors (#2741) 2018-06-14 13:55:09 -07:00
prepare_puppeteer_core.js feat: make it possible to run install.js script with puppeteer-core (#5325) 2020-01-28 13:08:13 +01:00