Skip to content

Commit

Permalink
v1.4.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
hjdhjd committed Aug 4, 2024
1 parent 9c26837 commit 5522b37
Show file tree
Hide file tree
Showing 21 changed files with 1,502 additions and 2,912 deletions.
46 changes: 0 additions & 46 deletions .eslintrc.json

This file was deleted.

16 changes: 9 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ jobs:
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:
Expand All @@ -39,11 +36,12 @@ jobs:
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
ESLINT_MAX_WARNINGS: 0
run: |
npm ci
npm run prepublishOnly
# Publish the release to the NPM registry.
publish-npm:
Expand All @@ -56,6 +54,10 @@ jobs:
# Specify the environment we're going to build in.
runs-on: ubuntu-latest

# Ensure we have permissions to provide our provenance attestation.
permissions:
id-token: write

# Execute the build and publish activities.
steps:
- name: Checkout the repository.
Expand All @@ -75,6 +77,6 @@ jobs:
run: npm ci

- name: Publish the package to NPM.
run: npm publish --access public
run: npm publish --access public --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.npm_token }}
128 changes: 126 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,129 @@
# Ignore compiled code
dist

# Ignore npmrc.
.npmrc

# Ignore macOS attribute files.
.DS_Store

# Ignore generated files.
homebridge-ui/public/lib

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

# 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/
package-lock.json
dist/
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.*
18 changes: 18 additions & 0 deletions CODE-OF-CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Code of Conduct

By interacting with this GitHub repository, you agree that you'll follow this code of conduct.

### In short: Be nice. Be respectful. No harassment, trolling, or spamming.

Always be mindful that in the free / open source community, people are contributing their time away from friends and families to work on these projects. No one is being compensated for their work here. While feedback is useful, coming to this repository to make demands isn’t respectful.

* Harassment includes sexual language and imagery, deliberate intimidation, stalking, name-calling, unwelcome attention, libel, and any malicious hacking or social engineering. This repository should be a harassment-free experience for everyone, regardless of your background, identity, or experience level.

* Trolling includes posting inflammatory comments to provoke an emotional response or disrupt discussions.

* Spamming includes posting off-topic messages to disrupt discussions, promote a product, solicit donations, advertise a job / internship / gig, or flooding discussions with files or text.

#### The maintainers of this GitHub repository will take any action we deem appropriate, up to and including banning the offender from this repository.

##### Attribution
This code of conduct was inspired by and adapted from the [freeCodeCamp](https://www.freecodecamp.org/news/code-of-conduct/) code of conduct.
4 changes: 4 additions & 0 deletions docs/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to this project will be documented in this file. This project uses [semantic versioning](https://semver.org/).

## 1.4.0 (2024-08-04)
* Improvement: now fully supporting UniFi Access v2, including all Access hubs.
* Housekeeping.

## 1.3.0 (2024-04-20)
* New feature: add support for the latest generation of UniFi Access hubs.

Expand Down
99 changes: 99 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
/* Copyright(C) 2017-2024, HJD (https://github.com/hjdhjd). All rights reserved.
*
* eslint.config.mjs: Linting defaults for Homebridge plugins.
*/
import eslintJs from "@eslint/js";
import hbPluginUtils from "homebridge-plugin-utils/build/eslint-rules.mjs";
import ts from "typescript-eslint";
import tsParser from "@typescript-eslint/parser";

export default ts.config(

eslintJs.configs.recommended,

{

files: [ "src/**.ts" ],
rules: {

...hbPluginUtils.rules.ts
}
},

{

files: [ "homebridge-ui/public/**/*.@(js|mjs)", "homebridge-ui/server.js", "eslint.config.mjs" ],
rules: {

...hbPluginUtils.rules.js
}
},

{

files: [ "src/**.ts", "homebridge-ui/*.@(js|mjs)", "homebridge-ui/public/**/*.@(js|mjs)", "eslint.config.mjs" ],

ignores: [ "dist" ],

languageOptions: {

ecmaVersion: "latest",
parser: tsParser,
parserOptions: {

ecmaVersion: "latest",
project: "./tsconfig.json",

projectService: {

allowDefaultProject: [ "eslint.config.mjs", "homebridge-ui/*.@(js|mjs)", "homebridge-ui/public/lib/*.@(js|mjs)" ],
defaultProject: "./tsconfig.json"
}
},

sourceType: "module"
},

linterOptions: {

reportUnusedDisableDirectives: "error"
},

plugins: {

...hbPluginUtils.plugins
},

rules: {

...hbPluginUtils.rules.common
}
},

{

files: [ "homebridge-ui/public/lib/webUi.mjs", "homebridge-ui/public/lib/webUi-featureoptions.mjs" ],

languageOptions: {

globals: {

...hbPluginUtils.globals.ui
}
}
},

{

files: [ "homebridge-ui/server.js" ],

languageOptions: {

globals: {

console: "readonly",
fetch: "readonly"
}
}
}
);
Loading

0 comments on commit 5522b37

Please sign in to comment.