diff --git a/.eslintignore b/.eslintignore index 2482eeca..33659f27 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,5 +1,2 @@ **/.eslintrc.js admin/words.js -lib/** -gulpfile.js -main.js \ No newline at end of file diff --git a/.github/auto-merge.yml b/.github/auto-merge.yml index 3f5fbe36..4f6d185f 100644 --- a/.github/auto-merge.yml +++ b/.github/auto-merge.yml @@ -1,17 +1,17 @@ # Configure here which dependency updates should be merged automatically. # The recommended configuration is the following: - match: - # Only merge patches for production dependencies - dependency_type: production - update_type: "semver:patch" + # Only merge patches for production dependencies + dependency_type: production + update_type: "semver:patch" - match: - # Except for security fixes, here we allow minor patches - dependency_type: production - update_type: "security:minor" + # Except for security fixes, here we allow minor patches + dependency_type: production + update_type: "security:minor" - match: - # and development dependencies can have a minor update, too - dependency_type: development - update_type: "semver:minor" + # and development dependencies can have a minor update, too + dependency_type: development + update_type: "semver:minor" # The syntax is based on the legacy dependabot v1 automerged_updates syntax, see: -# https://dependabot.com/docs/config-file/#automerged_updates \ No newline at end of file +# https://dependabot.com/docs/config-file/#automerged_updates diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 7bb1dcc6..e003072e 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,4 +1,4 @@ -version: 2version: 2 +version: 2 updates: - package-ecosystem: npm directory: "/" diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml new file mode 100644 index 00000000..fc331f14 --- /dev/null +++ b/.github/workflows/dependabot-auto-merge.yml @@ -0,0 +1,27 @@ +# Automatically merge Dependabot PRs when version comparison is within the range +# that is configured in .github/auto-merge.yml + +name: Auto-Merge Dependabot PRs + +on: + # WARNING: This needs to be run in the PR base, DO NOT build untrusted code in this action + # details under https://github.blog/changelog/2021-02-19-github-actions-workflows-triggered-by-dependabot-prs-will-run-with-read-only-permissions/ + pull_request_target: + +jobs: + auto-merge: + if: github.actor == 'dependabot[bot]' + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Check if PR should be auto-merged + uses: ahmadnassri/action-dependabot-auto-merge@v2 + with: + # In order to use this, you need to go to https://github.com/settings/tokens and + # create a Personal Access Token with the permission "public_repo". + # Enter this token in your repository settings under "Secrets" and name it AUTO_MERGE_TOKEN + github-token: ${{ secrets.AUTO_MERGE_TOKEN }} + # By default, squash and merge, so Github chooses nice commit messages + command: squash and merge diff --git a/.github/workflows/dependabot-automerge.yml b/.github/workflows/dependabot-automerge.yml deleted file mode 100644 index 7ebd3105..00000000 --- a/.github/workflows/dependabot-automerge.yml +++ /dev/null @@ -1,22 +0,0 @@ -# Automatically merge Dependabot PRs when version comparison is within the range -# that is configured in .github/auto-merge.yml - -name: Auto-Merge Dependabot PRs - -on: - pull_request_target: - -jobs: - auto-merge: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Check if PR should be auto-merged - uses: ahmadnassri/action-dependabot-auto-merge@v2 - with: - # This must be a personal access token with push access - github-token: ${{ secrets.AUTO_MERGE_TOKEN }} - # By default, squash and merge, so Github chooses nice commit messages - command: squash and merge \ No newline at end of file diff --git a/.gitignore b/.gitignore index 77358fb3..3bf582ba 100644 --- a/.gitignore +++ b/.gitignore @@ -1,13 +1,17 @@ -.git -.idea -.settings +# No dot-directories except github/vscode +.*/ +!.vscode/ +!.github/ + +*.code-workspace node_modules nbproject -admin/i18n/flat.txt -admin/i18n/*/flat.txt -/tmp/ +# npm package files +iobroker.*.tgz +Thumbs.db -# ioBroker dev-server -.dev-server/ +# i18n intermediate files +admin/i18n/flat.txt +admin/i18n/*/flat.txt \ No newline at end of file diff --git a/gulpfile.js b/.js similarity index 100% rename from gulpfile.js rename to .js diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..515bcd4f --- /dev/null +++ b/.prettierignore @@ -0,0 +1,2 @@ +package.json +package-lock.json \ No newline at end of file diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 00000000..164ee344 --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,9 @@ +module.exports = { + semi: true, + trailingComma: 'all', + singleQuote: true, + printWidth: 120, + useTabs: false, + tabWidth: 4, + endOfLine: 'lf', +}; diff --git a/.releaseconfig.json b/.releaseconfig.json index 6f9d0f55..e7d09e24 100644 --- a/.releaseconfig.json +++ b/.releaseconfig.json @@ -1,3 +1,3 @@ { - "plugins": ["iobroker", "license"] + "plugins": ["iobroker", "license", "manual-review"] } diff --git a/io-package.json b/io-package.json index db6afc08..6bf82bdb 100644 --- a/io-package.json +++ b/io-package.json @@ -88,7 +88,6 @@ "zh-cn": "允许设置默认的shuffle值\n轨道类型未更正" } }, - "title": "Spotify (Premium)", "titleLang": { "en": "Spotify (Premium)", "de": "Spotify (Premium)", @@ -99,6 +98,7 @@ "it": "Spotify (Premium)", "es": "Spotify (premium)", "pl": "Spotify (Premium)", + "uk": "Spotify (Premium)", "zh-cn": "Spotify(高级)" }, "desc": { @@ -111,42 +111,50 @@ "it": "controllare i dispositivi spotify", "es": "controlar dispositivos spotify", "pl": "kontroluj urządzenia spotify", + "uk": "управління точністю пристроїв", "zh-cn": "控制spotify设备" }, "authors": [ "Lucky", - "Alexander Kose" + "Alexander Kose", + "iobroker-community-adapters " ], + "keywords": [ + "spotify", + "player", + "media" + ], "license": "MIT", "platform": "Javascript/Node.js", - "mode": "daemon", + "main": "main.js", "icon": "spotify-premium.png", - "materialize": true, "enabled": true, "extIcon": "https://raw.githubusercontent.com/iobroker-community-adapters/ioBroker.spotify-premium/master/admin/spotify-premium.png", - "keywords": [ - "spotify", - "player", - "media" - ], "readme": "https://github.com/iobroker-community-adapters/ioBroker.spotify-premium/blob/master/README.md", "loglevel": "info", + "mode": "daemon", "type": "multimedia", "compact": true, "connectionType": "cloud", "dataSource": "poll", + "materialize": true, "tier": 2, + "dependencies": [ + { + "js-controller": ">=4.0.24" + } + ], + "globalDependencies": [ + { + "admin": ">=5.1.13" + } + ], "plugins": { - "sentry": { - "dsn": "https://df92a91a757f4325ab1ff04a0d17d4a4@sentry.iobroker.net/195" + "sentry": { + "dsn": "https://df92a91a757f4325ab1ff04a0d17d4a4@sentry.iobroker.net/195" + } } }, - "dependencies": [ - { - "js-controller": ">=2.0.0" - } - ] - }, "native": { "client_id": "", "client_secret": "", diff --git a/package.json b/package.json index cf99d4f3..1014c6eb 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,10 @@ "email": "twonky4@gmx.de" }, "contributors": [ + { + "name": "iobroker-community-adapters", + "email": "mcm57@gmx.at" + }, { "name": "Lucky" }, @@ -39,27 +43,25 @@ "@alcalzone/release-script-plugin-iobroker": "^3.6.0", "@alcalzone/release-script-plugin-license": "^3.5.9", "@alcalzone/release-script-plugin-manual-review": "^3.5.9", - "axios": "^1.6.0", - "gulp": "^4.0.2", "@iobroker/adapter-dev": "^1.2.0", "@iobroker/testing": "^4.1.0", "@tsconfig/node14": "^14.1.0", - "@types/chai": "^4.3.9", - "@types/chai-as-promised": "^7.1.7", - "@types/mocha": "^10.0.3", - "@types/node": "^20.8.9", - "@types/proxyquire": "^1.3.30", - "@types/sinon": "^10.0.19", - "@types/sinon-chai": "^3.2.11", + "@types/chai": "^4.3.8", + "@types/chai-as-promised": "^7.1.6", + "@types/mocha": "^10.0.2", + "@types/node": "^20.8.6", + "@types/proxyquire": "^1.3.29", + "@types/sinon": "^10.0.16", + "@types/sinon-chai": "^3.2.10", "chai": "^4.3.10", "chai-as-promised": "^7.1.1", - "eslint": "^8.52.0", - "eslint-config-prettier": "^9.0.0", - "eslint-plugin-prettier": "^5.0.1", + "eslint": "^8.51.0", + "eslint-config-prettier": "^8.9.0", + "eslint-plugin-prettier": "^4.2.1", "mocha": "^10.2.0", "prettier": "^3.0.3", "proxyquire": "^2.1.3", - "sinon": "^16.1.0", + "sinon": "^15.2.0", "sinon-chai": "^3.7.0", "typescript": "~5.2.2" }, diff --git a/test/mocha.custom.opts b/test/mocha.custom.opts deleted file mode 100644 index 703f749d..00000000 --- a/test/mocha.custom.opts +++ /dev/null @@ -1,2 +0,0 @@ ---require test/mocha.setup.js -{!(node_modules|test)/**/*.test.js,*.test.js,test/**/test!(PackageFiles|Startup).js} \ No newline at end of file diff --git a/test/mocha.setup.js b/test/mocha.setup.js index 15b9051f..7bc1808d 100644 --- a/test/mocha.setup.js +++ b/test/mocha.setup.js @@ -11,4 +11,4 @@ const { should, use } = require('chai'); should(); use(sinonChai); -use(chaiAsPromised); \ No newline at end of file +use(chaiAsPromised); diff --git a/test/mocharc.custom.json b/test/mocharc.custom.json new file mode 100644 index 00000000..f01dabb3 --- /dev/null +++ b/test/mocharc.custom.json @@ -0,0 +1,4 @@ +{ + "require": ["test/mocha.setup.js"], + "watch-files": ["!(node_modules|test)/**/*.test.js", "*.test.js", "test/**/test!(PackageFiles|Startup).js"] +} diff --git a/test/tsconfig.json b/test/tsconfig.json new file mode 100644 index 00000000..0fa051db --- /dev/null +++ b/test/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "noImplicitAny": false + }, + "include": ["./**/*.js"] +} diff --git a/test/unit.js b/test/unit.js deleted file mode 100644 index 8e27b3aa..00000000 --- a/test/unit.js +++ /dev/null @@ -1,5 +0,0 @@ -const path = require('path'); -const { tests } = require('@iobroker/testing'); - -// Run unit tests - See https://github.com/ioBroker/testing for a detailed explanation and further options -tests.unit(path.join(__dirname, '..'));