Skip to content

Commit

Permalink
Merge pull request #5 from pinpong/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
pinpong authored Sep 15, 2023
2 parents 61ca418 + 75e28df commit d97bbd4
Show file tree
Hide file tree
Showing 86 changed files with 2,797 additions and 538 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist/
docs/
7 changes: 5 additions & 2 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
/* eslint-env node */
/** @type {import("eslint")} */
module.exports = {
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
'plugin:import/errors',
'plugin:jsdoc/recommended',
],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
root: true,
ignorePatterns: ['dist/*', '*.test.ts'],
env: {
es6: true,
jest: true,
},
settings: {
'import/resolver': {
Expand All @@ -32,5 +33,7 @@ module.exports = {
alphabetize: { order: 'asc', caseInsensitive: true },
},
],
'import/no-unresolved': ['error'],
'no-undef': ['error'],
},
};
2 changes: 1 addition & 1 deletion .github/workflows/code_check.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Check code
name: Check code quality
on:
push:
branches: ['dev', 'main']
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/deploy_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Deploy docs to GH pages

on:
release:
types: [published]
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: 'pages'
cancel-in-progress: false

jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install
run: yarn install
- name: Build
run: npx typedoc --plugin typedoc-plugin-missing-exports
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: './docs'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
File renamed without changes.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ yarn-error.log*
build/
dist/
temp/
docs/
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn lint-staged
4 changes: 4 additions & 0 deletions .lintstagedrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
'*.{cjs,js,ts,json,md}': 'yarn format',
'!*.{cjs,md}': 'yarn lint',
};
6 changes: 2 additions & 4 deletions .prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @type {import("prettier").Config} */
const config = {
/** @type {import("prettier")} */
module.exports = {
trailingComma: 'es5',
semi: true,
singleQuote: true,
Expand All @@ -10,5 +10,3 @@ const config = {
importOrderSortSpecifiers: true,
importOrderCaseInsensitive: true,
};

module.exports = config;
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ try {
const blinds = client.blinds.getAll();
console.log(blinds);
await client.blinds.setPosition('item0', 75);
const blindsTrends = client.blinds.getTrends(
'2023-01-01T00:00:00+01:00',
'2023-01-06T00:00:00+01:00',
500
);
console.log(blindsTrends);
} catch (e) {
console.log(e);
}
Expand All @@ -48,7 +54,23 @@ try {
const blinds = client.blinds.getAll();
console.log(blinds);
await client.blinds.setPosition('item0', 75);
const blindsTrends = client.blinds.getTrends(
'2023-01-01T00:00:00+01:00',
'2023-01-06T00:00:00+01:00',
500
);
console.log(blindsTrends);
} catch (e) {
console.log(e);
}
```

## Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests.

```sh
yarn install && yarn prepare
```
11 changes: 11 additions & 0 deletions jest.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
verbose: true,
testTimeout: 60000,
transform: {
'^.+\\.ts$': 'ts-jest',
'^.+\\.js$': 'babel-jest',
'^.+\\.mjs$': 'babel-jest',
},
};
10 changes: 0 additions & 10 deletions jest.config.json

This file was deleted.

17 changes: 13 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,32 @@
"module": "dist/index.module.js",
"unpkg": "dist/index.umd.js",
"scripts": {
"postinstall": "husky install",
"prepack": "pinst --disable",
"postpack": "pinst --enable",
"build": "rm -rf ./dist && tsc",
"test": "jest",
"format": "yarn prettier . --write",
"lint": "eslint ."
"lint": "eslint . --fix"
},
"devDependencies": {
"@jest/globals": "29.7.0",
"@trivago/prettier-plugin-sort-imports": "^4.2.0",
"@trivago/prettier-plugin-sort-imports": "4.2.0",
"@types/jest": "29.5.4",
"@typescript-eslint/eslint-plugin": "6.7.0",
"@typescript-eslint/parser": "6.7.0",
"eslint": "8.49.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-import": "^2.28.1",
"eslint-config-prettier": "9.0.0",
"eslint-plugin-import": "2.28.1",
"eslint-plugin-jsdoc": "46.8.0",
"husky": "8.0.3",
"jest": "29.7.0",
"lint-staged": "14.0.1",
"pinst": "3.0.0",
"prettier": "3.0.3",
"ts-jest": "29.1.1",
"typedoc": "0.25.1",
"typedoc-plugin-missing-exports": "2.1.0",
"typescript": "5.2.2"
},
"dependencies": {
Expand Down
Loading

0 comments on commit d97bbd4

Please sign in to comment.