cicy-desktop 2.1.86 → 2.1.88
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/bin/cicy-desktop +50 -26
- package/package.json +6 -6
- package/src/backends/homepage-react/assets/index-5vDVCGqD.js +365 -0
- package/src/backends/homepage-react/index.html +1 -1
- package/src/i18n/locales/en.json +4 -2
- package/src/i18n/locales/fr.json +17 -16
- package/src/i18n/locales/ja.json +17 -16
- package/src/i18n/locales/zh-CN.json +4 -2
- package/workers/render/src/App.jsx +33 -12
- package/src/backends/homepage-react/assets/index-B7UhCeq6.js +0 -365
package/bin/cicy-desktop
CHANGED
|
@@ -40,41 +40,65 @@ function globalElectronBin() {
|
|
|
40
40
|
return _globalElectronBin;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
//
|
|
44
|
-
//
|
|
45
|
-
//
|
|
46
|
-
//
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
43
|
+
// Pinned electron version = the one cicy-desktop is built against (package.json
|
|
44
|
+
// dependency). NEVER install "latest": its native extract-zip prebuild is
|
|
45
|
+
// unpublished for win32-x64 → `npm i -g electron` dies with "Cannot find native
|
|
46
|
+
// binding". 41.x downloads fine.
|
|
47
|
+
const ELECTRON_VERSION = (() => {
|
|
48
|
+
try {
|
|
49
|
+
const pj = require("../package.json");
|
|
50
|
+
const v = (pj.dependencies && pj.dependencies.electron) ||
|
|
51
|
+
(pj.devDependencies && pj.devDependencies.electron) || "";
|
|
52
|
+
return String(v).replace(/^[\^~>=\s]*/, "").trim() || "41.0.3";
|
|
53
|
+
} catch { return "41.0.3"; }
|
|
54
|
+
})();
|
|
55
|
+
|
|
56
|
+
// True iff <electronDir> has a downloaded, runnable binary (path.txt → dist/exe).
|
|
57
|
+
function electronBinaryHealthy(electronDir) {
|
|
58
|
+
if (!electronDir) return false;
|
|
59
|
+
try {
|
|
60
|
+
const exe = fs.readFileSync(path.join(electronDir, "path.txt"), "utf8").trim();
|
|
61
|
+
return !!exe && fs.existsSync(path.join(electronDir, "dist", exe));
|
|
62
|
+
} catch { return false; }
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// The GLOBAL electron's package dir for the current npm prefix (null if none).
|
|
66
|
+
function globalElectronDir() {
|
|
67
|
+
try {
|
|
68
|
+
const prefix = execSync("npm prefix -g", { stdio: ["ignore", "pipe", "ignore"] }).toString().trim();
|
|
69
|
+
if (!prefix) return null;
|
|
70
|
+
return isWindows
|
|
71
|
+
? path.join(prefix, "node_modules", "electron") // win: <prefix>\node_modules\electron
|
|
72
|
+
: path.join(prefix, "lib", "node_modules", "electron"); // unix: <prefix>/lib/node_modules/electron
|
|
73
|
+
} catch { return null; }
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// Make sure a USABLE electron exists before spawning the worker. Prefer a shared
|
|
77
|
+
// GLOBAL electron (downloaded once, survives npx-cache eviction, and
|
|
78
|
+
// resolveElectronSpawn() picks it first). If nothing healthy is found anywhere,
|
|
79
|
+
// auto-install the PINNED version GLOBALLY with the npmmirror mirror — i.e. do the
|
|
80
|
+
// `npm i -g electron@<pin>` step for the user, so a fresh `npx cicy-desktop`
|
|
81
|
+
// self-provisions electron and starts first-try. Runs once per process.
|
|
52
82
|
let _electronEnsured = false;
|
|
53
83
|
function ensureElectron() {
|
|
54
84
|
if (_electronEnsured) return;
|
|
55
85
|
_electronEnsured = true;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
try {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
if (exe && fs.existsSync(path.join(electronDir, "dist", exe))) return; // healthy
|
|
64
|
-
}
|
|
65
|
-
} catch {}
|
|
66
|
-
const installJs = path.join(electronDir, "install.js");
|
|
67
|
-
if (!fs.existsSync(installJs)) return;
|
|
68
|
-
console.log("⚙️ Electron binary missing — repairing via electron/install.js (mirror)…");
|
|
86
|
+
// Already usable (global, or the resolvable bundled/npx copy)? nothing to do.
|
|
87
|
+
if (electronBinaryHealthy(globalElectronDir())) return;
|
|
88
|
+
let bundledDir = null;
|
|
89
|
+
try { bundledDir = path.dirname(require.resolve("electron/package.json", { paths: [PACKAGE_ROOT] })); } catch {}
|
|
90
|
+
if (electronBinaryHealthy(bundledDir)) return;
|
|
91
|
+
// None usable → install the pinned electron globally (with the mirror).
|
|
92
|
+
console.log(`⚙️ No usable Electron — installing electron@${ELECTRON_VERSION} -g (mirror), one-time…`);
|
|
69
93
|
try {
|
|
70
|
-
execSync(`
|
|
71
|
-
cwd: electronDir,
|
|
94
|
+
execSync(`npm i -g electron@${ELECTRON_VERSION} --registry=${NPM_REGISTRY}`, {
|
|
72
95
|
stdio: "inherit",
|
|
73
96
|
env: { ...process.env, ELECTRON_MIRROR, npm_config_registry: NPM_REGISTRY },
|
|
74
97
|
});
|
|
98
|
+
_globalElectronBin = undefined; // bust the memo so resolveElectronSpawn re-finds the new global bin
|
|
75
99
|
} catch (e) {
|
|
76
|
-
console.warn(`⚠️
|
|
77
|
-
console.warn(` Fix manually: set ELECTRON_MIRROR=${ELECTRON_MIRROR} && npm i -g electron
|
|
100
|
+
console.warn(`⚠️ Global electron install failed: ${e.message}`);
|
|
101
|
+
console.warn(` Fix manually: set ELECTRON_MIRROR=${ELECTRON_MIRROR} && npm i -g electron@${ELECTRON_VERSION}`);
|
|
78
102
|
}
|
|
79
103
|
}
|
|
80
104
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cicy-desktop",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.88",
|
|
4
4
|
"description": "CiCy - AI-powered operating system browser",
|
|
5
5
|
"main": "src/main.js",
|
|
6
6
|
"bin": {
|
|
@@ -133,11 +133,11 @@
|
|
|
133
133
|
},
|
|
134
134
|
"//optionalDependencies": "Runtime Bundle v1 (主人指令): platform binaries delivered by `npm i -g cicy-desktop` itself — npm installs only the current-platform subpackage (os/cpu pinned in each), so first start seeds the runtime store with ZERO network, ZERO npx. Windows packages are named *-windows-* (npm spam filter 403s new names containing win32). cicy-msys2 added once published.",
|
|
135
135
|
"optionalDependencies": {
|
|
136
|
-
"cicy-code-darwin-x64": "2.3.
|
|
137
|
-
"cicy-code-darwin-arm64": "2.3.
|
|
138
|
-
"cicy-code-linux-x64": "2.3.
|
|
139
|
-
"cicy-code-linux-arm64": "2.3.
|
|
140
|
-
"cicy-code-windows-x64": "2.3.
|
|
136
|
+
"cicy-code-darwin-x64": "2.3.9",
|
|
137
|
+
"cicy-code-darwin-arm64": "2.3.9",
|
|
138
|
+
"cicy-code-linux-x64": "2.3.9",
|
|
139
|
+
"cicy-code-linux-arm64": "2.3.9",
|
|
140
|
+
"cicy-code-windows-x64": "2.3.9",
|
|
141
141
|
"cicy-mihomo-darwin-x64": "1.10.4",
|
|
142
142
|
"cicy-mihomo-darwin-arm64": "1.10.4",
|
|
143
143
|
"cicy-mihomo-linux-x64": "1.10.4",
|