homebridge 2.0.0-beta.12 → 2.0.0-beta.14
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.
- package/bin/homebridge.js +22 -0
- package/dist/plugin.js +2 -2
- package/package.json +4 -4
- package/bin/homebridge +0 -19
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
//
|
|
4
|
+
// This executable sets up the environment and runs the Homebridge CLI.
|
|
5
|
+
//
|
|
6
|
+
|
|
7
|
+
import { realpathSync } from 'node:fs'
|
|
8
|
+
import { dirname, join } from 'node:path'
|
|
9
|
+
import process from 'node:process'
|
|
10
|
+
import { fileURLToPath, pathToFileURL } from 'node:url'
|
|
11
|
+
|
|
12
|
+
process.title = 'homebridge'
|
|
13
|
+
|
|
14
|
+
// Find the Homebridge lib
|
|
15
|
+
const __filename = fileURLToPath(import.meta.url)
|
|
16
|
+
const lib = join(dirname(realpathSync(__filename)), '../dist')
|
|
17
|
+
|
|
18
|
+
// Convert the path to a file URL
|
|
19
|
+
const libUrl = pathToFileURL(join(lib, 'cli.js')).href
|
|
20
|
+
|
|
21
|
+
// Run Homebridge
|
|
22
|
+
import(libUrl).then(({ default: run }) => run())
|
package/dist/plugin.js
CHANGED
|
@@ -136,13 +136,13 @@ export class Plugin {
|
|
|
136
136
|
const context = this.loadContext;
|
|
137
137
|
assert(context, 'Reached illegal state. Plugin state is undefined!');
|
|
138
138
|
this.loadContext = undefined; // free up memory
|
|
139
|
-
// pluck out the
|
|
139
|
+
// pluck out the Homebridge version requirement
|
|
140
140
|
if (!context.engines || !context.engines.homebridge) {
|
|
141
141
|
throw new Error(`Plugin ${this.pluginPath} does not contain the 'homebridge' package in 'engines'.`);
|
|
142
142
|
}
|
|
143
143
|
const versionRequired = context.engines.homebridge;
|
|
144
144
|
const nodeVersionRequired = context.engines.node;
|
|
145
|
-
// make sure the version is satisfied by the currently running version of
|
|
145
|
+
// make sure the version is satisfied by the currently running version of Homebridge
|
|
146
146
|
if (!satisfies(getVersion(), versionRequired, { includePrerelease: true })) {
|
|
147
147
|
// TODO - change this back to an error
|
|
148
148
|
log.warn(`The plugin "${this.pluginName}" requires a Homebridge version of ${versionRequired} which does \
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "homebridge",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.0-beta.
|
|
4
|
+
"version": "2.0.0-beta.14",
|
|
5
5
|
"description": "HomeKit support for the impatient",
|
|
6
6
|
"author": "Nick Farina",
|
|
7
7
|
"license": "Apache-2.0",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"Andreas Bauer <mail@anderl-bauer.de>"
|
|
20
20
|
],
|
|
21
21
|
"bin": {
|
|
22
|
-
"homebridge": "bin/homebridge"
|
|
22
|
+
"homebridge": "bin/homebridge.js"
|
|
23
23
|
},
|
|
24
24
|
"files": [
|
|
25
25
|
"LICENSE",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"build": "npm run clean && tsc",
|
|
36
36
|
"check": "npm install && npm outdated",
|
|
37
37
|
"clean": "rimraf dist && rimraf coverage",
|
|
38
|
-
"dev": "DEBUG=* ./bin/homebridge -D -P example-plugins/ || true",
|
|
38
|
+
"dev": "DEBUG=* ./bin/homebridge.js -D -P example-plugins/ || true",
|
|
39
39
|
"docs": "typedoc",
|
|
40
40
|
"lint": "eslint .",
|
|
41
41
|
"lint:fix": "npm run lint -- --fix",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"source-map-support": "0.5.21"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@antfu/eslint-config": "^
|
|
60
|
+
"@antfu/eslint-config": "^3.0.0",
|
|
61
61
|
"@types/debug": "^4.1.12",
|
|
62
62
|
"@types/fs-extra": "^11.0.4",
|
|
63
63
|
"@types/node": "^22.5.1",
|
package/bin/homebridge
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
//
|
|
4
|
-
// This executable sets up the environment and runs the HomeBridge CLI.
|
|
5
|
-
//
|
|
6
|
-
|
|
7
|
-
import { realpathSync } from 'node:fs'
|
|
8
|
-
import { dirname, join } from 'node:path'
|
|
9
|
-
import process from 'node:process'
|
|
10
|
-
import { fileURLToPath } from 'node:url'
|
|
11
|
-
|
|
12
|
-
process.title = 'homebridge'
|
|
13
|
-
|
|
14
|
-
// Find the HomeBridge lib
|
|
15
|
-
const __filename = fileURLToPath(import.meta.url)
|
|
16
|
-
const lib = join(dirname(realpathSync(__filename)), '../dist')
|
|
17
|
-
|
|
18
|
-
// Run HomeBridge
|
|
19
|
-
import(`${lib}/cli.js`).then(({ default: run }) => run())
|