Skip to content

Commit

Permalink
Merges Homebridge plugin template into this project as a base for dev…
Browse files Browse the repository at this point in the history
…elopment
  • Loading branch information
mkormendy committed Aug 9, 2020
1 parent 8cc41de commit 33aad3c
Show file tree
Hide file tree
Showing 19 changed files with 3,728 additions and 46 deletions.
36 changes: 36 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"parser": "@typescript-eslint/parser",
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended" // uses the recommended rules from the @typescript-eslint/eslint-plugin
],
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
},
"ignorePatterns": [
"dist"
],
"rules": {
"quotes": ["warn", "single"],
"indent": ["warn", 2, { "SwitchCase": 1 }],
"linebreak-style": ["warn", "unix"],
"semi": ["warn", "always"],
"comma-dangle": ["warn", "always-multiline"],
"dot-notation": "off",
"eqeqeq": "warn",
"curly": ["warn", "all"],
"brace-style": ["warn"],
"prefer-arrow-callback": ["warn"],
"max-len": ["warn", 140],
"no-console": ["off"], // use the provided Homebridge log method instead and set this to warn
"no-non-null-assertion": ["off"],
"comma-spacing": ["error"],
"no-multi-spaces": ["off", { "ignoreEOLComments": true }],
"lines-between-class-members": ["warn", "always", {"exceptAfterSingleLine": true}],
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/explicit-module-boundary-types": "off"
}
}
31 changes: 31 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build and Lint

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
# the Node.js versions to build on
node-version: [10.x, 12.x, 13.x]

steps:
- uses: actions/checkout@v2

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

- name: Install dependencies
run: npm install

- name: Lint the project
run: npm run lint

- name: Build the project
run: npm run build
env:
CI: true
21 changes: 20 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Ignore compiled code
dist

# ------------- Defaults ------------- #

# Logs
logs
*.log
Expand Down Expand Up @@ -41,6 +46,9 @@ build/Release
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript v1 declaration files
typings/

Expand Down Expand Up @@ -74,6 +82,7 @@ typings/

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
Expand All @@ -84,7 +93,7 @@ dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

Expand All @@ -102,3 +111,13 @@ dist

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2

.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.pnp.*
133 changes: 133 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
# Ignore source code
src

# ------------- Defaults ------------- #

# eslint
.eslintrc

# typescript
tsconfig.json

# vscode
.vscode
.code-workspace

# nodemon
nodemon.json

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2

.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.pnp.*
5 changes: 5 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"recommendations": [
"dbaeumer.vscode-eslint"
]
}
29 changes: 29 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch via NPM",
"type": "node",
"request": "launch",
"cwd": "${workspaceRoot}",
"runtimeExecutable": "npm",
"runtimeArgs": [
"run", "debug"
],
"console": "internalConsole",
"internalConsoleOptions": "neverOpen",
"outputCapture": "console",
"program": "${workspaceFolder}/src/index.js",
"skipFiles": [
"<node_internals>/**"
],
"autoAttachChildProcesses": true,
"outFiles": [
"${workspaceFolder}/dist/**.js"
]
}
]
}
8 changes: 8 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"files.eol": "\n",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"editor.rulers": [ 140 ],
"eslint.enable": true
}
29 changes: 0 additions & 29 deletions Discovery.ts

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"primaryphone": "555-555-5555",
"secondaryphone": "555-555-5555"
}
]
],
"logLevel": 1
}
```
Expand Down
16 changes: 16 additions & 0 deletions config.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"pluginAlias": "konnected",
"pluginType": "platform",
"singular": true,
"schema": {
"type": "object",
"properties": {
"name": {
"title": "Name",
"type": "string",
"required": true,
"default": "Example Dynamic Platform"
}
}
}
}
7 changes: 7 additions & 0 deletions homebridge-konnected.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"folders": [
{
"path": "."
}
]
}
10 changes: 10 additions & 0 deletions nodemon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"watch": [
"src",
"config.schema.json"
],
"ext": "ts",
"ignore": [],
"exec": "tsc && homebridge -I -D",
"signal": "SIGTERM"
}
Loading

0 comments on commit 33aad3c

Please sign in to comment.