smart-home-engine 1.48.2 → 1.49.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import{m as O}from"./monaco-langs-DKJI_o9J.js";import{t as I}from"./index-H1MMwTfd.js";/*!-----------------------------------------------------------------------------
1
+ import{m as O}from"./monaco-langs-DKJI_o9J.js";import{t as I}from"./index-D2S52Ody.js";/*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
3
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
4
4
  * Released under the MIT license
@@ -175,7 +175,7 @@
175
175
  }
176
176
  })();
177
177
  </script>
178
- <script type="module" crossorigin src="/assets/index-H1MMwTfd.js"></script>
178
+ <script type="module" crossorigin src="/assets/index-D2S52Ody.js"></script>
179
179
  <link rel="modulepreload" crossorigin href="/assets/monaco-langs-DKJI_o9J.js">
180
180
  <link rel="stylesheet" crossorigin href="/assets/monaco-langs-DyX1CsEw.css">
181
181
  <link rel="stylesheet" crossorigin href="/assets/index-BTq9iige.css">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "smart-home-engine",
3
- "version": "1.48.2",
3
+ "version": "1.49.0",
4
4
  "description": "Node.js based script runner for use in MQTT based Smart Home environments",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -45,7 +45,7 @@
45
45
 
46
46
  set -eu
47
47
 
48
- VERSION=13
48
+ VERSION=14
49
49
  BROKER_ENV=/etc/mqtt-interfaces/broker.env
50
50
  UNIT_DIR=/etc/systemd/system
51
51
 
@@ -84,10 +84,25 @@ need_instance() {
84
84
  valid_instance "$1" || die "invalid instance name: $1"
85
85
  }
86
86
 
87
+ # the command behind <adapter> belongs to an npm package of that name — what tells an adapter
88
+ # apart from any other daemon that happens to keep its binary in /usr/local/bin
89
+ npm_adapter_pkg() {
90
+ dir=$(adapter_dir "$1" 2>/dev/null) || return 1
91
+ [ "$(basename "$dir")" = "$1" ] && return 0
92
+ grep -Eq "\"name\"[[:space:]]*:[[:space:]]*\"(@[^\"/]*/)?$1\"" "$dir/package.json" 2>/dev/null
93
+ }
94
+
87
95
  # a plain <adapter>.service of an npm-installed adapter (pre-core layout)
88
96
  legacy_unit() {
89
97
  [ -f "$UNIT_DIR/$1.service" ] || return 1
90
- grep -Eq "(/node_modules/$1/|/usr/local/bin/$1( |$))" "$UNIT_DIR/$1.service" 2>/dev/null
98
+ # the unit naming the package directory is conclusive on its own
99
+ if grep -Eq "/node_modules/$1/" "$UNIT_DIR/$1.service" 2>/dev/null; then
100
+ return 0
101
+ fi
102
+ # ExecStart=/usr/local/bin/<name> alone is not: dnscrypt-proxy, dnsproxy and the like live
103
+ # there too. It counts only when that binary is an npm package called <adapter>.
104
+ grep -Eq "/usr/local/bin/$1( |$)" "$UNIT_DIR/$1.service" 2>/dev/null || return 1
105
+ npm_adapter_pkg "$1"
91
106
  }
92
107
  # the env file of a legacy unit: its EnvironmentFile= (leading - stripped), default /etc/default/<adapter>;
93
108
  # only /etc/default/<adapter> or something inside /etc/<adapter>/ is accepted
@@ -26,7 +26,7 @@ const { execFile, spawn } = require('child_process');
26
26
  const sshDeploy = require('./ssh-deploy');
27
27
 
28
28
  const HELPER = '/usr/local/bin/she-servicectl';
29
- const HELPER_VERSION = 13; // must match VERSION in service/she-servicectl (test/unit/helper-version.test.js)
29
+ const HELPER_VERSION = 14; // must match VERSION in service/she-servicectl (test/unit/helper-version.test.js)
30
30
  /** Default identity for services.hosts[].ssh — one key for all managed hosts (I5). */
31
31
  const DEFAULT_SERVICES_IDENTITY = '~/.she/ssh/services_id_ed25519';
32
32
  /** The helper as shipped with this she version (copied to remote hosts by the deploy route). */