Skip to content

Commit 9334a89

Browse files
committed
initial commit
1 parent 47ada8a commit 9334a89

32 files changed

+15337
-0
lines changed

.devcontainer/docker-compose.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: '3'
2+
3+
services:
4+
iobroker:
5+
restart: always
6+
build: ./iobroker
7+
container_name: iobroker
8+
hostname: iobroker
9+
ports:
10+
- "8081:8081"
11+
volumes:
12+
- ./iobrokerdata:/opt/iobroker
13+
- ..:/workspace:cached

.devcontainer/iobroker/Dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
FROM buanet/iobroker:latest
2+
RUN ln -s /opt/iobroker/node_modules/ /root/.node_modules

.eslintrc.json

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"env": {
3+
"es6": true,
4+
"node": true,
5+
"mocha": true
6+
},
7+
"extends": "eslint:recommended",
8+
"rules": {
9+
"indent": [
10+
"error",
11+
4,
12+
{
13+
"SwitchCase": 1
14+
}
15+
],
16+
"no-console": "off",
17+
"no-var": "error",
18+
"no-trailing-spaces": "error",
19+
"prefer-const": "error",
20+
"quotes": [
21+
"error",
22+
"single",
23+
{
24+
"avoidEscape": true,
25+
"allowTemplateLiterals": true
26+
}
27+
],
28+
"semi": [
29+
"error",
30+
"always"
31+
]
32+
},
33+
"parserOptions": {
34+
"ecmaVersion": 2018
35+
}
36+
}

.github/ISSUE_TEMPLATE/bug_report.md

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: Bug report
3+
about: Something is not working as it should
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
---
8+
9+
**Describe the bug**
10+
A clear and concise description of what the bug is.
11+
12+
**To Reproduce**
13+
Steps to reproduce the behavior:
14+
1. Go to '...'
15+
2. Click on '...'
16+
3. Scroll down to '....'
17+
4. See error
18+
19+
**Expected behavior**
20+
A clear and concise description of what you expected to happen.
21+
22+
**Screenshots & Logfiles**
23+
If applicable, add screenshots and logfiles to help explain your problem.
24+
25+
**Versions:**
26+
- Adapter version: <adapter-version>
27+
- JS-Controller version: <js-controller-version> <!-- determine this with `iobroker -v` on the console -->
28+
- Node version: <node-version> <!-- determine this with `node -v` on the console -->
29+
- Operating system: <os-name>
30+
31+
**Additional context**
32+
Add any other context about the problem here.
+136
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
name: Test and Release
2+
3+
# Run this job on all pushes and pull requests
4+
# as well as tags with a semantic version
5+
on:
6+
push:
7+
branches:
8+
- "*"
9+
tags:
10+
# normal versions
11+
- "v[0-9]+.[0-9]+.[0-9]+"
12+
# pre-releases
13+
- "v[0-9]+.[0-9]+.[0-9]+-**"
14+
pull_request: {}
15+
16+
jobs:
17+
# Performs quick checks before the expensive test runs
18+
check-and-lint:
19+
if: contains(github.event.head_commit.message, '[skip ci]') == false
20+
21+
runs-on: ubuntu-latest
22+
23+
strategy:
24+
matrix:
25+
node-version: [14.x]
26+
27+
steps:
28+
- name: Checkout code
29+
uses: actions/checkout@v2
30+
31+
- name: Use Node.js ${{ matrix.node-version }}
32+
uses: actions/setup-node@v1
33+
with:
34+
node-version: ${{ matrix.node-version }}
35+
36+
- name: Install Dependencies
37+
run: npm ci
38+
39+
- name: Lint source code
40+
run: npm run lint
41+
- name: Test package files
42+
run: npm run test:package
43+
44+
# Runs adapter tests on all supported node versions and OSes
45+
adapter-tests:
46+
if: contains(github.event.head_commit.message, '[skip ci]') == false
47+
48+
needs: [check-and-lint]
49+
50+
runs-on: ${{ matrix.os }}
51+
strategy:
52+
matrix:
53+
node-version: [10.x, 12.x, 14.x]
54+
os: [ubuntu-latest, windows-latest, macos-latest]
55+
56+
steps:
57+
- name: Checkout code
58+
uses: actions/checkout@v2
59+
60+
- name: Use Node.js ${{ matrix.node-version }}
61+
uses: actions/setup-node@v1
62+
with:
63+
node-version: ${{ matrix.node-version }}
64+
65+
- name: Install Dependencies
66+
run: npm ci
67+
68+
- name: Run unit tests
69+
run: npm run test:unit
70+
71+
- name: Run integration tests (unix only)
72+
if: startsWith(runner.OS, 'windows') == false
73+
run: DEBUG=testing:* npm run test:integration
74+
75+
- name: Run integration tests (windows only)
76+
if: startsWith(runner.OS, 'windows')
77+
run: set DEBUG=testing:* & npm run test:integration
78+
79+
# TODO: To enable automatic npm releases, create a token on npmjs.org
80+
# Enter this token as a GitHub secret (with name NPM_TOKEN) in the repository options
81+
# Then uncomment the following block:
82+
83+
# # Deploys the final package to NPM
84+
# deploy:
85+
# needs: [adapter-tests]
86+
#
87+
# # Trigger this step only when a commit on master is tagged with a version number
88+
# if: |
89+
# contains(github.event.head_commit.message, '[skip ci]') == false &&
90+
# github.event_name == 'push' &&
91+
# github.event.base_ref == 'refs/heads/master' &&
92+
# startsWith(github.ref, 'refs/tags/v')
93+
#
94+
# runs-on: ubuntu-latest
95+
# strategy:
96+
# matrix:
97+
# node-version: [14.x]
98+
#
99+
# steps:
100+
# - name: Checkout code
101+
# uses: actions/checkout@v2
102+
#
103+
# - name: Use Node.js ${{ matrix.node-version }}
104+
# uses: actions/setup-node@v1
105+
# with:
106+
# node-version: ${{ matrix.node-version }}
107+
#
108+
# - name: Extract the version and commit body from the tag
109+
# # The body may be multiline, therefore newlines and % need to be escaped
110+
# run: |
111+
# VERSION="${{ github.ref }}"
112+
# VERSION=${VERSION##*/v}
113+
# echo "::set-env name=VERSION::$VERSION"
114+
# BODY=$(git show -s --format=%b)
115+
# BODY="${BODY//'%'/'%25'}"
116+
# BODY="${BODY//$'\n'/'%0A'}"
117+
# BODY="${BODY//$'\r'/'%0D'}"
118+
# echo "::set-env name=BODY::$BODY"
119+
#
120+
# - name: Publish package to npm
121+
# run: |
122+
# npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
123+
# npm whoami
124+
# npm publish
125+
#
126+
# - name: Create Github Release
127+
# uses: actions/create-release@v1
128+
# env:
129+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
130+
# with:
131+
# tag_name: ${{ github.ref }}
132+
# release_name: Release v${{ env.VERSION }}
133+
# draft: false
134+
# # Prerelease versions create prereleases on Github
135+
# prerelease: ${{ contains(env.VERSION, '-') }}
136+
# body: ${{ env.BODY }}

.gitignore

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
.git
2+
.idea
3+
*.code-workspace
4+
node_modules
5+
nbproject
6+
7+
# npm package files
8+
iobroker.*.tgz
9+
10+
Thumbs.db
11+
12+
# i18n intermediate files
13+
admin/i18n/flat.txt
14+
admin/i18n/*/flat.txt
15+
16+
.vscode
17+
.devcontainer/iobrokerdata

.mocharc.json

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"require": [
3+
"./test/mocha.setup.js"
4+
],
5+
"watch-files": [
6+
"!(node_modules|test)/**/*.test.js",
7+
"*.test.js",
8+
"test/**/test!(PackageFiles|Startup).js"
9+
]
10+
}

.npmignore

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
.git
2+
.idea
3+
node_modules/
4+
nbproject/
5+
.vs*/
6+
*.code-workspace
7+
Thumbs.db
8+
gulpfile.js
9+
10+
# CI test files
11+
test/
12+
travis/
13+
.travis.yml
14+
appveyor.yml
15+
.travis.yaml
16+
appveyor.yaml
17+
18+
# Type checking configuration
19+
tsconfig.json
20+
tsconfig.*.json
21+
22+
# ESLint configuration
23+
.eslintrc.json
24+
.eslintrc.js
25+
26+
# npm package files
27+
iobroker.*.tgz
28+
package-lock.json
29+
30+
# i18n intermediate files
31+
admin/i18n
32+
33+
# maintenance scripts
34+
maintenance/**

0 commit comments

Comments
 (0)