Skip to content

Commit cadc0d4

Browse files
committed
Update to typpescript
1 parent 6b4d582 commit cadc0d4

Some content is hidden

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

54 files changed

+4989
-12881
lines changed

.create-adapter.json

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"cli": true,
3+
"target": "directory",
4+
"adapterName": "google-spreadsheet",
5+
"title": "Google Spreadsheet",
6+
"description": "Append data to google spreadsheets",
7+
"keywords": [
8+
"google",
9+
"spreadsheet"
10+
],
11+
"expert": "yes",
12+
"features": [
13+
"adapter"
14+
],
15+
"adminFeatures": [],
16+
"type": "storage",
17+
"startMode": "daemon",
18+
"connectionType": "cloud",
19+
"dataSource": "push",
20+
"connectionIndicator": "no",
21+
"language": "TypeScript",
22+
"nodeVersion": "14",
23+
"adminUi": "html",
24+
"tools": [
25+
"ESLint",
26+
"devcontainer"
27+
],
28+
"i18n": "JSON",
29+
"releaseScript": "yes",
30+
"devServer": "yes",
31+
"devServerPort": 8081,
32+
"indentation": "Space (4)",
33+
"quotes": "double",
34+
"es6class": "yes",
35+
"authorName": "Thomas Pohl",
36+
"authorGithub": "ThomasPohl",
37+
"authorEmail": "[email protected]",
38+
"gitRemoteProtocol": "HTTPS",
39+
"gitCommit": "no",
40+
"defaultBranch": "main",
41+
"license": "Apache License 2.0",
42+
"dependabot": "yes",
43+
"creatorVersion": "2.4.0"
44+
}

.devcontainer/docker-compose.yml

+36-10
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,39 @@
11
version: '3'
22

33
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
4+
iobroker:
5+
build: ./iobroker
6+
container_name: iobroker-google-spreadsheet
7+
hostname: iobroker-google-spreadsheet
8+
# This port is only internal, so we can work on this while another instance of ioBroker is running on the host
9+
expose:
10+
- 8081
11+
volumes:
12+
- ..:/workspace:cached
13+
- iobrokerdata-google-spreadsheet:/opt/iobroker
14+
environment:
15+
- LANG=en_US.UTF-8
16+
- LANGUAGE=en_US:en
17+
- LC_ALL=en_US.UTF-8
18+
- TZ=Europe/Berlin
19+
- SETGID=1000
20+
ports:
21+
- 8081:8081
22+
23+
# Reverse proxy to load up-to-date admin sources from the repo
24+
nginx:
25+
image: nginx:latest
26+
depends_on:
27+
- iobroker
28+
links:
29+
- iobroker
30+
container_name: nginx-google-spreadsheet
31+
volumes:
32+
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
33+
- ..:/workspace:cached
34+
ports:
35+
# Make the ioBroker admin available under http://localhost:8082
36+
- 8082:80
37+
38+
volumes:
39+
iobrokerdata-google-spreadsheet:

.devcontainer/iobroker/Dockerfile

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

.eslintignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
build/
2+
**/.eslintrc.js

.eslintrc.js

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
module.exports = {
2+
root: true, // Don't look outside this project for inherited configs
3+
parser: "@typescript-eslint/parser", // Specifies the ESLint parser
4+
parserOptions: {
5+
ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features
6+
sourceType: "module", // Allows for the use of imports
7+
project: "./tsconfig.json",
8+
},
9+
extends: [
10+
"plugin:@typescript-eslint/recommended", // Uses the recommended rules from the @typescript-eslint/eslint-plugin
11+
],
12+
plugins: [],
13+
rules: {
14+
"indent": "off",
15+
"@typescript-eslint/indent": [
16+
"error",
17+
4,
18+
{
19+
"SwitchCase": 1
20+
}
21+
],
22+
"quotes": [
23+
"error",
24+
"double",
25+
{
26+
"avoidEscape": true,
27+
"allowTemplateLiterals": true
28+
}
29+
],
30+
"@typescript-eslint/no-parameter-properties": "off",
31+
"@typescript-eslint/no-explicit-any": "off",
32+
"@typescript-eslint/no-use-before-define": [
33+
"error",
34+
{
35+
functions: false,
36+
typedefs: false,
37+
classes: false,
38+
},
39+
],
40+
"@typescript-eslint/no-unused-vars": [
41+
"error",
42+
{
43+
ignoreRestSiblings: true,
44+
argsIgnorePattern: "^_",
45+
},
46+
],
47+
"@typescript-eslint/explicit-function-return-type": [
48+
"warn",
49+
{
50+
allowExpressions: true,
51+
allowTypedFunctionExpressions: true,
52+
},
53+
],
54+
"@typescript-eslint/no-object-literal-type-assertion": "off",
55+
"@typescript-eslint/interface-name-prefix": "off",
56+
"@typescript-eslint/no-non-null-assertion": "off", // This is necessary for Map.has()/get()!
57+
"no-var": "error",
58+
"prefer-const": "error",
59+
"no-trailing-spaces": "error",
60+
},
61+
overrides: [
62+
{
63+
files: ["*.test.ts"],
64+
rules: {
65+
"@typescript-eslint/explicit-function-return-type": "off",
66+
},
67+
},
68+
],
69+
};

.github/auto-merge.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Configure here which dependency updates should be merged automatically.
2+
# The recommended configuration is the following:
3+
- match:
4+
# Only merge patches for production dependencies
5+
dependency_type: production
6+
update_type: "semver:patch"
7+
- match:
8+
# Except for security fixes, here we allow minor patches
9+
dependency_type: production
10+
update_type: "security:minor"
11+
- match:
12+
# and development dependencies can have a minor update, too
13+
dependency_type: development
14+
update_type: "semver:minor"
15+
16+
# The syntax is based on the legacy dependabot v1 automerged_updates syntax, see:
17+
# https://dependabot.com/docs/config-file/#automerged_updates

.github/dependabot.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: npm
4+
directory: "/"
5+
schedule:
6+
interval: monthly
7+
time: "04:00"
8+
timezone: Europe/Berlin
9+
open-pull-requests-limit: 5
10+
assignees:
11+
- ThomasPohl
12+
versioning-strategy: increase
13+
14+
- package-ecosystem: github-actions
15+
directory: "/"
16+
schedule:
17+
interval: monthly
18+
time: "04:00"
19+
timezone: Europe/Berlin
20+
open-pull-requests-limit: 5
21+
assignees:
22+
- ThomasPohl
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Automatically merge Dependabot PRs when version comparison is within the range
2+
# that is configured in .github/auto-merge.yml
3+
4+
name: Auto-Merge Dependabot PRs
5+
6+
on:
7+
# WARNING: This needs to be run in the PR base, DO NOT build untrusted code in this action
8+
# details under https://github.blog/changelog/2021-02-19-github-actions-workflows-triggered-by-dependabot-prs-will-run-with-read-only-permissions/
9+
pull_request_target:
10+
11+
jobs:
12+
auto-merge:
13+
if: github.actor == 'dependabot[bot]'
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v2
18+
19+
- name: Check if PR should be auto-merged
20+
uses: ahmadnassri/action-dependabot-auto-merge@v2
21+
with:
22+
# In order to use this, you need to go to https://github.com/settings/tokens and
23+
# create a Personal Access Token with the permission "public_repo".
24+
# Enter this token in your repository settings under "Secrets" and name it AUTO_MERGE_TOKEN
25+
github-token: ${{ secrets.AUTO_MERGE_TOKEN }}
26+
# By default, squash and merge, so Github chooses nice commit messages
27+
command: squash and merge

0 commit comments

Comments
 (0)