Commit Graph

11 Commits

Author SHA1 Message Date
Andrey Lushnikov
1be7545b70
chore: enhance markdown preprocessor (#3050)
Use preprocessor to make sure all the links in out README.md point
to the last-released version of documentation.

Fixes #3038.
2018-08-08 18:20:20 -07:00
Andrey Lushnikov
9904da262e
chore(doclint): remove old unused table-of-contents generator (#2659)
We no longer use markdown-toc to generate table-of-contents.
2018-06-01 13:59:31 -07:00
Andrey Lushnikov
0820d48f80
chore: link to the latest-released API from the README.md (#2449)
This patch adds a preprocessor command to link to the latest-released
API from the README.md.

Fixes #1923.
2018-04-25 18:18:08 -07:00
Andrey Lushnikov
13a41495aa
chore(doclint): remove SourceFactory (#2447)
SourceFactory was meant to cache Sources so that they could be used
in different preprocessor tasks.

This turned out to be over-engineering. This patch kills the layer.
2018-04-25 18:07:20 -07:00
Andrey Lushnikov
6d19db4df1
chore: enhance preprocessor commands to automate releases. (#2446)
Last release v1.3.0 had an error in the documentation, claiming
it wasn't released.

This patch makes sure we have a little bit of automation in place
to save us from this in future.
2018-04-25 17:11:45 -07:00
Andrey Lushnikov
a467d35a5f chore(doclint): do not attempt to lint non-documentation markdown 2017-11-07 03:33:25 -08:00
Andrey Lushnikov
13e8580a34 Use puppeteer.launch instead of browser constructor (#255)
This patch:
- split browser launching logic from Browser into `lib/Launcher.js`
- introduce `puppeteer` namespace which currently has a single `launch`
  method to start a browser

With this patch, the browser is no longer created with the `new
Browser(..)` command. Instead, it should be "launched" via the
`puppeteer.launch` method:

```js
const puppeteer = require('puppeteer');
puppeteer.launch().then(async browser => {
  ...
});
```

With this approach browser instance lifetime matches the lifetime of
actual browser process. This helps us:
- remove proxy streams, e.g. browser.stderr and browser.stdout
- cleanup browser class and make it possible to connect to remote
  browser
- introduce events on the browser instance, e.g. 'page' event. In case
  of lazy-launching browser, we should've launch browser when an event
  listener is added, which is unneded comlpexity.
2017-08-14 18:08:06 -07:00
Andrey Lushnikov
3ada7e1adb [doclint] Implement simple markdown preprocessor
This patch implements simple markdown preprocessor. The goal
is to generate certain parts of markdown, such as:
- puppeteer version
- chromium revision
- table-of-contents
- copy/paste parts of documentation (for shortcut methods)
2017-07-31 02:06:27 -07:00
Andrey Lushnikov
75a8d7b0c3 [doclint] Prepare doclint for more checks
This patch refactors doclint so that more checks and more generators
could be added.

This patch:
- Introduces 'Source' class, which holds file content in-memory and
  allows it to be updated.
- Introduces 'Message' class - which is a pair of a text and a type.
  Messages could have either 'error' type or 'warning' type.
2017-07-31 00:10:59 -07:00
Andrey Lushnikov
91785d97f3 Add missing LICENSE headers to the source files
This patch:
- adds missing LICENSE headers to the source files
- set's puppeteer version to 0.1.0
- set's repository field in package.json
2017-07-28 01:09:26 -07:00
Andrey Lushnikov
0960dc38d1 Automatically generate table-of-contents for markdown
This patch teaches doclint to regenerate table of contents
automatically whenever it's needed.

This patch:
- splits lint.js into lint.js and cli.js
- teaches cli.js to generate table-of-contents
- removes the test for table-of-contents errors from doclint
- adds a test for doclint failing to parse object destructuring in
  method parameters.
2017-07-21 11:12:05 -07:00