dsh-gufa-code 1.3.48 → 1.3.49
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 +1 -2
- package/client.js +1 -1
- package/desktop/float/bin/gufa-float-macos-arm64 +0 -0
- package/desktop/float/bin/gufa-float-macos-universal +0 -0
- package/desktop/float/bin/gufa-float-macos-x64 +0 -0
- package/desktop/float//345/217/244/346/263/225/347/274/226/347/250/213/346/202/254/346/265/256/345/261/202.app/Contents/Info.plist +2 -2
- package/desktop/float//345/217/244/346/263/225/347/274/226/347/250/213/346/202/254/346/265/256/345/261/202.app/Contents/MacOS/gufa-float +0 -0
- package/host/dev.js +1 -1
- package/package.json +1 -1
- package/scripts/build-float-macos.sh +43 -14
package/README.md
CHANGED
|
@@ -86,8 +86,7 @@ dsh plugin add dsh-gufa-code
|
|
|
86
86
|
- 菜单栏「古法」图标 / 拖动条右键:也能退出摸鱼。
|
|
87
87
|
- 选择器底部还有「自由悬浮(不吸附)」:不绑定窗口,自己拖拽缩放(同样带状态、同样可调透明度)。
|
|
88
88
|
- 平台限制:
|
|
89
|
-
- **macOS
|
|
90
|
-
- Intel Mac 需自行编译 helper:`./scripts/build-float-macos.sh`(需要 Xcode Command Line Tools),编译后放在 `desktop/float/bin/`;
|
|
89
|
+
- **macOS Apple Silicon / Intel 都开箱可用**:npm 包内带的是 universal helper(arm64 + x86_64),无需自己编译;
|
|
91
90
|
- Windows / Linux 暂无悬浮层(其余 IDE 功能正常);
|
|
92
91
|
- helper 为 ad-hoc 签名;首次启动若被系统拦截,在「隐私与安全性」里允许一次即可。
|
|
93
92
|
|
package/client.js
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
<key>CFBundleDisplayName</key><string>古法编程悬浮层</string>
|
|
8
8
|
<key>CFBundleExecutable</key><string>gufa-float</string>
|
|
9
9
|
<key>CFBundlePackageType</key><string>APPL</string>
|
|
10
|
-
<key>CFBundleShortVersionString</key><string>1.3.
|
|
11
|
-
<key>CFBundleVersion</key><string>1.3.
|
|
10
|
+
<key>CFBundleShortVersionString</key><string>1.3.48</string>
|
|
11
|
+
<key>CFBundleVersion</key><string>1.3.48</string>
|
|
12
12
|
<key>LSUIElement</key><true/>
|
|
13
13
|
<key>NSHighResolutionCapable</key><true/>
|
|
14
14
|
<key>NSPrincipalClass</key><string>NSApplication</string>
|
|
Binary file
|
package/host/dev.js
CHANGED
|
@@ -29,7 +29,7 @@ const runFile = promisify(execFile)
|
|
|
29
29
|
/** 查找当前平台编译好的悬浮层 helper(P0 只支持 macOS)。 */
|
|
30
30
|
function floatBinaryPath() {
|
|
31
31
|
const arch = process.arch === 'arm64' ? 'arm64' : 'x64'
|
|
32
|
-
const candidates = [`gufa-float-macos-${arch}`, 'gufa-float-macos-arm64', 'gufa-float-macos-x64']
|
|
32
|
+
const candidates = [`gufa-float-macos-${arch}`, 'gufa-float-macos-universal', 'gufa-float-macos-arm64', 'gufa-float-macos-x64']
|
|
33
33
|
for (const name of candidates) {
|
|
34
34
|
const full = join(PLUGIN_ROOT, 'desktop', 'float', 'bin', name)
|
|
35
35
|
if (existsSync(full)) return full
|
package/package.json
CHANGED
|
@@ -1,22 +1,50 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
-
# 构建 macOS 悬浮层 helper
|
|
3
|
-
#
|
|
4
|
-
#
|
|
2
|
+
# 构建 macOS 悬浮层 helper:Objective-C + AppKit + WebKit。
|
|
3
|
+
# 产物:
|
|
4
|
+
# desktop/float/bin/gufa-float-macos-arm64 (Apple Silicon)
|
|
5
|
+
# desktop/float/bin/gufa-float-macos-x64 (Intel)
|
|
6
|
+
# desktop/float/bin/gufa-float-macos-universal (通用二进制,两个架构都能跑)
|
|
7
|
+
# desktop/float/古法编程悬浮层.app (通用二进制 + ad-hoc 签名)
|
|
8
|
+
# 在 Apple Silicon 上也能交叉编译 x86_64(Xcode CLT 自带两套架构 SDK),
|
|
9
|
+
# 所以 npm 包可以只带 universal 一份、Intel/Apple Silicon 开箱即用。
|
|
5
10
|
set -euo pipefail
|
|
6
11
|
cd "$(dirname "$0")/.."
|
|
7
12
|
mkdir -p desktop/float/bin
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
|
|
14
|
+
VERSION="$(node -p "require('./package.json').version" 2>/dev/null || echo 0.0.0)"
|
|
15
|
+
SRC=desktop/float/GufaFloat.m
|
|
16
|
+
TMP_ARM="$(mktemp /tmp/gufa-float-arm64.XXXXXX)"
|
|
17
|
+
TMP_X64="$(mktemp /tmp/gufa-float-x64.XXXXXX)"
|
|
18
|
+
trap 'rm -f "$TMP_ARM" "$TMP_X64"' EXIT
|
|
19
|
+
|
|
20
|
+
compile_arch() {
|
|
21
|
+
local arch="$1" out="$2"
|
|
22
|
+
clang -fobjc-arc -O2 -arch "$arch" \
|
|
23
|
+
-framework AppKit -framework WebKit -framework Carbon \
|
|
24
|
+
-o "$out" "$SRC"
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
echo "building arm64 slice..."
|
|
28
|
+
compile_arch arm64 "$TMP_ARM"
|
|
29
|
+
echo "building x86_64 slice..."
|
|
30
|
+
compile_arch x86_64 "$TMP_X64"
|
|
31
|
+
|
|
32
|
+
cp "$TMP_ARM" desktop/float/bin/gufa-float-macos-arm64
|
|
33
|
+
cp "$TMP_X64" desktop/float/bin/gufa-float-macos-x64
|
|
34
|
+
lipo -create "$TMP_ARM" "$TMP_X64" -output desktop/float/bin/gufa-float-macos-universal
|
|
35
|
+
chmod +x desktop/float/bin/gufa-float-macos-*.??? 2>/dev/null || true
|
|
36
|
+
chmod +x desktop/float/bin/gufa-float-macos-arm64 desktop/float/bin/gufa-float-macos-x64 desktop/float/bin/gufa-float-macos-universal
|
|
37
|
+
|
|
38
|
+
# 稳定的 code identifier(TCC 按它识别,避免每次构建换身份字符串)
|
|
39
|
+
codesign --force --sign - -i com.gufa.float desktop/float/bin/gufa-float-macos-arm64 >/dev/null 2>&1 || true
|
|
40
|
+
codesign --force --sign - -i com.gufa.float desktop/float/bin/gufa-float-macos-x64 >/dev/null 2>&1 || true
|
|
41
|
+
codesign --force --sign - -i com.gufa.float desktop/float/bin/gufa-float-macos-universal >/dev/null 2>&1 || true
|
|
14
42
|
|
|
15
43
|
APP="desktop/float/古法编程悬浮层.app"
|
|
16
44
|
rm -rf "$APP"
|
|
17
45
|
mkdir -p "$APP/Contents/MacOS"
|
|
18
|
-
cp
|
|
19
|
-
cat > "$APP/Contents/Info.plist" <<
|
|
46
|
+
cp desktop/float/bin/gufa-float-macos-universal "$APP/Contents/MacOS/gufa-float"
|
|
47
|
+
cat > "$APP/Contents/Info.plist" <<PLIST
|
|
20
48
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
21
49
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
22
50
|
<plist version="1.0">
|
|
@@ -26,8 +54,8 @@ cat > "$APP/Contents/Info.plist" <<'PLIST'
|
|
|
26
54
|
<key>CFBundleDisplayName</key><string>古法编程悬浮层</string>
|
|
27
55
|
<key>CFBundleExecutable</key><string>gufa-float</string>
|
|
28
56
|
<key>CFBundlePackageType</key><string>APPL</string>
|
|
29
|
-
<key>CFBundleShortVersionString</key><string
|
|
30
|
-
<key>CFBundleVersion</key><string
|
|
57
|
+
<key>CFBundleShortVersionString</key><string>${VERSION}</string>
|
|
58
|
+
<key>CFBundleVersion</key><string>${VERSION}</string>
|
|
31
59
|
<key>LSUIElement</key><true/>
|
|
32
60
|
<key>NSHighResolutionCapable</key><true/>
|
|
33
61
|
<key>NSPrincipalClass</key><string>NSApplication</string>
|
|
@@ -35,5 +63,6 @@ cat > "$APP/Contents/Info.plist" <<'PLIST'
|
|
|
35
63
|
</plist>
|
|
36
64
|
PLIST
|
|
37
65
|
codesign --force --deep --sign - "$APP" >/dev/null 2>&1 || true
|
|
38
|
-
|
|
66
|
+
|
|
67
|
+
echo "built: desktop/float/bin/gufa-float-macos-universal ($(lipo -archs desktop/float/bin/gufa-float-macos-universal))"
|
|
39
68
|
echo "built: $APP"
|