@iobroker/legacy-testing 1.0.6 → 1.0.7
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/README.md +3 -0
- package/package.json +1 -1
- package/setup.js +15 -5
package/README.md
CHANGED
|
@@ -14,6 +14,9 @@ Set process.env.JS_CONTROLLER_VERSION to version e.g. `5.0.5-alpha.0-20230617-46
|
|
|
14
14
|
|
|
15
15
|
## Changelog
|
|
16
16
|
<!-- ### **WORK IN PROGRESS** -->
|
|
17
|
+
### 1.0.7 (2023-12-19)
|
|
18
|
+
* (foxriver76) allow re-initialization after config change
|
|
19
|
+
|
|
17
20
|
### 1.0.6 (2023-12-19)
|
|
18
21
|
* (foxriver76) allow to specify the `rootDir`
|
|
19
22
|
|
package/package.json
CHANGED
package/setup.js
CHANGED
|
@@ -18,8 +18,7 @@ if (adapterName[adapterName.length - 2] === 'vis-2-widgets-testing') {
|
|
|
18
18
|
}
|
|
19
19
|
adapterName = adapterName[adapterName.length - 2];
|
|
20
20
|
|
|
21
|
-
let pkg
|
|
22
|
-
pkg.main = pkg.main || 'main.js';
|
|
21
|
+
let pkg;
|
|
23
22
|
|
|
24
23
|
const adaptersStarted = {};
|
|
25
24
|
const pids = {};
|
|
@@ -28,6 +27,16 @@ let objects;
|
|
|
28
27
|
let states;
|
|
29
28
|
let systemConfig = null;
|
|
30
29
|
|
|
30
|
+
initialize();
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Initialize logic, you can re-trigger it after config has changed
|
|
34
|
+
*/
|
|
35
|
+
function initialize() {
|
|
36
|
+
pkg = require(`${rootDir}package.json`);
|
|
37
|
+
pkg.main = pkg.main || 'main.js';
|
|
38
|
+
}
|
|
39
|
+
|
|
31
40
|
function getAppName() {
|
|
32
41
|
const parts = rootDir.replace(/\\/g, '/').split('/');
|
|
33
42
|
parts.pop();
|
|
@@ -400,7 +409,7 @@ async function installJsController(preInstalledAdapters, cb) {
|
|
|
400
409
|
if (!fs.existsSync(`${rootDir}tmp/node_modules/${appName}.js-controller`)) {
|
|
401
410
|
console.log('installJsController: no js-controller => install dev build from npm');
|
|
402
411
|
|
|
403
|
-
cp.execSync(`npm install ${appName}.js-controller@${process.env.JS_CONTROLLER_VERSION || 'dev'} --prefix ./ --
|
|
412
|
+
cp.execSync(`npm install ${appName}.js-controller@${process.env.JS_CONTROLLER_VERSION || 'dev'} --prefix ./ --omit=dev`, {
|
|
404
413
|
cwd: `${rootDir}tmp/`,
|
|
405
414
|
stdio: [0, 1, 2],
|
|
406
415
|
});
|
|
@@ -473,7 +482,7 @@ function copyAdapterToController() {
|
|
|
473
482
|
stdio: [0, 1, 2],
|
|
474
483
|
});
|
|
475
484
|
copyFileSync(`${rootDir}${pkg.name}-${pkg.version}.tgz`, `${rootDir}tmp/${pkg.name}-${pkg.version}.tgz`);
|
|
476
|
-
cp.execSync(`npm install ${pkg.name}-${pkg.version}.tgz --prefix ./ --
|
|
485
|
+
cp.execSync(`npm install ${pkg.name}-${pkg.version}.tgz --prefix ./ --omit=dev`, {
|
|
477
486
|
cwd: `${rootDir}tmp`,
|
|
478
487
|
stdio: [0, 1, 2],
|
|
479
488
|
});
|
|
@@ -483,7 +492,7 @@ function copyAdapterToController() {
|
|
|
483
492
|
function installCustomAdapter(adapterName) {
|
|
484
493
|
if (!fs.existsSync(`${rootDir}tmp/node_modules/${adapterName}`)) {
|
|
485
494
|
console.log(`Install ${adapterName}`);
|
|
486
|
-
cp.execSync(`npm install ${adapterName} --prefix ./ --
|
|
495
|
+
cp.execSync(`npm install ${adapterName} --prefix ./ --omit=dev`, {
|
|
487
496
|
cwd: `${rootDir}tmp/`,
|
|
488
497
|
stdio: [0, 1, 2],
|
|
489
498
|
});
|
|
@@ -980,4 +989,5 @@ if (typeof module !== undefined && module.parent) {
|
|
|
980
989
|
module.exports.getObject = getObject;
|
|
981
990
|
module.exports.setObject = setObject;
|
|
982
991
|
module.exports.setOptions = setOptions;
|
|
992
|
+
module.exports.initialize = initialize;
|
|
983
993
|
}
|