Socket
Socket
Sign inDemoInstall

@iobroker/adapter-core

Package Overview
Dependencies
Maintainers
6
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@iobroker/adapter-core - npm Package Compare versions

Comparing version 3.0.5 to 3.0.6

2

build/controllerTools.js

@@ -62,3 +62,3 @@ "use strict";

const importPaths = [
// Attempt 1: JS-Controller 5.1+
// Attempt 1: JS-Controller 6+
path.join(utils.controllerDir, "build/cjs/lib", name),

@@ -65,0 +65,0 @@ // Attempt 2: JS-Controller 4.1+

@@ -37,19 +37,7 @@ "use strict";

function resolveAdapterConstructor() {
const adapterPaths = [
// Attempt 1: Resolve @iobroker/js-controller-adapter from here - JS-Controller 4.1+
(0, helpers_1.tryResolvePackage)(["@iobroker/js-controller-adapter"]),
// Attempt 2: Resolve @iobroker/js-controller-adapter in JS-Controller dir - JS-Controller 4.1+
(0, helpers_1.tryResolvePackage)(["@iobroker/js-controller-adapter"], [path.join(exports.controllerDir, "node_modules")]),
// Attempt 3: JS-Controller 4.1+ with adapter stub
path.join(exports.controllerDir, "build/lib/adapter.js"),
// Attempt 4: JS-Controller 5.1+ with adapter stub
path.join(exports.controllerDir, "build/cjs/lib/adapter.js"),
// Attempt 5: Legacy resolve - until JS-Controller 4.0
path.join(exports.controllerDir, "lib/adapter.js"),
];
for (const adapterPath of adapterPaths) {
if (!adapterPath)
continue;
// Attempt 1: Resolve @iobroker/js-controller-adapter from here - JS-Controller 4.1+
let adapterPath = (0, helpers_1.tryResolvePackage)(["@iobroker/js-controller-adapter"]);
if (adapterPath) {
try {
const Adapter = require(adapterPath);
const { Adapter } = require(adapterPath);
if (Adapter)

@@ -62,2 +50,47 @@ return Adapter;

}
// Attempt 2: Resolve @iobroker/js-controller-adapter in JS-Controller dir - JS-Controller 4.1+
adapterPath = (0, helpers_1.tryResolvePackage)(["@iobroker/js-controller-adapter"], [path.join(exports.controllerDir, "node_modules")]);
if (adapterPath) {
try {
const { Adapter } = require(adapterPath);
if (Adapter)
return Adapter;
}
catch (_b) {
// did not work, continue
}
}
// Attempt 3: JS-Controller 6+ with adapter stub
adapterPath = path.join(exports.controllerDir, "build/cjs/lib/adapter.js");
try {
// This was a default export prior to the TS migration
const Adapter = require(adapterPath);
if (Adapter)
return Adapter;
}
catch (_c) {
// did not work, continue
}
// Attempt 4: JS-Controller 4.1+ with adapter stub
adapterPath = path.join(exports.controllerDir, "build/lib/adapter.js");
try {
// This was a default export prior to the TS migration
const Adapter = require(adapterPath);
if (Adapter)
return Adapter;
}
catch (_d) {
// did not work, continue
}
// Attempt 5: Legacy resolve - until JS-Controller 4.0
adapterPath = path.join(exports.controllerDir, "lib/adapter.js");
try {
// This was a default export prior to the TS migration
const Adapter = require(adapterPath);
if (Adapter)
return Adapter;
}
catch (_e) {
// did not work, continue
}
throw new Error("Cannot resolve adapter class");

@@ -64,0 +97,0 @@ return process.exit(10);

{
"name": "@iobroker/adapter-core",
"version": "3.0.5",
"version": "3.0.6",
"description": "Core module to be used in ioBroker adapters. Acts as the bridge to js-controller.",

@@ -5,0 +5,0 @@ "engines": {

@@ -116,2 +116,6 @@ # Adapter-Core

-->
### 3.0.6 (2024-03-24)
- (foxriver76) hotfix previous release: compatibility with next controller with new esm/cjs exports
### 3.0.5 (2024-03-24)

@@ -118,0 +122,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc