
Product
Unify Your Security Stack with Socket Basics
A single platform for static analysis, secrets detection, container scanning, and CVE checks—built on trusted open source tools, ready to run out of the box.
@iobroker/create-adapter
Advanced tools
Command line utility to quickly create a new adapter or VIS widget for ioBroker:
Any computer with Node.js in version 18 or higher and npm 9 or higher. Note that the created adapters or ioBroker itself may have different requirements.
This tool is not supposed to be installed. Instead, run the most recent version using
npx @iobroker/create-adapter@latest [options]
in the directory where the directory of your project should be created. You don't need to create the adapter/widget directory, because it will be created for you. WARNING: If the path contains a space, this won't work.
After a short while, you will be asked a few questions. Afterwards all the necessary files will be created for you.
The following CLI options are available:
--target=/path/to/dir
- Specify which directory the adapter files should be created in (instead of the current dir). Shortcut: -t
--skipAdapterExistenceCheck
- Don't check if an adapter with the same name already exists on npm
. Shortcut: -x
--replay=/path/to/file
- Re-run the adapter creator with the answers of a previous run (the given file needs to be the .create-adapter.json
in the root of the previously generated directory). Shortcut: -r
--migrate=/path/to/dir
- Run the adapter creator with the answers pre-filled from an existing adapter directory (the given path needs to point to the adapter base directory where io-package.json
is found). Shortcut: -m
All CLI options can also be provided as environment variables by prepending CREATE_ADAPTER_
. Example: CREATE_ADAPTER_TARGET=/tmp/iobroker/create-adapter/
Besides all environment variables mentioned above under "Options" the following variables change the behavior of the application:
GOOGLE_APPLICATION_CREDENTIALS
- if this is pointing to a valid JSON file, the Google API v3 will be used for translations, make sure that the credentials are allowed to use the Google Translation API. Check the documentation for more details.adapter.config
properties@iobroker/adapter-react
mocha
, chai
(with chai-as-promised
) and sinon
(with sinon-chai
) for:
First of all: DO NOT push changes to master
directly! Just don't. Every change should be done through PRs, which have a template with a checklist to fill out.
This makes sure that master
always works and every change is documented.
For developers of this package, there are a few things to know:
npm run build
creates a fresh build and deletes old build files. This is necessary when template files are renamed or deleted, as the compiled files will still be there.npm run watch
keeps compiling incremental changes whenever you save a source file./templates
contains a bunch of templates, which are basically TypeScript files exporting a single method:
string
or Promise<string>
containing the output file..ts
) is removed when creating the output file. Setting the customPath
property of the template method allows you to override the output path of the file, either a constant or depending on the user's answers (function).noReformat
to true.npm test
and/or write relevant tests. For a couple of representative combination of answers, baseline adapter directories are generated. If those baselines are changed as a result of your changes, please review if those changes are desired.Do not publish directly using npm
. Instead create a new release with the release script npm run release ...
. This creates a tag on github, performs a test run on Github Actions and after a successful build automatically publishes to npm.
You can semantically increase the version and publish it by using
npm run release [<releaseType> [<postfix>]] [-- --dry]
(preferably) or set a specific version by using
npm run release <version> [-- --dry]
The option -- --dry
(don't forget the first pair of dashes) performs a dry run without updating files.
The available release types are:
major
premajor
minor
preminor
patch
prepatch
prerelease
and the pre-...
versions allow you to append a postfix like -beta
.
2.6.5 (2024-09-13)
js-controller
and admin
to the current stable versions (#1116)main
and title
fields from io-package.json
(#1115)io-package.json
(#1114)FAQs
Command line utility to create customized ioBroker adapters
We found that @iobroker/create-adapter demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
A single platform for static analysis, secrets detection, container scanning, and CVE checks—built on trusted open source tools, ready to run out of the box.
Product
Socket is launching experimental protection for the Hugging Face ecosystem, scanning for malware and malicious payload injections inside model files to prevent silent AI supply chain attacks.
Research
/Security News
The Socket Threat Research Team uncovered a coordinated campaign that floods the Chrome Web Store with 131 rebranded clones of a WhatsApp Web automation extension to spam Brazilian users.