cicy-desktop 2.1.131 → 2.1.133

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.
@@ -62,6 +62,10 @@ jobs:
62
62
  - name: Install Electron build dependencies
63
63
  run: npm install --save-dev --no-audit electron@41.0.2 electron-builder@26.7.0
64
64
 
65
+ # NOTE: the homepage SPA is rebuilt automatically by the prebuild:linux npm
66
+ # hook (scripts/build-homepage.cjs) right before `npm run build:linux` below,
67
+ # so the AppImage can never ship a stale homepage. No explicit step needed.
68
+
65
69
  - name: Build Linux app (deb + AppImage)
66
70
  shell: bash
67
71
  env:
@@ -70,6 +70,10 @@ jobs:
70
70
  - name: Install Electron build dependencies in project directory
71
71
  run: npm install --save-dev --no-audit electron@41.0.2 electron-builder@26.7.0
72
72
 
73
+ # NOTE: the homepage SPA is rebuilt automatically by the prebuild:mac npm
74
+ # hook (scripts/build-homepage.cjs) right before `npm run build:mac` below,
75
+ # so the dmg can never ship a stale homepage. No explicit step needed.
76
+
73
77
  - name: Prepare macOS icon
74
78
  shell: bash
75
79
  # cicy-ai.com sometimes returns 522 (origin unreachable). Don't let an
@@ -26,20 +26,11 @@ jobs:
26
26
  - name: Sync runtime deps to latest (cicy-code + cicy-mihomo; drop msys2)
27
27
  run: node scripts/sync-runtime-deps.cjs
28
28
 
29
- # The shipped homepage is the prebuilt SPA at src/backends/homepage-react.
30
- # vite outputs to workers/render/dist, so rebuild + copy it here — otherwise
31
- # the package ships a STALE homepage (this is exactly how the Docker card
32
- # lingered after it was removed in source). Always build from source on publish.
33
- - name: Build homepage SPA src/backends/homepage-react
34
- run: |
35
- cd workers/render
36
- npm install --no-audit --no-fund
37
- npm run build
38
- cd ../..
39
- rm -rf src/backends/homepage-react/assets src/backends/homepage-react/index.html
40
- cp -r workers/render/dist/. src/backends/homepage-react/
41
- echo "homepage bundle: $(grep -o 'assets/index-[A-Za-z0-9_-]*\.js' src/backends/homepage-react/index.html)"
42
-
29
+ # NOTE: the homepage SPA is rebuilt from source automatically by the
30
+ # prepublishOnly npm hook (scripts/build-homepage.cjs) during `npm publish`
31
+ # below, so the package can never ship a stale homepage (this is how the
32
+ # Docker card lingered, and how the version badge went missing). No explicit
33
+ # step needed one mechanism (npm lifecycle) covers npm + all installers.
43
34
  - name: Publish cicy-desktop to npm
44
35
  run: npm publish --access public
45
36
  env:
@@ -32,6 +32,10 @@ jobs:
32
32
  - name: Install Electron build dependencies in project directory
33
33
  run: npm install --save-dev --no-audit electron@41.0.2 electron-builder@26.7.0
34
34
 
35
+ # NOTE: the homepage SPA is rebuilt automatically by the prebuild:win npm
36
+ # hook (scripts/build-homepage.cjs) right before `npm run build:win` below,
37
+ # so the exe can never ship a stale homepage. No explicit step needed.
38
+
35
39
  - name: Prepare Windows icon
36
40
  shell: powershell
37
41
  continue-on-error: true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cicy-desktop",
3
- "version": "2.1.131",
3
+ "version": "2.1.133",
4
4
  "description": "CiCy - AI-powered operating system browser",
5
5
  "main": "src/main.js",
6
6
  "bin": {
@@ -17,6 +17,11 @@
17
17
  "test:ls": "node tests/test-ls.js",
18
18
  "build": "electron-builder --publish never",
19
19
  "build:ui": "cd packages/ui-react && npm install && npm run build",
20
+ "build:homepage": "node scripts/build-homepage.cjs",
21
+ "prebuild:win": "node scripts/build-homepage.cjs",
22
+ "prebuild:mac": "node scripts/build-homepage.cjs",
23
+ "prebuild:linux": "node scripts/build-homepage.cjs",
24
+ "prepublishOnly": "node scripts/build-homepage.cjs",
20
25
  "build:win": "electron-builder --win",
21
26
  "build:mac": "electron-builder --mac",
22
27
  "build:linux": "electron-builder --linux"
@@ -0,0 +1,44 @@
1
+ #!/usr/bin/env node
2
+ // Single source of truth for producing the SHIPPED homepage.
3
+ //
4
+ // The app loads src/backends/homepage-react/ (a prebuilt SPA snapshot). The
5
+ // SOURCE lives in workers/render/. These are two different things and WILL
6
+ // drift apart unless the snapshot is rebuilt from source — which is exactly
7
+ // how a stale homepage (missing the version badge) shipped before.
8
+ //
9
+ // This script rebuilds the snapshot from source. It is wired into every
10
+ // release path via npm lifecycle hooks (prebuild:win/mac/linux + prepublishOnly),
11
+ // so the shipped homepage can NEVER lag behind workers/render — locally or in CI.
12
+ // Cross-platform (pure node fs/cp): runs on the maintainer's Windows box too.
13
+
14
+ const { execSync } = require("child_process");
15
+ const fs = require("fs");
16
+ const path = require("path");
17
+
18
+ const ROOT = path.join(__dirname, "..");
19
+ const RENDER = path.join(ROOT, "workers", "render");
20
+ const DIST = path.join(RENDER, "dist");
21
+ const DEST = path.join(ROOT, "src", "backends", "homepage-react");
22
+
23
+ function run(cmd, cwd) {
24
+ console.log(`[build-homepage] $ ${cmd} (in ${path.relative(ROOT, cwd) || "."})`);
25
+ execSync(cmd, { cwd, stdio: "inherit" });
26
+ }
27
+
28
+ // 1) build the SPA from source (install deps on a cold runner)
29
+ if (!fs.existsSync(path.join(RENDER, "node_modules"))) {
30
+ run("npm install --no-audit --no-fund", RENDER);
31
+ }
32
+ run("npm run build", RENDER);
33
+
34
+ // 2) replace the shipped snapshot with the fresh build (clean, not merge —
35
+ // so old hashed assets don't pile up)
36
+ fs.rmSync(path.join(DEST, "assets"), { recursive: true, force: true });
37
+ fs.rmSync(path.join(DEST, "index.html"), { force: true });
38
+ fs.mkdirSync(DEST, { recursive: true });
39
+ fs.cpSync(DIST, DEST, { recursive: true });
40
+
41
+ // 3) report which bundle shipped (visible in CI logs)
42
+ const html = fs.readFileSync(path.join(DEST, "index.html"), "utf8");
43
+ const m = html.match(/assets\/index-[A-Za-z0-9_-]*\.js/);
44
+ console.log(`[build-homepage] shipped bundle: ${m ? m[0] : "(hash not found!)"}`);