├── .lgtm.yml ├── bin └── create-adapter.js ├── test ├── baselines │ ├── TS_Prettier │ │ ├── .prettierignore │ │ ├── .vscode │ │ │ └── extensions.json │ │ └── .prettierrc.js │ ├── adapter_JS_React │ │ ├── .vscode │ │ │ ├── extensions.json │ │ │ └── settings.json │ │ ├── admin │ │ │ ├── test-adapter.png │ │ │ ├── src │ │ │ │ ├── i18n │ │ │ │ │ ├── en.json │ │ │ │ │ ├── zh-cn.json │ │ │ │ │ ├── de.json │ │ │ │ │ ├── nl.json │ │ │ │ │ ├── pl.json │ │ │ │ │ ├── ru.json │ │ │ │ │ ├── es.json │ │ │ │ │ ├── fr.json │ │ │ │ │ ├── uk.json │ │ │ │ │ ├── it.json │ │ │ │ │ └── pt.json │ │ │ │ └── index.jsx │ │ │ ├── .eslintrc.json │ │ │ ├── index_m.html │ │ │ └── style.css │ │ ├── test │ │ │ ├── package.js │ │ │ ├── mocharc.custom.json │ │ │ ├── integration.js │ │ │ └── mocha.setup.js │ │ ├── __meta__ │ │ │ └── npm_package_files.txt │ │ ├── .github │ │ │ ├── ISSUE_TEMPLATE │ │ │ │ └── config.yml │ │ │ ├── dependabot.yml │ │ │ └── auto-merge.yml │ │ ├── .gitignore │ │ └── lib │ │ │ └── adapter-config.d.ts │ ├── adapter_TS_React │ │ ├── .vscode │ │ │ ├── extensions.json │ │ │ └── settings.json │ │ ├── admin │ │ │ ├── test-adapter.png │ │ │ ├── src │ │ │ │ ├── i18n │ │ │ │ │ ├── en.json │ │ │ │ │ ├── zh-cn.json │ │ │ │ │ ├── de.json │ │ │ │ │ ├── nl.json │ │ │ │ │ ├── pl.json │ │ │ │ │ ├── ru.json │ │ │ │ │ ├── es.json │ │ │ │ │ ├── fr.json │ │ │ │ │ ├── uk.json │ │ │ │ │ ├── it.json │ │ │ │ │ └── pt.json │ │ │ │ └── index.tsx │ │ │ ├── tsconfig.json │ │ │ ├── index_m.html │ │ │ └── style.css │ │ ├── __meta__ │ │ │ └── npm_package_files.txt │ │ ├── test │ │ │ ├── tsconfig.json │ │ │ ├── package.js │ │ │ ├── mocharc.custom.json │ │ │ ├── integration.js │ │ │ ├── .eslintrc.json │ │ │ └── mocha.setup.js │ │ ├── .github │ │ │ ├── ISSUE_TEMPLATE │ │ │ │ └── config.yml │ │ │ ├── dependabot.yml │ │ │ └── auto-merge.yml │ │ ├── .gitignore │ │ ├── tsconfig.build.json │ │ └── src │ │ │ ├── lib │ │ │ └── adapter-config.d.ts │ │ │ └── main.test.ts │ ├── adapter_TS_WithoutBuild │ │ ├── .vscode │ │ │ ├── extensions.json │ │ │ └── settings.json │ │ ├── admin │ │ │ └── test-adapter.png │ │ ├── test │ │ │ ├── package.js │ │ │ ├── mocharc.custom.json │ │ │ ├── integration.js │ │ │ └── mocha.setup.js │ │ ├── .github │ │ │ ├── ISSUE_TEMPLATE │ │ │ │ └── config.yml │ │ │ ├── dependabot.yml │ │ │ └── auto-merge.yml │ │ ├── __meta__ │ │ │ └── npm_package_files.txt │ │ ├── .gitignore │ │ └── src │ │ │ ├── lib │ │ │ └── adapter-config.d.ts │ │ │ └── main.test.ts │ ├── adapter_TS_VIS_CustomESLint │ │ ├── .vscode │ │ │ ├── extensions.json │ │ │ └── settings.json │ │ ├── widgets │ │ │ └── test-adapter │ │ │ │ └── css │ │ │ │ └── style.css │ │ ├── admin │ │ │ ├── test-adapter.png │ │ │ └── tsconfig.json │ │ ├── test │ │ │ ├── tsconfig.json │ │ │ ├── package.js │ │ │ ├── mocharc.custom.json │ │ │ ├── integration.js │ │ │ ├── .eslintrc.json │ │ │ └── mocha.setup.js │ │ ├── .github │ │ │ ├── ISSUE_TEMPLATE │ │ │ │ └── config.yml │ │ │ ├── dependabot.yml │ │ │ └── auto-merge.yml │ │ ├── __meta__ │ │ │ └── npm_package_files.txt │ │ ├── .gitignore │ │ ├── tsconfig.build.json │ │ └── src │ │ │ ├── lib │ │ │ └── adapter-config.d.ts │ │ │ └── main.test.ts │ ├── ReleaseScript_JS │ │ └── .releaseconfig.json │ ├── vis_Widget │ │ ├── widgets │ │ │ └── test-widget │ │ │ │ └── css │ │ │ │ └── style.css │ │ ├── admin │ │ │ └── test-widget.png │ │ ├── test │ │ │ ├── package.js │ │ │ ├── mocharc.custom.json │ │ │ └── mocha.setup.js │ │ ├── __meta__ │ │ │ └── npm_package_files.txt │ │ ├── .github │ │ │ ├── ISSUE_TEMPLATE │ │ │ │ └── config.yml │ │ │ ├── dependabot.yml │ │ │ └── auto-merge.yml │ │ ├── .gitignore │ │ └── .create-adapter.json │ ├── adapter_JS_OfficialESLint │ │ ├── .vscode │ │ │ ├── extensions.json │ │ │ └── settings.json │ │ ├── admin │ │ │ └── test-adapter.png │ │ ├── test │ │ │ ├── package.js │ │ │ ├── mocharc.custom.json │ │ │ ├── integration.js │ │ │ └── mocha.setup.js │ │ ├── .github │ │ │ ├── ISSUE_TEMPLATE │ │ │ │ └── config.yml │ │ │ ├── dependabot.yml │ │ │ └── auto-merge.yml │ │ ├── __meta__ │ │ │ └── npm_package_files.txt │ │ ├── prettier.config.mjs │ │ ├── .gitignore │ │ └── lib │ │ │ └── adapter-config.d.ts │ ├── adapter_TS_ESLint_Tabs_DoubleQuotes_MIT │ │ ├── .vscode │ │ │ ├── extensions.json │ │ │ └── settings.json │ │ ├── admin │ │ │ ├── test-adapter.png │ │ │ ├── tsconfig.json │ │ │ └── jsonCustom.json │ │ ├── test │ │ │ ├── tsconfig.json │ │ │ ├── package.js │ │ │ ├── mocharc.custom.json │ │ │ ├── integration.js │ │ │ ├── .eslintrc.json │ │ │ └── mocha.setup.js │ │ ├── .github │ │ │ ├── ISSUE_TEMPLATE │ │ │ │ └── config.yml │ │ │ ├── dependabot.yml │ │ │ └── auto-merge.yml │ │ ├── __meta__ │ │ │ └── npm_package_files.txt │ │ ├── .gitignore │ │ ├── tsconfig.build.json │ │ └── src │ │ │ └── lib │ │ │ └── adapter-config.d.ts │ ├── i18n_json │ │ └── admin │ │ │ ├── test-adapter.png │ │ │ ├── i18n │ │ │ ├── en.json │ │ │ ├── zh-cn.json │ │ │ ├── de.json │ │ │ ├── nl.json │ │ │ ├── pl.json │ │ │ ├── ru.json │ │ │ ├── uk.json │ │ │ ├── es.json │ │ │ ├── fr.json │ │ │ ├── it.json │ │ │ └── pt.json │ │ │ ├── tsconfig.json │ │ │ └── style.css │ ├── ioBroker.hello-devcontainer │ │ ├── .vscode │ │ │ ├── extensions.json │ │ │ ├── launch.json │ │ │ └── settings.json │ │ ├── admin │ │ │ ├── hello-devcontainer.png │ │ │ ├── i18n │ │ │ │ ├── en.json │ │ │ │ ├── zh-cn.json │ │ │ │ ├── de.json │ │ │ │ ├── es.json │ │ │ │ ├── nl.json │ │ │ │ ├── pl.json │ │ │ │ ├── ru.json │ │ │ │ ├── uk.json │ │ │ │ ├── fr.json │ │ │ │ ├── pt.json │ │ │ │ └── it.json │ │ │ └── jsonConfig.json │ │ ├── test │ │ │ ├── package.js │ │ │ ├── tsconfig.json │ │ │ ├── mocharc.custom.json │ │ │ ├── integration.js │ │ │ └── mocha.setup.js │ │ ├── .github │ │ │ ├── ISSUE_TEMPLATE │ │ │ │ └── config.yml │ │ │ ├── dependabot.yml │ │ │ └── auto-merge.yml │ │ ├── .devcontainer │ │ │ ├── iobroker │ │ │ │ └── boot.sh │ │ │ └── scripts │ │ │ │ └── poststart.sh │ │ ├── .gitignore │ │ ├── tsconfig.check.json │ │ ├── __meta__ │ │ │ └── npm_package_files.txt │ │ └── lib │ │ │ └── adapter-config.d.ts │ ├── no_config │ │ └── admin │ │ │ └── test-adapter.png │ ├── adapter_TS_OfficialESLint │ │ ├── .vscode │ │ │ ├── extensions.json │ │ │ └── settings.json │ │ ├── admin │ │ │ ├── test-adapter.png │ │ │ ├── tsconfig.json │ │ │ └── style.css │ │ ├── __meta__ │ │ │ └── npm_package_files.txt │ │ ├── test │ │ │ ├── tsconfig.json │ │ │ ├── package.js │ │ │ ├── mocharc.custom.json │ │ │ ├── integration.js │ │ │ ├── .eslintrc.json │ │ │ └── mocha.setup.js │ │ ├── .github │ │ │ ├── ISSUE_TEMPLATE │ │ │ │ └── config.yml │ │ │ ├── dependabot.yml │ │ │ └── auto-merge.yml │ │ ├── prettier.config.mjs │ │ ├── .gitignore │ │ ├── tsconfig.build.json │ │ └── src │ │ │ ├── lib │ │ │ └── adapter-config.d.ts │ │ │ └── main.test.ts │ ├── adapter_TS_VIS_OfficialESLint │ │ ├── widgets │ │ │ └── test-adapter │ │ │ │ └── css │ │ │ │ └── style.css │ │ ├── .vscode │ │ │ ├── extensions.json │ │ │ └── settings.json │ │ ├── admin │ │ │ ├── test-adapter.png │ │ │ └── tsconfig.json │ │ ├── test │ │ │ ├── tsconfig.json │ │ │ ├── package.js │ │ │ ├── mocharc.custom.json │ │ │ ├── integration.js │ │ │ ├── .eslintrc.json │ │ │ └── mocha.setup.js │ │ ├── .github │ │ │ ├── ISSUE_TEMPLATE │ │ │ │ └── config.yml │ │ │ ├── dependabot.yml │ │ │ └── auto-merge.yml │ │ ├── prettier.config.mjs │ │ ├── __meta__ │ │ │ └── npm_package_files.txt │ │ ├── .gitignore │ │ ├── tsconfig.build.json │ │ └── src │ │ │ └── lib │ │ │ └── adapter-config.d.ts │ ├── adapter_TS_React_OfficialESLint │ │ ├── .vscode │ │ │ ├── extensions.json │ │ │ └── settings.json │ │ ├── admin │ │ │ ├── test-adapter.png │ │ │ ├── src │ │ │ │ ├── i18n │ │ │ │ │ ├── en.json │ │ │ │ │ ├── zh-cn.json │ │ │ │ │ ├── de.json │ │ │ │ │ ├── nl.json │ │ │ │ │ ├── pl.json │ │ │ │ │ ├── ru.json │ │ │ │ │ ├── es.json │ │ │ │ │ ├── fr.json │ │ │ │ │ ├── uk.json │ │ │ │ │ ├── it.json │ │ │ │ │ └── pt.json │ │ │ │ └── index.tsx │ │ │ ├── tsconfig.json │ │ │ └── index_m.html │ │ ├── __meta__ │ │ │ └── npm_package_files.txt │ │ ├── test │ │ │ ├── tsconfig.json │ │ │ ├── package.js │ │ │ ├── mocharc.custom.json │ │ │ ├── integration.js │ │ │ ├── .eslintrc.json │ │ │ └── mocha.setup.js │ │ ├── .github │ │ │ ├── ISSUE_TEMPLATE │ │ │ │ └── config.yml │ │ │ ├── dependabot.yml │ │ │ └── auto-merge.yml │ │ ├── prettier.config.mjs │ │ ├── .gitignore │ │ ├── tsconfig.build.json │ │ └── src │ │ │ └── lib │ │ │ └── adapter-config.d.ts │ ├── tabReact_adminHtml_JS │ │ └── admin │ │ │ ├── test-adapter.png │ │ │ ├── src │ │ │ ├── i18n │ │ │ │ ├── en.json │ │ │ │ ├── zh-cn.json │ │ │ │ ├── de.json │ │ │ │ ├── nl.json │ │ │ │ ├── pl.json │ │ │ │ ├── ru.json │ │ │ │ ├── es.json │ │ │ │ ├── fr.json │ │ │ │ ├── uk.json │ │ │ │ ├── it.json │ │ │ │ └── pt.json │ │ │ └── tab.jsx │ │ │ ├── words.js │ │ │ ├── .eslintrc.json │ │ │ ├── tab_m.html │ │ │ └── style.css │ ├── tabReact_adminReact_TS │ │ └── admin │ │ │ ├── test-adapter.png │ │ │ ├── src │ │ │ ├── i18n │ │ │ │ ├── en.json │ │ │ │ ├── zh-cn.json │ │ │ │ ├── pl.json │ │ │ │ ├── ru.json │ │ │ │ ├── de.json │ │ │ │ ├── es.json │ │ │ │ ├── fr.json │ │ │ │ ├── nl.json │ │ │ │ ├── uk.json │ │ │ │ ├── it.json │ │ │ │ └── pt.json │ │ │ ├── index.tsx │ │ │ └── tab.tsx │ │ │ ├── tab_m.html │ │ │ ├── tsconfig.json │ │ │ └── index_m.html │ ├── adapter_JS_JsonUI_ESLint_TypeChecking_Spaces_SingleQuotes_Apache-2.0 │ │ ├── .vscode │ │ │ └── extensions.json │ │ ├── admin │ │ │ ├── i18n │ │ │ │ ├── en.json │ │ │ │ ├── zh-cn.json │ │ │ │ ├── ru.json │ │ │ │ ├── de.json │ │ │ │ ├── es.json │ │ │ │ ├── nl.json │ │ │ │ ├── pl.json │ │ │ │ ├── uk.json │ │ │ │ ├── fr.json │ │ │ │ ├── it.json │ │ │ │ └── pt.json │ │ │ ├── test-adapter.png │ │ │ └── jsonConfig.json │ │ ├── test │ │ │ ├── package.js │ │ │ ├── tsconfig.json │ │ │ ├── mocharc.custom.json │ │ │ ├── integration.js │ │ │ └── mocha.setup.js │ │ ├── .github │ │ │ ├── ISSUE_TEMPLATE │ │ │ │ └── config.yml │ │ │ ├── dependabot.yml │ │ │ └── auto-merge.yml │ │ ├── .gitignore │ │ ├── tsconfig.check.json │ │ ├── __meta__ │ │ │ └── npm_package_files.txt │ │ └── lib │ │ │ └── adapter-config.d.ts │ ├── ReleaseScript_TS │ │ └── .releaseconfig.json │ ├── schedule │ │ └── test │ │ │ └── integration.js │ ├── devcontainer │ │ ├── .devcontainer │ │ │ ├── iobroker │ │ │ │ └── boot.sh │ │ │ └── scripts │ │ │ │ └── poststart.sh │ │ ├── .gitignore │ │ └── .vscode │ │ │ └── launch.json │ ├── TS_DoubleQuotes │ │ ├── admin │ │ │ └── src │ │ │ │ └── index.tsx │ │ └── src │ │ │ └── main.test.ts │ └── TS_SingleQuotes │ │ ├── admin │ │ └── src │ │ │ └── index.tsx │ │ └── src │ │ └── main.test.ts └── mocha.setup.js ├── adapter-creator.png ├── docs ├── screenshot.png └── updates │ ├── 20250404_devcontainer_improvements │ ├── devcontainer_name_after.png │ ├── devcontainer_name_before.png │ └── devcontainer_ports_panel.png │ ├── 20210818_no_travis.md │ ├── 20210301_prettier_config.md │ ├── 20210515_test_node_16.md │ ├── 20230507_eslintignore_words_js.md │ ├── 20220506_remove_unit_tests.md │ ├── 20201201_require_main.md │ ├── 20250406_admin_dependency_ge.md │ ├── 20210519_dev_server.md │ ├── 20201103_css_fix.md │ ├── 20200909_devcontainers_no_restart.md │ ├── 20220515_cancel_check_runs.md │ ├── 20221208_update_io-packages_json_schema_ref.md │ ├── 20210503_devcontainer_official_docker.md │ ├── 20250401_devcontainer_ssh.md │ ├── 20201107_typed_i18n_t.md │ ├── 20210515_sourcemaps.md │ ├── 20210902_github_dependency_caching.md │ ├── 20210503_vscode_io-package_schema.md │ ├── 20201105_adapter_react_fixes.md │ ├── 20240105_ecmaversion_latest.md │ ├── 20210510_adapter-react-fix.md │ └── 20210405_automerge_fixes.md ├── .vscode ├── extensions.json ├── settings.json ├── workspace.code-workspace └── launch.json ├── index.ts ├── core.ts ├── templates ├── admin │ ├── i18n │ │ ├── de.json.ts │ │ ├── en.json.ts │ │ ├── es.json.ts │ │ ├── fr.json.ts │ │ ├── it.json.ts │ │ ├── nl.json.ts │ │ ├── pl.json.ts │ │ ├── pt.json.ts │ │ ├── ru.json.ts │ │ ├── uk.json.ts │ │ └── zh-cn.json.ts │ ├── src │ │ └── i18n │ │ │ ├── de.json.ts │ │ │ ├── en.json.ts │ │ │ ├── es.json.ts │ │ │ ├── fr.json.ts │ │ │ ├── it.json.ts │ │ │ ├── nl.json.ts │ │ │ ├── pl.json.ts │ │ │ ├── pt.json.ts │ │ │ ├── ru.json.ts │ │ │ ├── uk.json.ts │ │ │ └── zh-cn.json.ts │ ├── tsconfig.raw.json │ ├── style.css.ts │ ├── tsconfig_JS-React.raw.json │ ├── tsconfig_TS-React.raw.json │ ├── _eslintrc_js_react.json.ts │ ├── tsconfig.json.ts │ └── style.raw.css ├── test │ ├── tsconfig.raw.json │ ├── package.raw.js │ ├── package.js.ts │ └── tsconfig.json.ts ├── _github │ ├── ISSUE_TEMPLATE │ │ ├── config.raw.yml │ │ ├── config.yml.ts │ │ ├── bug_report.yml.ts │ │ └── feature_request.yml.ts │ ├── auto-merge.yml.ts │ ├── workflows │ │ └── dependabot-auto-merge.yml.ts │ └── auto-merge.raw.yml ├── LICENSE.ts ├── _create-adapter.json.ts ├── tsconfig.check.raw.json ├── main.test.js.ts ├── tsconfig.build.raw.json ├── tsconfig.check.json.ts ├── src │ ├── main.test.ts.ts │ └── main.test.raw.ts ├── tsconfig.build.json.ts ├── _prettierignore.ts ├── widgets │ └── style.css.ts └── _devcontainer │ ├── parcel │ ├── _Dockerfile.ts │ └── run.sh.ts │ ├── iobroker │ └── boot.sh.ts │ └── scripts │ └── poststart.sh.ts ├── .mocharc.json ├── src ├── lib │ ├── core │ │ └── index.ts │ ├── index.ts │ └── constants.ts └── index.ts ├── .gitignore ├── .gitattributes ├── .github ├── test_migration.sh ├── auto-merge.yml ├── test_template_creation.sh └── dependabot.yml ├── tsconfig.build.json ├── prettier.config.mjs └── .editorconfig /.lgtm.yml: -------------------------------------------------------------------------------- 1 | path_classifiers: 2 | generated: 3 | - build 4 | -------------------------------------------------------------------------------- /bin/create-adapter.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | require("../build/src/cli.js"); 3 | -------------------------------------------------------------------------------- /test/baselines/TS_Prettier/.prettierignore: -------------------------------------------------------------------------------- 1 | package.json 2 | package-lock.json 3 | build/ -------------------------------------------------------------------------------- /adapter-creator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ioBroker/create-adapter/HEAD/adapter-creator.png -------------------------------------------------------------------------------- /docs/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ioBroker/create-adapter/HEAD/docs/screenshot.png -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"] 3 | } 4 | -------------------------------------------------------------------------------- /test/baselines/adapter_JS_React/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "dbaeumer.vscode-eslint" 4 | ] 5 | } -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "dbaeumer.vscode-eslint" 4 | ] 5 | } -------------------------------------------------------------------------------- /test/baselines/adapter_TS_WithoutBuild/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "dbaeumer.vscode-eslint" 4 | ] 5 | } -------------------------------------------------------------------------------- /test/baselines/adapter_TS_VIS_CustomESLint/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "dbaeumer.vscode-eslint" 4 | ] 5 | } -------------------------------------------------------------------------------- /test/baselines/ReleaseScript_JS/.releaseconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": [ 3 | "iobroker", 4 | "license", 5 | "manual-review" 6 | ] 7 | } -------------------------------------------------------------------------------- /test/baselines/TS_Prettier/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"] 3 | } 4 | -------------------------------------------------------------------------------- /test/baselines/vis_Widget/widgets/test-widget/css/style.css: -------------------------------------------------------------------------------- 1 | /* Style your widget here */ 2 | .test-widget-class { 3 | font-style: italic; 4 | } -------------------------------------------------------------------------------- /test/baselines/adapter_JS_OfficialESLint/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "dbaeumer.vscode-eslint" 4 | ] 5 | } -------------------------------------------------------------------------------- /index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This file contains all type exports so create-adapter can be used as a nice library. 3 | */ 4 | 5 | export * from "./src/lib"; 6 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_ESLint_Tabs_DoubleQuotes_MIT/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "dbaeumer.vscode-eslint" 4 | ] 5 | } -------------------------------------------------------------------------------- /test/baselines/i18n_json/admin/test-adapter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ioBroker/create-adapter/HEAD/test/baselines/i18n_json/admin/test-adapter.png -------------------------------------------------------------------------------- /test/baselines/ioBroker.hello-devcontainer/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "dbaeumer.vscode-eslint" 4 | ] 5 | } -------------------------------------------------------------------------------- /test/baselines/no_config/admin/test-adapter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ioBroker/create-adapter/HEAD/test/baselines/no_config/admin/test-adapter.png -------------------------------------------------------------------------------- /test/baselines/vis_Widget/admin/test-widget.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ioBroker/create-adapter/HEAD/test/baselines/vis_Widget/admin/test-widget.png -------------------------------------------------------------------------------- /core.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This file contains all core type exports that can be used by a browser application. 3 | */ 4 | 5 | export * from "./src/lib/core"; 6 | -------------------------------------------------------------------------------- /templates/admin/i18n/de.json.ts: -------------------------------------------------------------------------------- 1 | import { getI18nJsonTemplate } from "../../../src/lib/translation"; 2 | 3 | export = getI18nJsonTemplate("de", false); 4 | -------------------------------------------------------------------------------- /templates/admin/i18n/en.json.ts: -------------------------------------------------------------------------------- 1 | import { getI18nJsonTemplate } from "../../../src/lib/translation"; 2 | 3 | export = getI18nJsonTemplate("en", false); 4 | -------------------------------------------------------------------------------- /templates/admin/i18n/es.json.ts: -------------------------------------------------------------------------------- 1 | import { getI18nJsonTemplate } from "../../../src/lib/translation"; 2 | 3 | export = getI18nJsonTemplate("es", false); 4 | -------------------------------------------------------------------------------- /templates/admin/i18n/fr.json.ts: -------------------------------------------------------------------------------- 1 | import { getI18nJsonTemplate } from "../../../src/lib/translation"; 2 | 3 | export = getI18nJsonTemplate("fr", false); 4 | -------------------------------------------------------------------------------- /templates/admin/i18n/it.json.ts: -------------------------------------------------------------------------------- 1 | import { getI18nJsonTemplate } from "../../../src/lib/translation"; 2 | 3 | export = getI18nJsonTemplate("it", false); 4 | -------------------------------------------------------------------------------- /templates/admin/i18n/nl.json.ts: -------------------------------------------------------------------------------- 1 | import { getI18nJsonTemplate } from "../../../src/lib/translation"; 2 | 3 | export = getI18nJsonTemplate("nl", false); 4 | -------------------------------------------------------------------------------- /templates/admin/i18n/pl.json.ts: -------------------------------------------------------------------------------- 1 | import { getI18nJsonTemplate } from "../../../src/lib/translation"; 2 | 3 | export = getI18nJsonTemplate("pl", false); 4 | -------------------------------------------------------------------------------- /templates/admin/i18n/pt.json.ts: -------------------------------------------------------------------------------- 1 | import { getI18nJsonTemplate } from "../../../src/lib/translation"; 2 | 3 | export = getI18nJsonTemplate("pt", false); 4 | -------------------------------------------------------------------------------- /templates/admin/i18n/ru.json.ts: -------------------------------------------------------------------------------- 1 | import { getI18nJsonTemplate } from "../../../src/lib/translation"; 2 | 3 | export = getI18nJsonTemplate("ru", false); 4 | -------------------------------------------------------------------------------- /templates/admin/i18n/uk.json.ts: -------------------------------------------------------------------------------- 1 | import { getI18nJsonTemplate } from "../../../src/lib/translation"; 2 | 3 | export = getI18nJsonTemplate("uk", false); 4 | -------------------------------------------------------------------------------- /templates/admin/i18n/zh-cn.json.ts: -------------------------------------------------------------------------------- 1 | import { getI18nJsonTemplate } from "../../../src/lib/translation"; 2 | 3 | export = getI18nJsonTemplate("zh-cn", false); 4 | -------------------------------------------------------------------------------- /templates/admin/src/i18n/de.json.ts: -------------------------------------------------------------------------------- 1 | import { getI18nJsonTemplate } from "../../../../src/lib/translation"; 2 | 3 | export = getI18nJsonTemplate("de", true); 4 | -------------------------------------------------------------------------------- /templates/admin/src/i18n/en.json.ts: -------------------------------------------------------------------------------- 1 | import { getI18nJsonTemplate } from "../../../../src/lib/translation"; 2 | 3 | export = getI18nJsonTemplate("en", true); 4 | -------------------------------------------------------------------------------- /templates/admin/src/i18n/es.json.ts: -------------------------------------------------------------------------------- 1 | import { getI18nJsonTemplate } from "../../../../src/lib/translation"; 2 | 3 | export = getI18nJsonTemplate("es", true); 4 | -------------------------------------------------------------------------------- /templates/admin/src/i18n/fr.json.ts: -------------------------------------------------------------------------------- 1 | import { getI18nJsonTemplate } from "../../../../src/lib/translation"; 2 | 3 | export = getI18nJsonTemplate("fr", true); 4 | -------------------------------------------------------------------------------- /templates/admin/src/i18n/it.json.ts: -------------------------------------------------------------------------------- 1 | import { getI18nJsonTemplate } from "../../../../src/lib/translation"; 2 | 3 | export = getI18nJsonTemplate("it", true); 4 | -------------------------------------------------------------------------------- /templates/admin/src/i18n/nl.json.ts: -------------------------------------------------------------------------------- 1 | import { getI18nJsonTemplate } from "../../../../src/lib/translation"; 2 | 3 | export = getI18nJsonTemplate("nl", true); 4 | -------------------------------------------------------------------------------- /templates/admin/src/i18n/pl.json.ts: -------------------------------------------------------------------------------- 1 | import { getI18nJsonTemplate } from "../../../../src/lib/translation"; 2 | 3 | export = getI18nJsonTemplate("pl", true); 4 | -------------------------------------------------------------------------------- /templates/admin/src/i18n/pt.json.ts: -------------------------------------------------------------------------------- 1 | import { getI18nJsonTemplate } from "../../../../src/lib/translation"; 2 | 3 | export = getI18nJsonTemplate("pt", true); 4 | -------------------------------------------------------------------------------- /templates/admin/src/i18n/ru.json.ts: -------------------------------------------------------------------------------- 1 | import { getI18nJsonTemplate } from "../../../../src/lib/translation"; 2 | 3 | export = getI18nJsonTemplate("ru", true); 4 | -------------------------------------------------------------------------------- /templates/admin/src/i18n/uk.json.ts: -------------------------------------------------------------------------------- 1 | import { getI18nJsonTemplate } from "../../../../src/lib/translation"; 2 | 3 | export = getI18nJsonTemplate("uk", true); 4 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_VIS_CustomESLint/widgets/test-adapter/css/style.css: -------------------------------------------------------------------------------- 1 | /* Style your widget here */ 2 | .test-adapter-class { 3 | font-style: italic; 4 | } -------------------------------------------------------------------------------- /templates/admin/src/i18n/zh-cn.json.ts: -------------------------------------------------------------------------------- 1 | import { getI18nJsonTemplate } from "../../../../src/lib/translation"; 2 | 3 | export = getI18nJsonTemplate("zh-cn", true); 4 | -------------------------------------------------------------------------------- /test/baselines/adapter_JS_React/admin/test-adapter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ioBroker/create-adapter/HEAD/test/baselines/adapter_JS_React/admin/test-adapter.png -------------------------------------------------------------------------------- /test/baselines/adapter_TS_OfficialESLint/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "dbaeumer.vscode-eslint", 4 | "esbenp.prettier-vscode" 5 | ] 6 | } -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React/admin/test-adapter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ioBroker/create-adapter/HEAD/test/baselines/adapter_TS_React/admin/test-adapter.png -------------------------------------------------------------------------------- /test/baselines/adapter_TS_VIS_OfficialESLint/widgets/test-adapter/css/style.css: -------------------------------------------------------------------------------- 1 | /* Style your widget here */ 2 | .test-adapter-class { 3 | font-style: italic; 4 | } -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React_OfficialESLint/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "dbaeumer.vscode-eslint", 4 | "esbenp.prettier-vscode" 5 | ] 6 | } -------------------------------------------------------------------------------- /test/baselines/adapter_TS_VIS_OfficialESLint/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "dbaeumer.vscode-eslint", 4 | "esbenp.prettier-vscode" 5 | ] 6 | } -------------------------------------------------------------------------------- /.mocharc.json: -------------------------------------------------------------------------------- 1 | { 2 | "require": [ 3 | "./test/mocha.setup.js", 4 | "tsx/cjs", 5 | "source-map-support/register" 6 | ], 7 | "watch-files": ["src/**/*.test.ts"] 8 | } 9 | -------------------------------------------------------------------------------- /src/lib/core/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./actionsAndTransformers"; 2 | export * from "./licenses"; 3 | export * from "./migrationContextBase"; 4 | export * from "./questions"; 5 | -------------------------------------------------------------------------------- /test/baselines/i18n_json/admin/i18n/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Adapter settings for test-adapter", 3 | "option1": "option1", 4 | "option2": "option2" 5 | } -------------------------------------------------------------------------------- /test/baselines/tabReact_adminHtml_JS/admin/test-adapter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ioBroker/create-adapter/HEAD/test/baselines/tabReact_adminHtml_JS/admin/test-adapter.png -------------------------------------------------------------------------------- /test/baselines/adapter_TS_WithoutBuild/admin/test-adapter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ioBroker/create-adapter/HEAD/test/baselines/adapter_TS_WithoutBuild/admin/test-adapter.png -------------------------------------------------------------------------------- /test/baselines/tabReact_adminReact_TS/admin/test-adapter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ioBroker/create-adapter/HEAD/test/baselines/tabReact_adminReact_TS/admin/test-adapter.png -------------------------------------------------------------------------------- /test/baselines/adapter_JS_OfficialESLint/admin/test-adapter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ioBroker/create-adapter/HEAD/test/baselines/adapter_JS_OfficialESLint/admin/test-adapter.png -------------------------------------------------------------------------------- /test/baselines/adapter_TS_OfficialESLint/admin/test-adapter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ioBroker/create-adapter/HEAD/test/baselines/adapter_TS_OfficialESLint/admin/test-adapter.png -------------------------------------------------------------------------------- /test/baselines/adapter_JS_JsonUI_ESLint_TypeChecking_Spaces_SingleQuotes_Apache-2.0/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "dbaeumer.vscode-eslint" 4 | ] 5 | } -------------------------------------------------------------------------------- /test/baselines/adapter_JS_React/admin/src/i18n/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Adapter settings for test-adapter", 3 | "option1": "option1", 4 | "option2": "option2" 5 | } -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React/__meta__/npm_package_files.txt: -------------------------------------------------------------------------------- 1 | admin/index_m.html 2 | admin/style.css 3 | admin/test-adapter.png 4 | io-package.json 5 | LICENSE 6 | package.json 7 | README.md -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React/admin/src/i18n/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Adapter settings for test-adapter", 3 | "option1": "option1", 4 | "option2": "option2" 5 | } -------------------------------------------------------------------------------- /test/baselines/adapter_TS_VIS_CustomESLint/admin/test-adapter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ioBroker/create-adapter/HEAD/test/baselines/adapter_TS_VIS_CustomESLint/admin/test-adapter.png -------------------------------------------------------------------------------- /test/baselines/adapter_TS_VIS_OfficialESLint/admin/test-adapter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ioBroker/create-adapter/HEAD/test/baselines/adapter_TS_VIS_OfficialESLint/admin/test-adapter.png -------------------------------------------------------------------------------- /templates/test/tsconfig.raw.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "noImplicitAny": false 5 | }, 6 | "include": [ 7 | "./**/*.js" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React_OfficialESLint/admin/test-adapter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ioBroker/create-adapter/HEAD/test/baselines/adapter_TS_React_OfficialESLint/admin/test-adapter.png -------------------------------------------------------------------------------- /test/baselines/tabReact_adminHtml_JS/admin/src/i18n/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Adapter settings for test-adapter", 3 | "option1": "option1", 4 | "option2": "option2" 5 | } -------------------------------------------------------------------------------- /test/baselines/tabReact_adminReact_TS/admin/src/i18n/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Adapter settings for test-adapter", 3 | "option1": "option1", 4 | "option2": "option2" 5 | } -------------------------------------------------------------------------------- /test/baselines/ioBroker.hello-devcontainer/admin/hello-devcontainer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ioBroker/create-adapter/HEAD/test/baselines/ioBroker.hello-devcontainer/admin/hello-devcontainer.png -------------------------------------------------------------------------------- /templates/test/package.raw.js: -------------------------------------------------------------------------------- 1 | const path = require("path"); 2 | const { tests } = require("@iobroker/testing"); 3 | 4 | // Validate the package files 5 | tests.packageFiles(path.join(__dirname, "..")); 6 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React_OfficialESLint/__meta__/npm_package_files.txt: -------------------------------------------------------------------------------- 1 | admin/index_m.html 2 | admin/style.css 3 | admin/test-adapter.png 4 | io-package.json 5 | LICENSE 6 | package.json 7 | README.md -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React_OfficialESLint/admin/src/i18n/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Adapter settings for test-adapter", 3 | "option1": "option1", 4 | "option2": "option2" 5 | } -------------------------------------------------------------------------------- /test/baselines/tabReact_adminHtml_JS/admin/words.js: -------------------------------------------------------------------------------- 1 | /* eslint no-unused-vars: off */ 2 | /* eslint no-global-assign: off */ 3 | /* global systemDictionary */ 4 | 'use strict'; 5 | 6 | systemDictionary = {}; -------------------------------------------------------------------------------- /docs/updates/20250404_devcontainer_improvements/devcontainer_name_after.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ioBroker/create-adapter/HEAD/docs/updates/20250404_devcontainer_improvements/devcontainer_name_after.png -------------------------------------------------------------------------------- /docs/updates/20250404_devcontainer_improvements/devcontainer_name_before.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ioBroker/create-adapter/HEAD/docs/updates/20250404_devcontainer_improvements/devcontainer_name_before.png -------------------------------------------------------------------------------- /docs/updates/20250404_devcontainer_improvements/devcontainer_ports_panel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ioBroker/create-adapter/HEAD/docs/updates/20250404_devcontainer_improvements/devcontainer_ports_panel.png -------------------------------------------------------------------------------- /test/baselines/ReleaseScript_TS/.releaseconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": [ 3 | "iobroker", 4 | "license", 5 | "manual-review" 6 | ], 7 | "exec": { 8 | "before_commit": "npm run build" 9 | } 10 | } -------------------------------------------------------------------------------- /test/baselines/adapter_TS_ESLint_Tabs_DoubleQuotes_MIT/admin/test-adapter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ioBroker/create-adapter/HEAD/test/baselines/adapter_TS_ESLint_Tabs_DoubleQuotes_MIT/admin/test-adapter.png -------------------------------------------------------------------------------- /test/baselines/adapter_TS_OfficialESLint/__meta__/npm_package_files.txt: -------------------------------------------------------------------------------- 1 | admin/index_m.html 2 | admin/style.css 3 | admin/test-adapter.png 4 | admin/words.js 5 | io-package.json 6 | LICENSE 7 | package.json 8 | README.md -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React/test/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "noImplicitAny": false 5 | }, 6 | "include": [ 7 | "./**/*.js" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /test/baselines/ioBroker.hello-devcontainer/admin/i18n/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "hello-devcontainer adapter settings": "Adapter settings for hello-devcontainer", 3 | "option1": "option1", 4 | "option2": "option2" 5 | } -------------------------------------------------------------------------------- /test/baselines/vis_Widget/test/package.js: -------------------------------------------------------------------------------- 1 | const path = require("path"); 2 | const { tests } = require("@iobroker/testing"); 3 | 4 | // Validate the package files 5 | tests.packageFiles(path.join(__dirname, "..")); 6 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_OfficialESLint/test/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "noImplicitAny": false 5 | }, 6 | "include": [ 7 | "./**/*.js" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /test/baselines/vis_Widget/__meta__/npm_package_files.txt: -------------------------------------------------------------------------------- 1 | widgets/test-widget.html 2 | widgets/test-widget/css/style.css 3 | widgets/test-widget/js/test-widget.js 4 | io-package.json 5 | LICENSE 6 | package.json 7 | README.md -------------------------------------------------------------------------------- /templates/_github/ISSUE_TEMPLATE/config.raw.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: ioBroker Community 4 | url: https://forum.iobroker.net/ 5 | about: Please ask and answer questions here. -------------------------------------------------------------------------------- /test/baselines/adapter_JS_React/test/package.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const { tests } = require('@iobroker/testing'); 3 | 4 | // Validate the package files 5 | tests.packageFiles(path.join(__dirname, '..')); 6 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React/test/package.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const { tests } = require('@iobroker/testing'); 3 | 4 | // Validate the package files 5 | tests.packageFiles(path.join(__dirname, '..')); 6 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_VIS_CustomESLint/test/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "noImplicitAny": false 5 | }, 6 | "include": [ 7 | "./**/*.js" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_VIS_OfficialESLint/test/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "noImplicitAny": false 5 | }, 6 | "include": [ 7 | "./**/*.js" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /src/lib/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./core"; 2 | export * from "./createAdapter"; 3 | export * from "./localMigrationContext"; 4 | export * from "./packageVersions"; 5 | export * from "./tools"; 6 | export * from "./translation"; 7 | -------------------------------------------------------------------------------- /test/baselines/TS_Prettier/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | semi: true, 3 | trailingComma: 'all', 4 | singleQuote: true, 5 | printWidth: 120, 6 | useTabs: true, 7 | tabWidth: 4, 8 | endOfLine: 'lf', 9 | }; 10 | -------------------------------------------------------------------------------- /test/baselines/adapter_JS_OfficialESLint/test/package.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const { tests } = require('@iobroker/testing'); 3 | 4 | // Validate the package files 5 | tests.packageFiles(path.join(__dirname, '..')); 6 | -------------------------------------------------------------------------------- /test/baselines/adapter_JS_React/__meta__/npm_package_files.txt: -------------------------------------------------------------------------------- 1 | admin/index_m.html 2 | admin/style.css 3 | admin/test-adapter.png 4 | lib/adapter-config.d.ts 5 | io-package.json 6 | LICENSE 7 | main.js 8 | package.json 9 | README.md -------------------------------------------------------------------------------- /test/baselines/adapter_TS_OfficialESLint/test/package.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const { tests } = require('@iobroker/testing'); 3 | 4 | // Validate the package files 5 | tests.packageFiles(path.join(__dirname, '..')); 6 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React_OfficialESLint/test/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "noImplicitAny": false 5 | }, 6 | "include": [ 7 | "./**/*.js" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_WithoutBuild/test/package.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const { tests } = require('@iobroker/testing'); 3 | 4 | // Validate the package files 5 | tests.packageFiles(path.join(__dirname, '..')); 6 | -------------------------------------------------------------------------------- /test/baselines/i18n_json/admin/i18n/zh-cn.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "test-adapter的适配器设置", 3 | "option1": "Mock translation of 'option1' to 'zh-cn'", 4 | "option2": "Mock translation of 'option2' to 'zh-cn'" 5 | } -------------------------------------------------------------------------------- /test/baselines/adapter_TS_ESLint_Tabs_DoubleQuotes_MIT/test/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "noImplicitAny": false 5 | }, 6 | "include": [ 7 | "./**/*.js" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_VIS_CustomESLint/test/package.js: -------------------------------------------------------------------------------- 1 | const path = require("path"); 2 | const { tests } = require("@iobroker/testing"); 3 | 4 | // Validate the package files 5 | tests.packageFiles(path.join(__dirname, "..")); 6 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_VIS_OfficialESLint/test/package.js: -------------------------------------------------------------------------------- 1 | const path = require("path"); 2 | const { tests } = require("@iobroker/testing"); 3 | 4 | // Validate the package files 5 | tests.packageFiles(path.join(__dirname, "..")); 6 | -------------------------------------------------------------------------------- /test/baselines/ioBroker.hello-devcontainer/test/package.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const { tests } = require('@iobroker/testing'); 3 | 4 | // Validate the package files 5 | tests.packageFiles(path.join(__dirname, '..')); 6 | -------------------------------------------------------------------------------- /test/baselines/vis_Widget/.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: ioBroker Community 4 | url: https://forum.iobroker.net/ 5 | about: Please ask and answer questions here. -------------------------------------------------------------------------------- /test/baselines/adapter_JS_React/admin/src/i18n/zh-cn.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "test-adapter的适配器设置", 3 | "option1": "Mock translation of 'option1' to 'zh-cn'", 4 | "option2": "Mock translation of 'option2' to 'zh-cn'" 5 | } -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React/admin/src/i18n/zh-cn.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "test-adapter的适配器设置", 3 | "option1": "Mock translation of 'option1' to 'zh-cn'", 4 | "option2": "Mock translation of 'option2' to 'zh-cn'" 5 | } -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React_OfficialESLint/test/package.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const { tests } = require('@iobroker/testing'); 3 | 4 | // Validate the package files 5 | tests.packageFiles(path.join(__dirname, '..')); 6 | -------------------------------------------------------------------------------- /test/baselines/i18n_json/admin/i18n/de.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Adaptereinstellungen für test-adapter", 3 | "option1": "Mock translation of 'option1' to 'de'", 4 | "option2": "Mock translation of 'option2' to 'de'" 5 | } -------------------------------------------------------------------------------- /test/baselines/i18n_json/admin/i18n/nl.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Adapterinstellingen voor test-adapter", 3 | "option1": "Mock translation of 'option1' to 'nl'", 4 | "option2": "Mock translation of 'option2' to 'nl'" 5 | } -------------------------------------------------------------------------------- /test/baselines/i18n_json/admin/i18n/pl.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Ustawienia adaptera dla test-adapter", 3 | "option1": "Mock translation of 'option1' to 'pl'", 4 | "option2": "Mock translation of 'option2' to 'pl'" 5 | } -------------------------------------------------------------------------------- /test/baselines/i18n_json/admin/i18n/ru.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Настройки адаптера для test-adapter", 3 | "option1": "Mock translation of 'option1' to 'ru'", 4 | "option2": "Mock translation of 'option2' to 'ru'" 5 | } -------------------------------------------------------------------------------- /test/baselines/i18n_json/admin/i18n/uk.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Налаштування адаптера для test-adapter", 3 | "option1": "Mock translation of 'option1' to 'uk'", 4 | "option2": "Mock translation of 'option2' to 'uk'" 5 | } -------------------------------------------------------------------------------- /test/baselines/adapter_JS_JsonUI_ESLint_TypeChecking_Spaces_SingleQuotes_Apache-2.0/admin/i18n/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Adapter settings for test-adapter", 3 | "option1": "option1", 4 | "option2": "option2" 5 | } -------------------------------------------------------------------------------- /test/baselines/adapter_JS_React/.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: ioBroker Community 4 | url: https://forum.iobroker.net/ 5 | about: Please ask and answer questions here. -------------------------------------------------------------------------------- /test/baselines/adapter_TS_ESLint_Tabs_DoubleQuotes_MIT/test/package.js: -------------------------------------------------------------------------------- 1 | const path = require("path"); 2 | const { tests } = require("@iobroker/testing"); 3 | 4 | // Validate the package files 5 | tests.packageFiles(path.join(__dirname, "..")); 6 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React/.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: ioBroker Community 4 | url: https://forum.iobroker.net/ 5 | about: Please ask and answer questions here. -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React/test/mocharc.custom.json: -------------------------------------------------------------------------------- 1 | { 2 | "require": [ 3 | "test/mocha.setup.js", 4 | "ts-node/register", 5 | "source-map-support/register" 6 | ], 7 | "watch-files": [ 8 | "src/**/*.test.ts" 9 | ] 10 | } -------------------------------------------------------------------------------- /test/baselines/i18n_json/admin/i18n/es.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Ajustes del adaptador para test-adapter", 3 | "option1": "Mock translation of 'option1' to 'es'", 4 | "option2": "Mock translation of 'option2' to 'es'" 5 | } -------------------------------------------------------------------------------- /test/baselines/i18n_json/admin/i18n/fr.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Paramètres d'adaptateur pour test-adapter", 3 | "option1": "Mock translation of 'option1' to 'fr'", 4 | "option2": "Mock translation of 'option2' to 'fr'" 5 | } -------------------------------------------------------------------------------- /test/baselines/tabReact_adminHtml_JS/admin/src/i18n/zh-cn.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "test-adapter的适配器设置", 3 | "option1": "Mock translation of 'option1' to 'zh-cn'", 4 | "option2": "Mock translation of 'option2' to 'zh-cn'" 5 | } -------------------------------------------------------------------------------- /templates/LICENSE.ts: -------------------------------------------------------------------------------- 1 | import type { TemplateFunction } from "../src/lib/createAdapter"; 2 | import { getFormattedLicense } from "../src/lib/tools"; 3 | 4 | export = (answers => { 5 | return getFormattedLicense(answers); 6 | }) as TemplateFunction; 7 | -------------------------------------------------------------------------------- /test/baselines/adapter_JS_OfficialESLint/.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: ioBroker Community 4 | url: https://forum.iobroker.net/ 5 | about: Please ask and answer questions here. -------------------------------------------------------------------------------- /test/baselines/adapter_JS_React/admin/src/i18n/de.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Adaptereinstellungen für test-adapter", 3 | "option1": "Mock translation of 'option1' to 'de'", 4 | "option2": "Mock translation of 'option2' to 'de'" 5 | } -------------------------------------------------------------------------------- /test/baselines/adapter_JS_React/admin/src/i18n/nl.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Adapterinstellingen voor test-adapter", 3 | "option1": "Mock translation of 'option1' to 'nl'", 4 | "option2": "Mock translation of 'option2' to 'nl'" 5 | } -------------------------------------------------------------------------------- /test/baselines/adapter_JS_React/admin/src/i18n/pl.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Ustawienia adaptera dla test-adapter", 3 | "option1": "Mock translation of 'option1' to 'pl'", 4 | "option2": "Mock translation of 'option2' to 'pl'" 5 | } -------------------------------------------------------------------------------- /test/baselines/adapter_JS_React/admin/src/i18n/ru.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Настройки адаптера для test-adapter", 3 | "option1": "Mock translation of 'option1' to 'ru'", 4 | "option2": "Mock translation of 'option2' to 'ru'" 5 | } -------------------------------------------------------------------------------- /test/baselines/adapter_TS_OfficialESLint/.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: ioBroker Community 4 | url: https://forum.iobroker.net/ 5 | about: Please ask and answer questions here. -------------------------------------------------------------------------------- /test/baselines/adapter_TS_OfficialESLint/test/mocharc.custom.json: -------------------------------------------------------------------------------- 1 | { 2 | "require": [ 3 | "test/mocha.setup.js", 4 | "ts-node/register", 5 | "source-map-support/register" 6 | ], 7 | "watch-files": [ 8 | "src/**/*.test.ts" 9 | ] 10 | } -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React/admin/src/i18n/de.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Adaptereinstellungen für test-adapter", 3 | "option1": "Mock translation of 'option1' to 'de'", 4 | "option2": "Mock translation of 'option2' to 'de'" 5 | } -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React/admin/src/i18n/nl.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Adapterinstellingen voor test-adapter", 3 | "option1": "Mock translation of 'option1' to 'nl'", 4 | "option2": "Mock translation of 'option2' to 'nl'" 5 | } -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React/admin/src/i18n/pl.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Ustawienia adaptera dla test-adapter", 3 | "option1": "Mock translation of 'option1' to 'pl'", 4 | "option2": "Mock translation of 'option2' to 'pl'" 5 | } -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React/admin/src/i18n/ru.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Настройки адаптера для test-adapter", 3 | "option1": "Mock translation of 'option1' to 'ru'", 4 | "option2": "Mock translation of 'option2' to 'ru'" 5 | } -------------------------------------------------------------------------------- /test/baselines/adapter_TS_WithoutBuild/.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: ioBroker Community 4 | url: https://forum.iobroker.net/ 5 | about: Please ask and answer questions here. -------------------------------------------------------------------------------- /test/baselines/adapter_TS_WithoutBuild/test/mocharc.custom.json: -------------------------------------------------------------------------------- 1 | { 2 | "require": [ 3 | "test/mocha.setup.js", 4 | "ts-node/register", 5 | "source-map-support/register" 6 | ], 7 | "watch-files": [ 8 | "src/**/*.test.ts" 9 | ] 10 | } -------------------------------------------------------------------------------- /test/baselines/i18n_json/admin/i18n/it.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Impostazioni dell'adattatore per test-adapter", 3 | "option1": "Mock translation of 'option1' to 'it'", 4 | "option2": "Mock translation of 'option2' to 'it'" 5 | } -------------------------------------------------------------------------------- /test/baselines/i18n_json/admin/i18n/pt.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Configurações do adaptador para test-adapter", 3 | "option1": "Mock translation of 'option1' to 'pt'", 4 | "option2": "Mock translation of 'option2' to 'pt'" 5 | } -------------------------------------------------------------------------------- /test/baselines/ioBroker.hello-devcontainer/test/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "noImplicitAny": false 5 | }, 6 | "include": [ 7 | "./**/*.js" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /test/baselines/tabReact_adminReact_TS/admin/src/i18n/zh-cn.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "test-adapter的适配器设置", 3 | "option1": "Mock translation of 'option1' to 'zh-cn'", 4 | "option2": "Mock translation of 'option2' to 'zh-cn'" 5 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | 3 | # Project files 4 | /nbproject 5 | 6 | # Build output 7 | /build 8 | 9 | # compiled test-files 10 | /.nyc_output 11 | /coverage 12 | 13 | # npm packet files 14 | iobroker-create-adapter-*.tgz 15 | /.idea 16 | -------------------------------------------------------------------------------- /test/baselines/adapter_JS_React/admin/src/i18n/es.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Ajustes del adaptador para test-adapter", 3 | "option1": "Mock translation of 'option1' to 'es'", 4 | "option2": "Mock translation of 'option2' to 'es'" 5 | } -------------------------------------------------------------------------------- /test/baselines/adapter_JS_React/admin/src/i18n/fr.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Paramètres d'adaptateur pour test-adapter", 3 | "option1": "Mock translation of 'option1' to 'fr'", 4 | "option2": "Mock translation of 'option2' to 'fr'" 5 | } -------------------------------------------------------------------------------- /test/baselines/adapter_JS_React/admin/src/i18n/uk.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Налаштування адаптера для test-adapter", 3 | "option1": "Mock translation of 'option1' to 'uk'", 4 | "option2": "Mock translation of 'option2' to 'uk'" 5 | } -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React/admin/src/i18n/es.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Ajustes del adaptador para test-adapter", 3 | "option1": "Mock translation of 'option1' to 'es'", 4 | "option2": "Mock translation of 'option2' to 'es'" 5 | } -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React/admin/src/i18n/fr.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Paramètres d'adaptateur pour test-adapter", 3 | "option1": "Mock translation of 'option1' to 'fr'", 4 | "option2": "Mock translation of 'option2' to 'fr'" 5 | } -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React/admin/src/i18n/uk.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Налаштування адаптера для test-adapter", 3 | "option1": "Mock translation of 'option1' to 'uk'", 4 | "option2": "Mock translation of 'option2' to 'uk'" 5 | } -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React_OfficialESLint/admin/src/i18n/zh-cn.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "test-adapter的适配器设置", 3 | "option1": "Mock translation of 'option1' to 'zh-cn'", 4 | "option2": "Mock translation of 'option2' to 'zh-cn'" 5 | } -------------------------------------------------------------------------------- /test/baselines/adapter_TS_VIS_CustomESLint/.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: ioBroker Community 4 | url: https://forum.iobroker.net/ 5 | about: Please ask and answer questions here. -------------------------------------------------------------------------------- /test/baselines/adapter_TS_VIS_CustomESLint/test/mocharc.custom.json: -------------------------------------------------------------------------------- 1 | { 2 | "require": [ 3 | "test/mocha.setup.js", 4 | "ts-node/register", 5 | "source-map-support/register" 6 | ], 7 | "watch-files": [ 8 | "src/**/*.test.ts" 9 | ] 10 | } -------------------------------------------------------------------------------- /test/baselines/adapter_TS_VIS_OfficialESLint/.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: ioBroker Community 4 | url: https://forum.iobroker.net/ 5 | about: Please ask and answer questions here. -------------------------------------------------------------------------------- /test/baselines/adapter_TS_VIS_OfficialESLint/test/mocharc.custom.json: -------------------------------------------------------------------------------- 1 | { 2 | "require": [ 3 | "test/mocha.setup.js", 4 | "ts-node/register", 5 | "source-map-support/register" 6 | ], 7 | "watch-files": [ 8 | "src/**/*.test.ts" 9 | ] 10 | } -------------------------------------------------------------------------------- /test/baselines/ioBroker.hello-devcontainer/.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: ioBroker Community 4 | url: https://forum.iobroker.net/ 5 | about: Please ask and answer questions here. -------------------------------------------------------------------------------- /test/baselines/tabReact_adminHtml_JS/admin/src/i18n/de.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Adaptereinstellungen für test-adapter", 3 | "option1": "Mock translation of 'option1' to 'de'", 4 | "option2": "Mock translation of 'option2' to 'de'" 5 | } -------------------------------------------------------------------------------- /test/baselines/tabReact_adminHtml_JS/admin/src/i18n/nl.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Adapterinstellingen voor test-adapter", 3 | "option1": "Mock translation of 'option1' to 'nl'", 4 | "option2": "Mock translation of 'option2' to 'nl'" 5 | } -------------------------------------------------------------------------------- /test/baselines/tabReact_adminHtml_JS/admin/src/i18n/pl.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Ustawienia adaptera dla test-adapter", 3 | "option1": "Mock translation of 'option1' to 'pl'", 4 | "option2": "Mock translation of 'option2' to 'pl'" 5 | } -------------------------------------------------------------------------------- /test/baselines/tabReact_adminHtml_JS/admin/src/i18n/ru.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Настройки адаптера для test-adapter", 3 | "option1": "Mock translation of 'option1' to 'ru'", 4 | "option2": "Mock translation of 'option2' to 'ru'" 5 | } -------------------------------------------------------------------------------- /test/baselines/tabReact_adminReact_TS/admin/src/i18n/pl.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Ustawienia adaptera dla test-adapter", 3 | "option1": "Mock translation of 'option1' to 'pl'", 4 | "option2": "Mock translation of 'option2' to 'pl'" 5 | } -------------------------------------------------------------------------------- /test/baselines/tabReact_adminReact_TS/admin/src/i18n/ru.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Настройки адаптера для test-adapter", 3 | "option1": "Mock translation of 'option1' to 'ru'", 4 | "option2": "Mock translation of 'option2' to 'ru'" 5 | } -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Ensure text files have LF line endings 2 | * text eol=lf 3 | 4 | # Images should be treated as binary 5 | # (binary is a macro for -text -diff) 6 | *.png binary 7 | *.jpg binary 8 | *.jpeg binary 9 | *.gif binary 10 | -------------------------------------------------------------------------------- /test/baselines/adapter_JS_React/admin/src/i18n/it.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Impostazioni dell'adattatore per test-adapter", 3 | "option1": "Mock translation of 'option1' to 'it'", 4 | "option2": "Mock translation of 'option2' to 'it'" 5 | } -------------------------------------------------------------------------------- /test/baselines/adapter_JS_React/admin/src/i18n/pt.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Configurações do adaptador para test-adapter", 3 | "option1": "Mock translation of 'option1' to 'pt'", 4 | "option2": "Mock translation of 'option2' to 'pt'" 5 | } -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React/admin/src/i18n/it.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Impostazioni dell'adattatore per test-adapter", 3 | "option1": "Mock translation of 'option1' to 'it'", 4 | "option2": "Mock translation of 'option2' to 'it'" 5 | } -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React/admin/src/i18n/pt.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Configurações do adaptador para test-adapter", 3 | "option1": "Mock translation of 'option1' to 'pt'", 4 | "option2": "Mock translation of 'option2' to 'pt'" 5 | } -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React_OfficialESLint/.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: ioBroker Community 4 | url: https://forum.iobroker.net/ 5 | about: Please ask and answer questions here. -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React_OfficialESLint/test/mocharc.custom.json: -------------------------------------------------------------------------------- 1 | { 2 | "require": [ 3 | "test/mocha.setup.js", 4 | "ts-node/register", 5 | "source-map-support/register" 6 | ], 7 | "watch-files": [ 8 | "src/**/*.test.ts" 9 | ] 10 | } -------------------------------------------------------------------------------- /test/baselines/tabReact_adminHtml_JS/admin/src/i18n/es.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Ajustes del adaptador para test-adapter", 3 | "option1": "Mock translation of 'option1' to 'es'", 4 | "option2": "Mock translation of 'option2' to 'es'" 5 | } -------------------------------------------------------------------------------- /test/baselines/tabReact_adminHtml_JS/admin/src/i18n/fr.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Paramètres d'adaptateur pour test-adapter", 3 | "option1": "Mock translation of 'option1' to 'fr'", 4 | "option2": "Mock translation of 'option2' to 'fr'" 5 | } -------------------------------------------------------------------------------- /test/baselines/tabReact_adminHtml_JS/admin/src/i18n/uk.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Налаштування адаптера для test-adapter", 3 | "option1": "Mock translation of 'option1' to 'uk'", 4 | "option2": "Mock translation of 'option2' to 'uk'" 5 | } -------------------------------------------------------------------------------- /test/baselines/tabReact_adminReact_TS/admin/src/i18n/de.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Adaptereinstellungen für test-adapter", 3 | "option1": "Mock translation of 'option1' to 'de'", 4 | "option2": "Mock translation of 'option2' to 'de'" 5 | } -------------------------------------------------------------------------------- /test/baselines/tabReact_adminReact_TS/admin/src/i18n/es.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Ajustes del adaptador para test-adapter", 3 | "option1": "Mock translation of 'option1' to 'es'", 4 | "option2": "Mock translation of 'option2' to 'es'" 5 | } -------------------------------------------------------------------------------- /test/baselines/tabReact_adminReact_TS/admin/src/i18n/fr.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Paramètres d'adaptateur pour test-adapter", 3 | "option1": "Mock translation of 'option1' to 'fr'", 4 | "option2": "Mock translation of 'option2' to 'fr'" 5 | } -------------------------------------------------------------------------------- /test/baselines/tabReact_adminReact_TS/admin/src/i18n/nl.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Adapterinstellingen voor test-adapter", 3 | "option1": "Mock translation of 'option1' to 'nl'", 4 | "option2": "Mock translation of 'option2' to 'nl'" 5 | } -------------------------------------------------------------------------------- /test/baselines/tabReact_adminReact_TS/admin/src/i18n/uk.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Налаштування адаптера для test-adapter", 3 | "option1": "Mock translation of 'option1' to 'uk'", 4 | "option2": "Mock translation of 'option2' to 'uk'" 5 | } -------------------------------------------------------------------------------- /test/baselines/vis_Widget/test/mocharc.custom.json: -------------------------------------------------------------------------------- 1 | { 2 | "require": [ 3 | "test/mocha.setup.js" 4 | ], 5 | "watch-files": [ 6 | "!(node_modules|test)/**/*.test.js", 7 | "*.test.js", 8 | "test/**/test!(PackageFiles|Startup).js" 9 | ] 10 | } -------------------------------------------------------------------------------- /.github/test_migration.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Make sure the paths we reference are relative to this script 6 | cd "${BASH_SOURCE%/*}" || exit 7 | 8 | # Run the TypeScript migration test 9 | node --require tsx/cjs test_migration.ts 10 | -------------------------------------------------------------------------------- /test/baselines/adapter_JS_OfficialESLint/__meta__/npm_package_files.txt: -------------------------------------------------------------------------------- 1 | admin/index_m.html 2 | admin/style.css 3 | admin/test-adapter.png 4 | admin/words.js 5 | lib/adapter-config.d.ts 6 | io-package.json 7 | LICENSE 8 | main.js 9 | package.json 10 | README.md -------------------------------------------------------------------------------- /test/baselines/adapter_JS_OfficialESLint/prettier.config.mjs: -------------------------------------------------------------------------------- 1 | // iobroker prettier configuration file 2 | import prettierConfig from '@iobroker/eslint-config/prettier.config.mjs'; 3 | 4 | export default { 5 | ...prettierConfig, 6 | singleQuote: true, 7 | }; -------------------------------------------------------------------------------- /test/baselines/adapter_JS_React/test/mocharc.custom.json: -------------------------------------------------------------------------------- 1 | { 2 | "require": [ 3 | "test/mocha.setup.js" 4 | ], 5 | "watch-files": [ 6 | "!(node_modules|test)/**/*.test.js", 7 | "*.test.js", 8 | "test/**/test!(PackageFiles|Startup).js" 9 | ] 10 | } -------------------------------------------------------------------------------- /test/baselines/adapter_TS_ESLint_Tabs_DoubleQuotes_MIT/.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: ioBroker Community 4 | url: https://forum.iobroker.net/ 5 | about: Please ask and answer questions here. -------------------------------------------------------------------------------- /test/baselines/adapter_TS_ESLint_Tabs_DoubleQuotes_MIT/test/mocharc.custom.json: -------------------------------------------------------------------------------- 1 | { 2 | "require": [ 3 | "test/mocha.setup.js", 4 | "ts-node/register", 5 | "source-map-support/register" 6 | ], 7 | "watch-files": [ 8 | "src/**/*.test.ts" 9 | ] 10 | } -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React_OfficialESLint/admin/src/i18n/de.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Adaptereinstellungen für test-adapter", 3 | "option1": "Mock translation of 'option1' to 'de'", 4 | "option2": "Mock translation of 'option2' to 'de'" 5 | } -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React_OfficialESLint/admin/src/i18n/nl.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Adapterinstellingen voor test-adapter", 3 | "option1": "Mock translation of 'option1' to 'nl'", 4 | "option2": "Mock translation of 'option2' to 'nl'" 5 | } -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React_OfficialESLint/admin/src/i18n/pl.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Ustawienia adaptera dla test-adapter", 3 | "option1": "Mock translation of 'option1' to 'pl'", 4 | "option2": "Mock translation of 'option2' to 'pl'" 5 | } -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React_OfficialESLint/admin/src/i18n/ru.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Настройки адаптера для test-adapter", 3 | "option1": "Mock translation of 'option1' to 'ru'", 4 | "option2": "Mock translation of 'option2' to 'ru'" 5 | } -------------------------------------------------------------------------------- /test/baselines/tabReact_adminHtml_JS/admin/src/i18n/it.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Impostazioni dell'adattatore per test-adapter", 3 | "option1": "Mock translation of 'option1' to 'it'", 4 | "option2": "Mock translation of 'option2' to 'it'" 5 | } -------------------------------------------------------------------------------- /test/baselines/tabReact_adminHtml_JS/admin/src/i18n/pt.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Configurações do adaptador para test-adapter", 3 | "option1": "Mock translation of 'option1' to 'pt'", 4 | "option2": "Mock translation of 'option2' to 'pt'" 5 | } -------------------------------------------------------------------------------- /test/baselines/tabReact_adminReact_TS/admin/src/i18n/it.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Impostazioni dell'adattatore per test-adapter", 3 | "option1": "Mock translation of 'option1' to 'it'", 4 | "option2": "Mock translation of 'option2' to 'it'" 5 | } -------------------------------------------------------------------------------- /test/baselines/tabReact_adminReact_TS/admin/src/i18n/pt.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Configurações do adaptador para test-adapter", 3 | "option1": "Mock translation of 'option1' to 'pt'", 4 | "option2": "Mock translation of 'option2' to 'pt'" 5 | } -------------------------------------------------------------------------------- /templates/test/package.js.ts: -------------------------------------------------------------------------------- 1 | import type { TemplateFunction } from "../../src/lib/createAdapter"; 2 | import { readFile } from "../../src/lib/createAdapter"; 3 | 4 | export = (_answers => { 5 | return readFile("package.raw.js", __dirname); 6 | }) as TemplateFunction; 7 | -------------------------------------------------------------------------------- /test/baselines/adapter_JS_JsonUI_ESLint_TypeChecking_Spaces_SingleQuotes_Apache-2.0/admin/test-adapter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ioBroker/create-adapter/HEAD/test/baselines/adapter_JS_JsonUI_ESLint_TypeChecking_Spaces_SingleQuotes_Apache-2.0/admin/test-adapter.png -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React_OfficialESLint/admin/src/i18n/es.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Ajustes del adaptador para test-adapter", 3 | "option1": "Mock translation of 'option1' to 'es'", 4 | "option2": "Mock translation of 'option2' to 'es'" 5 | } -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React_OfficialESLint/admin/src/i18n/fr.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Paramètres d'adaptateur pour test-adapter", 3 | "option1": "Mock translation of 'option1' to 'fr'", 4 | "option2": "Mock translation of 'option2' to 'fr'" 5 | } -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React_OfficialESLint/admin/src/i18n/uk.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Налаштування адаптера для test-adapter", 3 | "option1": "Mock translation of 'option1' to 'uk'", 4 | "option2": "Mock translation of 'option2' to 'uk'" 5 | } -------------------------------------------------------------------------------- /test/baselines/ioBroker.hello-devcontainer/admin/i18n/zh-cn.json: -------------------------------------------------------------------------------- 1 | { 2 | "hello-devcontainer adapter settings": "hello-devcontainer的适配器设置", 3 | "option1": "Mock translation of 'option1' to 'zh-cn'", 4 | "option2": "Mock translation of 'option2' to 'zh-cn'" 5 | } -------------------------------------------------------------------------------- /test/baselines/adapter_JS_JsonUI_ESLint_TypeChecking_Spaces_SingleQuotes_Apache-2.0/test/package.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const { tests } = require('@iobroker/testing'); 3 | 4 | // Validate the package files 5 | tests.packageFiles(path.join(__dirname, '..')); 6 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_OfficialESLint/prettier.config.mjs: -------------------------------------------------------------------------------- 1 | // iobroker prettier configuration file 2 | import prettierConfig from '@iobroker/eslint-config/prettier.config.mjs'; 3 | 4 | export default { 5 | ...prettierConfig, 6 | useTabs: true, 7 | singleQuote: true, 8 | }; -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React_OfficialESLint/admin/src/i18n/it.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Impostazioni dell'adattatore per test-adapter", 3 | "option1": "Mock translation of 'option1' to 'it'", 4 | "option2": "Mock translation of 'option2' to 'it'" 5 | } -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React_OfficialESLint/admin/src/i18n/pt.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Configurações do adaptador para test-adapter", 3 | "option1": "Mock translation of 'option1' to 'pt'", 4 | "option2": "Mock translation of 'option2' to 'pt'" 5 | } -------------------------------------------------------------------------------- /src/lib/constants.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Constants for default and fallback values used throughout the adapter creation process 3 | */ 4 | 5 | /** The recommended Node.js version to use as a fallback when none is specified */ 6 | export const RECOMMENDED_NODE_VERSION_FALLBACK = "20"; 7 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_VIS_OfficialESLint/prettier.config.mjs: -------------------------------------------------------------------------------- 1 | // iobroker prettier configuration file 2 | import prettierConfig from '@iobroker/eslint-config/prettier.config.mjs'; 3 | 4 | export default { 5 | ...prettierConfig, 6 | useTabs: true, 7 | singleQuote: false, 8 | }; -------------------------------------------------------------------------------- /test/baselines/ioBroker.hello-devcontainer/admin/i18n/de.json: -------------------------------------------------------------------------------- 1 | { 2 | "hello-devcontainer adapter settings": "Adaptereinstellungen für hello-devcontainer", 3 | "option1": "Mock translation of 'option1' to 'de'", 4 | "option2": "Mock translation of 'option2' to 'de'" 5 | } -------------------------------------------------------------------------------- /test/baselines/ioBroker.hello-devcontainer/admin/i18n/es.json: -------------------------------------------------------------------------------- 1 | { 2 | "hello-devcontainer adapter settings": "Ajustes del adaptador para hello-devcontainer", 3 | "option1": "Mock translation of 'option1' to 'es'", 4 | "option2": "Mock translation of 'option2' to 'es'" 5 | } -------------------------------------------------------------------------------- /test/baselines/ioBroker.hello-devcontainer/admin/i18n/nl.json: -------------------------------------------------------------------------------- 1 | { 2 | "hello-devcontainer adapter settings": "Adapterinstellingen voor hello-devcontainer", 3 | "option1": "Mock translation of 'option1' to 'nl'", 4 | "option2": "Mock translation of 'option2' to 'nl'" 5 | } -------------------------------------------------------------------------------- /test/baselines/ioBroker.hello-devcontainer/admin/i18n/pl.json: -------------------------------------------------------------------------------- 1 | { 2 | "hello-devcontainer adapter settings": "Ustawienia adaptera dla hello-devcontainer", 3 | "option1": "Mock translation of 'option1' to 'pl'", 4 | "option2": "Mock translation of 'option2' to 'pl'" 5 | } -------------------------------------------------------------------------------- /test/baselines/ioBroker.hello-devcontainer/admin/i18n/ru.json: -------------------------------------------------------------------------------- 1 | { 2 | "hello-devcontainer adapter settings": "Настройки адаптера для hello-devcontainer", 3 | "option1": "Mock translation of 'option1' to 'ru'", 4 | "option2": "Mock translation of 'option2' to 'ru'" 5 | } -------------------------------------------------------------------------------- /test/baselines/ioBroker.hello-devcontainer/admin/i18n/uk.json: -------------------------------------------------------------------------------- 1 | { 2 | "hello-devcontainer adapter settings": "Налаштування адаптера для hello-devcontainer", 3 | "option1": "Mock translation of 'option1' to 'uk'", 4 | "option2": "Mock translation of 'option2' to 'uk'" 5 | } -------------------------------------------------------------------------------- /test/baselines/adapter_JS_React/admin/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "browser": true, 4 | "es6": true 5 | }, 6 | "parserOptions": { 7 | "sourceType": "module", 8 | "project": "./tsconfig.json" 9 | }, 10 | "rules": { 11 | "react/prop-types": "off" 12 | } 13 | } -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React_OfficialESLint/prettier.config.mjs: -------------------------------------------------------------------------------- 1 | // iobroker prettier configuration file 2 | import prettierConfig from '@iobroker/eslint-config/prettier.config.mjs'; 3 | 4 | export default { 5 | ...prettierConfig, 6 | useTabs: true, 7 | singleQuote: true, 8 | }; -------------------------------------------------------------------------------- /test/baselines/ioBroker.hello-devcontainer/admin/i18n/fr.json: -------------------------------------------------------------------------------- 1 | { 2 | "hello-devcontainer adapter settings": "Paramètres d'adaptateur pour hello-devcontainer", 3 | "option1": "Mock translation of 'option1' to 'fr'", 4 | "option2": "Mock translation of 'option2' to 'fr'" 5 | } -------------------------------------------------------------------------------- /test/baselines/ioBroker.hello-devcontainer/admin/i18n/pt.json: -------------------------------------------------------------------------------- 1 | { 2 | "hello-devcontainer adapter settings": "Configurações do adaptador para hello-devcontainer", 3 | "option1": "Mock translation of 'option1' to 'pt'", 4 | "option2": "Mock translation of 'option2' to 'pt'" 5 | } -------------------------------------------------------------------------------- /.github/auto-merge.yml: -------------------------------------------------------------------------------- 1 | - match: 2 | dependency_type: development 3 | update_type: "semver:minor" 4 | - match: 5 | dependency_type: production 6 | update_type: "security:minor" 7 | - match: 8 | dependency_type: production 9 | update_type: "semver:patch" 10 | -------------------------------------------------------------------------------- /test/baselines/adapter_JS_JsonUI_ESLint_TypeChecking_Spaces_SingleQuotes_Apache-2.0/test/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "noImplicitAny": false 5 | }, 6 | "include": [ 7 | "./**/*.js" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_ESLint_Tabs_DoubleQuotes_MIT/__meta__/npm_package_files.txt: -------------------------------------------------------------------------------- 1 | admin/index_m.html 2 | admin/jsonCustom.json 3 | admin/style.css 4 | admin/tab_m.html 5 | admin/test-adapter.png 6 | admin/words.js 7 | io-package.json 8 | LICENSE 9 | package.json 10 | README.md -------------------------------------------------------------------------------- /test/baselines/ioBroker.hello-devcontainer/admin/i18n/it.json: -------------------------------------------------------------------------------- 1 | { 2 | "hello-devcontainer adapter settings": "Impostazioni dell'adattatore per hello-devcontainer", 3 | "option1": "Mock translation of 'option1' to 'it'", 4 | "option2": "Mock translation of 'option2' to 'it'" 5 | } -------------------------------------------------------------------------------- /test/baselines/tabReact_adminHtml_JS/admin/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "browser": true, 4 | "es6": true 5 | }, 6 | "parserOptions": { 7 | "sourceType": "module", 8 | "project": "./tsconfig.json" 9 | }, 10 | "rules": { 11 | "react/prop-types": "off" 12 | } 13 | } -------------------------------------------------------------------------------- /test/baselines/adapter_JS_JsonUI_ESLint_TypeChecking_Spaces_SingleQuotes_Apache-2.0/.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: ioBroker Community 4 | url: https://forum.iobroker.net/ 5 | about: Please ask and answer questions here. -------------------------------------------------------------------------------- /test/baselines/adapter_TS_WithoutBuild/__meta__/npm_package_files.txt: -------------------------------------------------------------------------------- 1 | admin/index_m.html 2 | admin/style.css 3 | admin/test-adapter.png 4 | admin/words.js 5 | src/lib/adapter-config.d.ts 6 | src/main.test.ts 7 | src/main.ts 8 | io-package.json 9 | LICENSE 10 | package.json 11 | README.md -------------------------------------------------------------------------------- /test/baselines/adapter_JS_JsonUI_ESLint_TypeChecking_Spaces_SingleQuotes_Apache-2.0/admin/i18n/zh-cn.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "test-adapter的适配器设置", 3 | "option1": "Mock translation of 'option1' to 'zh-cn'", 4 | "option2": "Mock translation of 'option2' to 'zh-cn'" 5 | } -------------------------------------------------------------------------------- /test/baselines/adapter_JS_JsonUI_ESLint_TypeChecking_Spaces_SingleQuotes_Apache-2.0/admin/i18n/ru.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Настройки адаптера для test-adapter", 3 | "option1": "Mock translation of 'option1' to 'ru'", 4 | "option2": "Mock translation of 'option2' to 'ru'" 5 | } -------------------------------------------------------------------------------- /test/baselines/adapter_JS_React/test/integration.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const { tests } = require('@iobroker/testing'); 3 | 4 | // Run integration tests - See https://github.com/ioBroker/testing for a detailed explanation and further options 5 | tests.integration(path.join(__dirname, '..')); -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React/test/integration.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const { tests } = require('@iobroker/testing'); 3 | 4 | // Run integration tests - See https://github.com/ioBroker/testing for a detailed explanation and further options 5 | tests.integration(path.join(__dirname, '..')); -------------------------------------------------------------------------------- /test/baselines/adapter_JS_JsonUI_ESLint_TypeChecking_Spaces_SingleQuotes_Apache-2.0/admin/i18n/de.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Adaptereinstellungen für test-adapter", 3 | "option1": "Mock translation of 'option1' to 'de'", 4 | "option2": "Mock translation of 'option2' to 'de'" 5 | } -------------------------------------------------------------------------------- /test/baselines/adapter_JS_JsonUI_ESLint_TypeChecking_Spaces_SingleQuotes_Apache-2.0/admin/i18n/es.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Ajustes del adaptador para test-adapter", 3 | "option1": "Mock translation of 'option1' to 'es'", 4 | "option2": "Mock translation of 'option2' to 'es'" 5 | } -------------------------------------------------------------------------------- /test/baselines/adapter_JS_JsonUI_ESLint_TypeChecking_Spaces_SingleQuotes_Apache-2.0/admin/i18n/nl.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Adapterinstellingen voor test-adapter", 3 | "option1": "Mock translation of 'option1' to 'nl'", 4 | "option2": "Mock translation of 'option2' to 'nl'" 5 | } -------------------------------------------------------------------------------- /test/baselines/adapter_JS_JsonUI_ESLint_TypeChecking_Spaces_SingleQuotes_Apache-2.0/admin/i18n/pl.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Ustawienia adaptera dla test-adapter", 3 | "option1": "Mock translation of 'option1' to 'pl'", 4 | "option2": "Mock translation of 'option2' to 'pl'" 5 | } -------------------------------------------------------------------------------- /test/baselines/adapter_JS_JsonUI_ESLint_TypeChecking_Spaces_SingleQuotes_Apache-2.0/admin/i18n/uk.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Налаштування адаптера для test-adapter", 3 | "option1": "Mock translation of 'option1' to 'uk'", 4 | "option2": "Mock translation of 'option2' to 'uk'" 5 | } -------------------------------------------------------------------------------- /test/baselines/adapter_JS_OfficialESLint/test/mocharc.custom.json: -------------------------------------------------------------------------------- 1 | { 2 | "require": [ 3 | "test/mocha.setup.js" 4 | ], 5 | "watch-files": [ 6 | "!(node_modules|test)/**/*.test.js", 7 | "*.test.js", 8 | "test/**/test!(PackageFiles|Startup).js" 9 | ] 10 | } -------------------------------------------------------------------------------- /test/baselines/adapter_TS_WithoutBuild/test/integration.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const { tests } = require('@iobroker/testing'); 3 | 4 | // Run integration tests - See https://github.com/ioBroker/testing for a detailed explanation and further options 5 | tests.integration(path.join(__dirname, '..')); -------------------------------------------------------------------------------- /test/baselines/ioBroker.hello-devcontainer/test/mocharc.custom.json: -------------------------------------------------------------------------------- 1 | { 2 | "require": [ 3 | "test/mocha.setup.js" 4 | ], 5 | "watch-files": [ 6 | "!(node_modules|test)/**/*.test.js", 7 | "*.test.js", 8 | "test/**/test!(PackageFiles|Startup).js" 9 | ] 10 | } -------------------------------------------------------------------------------- /test/baselines/adapter_JS_JsonUI_ESLint_TypeChecking_Spaces_SingleQuotes_Apache-2.0/admin/i18n/fr.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Paramètres d'adaptateur pour test-adapter", 3 | "option1": "Mock translation of 'option1' to 'fr'", 4 | "option2": "Mock translation of 'option2' to 'fr'" 5 | } -------------------------------------------------------------------------------- /test/baselines/adapter_JS_JsonUI_ESLint_TypeChecking_Spaces_SingleQuotes_Apache-2.0/admin/i18n/it.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Impostazioni dell'adattatore per test-adapter", 3 | "option1": "Mock translation of 'option1' to 'it'", 4 | "option2": "Mock translation of 'option2' to 'it'" 5 | } -------------------------------------------------------------------------------- /test/baselines/adapter_JS_JsonUI_ESLint_TypeChecking_Spaces_SingleQuotes_Apache-2.0/admin/i18n/pt.json: -------------------------------------------------------------------------------- 1 | { 2 | "test-adapter adapter settings": "Configurações do adaptador para test-adapter", 3 | "option1": "Mock translation of 'option1' to 'pt'", 4 | "option2": "Mock translation of 'option2' to 'pt'" 5 | } -------------------------------------------------------------------------------- /test/baselines/adapter_JS_OfficialESLint/test/integration.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const { tests } = require('@iobroker/testing'); 3 | 4 | // Run integration tests - See https://github.com/ioBroker/testing for a detailed explanation and further options 5 | tests.integration(path.join(__dirname, '..')); -------------------------------------------------------------------------------- /test/baselines/adapter_TS_OfficialESLint/test/integration.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const { tests } = require('@iobroker/testing'); 3 | 4 | // Run integration tests - See https://github.com/ioBroker/testing for a detailed explanation and further options 5 | tests.integration(path.join(__dirname, '..')); -------------------------------------------------------------------------------- /test/baselines/adapter_TS_VIS_CustomESLint/test/integration.js: -------------------------------------------------------------------------------- 1 | const path = require("path"); 2 | const { tests } = require("@iobroker/testing"); 3 | 4 | // Run integration tests - See https://github.com/ioBroker/testing for a detailed explanation and further options 5 | tests.integration(path.join(__dirname, "..")); -------------------------------------------------------------------------------- /test/baselines/ioBroker.hello-devcontainer/test/integration.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const { tests } = require('@iobroker/testing'); 3 | 4 | // Run integration tests - See https://github.com/ioBroker/testing for a detailed explanation and further options 5 | tests.integration(path.join(__dirname, '..')); -------------------------------------------------------------------------------- /templates/_create-adapter.json.ts: -------------------------------------------------------------------------------- 1 | import type { TemplateFunction } from "../src/lib/createAdapter"; 2 | 3 | const templateFunction: TemplateFunction = answers => { 4 | return JSON.stringify(answers, undefined, "\t"); 5 | }; 6 | 7 | templateFunction.customPath = ".create-adapter.json"; 8 | export = templateFunction; 9 | -------------------------------------------------------------------------------- /templates/tsconfig.check.raw.json: -------------------------------------------------------------------------------- 1 | // Specialized tsconfig for type-checking js files 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": {}, 5 | "include": [ 6 | "**/*.js", 7 | "**/*.d.ts" 8 | ], 9 | "exclude": [ 10 | "**/build", 11 | "node_modules/", 12 | "widgets/" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React_OfficialESLint/test/integration.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const { tests } = require('@iobroker/testing'); 3 | 4 | // Run integration tests - See https://github.com/ioBroker/testing for a detailed explanation and further options 5 | tests.integration(path.join(__dirname, '..')); -------------------------------------------------------------------------------- /test/baselines/adapter_TS_VIS_OfficialESLint/test/integration.js: -------------------------------------------------------------------------------- 1 | const path = require("path"); 2 | const { tests } = require("@iobroker/testing"); 3 | 4 | // Run integration tests - See https://github.com/ioBroker/testing for a detailed explanation and further options 5 | tests.integration(path.join(__dirname, "..")); -------------------------------------------------------------------------------- /docs/updates/20210818_no_travis.md: -------------------------------------------------------------------------------- 1 | # Drop support for Travis CI 2 | 3 | Since Travis is not a viable solution for CI testing anymore, we've decided to drop support in favor of Github Actions. To migrate, use the replay functionality and copy the generated `.github/workflows/test-and-release.yml` into your existing repository. 4 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_ESLint_Tabs_DoubleQuotes_MIT/test/integration.js: -------------------------------------------------------------------------------- 1 | const path = require("path"); 2 | const { tests } = require("@iobroker/testing"); 3 | 4 | // Run integration tests - See https://github.com/ioBroker/testing for a detailed explanation and further options 5 | tests.integration(path.join(__dirname, "..")); -------------------------------------------------------------------------------- /docs/updates/20210301_prettier_config.md: -------------------------------------------------------------------------------- 1 | # Update ESLint config for `eslint-config-prettier` v8 2 | 3 | The update to v8 broke linting for adapters that use Prettier. To fix it, remove the following line from `extends` in `.eslintrc.js`: 4 | 5 | ``` 6 | 'prettier/@typescript-eslint', // Uses eslint-config-prettier to ... 7 | ``` 8 | -------------------------------------------------------------------------------- /test/baselines/schedule/test/integration.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const { tests } = require('@iobroker/testing'); 3 | 4 | // Run integration tests - See https://github.com/ioBroker/testing for a detailed explanation and further options 5 | tests.integration(path.join(__dirname, '..'), { 6 | allowedExitCodes: [11], 7 | }); -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "typescript.tsdk": "node_modules\\typescript\\lib", 3 | "eslint.enable": true, 4 | "editor.formatOnSave": true, 5 | "editor.defaultFormatter": "esbenp.prettier-vscode", 6 | "[typescript]": { 7 | "editor.codeActionsOnSave": { 8 | "source.organizeImports": "explicit" 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_VIS_CustomESLint/__meta__/npm_package_files.txt: -------------------------------------------------------------------------------- 1 | admin/index_m.html 2 | admin/style.css 3 | admin/test-adapter.png 4 | admin/words.js 5 | widgets/test-adapter.html 6 | widgets/test-adapter/css/style.css 7 | widgets/test-adapter/js/test-adapter.js 8 | io-package.json 9 | LICENSE 10 | package.json 11 | README.md -------------------------------------------------------------------------------- /test/baselines/adapter_TS_VIS_OfficialESLint/__meta__/npm_package_files.txt: -------------------------------------------------------------------------------- 1 | admin/index_m.html 2 | admin/style.css 3 | admin/test-adapter.png 4 | admin/words.js 5 | widgets/test-adapter.html 6 | widgets/test-adapter/css/style.css 7 | widgets/test-adapter/js/test-adapter.js 8 | io-package.json 9 | LICENSE 10 | package.json 11 | README.md -------------------------------------------------------------------------------- /test/baselines/devcontainer/.devcontainer/iobroker/boot.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Define log file location 6 | LOG_FILE=/opt/iobroker/log/boot.log 7 | mkdir -p /opt/iobroker/log 8 | 9 | # Start logging to the file (standard output and error) 10 | exec > >(tee "$LOG_FILE") 2>&1 11 | 12 | /opt/scripts/iobroker_startup.sh -------------------------------------------------------------------------------- /docs/updates/20210515_test_node_16.md: -------------------------------------------------------------------------------- 1 | # Add Node 16 to test suite, drop Node 10 2 | 3 | Node 16 soon becomes LTS and Node 10 falls out of support. To make sure your tests are up to date, edit `.github/workflows/test-and-release.yml` as follows: 4 | 5 | ```diff 6 | - node-version: [10.x, 12.x, 14.x] 7 | + node-version: [12.x, 14.x, 16.x] 8 | ``` 9 | -------------------------------------------------------------------------------- /test/baselines/adapter_JS_JsonUI_ESLint_TypeChecking_Spaces_SingleQuotes_Apache-2.0/test/mocharc.custom.json: -------------------------------------------------------------------------------- 1 | { 2 | "require": [ 3 | "test/mocha.setup.js" 4 | ], 5 | "watch-files": [ 6 | "!(node_modules|test)/**/*.test.js", 7 | "*.test.js", 8 | "test/**/test!(PackageFiles|Startup).js" 9 | ] 10 | } -------------------------------------------------------------------------------- /test/baselines/devcontainer/.devcontainer/scripts/poststart.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # execute poststart only if container was created right before 6 | if [ -e /tmp/.postcreate_done ]; then 7 | rm /tmp/.postcreate_done 8 | else 9 | # Wait for ioBroker to become ready 10 | sh .devcontainer/scripts/wait_for_iobroker.sh 11 | fi -------------------------------------------------------------------------------- /test/baselines/adapter_JS_JsonUI_ESLint_TypeChecking_Spaces_SingleQuotes_Apache-2.0/test/integration.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const { tests } = require('@iobroker/testing'); 3 | 4 | // Run integration tests - See https://github.com/ioBroker/testing for a detailed explanation and further options 5 | tests.integration(path.join(__dirname, '..')); -------------------------------------------------------------------------------- /test/baselines/vis_Widget/.gitignore: -------------------------------------------------------------------------------- 1 | # No dot-directories except github/vscode 2 | .*/ 3 | !.vscode/ 4 | !.github/ 5 | 6 | *.code-workspace 7 | node_modules 8 | nbproject 9 | 10 | # npm package files 11 | iobroker.*.tgz 12 | 13 | Thumbs.db 14 | .commitinfo 15 | 16 | # i18n intermediate files 17 | admin/i18n/flat.txt 18 | admin/i18n/*/flat.txt -------------------------------------------------------------------------------- /templates/admin/tsconfig.raw.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "include": [ 4 | "./admin.d.ts", 5 | "./**/*.js", 6 | // Include the adapter-config definition if it exists. 7 | // It should be at either on of these paths: 8 | "../lib/adapter-config.d.ts", // JS 9 | "../src/lib/adapter-config.d.ts", // TS 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /test/baselines/adapter_JS_React/.gitignore: -------------------------------------------------------------------------------- 1 | # No dot-directories except github/vscode 2 | .*/ 3 | !.vscode/ 4 | !.github/ 5 | 6 | *.code-workspace 7 | node_modules 8 | nbproject 9 | 10 | # npm package files 11 | iobroker.*.tgz 12 | 13 | Thumbs.db 14 | .commitinfo 15 | 16 | # i18n intermediate files 17 | admin/i18n/flat.txt 18 | admin/i18n/*/flat.txt -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React/.gitignore: -------------------------------------------------------------------------------- 1 | # No dot-directories except github/vscode 2 | .*/ 3 | !.vscode/ 4 | !.github/ 5 | 6 | *.code-workspace 7 | node_modules 8 | nbproject 9 | 10 | # npm package files 11 | iobroker.*.tgz 12 | 13 | Thumbs.db 14 | .commitinfo 15 | 16 | # i18n intermediate files 17 | admin/i18n/flat.txt 18 | admin/i18n/*/flat.txt -------------------------------------------------------------------------------- /test/baselines/ioBroker.hello-devcontainer/.devcontainer/iobroker/boot.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Define log file location 6 | LOG_FILE=/opt/iobroker/log/boot.log 7 | mkdir -p /opt/iobroker/log 8 | 9 | # Start logging to the file (standard output and error) 10 | exec > >(tee "$LOG_FILE") 2>&1 11 | 12 | /opt/scripts/iobroker_startup.sh -------------------------------------------------------------------------------- /tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | // Modified config to only compile .ts-files in the src dir 4 | "compilerOptions": { 5 | "noEmit": false, 6 | "declaration": true 7 | }, 8 | "include": ["src/**/*.ts", "templates/**/*.ts", "index.ts", "core.ts"], 9 | "exclude": ["src/**/*.test.ts", "templates/**/*.raw.*"] 10 | } 11 | -------------------------------------------------------------------------------- /prettier.config.mjs: -------------------------------------------------------------------------------- 1 | // ioBroker prettier configuration file 2 | import prettierConfig from "@iobroker/eslint-config/prettier.config.mjs"; 3 | 4 | export default { 5 | ...prettierConfig, 6 | // Use tabs for indentation (project preference) 7 | useTabs: true, 8 | // Keep double quotes as this project prefers them 9 | singleQuote: false, 10 | }; 11 | -------------------------------------------------------------------------------- /test/baselines/adapter_JS_OfficialESLint/.gitignore: -------------------------------------------------------------------------------- 1 | # No dot-directories except github/vscode 2 | .*/ 3 | !.vscode/ 4 | !.github/ 5 | 6 | *.code-workspace 7 | node_modules 8 | nbproject 9 | 10 | # npm package files 11 | iobroker.*.tgz 12 | 13 | Thumbs.db 14 | .commitinfo 15 | 16 | # i18n intermediate files 17 | admin/i18n/flat.txt 18 | admin/i18n/*/flat.txt -------------------------------------------------------------------------------- /test/baselines/adapter_TS_OfficialESLint/.gitignore: -------------------------------------------------------------------------------- 1 | # No dot-directories except github/vscode 2 | .*/ 3 | !.vscode/ 4 | !.github/ 5 | 6 | *.code-workspace 7 | node_modules 8 | nbproject 9 | 10 | # npm package files 11 | iobroker.*.tgz 12 | 13 | Thumbs.db 14 | .commitinfo 15 | 16 | # i18n intermediate files 17 | admin/i18n/flat.txt 18 | admin/i18n/*/flat.txt -------------------------------------------------------------------------------- /test/baselines/adapter_TS_VIS_CustomESLint/.gitignore: -------------------------------------------------------------------------------- 1 | # No dot-directories except github/vscode 2 | .*/ 3 | !.vscode/ 4 | !.github/ 5 | 6 | *.code-workspace 7 | node_modules 8 | nbproject 9 | 10 | # npm package files 11 | iobroker.*.tgz 12 | 13 | Thumbs.db 14 | .commitinfo 15 | 16 | # i18n intermediate files 17 | admin/i18n/flat.txt 18 | admin/i18n/*/flat.txt -------------------------------------------------------------------------------- /test/baselines/adapter_TS_WithoutBuild/.gitignore: -------------------------------------------------------------------------------- 1 | # No dot-directories except github/vscode 2 | .*/ 3 | !.vscode/ 4 | !.github/ 5 | 6 | *.code-workspace 7 | node_modules 8 | nbproject 9 | 10 | # npm package files 11 | iobroker.*.tgz 12 | 13 | Thumbs.db 14 | .commitinfo 15 | 16 | # i18n intermediate files 17 | admin/i18n/flat.txt 18 | admin/i18n/*/flat.txt -------------------------------------------------------------------------------- /test/baselines/i18n_json/admin/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "include": [ 4 | "./admin.d.ts", 5 | "./**/*.js", 6 | // Include the adapter-config definition if it exists. 7 | // It should be at either on of these paths: 8 | "../lib/adapter-config.d.ts", // JS 9 | "../src/lib/adapter-config.d.ts", // TS 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React_OfficialESLint/.gitignore: -------------------------------------------------------------------------------- 1 | # No dot-directories except github/vscode 2 | .*/ 3 | !.vscode/ 4 | !.github/ 5 | 6 | *.code-workspace 7 | node_modules 8 | nbproject 9 | 10 | # npm package files 11 | iobroker.*.tgz 12 | 13 | Thumbs.db 14 | .commitinfo 15 | 16 | # i18n intermediate files 17 | admin/i18n/flat.txt 18 | admin/i18n/*/flat.txt -------------------------------------------------------------------------------- /test/baselines/adapter_TS_VIS_OfficialESLint/.gitignore: -------------------------------------------------------------------------------- 1 | # No dot-directories except github/vscode 2 | .*/ 3 | !.vscode/ 4 | !.github/ 5 | 6 | *.code-workspace 7 | node_modules 8 | nbproject 9 | 10 | # npm package files 11 | iobroker.*.tgz 12 | 13 | Thumbs.db 14 | .commitinfo 15 | 16 | # i18n intermediate files 17 | admin/i18n/flat.txt 18 | admin/i18n/*/flat.txt -------------------------------------------------------------------------------- /test/baselines/ioBroker.hello-devcontainer/.devcontainer/scripts/poststart.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # execute poststart only if container was created right before 6 | if [ -e /tmp/.postcreate_done ]; then 7 | rm /tmp/.postcreate_done 8 | else 9 | # Wait for ioBroker to become ready 10 | sh .devcontainer/scripts/wait_for_iobroker.sh 11 | fi -------------------------------------------------------------------------------- /docs/updates/20230507_eslintignore_words_js.md: -------------------------------------------------------------------------------- 1 | # Add `admin/words.js` to `.eslintignore` 2 | 3 | The file `admin/words.js` is often generated by external tooling which may have different linting rules than the adapter itself. To avoid noisy and useless errors, add the file to `.eslintignore`: 4 | 5 | ## `.eslintignore` 6 | 7 | ```diff 8 | + admin/words.js 9 | ``` 10 | -------------------------------------------------------------------------------- /test/baselines/devcontainer/.gitignore: -------------------------------------------------------------------------------- 1 | # No dot-directories except github/vscode 2 | .*/ 3 | !.vscode/ 4 | !.github/ 5 | !.devcontainer/ 6 | 7 | *.code-workspace 8 | node_modules 9 | nbproject 10 | 11 | # npm package files 12 | iobroker.*.tgz 13 | 14 | Thumbs.db 15 | .commitinfo 16 | 17 | # i18n intermediate files 18 | admin/i18n/flat.txt 19 | admin/i18n/*/flat.txt -------------------------------------------------------------------------------- /test/baselines/adapter_TS_ESLint_Tabs_DoubleQuotes_MIT/.gitignore: -------------------------------------------------------------------------------- 1 | # No dot-directories except github/vscode 2 | .*/ 3 | !.vscode/ 4 | !.github/ 5 | 6 | *.code-workspace 7 | node_modules 8 | nbproject 9 | 10 | # npm package files 11 | iobroker.*.tgz 12 | 13 | Thumbs.db 14 | .commitinfo 15 | 16 | # i18n intermediate files 17 | admin/i18n/flat.txt 18 | admin/i18n/*/flat.txt -------------------------------------------------------------------------------- /test/baselines/adapter_TS_OfficialESLint/admin/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "include": [ 4 | "./admin.d.ts", 5 | "./**/*.js", 6 | // Include the adapter-config definition if it exists. 7 | // It should be at either on of these paths: 8 | "../lib/adapter-config.d.ts", // JS 9 | "../src/lib/adapter-config.d.ts", // TS 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_VIS_CustomESLint/admin/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "include": [ 4 | "./admin.d.ts", 5 | "./**/*.js", 6 | // Include the adapter-config definition if it exists. 7 | // It should be at either on of these paths: 8 | "../lib/adapter-config.d.ts", // JS 9 | "../src/lib/adapter-config.d.ts", // TS 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /templates/main.test.js.ts: -------------------------------------------------------------------------------- 1 | import type { TemplateFunction } from "../src/lib/createAdapter"; 2 | import { readFile } from "../src/lib/createAdapter"; 3 | 4 | export = (answers => { 5 | const useJavaScript = answers.language === "JavaScript"; 6 | if (!useJavaScript) { 7 | return; 8 | } 9 | 10 | return readFile("main.test.raw.js", __dirname); 11 | }) as TemplateFunction; 12 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_VIS_OfficialESLint/admin/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "include": [ 4 | "./admin.d.ts", 5 | "./**/*.js", 6 | // Include the adapter-config definition if it exists. 7 | // It should be at either on of these paths: 8 | "../lib/adapter-config.d.ts", // JS 9 | "../src/lib/adapter-config.d.ts", // TS 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /docs/updates/20220506_remove_unit_tests.md: -------------------------------------------------------------------------------- 1 | # Remove deprecated unit tests 2 | 3 | The adapter unit tests have been deprecated for quite a while. If you're not using custom unit tests, you can remove the test script from your adapter. To do so, delete the file `test/unit.js` and the following line from `package.json`: 4 | 5 | ```diff 6 | - "test:unit": "mocha test/unit --exit", 7 | ``` 8 | -------------------------------------------------------------------------------- /templates/tsconfig.build.raw.json: -------------------------------------------------------------------------------- 1 | // Specialized tsconfig to only compile .ts-files in the src dir 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "allowJs": false, 6 | "checkJs": false, 7 | "noEmit": false, 8 | "declaration": false 9 | }, 10 | "include": [ 11 | "src/**/*.ts" 12 | ], 13 | "exclude": [ 14 | "src/**/*.test.ts" 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /test/baselines/ioBroker.hello-devcontainer/.gitignore: -------------------------------------------------------------------------------- 1 | # No dot-directories except github/vscode 2 | .*/ 3 | !.vscode/ 4 | !.github/ 5 | !.devcontainer/ 6 | 7 | *.code-workspace 8 | node_modules 9 | nbproject 10 | 11 | # npm package files 12 | iobroker.*.tgz 13 | 14 | Thumbs.db 15 | .commitinfo 16 | 17 | # i18n intermediate files 18 | admin/i18n/flat.txt 19 | admin/i18n/*/flat.txt -------------------------------------------------------------------------------- /test/baselines/adapter_TS_ESLint_Tabs_DoubleQuotes_MIT/admin/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "include": [ 4 | "./admin.d.ts", 5 | "./**/*.js", 6 | // Include the adapter-config definition if it exists. 7 | // It should be at either on of these paths: 8 | "../lib/adapter-config.d.ts", // JS 9 | "../src/lib/adapter-config.d.ts", // TS 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /test/baselines/ioBroker.hello-devcontainer/tsconfig.check.json: -------------------------------------------------------------------------------- 1 | // Specialized tsconfig for type-checking js files 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": {}, 5 | "include": [ 6 | "**/*.js", 7 | "**/*.d.ts" 8 | ], 9 | "exclude": [ 10 | "**/build", 11 | "node_modules/", 12 | "widgets/" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | // Specialized tsconfig to only compile .ts-files in the src dir 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "allowJs": false, 6 | "checkJs": false, 7 | "noEmit": false, 8 | "declaration": false 9 | }, 10 | "include": [ 11 | "src/**/*.ts" 12 | ], 13 | "exclude": [ 14 | "src/**/*.test.ts" 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /test/baselines/adapter_JS_JsonUI_ESLint_TypeChecking_Spaces_SingleQuotes_Apache-2.0/.gitignore: -------------------------------------------------------------------------------- 1 | # No dot-directories except github/vscode 2 | .*/ 3 | !.vscode/ 4 | !.github/ 5 | 6 | *.code-workspace 7 | node_modules 8 | nbproject 9 | 10 | # npm package files 11 | iobroker.*.tgz 12 | 13 | Thumbs.db 14 | .commitinfo 15 | 16 | # i18n intermediate files 17 | admin/i18n/flat.txt 18 | admin/i18n/*/flat.txt -------------------------------------------------------------------------------- /test/baselines/adapter_TS_OfficialESLint/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | // Specialized tsconfig to only compile .ts-files in the src dir 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "allowJs": false, 6 | "checkJs": false, 7 | "noEmit": false, 8 | "declaration": false 9 | }, 10 | "include": [ 11 | "src/**/*.ts" 12 | ], 13 | "exclude": [ 14 | "src/**/*.test.ts" 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_VIS_CustomESLint/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | // Specialized tsconfig to only compile .ts-files in the src dir 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "allowJs": false, 6 | "checkJs": false, 7 | "noEmit": false, 8 | "declaration": false 9 | }, 10 | "include": [ 11 | "src/**/*.ts" 12 | ], 13 | "exclude": [ 14 | "src/**/*.test.ts" 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React_OfficialESLint/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | // Specialized tsconfig to only compile .ts-files in the src dir 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "allowJs": false, 6 | "checkJs": false, 7 | "noEmit": false, 8 | "declaration": false 9 | }, 10 | "include": [ 11 | "src/**/*.ts" 12 | ], 13 | "exclude": [ 14 | "src/**/*.test.ts" 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_VIS_OfficialESLint/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | // Specialized tsconfig to only compile .ts-files in the src dir 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "allowJs": false, 6 | "checkJs": false, 7 | "noEmit": false, 8 | "declaration": false 9 | }, 10 | "include": [ 11 | "src/**/*.ts" 12 | ], 13 | "exclude": [ 14 | "src/**/*.test.ts" 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /.github/test_template_creation.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Make sure the paths we reference are relative to this script 6 | cd "${BASH_SOURCE%/*}" || exit 7 | 8 | # Create an empty folder for the templates 9 | mkdir ioBroker.template 10 | # clean it up on exit 11 | trap 'rm -rf ioBroker.template' EXIT 12 | 13 | # Test the template creation 14 | TESTING=true node --require tsx/cjs create_templates.ts 15 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_ESLint_Tabs_DoubleQuotes_MIT/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | // Specialized tsconfig to only compile .ts-files in the src dir 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "allowJs": false, 6 | "checkJs": false, 7 | "noEmit": false, 8 | "declaration": false 9 | }, 10 | "include": [ 11 | "src/**/*.ts" 12 | ], 13 | "exclude": [ 14 | "src/**/*.test.ts" 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /test/baselines/adapter_JS_JsonUI_ESLint_TypeChecking_Spaces_SingleQuotes_Apache-2.0/tsconfig.check.json: -------------------------------------------------------------------------------- 1 | // Specialized tsconfig for type-checking js files 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": {}, 5 | "include": [ 6 | "**/*.js", 7 | "**/*.d.ts" 8 | ], 9 | "exclude": [ 10 | "**/build", 11 | "node_modules/", 12 | "widgets/" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /docs/updates/20201201_require_main.md: -------------------------------------------------------------------------------- 1 | # Use `require.main` to test if an adapter was started in compact mode 2 | 3 | The `module.parent` is now deprecated in Node.js. As an alternative, `require.main` should be used. To update your code, just change the following line: 4 | 5 | ```diff 6 | - if (module.parent) { 7 | + if (require.main !== module) { 8 | ``` 9 | 10 | If `// @ts-ignore` was used to suppress an error, you can delete it. 11 | -------------------------------------------------------------------------------- /templates/tsconfig.check.json.ts: -------------------------------------------------------------------------------- 1 | import type { TemplateFunction } from "../src/lib/createAdapter"; 2 | import { readFile } from "../src/lib/createAdapter"; 3 | 4 | export = (answers => { 5 | const useTypeChecking = answers.language === "JavaScript" && answers.tools?.includes("type checking"); 6 | if (!useTypeChecking) { 7 | return; 8 | } 9 | 10 | return readFile("tsconfig.check.raw.json", __dirname); 11 | }) as TemplateFunction; 12 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React/src/lib/adapter-config.d.ts: -------------------------------------------------------------------------------- 1 | // This file extends the AdapterConfig type from "@iobroker/types" 2 | 3 | // Augment the globally declared type ioBroker.AdapterConfig 4 | declare global { 5 | namespace ioBroker { 6 | interface AdapterConfig { 7 | option1: boolean; 8 | option2: string; 9 | } 10 | } 11 | } 12 | 13 | // this is required so the above AdapterConfig is found by TypeScript / type checking 14 | export {}; -------------------------------------------------------------------------------- /test/baselines/devcontainer/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "type": "node", 6 | "request": "launch", 7 | "name": "Launch ioBroker Adapter", 8 | "skipFiles": [ 9 | "/**" 10 | ], 11 | "args": [ 12 | "--debug", 13 | "0", 14 | "--logs" 15 | ], 16 | "program": "${workspaceFolder}/main.js", 17 | "console": "integratedTerminal" 18 | } 19 | ] 20 | } -------------------------------------------------------------------------------- /test/baselines/tabReact_adminHtml_JS/admin/tab_m.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /test/baselines/tabReact_adminReact_TS/admin/tab_m.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /docs/updates/20250406_admin_dependency_ge.md: -------------------------------------------------------------------------------- 1 | # Update Global Dependency `admin` to Use Greater Than Equal (`>=`) 2 | 3 | To allow support for newer versions of the `admin` dependency, the version constraint in `io-package.json` has been updated from a fixed version to greater or equal (`>=`) version. 4 | 5 | `io-package.json` 6 | ```diff 7 | "globalDependencies": [ 8 | { 9 | - "admin": "7.0.23" 10 | + "admin": ">=7.0.23" 11 | } 12 | ] 13 | ``` -------------------------------------------------------------------------------- /test/baselines/adapter_TS_OfficialESLint/src/lib/adapter-config.d.ts: -------------------------------------------------------------------------------- 1 | // This file extends the AdapterConfig type from "@iobroker/types" 2 | 3 | // Augment the globally declared type ioBroker.AdapterConfig 4 | declare global { 5 | namespace ioBroker { 6 | interface AdapterConfig { 7 | option1: boolean; 8 | option2: string; 9 | } 10 | } 11 | } 12 | 13 | // this is required so the above AdapterConfig is found by TypeScript / type checking 14 | export {}; -------------------------------------------------------------------------------- /test/baselines/adapter_TS_WithoutBuild/src/lib/adapter-config.d.ts: -------------------------------------------------------------------------------- 1 | // This file extends the AdapterConfig type from "@iobroker/types" 2 | 3 | // Augment the globally declared type ioBroker.AdapterConfig 4 | declare global { 5 | namespace ioBroker { 6 | interface AdapterConfig { 7 | option1: boolean; 8 | option2: string; 9 | } 10 | } 11 | } 12 | 13 | // this is required so the above AdapterConfig is found by TypeScript / type checking 14 | export {}; -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React_OfficialESLint/src/lib/adapter-config.d.ts: -------------------------------------------------------------------------------- 1 | // This file extends the AdapterConfig type from "@iobroker/types" 2 | 3 | // Augment the globally declared type ioBroker.AdapterConfig 4 | declare global { 5 | namespace ioBroker { 6 | interface AdapterConfig { 7 | option1: boolean; 8 | option2: string; 9 | } 10 | } 11 | } 12 | 13 | // this is required so the above AdapterConfig is found by TypeScript / type checking 14 | export {}; -------------------------------------------------------------------------------- /test/baselines/adapter_TS_VIS_CustomESLint/src/lib/adapter-config.d.ts: -------------------------------------------------------------------------------- 1 | // This file extends the AdapterConfig type from "@iobroker/types" 2 | 3 | // Augment the globally declared type ioBroker.AdapterConfig 4 | declare global { 5 | namespace ioBroker { 6 | interface AdapterConfig { 7 | option1: boolean; 8 | option2: string; 9 | } 10 | } 11 | } 12 | 13 | // this is required so the above AdapterConfig is found by TypeScript / type checking 14 | export {}; -------------------------------------------------------------------------------- /test/baselines/adapter_TS_VIS_OfficialESLint/src/lib/adapter-config.d.ts: -------------------------------------------------------------------------------- 1 | // This file extends the AdapterConfig type from "@iobroker/types" 2 | 3 | // Augment the globally declared type ioBroker.AdapterConfig 4 | declare global { 5 | namespace ioBroker { 6 | interface AdapterConfig { 7 | option1: boolean; 8 | option2: string; 9 | } 10 | } 11 | } 12 | 13 | // this is required so the above AdapterConfig is found by TypeScript / type checking 14 | export {}; -------------------------------------------------------------------------------- /test/baselines/adapter_TS_ESLint_Tabs_DoubleQuotes_MIT/src/lib/adapter-config.d.ts: -------------------------------------------------------------------------------- 1 | // This file extends the AdapterConfig type from "@iobroker/types" 2 | 3 | // Augment the globally declared type ioBroker.AdapterConfig 4 | declare global { 5 | namespace ioBroker { 6 | interface AdapterConfig { 7 | option1: boolean; 8 | option2: string; 9 | } 10 | } 11 | } 12 | 13 | // this is required so the above AdapterConfig is found by TypeScript / type checking 14 | export {}; -------------------------------------------------------------------------------- /test/baselines/vis_Widget/test/mocha.setup.js: -------------------------------------------------------------------------------- 1 | // Don't silently swallow unhandled rejections 2 | process.on("unhandledRejection", (e) => { 3 | throw e; 4 | }); 5 | 6 | // enable the should interface with sinon 7 | // and load chai-as-promised and sinon-chai by default 8 | const sinonChai = require("sinon-chai"); 9 | const chaiAsPromised = require("chai-as-promised"); 10 | const { should, use } = require("chai"); 11 | 12 | should(); 13 | use(sinonChai); 14 | use(chaiAsPromised); -------------------------------------------------------------------------------- /test/baselines/adapter_JS_React/test/mocha.setup.js: -------------------------------------------------------------------------------- 1 | // Don't silently swallow unhandled rejections 2 | process.on('unhandledRejection', (e) => { 3 | throw e; 4 | }); 5 | 6 | // enable the should interface with sinon 7 | // and load chai-as-promised and sinon-chai by default 8 | const sinonChai = require('sinon-chai'); 9 | const chaiAsPromised = require('chai-as-promised'); 10 | const { should, use } = require('chai'); 11 | 12 | should(); 13 | use(sinonChai); 14 | use(chaiAsPromised); -------------------------------------------------------------------------------- /templates/src/main.test.ts.ts: -------------------------------------------------------------------------------- 1 | import type { TemplateFunction } from "../../src/lib/createAdapter"; 2 | import { readFile } from "../../src/lib/createAdapter"; 3 | 4 | export = (answers => { 5 | const useTypeScript = answers.language === "TypeScript"; 6 | const useTSWithoutBuild = answers.language === "TypeScript (without build)"; 7 | if (!useTypeScript && !useTSWithoutBuild) { 8 | return; 9 | } 10 | 11 | return readFile("main.test.raw.ts", __dirname); 12 | }) as TemplateFunction; 13 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_WithoutBuild/test/mocha.setup.js: -------------------------------------------------------------------------------- 1 | // Don't silently swallow unhandled rejections 2 | process.on('unhandledRejection', (e) => { 3 | throw e; 4 | }); 5 | 6 | // enable the should interface with sinon 7 | // and load chai-as-promised and sinon-chai by default 8 | const sinonChai = require('sinon-chai'); 9 | const chaiAsPromised = require('chai-as-promised'); 10 | const { should, use } = require('chai'); 11 | 12 | should(); 13 | use(sinonChai); 14 | use(chaiAsPromised); -------------------------------------------------------------------------------- /test/baselines/ioBroker.hello-devcontainer/__meta__/npm_package_files.txt: -------------------------------------------------------------------------------- 1 | admin/hello-devcontainer.png 2 | admin/i18n/de.json 3 | admin/i18n/en.json 4 | admin/i18n/es.json 5 | admin/i18n/fr.json 6 | admin/i18n/it.json 7 | admin/i18n/nl.json 8 | admin/i18n/pl.json 9 | admin/i18n/pt.json 10 | admin/i18n/ru.json 11 | admin/i18n/uk.json 12 | admin/i18n/zh-cn.json 13 | admin/jsonConfig.json 14 | lib/adapter-config.d.ts 15 | io-package.json 16 | LICENSE 17 | main.js 18 | package.json 19 | README.md -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: npm 4 | directory: "/" 5 | schedule: 6 | interval: monthly 7 | time: "04:00" 8 | timezone: Europe/Berlin 9 | open-pull-requests-limit: 5 10 | versioning-strategy: increase 11 | 12 | - package-ecosystem: github-actions 13 | directory: "/" 14 | schedule: 15 | interval: monthly 16 | time: "04:00" 17 | timezone: Europe/Berlin 18 | open-pull-requests-limit: 5 19 | -------------------------------------------------------------------------------- /docs/updates/20210519_dev_server.md: -------------------------------------------------------------------------------- 1 | # Support for dev-server 2 | 3 | If you wish to use `dev-server` with your adapter, please follow these steps (taken from the [official documentation](https://github.com/ioBroker/dev-server#tldr)): 4 | 5 | ```bash 6 | npm install --global @iobroker/dev-server 7 | dev-server setup 8 | dev-server watch 9 | ``` 10 | 11 | ## More information 12 | 13 | For further information, check the [official documentation](https://github.com/ioBroker/dev-server#readme). 14 | -------------------------------------------------------------------------------- /templates/tsconfig.build.json.ts: -------------------------------------------------------------------------------- 1 | import type { TemplateFunction } from "../src/lib/createAdapter"; 2 | import { readFile } from "../src/lib/createAdapter"; 3 | 4 | export = (answers => { 5 | const useTypeScript = answers.language === "TypeScript"; 6 | const useTSWithoutBuild = answers.language === "TypeScript (without build)"; 7 | if (!useTypeScript || useTSWithoutBuild) { 8 | return; 9 | } 10 | 11 | return readFile("tsconfig.build.raw.json", __dirname); 12 | }) as TemplateFunction; 13 | -------------------------------------------------------------------------------- /test/baselines/adapter_JS_OfficialESLint/test/mocha.setup.js: -------------------------------------------------------------------------------- 1 | // Don't silently swallow unhandled rejections 2 | process.on('unhandledRejection', (e) => { 3 | throw e; 4 | }); 5 | 6 | // enable the should interface with sinon 7 | // and load chai-as-promised and sinon-chai by default 8 | const sinonChai = require('sinon-chai'); 9 | const chaiAsPromised = require('chai-as-promised'); 10 | const { should, use } = require('chai'); 11 | 12 | should(); 13 | use(sinonChai); 14 | use(chaiAsPromised); -------------------------------------------------------------------------------- /test/baselines/ioBroker.hello-devcontainer/test/mocha.setup.js: -------------------------------------------------------------------------------- 1 | // Don't silently swallow unhandled rejections 2 | process.on('unhandledRejection', (e) => { 3 | throw e; 4 | }); 5 | 6 | // enable the should interface with sinon 7 | // and load chai-as-promised and sinon-chai by default 8 | const sinonChai = require('sinon-chai'); 9 | const chaiAsPromised = require('chai-as-promised'); 10 | const { should, use } = require('chai'); 11 | 12 | should(); 13 | use(sinonChai); 14 | use(chaiAsPromised); -------------------------------------------------------------------------------- /templates/test/tsconfig.json.ts: -------------------------------------------------------------------------------- 1 | import type { TemplateFunction } from "../../src/lib/createAdapter"; 2 | import { readFile } from "../../src/lib/createAdapter"; 3 | 4 | export = (answers => { 5 | const useTypeScript = answers.language === "TypeScript"; 6 | const useTypeChecking = answers.tools && answers.tools.indexOf("type checking") > -1; 7 | if (!useTypeScript && !useTypeChecking) { 8 | return; 9 | } 10 | 11 | return readFile("tsconfig.raw.json", __dirname); 12 | }) as TemplateFunction; 13 | -------------------------------------------------------------------------------- /templates/_github/ISSUE_TEMPLATE/config.yml.ts: -------------------------------------------------------------------------------- 1 | import type { TemplateFunction } from "../../../src/lib/createAdapter"; 2 | import { readFile } from "../../../src/lib/createAdapter"; 3 | 4 | const templateFunction: TemplateFunction = _answers => { 5 | return readFile("config.raw.yml", __dirname); 6 | }; 7 | 8 | templateFunction.customPath = ".github/ISSUE_TEMPLATE/config.yml"; 9 | // Reformatting this would create mixed tabs and spaces 10 | templateFunction.noReformat = true; 11 | export = templateFunction; 12 | -------------------------------------------------------------------------------- /templates/admin/style.css.ts: -------------------------------------------------------------------------------- 1 | import type { TemplateFunction } from "../../src/lib/createAdapter"; 2 | import { readFile } from "../../src/lib/createAdapter"; 3 | 4 | export = (answers => { 5 | const isAdapter = answers.features.indexOf("adapter") > -1; 6 | const useJsonConfig = answers.adminUi === "json"; 7 | const noConfig = answers.adminUi === "none"; 8 | if (!isAdapter || useJsonConfig || noConfig) { 9 | return; 10 | } 11 | 12 | return readFile("style.raw.css", __dirname); 13 | }) as TemplateFunction; 14 | -------------------------------------------------------------------------------- /docs/updates/20201103_css_fix.md: -------------------------------------------------------------------------------- 1 | # Fix CSS React UI height in Firefox 2 | 3 | This migration is **only relevant** if you're using a **React UI** for Admin. 4 | 5 | To update, change `admin/style.css` as follows: 6 | 7 | ```diff 8 | /* Don't cut off dropdowns! */ 9 | overflow: initial; 10 | } 11 | -.m.adapter-container { 12 | +.m.adapter-container, 13 | +.m.adapter-container > div.App { 14 | /* Fix layout/scrolling issues with tabs */ 15 | height: 100%; 16 | width: 100%; 17 | ``` 18 | -------------------------------------------------------------------------------- /templates/_github/ISSUE_TEMPLATE/bug_report.yml.ts: -------------------------------------------------------------------------------- 1 | import type { TemplateFunction } from "../../../src/lib/createAdapter"; 2 | import { readFile } from "../../../src/lib/createAdapter"; 3 | 4 | const templateFunction: TemplateFunction = _answers => { 5 | return readFile("bug_report.raw.yml", __dirname); 6 | }; 7 | 8 | templateFunction.customPath = ".github/ISSUE_TEMPLATE/bug_report.yml"; 9 | // Reformatting this would create mixed tabs and spaces 10 | templateFunction.noReformat = true; 11 | export = templateFunction; 12 | -------------------------------------------------------------------------------- /test/baselines/adapter_JS_JsonUI_ESLint_TypeChecking_Spaces_SingleQuotes_Apache-2.0/__meta__/npm_package_files.txt: -------------------------------------------------------------------------------- 1 | admin/i18n/de.json 2 | admin/i18n/en.json 3 | admin/i18n/es.json 4 | admin/i18n/fr.json 5 | admin/i18n/it.json 6 | admin/i18n/nl.json 7 | admin/i18n/pl.json 8 | admin/i18n/pt.json 9 | admin/i18n/ru.json 10 | admin/i18n/uk.json 11 | admin/i18n/zh-cn.json 12 | admin/jsonConfig.json 13 | admin/test-adapter.png 14 | lib/adapter-config.d.ts 15 | io-package.json 16 | LICENSE 17 | main.js 18 | package.json 19 | README.md -------------------------------------------------------------------------------- /templates/_github/ISSUE_TEMPLATE/feature_request.yml.ts: -------------------------------------------------------------------------------- 1 | import type { TemplateFunction } from "../../../src/lib/createAdapter"; 2 | import { readFile } from "../../../src/lib/createAdapter"; 3 | 4 | const templateFunction: TemplateFunction = _answers => { 5 | return readFile("feature_request.raw.yml", __dirname); 6 | }; 7 | 8 | templateFunction.customPath = ".github/ISSUE_TEMPLATE/feature_request.yml"; 9 | // Reformatting this would create mixed tabs and spaces 10 | templateFunction.noReformat = true; 11 | export = templateFunction; 12 | -------------------------------------------------------------------------------- /test/baselines/adapter_JS_JsonUI_ESLint_TypeChecking_Spaces_SingleQuotes_Apache-2.0/test/mocha.setup.js: -------------------------------------------------------------------------------- 1 | // Don't silently swallow unhandled rejections 2 | process.on('unhandledRejection', (e) => { 3 | throw e; 4 | }); 5 | 6 | // enable the should interface with sinon 7 | // and load chai-as-promised and sinon-chai by default 8 | const sinonChai = require('sinon-chai'); 9 | const chaiAsPromised = require('chai-as-promised'); 10 | const { should, use } = require('chai'); 11 | 12 | should(); 13 | use(sinonChai); 14 | use(chaiAsPromised); -------------------------------------------------------------------------------- /.vscode/workspace.code-workspace: -------------------------------------------------------------------------------- 1 | { 2 | "folders": [ 3 | { 4 | "path": "../" 5 | } 6 | ], 7 | "settings": { 8 | "typescript.tsdk": "node_modules\\typescript\\lib", 9 | "files.exclude": { 10 | "**/.*": true, 11 | "**/node_modules/": true, 12 | "**/build/": true 13 | } 14 | }, 15 | "extensions": { 16 | "recommendations": [ 17 | "EditorConfig.EditorConfig", 18 | "dbaeumer.vscode-eslint", 19 | "eg2.tslint", 20 | "eamodio.toggle-excluded-files", 21 | "wayou.vscode-todo-highlight" 22 | ] 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /docs/updates/20200909_devcontainers_no_restart.md: -------------------------------------------------------------------------------- 1 | # Disable automatic restart of VSCode devcontainers 2 | 3 | Since the introduction of [VSCode devcontainers](./20200902_vscode_devcontainers.md) we noticed issues when you have more than one project using devcontainers on your PC. 4 | When restarting the PC, all devcontainers would try to restart which can lead to TCP port conflicts. 5 | 6 | Migration guide: 7 | 8 | - Remove all lines containing `restart: always` from the file `./.devcontainer/docker-compose.yml` (it should exist two or three times) 9 | -------------------------------------------------------------------------------- /docs/updates/20220515_cancel_check_runs.md: -------------------------------------------------------------------------------- 1 | # Cancel previous PR/branch runs when a new commit is pushed 2 | 3 | GitHub Actions allows canceling check runs when a new commit is pushed. This avoid wasting time on outdated commits and yields quicker results on the current one. 4 | 5 | To make use of this, edit your `.github/workflows/test-and-release.yml` file as follows: 6 | 7 | ```diff 8 | + # Cancel previous PR/branch runs when a new commit is pushed 9 | + concurrency: 10 | + group: ${{ github.ref }} 11 | + cancel-in-progress: true 12 | 13 | jobs: 14 | ``` 15 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_ESLint_Tabs_DoubleQuotes_MIT/admin/jsonCustom.json: -------------------------------------------------------------------------------- 1 | { 2 | "i18n": true, 3 | "type": "panel", 4 | "items": { 5 | "enabled": { 6 | "type": "checkbox", 7 | "label": "enabled", 8 | "newLine": true 9 | }, 10 | "interval": { 11 | "type": "text", 12 | "label": "period of time", 13 | "newLine": true 14 | }, 15 | "state": { 16 | "type": "text", 17 | "label": "new state", 18 | "newLine": true 19 | }, 20 | "setAck": { 21 | "type": "checkbox", 22 | "label": "ack", 23 | "newLine": true 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /docs/updates/20221208_update_io-packages_json_schema_ref.md: -------------------------------------------------------------------------------- 1 | # Update `io-packages.json` JSON schema reference 2 | 3 | For JSON schema support in Visual Studio Code, the following file needs to be updated: 4 | 5 | ## `.vscode/settings.json` 6 | 7 | ```diff 8 | "json.schemas": [ 9 | { 10 | "fileMatch": ["io-package.json"], 11 | - "url": "https://json.schemastore.org/io-package" 12 | + "url": "https://raw.githubusercontent.com/ioBroker/ioBroker.js-controller/master/schemas/io-package.json" 13 | }, 14 | { 15 | ``` 16 | -------------------------------------------------------------------------------- /docs/updates/20210503_devcontainer_official_docker.md: -------------------------------------------------------------------------------- 1 | # Use official Docker image for devcontainer 2 | 3 | Since the introduction of [VSCode devcontainers](./20200902_vscode_devcontainers.md), the ioBroker Docker image has been migrated to the ioBroker organization. To make use of the new images, you need to update the dockerfile. 4 | 5 | Migration guide: 6 | 7 | Change the first line in `.devcontainer/iobroker/Dockerfile` from 8 | 9 | ```Dockerfile 10 | FROM buanet/iobroker:latest 11 | ``` 12 | 13 | to 14 | 15 | ```Dockerfile 16 | FROM iobroker/iobroker:latest 17 | ``` 18 | -------------------------------------------------------------------------------- /docs/updates/20250401_devcontainer_ssh.md: -------------------------------------------------------------------------------- 1 | # Add git-ssh support in DevContainer 2 | 3 | To be able to push to git using an ssh url in a DevContainer, ssh is needed in the docker image. 4 | 5 | Make sure to add this change to `.devcontainer/iobroker/Dockerfile`: 6 | 7 | ```diff 8 | FROM iobroker/iobroker:latest 9 | 10 | RUN ln -s /opt/iobroker/node_modules/ /root/.node_modules 11 | + 12 | +# Needed to use git-ssh in devcontainer 13 | +RUN apt-get update \ 14 | + && apt-get -y --no-install-recommends install openssh-client \ 15 | + && apt-get clean && rm -rf /var/lib/apt/lists/* 16 | ``` 17 | -------------------------------------------------------------------------------- /templates/_github/auto-merge.yml.ts: -------------------------------------------------------------------------------- 1 | import type { TemplateFunction } from "../../src/lib/createAdapter"; 2 | import { readFile } from "../../src/lib/createAdapter"; 3 | 4 | const templateFunction: TemplateFunction = answers => { 5 | const useDependabot = answers.dependabot === "yes"; 6 | if (!useDependabot) { 7 | return; 8 | } 9 | 10 | return readFile("auto-merge.raw.yml", __dirname); 11 | }; 12 | 13 | templateFunction.customPath = ".github/auto-merge.yml"; 14 | // Reformatting this would create mixed tabs and spaces 15 | templateFunction.noReformat = true; 16 | export = templateFunction; 17 | -------------------------------------------------------------------------------- /templates/_prettierignore.ts: -------------------------------------------------------------------------------- 1 | import type { TemplateFunction } from "../src/lib/createAdapter"; 2 | 3 | const templateFunction: TemplateFunction = answers => { 4 | const usePrettier = answers.tools && answers.tools.indexOf("Prettier") > -1; 5 | if (!usePrettier) { 6 | return; 7 | } 8 | const useTypeScript = answers.language === "TypeScript"; 9 | 10 | 11 | const template = ` 12 | package.json 13 | package-lock.json 14 | ${useTypeScript ? "build/" : ""} 15 | `; 16 | return template.trim(); 17 | }; 18 | 19 | templateFunction.customPath = ".prettierignore"; 20 | export = templateFunction; 21 | -------------------------------------------------------------------------------- /templates/admin/tsconfig_JS-React.raw.json: -------------------------------------------------------------------------------- 1 | // Specialized tsconfig for the admin directory, 2 | // includes DOM typings and configures the admin build 3 | { 4 | "extends": "../tsconfig.json", 5 | "compilerOptions": { 6 | "noEmit": false, 7 | "outDir": "./build", 8 | "sourceMap": true, 9 | "sourceRoot": "./src", 10 | "noImplicitAny": false, 11 | "lib": [ 12 | "es2018", 13 | "DOM" 14 | ], 15 | "jsx": "react" 16 | }, 17 | "include": [ 18 | "./**/*.d.ts", 19 | "./**/*.jsx", 20 | "../lib/adapter-config.d.ts" 21 | ], 22 | "exclude": [ 23 | "./**/*.test.jsx" 24 | ] 25 | } 26 | -------------------------------------------------------------------------------- /test/baselines/ioBroker.hello-devcontainer/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "type": "node", 6 | "request": "launch", 7 | "name": "Launch ioBroker Adapter", 8 | "skipFiles": [ 9 | "/**" 10 | ], 11 | "args": [ 12 | "--debug", 13 | "0", 14 | "--logs" 15 | ], 16 | "program": "${workspaceFolder}/main.js", 17 | "console": "integratedTerminal" 18 | } 19 | ] 20 | } -------------------------------------------------------------------------------- /templates/widgets/style.css.ts: -------------------------------------------------------------------------------- 1 | import type { TemplateFunction } from "../../src/lib/createAdapter"; 2 | 3 | const templateFunction: TemplateFunction = answers => { 4 | const isWidget = answers.features.indexOf("vis") > -1; 5 | if (!isWidget) { 6 | return; 7 | } 8 | 9 | const widgetName = answers.adapterName; 10 | 11 | const template = ` 12 | /* Style your widget here */ 13 | .${widgetName}-class { 14 | font-style: italic; 15 | } 16 | `; 17 | return template.trim(); 18 | }; 19 | 20 | templateFunction.customPath = answers => `widgets/${answers.adapterName}/css/style.css`; 21 | export = templateFunction; 22 | -------------------------------------------------------------------------------- /docs/updates/20201107_typed_i18n_t.md: -------------------------------------------------------------------------------- 1 | # Add better types for the `I18n.t` function based on words in `i18n/en.json` for React UI 2 | 3 | This migration is **only relevant** if you're using **React** for the Admin UI. 4 | 5 | It will add better types for the translate function `I18n.t` so that TypeScript will only accept words defined in the 6 | English translation file. 7 | Doing so you can't forget to add new translations to at least the English translation file. 8 | 9 | ## Migration 10 | 11 | Add the file `admin/src/i18n/i18n.d.ts` whith the contents from [here](../../test/baselines/adapter_TS_React/admin/i18n/i18n.d.ts). 12 | -------------------------------------------------------------------------------- /templates/admin/tsconfig_TS-React.raw.json: -------------------------------------------------------------------------------- 1 | // Specialized tsconfig for the admin directory, 2 | // includes DOM typings and configures the admin build 3 | { 4 | "extends": "../tsconfig.json", 5 | "compilerOptions": { 6 | "noEmit": false, 7 | "outDir": "./build", 8 | "sourceMap": true, 9 | "sourceRoot": "./src", 10 | "noImplicitAny": false, 11 | "lib": [ 12 | "es2018", 13 | "DOM" 14 | ], 15 | "jsx": "react" 16 | }, 17 | "include": [ 18 | "./**/*.ts", 19 | "./**/*.tsx", 20 | "../src/lib/adapter-config.d.ts" 21 | ], 22 | "exclude": [ 23 | "./**/*.test.ts", 24 | "./**/*.test.tsx" 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /docs/updates/20210515_sourcemaps.md: -------------------------------------------------------------------------------- 1 | # Enable TypeScript sourcemaps 2 | 3 | Sourcemaps allow debugging the original TypeScript code, even when ioBroker executes the compiled JS files. Furthermore, the error messages in ioBroker also reference the original ts files if you enable sourcemaps. To make use of this in your existing adapters, do the following changes: 4 | 5 | 1. Change `tsconfig.json` as follows: 6 | 7 | ```diff 8 | - "sourceMap": false, 9 | + "sourceMap": true, 10 | ``` 11 | 12 | 2. In `.gitignore` and `.npmignore` remove these entries if they exist: 13 | ``` 14 | maps/ 15 | *.maps 16 | ``` 17 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React/admin/tsconfig.json: -------------------------------------------------------------------------------- 1 | // Specialized tsconfig for the admin directory, 2 | // includes DOM typings and configures the admin build 3 | { 4 | "extends": "../tsconfig.json", 5 | "compilerOptions": { 6 | "noEmit": false, 7 | "outDir": "./build", 8 | "sourceMap": true, 9 | "sourceRoot": "./src", 10 | "noImplicitAny": false, 11 | "lib": [ 12 | "es2018", 13 | "DOM" 14 | ], 15 | "jsx": "react" 16 | }, 17 | "include": [ 18 | "./**/*.ts", 19 | "./**/*.tsx", 20 | "../src/lib/adapter-config.d.ts" 21 | ], 22 | "exclude": [ 23 | "./**/*.test.ts", 24 | "./**/*.test.tsx" 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Verwendet IntelliSense zum Ermitteln möglicher Attribute. 3 | // Zeigen Sie auf vorhandene Attribute, um die zugehörigen Beschreibungen anzuzeigen. 4 | // Weitere Informationen finden Sie unter https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "type": "node", 9 | "request": "launch", 10 | "name": "Programm starten", 11 | "program": "${workspaceFolder}/src/cli.ts", 12 | "console": "integratedTerminal", 13 | "sourceMaps": true, 14 | "stopOnEntry": true, 15 | "outFiles": ["${workspaceFolder}/build/**/*.js"] 16 | } 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /docs/updates/20210902_github_dependency_caching.md: -------------------------------------------------------------------------------- 1 | # Use dependency caching in Github Actions 2 | 3 | The `setup-node` action supports dependency caching in version 2, allowing you to speed up tests on Github Actions. To take advantage of this, edit your `.github/workflows/test-and-release.yml` as follows: 4 | 5 | ```diff 6 | - name: Use Node.js ${{ matrix.node-version }} 7 | - uses: actions/setup-node@v1 8 | + uses: actions/setup-node@v2 9 | with: 10 | node-version: ${{ matrix.node-version }} 11 | + cache: 'npm' 12 | ``` 13 | 14 | This change may need to be done in multiple locations. 15 | -------------------------------------------------------------------------------- /test/baselines/vis_Widget/.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: npm 4 | directory: "/" 5 | schedule: 6 | interval: monthly 7 | day: 3 8 | time: "00:05" 9 | timezone: Europe/Berlin 10 | open-pull-requests-limit: 5 11 | assignees: 12 | - AlCalzone 13 | versioning-strategy: increase 14 | 15 | - package-ecosystem: github-actions 16 | directory: "/" 17 | schedule: 18 | interval: monthly 19 | day: 3 20 | time: "00:05" 21 | timezone: Europe/Berlin 22 | open-pull-requests-limit: 5 23 | assignees: 24 | - AlCalzone 25 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # top-most EditorConfig file 2 | root = true 3 | 4 | [*] 5 | end_of_line = lf 6 | insert_final_newline = true 7 | charset = utf-8 8 | indent_style = tab 9 | indent_size = 4 10 | 11 | # tab indentation by default 12 | [*.{js,jsx,ts,tsx}] 13 | indent_style = tab 14 | indent_size = 4 15 | 16 | # space indentation for some specific files 17 | [{package.json,lerna.json}] 18 | indent_style = space 19 | indent_size = 2 20 | 21 | [io-package.json] 22 | indent_style = space 23 | indent_size = 4 24 | 25 | [*.yml] 26 | indent_style = space 27 | indent_size = 4 28 | 29 | [.github/**/*.yml] 30 | indent_style = space 31 | indent_size = 2 32 | -------------------------------------------------------------------------------- /test/baselines/adapter_JS_React/.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: npm 4 | directory: "/" 5 | schedule: 6 | interval: monthly 7 | day: 8 8 | time: "00:05" 9 | timezone: Europe/Berlin 10 | open-pull-requests-limit: 5 11 | assignees: 12 | - AlCalzone 13 | versioning-strategy: increase 14 | 15 | - package-ecosystem: github-actions 16 | directory: "/" 17 | schedule: 18 | interval: monthly 19 | day: 8 20 | time: "00:05" 21 | timezone: Europe/Berlin 22 | open-pull-requests-limit: 5 23 | assignees: 24 | - AlCalzone 25 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React/.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: npm 4 | directory: "/" 5 | schedule: 6 | interval: monthly 7 | day: 8 8 | time: "00:05" 9 | timezone: Europe/Berlin 10 | open-pull-requests-limit: 5 11 | assignees: 12 | - AlCalzone 13 | versioning-strategy: increase 14 | 15 | - package-ecosystem: github-actions 16 | directory: "/" 17 | schedule: 18 | interval: monthly 19 | day: 8 20 | time: "00:05" 21 | timezone: Europe/Berlin 22 | open-pull-requests-limit: 5 23 | assignees: 24 | - AlCalzone 25 | -------------------------------------------------------------------------------- /test/baselines/tabReact_adminReact_TS/admin/tsconfig.json: -------------------------------------------------------------------------------- 1 | // Specialized tsconfig for the admin directory, 2 | // includes DOM typings and configures the admin build 3 | { 4 | "extends": "../tsconfig.json", 5 | "compilerOptions": { 6 | "noEmit": false, 7 | "outDir": "./build", 8 | "sourceMap": true, 9 | "sourceRoot": "./src", 10 | "noImplicitAny": false, 11 | "lib": [ 12 | "es2018", 13 | "DOM" 14 | ], 15 | "jsx": "react" 16 | }, 17 | "include": [ 18 | "./**/*.ts", 19 | "./**/*.tsx", 20 | "../src/lib/adapter-config.d.ts" 21 | ], 22 | "exclude": [ 23 | "./**/*.test.ts", 24 | "./**/*.test.tsx" 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React_OfficialESLint/admin/tsconfig.json: -------------------------------------------------------------------------------- 1 | // Specialized tsconfig for the admin directory, 2 | // includes DOM typings and configures the admin build 3 | { 4 | "extends": "../tsconfig.json", 5 | "compilerOptions": { 6 | "noEmit": false, 7 | "outDir": "./build", 8 | "sourceMap": true, 9 | "sourceRoot": "./src", 10 | "noImplicitAny": false, 11 | "lib": [ 12 | "es2018", 13 | "DOM" 14 | ], 15 | "jsx": "react" 16 | }, 17 | "include": [ 18 | "./**/*.ts", 19 | "./**/*.tsx", 20 | "../src/lib/adapter-config.d.ts" 21 | ], 22 | "exclude": [ 23 | "./**/*.test.ts", 24 | "./**/*.test.tsx" 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_WithoutBuild/.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: npm 4 | directory: "/" 5 | schedule: 6 | interval: monthly 7 | day: 8 8 | time: "00:05" 9 | timezone: Europe/Berlin 10 | open-pull-requests-limit: 5 11 | assignees: 12 | - AlCalzone 13 | versioning-strategy: increase 14 | 15 | - package-ecosystem: github-actions 16 | directory: "/" 17 | schedule: 18 | interval: monthly 19 | day: 8 20 | time: "00:05" 21 | timezone: Europe/Berlin 22 | open-pull-requests-limit: 5 23 | assignees: 24 | - AlCalzone 25 | -------------------------------------------------------------------------------- /templates/_github/workflows/dependabot-auto-merge.yml.ts: -------------------------------------------------------------------------------- 1 | import type { TemplateFunction } from "../../../src/lib/createAdapter"; 2 | import { readFile } from "../../../src/lib/createAdapter"; 3 | 4 | const templateFunction: TemplateFunction = answers => { 5 | const useDependabot = answers.dependabot === "yes"; 6 | if (!useDependabot) { 7 | return; 8 | } 9 | 10 | return readFile("dependabot-auto-merge.raw.yml", __dirname); 11 | }; 12 | 13 | templateFunction.customPath = ".github/workflows/dependabot-auto-merge.yml"; 14 | // Reformatting this would create mixed tabs and spaces 15 | templateFunction.noReformat = true; 16 | export = templateFunction; 17 | -------------------------------------------------------------------------------- /test/baselines/adapter_JS_OfficialESLint/.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: npm 4 | directory: "/" 5 | schedule: 6 | interval: monthly 7 | day: 8 8 | time: "00:05" 9 | timezone: Europe/Berlin 10 | open-pull-requests-limit: 5 11 | assignees: 12 | - AlCalzone 13 | versioning-strategy: increase 14 | 15 | - package-ecosystem: github-actions 16 | directory: "/" 17 | schedule: 18 | interval: monthly 19 | day: 8 20 | time: "00:05" 21 | timezone: Europe/Berlin 22 | open-pull-requests-limit: 5 23 | assignees: 24 | - AlCalzone 25 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_OfficialESLint/.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: npm 4 | directory: "/" 5 | schedule: 6 | interval: monthly 7 | day: 8 8 | time: "00:05" 9 | timezone: Europe/Berlin 10 | open-pull-requests-limit: 5 11 | assignees: 12 | - AlCalzone 13 | versioning-strategy: increase 14 | 15 | - package-ecosystem: github-actions 16 | directory: "/" 17 | schedule: 18 | interval: monthly 19 | day: 8 20 | time: "00:05" 21 | timezone: Europe/Berlin 22 | open-pull-requests-limit: 5 23 | assignees: 24 | - AlCalzone 25 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_VIS_CustomESLint/.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: npm 4 | directory: "/" 5 | schedule: 6 | interval: monthly 7 | day: 8 8 | time: "00:05" 9 | timezone: Europe/Berlin 10 | open-pull-requests-limit: 5 11 | assignees: 12 | - AlCalzone 13 | versioning-strategy: increase 14 | 15 | - package-ecosystem: github-actions 16 | directory: "/" 17 | schedule: 18 | interval: monthly 19 | day: 8 20 | time: "00:05" 21 | timezone: Europe/Berlin 22 | open-pull-requests-limit: 5 23 | assignees: 24 | - AlCalzone 25 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_VIS_OfficialESLint/.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: npm 4 | directory: "/" 5 | schedule: 6 | interval: monthly 7 | day: 8 8 | time: "00:05" 9 | timezone: Europe/Berlin 10 | open-pull-requests-limit: 5 11 | assignees: 12 | - AlCalzone 13 | versioning-strategy: increase 14 | 15 | - package-ecosystem: github-actions 16 | directory: "/" 17 | schedule: 18 | interval: monthly 19 | day: 8 20 | time: "00:05" 21 | timezone: Europe/Berlin 22 | open-pull-requests-limit: 5 23 | assignees: 24 | - AlCalzone 25 | -------------------------------------------------------------------------------- /test/baselines/ioBroker.hello-devcontainer/.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: npm 4 | directory: "/" 5 | schedule: 6 | interval: monthly 7 | day: 21 8 | time: "00:05" 9 | timezone: Europe/Berlin 10 | open-pull-requests-limit: 5 11 | assignees: 12 | - AlCalzone 13 | versioning-strategy: increase 14 | 15 | - package-ecosystem: github-actions 16 | directory: "/" 17 | schedule: 18 | interval: monthly 19 | day: 21 20 | time: "00:05" 21 | timezone: Europe/Berlin 22 | open-pull-requests-limit: 5 23 | assignees: 24 | - AlCalzone 25 | -------------------------------------------------------------------------------- /test/baselines/vis_Widget/.create-adapter.json: -------------------------------------------------------------------------------- 1 | { 2 | "cli": true, 3 | "target": "directory", 4 | "adapterName": "test-widget", 5 | "title": "Is used to test the creator", 6 | "features": [ 7 | "vis" 8 | ], 9 | "type": "visualization-widgets", 10 | "widgetIsMainFunction": "main", 11 | "releaseScript": "no", 12 | "indentation": "Tab", 13 | "quotes": "double", 14 | "authorName": "Al Calzone", 15 | "authorGithub": "AlCalzone", 16 | "authorEmail": "al@calzo.ne", 17 | "gitRemoteProtocol": "HTTPS", 18 | "dependabot": "yes", 19 | "gitCommit": "no", 20 | "defaultBranch": "main", 21 | "license": "MIT License", 22 | "creatorVersion": "3.1.2" 23 | } -------------------------------------------------------------------------------- /docs/updates/20210503_vscode_io-package_schema.md: -------------------------------------------------------------------------------- 1 | # Enable JSON schema support for `io-package.json` in VSCode 2 | 3 | Modern editors like VSCode and WebStorm have JSON Schema support when editing common `.json` files. This provides you with auto-completion and warns you of errors in your files. 4 | To make VSCode enable this feature for 3rd-party files like `io-package.json`, a setting needs to be enabled in the project settings. To do so, edit `.vscode/settings.json` and add the following: 5 | 6 | ```json 7 | "json.schemas": [ 8 | { 9 | "fileMatch": ["io-package.json"], 10 | "url": "https://json.schemastore.org/io-package" 11 | } 12 | ] 13 | ``` 14 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React_OfficialESLint/.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: npm 4 | directory: "/" 5 | schedule: 6 | interval: monthly 7 | day: 8 8 | time: "00:05" 9 | timezone: Europe/Berlin 10 | open-pull-requests-limit: 5 11 | assignees: 12 | - AlCalzone 13 | versioning-strategy: increase 14 | 15 | - package-ecosystem: github-actions 16 | directory: "/" 17 | schedule: 18 | interval: monthly 19 | day: 8 20 | time: "00:05" 21 | timezone: Europe/Berlin 22 | open-pull-requests-limit: 5 23 | assignees: 24 | - AlCalzone 25 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_ESLint_Tabs_DoubleQuotes_MIT/.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: npm 4 | directory: "/" 5 | schedule: 6 | interval: monthly 7 | day: 8 8 | time: "00:05" 9 | timezone: Europe/Berlin 10 | open-pull-requests-limit: 5 11 | assignees: 12 | - AlCalzone 13 | versioning-strategy: increase 14 | 15 | - package-ecosystem: github-actions 16 | directory: "/" 17 | schedule: 18 | interval: monthly 19 | day: 8 20 | time: "00:05" 21 | timezone: Europe/Berlin 22 | open-pull-requests-limit: 5 23 | assignees: 24 | - AlCalzone 25 | -------------------------------------------------------------------------------- /test/mocha.setup.js: -------------------------------------------------------------------------------- 1 | // Makes ts-node ignore warnings, so mocha --watch does work 2 | process.env.TS_NODE_IGNORE_WARNINGS = "TRUE"; 3 | // Sets the correct tsconfig for testing 4 | process.env.TS_NODE_PROJECT = "tsconfig.json"; 5 | 6 | // Don't silently swallow unhandled rejections 7 | process.on("unhandledRejection", e => { 8 | throw e; 9 | }); 10 | 11 | // enable the should interface with sinon 12 | // and load chai-as-promised and sinon-chai by default 13 | const sinonChai = require("sinon-chai"); 14 | const chaiAsPromised = require("chai-as-promised"); 15 | const { should, use } = require("chai"); 16 | 17 | should(); 18 | use(sinonChai); 19 | use(chaiAsPromised); 20 | -------------------------------------------------------------------------------- /test/baselines/adapter_JS_React/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "eslint.enable": true, 3 | "json.schemas": [ 4 | { 5 | "fileMatch": [ 6 | "io-package.json" 7 | ], 8 | "url": "https://raw.githubusercontent.com/ioBroker/ioBroker.js-controller/master/schemas/io-package.json" 9 | }, 10 | { 11 | "fileMatch": [ 12 | "admin/jsonConfig.json", 13 | "admin/jsonConfig.json5", 14 | "admin/jsonCustom.json", 15 | "admin/jsonCustom.json5", 16 | "admin/jsonTab.json", 17 | "admin/jsonTab.json5" 18 | ], 19 | "url": "https://raw.githubusercontent.com/ioBroker/ioBroker.admin/master/packages/jsonConfig/schemas/jsonConfig.json" 20 | } 21 | ] 22 | } -------------------------------------------------------------------------------- /test/baselines/adapter_TS_WithoutBuild/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "eslint.enable": true, 3 | "json.schemas": [ 4 | { 5 | "fileMatch": [ 6 | "io-package.json" 7 | ], 8 | "url": "https://raw.githubusercontent.com/ioBroker/ioBroker.js-controller/master/schemas/io-package.json" 9 | }, 10 | { 11 | "fileMatch": [ 12 | "admin/jsonConfig.json", 13 | "admin/jsonConfig.json5", 14 | "admin/jsonCustom.json", 15 | "admin/jsonCustom.json5", 16 | "admin/jsonTab.json", 17 | "admin/jsonTab.json5" 18 | ], 19 | "url": "https://raw.githubusercontent.com/ioBroker/ioBroker.admin/master/packages/jsonConfig/schemas/jsonConfig.json" 20 | } 21 | ] 22 | } -------------------------------------------------------------------------------- /test/baselines/adapter_JS_React/lib/adapter-config.d.ts: -------------------------------------------------------------------------------- 1 | // This file extends the AdapterConfig type from "@iobroker/types" 2 | // using the actual properties present in io-package.json 3 | // in order to provide typings for adapter.config properties 4 | 5 | import { native } from '../io-package.json'; 6 | 7 | type _AdapterConfig = typeof native; 8 | 9 | // Augment the globally declared type ioBroker.AdapterConfig 10 | declare global { 11 | namespace ioBroker { 12 | interface AdapterConfig extends _AdapterConfig { 13 | // Do not enter anything here! 14 | } 15 | } 16 | } 17 | 18 | // this is required so the above AdapterConfig is found by TypeScript / type checking 19 | export {}; -------------------------------------------------------------------------------- /test/baselines/adapter_JS_React/admin/index_m.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React/admin/index_m.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /test/baselines/ioBroker.hello-devcontainer/admin/jsonConfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "i18n": true, 3 | "type": "panel", 4 | "items": { 5 | "option1": { 6 | "type": "checkbox", 7 | "label": "option1", 8 | "newLine": true, 9 | "xs": 12, 10 | "sm": 12, 11 | "md": 6, 12 | "lg": 4, 13 | "xl": 4 14 | }, 15 | "option2": { 16 | "type": "text", 17 | "label": "option2", 18 | "newLine": true, 19 | "xs": 12, 20 | "sm": 12, 21 | "md": 6, 22 | "lg": 4, 23 | "xl": 4 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /test/baselines/adapter_JS_JsonUI_ESLint_TypeChecking_Spaces_SingleQuotes_Apache-2.0/.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: npm 4 | directory: "/" 5 | schedule: 6 | interval: monthly 7 | day: 8 8 | time: "00:05" 9 | timezone: Europe/Berlin 10 | open-pull-requests-limit: 5 11 | assignees: 12 | - AlCalzone 13 | versioning-strategy: increase 14 | 15 | - package-ecosystem: github-actions 16 | directory: "/" 17 | schedule: 18 | interval: monthly 19 | day: 8 20 | time: "00:05" 21 | timezone: Europe/Berlin 22 | open-pull-requests-limit: 5 23 | assignees: 24 | - AlCalzone 25 | -------------------------------------------------------------------------------- /test/baselines/tabReact_adminReact_TS/admin/index_m.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React_OfficialESLint/admin/index_m.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /test/baselines/adapter_JS_OfficialESLint/lib/adapter-config.d.ts: -------------------------------------------------------------------------------- 1 | // This file extends the AdapterConfig type from "@iobroker/types" 2 | // using the actual properties present in io-package.json 3 | // in order to provide typings for adapter.config properties 4 | 5 | import { native } from '../io-package.json'; 6 | 7 | type _AdapterConfig = typeof native; 8 | 9 | // Augment the globally declared type ioBroker.AdapterConfig 10 | declare global { 11 | namespace ioBroker { 12 | interface AdapterConfig extends _AdapterConfig { 13 | // Do not enter anything here! 14 | } 15 | } 16 | } 17 | 18 | // this is required so the above AdapterConfig is found by TypeScript / type checking 19 | export {}; -------------------------------------------------------------------------------- /test/baselines/ioBroker.hello-devcontainer/lib/adapter-config.d.ts: -------------------------------------------------------------------------------- 1 | // This file extends the AdapterConfig type from "@iobroker/types" 2 | // using the actual properties present in io-package.json 3 | // in order to provide typings for adapter.config properties 4 | 5 | import { native } from '../io-package.json'; 6 | 7 | type _AdapterConfig = typeof native; 8 | 9 | // Augment the globally declared type ioBroker.AdapterConfig 10 | declare global { 11 | namespace ioBroker { 12 | interface AdapterConfig extends _AdapterConfig { 13 | // Do not enter anything here! 14 | } 15 | } 16 | } 17 | 18 | // this is required so the above AdapterConfig is found by TypeScript / type checking 19 | export {}; -------------------------------------------------------------------------------- /test/baselines/adapter_JS_JsonUI_ESLint_TypeChecking_Spaces_SingleQuotes_Apache-2.0/admin/jsonConfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "i18n": true, 3 | "type": "panel", 4 | "items": { 5 | "option1": { 6 | "type": "checkbox", 7 | "label": "option1", 8 | "newLine": true, 9 | "xs": 12, 10 | "sm": 12, 11 | "md": 6, 12 | "lg": 4, 13 | "xl": 4 14 | }, 15 | "option2": { 16 | "type": "text", 17 | "label": "option2", 18 | "newLine": true, 19 | "xs": 12, 20 | "sm": 12, 21 | "md": 6, 22 | "lg": 4, 23 | "xl": 4 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "typescript.tsdk": "node_modules/typescript/lib", 3 | "eslint.enable": true, 4 | "json.schemas": [ 5 | { 6 | "fileMatch": [ 7 | "io-package.json" 8 | ], 9 | "url": "https://raw.githubusercontent.com/ioBroker/ioBroker.js-controller/master/schemas/io-package.json" 10 | }, 11 | { 12 | "fileMatch": [ 13 | "admin/jsonConfig.json", 14 | "admin/jsonConfig.json5", 15 | "admin/jsonCustom.json", 16 | "admin/jsonCustom.json5", 17 | "admin/jsonTab.json", 18 | "admin/jsonTab.json5" 19 | ], 20 | "url": "https://raw.githubusercontent.com/ioBroker/ioBroker.admin/master/packages/jsonConfig/schemas/jsonConfig.json" 21 | } 22 | ] 23 | } -------------------------------------------------------------------------------- /test/baselines/adapter_JS_React/admin/src/index.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import { MuiThemeProvider } from '@material-ui/core/styles'; 4 | import theme from '@iobroker/adapter-react/Theme'; 5 | import Utils from '@iobroker/adapter-react/Components/Utils'; 6 | import App from './app'; 7 | 8 | let themeName = Utils.getThemeName(); 9 | 10 | function build() { 11 | ReactDOM.render( 12 | 13 | { 16 | themeName = _theme; 17 | build(); 18 | }} 19 | /> 20 | , 21 | document.getElementById('root'), 22 | ); 23 | } 24 | 25 | build(); 26 | -------------------------------------------------------------------------------- /test/baselines/TS_DoubleQuotes/admin/src/index.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import ReactDOM from "react-dom"; 3 | import { MuiThemeProvider } from "@material-ui/core/styles"; 4 | import theme from "@iobroker/adapter-react/Theme"; 5 | import Utils from "@iobroker/adapter-react/Components/Utils"; 6 | import App from "./app"; 7 | 8 | let themeName = Utils.getThemeName(); 9 | 10 | function build(): void { 11 | ReactDOM.render( 12 | 13 | { 16 | themeName = _theme; 17 | build(); 18 | }} 19 | /> 20 | , 21 | document.getElementById("root"), 22 | ); 23 | } 24 | 25 | build(); 26 | -------------------------------------------------------------------------------- /test/baselines/TS_SingleQuotes/admin/src/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import { MuiThemeProvider } from '@material-ui/core/styles'; 4 | import theme from '@iobroker/adapter-react/Theme'; 5 | import Utils from '@iobroker/adapter-react/Components/Utils'; 6 | import App from './app'; 7 | 8 | let themeName = Utils.getThemeName(); 9 | 10 | function build(): void { 11 | ReactDOM.render( 12 | 13 | { 16 | themeName = _theme; 17 | build(); 18 | }} 19 | /> 20 | , 21 | document.getElementById('root'), 22 | ); 23 | } 24 | 25 | build(); 26 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_OfficialESLint/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "typescript.tsdk": "node_modules/typescript/lib", 3 | "eslint.enable": true, 4 | "json.schemas": [ 5 | { 6 | "fileMatch": [ 7 | "io-package.json" 8 | ], 9 | "url": "https://raw.githubusercontent.com/ioBroker/ioBroker.js-controller/master/schemas/io-package.json" 10 | }, 11 | { 12 | "fileMatch": [ 13 | "admin/jsonConfig.json", 14 | "admin/jsonConfig.json5", 15 | "admin/jsonCustom.json", 16 | "admin/jsonCustom.json5", 17 | "admin/jsonTab.json", 18 | "admin/jsonTab.json5" 19 | ], 20 | "url": "https://raw.githubusercontent.com/ioBroker/ioBroker.admin/master/packages/jsonConfig/schemas/jsonConfig.json" 21 | } 22 | ] 23 | } -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React/admin/src/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import { MuiThemeProvider } from '@material-ui/core/styles'; 4 | import theme from '@iobroker/adapter-react/Theme'; 5 | import Utils from '@iobroker/adapter-react/Components/Utils'; 6 | import App from './app'; 7 | 8 | let themeName = Utils.getThemeName(); 9 | 10 | function build(): void { 11 | ReactDOM.render( 12 | 13 | { 16 | themeName = _theme; 17 | build(); 18 | }} 19 | /> 20 | , 21 | document.getElementById('root'), 22 | ); 23 | } 24 | 25 | build(); 26 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_VIS_CustomESLint/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "typescript.tsdk": "node_modules/typescript/lib", 3 | "eslint.enable": true, 4 | "json.schemas": [ 5 | { 6 | "fileMatch": [ 7 | "io-package.json" 8 | ], 9 | "url": "https://raw.githubusercontent.com/ioBroker/ioBroker.js-controller/master/schemas/io-package.json" 10 | }, 11 | { 12 | "fileMatch": [ 13 | "admin/jsonConfig.json", 14 | "admin/jsonConfig.json5", 15 | "admin/jsonCustom.json", 16 | "admin/jsonCustom.json5", 17 | "admin/jsonTab.json", 18 | "admin/jsonTab.json5" 19 | ], 20 | "url": "https://raw.githubusercontent.com/ioBroker/ioBroker.admin/master/packages/jsonConfig/schemas/jsonConfig.json" 21 | } 22 | ] 23 | } -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React_OfficialESLint/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "typescript.tsdk": "node_modules/typescript/lib", 3 | "eslint.enable": true, 4 | "json.schemas": [ 5 | { 6 | "fileMatch": [ 7 | "io-package.json" 8 | ], 9 | "url": "https://raw.githubusercontent.com/ioBroker/ioBroker.js-controller/master/schemas/io-package.json" 10 | }, 11 | { 12 | "fileMatch": [ 13 | "admin/jsonConfig.json", 14 | "admin/jsonConfig.json5", 15 | "admin/jsonCustom.json", 16 | "admin/jsonCustom.json5", 17 | "admin/jsonTab.json", 18 | "admin/jsonTab.json5" 19 | ], 20 | "url": "https://raw.githubusercontent.com/ioBroker/ioBroker.admin/master/packages/jsonConfig/schemas/jsonConfig.json" 21 | } 22 | ] 23 | } -------------------------------------------------------------------------------- /test/baselines/adapter_TS_VIS_OfficialESLint/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "typescript.tsdk": "node_modules/typescript/lib", 3 | "eslint.enable": true, 4 | "json.schemas": [ 5 | { 6 | "fileMatch": [ 7 | "io-package.json" 8 | ], 9 | "url": "https://raw.githubusercontent.com/ioBroker/ioBroker.js-controller/master/schemas/io-package.json" 10 | }, 11 | { 12 | "fileMatch": [ 13 | "admin/jsonConfig.json", 14 | "admin/jsonConfig.json5", 15 | "admin/jsonCustom.json", 16 | "admin/jsonCustom.json5", 17 | "admin/jsonTab.json", 18 | "admin/jsonTab.json5" 19 | ], 20 | "url": "https://raw.githubusercontent.com/ioBroker/ioBroker.admin/master/packages/jsonConfig/schemas/jsonConfig.json" 21 | } 22 | ] 23 | } -------------------------------------------------------------------------------- /test/baselines/tabReact_adminReact_TS/admin/src/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import { MuiThemeProvider } from '@material-ui/core/styles'; 4 | import theme from '@iobroker/adapter-react/Theme'; 5 | import Utils from '@iobroker/adapter-react/Components/Utils'; 6 | import App from './app'; 7 | 8 | let themeName = Utils.getThemeName(); 9 | 10 | function build(): void { 11 | ReactDOM.render( 12 | 13 | { 16 | themeName = _theme; 17 | build(); 18 | }} 19 | /> 20 | , 21 | document.getElementById('root'), 22 | ); 23 | } 24 | 25 | build(); 26 | -------------------------------------------------------------------------------- /test/baselines/tabReact_adminHtml_JS/admin/src/tab.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import { MuiThemeProvider } from '@material-ui/core/styles'; 4 | import theme from '@iobroker/adapter-react/Theme'; 5 | import Utils from '@iobroker/adapter-react/Components/Utils'; 6 | import TabApp from './tab-app'; 7 | 8 | let themeName = Utils.getThemeName(); 9 | 10 | function build() { 11 | ReactDOM.render( 12 | 13 | { 16 | themeName = _theme; 17 | build(); 18 | }} 19 | /> 20 | , 21 | document.getElementById('root'), 22 | ); 23 | } 24 | 25 | build(); 26 | -------------------------------------------------------------------------------- /templates/_devcontainer/parcel/_Dockerfile.ts: -------------------------------------------------------------------------------- 1 | import type { TemplateFunction } from "../../../src/lib/createAdapter"; 2 | 3 | const templateFunction: TemplateFunction = answers => { 4 | const devcontainer = answers.tools && answers.tools.includes("devcontainer"); 5 | const needsParcel = answers.adminUi === "react" || answers.tabReact === "yes"; 6 | if (!devcontainer || !needsParcel) { 7 | return; 8 | } 9 | 10 | const template = ` 11 | FROM node:12 12 | 13 | RUN mkdir -p /usr/app 14 | 15 | COPY *.sh /usr/app/ 16 | 17 | RUN chmod +x /usr/app/*.sh 18 | 19 | CMD /bin/bash -c "/usr/app/run.sh" 20 | `; 21 | return template.trim(); 22 | }; 23 | 24 | templateFunction.customPath = ".devcontainer/parcel/Dockerfile"; 25 | export = templateFunction; 26 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_ESLint_Tabs_DoubleQuotes_MIT/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "typescript.tsdk": "node_modules/typescript/lib", 3 | "eslint.enable": true, 4 | "json.schemas": [ 5 | { 6 | "fileMatch": [ 7 | "io-package.json" 8 | ], 9 | "url": "https://raw.githubusercontent.com/ioBroker/ioBroker.js-controller/master/schemas/io-package.json" 10 | }, 11 | { 12 | "fileMatch": [ 13 | "admin/jsonConfig.json", 14 | "admin/jsonConfig.json5", 15 | "admin/jsonCustom.json", 16 | "admin/jsonCustom.json5", 17 | "admin/jsonTab.json", 18 | "admin/jsonTab.json5" 19 | ], 20 | "url": "https://raw.githubusercontent.com/ioBroker/ioBroker.admin/master/packages/jsonConfig/schemas/jsonConfig.json" 21 | } 22 | ] 23 | } -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React_OfficialESLint/admin/src/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import { MuiThemeProvider } from '@material-ui/core/styles'; 4 | import theme from '@iobroker/adapter-react/Theme'; 5 | import Utils from '@iobroker/adapter-react/Components/Utils'; 6 | import App from './app'; 7 | 8 | let themeName = Utils.getThemeName(); 9 | 10 | function build(): void { 11 | ReactDOM.render( 12 | 13 | { 16 | themeName = _theme; 17 | build(); 18 | }} 19 | /> 20 | , 21 | document.getElementById('root'), 22 | ); 23 | } 24 | 25 | build(); 26 | -------------------------------------------------------------------------------- /test/baselines/tabReact_adminReact_TS/admin/src/tab.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import { MuiThemeProvider } from '@material-ui/core/styles'; 4 | import theme from '@iobroker/adapter-react/Theme'; 5 | import Utils from '@iobroker/adapter-react/Components/Utils'; 6 | import TabApp from './tab-app'; 7 | 8 | let themeName = Utils.getThemeName(); 9 | 10 | function build(): void { 11 | ReactDOM.render( 12 | 13 | { 16 | themeName = _theme; 17 | build(); 18 | }} 19 | /> 20 | , 21 | document.getElementById('root'), 22 | ); 23 | } 24 | 25 | build(); 26 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | import type { Answers } from "./lib/core/questions"; 2 | import { checkAnswers, formatAnswers, validateAnswers } from "./lib/core/questions"; 3 | import type { File } from "./lib/createAdapter"; 4 | import { createFiles } from "./lib/createAdapter"; 5 | 6 | /** 7 | * 8 | * @param answers 9 | * @param disableValidation 10 | */ 11 | export async function createAdapter(answers: Answers, disableValidation: (keyof Answers)[] = []): Promise { 12 | // Format answers (apply defaults, transformations, etc.) 13 | answers = (await formatAnswers(answers)) as Answers; 14 | // Check all answers 15 | checkAnswers(answers); 16 | await validateAnswers(answers, disableValidation); 17 | 18 | // Create files 19 | return createFiles(answers); 20 | } 21 | -------------------------------------------------------------------------------- /test/baselines/adapter_JS_JsonUI_ESLint_TypeChecking_Spaces_SingleQuotes_Apache-2.0/lib/adapter-config.d.ts: -------------------------------------------------------------------------------- 1 | // This file extends the AdapterConfig type from "@iobroker/types" 2 | // using the actual properties present in io-package.json 3 | // in order to provide typings for adapter.config properties 4 | 5 | import { native } from '../io-package.json'; 6 | 7 | type _AdapterConfig = typeof native; 8 | 9 | // Augment the globally declared type ioBroker.AdapterConfig 10 | declare global { 11 | namespace ioBroker { 12 | interface AdapterConfig extends _AdapterConfig { 13 | // Do not enter anything here! 14 | } 15 | } 16 | } 17 | 18 | // this is required so the above AdapterConfig is found by TypeScript / type checking 19 | export {}; -------------------------------------------------------------------------------- /templates/_github/auto-merge.raw.yml: -------------------------------------------------------------------------------- 1 | # Configure here which dependency updates should be merged automatically. 2 | # The recommended configuration is the following: 3 | - match: 4 | # Only merge patches for production dependencies 5 | dependency_type: production 6 | update_type: "semver:patch" 7 | - match: 8 | # Except for security fixes, here we allow minor patches 9 | dependency_type: production 10 | update_type: "security:minor" 11 | - match: 12 | # and development dependencies can have a minor update, too 13 | dependency_type: development 14 | update_type: "semver:minor" 15 | 16 | # The syntax is based on the legacy dependabot v1 automerged_updates syntax, see: 17 | # https://dependabot.com/docs/config-file/#automerged_updates 18 | -------------------------------------------------------------------------------- /docs/updates/20201105_adapter_react_fixes.md: -------------------------------------------------------------------------------- 1 | # Fix compatibility with @iobroker/adapter-react@1.4.5 2 | 3 | `@iobroker/adapter-react` has switched to default-importing `React`, which causes our `* as React` imports to break the type declarations. 4 | By enabling `esModuleInterop` and dropping the `*` import (TypeScript only), we can fix it. 5 | 6 | Migration guide: 7 | 8 | - Remove the line `"jsx": "react"` from `tsconfig.json` in the project root. 9 | - Add `"esModuleInterop": true` and `"jsx": "react"` to `admin/tsconfig.json` (inside `compilerOptions`) 10 | - TypeScript only: Replace `import * as React from "react"` with `import React from "react"` 11 | - TypeScript only: Replace `import * as ReactDOM from "react-dom"` with `import ReactDOM from "react-dom"` 12 | -------------------------------------------------------------------------------- /templates/_devcontainer/iobroker/boot.sh.ts: -------------------------------------------------------------------------------- 1 | import type { TemplateFunction } from "../../../src/lib/createAdapter"; 2 | 3 | const templateFunction: TemplateFunction = answers => { 4 | const devcontainer = answers.tools && answers.tools.includes("devcontainer"); 5 | if (!devcontainer) { 6 | return; 7 | } 8 | 9 | const template = ` 10 | #!/bin/bash 11 | 12 | set -e 13 | 14 | # Define log file location 15 | LOG_FILE=/opt/iobroker/log/boot.log 16 | mkdir -p /opt/iobroker/log 17 | 18 | # Start logging to the file (standard output and error) 19 | exec > >(tee "$LOG_FILE") 2>&1 20 | 21 | /opt/scripts/iobroker_startup.sh 22 | `; 23 | return template.trim(); 24 | }; 25 | 26 | templateFunction.customPath = ".devcontainer/iobroker/boot.sh"; 27 | export = templateFunction; 28 | -------------------------------------------------------------------------------- /templates/_devcontainer/parcel/run.sh.ts: -------------------------------------------------------------------------------- 1 | import type { TemplateFunction } from "../../../src/lib/createAdapter"; 2 | 3 | const templateFunction: TemplateFunction = answers => { 4 | const devcontainer = answers.tools && answers.tools.includes("devcontainer"); 5 | const needsParcel = answers.adminUi === "react" || answers.tabReact === "yes"; 6 | if (!devcontainer || !needsParcel) { 7 | return; 8 | } 9 | 10 | const template = ` 11 | #!/bin/bash 12 | cd /workspace 13 | 14 | echo "Installing all dependencies..." 15 | npm install 16 | 17 | npm run watch:parcel 18 | `; 19 | return template.trim().replace(/\r\n/g, "\n"); 20 | }; 21 | 22 | templateFunction.customPath = ".devcontainer/parcel/run.sh"; 23 | templateFunction.noReformat = true; 24 | export = templateFunction; 25 | -------------------------------------------------------------------------------- /test/baselines/vis_Widget/.github/auto-merge.yml: -------------------------------------------------------------------------------- 1 | # Configure here which dependency updates should be merged automatically. 2 | # The recommended configuration is the following: 3 | - match: 4 | # Only merge patches for production dependencies 5 | dependency_type: production 6 | update_type: "semver:patch" 7 | - match: 8 | # Except for security fixes, here we allow minor patches 9 | dependency_type: production 10 | update_type: "security:minor" 11 | - match: 12 | # and development dependencies can have a minor update, too 13 | dependency_type: development 14 | update_type: "semver:minor" 15 | 16 | # The syntax is based on the legacy dependabot v1 automerged_updates syntax, see: 17 | # https://dependabot.com/docs/config-file/#automerged_updates 18 | -------------------------------------------------------------------------------- /templates/admin/_eslintrc_js_react.json.ts: -------------------------------------------------------------------------------- 1 | import type { TemplateFunction } from "../../src/lib/createAdapter"; 2 | 3 | const templateFunction: TemplateFunction = answers => { 4 | const useTypeScript = answers.language === "TypeScript"; 5 | const useReact = answers.adminUi === "react" || answers.tabReact === "yes"; 6 | if (useTypeScript || !useReact) { 7 | return; 8 | } 9 | 10 | const template = ` 11 | { 12 | "env": { 13 | "browser": true, 14 | "es6": true 15 | }, 16 | "parserOptions": { 17 | "sourceType": "module", 18 | "project": "./tsconfig.json" 19 | }, 20 | "rules": { 21 | "react/prop-types": "off" 22 | } 23 | } 24 | `; 25 | return template.trim(); 26 | }; 27 | 28 | templateFunction.customPath = "admin/.eslintrc.json"; 29 | export = templateFunction; 30 | -------------------------------------------------------------------------------- /templates/_devcontainer/scripts/poststart.sh.ts: -------------------------------------------------------------------------------- 1 | import type { TemplateFunction } from "../../../src/lib/createAdapter"; 2 | 3 | const templateFunction: TemplateFunction = answers => { 4 | const devcontainer = answers.tools && answers.tools.includes("devcontainer"); 5 | if (!devcontainer) { 6 | return; 7 | } 8 | 9 | const template = ` 10 | #!/bin/bash 11 | 12 | set -e 13 | 14 | # execute poststart only if container was created right before 15 | if [ -e /tmp/.postcreate_done ]; then 16 | rm /tmp/.postcreate_done 17 | else 18 | # Wait for ioBroker to become ready 19 | sh .devcontainer/scripts/wait_for_iobroker.sh 20 | fi 21 | `; 22 | return template.trim(); 23 | }; 24 | 25 | templateFunction.customPath = ".devcontainer/scripts/poststart.sh"; 26 | export = templateFunction; 27 | -------------------------------------------------------------------------------- /test/baselines/adapter_JS_React/.github/auto-merge.yml: -------------------------------------------------------------------------------- 1 | # Configure here which dependency updates should be merged automatically. 2 | # The recommended configuration is the following: 3 | - match: 4 | # Only merge patches for production dependencies 5 | dependency_type: production 6 | update_type: "semver:patch" 7 | - match: 8 | # Except for security fixes, here we allow minor patches 9 | dependency_type: production 10 | update_type: "security:minor" 11 | - match: 12 | # and development dependencies can have a minor update, too 13 | dependency_type: development 14 | update_type: "semver:minor" 15 | 16 | # The syntax is based on the legacy dependabot v1 automerged_updates syntax, see: 17 | # https://dependabot.com/docs/config-file/#automerged_updates 18 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React/.github/auto-merge.yml: -------------------------------------------------------------------------------- 1 | # Configure here which dependency updates should be merged automatically. 2 | # The recommended configuration is the following: 3 | - match: 4 | # Only merge patches for production dependencies 5 | dependency_type: production 6 | update_type: "semver:patch" 7 | - match: 8 | # Except for security fixes, here we allow minor patches 9 | dependency_type: production 10 | update_type: "security:minor" 11 | - match: 12 | # and development dependencies can have a minor update, too 13 | dependency_type: development 14 | update_type: "semver:minor" 15 | 16 | # The syntax is based on the legacy dependabot v1 automerged_updates syntax, see: 17 | # https://dependabot.com/docs/config-file/#automerged_updates 18 | -------------------------------------------------------------------------------- /test/baselines/adapter_JS_OfficialESLint/.github/auto-merge.yml: -------------------------------------------------------------------------------- 1 | # Configure here which dependency updates should be merged automatically. 2 | # The recommended configuration is the following: 3 | - match: 4 | # Only merge patches for production dependencies 5 | dependency_type: production 6 | update_type: "semver:patch" 7 | - match: 8 | # Except for security fixes, here we allow minor patches 9 | dependency_type: production 10 | update_type: "security:minor" 11 | - match: 12 | # and development dependencies can have a minor update, too 13 | dependency_type: development 14 | update_type: "semver:minor" 15 | 16 | # The syntax is based on the legacy dependabot v1 automerged_updates syntax, see: 17 | # https://dependabot.com/docs/config-file/#automerged_updates 18 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_OfficialESLint/.github/auto-merge.yml: -------------------------------------------------------------------------------- 1 | # Configure here which dependency updates should be merged automatically. 2 | # The recommended configuration is the following: 3 | - match: 4 | # Only merge patches for production dependencies 5 | dependency_type: production 6 | update_type: "semver:patch" 7 | - match: 8 | # Except for security fixes, here we allow minor patches 9 | dependency_type: production 10 | update_type: "security:minor" 11 | - match: 12 | # and development dependencies can have a minor update, too 13 | dependency_type: development 14 | update_type: "semver:minor" 15 | 16 | # The syntax is based on the legacy dependabot v1 automerged_updates syntax, see: 17 | # https://dependabot.com/docs/config-file/#automerged_updates 18 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_WithoutBuild/.github/auto-merge.yml: -------------------------------------------------------------------------------- 1 | # Configure here which dependency updates should be merged automatically. 2 | # The recommended configuration is the following: 3 | - match: 4 | # Only merge patches for production dependencies 5 | dependency_type: production 6 | update_type: "semver:patch" 7 | - match: 8 | # Except for security fixes, here we allow minor patches 9 | dependency_type: production 10 | update_type: "security:minor" 11 | - match: 12 | # and development dependencies can have a minor update, too 13 | dependency_type: development 14 | update_type: "semver:minor" 15 | 16 | # The syntax is based on the legacy dependabot v1 automerged_updates syntax, see: 17 | # https://dependabot.com/docs/config-file/#automerged_updates 18 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_VIS_CustomESLint/.github/auto-merge.yml: -------------------------------------------------------------------------------- 1 | # Configure here which dependency updates should be merged automatically. 2 | # The recommended configuration is the following: 3 | - match: 4 | # Only merge patches for production dependencies 5 | dependency_type: production 6 | update_type: "semver:patch" 7 | - match: 8 | # Except for security fixes, here we allow minor patches 9 | dependency_type: production 10 | update_type: "security:minor" 11 | - match: 12 | # and development dependencies can have a minor update, too 13 | dependency_type: development 14 | update_type: "semver:minor" 15 | 16 | # The syntax is based on the legacy dependabot v1 automerged_updates syntax, see: 17 | # https://dependabot.com/docs/config-file/#automerged_updates 18 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_VIS_OfficialESLint/.github/auto-merge.yml: -------------------------------------------------------------------------------- 1 | # Configure here which dependency updates should be merged automatically. 2 | # The recommended configuration is the following: 3 | - match: 4 | # Only merge patches for production dependencies 5 | dependency_type: production 6 | update_type: "semver:patch" 7 | - match: 8 | # Except for security fixes, here we allow minor patches 9 | dependency_type: production 10 | update_type: "security:minor" 11 | - match: 12 | # and development dependencies can have a minor update, too 13 | dependency_type: development 14 | update_type: "semver:minor" 15 | 16 | # The syntax is based on the legacy dependabot v1 automerged_updates syntax, see: 17 | # https://dependabot.com/docs/config-file/#automerged_updates 18 | -------------------------------------------------------------------------------- /test/baselines/ioBroker.hello-devcontainer/.github/auto-merge.yml: -------------------------------------------------------------------------------- 1 | # Configure here which dependency updates should be merged automatically. 2 | # The recommended configuration is the following: 3 | - match: 4 | # Only merge patches for production dependencies 5 | dependency_type: production 6 | update_type: "semver:patch" 7 | - match: 8 | # Except for security fixes, here we allow minor patches 9 | dependency_type: production 10 | update_type: "security:minor" 11 | - match: 12 | # and development dependencies can have a minor update, too 13 | dependency_type: development 14 | update_type: "semver:minor" 15 | 16 | # The syntax is based on the legacy dependabot v1 automerged_updates syntax, see: 17 | # https://dependabot.com/docs/config-file/#automerged_updates 18 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React_OfficialESLint/.github/auto-merge.yml: -------------------------------------------------------------------------------- 1 | # Configure here which dependency updates should be merged automatically. 2 | # The recommended configuration is the following: 3 | - match: 4 | # Only merge patches for production dependencies 5 | dependency_type: production 6 | update_type: "semver:patch" 7 | - match: 8 | # Except for security fixes, here we allow minor patches 9 | dependency_type: production 10 | update_type: "security:minor" 11 | - match: 12 | # and development dependencies can have a minor update, too 13 | dependency_type: development 14 | update_type: "semver:minor" 15 | 16 | # The syntax is based on the legacy dependabot v1 automerged_updates syntax, see: 17 | # https://dependabot.com/docs/config-file/#automerged_updates 18 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_ESLint_Tabs_DoubleQuotes_MIT/.github/auto-merge.yml: -------------------------------------------------------------------------------- 1 | # Configure here which dependency updates should be merged automatically. 2 | # The recommended configuration is the following: 3 | - match: 4 | # Only merge patches for production dependencies 5 | dependency_type: production 6 | update_type: "semver:patch" 7 | - match: 8 | # Except for security fixes, here we allow minor patches 9 | dependency_type: production 10 | update_type: "security:minor" 11 | - match: 12 | # and development dependencies can have a minor update, too 13 | dependency_type: development 14 | update_type: "semver:minor" 15 | 16 | # The syntax is based on the legacy dependabot v1 automerged_updates syntax, see: 17 | # https://dependabot.com/docs/config-file/#automerged_updates 18 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React/test/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | "env": { 4 | "es6": true, 5 | "node": true, 6 | "mocha": true 7 | }, 8 | "extends": [ 9 | "eslint:recommended" 10 | ], 11 | "rules": { 12 | "indent": [ 13 | "error", 14 | "tab", 15 | { 16 | "SwitchCase": 1 17 | } 18 | ], 19 | "no-console": "off", 20 | "no-unused-vars": [ 21 | "error", 22 | { 23 | "ignoreRestSiblings": true, 24 | "argsIgnorePattern": "^_" 25 | } 26 | ], 27 | "no-var": "error", 28 | "no-trailing-spaces": "error", 29 | "prefer-const": "error", 30 | "quotes": [ 31 | "error", 32 | "single", 33 | { 34 | "avoidEscape": true, 35 | "allowTemplateLiterals": true 36 | } 37 | ], 38 | "semi": [ 39 | "error", 40 | "always" 41 | ] 42 | } 43 | } -------------------------------------------------------------------------------- /test/baselines/adapter_TS_OfficialESLint/test/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | "env": { 4 | "es6": true, 5 | "node": true, 6 | "mocha": true 7 | }, 8 | "extends": [ 9 | "eslint:recommended" 10 | ], 11 | "rules": { 12 | "indent": [ 13 | "error", 14 | "tab", 15 | { 16 | "SwitchCase": 1 17 | } 18 | ], 19 | "no-console": "off", 20 | "no-unused-vars": [ 21 | "error", 22 | { 23 | "ignoreRestSiblings": true, 24 | "argsIgnorePattern": "^_" 25 | } 26 | ], 27 | "no-var": "error", 28 | "no-trailing-spaces": "error", 29 | "prefer-const": "error", 30 | "quotes": [ 31 | "error", 32 | "single", 33 | { 34 | "avoidEscape": true, 35 | "allowTemplateLiterals": true 36 | } 37 | ], 38 | "semi": [ 39 | "error", 40 | "always" 41 | ] 42 | } 43 | } -------------------------------------------------------------------------------- /test/baselines/adapter_TS_VIS_CustomESLint/test/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | "env": { 4 | "es6": true, 5 | "node": true, 6 | "mocha": true 7 | }, 8 | "extends": [ 9 | "eslint:recommended" 10 | ], 11 | "rules": { 12 | "indent": [ 13 | "error", 14 | "tab", 15 | { 16 | "SwitchCase": 1 17 | } 18 | ], 19 | "no-console": "off", 20 | "no-unused-vars": [ 21 | "error", 22 | { 23 | "ignoreRestSiblings": true, 24 | "argsIgnorePattern": "^_" 25 | } 26 | ], 27 | "no-var": "error", 28 | "no-trailing-spaces": "error", 29 | "prefer-const": "error", 30 | "quotes": [ 31 | "error", 32 | "double", 33 | { 34 | "avoidEscape": true, 35 | "allowTemplateLiterals": true 36 | } 37 | ], 38 | "semi": [ 39 | "error", 40 | "always" 41 | ] 42 | } 43 | } -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React/test/mocha.setup.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | // Makes ts-node ignore warnings, so mocha --watch does work 4 | process.env.TS_NODE_IGNORE_WARNINGS = 'TRUE'; 5 | // Sets the correct tsconfig for testing 6 | process.env.TS_NODE_PROJECT = 'tsconfig.json'; 7 | // Make ts-node respect the "include" key in tsconfig.json 8 | process.env.TS_NODE_FILES = 'TRUE'; 9 | 10 | // Don't silently swallow unhandled rejections 11 | process.on('unhandledRejection', (e) => { 12 | throw e; 13 | }); 14 | 15 | // enable the should interface with sinon 16 | // and load chai-as-promised and sinon-chai by default 17 | const sinonChai = require('sinon-chai'); 18 | const chaiAsPromised = require('chai-as-promised'); 19 | const { should, use } = require('chai'); 20 | 21 | should(); 22 | use(sinonChai); 23 | use(chaiAsPromised); -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React_OfficialESLint/test/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | "env": { 4 | "es6": true, 5 | "node": true, 6 | "mocha": true 7 | }, 8 | "extends": [ 9 | "eslint:recommended" 10 | ], 11 | "rules": { 12 | "indent": [ 13 | "error", 14 | "tab", 15 | { 16 | "SwitchCase": 1 17 | } 18 | ], 19 | "no-console": "off", 20 | "no-unused-vars": [ 21 | "error", 22 | { 23 | "ignoreRestSiblings": true, 24 | "argsIgnorePattern": "^_" 25 | } 26 | ], 27 | "no-var": "error", 28 | "no-trailing-spaces": "error", 29 | "prefer-const": "error", 30 | "quotes": [ 31 | "error", 32 | "single", 33 | { 34 | "avoidEscape": true, 35 | "allowTemplateLiterals": true 36 | } 37 | ], 38 | "semi": [ 39 | "error", 40 | "always" 41 | ] 42 | } 43 | } -------------------------------------------------------------------------------- /test/baselines/adapter_TS_VIS_OfficialESLint/test/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | "env": { 4 | "es6": true, 5 | "node": true, 6 | "mocha": true 7 | }, 8 | "extends": [ 9 | "eslint:recommended" 10 | ], 11 | "rules": { 12 | "indent": [ 13 | "error", 14 | "tab", 15 | { 16 | "SwitchCase": 1 17 | } 18 | ], 19 | "no-console": "off", 20 | "no-unused-vars": [ 21 | "error", 22 | { 23 | "ignoreRestSiblings": true, 24 | "argsIgnorePattern": "^_" 25 | } 26 | ], 27 | "no-var": "error", 28 | "no-trailing-spaces": "error", 29 | "prefer-const": "error", 30 | "quotes": [ 31 | "error", 32 | "double", 33 | { 34 | "avoidEscape": true, 35 | "allowTemplateLiterals": true 36 | } 37 | ], 38 | "semi": [ 39 | "error", 40 | "always" 41 | ] 42 | } 43 | } -------------------------------------------------------------------------------- /templates/admin/tsconfig.json.ts: -------------------------------------------------------------------------------- 1 | import type { TemplateFunction } from "../../src/lib/createAdapter"; 2 | import { readFile } from "../../src/lib/createAdapter"; 3 | 4 | export = (answers => { 5 | const useTypeScript = answers.language === "TypeScript"; 6 | const useTypeChecking = answers.tools && answers.tools.indexOf("type checking") > -1; 7 | const useJsonConfig = answers.adminUi === "json"; 8 | const noConfig = answers.adminUi === "none"; 9 | if ((!useTypeScript && !useTypeChecking) || useJsonConfig || noConfig) { 10 | return; 11 | } 12 | 13 | const useReact = answers.adminUi === "react" || answers.tabReact === "yes"; 14 | 15 | return readFile( 16 | useReact ? (useTypeScript ? "tsconfig_TS-React.raw.json" : "tsconfig_JS-React.raw.json") : "tsconfig.raw.json", 17 | __dirname, 18 | ); 19 | }) as TemplateFunction; 20 | -------------------------------------------------------------------------------- /docs/updates/20240105_ecmaversion_latest.md: -------------------------------------------------------------------------------- 1 | # Simplify maintenance of ESLint config by using the `"latest"` parser version 2 | 3 | Previously, ESLint required the developer to specify which ECMAScript version to use for parsing. When using newer JavaScript features, this setting had to be changed for ESLint to work. 4 | It is now possible to set the field to `"latest"`, which will make further changes unnecessary. 5 | 6 | To do this, edit the ESLint config as follows (2022 can be a diffent number currently): 7 | 8 | **If you have a file `.eslintrc.json`:** 9 | 10 | ```diff 11 | "parserOptions": { 12 | - "ecmaVersion": 2022, 13 | + "ecmaVersion": "latest", 14 | ``` 15 | 16 | **If you have a file `.eslintrc.js`:** 17 | 18 | ```diff 19 | parserOptions: { 20 | - ecmaVersion: 2022, 21 | + ecmaVersion: "latest", 22 | ``` 23 | -------------------------------------------------------------------------------- /templates/src/main.test.raw.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This is a dummy TypeScript test file using chai and mocha 3 | * 4 | * It's automatically excluded from npm and its build output is excluded from both git and npm. 5 | * It is advised to test all your modules with accompanying *.test.ts-files 6 | */ 7 | 8 | import { expect } from "chai"; 9 | // import { functionToTest } from "./moduleToTest"; 10 | 11 | describe("module to test => function to test", () => { 12 | // initializing logic 13 | const expected = 5; 14 | 15 | it(`should return ${expected}`, () => { 16 | const result = 5; 17 | // assign result a value from functionToTest 18 | expect(result).to.equal(expected); 19 | // or using the should() syntax 20 | result.should.equal(expected); 21 | }); 22 | // ... more tests => it 23 | }); 24 | // ... more test suites => describe 25 | -------------------------------------------------------------------------------- /test/baselines/adapter_JS_JsonUI_ESLint_TypeChecking_Spaces_SingleQuotes_Apache-2.0/.github/auto-merge.yml: -------------------------------------------------------------------------------- 1 | # Configure here which dependency updates should be merged automatically. 2 | # The recommended configuration is the following: 3 | - match: 4 | # Only merge patches for production dependencies 5 | dependency_type: production 6 | update_type: "semver:patch" 7 | - match: 8 | # Except for security fixes, here we allow minor patches 9 | dependency_type: production 10 | update_type: "security:minor" 11 | - match: 12 | # and development dependencies can have a minor update, too 13 | dependency_type: development 14 | update_type: "semver:minor" 15 | 16 | # The syntax is based on the legacy dependabot v1 automerged_updates syntax, see: 17 | # https://dependabot.com/docs/config-file/#automerged_updates 18 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_ESLint_Tabs_DoubleQuotes_MIT/test/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | "env": { 4 | "es6": true, 5 | "node": true, 6 | "mocha": true 7 | }, 8 | "extends": [ 9 | "eslint:recommended" 10 | ], 11 | "rules": { 12 | "indent": [ 13 | "error", 14 | "tab", 15 | { 16 | "SwitchCase": 1 17 | } 18 | ], 19 | "no-console": "off", 20 | "no-unused-vars": [ 21 | "error", 22 | { 23 | "ignoreRestSiblings": true, 24 | "argsIgnorePattern": "^_" 25 | } 26 | ], 27 | "no-var": "error", 28 | "no-trailing-spaces": "error", 29 | "prefer-const": "error", 30 | "quotes": [ 31 | "error", 32 | "double", 33 | { 34 | "avoidEscape": true, 35 | "allowTemplateLiterals": true 36 | } 37 | ], 38 | "semi": [ 39 | "error", 40 | "always" 41 | ] 42 | } 43 | } -------------------------------------------------------------------------------- /test/baselines/adapter_TS_OfficialESLint/test/mocha.setup.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | // Makes ts-node ignore warnings, so mocha --watch does work 4 | process.env.TS_NODE_IGNORE_WARNINGS = 'TRUE'; 5 | // Sets the correct tsconfig for testing 6 | process.env.TS_NODE_PROJECT = 'tsconfig.json'; 7 | // Make ts-node respect the "include" key in tsconfig.json 8 | process.env.TS_NODE_FILES = 'TRUE'; 9 | 10 | // Don't silently swallow unhandled rejections 11 | process.on('unhandledRejection', (e) => { 12 | throw e; 13 | }); 14 | 15 | // enable the should interface with sinon 16 | // and load chai-as-promised and sinon-chai by default 17 | const sinonChai = require('sinon-chai'); 18 | const chaiAsPromised = require('chai-as-promised'); 19 | const { should, use } = require('chai'); 20 | 21 | should(); 22 | use(sinonChai); 23 | use(chaiAsPromised); -------------------------------------------------------------------------------- /test/baselines/adapter_TS_VIS_CustomESLint/test/mocha.setup.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | // Makes ts-node ignore warnings, so mocha --watch does work 4 | process.env.TS_NODE_IGNORE_WARNINGS = "TRUE"; 5 | // Sets the correct tsconfig for testing 6 | process.env.TS_NODE_PROJECT = "tsconfig.json"; 7 | // Make ts-node respect the "include" key in tsconfig.json 8 | process.env.TS_NODE_FILES = "TRUE"; 9 | 10 | // Don't silently swallow unhandled rejections 11 | process.on("unhandledRejection", (e) => { 12 | throw e; 13 | }); 14 | 15 | // enable the should interface with sinon 16 | // and load chai-as-promised and sinon-chai by default 17 | const sinonChai = require("sinon-chai"); 18 | const chaiAsPromised = require("chai-as-promised"); 19 | const { should, use } = require("chai"); 20 | 21 | should(); 22 | use(sinonChai); 23 | use(chaiAsPromised); -------------------------------------------------------------------------------- /test/baselines/adapter_TS_VIS_OfficialESLint/test/mocha.setup.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | // Makes ts-node ignore warnings, so mocha --watch does work 4 | process.env.TS_NODE_IGNORE_WARNINGS = "TRUE"; 5 | // Sets the correct tsconfig for testing 6 | process.env.TS_NODE_PROJECT = "tsconfig.json"; 7 | // Make ts-node respect the "include" key in tsconfig.json 8 | process.env.TS_NODE_FILES = "TRUE"; 9 | 10 | // Don't silently swallow unhandled rejections 11 | process.on("unhandledRejection", (e) => { 12 | throw e; 13 | }); 14 | 15 | // enable the should interface with sinon 16 | // and load chai-as-promised and sinon-chai by default 17 | const sinonChai = require("sinon-chai"); 18 | const chaiAsPromised = require("chai-as-promised"); 19 | const { should, use } = require("chai"); 20 | 21 | should(); 22 | use(sinonChai); 23 | use(chaiAsPromised); -------------------------------------------------------------------------------- /templates/admin/style.raw.css: -------------------------------------------------------------------------------- 1 | /* You can delete those if you want. I just found them very helpful */ 2 | * { 3 | box-sizing: border-box 4 | } 5 | .m { 6 | /* Don't cut off dropdowns! */ 7 | overflow: initial; 8 | } 9 | .m.adapter-container, 10 | .m.adapter-container > div.App { 11 | /* Fix layout/scrolling issues with tabs */ 12 | height: 100%; 13 | width: 100%; 14 | position: relative; 15 | } 16 | .m .select-wrapper + label { 17 | /* The positioning for dropdown labels is messed up */ 18 | transform: none !important; 19 | } 20 | 21 | label > i[title] { 22 | /* Display the help cursor for the tooltip icons and fix their positioning */ 23 | cursor: help; 24 | margin-left: 0.25em; 25 | } 26 | 27 | .dropdown-content { 28 | /* Don't wrap text in dropdowns */ 29 | white-space: nowrap; 30 | } 31 | 32 | /* Add your styles here */ 33 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React_OfficialESLint/test/mocha.setup.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | // Makes ts-node ignore warnings, so mocha --watch does work 4 | process.env.TS_NODE_IGNORE_WARNINGS = 'TRUE'; 5 | // Sets the correct tsconfig for testing 6 | process.env.TS_NODE_PROJECT = 'tsconfig.json'; 7 | // Make ts-node respect the "include" key in tsconfig.json 8 | process.env.TS_NODE_FILES = 'TRUE'; 9 | 10 | // Don't silently swallow unhandled rejections 11 | process.on('unhandledRejection', (e) => { 12 | throw e; 13 | }); 14 | 15 | // enable the should interface with sinon 16 | // and load chai-as-promised and sinon-chai by default 17 | const sinonChai = require('sinon-chai'); 18 | const chaiAsPromised = require('chai-as-promised'); 19 | const { should, use } = require('chai'); 20 | 21 | should(); 22 | use(sinonChai); 23 | use(chaiAsPromised); -------------------------------------------------------------------------------- /docs/updates/20210510_adapter-react-fix.md: -------------------------------------------------------------------------------- 1 | # Fix adapter-react dependencies 2 | 3 | Up until version 1.6.14 of `@iobroker/adapter-react` one had to manually add dependencies to the package.json file. This is now obsolete. 4 | 5 | You may update your `devDependencies` in `package.json` as follows: 6 | 7 | - explicitly set `@iobroker/adapter-react` to version `1.6.15` 8 | - remove any indirect dependencies if you are not using them: 9 | - `@material-ui/icons` 10 | - `react-icons` 11 | - `@sentry/browser` 12 | 13 | Your `package.json` should now look similar to: 14 | 15 | - [this](./../../test/baselines/adapter_JS_React/package.json) for JavaScript 16 | - [this](./../../test/baselines/adapter_TS_React/package.json) for TypeScript 17 | 18 | After these modifications, call `npm install` in your adapter root directory. 19 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_ESLint_Tabs_DoubleQuotes_MIT/test/mocha.setup.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | // Makes ts-node ignore warnings, so mocha --watch does work 4 | process.env.TS_NODE_IGNORE_WARNINGS = "TRUE"; 5 | // Sets the correct tsconfig for testing 6 | process.env.TS_NODE_PROJECT = "tsconfig.json"; 7 | // Make ts-node respect the "include" key in tsconfig.json 8 | process.env.TS_NODE_FILES = "TRUE"; 9 | 10 | // Don't silently swallow unhandled rejections 11 | process.on("unhandledRejection", (e) => { 12 | throw e; 13 | }); 14 | 15 | // enable the should interface with sinon 16 | // and load chai-as-promised and sinon-chai by default 17 | const sinonChai = require("sinon-chai"); 18 | const chaiAsPromised = require("chai-as-promised"); 19 | const { should, use } = require("chai"); 20 | 21 | should(); 22 | use(sinonChai); 23 | use(chaiAsPromised); -------------------------------------------------------------------------------- /test/baselines/adapter_JS_OfficialESLint/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "eslint.enable": true, 3 | "json.schemas": [ 4 | { 5 | "fileMatch": [ 6 | "io-package.json" 7 | ], 8 | "url": "https://raw.githubusercontent.com/ioBroker/ioBroker.js-controller/master/schemas/io-package.json" 9 | }, 10 | { 11 | "fileMatch": [ 12 | "admin/jsonConfig.json", 13 | "admin/jsonConfig.json5", 14 | "admin/jsonCustom.json", 15 | "admin/jsonCustom.json5", 16 | "admin/jsonTab.json", 17 | "admin/jsonTab.json5" 18 | ], 19 | "url": "https://raw.githubusercontent.com/ioBroker/ioBroker.admin/master/packages/jsonConfig/schemas/jsonConfig.json" 20 | } 21 | ] 22 | } -------------------------------------------------------------------------------- /test/baselines/i18n_json/admin/style.css: -------------------------------------------------------------------------------- 1 | /* You can delete those if you want. I just found them very helpful */ 2 | * { 3 | box-sizing: border-box 4 | } 5 | .m { 6 | /* Don't cut off dropdowns! */ 7 | overflow: initial; 8 | } 9 | .m.adapter-container, 10 | .m.adapter-container > div.App { 11 | /* Fix layout/scrolling issues with tabs */ 12 | height: 100%; 13 | width: 100%; 14 | position: relative; 15 | } 16 | .m .select-wrapper + label { 17 | /* The positioning for dropdown labels is messed up */ 18 | transform: none !important; 19 | } 20 | 21 | label > i[title] { 22 | /* Display the help cursor for the tooltip icons and fix their positioning */ 23 | cursor: help; 24 | margin-left: 0.25em; 25 | } 26 | 27 | .dropdown-content { 28 | /* Don't wrap text in dropdowns */ 29 | white-space: nowrap; 30 | } 31 | 32 | /* Add your styles here */ 33 | -------------------------------------------------------------------------------- /test/baselines/ioBroker.hello-devcontainer/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "eslint.enable": true, 3 | "json.schemas": [ 4 | { 5 | "fileMatch": [ 6 | "io-package.json" 7 | ], 8 | "url": "https://raw.githubusercontent.com/ioBroker/ioBroker.js-controller/master/schemas/io-package.json" 9 | }, 10 | { 11 | "fileMatch": [ 12 | "admin/jsonConfig.json", 13 | "admin/jsonConfig.json5", 14 | "admin/jsonCustom.json", 15 | "admin/jsonCustom.json5", 16 | "admin/jsonTab.json", 17 | "admin/jsonTab.json5" 18 | ], 19 | "url": "https://raw.githubusercontent.com/ioBroker/ioBroker.admin/master/packages/jsonConfig/schemas/jsonConfig.json" 20 | } 21 | ] 22 | } -------------------------------------------------------------------------------- /test/baselines/TS_DoubleQuotes/src/main.test.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This is a dummy TypeScript test file using chai and mocha 3 | * 4 | * It's automatically excluded from npm and its build output is excluded from both git and npm. 5 | * It is advised to test all your modules with accompanying *.test.ts-files 6 | */ 7 | 8 | import { expect } from "chai"; 9 | // import { functionToTest } from "./moduleToTest"; 10 | 11 | describe("module to test => function to test", () => { 12 | // initializing logic 13 | const expected = 5; 14 | 15 | it(`should return ${expected}`, () => { 16 | const result = 5; 17 | // assign result a value from functionToTest 18 | expect(result).to.equal(expected); 19 | // or using the should() syntax 20 | result.should.equal(expected); 21 | }); 22 | // ... more tests => it 23 | }); 24 | // ... more test suites => describe 25 | -------------------------------------------------------------------------------- /test/baselines/TS_SingleQuotes/src/main.test.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This is a dummy TypeScript test file using chai and mocha 3 | * 4 | * It's automatically excluded from npm and its build output is excluded from both git and npm. 5 | * It is advised to test all your modules with accompanying *.test.ts-files 6 | */ 7 | 8 | import { expect } from 'chai'; 9 | // import { functionToTest } from "./moduleToTest"; 10 | 11 | describe('module to test => function to test', () => { 12 | // initializing logic 13 | const expected = 5; 14 | 15 | it(`should return ${expected}`, () => { 16 | const result = 5; 17 | // assign result a value from functionToTest 18 | expect(result).to.equal(expected); 19 | // or using the should() syntax 20 | result.should.equal(expected); 21 | }); 22 | // ... more tests => it 23 | }); 24 | // ... more test suites => describe 25 | -------------------------------------------------------------------------------- /test/baselines/adapter_JS_React/admin/style.css: -------------------------------------------------------------------------------- 1 | /* You can delete those if you want. I just found them very helpful */ 2 | * { 3 | box-sizing: border-box 4 | } 5 | .m { 6 | /* Don't cut off dropdowns! */ 7 | overflow: initial; 8 | } 9 | .m.adapter-container, 10 | .m.adapter-container > div.App { 11 | /* Fix layout/scrolling issues with tabs */ 12 | height: 100%; 13 | width: 100%; 14 | position: relative; 15 | } 16 | .m .select-wrapper + label { 17 | /* The positioning for dropdown labels is messed up */ 18 | transform: none !important; 19 | } 20 | 21 | label > i[title] { 22 | /* Display the help cursor for the tooltip icons and fix their positioning */ 23 | cursor: help; 24 | margin-left: 0.25em; 25 | } 26 | 27 | .dropdown-content { 28 | /* Don't wrap text in dropdowns */ 29 | white-space: nowrap; 30 | } 31 | 32 | /* Add your styles here */ 33 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React/admin/style.css: -------------------------------------------------------------------------------- 1 | /* You can delete those if you want. I just found them very helpful */ 2 | * { 3 | box-sizing: border-box 4 | } 5 | .m { 6 | /* Don't cut off dropdowns! */ 7 | overflow: initial; 8 | } 9 | .m.adapter-container, 10 | .m.adapter-container > div.App { 11 | /* Fix layout/scrolling issues with tabs */ 12 | height: 100%; 13 | width: 100%; 14 | position: relative; 15 | } 16 | .m .select-wrapper + label { 17 | /* The positioning for dropdown labels is messed up */ 18 | transform: none !important; 19 | } 20 | 21 | label > i[title] { 22 | /* Display the help cursor for the tooltip icons and fix their positioning */ 23 | cursor: help; 24 | margin-left: 0.25em; 25 | } 26 | 27 | .dropdown-content { 28 | /* Don't wrap text in dropdowns */ 29 | white-space: nowrap; 30 | } 31 | 32 | /* Add your styles here */ 33 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_React/src/main.test.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This is a dummy TypeScript test file using chai and mocha 3 | * 4 | * It's automatically excluded from npm and its build output is excluded from both git and npm. 5 | * It is advised to test all your modules with accompanying *.test.ts-files 6 | */ 7 | 8 | import { expect } from 'chai'; 9 | // import { functionToTest } from "./moduleToTest"; 10 | 11 | describe('module to test => function to test', () => { 12 | // initializing logic 13 | const expected = 5; 14 | 15 | it(`should return ${expected}`, () => { 16 | const result = 5; 17 | // assign result a value from functionToTest 18 | expect(result).to.equal(expected); 19 | // or using the should() syntax 20 | result.should.equal(expected); 21 | }); 22 | // ... more tests => it 23 | }); 24 | // ... more test suites => describe 25 | -------------------------------------------------------------------------------- /docs/updates/20210405_automerge_fixes.md: -------------------------------------------------------------------------------- 1 | # Update Dependabot auto-merge workflow to work with recent GitHub changes 2 | 3 | GitHub recently changed the permissions for workflow triggered by Dependabot PRs: https://github.blog/changelog/2021-02-19-github-actions-workflows-triggered-by-dependabot-prs-will-run-with-read-only-permissions/ 4 | 5 | To handle these changes, edit the workflow file `.github/workflows/dependabot-auto-merge.yml` as follows: 6 | 7 | ```diff 8 | on: 9 | - pull_request: 10 | + # WARNING: This needs to be run in the PR base, DO NOT build untrusted code in this action 11 | + # details under https://github.blog/changelog/2021-02-19-github-actions-workflows-triggered-by-dependabot-prs-will-run-with-read-only-permissions/ 12 | + pull_request_target: 13 | 14 | jobs: 15 | auto-merge: 16 | + if: github.actor == 'dependabot[bot]' 17 | ``` 18 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_WithoutBuild/src/main.test.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This is a dummy TypeScript test file using chai and mocha 3 | * 4 | * It's automatically excluded from npm and its build output is excluded from both git and npm. 5 | * It is advised to test all your modules with accompanying *.test.ts-files 6 | */ 7 | 8 | import { expect } from 'chai'; 9 | // import { functionToTest } from "./moduleToTest"; 10 | 11 | describe('module to test => function to test', () => { 12 | // initializing logic 13 | const expected = 5; 14 | 15 | it(`should return ${expected}`, () => { 16 | const result = 5; 17 | // assign result a value from functionToTest 18 | expect(result).to.equal(expected); 19 | // or using the should() syntax 20 | result.should.equal(expected); 21 | }); 22 | // ... more tests => it 23 | }); 24 | // ... more test suites => describe 25 | -------------------------------------------------------------------------------- /test/baselines/tabReact_adminHtml_JS/admin/style.css: -------------------------------------------------------------------------------- 1 | /* You can delete those if you want. I just found them very helpful */ 2 | * { 3 | box-sizing: border-box 4 | } 5 | .m { 6 | /* Don't cut off dropdowns! */ 7 | overflow: initial; 8 | } 9 | .m.adapter-container, 10 | .m.adapter-container > div.App { 11 | /* Fix layout/scrolling issues with tabs */ 12 | height: 100%; 13 | width: 100%; 14 | position: relative; 15 | } 16 | .m .select-wrapper + label { 17 | /* The positioning for dropdown labels is messed up */ 18 | transform: none !important; 19 | } 20 | 21 | label > i[title] { 22 | /* Display the help cursor for the tooltip icons and fix their positioning */ 23 | cursor: help; 24 | margin-left: 0.25em; 25 | } 26 | 27 | .dropdown-content { 28 | /* Don't wrap text in dropdowns */ 29 | white-space: nowrap; 30 | } 31 | 32 | /* Add your styles here */ 33 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_OfficialESLint/admin/style.css: -------------------------------------------------------------------------------- 1 | /* You can delete those if you want. I just found them very helpful */ 2 | * { 3 | box-sizing: border-box 4 | } 5 | .m { 6 | /* Don't cut off dropdowns! */ 7 | overflow: initial; 8 | } 9 | .m.adapter-container, 10 | .m.adapter-container > div.App { 11 | /* Fix layout/scrolling issues with tabs */ 12 | height: 100%; 13 | width: 100%; 14 | position: relative; 15 | } 16 | .m .select-wrapper + label { 17 | /* The positioning for dropdown labels is messed up */ 18 | transform: none !important; 19 | } 20 | 21 | label > i[title] { 22 | /* Display the help cursor for the tooltip icons and fix their positioning */ 23 | cursor: help; 24 | margin-left: 0.25em; 25 | } 26 | 27 | .dropdown-content { 28 | /* Don't wrap text in dropdowns */ 29 | white-space: nowrap; 30 | } 31 | 32 | /* Add your styles here */ 33 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_OfficialESLint/src/main.test.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This is a dummy TypeScript test file using chai and mocha 3 | * 4 | * It's automatically excluded from npm and its build output is excluded from both git and npm. 5 | * It is advised to test all your modules with accompanying *.test.ts-files 6 | */ 7 | 8 | import { expect } from 'chai'; 9 | // import { functionToTest } from "./moduleToTest"; 10 | 11 | describe('module to test => function to test', () => { 12 | // initializing logic 13 | const expected = 5; 14 | 15 | it(`should return ${expected}`, () => { 16 | const result = 5; 17 | // assign result a value from functionToTest 18 | expect(result).to.equal(expected); 19 | // or using the should() syntax 20 | result.should.equal(expected); 21 | }); 22 | // ... more tests => it 23 | }); 24 | // ... more test suites => describe 25 | -------------------------------------------------------------------------------- /test/baselines/adapter_TS_VIS_CustomESLint/src/main.test.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This is a dummy TypeScript test file using chai and mocha 3 | * 4 | * It's automatically excluded from npm and its build output is excluded from both git and npm. 5 | * It is advised to test all your modules with accompanying *.test.ts-files 6 | */ 7 | 8 | import { expect } from "chai"; 9 | // import { functionToTest } from "./moduleToTest"; 10 | 11 | describe("module to test => function to test", () => { 12 | // initializing logic 13 | const expected = 5; 14 | 15 | it(`should return ${expected}`, () => { 16 | const result = 5; 17 | // assign result a value from functionToTest 18 | expect(result).to.equal(expected); 19 | // or using the should() syntax 20 | result.should.equal(expected); 21 | }); 22 | // ... more tests => it 23 | }); 24 | // ... more test suites => describe 25 | --------------------------------------------------------------------------------