From a79ce2a3c03b48e0964212fc007979407eb65b9b Mon Sep 17 00:00:00 2001 From: Olivier Zalmanski <88216225+OlivierZal@users.noreply.github.com> Date: Mon, 29 Apr 2024 13:35:03 +0200 Subject: [PATCH] Improve first commit --- .github/dependabot.yml | 12 +++ .github/workflows/build.yml | 28 ++++++ .npmignore | 1 + .vscode/settings.json | 6 ++ package-lock.json | 112 +++++++++++------------- package.json | 21 ++++- index.ts => src/index.ts | 0 {lib => src/lib}/APICallContextData.ts | 0 {lib => src/lib}/APICallErrorData.ts | 8 +- {lib => src/lib}/APICallRequestData.ts | 2 +- {lib => src/lib}/APICallResponseData.ts | 2 +- {lib => src/lib}/MELCloudAPI.ts | 0 types.ts => src/types.ts | 0 tsconfig.json | 6 +- 14 files changed, 128 insertions(+), 70 deletions(-) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/build.yml create mode 100644 .vscode/settings.json rename index.ts => src/index.ts (100%) rename {lib => src/lib}/APICallContextData.ts (100%) rename {lib => src/lib}/APICallErrorData.ts (81%) rename {lib => src/lib}/APICallRequestData.ts (90%) rename {lib => src/lib}/APICallResponseData.ts (93%) rename {lib => src/lib}/MELCloudAPI.ts (100%) rename types.ts => src/types.ts (100%) diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..be4af60d --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,12 @@ +version: 2 +updates: + - package-ecosystem: 'github-actions' + directory: '/' + schedule: + interval: 'daily' + time: '05:00' + - package-ecosystem: 'npm' + directory: '/' + schedule: + interval: 'daily' + time: '05:00' diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..a5b26df7 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,28 @@ +name: Build +on: + push: + branches: + - main + pull_request: + types: [opened, synchronize, reopened] + +permissions: + contents: write + pull-requests: write + +jobs: + dependabot: + name: Dependabot + runs-on: ubuntu-latest + if: ${{ github.actor == 'dependabot[bot]' }} + steps: + - name: Fetch metadata + id: metadata + uses: dependabot/fetch-metadata@v2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + - name: Auto-merge + run: gh pr merge --auto --merge $PR_URL + env: + PR_URL: ${{ github.event.pull_request.html_url }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.npmignore b/.npmignore index 9670bfa7..2d45b61b 100644 --- a/.npmignore +++ b/.npmignore @@ -1,3 +1,4 @@ +/.github/ /.vscode/ /coverage/ /docs/ diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..f19ee8d3 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "sonarlint.connectedMode.project": { + "connectionId": "olivierzal", + "projectKey": "OlivierZal_melcloud-api" + } +} diff --git a/package-lock.json b/package-lock.json index 1a26ee12..cfea048b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,13 @@ { - "name": "melcloud", + "name": "melcloud-api", "version": "1.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "melcloud", + "name": "melcloud-api", "version": "1.0.0", + "license": "ISC", "dependencies": { "axios": "^1.6.8", "luxon": "^3.4.4", @@ -14,17 +15,16 @@ }, "devDependencies": { "@stylistic/eslint-plugin": "^1.7.2", - "@tsconfig/node21": "^21.0.3", "@types/luxon": "^3.4.2", "@types/node": "^20.12.7", "eslint": "^9.1.1", "eslint-config-prettier": "^9.1.0", "eslint-import-resolver-typescript": "^3.6.1", "eslint-plugin-import": "^2.29.1", - "globals": "^15.0.0", + "globals": "^15.1.0", "prettier": "^3.2.5", "typescript": "^5.4.5", - "typescript-eslint": "^7.7.1" + "typescript-eslint": "^7.8.0" } }, "node_modules/@eslint-community/eslint-utils": { @@ -371,12 +371,6 @@ "node": ">=10" } }, - "node_modules/@tsconfig/node21": { - "version": "21.0.3", - "resolved": "https://registry.npmjs.org/@tsconfig/node21/-/node21-21.0.3.tgz", - "integrity": "sha512-qTX4pGNfnRTutaiRPx+c4GFL1DB1u6GHkwfoYSNn/KelE9m86Mkn3RpFBhhxDh6yHeqaVuAx0tz+n7LrjBUEpw==", - "dev": true - }, "node_modules/@types/eslint": { "version": "8.56.10", "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.10.tgz", @@ -3119,14 +3113,14 @@ } }, "node_modules/typescript-eslint": { - "version": "7.7.1", - "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-7.7.1.tgz", - "integrity": "sha512-ykEBfa3xx3odjZy6GRED4SCPrjo0rgHwstLlEgLX4EMEuv7QeIDSmfV+S6Kk+XkbsYn4BDEcPvsci1X26lRpMQ==", + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-7.8.0.tgz", + "integrity": "sha512-sheFG+/D8N/L7gC3WT0Q8sB97Nm573Yfr+vZFzl/4nBdYcmviBPtwGSX9TJ7wpVg28ocerKVOt+k2eGmHzcgVA==", "dev": true, "dependencies": { - "@typescript-eslint/eslint-plugin": "7.7.1", - "@typescript-eslint/parser": "7.7.1", - "@typescript-eslint/utils": "7.7.1" + "@typescript-eslint/eslint-plugin": "7.8.0", + "@typescript-eslint/parser": "7.8.0", + "@typescript-eslint/utils": "7.8.0" }, "engines": { "node": "^18.18.0 || >=20.0.0" @@ -3145,16 +3139,16 @@ } }, "node_modules/typescript-eslint/node_modules/@typescript-eslint/eslint-plugin": { - "version": "7.7.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.7.1.tgz", - "integrity": "sha512-KwfdWXJBOviaBVhxO3p5TJiLpNuh2iyXyjmWN0f1nU87pwyvfS0EmjC6ukQVYVFJd/K1+0NWGPDXiyEyQorn0Q==", + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.8.0.tgz", + "integrity": "sha512-gFTT+ezJmkwutUPmB0skOj3GZJtlEGnlssems4AjkVweUPGj7jRwwqg0Hhg7++kPGJqKtTYx+R05Ftww372aIg==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "7.7.1", - "@typescript-eslint/type-utils": "7.7.1", - "@typescript-eslint/utils": "7.7.1", - "@typescript-eslint/visitor-keys": "7.7.1", + "@typescript-eslint/scope-manager": "7.8.0", + "@typescript-eslint/type-utils": "7.8.0", + "@typescript-eslint/utils": "7.8.0", + "@typescript-eslint/visitor-keys": "7.8.0", "debug": "^4.3.4", "graphemer": "^1.4.0", "ignore": "^5.3.1", @@ -3180,13 +3174,13 @@ } }, "node_modules/typescript-eslint/node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/type-utils": { - "version": "7.7.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.7.1.tgz", - "integrity": "sha512-ZksJLW3WF7o75zaBPScdW1Gbkwhd/lyeXGf1kQCxJaOeITscoSl0MjynVvCzuV5boUz/3fOI06Lz8La55mu29Q==", + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.8.0.tgz", + "integrity": "sha512-H70R3AefQDQpz9mGv13Uhi121FNMh+WEaRqcXTX09YEDky21km4dV1ZXJIp8QjXc4ZaVkXVdohvWDzbnbHDS+A==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "7.7.1", - "@typescript-eslint/utils": "7.7.1", + "@typescript-eslint/typescript-estree": "7.8.0", + "@typescript-eslint/utils": "7.8.0", "debug": "^4.3.4", "ts-api-utils": "^1.3.0" }, @@ -3207,15 +3201,15 @@ } }, "node_modules/typescript-eslint/node_modules/@typescript-eslint/parser": { - "version": "7.7.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.7.1.tgz", - "integrity": "sha512-vmPzBOOtz48F6JAGVS/kZYk4EkXao6iGrD838sp1w3NQQC0W8ry/q641KU4PrG7AKNAf56NOcR8GOpH8l9FPCw==", + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.8.0.tgz", + "integrity": "sha512-KgKQly1pv0l4ltcftP59uQZCi4HUYswCLbTqVZEJu7uLX8CTLyswqMLqLN+2QFz4jCptqWVV4SB7vdxcH2+0kQ==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "7.7.1", - "@typescript-eslint/types": "7.7.1", - "@typescript-eslint/typescript-estree": "7.7.1", - "@typescript-eslint/visitor-keys": "7.7.1", + "@typescript-eslint/scope-manager": "7.8.0", + "@typescript-eslint/types": "7.8.0", + "@typescript-eslint/typescript-estree": "7.8.0", + "@typescript-eslint/visitor-keys": "7.8.0", "debug": "^4.3.4" }, "engines": { @@ -3235,13 +3229,13 @@ } }, "node_modules/typescript-eslint/node_modules/@typescript-eslint/scope-manager": { - "version": "7.7.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.7.1.tgz", - "integrity": "sha512-PytBif2SF+9SpEUKynYn5g1RHFddJUcyynGpztX3l/ik7KmZEv19WCMhUBkHXPU9es/VWGD3/zg3wg90+Dh2rA==", + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.8.0.tgz", + "integrity": "sha512-viEmZ1LmwsGcnr85gIq+FCYI7nO90DVbE37/ll51hjv9aG+YZMb4WDE2fyWpUR4O/UrhGRpYXK/XajcGTk2B8g==", "dev": true, "dependencies": { - "@typescript-eslint/types": "7.7.1", - "@typescript-eslint/visitor-keys": "7.7.1" + "@typescript-eslint/types": "7.8.0", + "@typescript-eslint/visitor-keys": "7.8.0" }, "engines": { "node": "^18.18.0 || >=20.0.0" @@ -3252,9 +3246,9 @@ } }, "node_modules/typescript-eslint/node_modules/@typescript-eslint/types": { - "version": "7.7.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.7.1.tgz", - "integrity": "sha512-AmPmnGW1ZLTpWa+/2omPrPfR7BcbUU4oha5VIbSbS1a1Tv966bklvLNXxp3mrbc+P2j4MNOTfDffNsk4o0c6/w==", + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.8.0.tgz", + "integrity": "sha512-wf0peJ+ZGlcH+2ZS23aJbOv+ztjeeP8uQ9GgwMJGVLx/Nj9CJt17GWgWWoSmoRVKAX2X+7fzEnAjxdvK2gqCLw==", "dev": true, "engines": { "node": "^18.18.0 || >=20.0.0" @@ -3265,13 +3259,13 @@ } }, "node_modules/typescript-eslint/node_modules/@typescript-eslint/typescript-estree": { - "version": "7.7.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.7.1.tgz", - "integrity": "sha512-CXe0JHCXru8Fa36dteXqmH2YxngKJjkQLjxzoj6LYwzZ7qZvgsLSc+eqItCrqIop8Vl2UKoAi0StVWu97FQZIQ==", + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.8.0.tgz", + "integrity": "sha512-5pfUCOwK5yjPaJQNy44prjCwtr981dO8Qo9J9PwYXZ0MosgAbfEMB008dJ5sNo3+/BN6ytBPuSvXUg9SAqB0dg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "7.7.1", - "@typescript-eslint/visitor-keys": "7.7.1", + "@typescript-eslint/types": "7.8.0", + "@typescript-eslint/visitor-keys": "7.8.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -3293,17 +3287,17 @@ } }, "node_modules/typescript-eslint/node_modules/@typescript-eslint/utils": { - "version": "7.7.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.7.1.tgz", - "integrity": "sha512-QUvBxPEaBXf41ZBbaidKICgVL8Hin0p6prQDu6bbetWo39BKbWJxRsErOzMNT1rXvTll+J7ChrbmMCXM9rsvOQ==", + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.8.0.tgz", + "integrity": "sha512-L0yFqOCflVqXxiZyXrDr80lnahQfSOfc9ELAAZ75sqicqp2i36kEZZGuUymHNFoYOqxRT05up760b4iGsl02nQ==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "@types/json-schema": "^7.0.15", "@types/semver": "^7.5.8", - "@typescript-eslint/scope-manager": "7.7.1", - "@typescript-eslint/types": "7.7.1", - "@typescript-eslint/typescript-estree": "7.7.1", + "@typescript-eslint/scope-manager": "7.8.0", + "@typescript-eslint/types": "7.8.0", + "@typescript-eslint/typescript-estree": "7.8.0", "semver": "^7.6.0" }, "engines": { @@ -3318,12 +3312,12 @@ } }, "node_modules/typescript-eslint/node_modules/@typescript-eslint/visitor-keys": { - "version": "7.7.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.7.1.tgz", - "integrity": "sha512-gBL3Eq25uADw1LQ9kVpf3hRM+DWzs0uZknHYK3hq4jcTPqVCClHGDnB6UUUV2SFeBeA4KWHWbbLqmbGcZ4FYbw==", + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.8.0.tgz", + "integrity": "sha512-q4/gibTNBQNA0lGyYQCmWRS5D15n8rXh4QjK3KV+MBPlTYHpfBUT3D3PaPR/HeNiI9W6R7FvlkcGhNyAoP+caA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "7.7.1", + "@typescript-eslint/types": "7.8.0", "eslint-visitor-keys": "^3.4.3" }, "engines": { diff --git a/package.json b/package.json index bca02b5a..e74aec9e 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,23 @@ { - "name": "melcloud", + "name": "melcloud-api", "version": "1.0.0", + "description": "MELCloud API package for NodeJS", "main": "dist/index.js", "types": "dist/index.d.ts", + "repository": { + "type": "git", + "url": "git+https://github.com/OlivierZal/melcloud-api.git" + }, + "keywords": [ + "melcloud", + "api" + ], + "author": "Olivier Zalmanski", + "license": "ISC", + "bugs": { + "url": "https://github.com/OlivierZal/melcloud-api/issues" + }, + "homepage": "https://github.com/OlivierZal/melcloud-api#readme", "prettier": { "experimentalTernaries": true, "semi": false, @@ -25,10 +40,10 @@ "eslint-config-prettier": "^9.1.0", "eslint-import-resolver-typescript": "^3.6.1", "eslint-plugin-import": "^2.29.1", - "globals": "^15.0.0", + "globals": "^15.1.0", "prettier": "^3.2.5", "typescript": "^5.4.5", - "typescript-eslint": "^7.7.1" + "typescript-eslint": "^7.8.0" }, "dependencies": { "axios": "^1.6.8", diff --git a/index.ts b/src/index.ts similarity index 100% rename from index.ts rename to src/index.ts diff --git a/lib/APICallContextData.ts b/src/lib/APICallContextData.ts similarity index 100% rename from lib/APICallContextData.ts rename to src/lib/APICallContextData.ts diff --git a/lib/APICallErrorData.ts b/src/lib/APICallErrorData.ts similarity index 81% rename from lib/APICallErrorData.ts rename to src/lib/APICallErrorData.ts index 9e80b0f5..8c364143 100644 --- a/lib/APICallErrorData.ts +++ b/src/lib/APICallErrorData.ts @@ -1,6 +1,8 @@ -import type APICallContextData from './APICallContextData' -import APICallRequestData from './APICallRequestData' -import APICallResponseData from './APICallResponseData' +import { + type APICallContextData, + APICallRequestData, + APICallResponseData, +} from '..' import type { AxiosError } from 'axios' interface APICallContextDataWithErrorMessage extends APICallContextData { diff --git a/lib/APICallRequestData.ts b/src/lib/APICallRequestData.ts similarity index 90% rename from lib/APICallRequestData.ts rename to src/lib/APICallRequestData.ts index 53e312aa..b3848fd7 100644 --- a/lib/APICallRequestData.ts +++ b/src/lib/APICallRequestData.ts @@ -1,4 +1,4 @@ -import APICallContextData from './APICallContextData' +import { APICallContextData } from '..' import type { InternalAxiosRequestConfig } from 'axios' export default class APICallRequestData extends APICallContextData { diff --git a/lib/APICallResponseData.ts b/src/lib/APICallResponseData.ts similarity index 93% rename from lib/APICallResponseData.ts rename to src/lib/APICallResponseData.ts index b322040c..990bb72b 100644 --- a/lib/APICallResponseData.ts +++ b/src/lib/APICallResponseData.ts @@ -1,5 +1,5 @@ import type { AxiosResponse, InternalAxiosRequestConfig } from 'axios' -import APICallContextData from './APICallContextData' +import { APICallContextData } from '..' export default class APICallResponseData extends APICallContextData { public readonly headers?: AxiosResponse['headers'] diff --git a/lib/MELCloudAPI.ts b/src/lib/MELCloudAPI.ts similarity index 100% rename from lib/MELCloudAPI.ts rename to src/lib/MELCloudAPI.ts diff --git a/types.ts b/src/types.ts similarity index 100% rename from types.ts rename to src/types.ts diff --git a/tsconfig.json b/tsconfig.json index 917dd327..bbb0da2b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,13 +2,13 @@ "compilerOptions": { "declaration": true, "declarationMap": true, - "lib": ["ESNext"], - "module": "node16", + "module": "NodeNext", "noImplicitOverride": true, "outDir": "dist", + "rootDir": "src", "skipLibCheck": true, "sourceMap": true, "strict": true, - "target": "ES2022" + "target": "ESNext" } }