Skip to content

2.0.0-RC1 #346

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 70 commits into from
Dec 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
7425090
Bump tar from 4.4.13 to 4.4.15
dependabot[bot] Aug 3, 2021
43db328
Bump tar from 4.4.13 to 4.4.15 in /e2e/electron-test
dependabot[bot] Aug 4, 2021
c9c35ef
Bump path-parse from 1.0.6 to 1.0.7
dependabot[bot] Aug 10, 2021
f53d03e
(#190) Rename private field native to nativeAdapter to stay consistent
s1hofmann Aug 13, 2021
0ce6c8b
(#255) Only run sonar step if SONAR_TOKEN is set
s1hofmann Aug 13, 2021
58c5aa1
Merge pull request #256 from nut-tree/feature/255/conditional_sonar
s1hofmann Aug 13, 2021
d41d0be
Merge pull request #257 from nut-tree/feature/190/consistent_naming
s1hofmann Aug 13, 2021
7d9b5a5
Merge pull request #251 from nut-tree/dependabot/npm_and_yarn/tar-4.4.15
s1hofmann Aug 18, 2021
225275a
Merge pull request #253 from nut-tree/dependabot/npm_and_yarn/path-pa…
s1hofmann Aug 18, 2021
20658c7
Merge pull request #252 from nut-tree/dependabot/npm_and_yarn/e2e/ele…
s1hofmann Aug 18, 2021
97ac21d
Added link to API docs to README.md
s1hofmann May 11, 2020
6fe296e
(#260) Added missing lookup for 'delete' key
s1hofmann Aug 30, 2021
0be2917
(#262) Upgraded to Typescript 4.4.2 with minor adjustments
s1hofmann Aug 30, 2021
5033525
Merge pull request #261 from nut-tree/bugfix/260/delete-key-mapping
s1hofmann Aug 30, 2021
6f0c298
(#265) Upgraded to SonarSource/sonarcloud-github-action v1.6
s1hofmann Aug 31, 2021
955d40a
Bump tar from 4.4.15 to 4.4.19 in /e2e/electron-test
dependabot[bot] Sep 1, 2021
1893d2c
Merge pull request #263 from nut-tree/feature/262/typescript-update
s1hofmann Sep 5, 2021
11df5b0
Merge pull request #266 from nut-tree/maintenance/265/update-sonarclo…
s1hofmann Sep 5, 2021
d50833c
Revert conditional execution of Sonar reports
s1hofmann Sep 5, 2021
9312b2e
(#269) Export some internal objects
s1hofmann Sep 5, 2021
224e7e5
Merge pull request #270 from nut-tree/feature/269/internal_objects
s1hofmann Sep 5, 2021
2b79529
(#271) Disable sonarcloud reporting to unstuck cross-platform checks
s1hofmann Sep 5, 2021
f5d532e
(#271) Updated dependencies, fix conflicts
s1hofmann Sep 5, 2021
074d440
(#271) Pin versions for clipboardy
s1hofmann Sep 5, 2021
7bb773a
(#271) Move Jest timeout config out of test
s1hofmann Sep 5, 2021
27fc8ed
(#271) Debug failing AbortController test
s1hofmann Sep 5, 2021
fb8bca7
(#271) Revert node-abort-controller version bump due to inconsistenci…
s1hofmann Sep 5, 2021
e82a49e
Merge pull request #268 from nut-tree/dependabot/npm_and_yarn/e2e/ele…
s1hofmann Sep 5, 2021
7c8c3f5
(#271) Fixed timeout configs in e2e tests
s1hofmann Sep 5, 2021
fc82faf
Merge pull request #272 from nut-tree/maintenance/271/dependency_updates
s1hofmann Sep 5, 2021
bd5468e
Added demo video to README.md
s1hofmann Sep 9, 2021
379da07
(#269) Changed export level and renamed classes to be less ambiguous
s1hofmann Sep 18, 2021
079eca2
Merge pull request #277 from nut-tree/feature/269/internal_objects
s1hofmann Sep 18, 2021
9515ce4
(#278) Added grab and grabRegion methods to Screen
s1hofmann Sep 18, 2021
c17b770
Merge pull request #280 from nut-tree/feature/278/grab_screen
s1hofmann Sep 18, 2021
6de99cb
(#278) Adjusted captureRegion and grabRegion parameters to accept Pro…
s1hofmann Sep 26, 2021
d8b183d
Merge pull request #284 from nut-tree/feature/278/grab_screen
s1hofmann Sep 26, 2021
86df469
(#285) Added additional publish step for GitHub package registry
s1hofmann Sep 27, 2021
a414f6c
Merge pull request #286 from nut-tree/feature/285/github_package_regi…
s1hofmann Sep 27, 2021
4d0ab28
(#258) Refined wording in snapshot release workflow
s1hofmann Sep 27, 2021
d4ca59a
Merge pull request #287 from nut-tree/feature/285/github_package_regi…
s1hofmann Sep 27, 2021
a1fcc65
Feature/292/provider registry (#293)
s1hofmann Oct 25, 2021
7064a15
Feature/294/export provider interfaces (#295)
s1hofmann Oct 25, 2021
ef98e44
(#296) Add missing export for ImageWriterParameters (#297)
s1hofmann Oct 26, 2021
a818d79
(#301) Exported FilType enum (#302)
s1hofmann Oct 27, 2021
6002651
Feature/279/separate image matching (#298)
s1hofmann Oct 28, 2021
faa9ef5
feat: adding the rest of the function keys (#305)
ahadcove Nov 3, 2021
ab84e1d
(#130) Introduce EasingFunction interface (#304)
s1hofmann Nov 4, 2021
1ec9d62
Feature/307/default imagereader imagewriter (#308)
s1hofmann Nov 5, 2021
9786e04
Maintenance/310/remove adapters (#311)
s1hofmann Nov 6, 2021
7e99b8c
Added sponsors listing to README.md
s1hofmann Nov 15, 2021
f9002b0
(#306) Update supported cpus to include Apple Silicon (arm64)
s1hofmann Nov 16, 2021
19744ea
Add https://github.com/stoefln to sponsors listing
s1hofmann Nov 24, 2021
2af703a
Feature/204/screen find image needles (#319)
s1hofmann Nov 26, 2021
5798a84
Feature/320/find accept promise (#322)
s1hofmann Nov 26, 2021
3498963
(#321) Added `findAll` to Screen (#323)
s1hofmann Nov 26, 2021
719f27e
Feature/259/get screen pixel color (#325)
s1hofmann Nov 26, 2021
4de814f
(#324) Updated assert to handle valid find parameter types (#326)
s1hofmann Nov 26, 2021
b61b723
Feature/329/find image parameter type (#330)
s1hofmann Dec 1, 2021
6ab5de6
(#329) Remove leftover string type checks
s1hofmann Dec 3, 2021
4fbc831
(#327) Apply pixel density scaling when querying pixel color informat…
s1hofmann Dec 7, 2021
6ca2a4d
(#312) Added new parameter `updateInterval` to `waitFor` to make the …
s1hofmann Dec 7, 2021
ba5b810
Feature/233/audio keys (#334)
s1hofmann Dec 7, 2021
1ffaef6
Feature/336/colormode conversion (#337)
s1hofmann Dec 10, 2021
8490a3f
Update README and docstrings
s1hofmann Dec 13, 2021
93c455c
Fix y offset for tests on macos-latest
s1hofmann Dec 13, 2021
d76a1b3
Maintenance/341/remove old code (#342)
s1hofmann Dec 14, 2021
a9c9575
Maintenance/340/refine types (#343)
s1hofmann Dec 14, 2021
be5ea87
Re-enable sonar step (#344)
s1hofmann Dec 16, 2021
67f8687
Release/v2.0.0 rc1 (#345)
s1hofmann Dec 17, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions .build/pre-release.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
#!/usr/bin/env bash
set -ex

echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
npm whoami

npm ci
patchVersion=$(npm --no-git-tag version patch)
nextVersion=${patchVersion}-next."$(date +%Y%m%d%H%M%S)"
echo "${nextVersion:1}"

npm version --no-git-tag -f "${nextVersion:1}"
npm run publish-next
npm version --no-git-tag -f "${nextVersion:1}"
9 changes: 3 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
npm run coverage:merge
npm run coverage:merge-report
- name: Send results to SonarCloud
uses: SonarSource/sonarcloud-github-action@v1.4
uses: SonarSource/sonarcloud-github-action@v1.6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
Expand All @@ -53,11 +53,8 @@ jobs:
- sonar
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
node: [ 12, 14, 16 ]
exclude:
- os: ubuntu-latest
node: 14
os: [ windows-latest, macos-latest ]
node: [ 14 ]
runs-on: ${{matrix.os}}
steps:
- name: Set up Git repository
Expand Down
18 changes: 15 additions & 3 deletions .github/workflows/snapshot_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
node: [ 12, 14, 16 ]
node: [ 14 ]
runs-on: ${{matrix.os}}
steps:
- name: Set up Git repository
Expand Down Expand Up @@ -58,9 +58,21 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: 14
registry-url: 'https://registry.npmjs.org'
- name: Install
run: npm ci
- name: Install @nut-tree/libnut@next
run: npm i @nut-tree/libnut@next
- name: Publish snapshot release
- name: Create snapshot release
run: bash ./.build/pre-release.sh
- name: Publish snapshot release to npm
run: npm run publish-next
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- uses: actions/setup-node@v2
with:
registry-url: 'https://npm.pkg.github.com'
- name: Publish snapshot release to GPR
run: npm run publish-next
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16 changes: 12 additions & 4 deletions .github/workflows/tagged_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
node: [ 12, 14, 16 ]
node: [ 14 ]
runs-on: ${{matrix.os}}
steps:
- name: Set up Git repository
Expand Down Expand Up @@ -52,6 +52,7 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: 14
registry-url: 'https://registry.npmjs.org'
- name: Install
run: npm ci
- name: Run typedoc
Expand All @@ -62,7 +63,14 @@ jobs:
deploy_key: ${{ secrets.API_DOC_DEPLOY_KEY }}
external_repository: nut-tree/apidoc
publish_dir: ./docs
- name: Publish tagged release
uses: JS-DevTools/npm-publish@v1
- name: Publish tagged release to npm
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- uses: actions/setup-node@v2
with:
token: ${{ secrets.NPM_TOKEN }}
registry-url: 'https://npm.pkg.github.com'
- name: Publish tagged release to GPR
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
131 changes: 26 additions & 105 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,15 @@
|Master |![Create tagged release](https://github.com/nut-tree/nut.js/workflows/Create%20tagged%20release/badge.svg)|
|Develop|![Create snapshot release](https://github.com/nut-tree/nut.js/workflows/Create%20snapshot%20release/badge.svg)|

![Supported node LTS versions](https://img.shields.io/badge/node%40lts-erbium%2C%20fermium-green)
![Supported node versions](https://img.shields.io/badge/node-16.x.x-green)
![Supported Electron versions](https://img.shields.io/badge/electron-8.x.x%20--%2013.x.x-green)

[![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)

<p align="center">
<p style="text-align: center">
Native UI testing / automation with node.js
</p>
<br/>
<p align="center">
<a target="_blank" href="https://github.com/justadudewhohacks/opencv4nodejs">
<img src="https://img.shields.io/badge/Built_with-opencv4nodejs-C86414.svg?style=flat-square" alt="Built with opencv4nodejs" /></a>
</p>

# About

Expand All @@ -34,10 +26,30 @@ Native UI testing / automation with node.js
It allows for native UI interactions via keyboard and / or mouse,
but additionally gives you the possibility to navigate the screen based on image matching.

# Sponsoring

`nut.js` is developed with community in mind.

A huge **"Thank you!"** goes out to all sponsors who make open source a bit more sustainable!

[<img src="https://avatars.githubusercontent.com/u/17616211?v=4" width="75" alt="Reiss Cashmore" />](https://github.com/Reiss-Cashmore)
[<img src="https://avatars.githubusercontent.com/u/1794527?v=4" width="75" alt="Chet Corcos" />](https://github.com/ccorcos)
[<img src="https://avatars.githubusercontent.com/u/562800?v=4" width="75" alt="Stephan Petzl" />](https://github.com/stoefln)

# Demo

Check out this demo video to get a first impression of what nut.js is capable of.

[![nut.js demo video](https://img.youtube.com/vi/MpIyUJnU_Bk/1.jpg)](https://www.youtube.com/watch?v=MpIyUJnU_Bk)

# Examples

[nut-tree/trailmix](https://github.com/nut-tree/trailmix) contains a set of ready to use examples which demo the usage ot nut.js.

# API Docs

nut.js provides [public API documentation](https://nut-tree.github.io/apidoc/) auto-generated by [TypeDoc](https://typedoc.org).

# Discussion

In [nut-tree/rfc](https://github.com/nut-tree/rfc) documents regarding larger design / implementation changes in nut.js are up for discussion.
Expand All @@ -59,7 +71,7 @@ It's work in progress and will undergo constant modification.
## Keyboard

- [x] Support for standard US keyboard layout
- [x] Support for German special characters
- [x] Support for multimedia keys

## Mouse

Expand All @@ -77,8 +89,10 @@ It's work in progress and will undergo constant modification.

## Screen

- [x] findOnScreen
- [x] waitFor
- [x] Find an image on screen
- [x] Find all image occurrences on screen
- [x] Wait for an image to appear on screen
- [x] Retrieve RGBA color information on screen
- [x] Hooks to trigger actions based on images
- [x] Highlighting screen regions

Expand Down Expand Up @@ -201,96 +215,3 @@ will install the most recent development release of `nut.js`.

**Attention**: While snapshot releases are great to work with upcoming features before a new stable release, it is still a snapshot release.
Please bear in mind that things might change and / or break on snapshot releases, so it is not recommended using them in production.

### Usage with Electron

`nut.js` in combination with Electron requires bindings built for use with Electron.
`nut.js` does provide such bindings and e.g. [electron-rebuild](https://www.npmjs.com/package/electron-rebuild) makes installation a breeze.

Besides installing `nut.js` via

```bash
npm i @nut-tree/nut-js
```

or

```bash
yarn add @nut-tree/nut-js
```

we also install `electron-rebuild` as a `devDependency`:

```bash
npm i -D electron-rebuild
```

or

```bash
yarn add -D electron-rebuild
```

Next, we add a `rebuild` script to our `package.json`:

```json
{
...
"scripts": {
...
"start": "electron app.js",
"rebuild": "electron-rebuild"
},
...,
}
```

Now all we have to do is run `npm run rebuild` and `electron-rebuild` will fetch the appropriate bindings for our Electron version.
Currently `nut.js` provides bindings for all ABI version to work with Electron v4.x up to 8.x

### Manual build

As a fallback, `nut.js` is able to build all required dependencies by itself.
To do so, some setup is required on the respective target platform.

#### Windows

In order to install `nut.js` on Windows, [Windows Build Tools](https://www.microsoft.com/en-us/download/details.aspx?id=48159) and [Python 2](https://www.python.org/downloads/windows/) are required.
You can either set them up manually, or install them via npm:

```bash
npm install --global windows-build-tools
```

or

```bash
yarn global add windows-build-tools
```

#### macOS

On macOS, Xcode command line tools are required.
You can install them by running
```bash
xcode-select --install
```

#### Linux

Depending on your distribution, Linux setups may differ.

In general, `nut.js` requires

- Python 2
- g++
- make
- libXtst
- libPng

Installation on `*buntu` distributions:
```bash
sudo apt-get install build-essential python libxtst-dev libpng++-dev
```

Setups on other distributions might differ.
Binary file added e2e/assets/checkers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading