|
14 | 14 |
|
15 | 15 | Connect to hyperion.ng server. |
16 | 16 |
|
17 | | -## Developer manual |
18 | | -This section is intended for the developer. It can be deleted later. |
19 | | - |
20 | | -### DISCLAIMER |
21 | | - |
22 | | -Please make sure that you consider copyrights and trademarks when you use names or logos of a company and add a disclaimer to your README. |
23 | | -You can check other adapters for examples or ask in the developer community. Using a name or logo of a company without permission may cause legal problems for you. |
24 | | - |
25 | | -### Getting started |
26 | | - |
27 | | -You are almost done, only a few steps left: |
28 | | -1. Create a new repository on GitHub with the name `ioBroker.hyperion-ng2` |
29 | | - |
30 | | -1. Push all files to the GitHub repo. The creator has already set up the local repository for you: |
31 | | - ```bash |
32 | | - git push origin main |
33 | | - ``` |
34 | | -1. Add a new secret under https://github.com/ticaki/ioBroker.hyperion-ng2/settings/secrets. It must be named `AUTO_MERGE_TOKEN` and contain a personal access token with push access to the repository, e.g. yours. You can create a new token under https://github.com/settings/tokens. |
35 | | - |
36 | | -1. Head over to [src/main.ts](src/main.ts) and start programming! |
37 | | - |
38 | | -### Best Practices |
39 | | -We've collected some [best practices](https://github.com/ioBroker/ioBroker.repositories#development-and-coding-best-practices) regarding ioBroker development and coding in general. If you're new to ioBroker or Node.js, you should |
40 | | -check them out. If you're already experienced, you should also take a look at them - you might learn something new :) |
41 | | - |
42 | | -### Scripts in `package.json` |
43 | | -Several npm scripts are predefined for your convenience. You can run them using `npm run <scriptname>` |
44 | | -| Script name | Description | |
45 | | -|-------------|-------------| |
46 | | -| `build` | Compile the TypeScript sources. | |
47 | | -| `watch` | Compile the TypeScript sources and watch for changes. | |
48 | | -| `test:ts` | Executes the tests you defined in `*.test.ts` files. | |
49 | | -| `test:package` | Ensures your `package.json` and `io-package.json` are valid. | |
50 | | -| `test:integration` | Tests the adapter startup with an actual instance of ioBroker. | |
51 | | -| `test` | Performs a minimal test run on package files and your tests. | |
52 | | -| `check` | Performs a type-check on your code (without compiling anything). | |
53 | | -| `lint` | Runs `ESLint` to check your code for formatting errors and potential bugs. | |
54 | | -| `translate` | Translates texts in your adapter to all required languages, see [`@iobroker/adapter-dev`](https://github.com/ioBroker/adapter-dev#manage-translations) for more details. | |
55 | | -| `release` | Creates a new release, see [`@alcalzone/release-script`](https://github.com/AlCalzone/release-script#usage) for more details. | |
56 | | - |
57 | | -### Configuring the compilation |
58 | | -The adapter template uses [esbuild](https://esbuild.github.io/) to compile TypeScript and/or React code. You can configure many compilation settings |
59 | | -either in `tsconfig.json` or by changing options for the build tasks. These options are described in detail in the |
60 | | -[`@iobroker/adapter-dev` documentation](https://github.com/ioBroker/adapter-dev#compile-adapter-files). |
61 | | - |
62 | | -### Writing tests |
63 | | -When done right, testing code is invaluable, because it gives you the |
64 | | -confidence to change your code while knowing exactly if and when |
65 | | -something breaks. A good read on the topic of test-driven development |
66 | | -is https://hackernoon.com/introduction-to-test-driven-development-tdd-61a13bc92d92. |
67 | | -Although writing tests before the code might seem strange at first, but it has very |
68 | | -clear upsides. |
69 | | - |
70 | | -The template provides you with basic tests for the adapter startup and package files. |
71 | | -It is recommended that you add your own tests into the mix. |
72 | | - |
73 | | -### Publishing the adapter |
74 | | -Using GitHub Actions, you can enable automatic releases on npm whenever you push a new git tag that matches the form |
75 | | -`v<major>.<minor>.<patch>`. We **strongly recommend** that you do. The necessary steps are described in `.github/workflows/test-and-release.yml`. |
76 | | - |
77 | | -Since you installed the release script, you can create a new |
78 | | -release simply by calling: |
79 | | -```bash |
80 | | -npm run release |
81 | | -``` |
82 | | -Additional command line options for the release script are explained in the |
83 | | -[release-script documentation](https://github.com/AlCalzone/release-script#command-line). |
84 | | - |
85 | | -To get your adapter released in ioBroker, please refer to the documentation |
86 | | -of [ioBroker.repositories](https://github.com/ioBroker/ioBroker.repositories#requirements-for-adapter-to-get-added-to-the-latest-repository). |
87 | | - |
88 | | -### Test the adapter manually with dev-server |
89 | | -Since you set up `dev-server`, you can use it to run, test and debug your adapter. |
90 | | - |
91 | | -You may start `dev-server` by calling from your dev directory: |
92 | | -```bash |
93 | | -dev-server watch |
94 | | -``` |
95 | | - |
96 | | -The ioBroker.admin interface will then be available at http://localhost:8081/ |
97 | | - |
98 | | -Please refer to the [`dev-server` documentation](https://github.com/ioBroker/dev-server#command-line) for more details. |
99 | | - |
100 | 17 | ## Changelog |
101 | 18 | <!-- |
102 | 19 | Placeholder for the next version (at the beginning of the line): |
|
0 commit comments