Skip to content

Commit

Permalink
docs: update
Browse files Browse the repository at this point in the history
  • Loading branch information
stoffeastrom committed Jun 27, 2018
1 parent 4ccb938 commit 652c9c8
Show file tree
Hide file tree
Showing 4 changed files with 142 additions and 2 deletions.
134 changes: 134 additions & 0 deletions docs/development.md
@@ -0,0 +1,134 @@
---
id: development
title: Development
---

* [Getting started](#getting-started)
* [Clone](#clone)
* [Installation](#installation)
* [Testing](#testing)
* [Debugging](#debugging)
* [Debugging with Chrome](#debugging-with-chrome)
* [Testing local changes](#testing-local-changes)

## Getting started

### Clone

```sh
git clone git@github.com:qlik-oss/after-work.js.git
```

### Installation

Go into the cloned folder:

```sh
npm i
```

Since we are using [Lerna](https://lernajs.io/) with hoisting run:

```sh
npm run bootstrap
```

### Testing

Run all tests with:

```sh
npm test
```

This will run all `after-work.js` tests with `after-work.js` itself.

### Debugging

For easy debugging using [vscode](https://code.visualstudio.com/download) just add a `.vscode/launch.json`.

<details><summary>launch.json</summary>
<p>

```json
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "NodeRunner",
"program": "${workspaceRoot}/commands/aw/src/index.js",
"args": [
"-c",
"aw.config.js",
"--glob",
"${file}"
]
},
{
"type": "node",
"request": "launch",
"name": "ChromeRunner",
"program": "${workspaceRoot}/commands/aw/src/index.js",
"args": [
"chrome",
"-c",
"aw.config.js",
"--glob",
"${file}"
]
},
{
"type": "chrome",
"request": "launch",
"name": "ChromeHeadless",
"port": 9222,
"url": "http://localhost:9676/examples/index.html",
"webRoot": "${workspaceFolder}",
"runtimeArgs": [
"--headless",
"--disable-gpu"
]
}
],
"compounds": [
{
"name": "ChromeDebug",
"configurations": [
"ChromeHeadless",
"ChromeRunner"
]
}
]
}

```

</p>
</details>

<br>

Add a breakpoint in any `*.{js,ts}` and hit F5 and off you go...

### Debugging with Chrome

To debug in Chrome just pass:

```sh
npx aw chrome -c aw.config.js --chrome.devtools=true
```

This will ensure to auto open devtools in your Chrome instance and waiting for it to attach.
Add a `debugger` statement in any file and it will break right into it 🚀.

### Testing local changes

`after-work.js` is designed to be run directly without installing it. Just go into the project you want to test and point to your local entry point:

```sh
../after-work.js/commands/aw/src/index.js
```

This will run `after-work.js` with your local changes 💥.
3 changes: 2 additions & 1 deletion docs/protractor.md
Expand Up @@ -10,7 +10,8 @@ If you are using protractor for running test the configuration has to be accordi
## Override default configs

aw.config.js
```

```js
'use strict';

const path = require('path');
Expand Down
4 changes: 3 additions & 1 deletion website/i18n/en.json
Expand Up @@ -5,6 +5,7 @@
"previous": "Previous",
"tagline": "Testing, made simple",
"cdp": "Chrome",
"development": "Development",
"installation": "Installation",
"node": "Node",
"protractor": "Protractor",
Expand All @@ -13,7 +14,8 @@
"Docs": "Docs",
"": "",
"Getting started": "Getting started",
"Commands": "Commands"
"Commands": "Commands",
"Contributing": "Contributing"
},
"pages-strings": {
"Help Translate|recruit community translators for your project": "Help Translate",
Expand Down
3 changes: 3 additions & 0 deletions website/sidebars.json
Expand Up @@ -8,6 +8,9 @@
"node",
"cdp",
"protractor"
],
"Contributing": [
"development"
]
}
}

0 comments on commit 652c9c8

Please sign in to comment.