Skip to content

Commit c5e34b1

Browse files
s1hofmanndependabot[bot]ahadcove
authored
2.0.0-RC1 (#346)
* Bump tar from 4.4.13 to 4.4.15 Bumps [tar](https://github.com/npm/node-tar) from 4.4.13 to 4.4.15. - [Release notes](https://github.com/npm/node-tar/releases) - [Changelog](https://github.com/npm/node-tar/blob/main/CHANGELOG.md) - [Commits](isaacs/node-tar@v4.4.13...v4.4.15) --- updated-dependencies: - dependency-name: tar dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> * Bump tar from 4.4.13 to 4.4.15 in /e2e/electron-test Bumps [tar](https://github.com/npm/node-tar) from 4.4.13 to 4.4.15. - [Release notes](https://github.com/npm/node-tar/releases) - [Changelog](https://github.com/npm/node-tar/blob/main/CHANGELOG.md) - [Commits](isaacs/node-tar@v4.4.13...v4.4.15) --- updated-dependencies: - dependency-name: tar dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> * Bump path-parse from 1.0.6 to 1.0.7 Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7. - [Release notes](https://github.com/jbgutierrez/path-parse/releases) - [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7) --- updated-dependencies: - dependency-name: path-parse dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> * (#190) Rename private field native to nativeAdapter to stay consistent * (#255) Only run sonar step if SONAR_TOKEN is set * Added link to API docs to README.md * (#260) Added missing lookup for 'delete' key * (#262) Upgraded to Typescript 4.4.2 with minor adjustments * (#265) Upgraded to SonarSource/sonarcloud-github-action v1.6 * Bump tar from 4.4.15 to 4.4.19 in /e2e/electron-test Bumps [tar](https://github.com/npm/node-tar) from 4.4.15 to 4.4.19. - [Release notes](https://github.com/npm/node-tar/releases) - [Changelog](https://github.com/npm/node-tar/blob/main/CHANGELOG.md) - [Commits](isaacs/node-tar@v4.4.15...v4.4.19) --- updated-dependencies: - dependency-name: tar dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> * Revert conditional execution of Sonar reports * (#269) Export some internal objects * (#271) Disable sonarcloud reporting to unstuck cross-platform checks * (#271) Updated dependencies, fix conflicts * (#271) Pin versions for clipboardy * (#271) Move Jest timeout config out of test * (#271) Debug failing AbortController test * (#271) Revert node-abort-controller version bump due to inconsistencies. (Typescript complains on compile time, but after the change it fails on runtime) * (#271) Fixed timeout configs in e2e tests * Added demo video to README.md * (#269) Changed export level and renamed classes to be less ambiguous * (#278) Added grab and grabRegion methods to Screen * (#278) Adjusted captureRegion and grabRegion parameters to accept Promises * (#285) Added additional publish step for GitHub package registry * (#258) Refined wording in snapshot release workflow * Feature/292/provider registry (#293) * (#292) Draft provider registry * (#292) Register ImageWriter and ImageReader instances * Feature/294/export provider interfaces (#295) * (#294) Export interfaces for providers * (#294) Align naming of interfaces * (#296) Add missing export for ImageWriterParameters (#297) * (#301) Exported FilType enum (#302) * Feature/279/separate image matching (#298) * (#279) Remove image matching provider code * (#279) Remove image matching providers from registry * (#279) Update vision adapter test * (#279) Remove opencv4nodejs-prebuilt dependency * (#279) Plugin e2e test * (#279) Init plugin e2e test * (#279) Align e2e package versions * (#279) Fix resource path * (#279) Add error info to output, formatting * (#279) Run plugin test in Docker environment * (#279) Export FileType enum * (#279) Move screen e2e test to plugin e2e test subpackage since it requires the template-matcher package as well * (#279) Move keyboard e2e test to plugin subpackage as well * feat: adding the rest of the function keys (#305) * (#130) Introduce EasingFunction interface (#304) * (#130) Updated implementation * (#130) Easing function refinement * Feature/307/default imagereader imagewriter (#308) * (#307) Add jimp dependencz * (#307) Implement image reader * (#307) Implement image writer * (#307) Test data * (#307) Register both providers * (#307) Stick to BGR color format when loading images * (#307) Expose imagereader and imagewriter through utility functions * (#307) Updated tests to verify calls to Jimp * (#307) Mock jimp in testcases using the pluginRegistry to avoid ReferenceErrors * (#307) Mock jimp in e2e testcases to avoid ReferenceErrors * Maintenance/310/remove adapters (#311) * (#310) Delete both adapters * (#310) Migrate window.function to not use adapters * (#310) Migrated window.class to not use adapters * (#310) Migrated screen.class to not use adapters * (#310) Migrated movement.function to not use adapters * (#310) Migrated mouse.class to not use adapters * (#310) Remove leftover notions of adapters in test description * (#310) Fixed expected format when saving a screenshot to disk * (#310) Migrated keyboard.class to not use adapters * (#310) Migrated clipboard.class to not use adapters * (#310) Migrated assert.class test to not use adapters * (#310) Migrated all exported instances to not use adapters * (#310) Removed mention of adapter from test description * Added sponsors listing to README.md * (#306) Update supported cpus to include Apple Silicon (arm64) * Add https://github.com/stoefln to sponsors listing * Feature/204/screen find image needles (#319) * (#204) Enabled passing of Image data to Screen#find * (#204) Updated screen tests * (#204) Removed plugin test from main repo * (#204) Removed plugin test from Docker test runs * (#204) Introduced additional id property to images * (#204) Adjusted tests and image usage to new id property * (#204) Added helper function to make loading image resources easier * (#204) Adapted toShow matcher to new find parameters * (#204) Re-use loadImageResource function * Feature/320/find accept promise (#322) * (#320) Make find, and the functions re-using it, accept Promise<Image> * (#320) Update toShow matcher accordingly * (#320) Update tests * (#321) Added `findAll` to Screen (#323) * Feature/259/get screen pixel color (#325) * (#259) Introduced ImageProcessor interface * (#259) imageToJimp converter function * (#259) RGBA dataclass * (#259) Implement ImageProcessor and register the new provider * (#259) Re-use imageToJimp and clean up tests * (#259) Fixed import for Image which was previously importing from dist * Maintenance/310/remove adapters (#311) * (#310) Delete both adapters * (#310) Migrate window.function to not use adapters * (#310) Migrated window.class to not use adapters * (#310) Migrated screen.class to not use adapters * (#310) Migrated movement.function to not use adapters * (#310) Migrated mouse.class to not use adapters * (#310) Remove leftover notions of adapters in test description * (#310) Fixed expected format when saving a screenshot to disk * (#310) Migrated keyboard.class to not use adapters * (#310) Migrated clipboard.class to not use adapters * (#310) Migrated assert.class test to not use adapters * (#310) Migrated all exported instances to not use adapters * (#310) Removed mention of adapter from test description * Added sponsors listing to README.md * (#306) Update supported cpus to include Apple Silicon (arm64) * Add https://github.com/stoefln to sponsors listing * Feature/204/screen find image needles (#319) * (#204) Enabled passing of Image data to Screen#find * (#204) Updated screen tests * (#204) Removed plugin test from main repo * (#204) Removed plugin test from Docker test runs * (#204) Introduced additional id property to images * (#204) Adjusted tests and image usage to new id property * (#204) Added helper function to make loading image resources easier * (#204) Adapted toShow matcher to new find parameters * (#204) Re-use loadImageResource function * Feature/320/find accept promise (#322) * (#320) Make find, and the functions re-using it, accept Promise<Image> * (#320) Update toShow matcher accordingly * (#320) Update tests * (#321) Added `findAll` to Screen (#323) * (#259) Add `colorAt` to screen class * (#324) Updated assert to handle valid find parameter types (#326) * Feature/329/find image parameter type (#330) * (#329) Make `Screen#find` only accept `Image` or `Promise<Image>` parameter type * (#329) Update docstrings * (#329) Adjusted tests * (#329) Remove leftover string type checks * (#327) Apply pixel density scaling when querying pixel color information (#332) * (#312) Added new parameter `updateInterval` to `waitFor` to make the interval user configurable (#333) * Feature/233/audio keys (#334) * (#233) Extended key.enum with audio multimedia keys * (#233) Extended Key mapping * Feature/336/colormode conversion (#337) * (#336) Introduced colormode enum * (#336) Extended Image class with color mode conversion methods * (#336) Set color mode on images when reading from disk * (#336) Set colormode on images when grabbing screen content * (#336) Limit switching of channels only to BGR images * (#336) Export ColorMode enum * (#336) Chasing down another async error in tests due to jimp * Update README and docstrings * Fix y offset for tests on macos-latest * Maintenance/341/remove old code (#342) * (#341) Remove Region#scaled * (#341) Remove LocationParameters * Maintenance/340/refine types (#343) * (#340) Refactor the `data` property of `ImageWriterParameters` to `image` * (#340) Refactor `Image#data` to a `Buffer` instead of `any` * (#340) Fixed screen tests * Re-enable sonar step (#344) * Release/v2.0.0 rc1 (#345) * Updated readme * RC1 * Update @nut-tree/libnut to 2.1.3 * Center image in readme again * Fixed typedoc config Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ahad <[email protected]>
1 parent 42ea9d6 commit c5e34b1

File tree

124 files changed

+5817
-7464
lines changed

Some content is hidden

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

124 files changed

+5817
-7464
lines changed

Diff for: .build/pre-release.sh

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
#!/usr/bin/env bash
22
set -ex
33

4-
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
5-
npm whoami
6-
7-
npm ci
84
patchVersion=$(npm --no-git-tag version patch)
95
nextVersion=${patchVersion}-next."$(date +%Y%m%d%H%M%S)"
106
echo "${nextVersion:1}"
117

12-
npm version --no-git-tag -f "${nextVersion:1}"
13-
npm run publish-next
8+
npm version --no-git-tag -f "${nextVersion:1}"

Diff for: .github/workflows/ci.yaml

+3-6
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
npm run coverage:merge
4444
npm run coverage:merge-report
4545
- name: Send results to SonarCloud
46-
uses: SonarSource/sonarcloud-github-action@v1.4
46+
uses: SonarSource/sonarcloud-github-action@v1.6
4747
env:
4848
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4949
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
@@ -53,11 +53,8 @@ jobs:
5353
- sonar
5454
strategy:
5555
matrix:
56-
os: [ ubuntu-latest, windows-latest, macos-latest ]
57-
node: [ 12, 14, 16 ]
58-
exclude:
59-
- os: ubuntu-latest
60-
node: 14
56+
os: [ windows-latest, macos-latest ]
57+
node: [ 14 ]
6158
runs-on: ${{matrix.os}}
6259
steps:
6360
- name: Set up Git repository

Diff for: .github/workflows/snapshot_release.yaml

+15-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
strategy:
1313
matrix:
1414
os: [ ubuntu-latest, windows-latest, macos-latest ]
15-
node: [ 12, 14, 16 ]
15+
node: [ 14 ]
1616
runs-on: ${{matrix.os}}
1717
steps:
1818
- name: Set up Git repository
@@ -58,9 +58,21 @@ jobs:
5858
uses: actions/setup-node@v2
5959
with:
6060
node-version: 14
61+
registry-url: 'https://registry.npmjs.org'
62+
- name: Install
63+
run: npm ci
6164
- name: Install @nut-tree/libnut@next
6265
run: npm i @nut-tree/libnut@next
63-
- name: Publish snapshot release
66+
- name: Create snapshot release
6467
run: bash ./.build/pre-release.sh
68+
- name: Publish snapshot release to npm
69+
run: npm run publish-next
70+
env:
71+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
72+
- uses: actions/setup-node@v2
73+
with:
74+
registry-url: 'https://npm.pkg.github.com'
75+
- name: Publish snapshot release to GPR
76+
run: npm run publish-next
6577
env:
66-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
78+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Diff for: .github/workflows/tagged_release.yaml

+12-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
strategy:
1010
matrix:
1111
os: [ ubuntu-latest, windows-latest, macos-latest ]
12-
node: [ 12, 14, 16 ]
12+
node: [ 14 ]
1313
runs-on: ${{matrix.os}}
1414
steps:
1515
- name: Set up Git repository
@@ -52,6 +52,7 @@ jobs:
5252
uses: actions/setup-node@v2
5353
with:
5454
node-version: 14
55+
registry-url: 'https://registry.npmjs.org'
5556
- name: Install
5657
run: npm ci
5758
- name: Run typedoc
@@ -62,7 +63,14 @@ jobs:
6263
deploy_key: ${{ secrets.API_DOC_DEPLOY_KEY }}
6364
external_repository: nut-tree/apidoc
6465
publish_dir: ./docs
65-
- name: Publish tagged release
66-
uses: JS-DevTools/npm-publish@v1
66+
- name: Publish tagged release to npm
67+
run: npm publish
68+
env:
69+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
70+
- uses: actions/setup-node@v2
6771
with:
68-
token: ${{ secrets.NPM_TOKEN }}
72+
registry-url: 'https://npm.pkg.github.com'
73+
- name: Publish tagged release to GPR
74+
run: npm publish
75+
env:
76+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Diff for: README.md

+26-105
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,15 @@
55
|Master |![Create tagged release](https://github.com/nut-tree/nut.js/workflows/Create%20tagged%20release/badge.svg)|
66
|Develop|![Create snapshot release](https://github.com/nut-tree/nut.js/workflows/Create%20snapshot%20release/badge.svg)|
77

8-
![Supported node LTS versions](https://img.shields.io/badge/node%40lts-erbium%2C%20fermium-green)
9-
![Supported node versions](https://img.shields.io/badge/node-16.x.x-green)
10-
![Supported Electron versions](https://img.shields.io/badge/electron-8.x.x%20--%2013.x.x-green)
11-
128
[![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)
139
[![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)
1410

1511
[![Downloads per month](https://img.shields.io/npm/dm/@nut-tree/nut-js)](https://www.npmjs.com/package/@nut-tree/nut-js)
1612

17-
<p align="center">
13+
<p style="text-align: center">
1814
Native UI testing / automation with node.js
1915
</p>
2016
<br/>
21-
<p align="center">
22-
<a target="_blank" href="https://github.com/justadudewhohacks/opencv4nodejs">
23-
<img src="https://img.shields.io/badge/Built_with-opencv4nodejs-C86414.svg?style=flat-square" alt="Built with opencv4nodejs" /></a>
24-
</p>
2517

2618
# About
2719

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

29+
# Sponsoring
30+
31+
`nut.js` is developed with community in mind.
32+
33+
A huge **"Thank you!"** goes out to all sponsors who make open source a bit more sustainable!
34+
35+
[<img src="https://avatars.githubusercontent.com/u/17616211?v=4" width="75" alt="Reiss Cashmore" />](https://github.com/Reiss-Cashmore)
36+
[<img src="https://avatars.githubusercontent.com/u/1794527?v=4" width="75" alt="Chet Corcos" />](https://github.com/ccorcos)
37+
[<img src="https://avatars.githubusercontent.com/u/562800?v=4" width="75" alt="Stephan Petzl" />](https://github.com/stoefln)
38+
39+
# Demo
40+
41+
Check out this demo video to get a first impression of what nut.js is capable of.
42+
43+
[![nut.js demo video](https://img.youtube.com/vi/MpIyUJnU_Bk/1.jpg)](https://www.youtube.com/watch?v=MpIyUJnU_Bk)
44+
3745
# Examples
3846

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

49+
# API Docs
50+
51+
nut.js provides [public API documentation](https://nut-tree.github.io/apidoc/) auto-generated by [TypeDoc](https://typedoc.org).
52+
4153
# Discussion
4254

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

6173
- [x] Support for standard US keyboard layout
62-
- [x] Support for German special characters
74+
- [x] Support for multimedia keys
6375

6476
## Mouse
6577

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

7890
## Screen
7991

80-
- [x] findOnScreen
81-
- [x] waitFor
92+
- [x] Find an image on screen
93+
- [x] Find all image occurrences on screen
94+
- [x] Wait for an image to appear on screen
95+
- [x] Retrieve RGBA color information on screen
8296
- [x] Hooks to trigger actions based on images
8397
- [x] Highlighting screen regions
8498

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

202216
**Attention**: While snapshot releases are great to work with upcoming features before a new stable release, it is still a snapshot release.
203217
Please bear in mind that things might change and / or break on snapshot releases, so it is not recommended using them in production.
204-
205-
### Usage with Electron
206-
207-
`nut.js` in combination with Electron requires bindings built for use with Electron.
208-
`nut.js` does provide such bindings and e.g. [electron-rebuild](https://www.npmjs.com/package/electron-rebuild) makes installation a breeze.
209-
210-
Besides installing `nut.js` via
211-
212-
```bash
213-
npm i @nut-tree/nut-js
214-
```
215-
216-
or
217-
218-
```bash
219-
yarn add @nut-tree/nut-js
220-
```
221-
222-
we also install `electron-rebuild` as a `devDependency`:
223-
224-
```bash
225-
npm i -D electron-rebuild
226-
```
227-
228-
or
229-
230-
```bash
231-
yarn add -D electron-rebuild
232-
```
233-
234-
Next, we add a `rebuild` script to our `package.json`:
235-
236-
```json
237-
{
238-
...
239-
"scripts": {
240-
...
241-
"start": "electron app.js",
242-
"rebuild": "electron-rebuild"
243-
},
244-
...,
245-
}
246-
```
247-
248-
Now all we have to do is run `npm run rebuild` and `electron-rebuild` will fetch the appropriate bindings for our Electron version.
249-
Currently `nut.js` provides bindings for all ABI version to work with Electron v4.x up to 8.x
250-
251-
### Manual build
252-
253-
As a fallback, `nut.js` is able to build all required dependencies by itself.
254-
To do so, some setup is required on the respective target platform.
255-
256-
#### Windows
257-
258-
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.
259-
You can either set them up manually, or install them via npm:
260-
261-
```bash
262-
npm install --global windows-build-tools
263-
```
264-
265-
or
266-
267-
```bash
268-
yarn global add windows-build-tools
269-
```
270-
271-
#### macOS
272-
273-
On macOS, Xcode command line tools are required.
274-
You can install them by running
275-
```bash
276-
xcode-select --install
277-
```
278-
279-
#### Linux
280-
281-
Depending on your distribution, Linux setups may differ.
282-
283-
In general, `nut.js` requires
284-
285-
- Python 2
286-
- g++
287-
- make
288-
- libXtst
289-
- libPng
290-
291-
Installation on `*buntu` distributions:
292-
```bash
293-
sudo apt-get install build-essential python libxtst-dev libpng++-dev
294-
```
295-
296-
Setups on other distributions might differ.

Diff for: e2e/assets/checkers.png

1.58 KB
Loading

0 commit comments

Comments
 (0)