Skip to content

Commit ec04aa6

Browse files
authored
Merge pull request #123 from nut-tree/feature/87/api_docs
Feature/87/api docs
2 parents a26192e + 5b982a8 commit ec04aa6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+470
-381
lines changed

README.md

Lines changed: 70 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# nut.js (Native UI Toolkit) [![Build Status](https://travis-ci.com/nut-tree/nut.js.svg?branch=master)](https://travis-ci.com/nut-tree/nut.js) [![SonarCloud badge](https://sonarcloud.io/api/project_badges/measure?project=nut-tree%3Anut.js&metric=alert_status)](https://sonarcloud.io/dashboard?id=nut-tree%3Anut.js) [![SonarCloud Coverage](https://sonarcloud.io/api/project_badges/measure?project=nut-tree%3Anut.js&metric=coverage)](https://sonarcloud.io/component_measures?id=nut-tree%3Anut.js&metric=coverage) [![Downloads per month](https://img.shields.io/npm/dm/@nut-tree/nut-js)](https://www.npmjs.com/package/@nut-tree/nut-js)
1+
# nut.js (Native UI Toolkit) [![Build Status](https://travis-ci.com/nut-tree/nut.js.svg?branch=master)](https://travis-ci.com/nut-tree/nut.js) [![Build status](https://ci.appveyor.com/api/projects/status/iohwxc5t46gcuvby/branch/master?svg=true)](https://ci.appveyor.com/project/s1hofmann/nut-js/branch/master) [![SonarCloud badge](https://sonarcloud.io/api/project_badges/measure?project=nut-tree%3Anut.js&metric=alert_status)](https://sonarcloud.io/dashboard?id=nut-tree%3Anut.js) [![SonarCloud Coverage](https://sonarcloud.io/api/project_badges/measure?project=nut-tree%3Anut.js&metric=coverage)](https://sonarcloud.io/component_measures?id=nut-tree%3Anut.js&metric=coverage) [![Downloads per month](https://img.shields.io/npm/dm/@nut-tree/nut-js)](https://www.npmjs.com/package/@nut-tree/nut-js)
22
<p align="center">
33
Native UI testing / automation with node.js
44
</p>
@@ -21,7 +21,7 @@ but additionally gives you the possibility to navigate the screen based on image
2121

2222
# Sample
2323

24-
The following snippet shows a valid NUT example (on macOS)
24+
The following snippet shows a valid `nut.js` example (on macOS)
2525

2626
```js
2727
"use strict";
@@ -61,6 +61,7 @@ In order to use these pre-compiled bindings, certain runtime conditions have to
6161
## Prerequisites
6262

6363
This section lists runtime requirements for `nut.js` on the respective target platform.
64+
`nut.js` is built and tested against node 10 and later as well as Electron 4 and later, so in order to use `nut.js` please make sure to use one of these versions.
6465

6566
#### Windows
6667

@@ -155,8 +156,74 @@ or
155156
yarn add @nut-tree/nut-js
156157
```
157158

158-
will install nut.js and its required dependencies.
159+
will install `nut.js` and its required dependencies.
159160

161+
### Snapshot releases
162+
163+
`nut.js` also provides snapshot releases which allows to test upcoming features.
164+
165+
Running
166+
167+
```bash
168+
npm i @nut-tree/nut-js@next
169+
```
170+
171+
or
172+
173+
```bash
174+
yarn add @nut-tree/nut-js@next
175+
```
176+
177+
will install the most recent development release of `nut.js`.
178+
179+
**Attention**: While snapshot releases are great to work with upcoming features before a new stable release, it is still a snapshot release.
180+
Please bear in mind that things might change and / or break on snapshot releases, so it is not recommended using them in production.
181+
182+
### Usage with Electron
183+
184+
`nut.js` in combination with Electron requires bindings built for use with Electron.
185+
`nut.js` does provide such bindings and e.g. [electron-rebuild](https://www.npmjs.com/package/electron-rebuild) makes installation a breeze.
186+
187+
Besides installing `nut.js` via
188+
189+
```bash
190+
npm i @nut-tree/nut-js
191+
```
192+
193+
or
194+
195+
```bash
196+
yarn add @nut-tree/nut-js
197+
```
198+
199+
we also install `electron-rebuild` as a `devDependency`:
200+
201+
```bash
202+
npm i -D electron-rebuild
203+
```
204+
205+
or
206+
207+
```bash
208+
yarn add -D electron-rebuild
209+
```
210+
211+
Next, we add a `rebuild` script to our `package.json`:
212+
213+
```json
214+
{
215+
...
216+
"scripts": {
217+
...
218+
"start": "electron app.js",
219+
"rebuild": "electron-rebuild"
220+
},
221+
...,
222+
}
223+
```
224+
225+
Now all we have to do is run `npm run rebuild` and `electron-rebuild` will fetch the appropriate bindings for our Electron version.
226+
Currently `nut.js` provides bindings for all ABI version to work with Electron v4.x up to 8.x
160227

161228
# Examples
162229

docs/assets/css/main.css

100644100755
File mode changed.

docs/assets/images/icons.png

100644100755
File mode changed.

docs/assets/images/[email protected]

100644100755
File mode changed.

docs/assets/images/widgets.png

100644100755
File mode changed.

docs/assets/images/[email protected]

100644100755
File mode changed.

docs/assets/js/main.js

100644100755
File mode changed.

docs/assets/js/search.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/classes/assert.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ <h3>constructor</h3>
102102
<li class="tsd-description">
103103
<aside class="tsd-sources">
104104
<ul>
105-
<li>Defined in <a href="https://github.com/nut-tree/nut.js/blob/3bcae92/lib/assert.class.ts#L5">assert.class.ts:5</a></li>
105+
<li>Defined in <a href="https://github.com/nut-tree/nut.js/blob/a26192e/lib/assert.class.ts#L5">assert.class.ts:5</a></li>
106106
</ul>
107107
</aside>
108108
<h4 class="tsd-parameters-title">Parameters</h4>
@@ -128,7 +128,7 @@ <h3>is<wbr>Visible</h3>
128128
<li class="tsd-description">
129129
<aside class="tsd-sources">
130130
<ul>
131-
<li>Defined in <a href="https://github.com/nut-tree/nut.js/blob/3bcae92/lib/assert.class.ts#L8">assert.class.ts:8</a></li>
131+
<li>Defined in <a href="https://github.com/nut-tree/nut.js/blob/a26192e/lib/assert.class.ts#L8">assert.class.ts:8</a></li>
132132
</ul>
133133
</aside>
134134
<h4 class="tsd-parameters-title">Parameters</h4>
@@ -157,7 +157,7 @@ <h3>not<wbr>Visible</h3>
157157
<li class="tsd-description">
158158
<aside class="tsd-sources">
159159
<ul>
160-
<li>Defined in <a href="https://github.com/nut-tree/nut.js/blob/3bcae92/lib/assert.class.ts#L25">assert.class.ts:25</a></li>
160+
<li>Defined in <a href="https://github.com/nut-tree/nut.js/blob/a26192e/lib/assert.class.ts#L25">assert.class.ts:25</a></li>
161161
</ul>
162162
</aside>
163163
<h4 class="tsd-parameters-title">Parameters</h4>

docs/classes/bresenham.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ <h3><span class="tsd-flag ts-flagStatic">Static</span> compute</h3>
9595
<li class="tsd-description">
9696
<aside class="tsd-sources">
9797
<ul>
98-
<li>Defined in <a href="https://github.com/nut-tree/nut.js/blob/3bcae92/lib/util/bresenham.class.ts#L4">util/bresenham.class.ts:4</a></li>
98+
<li>Defined in <a href="https://github.com/nut-tree/nut.js/blob/a26192e/lib/util/bresenham.class.ts#L4">util/bresenham.class.ts:4</a></li>
9999
</ul>
100100
</aside>
101101
<h4 class="tsd-parameters-title">Parameters</h4>

0 commit comments

Comments
 (0)