From d1da4342d2ba7039eb75d5bea88f41e1601d9eba Mon Sep 17 00:00:00 2001 From: msojocs Date: Mon, 28 Apr 2025 16:57:01 +0800 Subject: [PATCH 01/11] temp --- tools/fix-other.sh | 10 ++++++++++ tools/replace-skyline.sh | 21 +++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100755 tools/replace-skyline.sh diff --git a/tools/fix-other.sh b/tools/fix-other.sh index 438daa6..257807d 100755 --- a/tools/fix-other.sh +++ b/tools/fix-other.sh @@ -74,6 +74,16 @@ rm "${package_dir}/node_modules/node-float-pigment-css/float-pigment-css-for-nod cp "${srcdir}/cache/float-pigment-${float_pigment_version}.node" "${package_dir}/node_modules/node-float-pigment-css/float-pigment-css-for-nodejs.node" cp "${srcdir}/cache/float-pigment-${float_pigment_version}.node" "${package_dir}/node_modules/node-float-pigment-css/float-pigment-css-for-nwjs.node" +# Skyline解析插件修复 +float_pigment_version="v1.0.0" +# if [ ! -f "${srcdir}/cache/float-pigment-${float_pigment_version}.node" ];then +# wget -c "https://github.com/msojocs/float-pigment-rust/releases/download/${float_pigment_version}/float-pigment-${float_pigment_version}.node" -O "float-pigment-${float_pigment_version}.node.tmp" +# mv "${srcdir}/cache/float-pigment-${float_pigment_version}.node.tmp" "${srcdir}/cache/float-pigment-${float_pigment_version}.node" +# fi +# rm "${package_dir}/node_modules/node-float-pigment-css/float-pigment-css-for-nodejs.node" "${package_dir}/node_modules/node-float-pigment-css/float-pigment-css-for-nwjs.node" +# cp "${srcdir}/cache/float-pigment-${float_pigment_version}.node" "${package_dir}/node_modules/node-float-pigment-css/float-pigment-css-for-nodejs.node" +# cp "${srcdir}/cache/float-pigment-${float_pigment_version}.node" "${package_dir}/node_modules/node-float-pigment-css/float-pigment-css-for-nwjs.node" + # 阻止无限启动服务器 mv "${package_dir}/js/core/entrance.js" "${package_dir}/js/core/entrance.js.bak" cat "${srcdir}/res/scripts/entrance.js" > "${package_dir}/js/core/entrance.js" diff --git a/tools/replace-skyline.sh b/tools/replace-skyline.sh new file mode 100755 index 0000000..6358ddc --- /dev/null +++ b/tools/replace-skyline.sh @@ -0,0 +1,21 @@ +#!/bin/bash +set -ex +root_dir=$(cd `dirname $0`/.. && pwd -P) +srcdir=$root_dir +tmp_dir="$root_dir/tmp" +cache_dir="$root_dir/cache" +nwjs_dir="$root_dir/nwjs" +package_dir="$root_dir/package.nw" + +shared_memory_version="v1.0.1" +skyline_version="v1.0.1" + +cd "$package_dir/node_modules" +rm sharedMemory/sharedMemory.node +wget -c https://github.com/msojocs/skyline-shared-memory/releases/download/$shared_memory_version/skyline-sharedMemory-linux-x86_64-$shared_memory_version.node -OsharedMemory/sharedMemory.node + +cd skyline-addon +rm build/skyline.node +wget -c https://github.com/msojocs/skyline-client-server/releases/download/$skyline_version/skyline-skylineClient-linux-x86_64-$skyline_version.node -Obuild/skyline.node +rm build/icudtl.dat +rm -rf bundle \ No newline at end of file From 96b9aaf115480fe8e2dc1b76bf73e8318ead8064 Mon Sep 17 00:00:00 2001 From: msojocs Date: Tue, 29 Apr 2025 14:59:16 +0800 Subject: [PATCH 02/11] feat: document start script --- res/scripts/document_start.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 res/scripts/document_start.js diff --git a/res/scripts/document_start.js b/res/scripts/document_start.js new file mode 100644 index 0000000..6ff81c7 --- /dev/null +++ b/res/scripts/document_start.js @@ -0,0 +1,18 @@ +(() => { + if (!window.skylineRequireReplace) { + window.skylineRequireReplace = true + const originalRequire = window.require + if (originalRequire) { + window.require = function (m) { + if (m.includes('skyline.node')) { + // 给native用的 + globalThis.__sharedMemory = originalRequire('sharedMemory/sharedMemory.node') + } + return originalRequire(m) + } + window.require.cache = originalRequire.cache + window.require.extensions = originalRequire.extensions + window.require.resolve = originalRequire.resolve + } + } + })(); \ No newline at end of file From bf70eb31b64cb58d994559c076131e0ac594df45 Mon Sep 17 00:00:00 2001 From: msojocs Date: Wed, 30 Apr 2025 11:51:13 +0800 Subject: [PATCH 03/11] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9documentstart?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/fix-other.sh | 10 ---------- tools/replace-skyline.sh | 7 ++++++- tools/setup-wechat-devtools.sh | 3 +++ 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/tools/fix-other.sh b/tools/fix-other.sh index 257807d..438daa6 100755 --- a/tools/fix-other.sh +++ b/tools/fix-other.sh @@ -74,16 +74,6 @@ rm "${package_dir}/node_modules/node-float-pigment-css/float-pigment-css-for-nod cp "${srcdir}/cache/float-pigment-${float_pigment_version}.node" "${package_dir}/node_modules/node-float-pigment-css/float-pigment-css-for-nodejs.node" cp "${srcdir}/cache/float-pigment-${float_pigment_version}.node" "${package_dir}/node_modules/node-float-pigment-css/float-pigment-css-for-nwjs.node" -# Skyline解析插件修复 -float_pigment_version="v1.0.0" -# if [ ! -f "${srcdir}/cache/float-pigment-${float_pigment_version}.node" ];then -# wget -c "https://github.com/msojocs/float-pigment-rust/releases/download/${float_pigment_version}/float-pigment-${float_pigment_version}.node" -O "float-pigment-${float_pigment_version}.node.tmp" -# mv "${srcdir}/cache/float-pigment-${float_pigment_version}.node.tmp" "${srcdir}/cache/float-pigment-${float_pigment_version}.node" -# fi -# rm "${package_dir}/node_modules/node-float-pigment-css/float-pigment-css-for-nodejs.node" "${package_dir}/node_modules/node-float-pigment-css/float-pigment-css-for-nwjs.node" -# cp "${srcdir}/cache/float-pigment-${float_pigment_version}.node" "${package_dir}/node_modules/node-float-pigment-css/float-pigment-css-for-nodejs.node" -# cp "${srcdir}/cache/float-pigment-${float_pigment_version}.node" "${package_dir}/node_modules/node-float-pigment-css/float-pigment-css-for-nwjs.node" - # 阻止无限启动服务器 mv "${package_dir}/js/core/entrance.js" "${package_dir}/js/core/entrance.js.bak" cat "${srcdir}/res/scripts/entrance.js" > "${package_dir}/js/core/entrance.js" diff --git a/tools/replace-skyline.sh b/tools/replace-skyline.sh index 6358ddc..f729f98 100755 --- a/tools/replace-skyline.sh +++ b/tools/replace-skyline.sh @@ -18,4 +18,9 @@ cd skyline-addon rm build/skyline.node wget -c https://github.com/msojocs/skyline-client-server/releases/download/$skyline_version/skyline-skylineClient-linux-x86_64-$skyline_version.node -Obuild/skyline.node rm build/icudtl.dat -rm -rf bundle \ No newline at end of file +rm -rf bundle + +mv ${package_dir}/js/extensions/inject/documentstart/index.js ${package_dir}/js/extensions/inject/documentstart/index.js.bak +cp ${srcdir}/res/scripts/document_start.js ${package_dir}/js/extensions/inject/documentstart/index.js +cat ${package_dir}/js/extensions/inject/documentstart/index.js.bak >> ${package_dir}/js/extensions/inject/documentstart/index.js +rm ${package_dir}/js/extensions/inject/documentstart/index.js.bak \ No newline at end of file diff --git a/tools/setup-wechat-devtools.sh b/tools/setup-wechat-devtools.sh index 87bb667..1f864fc 100755 --- a/tools/setup-wechat-devtools.sh +++ b/tools/setup-wechat-devtools.sh @@ -162,6 +162,9 @@ if [ $CURRENT_STEP == $INSTALL_REBUILD_SUCCESS ];then notice "Patching Other" "$root_dir/tools/fix-other.sh" + + notice "Replace Skyline" + "$root_dir/tools/replace-skyline.sh" fi success "微信开发者工具安装完毕" From 18ac1019a1288047d871ec9abae7ed4df7b4cf2d Mon Sep 17 00:00:00 2001 From: msojocs Date: Wed, 30 Apr 2025 16:03:20 +0800 Subject: [PATCH 04/11] update: skyline module --- tools/replace-skyline.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/replace-skyline.sh b/tools/replace-skyline.sh index f729f98..f37972f 100755 --- a/tools/replace-skyline.sh +++ b/tools/replace-skyline.sh @@ -7,8 +7,8 @@ cache_dir="$root_dir/cache" nwjs_dir="$root_dir/nwjs" package_dir="$root_dir/package.nw" -shared_memory_version="v1.0.1" -skyline_version="v1.0.1" +shared_memory_version="v1.0.2" +skyline_version="v1.0.2" cd "$package_dir/node_modules" rm sharedMemory/sharedMemory.node From 0d16105836bce5357728bed039100e767aabbd5f Mon Sep 17 00:00:00 2001 From: msojocs Date: Thu, 1 May 2025 19:51:07 +0800 Subject: [PATCH 05/11] feat: script --- test/skyline/appservice.js | 452 +++++++++++++++++++++++++++++++++++++ 1 file changed, 452 insertions(+) create mode 100644 test/skyline/appservice.js diff --git a/test/skyline/appservice.js b/test/skyline/appservice.js new file mode 100644 index 0000000..62ab281 --- /dev/null +++ b/test/skyline/appservice.js @@ -0,0 +1,452 @@ +// setNotifyWindowReadyCallback 里面添加 +globalThis.SkylineGlobal = { + // AppBarContext: originalSkylineGlobal.AppBarContext, + // GestureHandler: originalSkylineGlobal.GestureHandler, + // NavigatorBinding: originalSkylineGlobal.NavigatorBinding, + // PageContext: originalSkylineGlobal.PageContext, + PageContext: class { + constructor(...args) { + console.info("PageContext constructor", args); + this.original = new originalSkylineGlobal.PageContext(...args); + } + get id() { + console.info("PageContext id", this.original.id); + return this.original.id; + } + get frameworkType() { + console.info("PageContext frameworkType get", this.original.frameworkType); + return this.original.frameworkType; + } + set frameworkType(v) { + console.info("PageContext frameworkType set", v); + this.original.frameworkType = v; + } + get clientHeight() { + console.info("PageContext clientHeight", this.original.clientHeight); + return this.original.clientHeight; + } + get clientWidth() { + console.info("PageContext clientWidth", this.original.clientWidth); + return this.original.clientWidth; + } + appendCompiledStyleSheets(...args) { + console.info("PageContext appendCompiledStyleSheets", args, JSON.stringify(args)); + const result = this.original.appendCompiledStyleSheets(...args); + console.info("PageContext appendCompiledStyleSheets result", result); + return result; + } + appendStyleSheet(...args) { + console.info("PageContext appendStyleSheet", args); + const result = this.original.appendStyleSheet(...args); + console.info("PageContext appendStyleSheet result", result); + return result; + } + + appendStyleSheetIndex(...args) { + console.info("PageContext appendStyleSheetIndex", args); + const result = this.original.appendStyleSheetIndex(...args); + console.info("PageContext appendStyleSheetIndex result", result); + return result; + } + + appendStyleSheets(...args) { + console.info("PageContext appendStyleSheets", args); + const result = this.original.appendStyleSheets(...args); + console.info("PageContext appendStyleSheets result", result); + return result; + } + + attach(...args) { + console.info("PageContext attach", args); + const result = this.original.attach(...args); + console.info("PageContext attach result", result); + return result; + } + + attachCustomRoute(...args) { + console.info("PageContext attachCustomRoute", args); + global.attachCustomRouteMark == undefined ? global.attachCustomRouteMark = 1 : global.attachCustomRouteMark++ + // if (global.attachCustomRouteMark > 0) { + // throw new Error("attachCustomRoute break!"); + // } + const result = this.original.attachCustomRoute(...args); + console.info("PageContext attachCustomRoute result", result); + return result; + } + + clearStylesheets(...args) { + console.info("PageContext clearStylesheets", args); + const result = this.original.clearStylesheets(...args); + console.info("PageContext clearStylesheets result", result); + return result; + } + + createElement(...args) { + if (this.createElementMark == undefined) this.createElementMark = 0 + globalThis.page = this + const result = this.original.createElement(...args); + if (this.createElementMark++ < 5) { + console.info("PageContext createElement", result); + } + const orgiFunc = result.getBoundingClientRect + // result.getBoundingClientRect = function (cb) { + // const wrapper = (info) => { + // console.info("Element getBoundingClientRect:", info); + // cb(info) + // } + // return orgiFunc.apply(this, [wrapper]); + // } + return result; + } + + createFragment(...args) { + // console.info("PageContext createFragment", args); + const result = this.original.createFragment(...args); + // console.info("PageContext createFragment result", result); + return result; + } + + createStyleSheetIndexGroup(...args) { + console.info("PageContext createStyleSheetIndexGroup", args); + const result = this.original.createStyleSheetIndexGroup(...args); + console.info("PageContext createStyleSheetIndexGroup result", result); + return result; + } + + createTextNode(...args) { + // console.info("PageContext createTextNode", args); + const result = this.original.createTextNode(...args); + // console.info("PageContext createTextNode result", result); + return result; + } + + finishStyleSheetsCompilation(...args) { + console.info("PageContext finishStyleSheetsCompilation", args); + const result = this.original.finishStyleSheetsCompilation(...args); + console.info("PageContext finishStyleSheetsCompilation result", result); + return result; + } + + getComputedStyle(...args) { + console.info("PageContext getComputedStyle", args); + const result = this.original.getComputedStyle(...args); + return result; + } + + getHostNode(...args) { + console.info("PageContext getHostNode", args); + const result = this.original.getHostNode(...args); + return result; + } + + getNodeFromPoint(...args) { + console.info("PageContext getNodeFromPoint", args); + const result = this.original.getNodeFromPoint(...args); + return result; + } + + getRootNode(...args) { + console.info("PageContext getRootNode", args); + const result = this.original.getRootNode(...args); + return result; + } + + getWindowId(...args) { + console.info("PageContext getWindowId", args); + const result = this.original.getWindowId(...args); + return result; + } + + isTab(...args) { + console.info("PageContext isTab", args); + const result = this.original.isTab(...args); + return result; + } + + loadFontFace(...args) { + console.info("PageContext loadFontFace", args); + const result = this.original.loadFontFace(...args); + return result; + } + + preCompileStyleSheets(...args) { + console.info("PageContext preCompileStyleSheets", args); + const result = this.original.preCompileStyleSheets(...args); + return result; + } + + recalcStyle(...args) { + console.info("PageContext recalcStyle", args); + const result = this.original.recalcStyle(...args); + return result; + } + + release(...args) { + console.info("PageContext release", args); + const result = this.original.release(...args); + return result; + } + + setAsTab(...args) { + console.info("PageContext setAsTab", args); + const result = this.original.setAsTab(...args); + return result; + } + + setNavigateBackInterception(...args) { + console.info("PageContext setNavigateBackInterception", args); + const result = this.original.setNavigateBackInterception(...args); + return result; + } + + startRender(...args) { + console.info("PageContext startRender", args); + global.startRenderMark == undefined ? global.startRenderMark = 1 : global.startRenderMark++ + if (global.startRenderMark > 1) { + // throw new Error("startRender break!"); + } + const result = this.original.startRender(() => { + console.info("PageContext startRender callback"); + args[0](); + console.info("PageContext startRender callback end"); + }); + console.info("PageContext startRender end"); + return result; + } + + updateRouteConfig(...args) { + console.info("PageContext updateRouteConfig", args); + const result = this.original.updateRouteConfig(...args); + console.info("PageContext updateRouteConfig result", result); + return result; + } + + }, + // RuntimeBinding: originalSkylineGlobal.RuntimeBinding, + // TabBarContext: originalSkylineGlobal.TabBarContext, + // WorkletBinding: originalSkylineGlobal.WorkletBinding, + features: { + eventDefaultPrevented: 1, + contextOperation: 1 + }, + gestureHandlerModule: originalSkylineGlobal.gestureHandlerModule, + // navigator: originalSkylineGlobal.navigator, + // requestGarbageCollectionForTesting: originalSkylineGlobal.requestGarbageCollectionForTesting, + runtime: { + "registerTouchCallback": (func) => { + // console.info("registerTouchCallback called with args:", func); + const result = originalSkylineGlobal.runtime.registerTouchCallback((...args) => { + // console.info('emit registerTouchCallback', args) + func(...args) + }); + // console.info("registerTouchCallback result:", result); + return result; + }, + "registerMouseCallback": (func) => { + // console.info("registerMouseCallback called with args:", func); + const result = originalSkylineGlobal.runtime.registerMouseCallback((...args) => { + // console.info('emit registerMouseCallback', args) + func(...args) + }); + // console.info("registerMouseCallback result:", result); + return result; + }, + "registerTransitionCallback": (func) => { + console.info("registerTransitionCallback called with args:", func); + const result = originalSkylineGlobal.runtime.registerTransitionCallback((...args) => { + console.info('emit registerTransitionCallback', args) + func(...args) + }); + console.info("registerTransitionCallback result:", result); + return result; + }, + "registerAnimationCallback": (func) => { + console.info("registerAnimationCallback called with args:", func); + const result = originalSkylineGlobal.runtime.registerAnimationCallback((...args) => { + console.info('emit registerAnimationCallback', args) + func(...args) + }); + console.info("registerAnimationCallback result:", result); + return result; + }, + "registerTriggerEventCallback": (func) => { + // console.info("registerTriggerEventCallback called with args:", func); + const result = originalSkylineGlobal.runtime.registerTriggerEventCallback((...args) => { + // console.info('emit registerTriggerEventCallback', args) + func(...args) + }); + // console.info("registerTriggerEventCallback result:", result); + return result; + }, + "registerPerformanceCallback": (...args) => { + console.info("registerPerformanceCallback called with args:", args); + const result = originalSkylineGlobal.runtime.registerPerformanceCallback(...args); + console.info("registerPerformanceCallback result:", result); + return result; + }, + "registerNavigateBackInterceptCallback": (...args) => { + console.info("registerNavigateBackInterceptCallback called with args:", args); + const result = originalSkylineGlobal.runtime.registerNavigateBackInterceptCallback(...args); + console.info("registerNavigateBackInterceptCallback result:", result); + return result; + }, + "registerJsValue": (...args) => { + // console.info("registerJsValue called with args:", args); + if (typeof args[0] === 'function') { + const workletReplace = { + 575660067119: "function _f(){const{beginRect,endRect}=jsThis._closure;{globalThis['RouteCardSrcRect']=beginRect;globalThis['RouteCardDestRect']=endRect;console.info('RouteCardSrcRect:', globalThis['RouteCardSrcRect']);console.info('RouteCardDestRect:', globalThis['RouteCardDestRect']);}}" + } + if (workletReplace[args[0].__workletHash]) { + args[0].asString = workletReplace[args[0].__workletHash] + } + } + const result = originalSkylineGlobal.runtime.registerJsValue(...args); + // console.info("registerJsValue result:", result); + return result; + }, + "unRegisterJsValue": (...args) => { + // console.info("unRegisterJsValue called with args:", args); + const result = originalSkylineGlobal.runtime.unRegisterJsValue(...args); + // console.info("unRegisterJsValue result:", result); + return result; + }, + "getJsValueById": (...args) => { + global.getJsValueByIdMark == undefined ? global.getJsValueByIdMark = 1 : global.getJsValueByIdMark++ + if (args[0] == 5) { + // debugger + } + // console.info("getJsValueById called with args:", args); + let result = originalSkylineGlobal.runtime.getJsValueById(...args); + + // console.info("getJsValueById result:", result, typeof result); + // if (typeof result === 'function') { + // return (...args) => { + // // console.info("getJsValueById result wrapper called with args:", args); + // return result(...args); + // } + // } + return result; + }, + "registerFontFaceCallback": (...args) => { + console.info("registerFontFaceCallback called with args:", args); + const result = originalSkylineGlobal.runtime.registerFontFaceCallback(...args); + console.info("registerFontFaceCallback result:", result); + return result; + }, + "setFeatureFlags": (...args) => { + console.info("setFeatureFlags called with args:", args); + const result = originalSkylineGlobal.runtime.setFeatureFlags(...args); + console.info("setFeatureFlags result:", result); + return result; + }, + "updateMapCustomCallout": (...args) => { + console.info("updateMapCustomCallout called with args:", args); + const result = originalSkylineGlobal.runtime.updateMapCustomCallout(...args); + console.info("updateMapCustomCallout result:", result); + return result; + }, + "preloadAssets": (...args) => { + console.info("preloadAssets called with args:", args); + const result = originalSkylineGlobal.runtime.preloadAssets(...args); + console.info("preloadAssets result:", result); + return result; + }, + }, + userAgent: "skyline/1.4.0 (;8f190450e6301587ce41e08afcaa983db4dc712e;)", + workletModule: { + installCoreFunctions: (func1) => { + const func = function (...args) { + console.info('-----> SkylineWorkletModule - installCoreFunctions', args) + } + func._closure = { + requestFrame: (...args1) => { + console.info("[coreFunctions] requestFrame called with args:", args1); + } + } + func.asString = func1.asString + func.__workletHash = func1.__workletHash + func.__location = func1.__location + func.__worklet = func1.__worklet + console.info("installCoreFunctions called with args:", func); + const result = originalSkylineGlobal.workletModule.installCoreFunctions(func); + console.info("installCoreFunctions result:", result); + return undefined; + }, + makeShareable: (func1) => { + // console.info("makeShareable called with args:", [func1]); + const result = originalSkylineGlobal.workletModule.makeShareable(func1); + return result; + }, + makeMutable: (...args) => { + // console.info("makeMutable called with args:", args); + const result = originalSkylineGlobal.workletModule.makeMutable(...args); + if (!globalThis.mutableList) globalThis.mutableList = [] + globalThis.mutableList.push(result) + // console.info("makeMutable result:", result, result._windowId, result._value, result.value); + // delete result._windowId + // delete result._value + // delete result.value + // delete result._animation + const orgi = result.__proto__.installGetter + // result.installGetter = function (...args) { + // console.info("installGetter called with args:", result, args); + // const ret = orgi.apply(this, args); + // console.info("installGetter result:", ret); + // return ret; + // } + globalThis.makeMutableMark == undefined ? globalThis.makeMutableMark = 1 : globalThis.makeMutableMark++ + const currentMakr = globalThis.makeMutableMark; + // result.installGetter = function (...args) { + // console.info(`[${currentMakr}]installGetter called with args:`, result, args); + // console.info(`[${currentMakr}]before value:`, result.value) + // const ret = orgi.apply(this, args); + // console.info(`[${currentMakr}]after value:`, result.value) + // console.info(`[${currentMakr}]installGetter result:`, ret); + // return ret; + // } + // console.info("makeMutable __hiddenHostObjectProp:", result.__hiddenHostObjectProp); + // Object.defineProperty(result, "_value", { + // set: function (v) { + // console.info("makeMutable _value set:", v); + // result.value = v; + // } + // }) + return result + + + }, + makeRemote: (...args) => { + global.makeRemoteMark == undefined ? global.makeRemoteMark = 1 : global.makeRemoteMark++ + console.info("makeRemote called with args:", args, global.makeRemoteMark); + + // const result = originalSkylineGlobal.workletModule.makeRemote(...args); + // console.info("makeRemote result:", result); + return {}; + }, + registerEventHandler: (...args) => { + // console.info('registerEventHandler:', args) + const result = originalSkylineGlobal.workletModule.registerEventHandler(...args); + return result; + }, + unregisterEventHandler: (...args) => { + const result = originalSkylineGlobal.workletModule.unregisterEventHandler(...args); + return result; + }, + startMapper: (...args) => { + // console.info('SkylineWorkletModule - startMapper', args) + if (args[1].__location === "src/worklet/hook/animatedStyle.ts (66:23)") { + args[1].asString = "function _f(_,nodes){const{updater}=jsThis._closure;{var _updater;function convertToCssText(obj){let cssText='';Object.keys(obj).forEach(function(key){const hyphenatedKey=key.replace(/([A-Z])/g,'-$1').toLowerCase();cssText+=hyphenatedKey+': '+obj[key]+'; ';});return cssText;}const updates=(_updater=updater())!==null&&_updater!==void 0?_updater:{};const inlineStyle=convertToCssText(updates);console.info('nodes:', nodes);if(!Array.isArray(nodes)){console.warn('applyAnimatedStyle can not find corresponding nodes');return;}nodes.forEach(function(node){return workletUIModule.updateNodeStyle(node,inlineStyle);});}}" + } + const result = originalSkylineGlobal.workletModule.startMapper(...args) + // console.info('SkylineWorkletModule - startMapper result', result); + return result; + }, + stopMappers: (...args) => { + // console.info('SkylineWorkletModule - stopMappers', args) + const result = originalSkylineGlobal.workletModule.stopMappers(...args); + return result; + }, + + + }, + } \ No newline at end of file From c388a0f7040a40ad0c98326c8ef7c156fce375f2 Mon Sep 17 00:00:00 2001 From: msojocs Date: Sun, 11 May 2025 15:25:41 +0800 Subject: [PATCH 06/11] perf: use continuous --- tools/replace-skyline.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/replace-skyline.sh b/tools/replace-skyline.sh index f37972f..1bf0d33 100755 --- a/tools/replace-skyline.sh +++ b/tools/replace-skyline.sh @@ -8,7 +8,7 @@ nwjs_dir="$root_dir/nwjs" package_dir="$root_dir/package.nw" shared_memory_version="v1.0.2" -skyline_version="v1.0.2" +skyline_version="continuous" cd "$package_dir/node_modules" rm sharedMemory/sharedMemory.node From 82c62bae6c17fdbee52e08ae7e8b5804f0152115 Mon Sep 17 00:00:00 2001 From: msojocs Date: Wed, 9 Jul 2025 19:22:23 +0800 Subject: [PATCH 07/11] =?UTF-8?q?perf:=20=E6=A0=BC=E5=BC=8F=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/settings.json | 3 ++- res/scripts/document_start.js | 30 ++++++++++++++++-------------- res/scripts/entrance.js | 18 +++++++++--------- 3 files changed, 27 insertions(+), 24 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index f8cf3bb..aa4e239 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,5 +6,6 @@ "**/.hg/store/**": true, ".flatpak/**": true, "_build/**": true - } + }, + "prettier.tabWidth": 4 } \ No newline at end of file diff --git a/res/scripts/document_start.js b/res/scripts/document_start.js index 6ff81c7..d072220 100644 --- a/res/scripts/document_start.js +++ b/res/scripts/document_start.js @@ -1,18 +1,20 @@ (() => { if (!window.skylineRequireReplace) { - window.skylineRequireReplace = true - const originalRequire = window.require - if (originalRequire) { - window.require = function (m) { - if (m.includes('skyline.node')) { - // 给native用的 - globalThis.__sharedMemory = originalRequire('sharedMemory/sharedMemory.node') - } - return originalRequire(m) + window.skylineRequireReplace = true; + const originalRequire = window.require; + if (originalRequire) { + window.require = function (m) { + if (m.includes("skyline.node")) { + // 给native用的 + globalThis.__sharedMemory = originalRequire( + "sharedMemory/sharedMemory.node" + ); + } + return originalRequire(m); + }; + window.require.cache = originalRequire.cache; + window.require.extensions = originalRequire.extensions; + window.require.resolve = originalRequire.resolve; } - window.require.cache = originalRequire.cache - window.require.extensions = originalRequire.extensions - window.require.resolve = originalRequire.resolve - } } - })(); \ No newline at end of file +})(); diff --git a/res/scripts/entrance.js b/res/scripts/entrance.js index 566f16c..e28d5da 100644 --- a/res/scripts/entrance.js +++ b/res/scripts/entrance.js @@ -1,11 +1,11 @@ (() => { - const http = require('http') - const originaleListen = http.Server.prototype.listen - http.Server.prototype.listen = function(...args) { - if (args[0] == 33233) { - console.warn('block port of http server:', args[0]) - return + const http = require("http"); + const originaleListen = http.Server.prototype.listen; + http.Server.prototype.listen = function (port) { + if (port == 33233) { + console.warn("block port of http server:", port); + return; } - return originaleListen.apply(this, args) - } -})(); \ No newline at end of file + return originaleListen.apply(this, [port]); + }; +})(); From 678abafa5856c385bea0fe4f0632ab6d99254344 Mon Sep 17 00:00:00 2001 From: msojocs Date: Mon, 3 Nov 2025 18:21:00 +0800 Subject: [PATCH 08/11] update: skyline version --- CHANGELOG.MD | 2 + test/fix-core.sh | 16 -- test/skyline/appservice.js | 452 -------------------------------- tools/replace-skyline.sh | 2 +- tools/update-wechat-devtools.js | 6 +- 5 files changed, 6 insertions(+), 472 deletions(-) delete mode 100755 test/fix-core.sh delete mode 100644 test/skyline/appservice.js diff --git a/CHANGELOG.MD b/CHANGELOG.MD index 2bb8768..979a1b9 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -111,6 +111,8 @@ # 1.06.2306020-1 / 2023-06-04 - update: devtools to v1.06.2306020 +- update: nwjs 0.55.0 用以修复切换主题时标题栏重新出现的问题 +- fix: 处理vscode-ripgrep安装失败 # 1.06.2301040-1 / 2023-01-21 diff --git a/test/fix-core.sh b/test/fix-core.sh deleted file mode 100755 index 4b29f9c..0000000 --- a/test/fix-core.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -root_dir=$(cd `dirname $0`/.. && pwd -P) - -package_dir="$root_dir/package.nw" -tmp_dir="$root_dir/package.nw" -mkdir -p $tmp_dir -unpack_script="$root_dir/tools/wxvpkg_unpack.js" -pack_script="$root_dir/tools/wxvpkg_pack.js" - -find_result=$( grep -lr "OSThemeController=" "$tmp_dir/core.wxvpkg.ext" ) -echo "theme: $find_result" -sed -i 's/"use strict";O/"use strict";const {execSync,spawn}=require("child_process");O/' $find_result -sed -i 's/this.registerListeners()/this.monitorTheme()/' $find_result -sed -i 's/}registerListeners/}monitorTheme(){let monitor=null;const{DESKTOP_SESSION}=process.env;switch(DESKTOP_SESSION){case"deepin":monitor=spawn("gsettings",["monitor","com.deepin.dde.appearance","gtk-theme",]);break;case"gnome":case"gnome-classic":monitor=spawn("gsettings",["monitor","org.gnome.desktop.interface","gtk-theme",]);break;default:console.warn(`NOT SUPPORTED!!!DESKTOP_SESSION:${DESKTOP_SESSION}`);break}monitor\&\&monitor.on("error",(err)=>{console.error("monitorTheme",err)});monitor\&\&monitor.stdout.on("data",e.debounce((chunk)=>{const data=chunk.toString();const t=data.includes("dark");console.warn(data);console.warn("dark",t);(this._theme=t?i.Dark:i.Light),this._onDidThemeChange.fire(this._theme)},400))}registerListeners/' $find_result -sed -i 's/mediaQuery.matches/isDark/' $find_result -sed -i 's/}getDefaultTheme/}get isDark(){const{DESKTOP_SESSION}=process.env;console.log(DESKTOP_SESSION);let theme="";switch(DESKTOP_SESSION){case"deepin":theme=execSync(`gsettings get com.deepin.dde.appearance gtk-theme`);break;case"gnome":case"gnome-classic":theme=execSync(`gsettings get org.gnome.desktop.interface gtk-theme`);break;default:break}return theme.includes("dark")}getDefaultTheme/' $find_result \ No newline at end of file diff --git a/test/skyline/appservice.js b/test/skyline/appservice.js deleted file mode 100644 index 62ab281..0000000 --- a/test/skyline/appservice.js +++ /dev/null @@ -1,452 +0,0 @@ -// setNotifyWindowReadyCallback 里面添加 -globalThis.SkylineGlobal = { - // AppBarContext: originalSkylineGlobal.AppBarContext, - // GestureHandler: originalSkylineGlobal.GestureHandler, - // NavigatorBinding: originalSkylineGlobal.NavigatorBinding, - // PageContext: originalSkylineGlobal.PageContext, - PageContext: class { - constructor(...args) { - console.info("PageContext constructor", args); - this.original = new originalSkylineGlobal.PageContext(...args); - } - get id() { - console.info("PageContext id", this.original.id); - return this.original.id; - } - get frameworkType() { - console.info("PageContext frameworkType get", this.original.frameworkType); - return this.original.frameworkType; - } - set frameworkType(v) { - console.info("PageContext frameworkType set", v); - this.original.frameworkType = v; - } - get clientHeight() { - console.info("PageContext clientHeight", this.original.clientHeight); - return this.original.clientHeight; - } - get clientWidth() { - console.info("PageContext clientWidth", this.original.clientWidth); - return this.original.clientWidth; - } - appendCompiledStyleSheets(...args) { - console.info("PageContext appendCompiledStyleSheets", args, JSON.stringify(args)); - const result = this.original.appendCompiledStyleSheets(...args); - console.info("PageContext appendCompiledStyleSheets result", result); - return result; - } - appendStyleSheet(...args) { - console.info("PageContext appendStyleSheet", args); - const result = this.original.appendStyleSheet(...args); - console.info("PageContext appendStyleSheet result", result); - return result; - } - - appendStyleSheetIndex(...args) { - console.info("PageContext appendStyleSheetIndex", args); - const result = this.original.appendStyleSheetIndex(...args); - console.info("PageContext appendStyleSheetIndex result", result); - return result; - } - - appendStyleSheets(...args) { - console.info("PageContext appendStyleSheets", args); - const result = this.original.appendStyleSheets(...args); - console.info("PageContext appendStyleSheets result", result); - return result; - } - - attach(...args) { - console.info("PageContext attach", args); - const result = this.original.attach(...args); - console.info("PageContext attach result", result); - return result; - } - - attachCustomRoute(...args) { - console.info("PageContext attachCustomRoute", args); - global.attachCustomRouteMark == undefined ? global.attachCustomRouteMark = 1 : global.attachCustomRouteMark++ - // if (global.attachCustomRouteMark > 0) { - // throw new Error("attachCustomRoute break!"); - // } - const result = this.original.attachCustomRoute(...args); - console.info("PageContext attachCustomRoute result", result); - return result; - } - - clearStylesheets(...args) { - console.info("PageContext clearStylesheets", args); - const result = this.original.clearStylesheets(...args); - console.info("PageContext clearStylesheets result", result); - return result; - } - - createElement(...args) { - if (this.createElementMark == undefined) this.createElementMark = 0 - globalThis.page = this - const result = this.original.createElement(...args); - if (this.createElementMark++ < 5) { - console.info("PageContext createElement", result); - } - const orgiFunc = result.getBoundingClientRect - // result.getBoundingClientRect = function (cb) { - // const wrapper = (info) => { - // console.info("Element getBoundingClientRect:", info); - // cb(info) - // } - // return orgiFunc.apply(this, [wrapper]); - // } - return result; - } - - createFragment(...args) { - // console.info("PageContext createFragment", args); - const result = this.original.createFragment(...args); - // console.info("PageContext createFragment result", result); - return result; - } - - createStyleSheetIndexGroup(...args) { - console.info("PageContext createStyleSheetIndexGroup", args); - const result = this.original.createStyleSheetIndexGroup(...args); - console.info("PageContext createStyleSheetIndexGroup result", result); - return result; - } - - createTextNode(...args) { - // console.info("PageContext createTextNode", args); - const result = this.original.createTextNode(...args); - // console.info("PageContext createTextNode result", result); - return result; - } - - finishStyleSheetsCompilation(...args) { - console.info("PageContext finishStyleSheetsCompilation", args); - const result = this.original.finishStyleSheetsCompilation(...args); - console.info("PageContext finishStyleSheetsCompilation result", result); - return result; - } - - getComputedStyle(...args) { - console.info("PageContext getComputedStyle", args); - const result = this.original.getComputedStyle(...args); - return result; - } - - getHostNode(...args) { - console.info("PageContext getHostNode", args); - const result = this.original.getHostNode(...args); - return result; - } - - getNodeFromPoint(...args) { - console.info("PageContext getNodeFromPoint", args); - const result = this.original.getNodeFromPoint(...args); - return result; - } - - getRootNode(...args) { - console.info("PageContext getRootNode", args); - const result = this.original.getRootNode(...args); - return result; - } - - getWindowId(...args) { - console.info("PageContext getWindowId", args); - const result = this.original.getWindowId(...args); - return result; - } - - isTab(...args) { - console.info("PageContext isTab", args); - const result = this.original.isTab(...args); - return result; - } - - loadFontFace(...args) { - console.info("PageContext loadFontFace", args); - const result = this.original.loadFontFace(...args); - return result; - } - - preCompileStyleSheets(...args) { - console.info("PageContext preCompileStyleSheets", args); - const result = this.original.preCompileStyleSheets(...args); - return result; - } - - recalcStyle(...args) { - console.info("PageContext recalcStyle", args); - const result = this.original.recalcStyle(...args); - return result; - } - - release(...args) { - console.info("PageContext release", args); - const result = this.original.release(...args); - return result; - } - - setAsTab(...args) { - console.info("PageContext setAsTab", args); - const result = this.original.setAsTab(...args); - return result; - } - - setNavigateBackInterception(...args) { - console.info("PageContext setNavigateBackInterception", args); - const result = this.original.setNavigateBackInterception(...args); - return result; - } - - startRender(...args) { - console.info("PageContext startRender", args); - global.startRenderMark == undefined ? global.startRenderMark = 1 : global.startRenderMark++ - if (global.startRenderMark > 1) { - // throw new Error("startRender break!"); - } - const result = this.original.startRender(() => { - console.info("PageContext startRender callback"); - args[0](); - console.info("PageContext startRender callback end"); - }); - console.info("PageContext startRender end"); - return result; - } - - updateRouteConfig(...args) { - console.info("PageContext updateRouteConfig", args); - const result = this.original.updateRouteConfig(...args); - console.info("PageContext updateRouteConfig result", result); - return result; - } - - }, - // RuntimeBinding: originalSkylineGlobal.RuntimeBinding, - // TabBarContext: originalSkylineGlobal.TabBarContext, - // WorkletBinding: originalSkylineGlobal.WorkletBinding, - features: { - eventDefaultPrevented: 1, - contextOperation: 1 - }, - gestureHandlerModule: originalSkylineGlobal.gestureHandlerModule, - // navigator: originalSkylineGlobal.navigator, - // requestGarbageCollectionForTesting: originalSkylineGlobal.requestGarbageCollectionForTesting, - runtime: { - "registerTouchCallback": (func) => { - // console.info("registerTouchCallback called with args:", func); - const result = originalSkylineGlobal.runtime.registerTouchCallback((...args) => { - // console.info('emit registerTouchCallback', args) - func(...args) - }); - // console.info("registerTouchCallback result:", result); - return result; - }, - "registerMouseCallback": (func) => { - // console.info("registerMouseCallback called with args:", func); - const result = originalSkylineGlobal.runtime.registerMouseCallback((...args) => { - // console.info('emit registerMouseCallback', args) - func(...args) - }); - // console.info("registerMouseCallback result:", result); - return result; - }, - "registerTransitionCallback": (func) => { - console.info("registerTransitionCallback called with args:", func); - const result = originalSkylineGlobal.runtime.registerTransitionCallback((...args) => { - console.info('emit registerTransitionCallback', args) - func(...args) - }); - console.info("registerTransitionCallback result:", result); - return result; - }, - "registerAnimationCallback": (func) => { - console.info("registerAnimationCallback called with args:", func); - const result = originalSkylineGlobal.runtime.registerAnimationCallback((...args) => { - console.info('emit registerAnimationCallback', args) - func(...args) - }); - console.info("registerAnimationCallback result:", result); - return result; - }, - "registerTriggerEventCallback": (func) => { - // console.info("registerTriggerEventCallback called with args:", func); - const result = originalSkylineGlobal.runtime.registerTriggerEventCallback((...args) => { - // console.info('emit registerTriggerEventCallback', args) - func(...args) - }); - // console.info("registerTriggerEventCallback result:", result); - return result; - }, - "registerPerformanceCallback": (...args) => { - console.info("registerPerformanceCallback called with args:", args); - const result = originalSkylineGlobal.runtime.registerPerformanceCallback(...args); - console.info("registerPerformanceCallback result:", result); - return result; - }, - "registerNavigateBackInterceptCallback": (...args) => { - console.info("registerNavigateBackInterceptCallback called with args:", args); - const result = originalSkylineGlobal.runtime.registerNavigateBackInterceptCallback(...args); - console.info("registerNavigateBackInterceptCallback result:", result); - return result; - }, - "registerJsValue": (...args) => { - // console.info("registerJsValue called with args:", args); - if (typeof args[0] === 'function') { - const workletReplace = { - 575660067119: "function _f(){const{beginRect,endRect}=jsThis._closure;{globalThis['RouteCardSrcRect']=beginRect;globalThis['RouteCardDestRect']=endRect;console.info('RouteCardSrcRect:', globalThis['RouteCardSrcRect']);console.info('RouteCardDestRect:', globalThis['RouteCardDestRect']);}}" - } - if (workletReplace[args[0].__workletHash]) { - args[0].asString = workletReplace[args[0].__workletHash] - } - } - const result = originalSkylineGlobal.runtime.registerJsValue(...args); - // console.info("registerJsValue result:", result); - return result; - }, - "unRegisterJsValue": (...args) => { - // console.info("unRegisterJsValue called with args:", args); - const result = originalSkylineGlobal.runtime.unRegisterJsValue(...args); - // console.info("unRegisterJsValue result:", result); - return result; - }, - "getJsValueById": (...args) => { - global.getJsValueByIdMark == undefined ? global.getJsValueByIdMark = 1 : global.getJsValueByIdMark++ - if (args[0] == 5) { - // debugger - } - // console.info("getJsValueById called with args:", args); - let result = originalSkylineGlobal.runtime.getJsValueById(...args); - - // console.info("getJsValueById result:", result, typeof result); - // if (typeof result === 'function') { - // return (...args) => { - // // console.info("getJsValueById result wrapper called with args:", args); - // return result(...args); - // } - // } - return result; - }, - "registerFontFaceCallback": (...args) => { - console.info("registerFontFaceCallback called with args:", args); - const result = originalSkylineGlobal.runtime.registerFontFaceCallback(...args); - console.info("registerFontFaceCallback result:", result); - return result; - }, - "setFeatureFlags": (...args) => { - console.info("setFeatureFlags called with args:", args); - const result = originalSkylineGlobal.runtime.setFeatureFlags(...args); - console.info("setFeatureFlags result:", result); - return result; - }, - "updateMapCustomCallout": (...args) => { - console.info("updateMapCustomCallout called with args:", args); - const result = originalSkylineGlobal.runtime.updateMapCustomCallout(...args); - console.info("updateMapCustomCallout result:", result); - return result; - }, - "preloadAssets": (...args) => { - console.info("preloadAssets called with args:", args); - const result = originalSkylineGlobal.runtime.preloadAssets(...args); - console.info("preloadAssets result:", result); - return result; - }, - }, - userAgent: "skyline/1.4.0 (;8f190450e6301587ce41e08afcaa983db4dc712e;)", - workletModule: { - installCoreFunctions: (func1) => { - const func = function (...args) { - console.info('-----> SkylineWorkletModule - installCoreFunctions', args) - } - func._closure = { - requestFrame: (...args1) => { - console.info("[coreFunctions] requestFrame called with args:", args1); - } - } - func.asString = func1.asString - func.__workletHash = func1.__workletHash - func.__location = func1.__location - func.__worklet = func1.__worklet - console.info("installCoreFunctions called with args:", func); - const result = originalSkylineGlobal.workletModule.installCoreFunctions(func); - console.info("installCoreFunctions result:", result); - return undefined; - }, - makeShareable: (func1) => { - // console.info("makeShareable called with args:", [func1]); - const result = originalSkylineGlobal.workletModule.makeShareable(func1); - return result; - }, - makeMutable: (...args) => { - // console.info("makeMutable called with args:", args); - const result = originalSkylineGlobal.workletModule.makeMutable(...args); - if (!globalThis.mutableList) globalThis.mutableList = [] - globalThis.mutableList.push(result) - // console.info("makeMutable result:", result, result._windowId, result._value, result.value); - // delete result._windowId - // delete result._value - // delete result.value - // delete result._animation - const orgi = result.__proto__.installGetter - // result.installGetter = function (...args) { - // console.info("installGetter called with args:", result, args); - // const ret = orgi.apply(this, args); - // console.info("installGetter result:", ret); - // return ret; - // } - globalThis.makeMutableMark == undefined ? globalThis.makeMutableMark = 1 : globalThis.makeMutableMark++ - const currentMakr = globalThis.makeMutableMark; - // result.installGetter = function (...args) { - // console.info(`[${currentMakr}]installGetter called with args:`, result, args); - // console.info(`[${currentMakr}]before value:`, result.value) - // const ret = orgi.apply(this, args); - // console.info(`[${currentMakr}]after value:`, result.value) - // console.info(`[${currentMakr}]installGetter result:`, ret); - // return ret; - // } - // console.info("makeMutable __hiddenHostObjectProp:", result.__hiddenHostObjectProp); - // Object.defineProperty(result, "_value", { - // set: function (v) { - // console.info("makeMutable _value set:", v); - // result.value = v; - // } - // }) - return result - - - }, - makeRemote: (...args) => { - global.makeRemoteMark == undefined ? global.makeRemoteMark = 1 : global.makeRemoteMark++ - console.info("makeRemote called with args:", args, global.makeRemoteMark); - - // const result = originalSkylineGlobal.workletModule.makeRemote(...args); - // console.info("makeRemote result:", result); - return {}; - }, - registerEventHandler: (...args) => { - // console.info('registerEventHandler:', args) - const result = originalSkylineGlobal.workletModule.registerEventHandler(...args); - return result; - }, - unregisterEventHandler: (...args) => { - const result = originalSkylineGlobal.workletModule.unregisterEventHandler(...args); - return result; - }, - startMapper: (...args) => { - // console.info('SkylineWorkletModule - startMapper', args) - if (args[1].__location === "src/worklet/hook/animatedStyle.ts (66:23)") { - args[1].asString = "function _f(_,nodes){const{updater}=jsThis._closure;{var _updater;function convertToCssText(obj){let cssText='';Object.keys(obj).forEach(function(key){const hyphenatedKey=key.replace(/([A-Z])/g,'-$1').toLowerCase();cssText+=hyphenatedKey+': '+obj[key]+'; ';});return cssText;}const updates=(_updater=updater())!==null&&_updater!==void 0?_updater:{};const inlineStyle=convertToCssText(updates);console.info('nodes:', nodes);if(!Array.isArray(nodes)){console.warn('applyAnimatedStyle can not find corresponding nodes');return;}nodes.forEach(function(node){return workletUIModule.updateNodeStyle(node,inlineStyle);});}}" - } - const result = originalSkylineGlobal.workletModule.startMapper(...args) - // console.info('SkylineWorkletModule - startMapper result', result); - return result; - }, - stopMappers: (...args) => { - // console.info('SkylineWorkletModule - stopMappers', args) - const result = originalSkylineGlobal.workletModule.stopMappers(...args); - return result; - }, - - - }, - } \ No newline at end of file diff --git a/tools/replace-skyline.sh b/tools/replace-skyline.sh index 1bf0d33..2272c13 100755 --- a/tools/replace-skyline.sh +++ b/tools/replace-skyline.sh @@ -8,7 +8,7 @@ nwjs_dir="$root_dir/nwjs" package_dir="$root_dir/package.nw" shared_memory_version="v1.0.2" -skyline_version="continuous" +skyline_version="v1.0.3" cd "$package_dir/node_modules" rm sharedMemory/sharedMemory.node diff --git a/tools/update-wechat-devtools.js b/tools/update-wechat-devtools.js index 12d78be..55e549e 100755 --- a/tools/update-wechat-devtools.js +++ b/tools/update-wechat-devtools.js @@ -15,11 +15,11 @@ const urls = { "https://developers.weixin.qq.com/miniprogram/dev/devtools/nightly.html", }; -const arguments = process.argv.slice(2); -console.log(arguments) +const commandArgs = process.argv.slice(2); +console.log(commandArgs) const args = {}; -for (let arg of arguments) { +for (let arg of commandArgs) { let t = arg.split("="); args[t[0]] = t[1]; } From 26fb2cf073fa07824db6e00c9b35eb16e49f11ab Mon Sep 17 00:00:00 2001 From: msojocs Date: Sun, 9 Nov 2025 19:22:34 +0800 Subject: [PATCH 09/11] feat: skyline sever run script --- tools/run-skyline-server.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 tools/run-skyline-server.sh diff --git a/tools/run-skyline-server.sh b/tools/run-skyline-server.sh new file mode 100755 index 0000000..bdf2508 --- /dev/null +++ b/tools/run-skyline-server.sh @@ -0,0 +1,12 @@ +#!/bin/bash +docker run -d -it \ + --restart=always \ + --hostname="$(hostname)" \ + --env="DISPLAY" \ + --platform="linux/amd64" \ + --volume="${XAUTHORITY:-${HOME}/.Xauthority}:/root/.Xauthority:ro" \ + --volume="/tmp/.X11-unix:/tmp/.X11-unix:ro" \ + --volume="/dev/shm:/dev/shm" \ + -p 3001:3001 \ + --name skyline_server \ + ghcr.io/msojocs/skyline-client-server:master \ No newline at end of file From 873f1d265b5cbe998c87885817af3b9c84a99372 Mon Sep 17 00:00:00 2001 From: msojocs Date: Sun, 9 Nov 2025 20:10:47 +0800 Subject: [PATCH 10/11] =?UTF-8?q?docs:=20skyline=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.MD | 23 ++++++++++++++++++++++- tools/build-with-docker.sh | 7 ++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/README.MD b/README.MD index e0ecf70..c4bdfbc 100644 --- a/README.MD +++ b/README.MD @@ -139,7 +139,28 @@ # FAQ -请参考: [FAQ](docs/FAQ.MD) +## Skyline + +启动Server后,点击编译即可;第一次启动Server会有wine配置提示,**不需要安装mono**。 + +> [!Warning] +> 第一次编译之后的编译操作可能会失败,因为点击编译按钮后,wine服务器需要一些时间完成重启。 + +```shell +docker run -d -it \ + --restart=always \ + --hostname="$(hostname)" \ + --env="DISPLAY" \ + --platform="linux/amd64" \ + --volume="${XAUTHORITY:-${HOME}/.Xauthority}:/root/.Xauthority:ro" \ + --volume="/tmp/.X11-unix:/tmp/.X11-unix:ro" \ + --volume="/dev/shm:/dev/shm" \ + -p 3001:3001 \ + --name skyline_server \ + ghcr.io/msojocs/skyline-client-server:master +``` + +其它请参考: [FAQ](docs/FAQ.MD) # 界面截图 diff --git a/tools/build-with-docker.sh b/tools/build-with-docker.sh index 0cf320a..ce56a31 100755 --- a/tools/build-with-docker.sh +++ b/tools/build-with-docker.sh @@ -2,5 +2,10 @@ root_dir=$(cd `dirname $0`/.. && pwd -P) echo "$(id -u):$(id -g)" -docker run -u "$(id -u):$(id -g)" --rm -i -e "ACTION_MODE=${ACTION_MODE:-false}" -w /workspace -v "$root_dir:/workspace" jiyecafe/wechat-devtools-build:v1.0.4 \ +docker run --rm -i \ + -u "$(id -u):$(id -g)" \ + -e "ACTION_MODE=${ACTION_MODE:-false}" \ + -w /workspace \ + -v "$root_dir:/workspace" \ + jiyecafe/wechat-devtools-build:v1.0.4 \ bash ./docker/entrypoint \ No newline at end of file From 49c17acbb6aaa34ed631e5f5d459cbf5a0e91e9c Mon Sep 17 00:00:00 2001 From: msojocs Date: Sun, 9 Nov 2025 20:27:01 +0800 Subject: [PATCH 11/11] docs: CHANGELOG --- CHANGELOG.MD | 3 +++ README.MD | 2 +- docker/entrypoint | 34 ---------------------------------- tools/build-with-docker.sh | 2 +- tools/setup-wechat-devtools.sh | 14 +++++--------- 5 files changed, 10 insertions(+), 45 deletions(-) delete mode 100755 docker/entrypoint diff --git a/CHANGELOG.MD b/CHANGELOG.MD index 979a1b9..df53330 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -1,3 +1,6 @@ +# 1.06.2504060-2 / 2025-11- +- feat: skyline support + # 1.06.2504060-1 / 2025-10-30 - update: devtools to v1.06.2504060 diff --git a/README.MD b/README.MD index c4bdfbc..2de9738 100644 --- a/README.MD +++ b/README.MD @@ -139,7 +139,7 @@ # FAQ -## Skyline +## Skyline(实验性功能) 启动Server后,点击编译即可;第一次启动Server会有wine配置提示,**不需要安装mono**。 diff --git a/docker/entrypoint b/docker/entrypoint deleted file mode 100755 index d59450a..0000000 --- a/docker/entrypoint +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -set -e # 命令出错就退出 -trap 'catchError $LINENO $BASH_COMMAND' ERR # 捕获错误情况 - -catchError() { - exit_code=$? - if [ $exit_code -ne 0 ]; then - fail "\033[31mcommand: $2\n at $0:$1\n at $STEP\033[0m" - fi - exit $exit_code -} - -success() { - echo -e "\033[42;37m 成功 \033[0m $1" -} - -fail() { - echo -e "\033[41;37m 失败 \033[0m $1" -} - -echo "start $UID" -python --version -echo "docker node version: $( node --version )" - -cd /workspace -export HOME="/tmp/home" -mkdir -p /tmp/home -# -# exec ./tools/rebuild-node-modules 0.53.1 -./tools/setup-wechat-devtools.sh - -# chmod -R 777 tmp node nwjs package.nw -# ls -l package.nw diff --git a/tools/build-with-docker.sh b/tools/build-with-docker.sh index ce56a31..86cc3d1 100755 --- a/tools/build-with-docker.sh +++ b/tools/build-with-docker.sh @@ -8,4 +8,4 @@ docker run --rm -i \ -w /workspace \ -v "$root_dir:/workspace" \ jiyecafe/wechat-devtools-build:v1.0.4 \ - bash ./docker/entrypoint \ No newline at end of file + bash ./tools/setup-wechat-devtools.sh \ No newline at end of file diff --git a/tools/setup-wechat-devtools.sh b/tools/setup-wechat-devtools.sh index 1f864fc..de70532 100755 --- a/tools/setup-wechat-devtools.sh +++ b/tools/setup-wechat-devtools.sh @@ -56,6 +56,11 @@ export PATH="$root_dir/cache/npm/node_global/bin:$root_dir/node/bin:$PATH" node --version npm --version +if [ "$ACTION_MODE" == "true" ]; then + # ACTION HOME没有定义,导致异常 + export HOME="/tmp/home" + mkdir -p /tmp/home +fi if [ $CURRENT_STEP == $INSTALL_NODE_SUCCESS ];then npm config set prefix "$root_dir/cache/npm/node_global" npm config set cache "$root_dir/cache/npm/node_cache" @@ -63,15 +68,6 @@ if [ $CURRENT_STEP == $INSTALL_NODE_SUCCESS ];then notice "非ACTION模式, 设置镜像源" npm config set registry http://registry.npmmirror.com/ # 注册模块镜像 npm config set disturl http://npmmirror.com/dist # node-gyp 编译依赖的 node 源码镜像 - ## 以下选择添加 - npm config set sass_binary_site http://npmmirror.com/mirrors/node-sass # node-sass 二进制包镜像 - npm config set electron_mirror http://npmmirror.com/mirrors/electron/ # electron 二进制包镜像 - npm config set puppeteer_download_host http://npmmirror.com/mirrors # puppeteer 二进制包镜像 - npm config set chromedriver_cdnurl http://npmmirror.com/mirrors/chromedriver # chromedriver 二进制包镜像 - npm config set operadriver_cdnurl http://npmmirror.com/mirrors/operadriver # operadriver 二进制包镜像 - npm config set phantomjs_cdnurl http://npmmirror.com/mirrors/phantomjs # phantomjs 二进制包镜像 - npm config set selenium_cdnurl http://npmmirror.com/mirrors/selenium # selenium 二进制包镜像 - npm config set node_inspector_cdnurl http://npmmirror.com/mirrors/node-inspector # node-inspector 二进制包镜像 fi step_switch $INSTALL_NPM_CONFIG_SUCCESS fi