You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore: add eslint and prettier, automate versioning from PR titles
ESLint uses the type-aware strict ruleset, because the rules that matter for
a tool doing async I/O against a live house — floating promises, misused
promises — cannot be detected without type information.
Two rules encode existing invariants instead of taste:
- no-console is an error everywhere in src/ except cli.ts, which owns
stdout/stderr. This immediately caught three console.warn calls in
sync/manifest.ts that bypassed ctx.log entirely: they could not be
captured by tests and ignored --json. loadManifest now takes a warn
callback and every caller threads ctx.log.warn through.
- no-floating-promises is an error. node:test's describe/it are declared
safe via allowForKnownSafeCalls rather than disabling the rule in tests,
which would have hidden real cases.
Three strictTypeChecked rules are off with reasoning recorded in the config.
The significant one is no-unnecessary-condition: socket.emit<T>() returns T,
but that type is a claim about what the server should send rather than a
guarantee, so guards like `result?.rows ?? []` look redundant to the rule
and are essential at runtime. prefer-nullish-coalescing exempts strings
because ioBroker represents "unset" as an empty string, making `||` the
correct operator and `??` a silent bug.
Fixes found while clearing the remaining reports: dead imports in new.ts,
pull.ts, list.ts and cli.ts; non-null assertions replaced with narrowing;
and WebSocket RawData stringified properly — the array-of-Buffers form
produced "[object Object]" and would have failed to parse for a reason
invisible in a stack trace.
PR titles are validated as conventional commits, since the title becomes
the squash commit and drives the version bump. release-please maintains a
release PR rather than publishing automatically; npm publish stays manual.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: README.md
+43-42Lines changed: 43 additions & 42 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,7 @@ search across scripts, no editor of your choice, and no way to touch them from a
8
8
or a CI job. `iobroker-sync` maps them to a local folder and keeps the two in step.
9
9
10
10
<!-- Screenshot to add before v1.0 — see docs/images/README.md for exactly what to capture. -->
11
+
11
12

12
13
13
14
## Quick start
@@ -41,13 +42,13 @@ That is the whole loop. `git init` in that folder and your home automation has h
41
42
42
43
The five commands worth knowing on day one:
43
44
44
-
|||
45
-
| --- | --- |
46
-
|`iob-sync pull`| bring the server's scripts down |
47
-
|`iob-sync status`| what differs, locally and remotely |
48
-
|`iob-sync push`| send your edits up |
49
-
|`iob-sync logs`| watch script output — **this is how you find out a push actually worked**|
50
-
|`iob-sync backup`| snapshot everything before you touch something important |
|`init`| Write `.iobroker-sync.json`, verify the connection, create the script folder. Asks interactively when run without flags. `--types` also sets up TypeScript definitions. |
140
-
|`login` / `logout`| Save or remove the password for this instance. Never stored in the project. |
141
-
|`pull [pattern]`| Download scripts to disk. Never deletes local files. |
|`init`| Write `.iobroker-sync.json`, verify the connection, create the script folder. Asks interactively when run without flags. `--types` also sets up TypeScript definitions. |
141
+
|`login` / `logout`| Save or remove the password for this instance. Never stored in the project. |
142
+
|`pull [pattern]`| Download scripts to disk. Never deletes local files.|
143
+
|`push [pattern]`| Upload locally modified scripts. Never deletes remote objects.|
144
+
|`status`| Show what changed, locally and remotely.|
145
+
|`diff [pattern]`| Unified diff of local vs server. `--against <snapshot>` compares with a backup instead.|
146
+
|`watch`| Push on save. `--pull` also applies remote changes.|
147
+
|`logs [pattern]`| Stream the server log. `--level`, `--limit`. Read-only.|
148
+
|`backup [pattern]`| Snapshot every script — source _and_ full object — to `.iobroker-sync/backup/<timestamp>/`. Read-only against the server.|
148
149
149
150
**Lifecycle**
150
151
151
-
| Command | Description |
152
-
| --- | --- |
153
-
|`list`| All scripts with instance and enabled state. |
0 commit comments