Commit Graph

34 Commits

Author SHA1 Message Date
Jack Franklin
1f5e333f00
chore: Don't store revisions in package.json (#6109)
* chore: Don't store revisions in `package.json`

It's quite messy to have to require the `package.json` file in multiple
places purely to find out what revision of a given browser we want to
use. We can also achieve better type safety by placing it in an actual
source file.

This commit makes that change and also tidies up our reliance on
`package.json` within the source code generally; we now only use it to
find the location of the Puppeteer root such that we know where to
install downloaded browsers to.

To avoid using `package.json` to parse the name of the module, we also
now explicitly have an entry point for the Puppeteer module and the
Puppeter Core module. This will make it easier in the future to ship
less code as part of core (e.g. core never needs to download a browser,
so why ship that code?). Core can also then not have any revisions based
info contained in it.

The test install script has also been updated to ensure that
puppeteer-core can be installed correctly too.

Finally, the `install` script has been moved to TypeScript for nicer
typechecking and safety. The functionality of it has not changed.
2020-06-29 16:13:24 +01:00
Yang Guo
123c377512
docs(new): Add TSDoc to Coverage class (#6106) 2020-06-29 09:53:28 +01:00
Changhao Han
adeffbaac1
docs(new): migrate Page.ts to TSDoc (part 0 / 2) (#6104)
* docs(new): migrate Page.ts to TSDoc (part 0 / 2)

Co-authored-by: Changhao Han <changhaohan@chromium.org>
2020-06-26 09:24:56 +02:00
Mathias Bynens
df96f16921
docs(new): migrate JSHandle docs to TSDoc (#6102) 2020-06-25 15:49:35 +01:00
Jack Franklin
46fc6ca41a
feat(types): improve typing of .evaluate() (#6096)
* feat(types): improve typing of `.evaluate()`

This is the start of the work to take the types from the
`@types/puppeteer` repository and port them into our repo so we can ship
our built-in types out the box.

This change types the `evaluate` function properly. It takes a generic
type which is the type of the function you're passing, and the arguments
and the return that you get back from the `evaluate` call are typed
correctly.
2020-06-25 13:38:01 +01:00
Jack Franklin
5b6d2bfb0e docs(new): add TSDoc comments to Keyboard (#6099)
Co-authored-by: Tim van der Lippe <tvanderlippe@google.com>
2020-06-25 13:01:46 +02:00
Changhao Han
4696f7abda docs(new): migrate HTTPResponse docs to TSDoc (#6085)
Co-authored-by: Changhao Han <changhaohan@chromium.org>
2020-06-25 13:01:46 +02:00
Jack Franklin
48c5a8ed01 docs(new): add TSDoc comments to Puppeteer (#6032) (#6094)
Co-authored-by: Martin Splitt <mr.avgp@googlemail.com>
2020-06-25 13:01:46 +02:00
Martin Splitt
f1f7339a3b docs(new): add TSDoc comments to Puppeteer (#6032) 2020-06-25 13:01:46 +02:00
Martin Splitt
a46c78fc91 docs(new): Adds TSDoc to Tracing class (#6088)
* Adds tsdoc to Tracing class

* Updates tsdocs

Co-authored-by: martinsplitt <martin@geekonaut.de>
2020-06-25 13:01:46 +02:00
Martin Splitt
60904da4cd docs(new): migrate FileChooser docs to TSDoc (#6092)
Co-authored-by: martinsplitt <martin@geekonaut.de>
2020-06-25 13:01:36 +02:00
Martin Splitt
f481922175 docs(new): Adds TSDoc to Mouse class (#6086)
* Adds tsdoc to Mouse class

* Updates puppeteer class tsdoc

* docs(new): add TSDoc comments to BrowserFetcher (#6078)

* Adds tsdoc for Touchscreen (#6087)

Co-authored-by: martinsplitt <martin@geekonaut.de>

* Adds tsdoc to Mouse class

* Fixes tsdoc comment for Mouse class

Co-authored-by: martinsplitt <martin@geekonaut.de>
2020-06-25 13:01:36 +02:00
Martin Splitt
2ad42dc398 docs(new): migrate Touchscreen docs to TSDoc (#6087)
Co-authored-by: martinsplitt <martin@geekonaut.de>
2020-06-25 13:01:12 +02:00
Martin Splitt
73b97956cc
docs(new): add TSDoc comments to BrowserFetcher (#6078) 2020-06-24 09:33:19 +01:00
Jack Franklin
70a900e93b
chore: fix ESLint violation and lessen rule strictness (#6081) 2020-06-23 12:55:42 +01:00
Tim van der Lippe
4659ee8daa docs(new): add TSDoc comments to BrowserContext (#6066) 2020-06-23 07:22:10 +02:00
Peter Marshall
ccae54644c
docs(new): migrate Browser docs to TSDoc (#6070) 2020-06-23 07:19:15 +02:00
Alex Rudenko
6657364364
docs(new): migrate ElementHandle to TSDoc (#6073)
* docs(new): migrate ElementHandle to TSDoc

Co-authored-by: Alex Rudenko <alexrudenko@chromium.org>
2020-06-22 17:21:57 +02:00
Alex Rudenko
7025f1c5ea
docs(new): migrate Target to TSDoc (#6067)
* docs(new): migrate Target to TSDoc

Co-authored-by: Alex Rudenko <alexrudenko@chromium.org>
2020-06-22 14:57:04 +02:00
Paul Lewis
819afbebf7
docs(new): migrate ConsoleMessage docs to TSDoc (#6065) 2020-06-22 13:52:39 +01:00
Alex Rudenko
983a7b67df
docs(new): migrate CDPSession to TSDoc (#6064) 2020-06-22 12:05:10 +02:00
Alex Rudenko
1cf3f06055
docs(new): migrate TimeoutError to TSDoc (#6062)
* docs(new): migrate TimeoutError to TSDoc

Co-authored-by: Alex Rudenko <alexrudenko@chromium.org>
2020-06-22 10:34:57 +02:00
Jack Franklin
ace31d6f58
chore: pin TSDoc related dependencies (#6063)
Without the API-* dependencies pinned different versions may be
installed on local machines vs CI. One of the checks we do is to check
that the checked in docs matches what is generated on CI. Therefore we
need to ensure devs locally run the exact version that CI runs such that
they generate the same output. So in this case we pin to a particular
version of the dependencies.
2020-06-22 09:16:51 +01:00
Jack Franklin
e7b91a7f41
chore: enforce a max line length on comments (#6055) 2020-06-19 15:39:03 +01:00
Mathias Bynens
7978315de7
docs(new): migrate SecurityDetails docs to TSDoc (#6053) 2020-06-19 15:30:28 +02:00
Jack Franklin
ce34c0a4ff
fix: page.goto options type should be optional (#6038)
The TypeScript definition erroneously made `options` required. We can
fix it by providing a default value, which means users calling the
function will be able to leave it blank without TS complaining.

Issues like this are a +1 to porting our tests to TypeScript in order to
catch these on our own test suite, so that's something we should look into.
2020-06-18 12:44:46 +01:00
Martin Splitt
44402b75a0
feat(new-docs): add tsdoc comments to WebWorker (#6029)
* feat(new-docs): add TSDoc comments to `WebWorker`

Co-authored-by: martinsplitt <martin@geekonaut.de>
2020-06-17 16:26:10 +01:00
Jack Franklin
b659969a38
chore: migrate away from Node's EventEmitter (#5979) 2020-06-15 11:52:19 +01:00
Jack Franklin
8a099a0c2c
docs: replace @return with @returns (#6006)
The former is not understood by TSDoc.
2020-06-12 12:38:24 +02:00
Jack Franklin
23f18d8cc0
docs(new): start documenting the Page class (#6001)
This PR starts exploring the Page class and how to best document it. It explores how best to document events in the system, and I think pulling them out into an `enum` is the best solution here. It lets us end up with a page of docs that explicitly lists all the events the page class can ever emit.
2020-06-12 11:10:12 +01:00
Jack Franklin
b86ff21b64
feat(api): add Page.isJavaScriptEnabled + mark properties as private (#5993)
Just one was used externally and I wrapped that up in a method. I think
it's a useful method to provide (I can imagine wanting to know if JS is
enabled on a page) so I think there's no harm here (I'd rather that then
have JSHandle reach into a private variable).
2020-06-10 16:15:02 +01:00
Jack Franklin
ca8b0d685c
feat(new-docs): migrate Dialog documentation to TSDoc (#5981) 2020-06-09 09:19:42 +01:00
Jack Franklin
0b3d52a70e
feat(new-docs): add TSDoc comments to Accessibility (#5971)
* feat(new-docs): add tsdoc to `Accessibility`
2020-06-05 15:20:11 +01:00
Jack Franklin
086c08998b
chore: commit base new-docs (#5973)
This adds the new docs that are generated by API Extractor via TSDoc.
They are sparse because we do not yet use TSDoc in the codebase. This is
the starting point and from here we can work through all the different
classes and improve the documentation.
2020-06-04 15:56:45 +01:00