Skip to content

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
hjdhjd committed Oct 22, 2023
0 parents commit 627a61f
Show file tree
Hide file tree
Showing 22 changed files with 4,255 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"parser": "@typescript-eslint/parser",
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"ignorePatterns": ["dist"],
"rules": {
"quotes": ["warn", "double", {"avoidEscape": true}],
"indent": [
"warn",
2,
{
"SwitchCase": 1
}
],
"linebreak-style": ["warn", "unix"],
"semi": ["warn", "always"],
"comma-dangle": ["error"],
"dot-notation": "warn",
"eqeqeq": "warn",
"curly": ["warn", "all"],
"brace-style": ["warn"],
"prefer-arrow-callback": ["warn"],
"max-len": ["warn", 170],
"no-console": ["warn"],
"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",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-this-alias": "off"
}
}
45 changes: 45 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
name: Support Request
about: Report a bug or request help. Please read the documentation first before creating a support request.
title: ''
assignees: ''

---

<!-- You must use the issue template below. -->
<!-- Please ensure you read the documentation before creating a support request. -->

**Describe The Problem:**
<!-- A clear and concise description of what the issue is. -->

**To Reproduce:**
<!-- Steps to reproduce the behavior. -->

**Logs:**
<!-- In order to be helpful, include the relevant logs from Homebridge, if applicable. -->

```
Show the Homebridge logs here.
Remove any sensitive information.
```

**Homebridge Configuration:**

```json
Show the relevant portion of your homebridge config.json here, if needed.
Remove any sensitive information.
```

**Screenshots:**
<!-- If applicable, add screenshots to help explain your problem. -->

**Environment:**

* **Homebridge Version:** <!-- homebridge -V -->
* **Node Version:** <!-- node -v -->
* **Homebridge-myQ Plugin Version**:
* **Apple Device and iOS / macOS / iPadOS / tvOS Version:**<!-- Type of Apple device you're using and associated OS version -->
* **Operating System and OS Version:** <!-- Raspbian / Ubuntu / Debian / Windows / macOS / Docker -->

<!-- Click the "Preview" tab before you submit to ensure the formatting is correct. -->

5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Homebridge Discord Community
url: https://discord.gg/QXqfHEW
about: Ask your questions in the myq channel.
22 changes: 22 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: Feature Request
about: Suggest an idea for an enhancement.
title: ''
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe:**
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->

**Describe the solution you'd like:**
<!-- A clear and concise description of what you want to happen. -->

**Describe alternatives you've considered:**
<!-- A clear and concise description of any alternative solutions or features you've considered. -->

**Additional context:**
<!-- Add any other context or screenshots about the feature request here. -->

<!-- Click the "Preview" tab before you submit to ensure the formatting is correct. -->
5 changes: 5 additions & 0 deletions .github/auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Merge all dependencies as long within ${TARGET} scope (defined in workflows/dependabot-automerge.yml).
#
- match:
dependency_type: all
update_type: semver:minor
36 changes: 36 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Query daily for npm dependency updates.
#
version: 2

updates:

# Enable version updates for github-actions.
- package-ecosystem: "github-actions"

# Look for ".github/workflows" in the "root" directory.
directory: "/"

# Check for updated GitHub Actions every weekday.
schedule:
interval: "daily"

# Allow up to ten pull requests to be generated at any one time.
open-pull-requests-limit: 0

# Enable version updates for npm.
- package-ecosystem: "npm"

# Look for "package.json" and "package-lock.json" files in the "root" directory.
directory: "/"

# Check the npm registry for updates every weekday.
schedule:
interval: "daily"

# Allow up to ten pull requests to be generated at any one time.
open-pull-requests-limit: 0

# Ignore certain dependency updates.
# ignore:
# Ignore mqtt updates for now due to the breaking change in module management.
# - dependency-name: "mqtt"
80 changes: 80 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Continuous integration - validate builds when commits are made, and publish when releases are created.
#
name: "Continuous Integration"

# Run the build on all push, pull request, and release creation events.
on:
pull_request:
push:
release:
types: [ published ]
workflow_dispatch:

jobs:

# Run a validation build on LTS versions of node.
build:
name: 'Build package'

# Build only if we've received a push, manual workflow dispatch, or release event with a release tag (aka v1.2.3).
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' || (github.event_name == 'release' && startsWith(github.ref, 'refs/tags/v'))

# Create the build matrix for all the environments we're validating against.
strategy:
matrix:
node-version: [ lts/-1, lts/* ]
os: [ ubuntu-latest ]

# Specify the environments we're going to build in.
runs-on: ${{ matrix.os }}

# Execute the build activities.
steps:
- name: Checkout the repository.
uses: actions/checkout@v3

- name: Setup the node ${{ matrix.node-version }} environment.
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Build and install the package with a clean slate.
run: |
npm ci
npm run build --if-present
env:
CI: true

# Publish the release to the NPM registry.
publish-npm:
name: 'Publish package'
needs: build

# Publish only if we've received a release event and the tag starts with "v" (aka v1.2.3).
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/v')

# Specify the environment we're going to build in.
runs-on: ubuntu-latest

# Execute the build and publish activities.
steps:
- name: Checkout the repository.
uses: actions/checkout@v3

- name: Setup the node environment.
uses: actions/setup-node@v3
with:

# Use the oldest node LTS version that we support.
node-version: lts/-1

# Use the NPM registry.
registry-url: 'https://registry.npmjs.org/'

- name: Install the package with a clean slate.
run: npm ci

- name: Publish the package to NPM.
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.npm_token }}
17 changes: 17 additions & 0 deletions .github/workflows/dependabot-automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Automerge dependency updates identified by dependabot.
#
name: Automerge Dependabot Version Updates

on:
pull_request_target:

jobs:
auto-merge:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
steps:
- uses: actions/checkout@v2
- uses: ahmadnassri/action-dependabot-auto-merge@v2
with:
target: minor
github-token: ${{ secrets.UPDATES_TOKEN }}
27 changes: 27 additions & 0 deletions .github/workflows/issue-stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Close stale issues after a defined period of time.
#
name: Close Stale Issues

on:
issues:
types: [reopened]
schedule:
- cron: "*/60 * * * *"

jobs:
stale:
runs-on: ubuntu-latest
steps:
- name: Autoclose stale issues.
uses: actions/stale@v8
with:
days-before-close: 2
days-before-stale: 7
exempt-issue-labels: 'discussion,help wanted,long running'
exempt-pr-labels: 'awaiting-approval,work-in-progress'
remove-stale-when-updated: true
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-label: 'stale'
stale-issue-message: 'This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.'
stale-pr-label: 'stale'
stale-pr-message: 'This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.'
18 changes: 18 additions & 0 deletions .github/workflows/issue-validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Close issues that don't conform to the issue templates.
#
name: Close Non-Conforming Issues

on:
issues:
types: [opened]

jobs:
autoclose:
runs-on: ubuntu-latest
steps:
- name: Autoclose issues that don't follow the issue templates.
uses: roots/[email protected]
with:
issue-close-message: "@${issue.user.login} - this issue is being automatically closed because it does not follow either the feature request or bug report issue template. The issue templates have been designed to help in the troubleshooting (or feature request) process. Please use them and populate it as completely as possible to streamline troubleshooting or feature request discussions."
issue-pattern: "Describe alternatives you've considered|Homebridge-myQ Plugin Version"
repo-token: ${{ secrets.GITHUB_TOKEN }}
27 changes: 27 additions & 0 deletions .github/workflows/lock-threads.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: 'Lock Threads'

on:
schedule:
- cron: '0 1 * * *'

permissions:
issues: write
pull-requests: write

concurrency:
group: lock

jobs:
action:
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
issue-inactive-days: "2"
exclude-any-issue-labels: "discussion"
issue-comment: "This issue is locked to prevent necroposting on closed issues. Please create a new issue for related support requests, bug reports, or feature suggestions."
issue-lock-reason: ""
pr-inactive-days: "7"
pr-comment: "This issue is locked to prevent necroposting on closed issues. Please create a new issue for related discussion, if needed."
pr-lock-reason: ""
Loading

0 comments on commit 627a61f

Please sign in to comment.