Skip to content
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

Refactored adapter, Node-RED 3.1.x, added nodes, fixed issues #407

Merged
merged 34 commits into from
Nov 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
94f5c3b
Updated dependencies
klein0r Nov 16, 2023
d92bb25
Node-RED 3.1.0 settings
klein0r Nov 16, 2023
555de47
ES6 class
klein0r Nov 16, 2023
a9bcffa
Class properties
klein0r Nov 16, 2023
876f0b2
eslint
klein0r Nov 16, 2023
fbed559
eslint
klein0r Nov 16, 2023
e8ab4f9
Tests
klein0r Nov 16, 2023
f368c23
Test and Release workflow update
klein0r Nov 16, 2023
57cd09f
Meta data
klein0r Nov 16, 2023
1923cb4
Removed deprecated settings from io-package
klein0r Nov 16, 2023
b9b2881
Updated logo
klein0r Nov 16, 2023
2535282
lint
klein0r Nov 16, 2023
5da552c
Updated ioBroker icon of nodes
klein0r Nov 16, 2023
89f887c
Admin 5/6 JSON config for instance configuration
klein0r Nov 16, 2023
7bb49b8
Moved npmLibs to native
klein0r Nov 16, 2023
521374a
Translations
klein0r Nov 16, 2023
b81768b
Indentation 4 spaces
klein0r Nov 16, 2023
bc22c68
Documentation structure
klein0r Nov 16, 2023
faece31
Revert "Updated ioBroker icon of nodes"
klein0r Nov 16, 2023
7072e48
Updated iobroker logo in flows
klein0r Nov 16, 2023
04bc33a
Added sendTo node with callback - fixes #291
klein0r Nov 16, 2023
d089a93
Allow to override command and instance via msg object
klein0r Nov 16, 2023
1bf396a
ioBroker sendTo
klein0r Nov 17, 2023
f306bba
Allow custom attribute name for "ioBroker in" node - fixes #384
klein0r Nov 17, 2023
ef488ca
Added upgrade message to io-package
klein0r Nov 17, 2023
a7fc6ec
Documentation
klein0r Nov 17, 2023
5d23088
Passwords should not be visible
klein0r Nov 17, 2023
367b818
Added option to select editor (monaco, ace) - fixes #332
klein0r Nov 17, 2023
ca6a05c
Added table for custom env vars to instance configuration - fixes #323
klein0r Nov 17, 2023
a56cbf0
NodeJS 16.4.x
klein0r Nov 17, 2023
74460e9
Re-added Weblate badge
klein0r Nov 17, 2023
c5254dd
'send' is not defined no-undef
klein0r Nov 17, 2023
f9596ba
Change loglevel of regex - fixes #389
klein0r Nov 17, 2023
f998320
Translations
klein0r Nov 18, 2023
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
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
**/.eslintrc.js
admin/words.js
public/
admin/bcrypt.min.js
settings.js
42 changes: 42 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"root": true,
"env": {
"es6": true,
"node": true,
"mocha": true
},
"extends": [
"eslint:recommended"
],
"rules": {
"indent": [
"error",
4,
{
"SwitchCase": 1
}
],
"no-console": "off",
"no-var": "error",
"no-trailing-spaces": "error",
"prefer-const": "error",
"quotes": [
"error",
"single",
{
"avoidEscape": true,
"allowTemplateLiterals": true
}
],
"semi": [
"error",
"always"
]
},
"parserOptions": {
"ecmaVersion": 2020,
"ecmaFeatures": {
"jsx": true
}
}
}
126 changes: 28 additions & 98 deletions .github/workflows/test-and-release.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
# This is a composition of lint and test scripts
# Make sure to update this file along with the others

name: Test and Release

# Run this job on all pushes and pull requests
# as well as tags with a semantic version
on:
push:
branches:
- '*'
- "master"
tags:
# normal versions
- "v?[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+"
# pre-releases
- "v?[0-9]+.[0-9]+.[0-9]+-**"
- "v[0-9]+.[0-9]+.[0-9]+-**"
pull_request: {}

# Cancel previous PR/branch runs when a new commit is pushed
Expand All @@ -28,119 +25,52 @@ jobs:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [14.x]

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
- uses: ioBroker/testing-action-check@v1
with:
node-version: ${{ matrix.node-version }}

node-version: '18.x'
lint: true
lint-command: 'npm run lint .'

- name: Install Dependencies
run: npm i

# - name: Perform a type check
# run: npm run check:ts
# env:
# CI: true
# - name: Lint TypeScript code
# run: npm run lint
# - name: Test package files
# run: npm run test:package

# Runs adapter tests on all supported node versions and OSes
adapter-tests:
if: contains(github.event.head_commit.message, '[skip ci]') == false

needs: [check-and-lint]

runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
node-version: [16.x, 18.x, 20.x]
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
- uses: ioBroker/testing-action-adapter@v1
with:
node-version: ${{ matrix.node-version }}
os: ${{ matrix.os }}
extra-tests: npm run test:js

- name: Install Dependencies
run: npm i

- name: Run local tests
run: npm test
# - name: Run unit tests
# run: npm run test:unit
# - name: Run integration tests # (linux/osx)
# if: startsWith(runner.OS, 'windows') == false
# run: DEBUG=testing:* npm run test:integration
# - name: Run integration tests # (windows)
# if: startsWith(runner.OS, 'windows')
# run: set DEBUG=testing:* & npm run test:integration

# Deploys the final package to NPM
deploy:
needs: [adapter-tests]
needs: [check-and-lint, adapter-tests]

# Trigger this step only when a commit on master is tagged with a version number
if: |
contains(github.event.head_commit.message, '[skip ci]') == false &&
github.event_name == 'push' &&
startsWith(github.ref, 'refs/tags/')
startsWith(github.ref, 'refs/tags/v')

runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Extract the version and commit body from the tag
id: extract_release
# The body may be multiline, therefore we need to escape some characters
run: |
VERSION="${{ github.ref }}"
VERSION=${VERSION##*/}
VERSION=${VERSION##*v}
echo "::set-output name=VERSION::$VERSION"
BODY=$(git show -s --format=%b)
BODY="${BODY//'%'/'%25'}"
BODY="${BODY//$'\n'/'%0A'}"
BODY="${BODY//$'\r'/'%0D'}"
echo "::set-output name=BODY::$BODY"

- name: Install Dependencies
run: npm i

# - name: Create a clean build
# run: npm run build
- name: Publish package to npm
run: |
npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
npm whoami
npm publish

- name: Create Github Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: ioBroker/testing-action-deploy@v1
with:
tag_name: ${{ github.ref }}
release_name: Release v${{ steps.extract_release.outputs.VERSION }}
draft: false
# Prerelease versions create prereleases on Github
prerelease: ${{ contains(steps.extract_release.outputs.VERSION, '-') }}
body: ${{ steps.extract_release.outputs.BODY }}
node-version: '18.x'
npm-token: ${{ secrets.NPM_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}

# When using Sentry for error reporting, Sentry can be informed about new releases
# To enable create a API-Token in Sentry (User settings, API keys)
# Enter this token as a GitHub secret (with name SENTRY_AUTH_TOKEN) in the repository options
# Then uncomment and customize the following block:
# sentry-token: ${{ secrets.SENTRY_AUTH_TOKEN }}
# sentry-project: "iobroker-node-red"
# sentry-version-prefix: "iobroker.node-red"
# If your sentry project is linked to a GitHub repository, you can enable the following option
# sentry-github-integration: true
21 changes: 15 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
# No dot-directories except github/vscode
.*/
!.vscode/
!.github/

*.code-workspace
node_modules
.idea
tmp
nbproject

# npm package files
iobroker.*.tgz

Thumbs.db

# i18n intermediate files
admin/i18n/flat.txt
admin/i18n/*/flat.txt
iob_npm.done
/userdata
/package-lock.json
admin/i18n/*/flat.txt
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["dbaeumer.vscode-eslint"]
}
19 changes: 19 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"eslint.enable": true,
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"json.schemas": [
{
"fileMatch": ["io-package.json"],
"url": "https://raw.githubusercontent.com/ioBroker/ioBroker.js-controller/master/schemas/io-package.json"
},
{
"fileMatch": [
"admin/jsonConfig.json",
"admin/jsonCustom.json",
"admin/jsonTab.json"
],
"url": "https://raw.githubusercontent.com/ioBroker/adapter-react-v5/main/schemas/jsonConfig.json"
}
]
}
1 change: 1 addition & 0 deletions CHANGELOG_OLD.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Older changes
Loading
Loading