Skip to content

Commit

Permalink
v2.7.0
Browse files Browse the repository at this point in the history
* Convert to ESmodule
* Update dependencies
  • Loading branch information
donavanbecker committed Jan 22, 2025
1 parent 0cbdbab commit 0c5824a
Show file tree
Hide file tree
Showing 58 changed files with 17,498 additions and 11,762 deletions.
Binary file modified .DS_Store
Binary file not shown.
38 changes: 27 additions & 11 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,48 @@
"plugin:@typescript-eslint/recommended" // uses the recommended rules from the @typescript-eslint/eslint-plugin
],
"parserOptions": {
"ecmaVersion": 2018,
"ecmaVersion": 2021,
"sourceType": "module"
},
"ignorePatterns": [
"dist"
],
"ignorePatterns": ["dist", "server"],
"rules": {
"quotes": ["warn", "single"],
"indent": ["warn", 4, { "SwitchCase": 1 }],
"semi": ["off"],
"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],
"max-len": ["warn", 150],
"no-console": ["warn"], // use the provided Homebridge log method instead
"no-non-null-assertion": ["off"],
"comma-spacing": ["error"],
"no-multi-spaces": ["warn", { "ignoreEOLComments": true }],
"lines-between-class-members": ["warn", "always", {"exceptAfterSingleLine": true}],
"no-multi-spaces": [
"warn",
{
"ignoreEOLComments": true
}
],
"no-trailing-spaces": ["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/semi": ["warn"],
"@typescript-eslint/member-delimiter-style": ["warn"]
"@typescript-eslint/no-explicit-any": "off"
}
}
54 changes: 54 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
name: Bug Report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

<!-- You must use the issue template below when submitting a bug -->

**Describe The Bug:**

<!-- A clear and concise description of what the bug is. -->

**To Reproduce:**

<!-- Steps to reproduce the behavior. -->

**Expected behavior:**

<!-- A clear and concise description of what you expected to happen. -->

**Logs:**

<!-- Bug reports that do not contain logs may be closed without warning. -->

```
Show the Homebridge / Homebridge Config UI X logs here.
```

**Homebridge Config:**

```json
{
"example": "Show your homebridge config.json here"
}
```

**Screenshots:**

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

**Environment:**

- **Node.js Version**: <!-- node -v -->
- **NPM Version**: <!-- npm -v -->
- **Homebridge Version**: <!-- homebridge -V -->
- **Homebridge Lutron Plugin Version**:
- **Homebridge Config UI X Version**:
- **Operating System**: Raspbian / Ubuntu / Debian / Windows / macOS / Docker
- **Process Supervisor**: Docker / Systemd / init.d / pm2 / launchctl / hb-service / other / none

<!-- Click the "Preview" tab before you submit to ensure the formatting is correct. -->
17 changes: 17 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: 'npm' # See documentation for possible values
directory: '/' # Location of package manifests
target-branch: 'beta-*.*.*'
schedule:
interval: 'daily'
- package-ecosystem: 'github-actions' # See documentation for possible values
directory: '/' # Location of package manifests
target-branch: 'beta-*.*.*'
schedule:
interval: 'daily'
38 changes: 38 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Add 'branding' label to any changes within 'docs' folder or any subfolders
branding:
- changed-files:
- any-glob-to-any-file: branding/**

# Add 'docs' label to any change to .md files within the entire repository
docs:
- changed-files:
- any-glob-to-any-file: '**/*.md'

# Add 'enhancement' label to any change to src files within the source dir EXCEPT for the docs sub-folder
enhancement:
- changed-files:
- any-glob-to-any-file: 'src/**/*'
- any-glob-to-any-file: 'config.schema.json'

# Add 'dependencies' label to any change to src files within the source dir EXCEPT for the docs sub-folder
dependencies:
- changed-files:
- any-glob-to-any-file: 'package.json'
- any-glob-to-any-file: 'package-lock.json'

# Add 'beta' label to any PR that is opened against the `beta` branch
beta:
- base-branch: 'beta*'

# Add 'alpha' label to any PR that is opened against the `alpha` branch
alpha:
- base-branch: 'alpha*'

# Add 'latest' label to any PR that is opened against the `latest` branch
latest:
- base-branch: 'latest'

# Add 'workflow' to any changes within 'workflow' folder or any subfolders
workflow:
- changed-files:
- any-glob-to-any-file: .github/**
55 changes: 55 additions & 0 deletions .github/workflows/beta-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Beta Release

on:
push:
branches: [beta-*.*.*, beta]
workflow_dispatch:

jobs:
build_and_test:
uses: homebridge/.github/.github/workflows/nodejs-build-and-test.yml@latest
with:
enable_coverage: false
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
lint:
needs: build_and_test
uses: homebridge/.github/.github/workflows/eslint.yml@latest

publish:
needs: lint
if: ${{ github.repository == 'thenewwazoo/homebridge-lutron-caseta-leap' }}
permissions:
id-token: write
uses: homebridge/.github/.github/workflows/npm-publish-esm.yml@latest
with:
tag: 'beta'
dynamically_adjust_version: true
npm_version_command: 'pre'
pre_id: 'beta'
secrets:
npm_auth_token: ${{ secrets.npm_token }}

pre-release:
needs: publish
if: ${{ github.repository == 'thenewwazoo/homebridge-lutron-caseta-leap' }}
uses: homebridge/.github/.github/workflows/pre-release.yml@latest
with:
npm_version: ${{ needs.publish.outputs.NPM_VERSION }}
body: |
**Beta Release**
**Version**: v${{ needs.publish.outputs.NPM_VERSION }}
[How To Test Beta Releases](https://github.com/thenewwazoo/homebridge-lutron-caseta-leap/wiki/Beta-Version)
github-releases-to-discord:
name: Discord Webhooks
needs: [build_and_test,publish]
if: ${{ github.repository == 'thenewwazoo/homebridge-lutron-caseta-leap' }}
uses: homebridge/.github/.github/workflows/discord-webhooks.yml@latest
with:
title: "Lutron Beta Release"
description: |
Version `v${{ needs.publish.outputs.NPM_VERSION }}`
url: "https://github.com/thenewwazoo/homebridge-lutron-caseta-leap/releases/tag/v${{ needs.publish.outputs.NPM_VERSION }}"
secrets:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_URL_BETA || secrets.DISCORD_WEBHOOK_URL_LATEST }}
44 changes: 15 additions & 29 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,18 @@
name: Build and Lint
name: Node Build

on: [push, pull_request]
on:
push:
branches: [latest]
pull_request:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
# the Node.js versions to build on
# 16.x is required by Homebridge: https://github.com/homebridge/homebridge/wiki/Install-Homebridge-on-macOS
node-version: [18, 20]

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
build_and_test:
uses: homebridge/.github/.github/workflows/nodejs-build-and-test.yml@latest
with:
enable_coverage: false
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
lint:
needs: build_and_test
uses: homebridge/.github/.github/workflows/eslint.yml@latest
11 changes: 11 additions & 0 deletions .github/workflows/changerelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Changelog to Release

on:
release:
types: [published]

jobs:
changerelease:
uses: homebridge/.github/.github/workflows/change-release.yml@latest
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
9 changes: 9 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Labeler

on: [pull_request]

jobs:
labeler:
uses: homebridge/.github/.github/workflows/labeler.yml@latest
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
44 changes: 9 additions & 35 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,14 @@ name: Release Drafter

on:
push:
# branches to consider in the event; optional, defaults to all
branches:
- main
# pull_request event is required only for autolabeler
pull_request:
# Only following types are handled by the action, but one can default to all as well
types: [opened, reopened, synchronize]
# pull_request_target event is required for autolabeler to support PRs from forks
# pull_request_target:
# types: [opened, reopened, synchronize]

permissions:
contents: read
branches: [latest]
pull_request: # required for autolabeler
branches: [latest]
types: [opened, reopened, synchronize, ready_for_review, review_requested]
workflow_dispatch:

jobs:
update_release_draft:
permissions:
# write permission is required to create a github release
contents: write
# write permission is required for autolabeler
# otherwise, read permission is required at least
pull-requests: write
runs-on: ubuntu-latest
steps:
# (Optional) GitHub Enterprise requires GHE_HOST variable set
#- name: Set GHE_HOST
# run: |
# echo "GHE_HOST=${GITHUB_SERVER_URL##https:\/\/}" >> $GITHUB_ENV

# Drafts your next Release notes as Pull Requests are merged into "master"
- uses: release-drafter/release-drafter@v6
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
# with:
# config-name: my-config.yml
# disable-autolabeler: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release-drafter:
uses: homebridge/.github/.github/workflows/release-drafter.yml@latest
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
Loading

0 comments on commit 0c5824a

Please sign in to comment.