@ohos-ports/slides-grab 1.5.0-beta.7 → 1.5.0-beta.9

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.
@@ -6,6 +6,8 @@
6
6
  * 1. Patches playwright-core to support openharmony platform
7
7
  * 2. Copies bundled native binaries (sharp .node + libvips .so) to node_modules/@img/
8
8
  * (these packages are NOT on public npm registry — compiled from source with OHOS clang)
9
+ * 3. Creates libvips soname symlinks and @ohos-ports/sharp-libvips-* symlink
10
+ * (the .node RPATH and .so NEEDED entries reference sonames that don't exist as files)
9
11
  *
10
12
  * Runs automatically after `npm install`.
11
13
  * Non-blocking: warnings don't fail npm install.
@@ -111,8 +113,82 @@ function copyNativeBinaries() {
111
113
  return true;
112
114
  }
113
115
 
116
+ // ─── 3. Create libvips soname symlinks ──────────────────────────────────
117
+ function createLibvipsSymlinks() {
118
+ if (process.platform !== 'openharmony') {
119
+ return false;
120
+ }
121
+
122
+ const platform = process.platform + '-' + process.arch;
123
+
124
+ // Find libvips lib directory
125
+ let libvipsLibPath;
126
+ try {
127
+ libvipsLibPath = require(`@ohos-ports/img-sharp-libvips-${platform}/lib`);
128
+ } catch {
129
+ try {
130
+ libvipsLibPath = require(`@img/sharp-libvips-${platform}/lib`);
131
+ } catch {
132
+ console.log(' [ohos-bridge] libvips package not found, skipping symlinks');
133
+ return false;
134
+ }
135
+ }
136
+
137
+ if (!libvipsLibPath || !fs.existsSync(libvipsLibPath)) {
138
+ console.log(' [ohos-bridge] libvips lib directory not found, skipping');
139
+ return false;
140
+ }
141
+
142
+ let created = 0;
143
+
144
+ // Create soname symlinks: libXXX.so.Y.Z.W → libXXX.so.Y
145
+ try {
146
+ for (const file of fs.readdirSync(libvipsLibPath)) {
147
+ const m = file.match(/^(.+\.so\.\d+)\.\d+\.\d+$/);
148
+ if (m) {
149
+ const soname = path.join(libvipsLibPath, m[1]);
150
+ if (!fs.existsSync(soname)) {
151
+ try {
152
+ fs.symlinkSync(file, soname);
153
+ created++;
154
+ } catch {
155
+ try {
156
+ fs.copyFileSync(path.join(libvipsLibPath, file), soname);
157
+ created++;
158
+ } catch {}
159
+ }
160
+ }
161
+ }
162
+ }
163
+ } catch {}
164
+
165
+ // Special: libz.so.1.3.1.zlib-ng → libz.so.1
166
+ const zlibNg = path.join(libvipsLibPath, 'libz.so.1.3.1.zlib-ng');
167
+ if (fs.existsSync(zlibNg)) {
168
+ const zLink = path.join(libvipsLibPath, 'libz.so.1');
169
+ if (!fs.existsSync(zLink)) {
170
+ try { fs.symlinkSync('libz.so.1.3.1.zlib-ng', zLink); created++; } catch {}
171
+ }
172
+ }
173
+
174
+ // Create @ohos-ports/sharp-libvips-{platform} → img-sharp-libvips-{platform} symlink
175
+ // .node RPATH references sharp-libvips-* (without img- prefix)
176
+ try {
177
+ const ohosDir = path.resolve(libvipsLibPath, '../../..');
178
+ const targetName = `img-sharp-libvips-${platform}`;
179
+ const linkName = path.join(ohosDir, `sharp-libvips-${platform}`);
180
+ if (fs.existsSync(path.join(ohosDir, targetName)) && !fs.existsSync(linkName)) {
181
+ try { fs.symlinkSync(targetName, linkName); created++; } catch {}
182
+ }
183
+ } catch {}
184
+
185
+ console.log(` [ohos-bridge] ✓ ${created} libvips symlinks created`);
186
+ return true;
187
+ }
188
+
114
189
  // ─── Main ────────────────────────────────────────────────────────────────
115
190
  console.log('[ohos-ports/slides-grab] Running postinstall...');
116
191
  patchPlaywrightCore();
117
192
  copyNativeBinaries();
193
+ createLibvipsSymlinks();
118
194
  console.log('[ohos-ports/slides-grab] Postinstall complete.');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ohos-ports/slides-grab",
3
- "version": "1.5.0-beta.7",
3
+ "version": "1.5.0-beta.9",
4
4
  "description": "Agent-first presentation framework — plan, design, and visually edit HTML slides with Claude Code or Codex, then export to PDF or experimental/unstable PPTX/Figma formats. HarmonyOS adaptation: Playwright connects to system Haitai browser (Chromium M132) via CDP bridge.",
5
5
  "license": "MIT",
6
6
  "author": "vkehfdl1",
@@ -82,7 +82,6 @@
82
82
  "tldraw": "^4.4.1"
83
83
  },
84
84
  "optionalDependencies": {
85
- "@ohos-ports/img-sharp-openharmony-arm64": "0.34.5-beta.0",
86
85
  "@ohos-ports/img-sharp-libvips-openharmony-arm64": "1.2.4-beta.7"
87
86
  },
88
87
  "devDependencies": {