-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create new structure for template 2.0
- Loading branch information
Showing
27 changed files
with
47 additions
and
1,693 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,98 +1,47 @@ | ||
 | ||
# ioBroker.template | ||
================= | ||
|
||
This adapter is a template for the creation of an ioBroker adapter. You do not need it unless you plan on developing your own adapter. | ||
|
||
It includes both code running within iobroker and as vis widget. If you only plan to create a vis widget then you should use the [iobroker.vis-template](https://github.com/ioBroker/ioBroker.vis-template) instead. | ||
|
||
## Steps | ||
1. download and unpack this packet from github ```https://github.com/ioBroker/ioBroker.template/archive/master.zip``` | ||
or clone git repository ```git clone --depth=1 https://github.com/ioBroker/ioBroker.template.git``` | ||
|
||
2. download required npm packets. Write in ioBroker.template directory: | ||
|
||
```npm install``` | ||
|
||
3. set name of this template. Call | ||
|
||
```gulp rename --name mynewname --email [email protected] --author "Author Name"``` | ||
|
||
*mynewname* must be **lower** case and with no spaces. | ||
|
||
If gulp is not available, install gulp globally: | ||
|
||
```npm install -g gulp-cli``` | ||
|
||
4. rename directory from *ioBroker.template* (can be *ioBroker.template-master*) to *iobroker.mynewname* | ||
|
||
5. to use this template you should copy it into *.../iobroker/node_modules* directory and then create an instance for it with iobroker.admin | ||
|
||
6. create your adapter: | ||
|
||
* you might want to start with main.js (code running within iobroker) and admin/index.html (the adapter settings page). | ||
|
||
* [Adapter-Development-Documentation](https://github.com/ioBroker/ioBroker/wiki/Adapter-Development-Documentation), | ||
|
||
* [Installation, setup and first steps with an ioBroker Development Environment](https://github.com/ioBroker/ioBroker/wiki/Installation,-setup-and-first-steps-with-an-ioBroker-Development-Environment) | ||
|
||
* [Write and debug vis widgets](https://github.com/ioBroker/ioBroker/wiki/How-to-debug-vis-and-to-write-own-widget-set) | ||
|
||
* files under the www folders are made available under http://<iobrokerIP>:8082/<adapter-name>/ | ||
* for this to work the iobroker.vis adapter has to be installed | ||
* delete this folder if you do not plan to export any files this way | ||
* call ```iobroker upload <adapter-name>``` after you change files in the www folder to get the new files uploaded to vis | ||
* the widget folder contains an example of a vis widget | ||
* you might want to start with *widget/<adapter-name>.html* and *widget/js/<adapter-name>.js* | ||
* call ```iobroker visdebug <adapter-name>``` to enable debugging and upload widget to "vis". (This works only from V0.7.15 of js-controller) | ||
* If you do not plan to export any widget then delete the whole widget folder and remove the ```"restartAdapters": ["vis"]``` statement from *io-package.json* | ||
* After admin/index.html is changed you must execute ```iobroker upload mynewname``` to see changes in admin console. The same is valid for any files in *admin* and *www* directory | ||
|
||
7. change version: edit package.json and then call ```grunt p``` in your adapter directory. | ||
|
||
8. share it with the community | ||
|
||
## Requirements | ||
* your github repository must have name "ioBroker.<adaptername>". **B** is capital in "ioBroker", but in the package.json the *name* must be low case, because npm does not allow upper case letters. | ||
* *title* in io-package.json (common) is simple short name of adapter in english. *titleLang* is object that consist short names in many languages. *Lang* ist not german Länge, but english LANGuages. | ||
* Do not use in the title the words "ioBroker" or "Adapter". It is clear anyway, that it is adapter for ioBroker. | ||
|
||
## Changelog | ||
|
||
### 0.7.0 (2019.01.08) | ||
* (jogibear998) compact mode and fixes | ||
|
||
### 0.6.0 (2017.01.02) | ||
* (bluefox) Support of admin3 | ||
|
||
### 0.5.0 | ||
* (vegetto) include vis widget | ||
|
||
### 0.4.0 | ||
* (bluefox) fix errors with grunt | ||
|
||
### 0.2.0 | ||
* (bluefox) initial release | ||
|
||
## License | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2018 @@Author@@ <@@email@@> | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. | ||
# <img src="icon.png" width=48> ioBroker templates | ||
|
||
This is a collection of templates for ioBroker developers. Just select the template you need, copy its contents from the sub directory and begin working on your project. | ||
|
||
<!-- TODO: Links to documentation and stuff --> | ||
|
||
## Templates | ||
Currently, the following templates are available: | ||
|
||
### Adapter and visualization | ||
|
||
#### JavaScript | ||
|
||
#### TypeScript | ||
|
||
### Adapter only | ||
|
||
#### JavaScript | ||
|
||
#### TypeScript | ||
|
||
## Visualization only | ||
|
||
#### JavaScript | ||
|
||
#### TypeScript | ||
|
||
|
||
## Features | ||
All templates come with the following features: | ||
* IntelliSense (auto completion and tooltips) in supporting editors | ||
* JavaScript only: | ||
* [ESLint](https://github.com/eslint/eslint) for code quality | ||
* Type checking based on the ioBroker declarations | ||
* TypeScript only: | ||
* [TSLint](https://github.com/palantir/tslint) for code quality | ||
* [nyc](https://github.com/istanbuljs/nyc) for code coverage | ||
* Built-in component tests using `mocha` & `chai` (with `chai-as-promised`) and `sinon` (with `sinon-chai`) for: | ||
* Correctly defined package files | ||
* and your own tests | ||
* ... [and more to come](https://github.com/ioBroker/create-adapter/blob/master/README.md#roadmap) | ||
|
||
## Anything missing? | ||
The templates are automatically generated using [`@iobroker/create-adapter`](https://github.com/ioBroker/create-adapter). If you're missing a feature or found a bug, please open an issue in that repository. Or consider using the tool directly for much more configuration goodness. | ||
|
||
## For developers | ||
Please don't edit these files directly (except this README). Instead the CI builds in the `create-adapter` repo should be updated. |
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.