smart-home-engine 0.24.2 → 0.24.3
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-BW2J83t5.js";import{t as I}from"./index-
|
|
1
|
+
import{m as O}from"./monaco-langs-BW2J83t5.js";import{t as I}from"./index-CH348YBf.js";/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
3
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
|
4
4
|
* Released under the MIT license
|
package/dist/web/index.html
CHANGED
|
@@ -155,7 +155,7 @@
|
|
|
155
155
|
}
|
|
156
156
|
})();
|
|
157
157
|
</script>
|
|
158
|
-
<script type="module" crossorigin src="/assets/index-
|
|
158
|
+
<script type="module" crossorigin src="/assets/index-CH348YBf.js"></script>
|
|
159
159
|
<link rel="modulepreload" crossorigin href="/assets/monaco-langs-BW2J83t5.js">
|
|
160
160
|
<link rel="stylesheet" crossorigin href="/assets/monaco-langs-DyX1CsEw.css">
|
|
161
161
|
<link rel="stylesheet" crossorigin href="/assets/index-OfBaeGiK.css">
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -1329,12 +1329,21 @@ function loadDir(dir) {
|
|
|
1329
1329
|
return;
|
|
1330
1330
|
}
|
|
1331
1331
|
|
|
1332
|
-
// .shelib marker changes -
|
|
1332
|
+
// .shelib marker changes - unload or reload scripts in the affected directory
|
|
1333
1333
|
if (basename === '.shelib') {
|
|
1334
|
+
const affectedDir = path.dirname(filePath);
|
|
1334
1335
|
if (event === 'add') {
|
|
1335
|
-
log.
|
|
1336
|
+
log.info(makeLabel(filePath), 'library marker added - unloading scripts in this directory');
|
|
1337
|
+
Object.keys(scripts).forEach((scriptFile) => {
|
|
1338
|
+
const absScript = path.resolve(scriptFile);
|
|
1339
|
+
const absDir = path.resolve(affectedDir);
|
|
1340
|
+
if (absScript.startsWith(absDir + path.sep) || path.dirname(absScript) === absDir) {
|
|
1341
|
+
unloadScript(scriptFile);
|
|
1342
|
+
}
|
|
1343
|
+
});
|
|
1336
1344
|
} else if (event === 'unlink') {
|
|
1337
|
-
log.
|
|
1345
|
+
log.info(makeLabel(filePath), 'library marker removed - loading scripts in this directory');
|
|
1346
|
+
loadDirRecursive(affectedDir, path.resolve(dir));
|
|
1338
1347
|
}
|
|
1339
1348
|
return;
|
|
1340
1349
|
}
|
package/src/web/scripts-api.js
CHANGED
|
@@ -63,7 +63,7 @@ function walk(dir, base, parentIsLib) {
|
|
|
63
63
|
* Nested tree of all files and subdirectories.
|
|
64
64
|
* Each node: { type:'file'|'dir', name, path, lib, size?, mtime?, children? }
|
|
65
65
|
*/
|
|
66
|
-
function buildTree(dir, base, parentIsLib) {
|
|
66
|
+
function buildTree(dir, base, parentIsLib, parentIsDisabled = false) {
|
|
67
67
|
let entries;
|
|
68
68
|
try {
|
|
69
69
|
entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
@@ -81,13 +81,15 @@ function buildTree(dir, base, parentIsLib) {
|
|
|
81
81
|
const abs = path.join(dir, entry.name);
|
|
82
82
|
if (entry.isDirectory()) {
|
|
83
83
|
const childIsLib = lib || hasShelibMarker(abs);
|
|
84
|
-
const
|
|
85
|
-
const
|
|
86
|
-
|
|
84
|
+
const selfDisabled = hasShedisableMarker(abs);
|
|
85
|
+
const effectiveDisabled = parentIsDisabled || selfDisabled;
|
|
86
|
+
const children = buildTree(abs, rel, childIsLib, effectiveDisabled);
|
|
87
|
+
result.push({ type: 'dir', name: entry.name, path: rel, lib: childIsLib, disabled: selfDisabled, children });
|
|
87
88
|
} else {
|
|
88
89
|
const stat = fs.statSync(abs);
|
|
89
90
|
const isJs = entry.name.endsWith('.js');
|
|
90
|
-
const
|
|
91
|
+
const selfDisabled = isJs ? hasShedisableMarker(abs) : false;
|
|
92
|
+
const disabled = parentIsDisabled || selfDisabled;
|
|
91
93
|
result.push({ type: 'file', name: entry.name, path: rel, lib, size: stat.size, mtime: stat.mtimeMs, ...(isJs ? { disabled } : {}) });
|
|
92
94
|
}
|
|
93
95
|
}
|