@tuya-miniapp/ark-extension-virtual-device 1.6.2-beta-2 → 1.6.2-beta-4
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/dist/worker/index.js +45 -28
- package/package.json +1 -1
package/dist/worker/index.js
CHANGED
|
@@ -220712,7 +220712,7 @@ var require_package2 = __commonJS({
|
|
|
220712
220712
|
"package.json"(exports, module2) {
|
|
220713
220713
|
module2.exports = {
|
|
220714
220714
|
name: "@tuya-miniapp/ark-extension-virtual-device",
|
|
220715
|
-
version: "1.6.2-beta-
|
|
220715
|
+
version: "1.6.2-beta-3",
|
|
220716
220716
|
license: "MIT",
|
|
220717
220717
|
files: [
|
|
220718
220718
|
"manifest.json",
|
|
@@ -263864,6 +263864,13 @@ var MqttClientManager = class _MqttClientManager {
|
|
|
263864
263864
|
});
|
|
263865
263865
|
});
|
|
263866
263866
|
global.__mqttClient = client;
|
|
263867
|
+
console.log("--------------mqtt client-------------------");
|
|
263868
|
+
console.log(
|
|
263869
|
+
global.__mqttClient.version,
|
|
263870
|
+
global.__mqttClient.connected,
|
|
263871
|
+
global.__mqttClient.options
|
|
263872
|
+
);
|
|
263873
|
+
console.log("--------------mqtt client-------------------");
|
|
263867
263874
|
return client;
|
|
263868
263875
|
}
|
|
263869
263876
|
// destroy() {
|
|
@@ -264074,6 +264081,7 @@ var MqttClientManager = class _MqttClientManager {
|
|
|
264074
264081
|
async function initMqttClient() {
|
|
264075
264082
|
console.log("---------------initClient");
|
|
264076
264083
|
const client = await MqttClientManager.init();
|
|
264084
|
+
console.log("---------------initClient success");
|
|
264077
264085
|
return client;
|
|
264078
264086
|
}
|
|
264079
264087
|
var initMqttClient_default = MqttClientManager;
|
|
@@ -281972,39 +281980,48 @@ var getInstalledExtList2 = () => {
|
|
|
281972
281980
|
var getDebugExt = () => {
|
|
281973
281981
|
return new Promise((resolve) => {
|
|
281974
281982
|
ark.storage.get(DEBUG_EXT_STORAGE_KEY).then((value) => {
|
|
281975
|
-
|
|
281976
|
-
|
|
281977
|
-
|
|
281983
|
+
try {
|
|
281984
|
+
let list = null;
|
|
281985
|
+
if (value) {
|
|
281986
|
+
list = JSON.parse(value);
|
|
281987
|
+
}
|
|
281988
|
+
resolve(list);
|
|
281989
|
+
} catch (error) {
|
|
281990
|
+
console.log("getDebugExt error", error);
|
|
281978
281991
|
}
|
|
281979
|
-
resolve(list);
|
|
281980
281992
|
}).catch((err) => {
|
|
281981
281993
|
resolve(null);
|
|
281982
281994
|
});
|
|
281983
281995
|
});
|
|
281984
281996
|
};
|
|
281985
281997
|
async function initPlugin() {
|
|
281986
|
-
|
|
281987
|
-
|
|
281988
|
-
|
|
281989
|
-
|
|
281990
|
-
|
|
281991
|
-
|
|
281992
|
-
|
|
281993
|
-
|
|
281994
|
-
|
|
281995
|
-
|
|
281996
|
-
|
|
281997
|
-
|
|
281998
|
-
|
|
281999
|
-
|
|
281998
|
+
try {
|
|
281999
|
+
const installedExt = await getInstalledExtList2();
|
|
282000
|
+
const plugins = [...installedExt];
|
|
282001
|
+
const debugExt = await getDebugExt();
|
|
282002
|
+
if (debugExt) {
|
|
282003
|
+
plugins.push(debugExt);
|
|
282004
|
+
}
|
|
282005
|
+
return Promise.all(
|
|
282006
|
+
plugins.map(async (item) => {
|
|
282007
|
+
try {
|
|
282008
|
+
const p2 = `${item.baseDir}/${item.worker.entry}`;
|
|
282009
|
+
if (!!item.worker.initFunc) {
|
|
282010
|
+
import(p2);
|
|
282011
|
+
} else {
|
|
282012
|
+
import(p2);
|
|
282013
|
+
}
|
|
282014
|
+
} catch (error) {
|
|
282015
|
+
console.log("\u63D2\u4EF6\u52A0\u8F7D\u5931\u8D25", item, error);
|
|
282000
282016
|
}
|
|
282001
|
-
}
|
|
282002
|
-
|
|
282003
|
-
|
|
282004
|
-
|
|
282005
|
-
|
|
282006
|
-
|
|
282007
|
-
|
|
282017
|
+
})
|
|
282018
|
+
).catch((e2) => {
|
|
282019
|
+
console.log("------promise fail", e2);
|
|
282020
|
+
return Promise.reject(e2);
|
|
282021
|
+
});
|
|
282022
|
+
} catch (error) {
|
|
282023
|
+
return Promise.reject(error);
|
|
282024
|
+
}
|
|
282008
282025
|
}
|
|
282009
282026
|
|
|
282010
282027
|
// worker/utils/debugExtension.ts
|
|
@@ -282194,7 +282211,7 @@ try {
|
|
|
282194
282211
|
console.log("---------------error", error);
|
|
282195
282212
|
}
|
|
282196
282213
|
});
|
|
282197
|
-
async
|
|
282214
|
+
const initLaunchParams = async () => {
|
|
282198
282215
|
try {
|
|
282199
282216
|
onUpdateListener && onUpdateListener();
|
|
282200
282217
|
const status = await ark.auth.checkStatus();
|
|
@@ -282231,7 +282248,7 @@ try {
|
|
|
282231
282248
|
} catch (error) {
|
|
282232
282249
|
console.log("---------update", error);
|
|
282233
282250
|
}
|
|
282234
|
-
}
|
|
282251
|
+
};
|
|
282235
282252
|
isInstanceMode7 && ark.project.setCompilationParams({ params: `deviceId=123` });
|
|
282236
282253
|
ark.auth.onAuthed(async (env) => {
|
|
282237
282254
|
try {
|