@shotstack/shotstack-canvas 1.3.2 → 1.3.3

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.
@@ -182,6 +182,7 @@ function bufferToArrayBuffer(buffer) {
182
182
  var DEFAULT_WASM_URL = "https://shotstack-ingest-api-dev-sources.s3.ap-southeast-2.amazonaws.com/euo5r93oyr/zzz01k9h-yycyx-2x2y6-qx9bj-7n567b/source.wasm";
183
183
  async function fetchWasmFromUrl(url) {
184
184
  try {
185
+ console.log(`\u{1F310} Fetching WASM from URL: ${url}`);
185
186
  const response = await fetch(url);
186
187
  if (response.ok) {
187
188
  const arrayBuffer = await response.arrayBuffer();
@@ -189,11 +190,15 @@ async function fetchWasmFromUrl(url) {
189
190
  if (bytes.length >= 4 && bytes[0] === 0 && bytes[1] === 97 && bytes[2] === 115 && bytes[3] === 109) {
190
191
  console.log(`\u2705 Fetched WASM from URL (${bytes.length} bytes)`);
191
192
  return arrayBuffer;
193
+ } else {
194
+ console.error(`\u274C Invalid WASM magic number from URL: ${url}`);
192
195
  }
196
+ } else {
197
+ console.error(`\u274C Failed to fetch WASM from URL: ${url}, status: ${response.status}`);
193
198
  }
194
199
  return void 0;
195
200
  } catch (err) {
196
- console.warn(`Failed to fetch WASM from ${url}:`, err);
201
+ console.error(`\u274C Error fetching WASM from ${url}:`, err);
197
202
  return void 0;
198
203
  }
199
204
  }
@@ -230,6 +235,7 @@ async function loadWasmNode(wasmBaseURL) {
230
235
  path.join(currentDir, "../../../node_modules/harfbuzzjs/hb.wasm"),
231
236
  path.join(currentDir, "../../../../node_modules/harfbuzzjs/hb.wasm")
232
237
  ];
238
+ console.log(`\u{1F50D} Searching for WASM in ${candidates.length} locations...`);
233
239
  for (const candidate of candidates) {
234
240
  try {
235
241
  const buffer = await readFile2(candidate);
@@ -239,7 +245,7 @@ async function loadWasmNode(wasmBaseURL) {
239
245
  continue;
240
246
  }
241
247
  }
242
- console.log("Local WASM not found, fetching from URL...");
248
+ console.log("\u{1F4C2} Local WASM not found in any location, fetching from URL...");
243
249
  const urlToFetch = wasmBaseURL || DEFAULT_WASM_URL;
244
250
  return await fetchWasmFromUrl(urlToFetch);
245
251
  } catch {
@@ -143,6 +143,7 @@ function bufferToArrayBuffer(buffer) {
143
143
  var DEFAULT_WASM_URL = "https://shotstack-ingest-api-dev-sources.s3.ap-southeast-2.amazonaws.com/euo5r93oyr/zzz01k9h-yycyx-2x2y6-qx9bj-7n567b/source.wasm";
144
144
  async function fetchWasmFromUrl(url) {
145
145
  try {
146
+ console.log(`\u{1F310} Fetching WASM from URL: ${url}`);
146
147
  const response = await fetch(url);
147
148
  if (response.ok) {
148
149
  const arrayBuffer = await response.arrayBuffer();
@@ -150,11 +151,15 @@ async function fetchWasmFromUrl(url) {
150
151
  if (bytes.length >= 4 && bytes[0] === 0 && bytes[1] === 97 && bytes[2] === 115 && bytes[3] === 109) {
151
152
  console.log(`\u2705 Fetched WASM from URL (${bytes.length} bytes)`);
152
153
  return arrayBuffer;
154
+ } else {
155
+ console.error(`\u274C Invalid WASM magic number from URL: ${url}`);
153
156
  }
157
+ } else {
158
+ console.error(`\u274C Failed to fetch WASM from URL: ${url}, status: ${response.status}`);
154
159
  }
155
160
  return void 0;
156
161
  } catch (err) {
157
- console.warn(`Failed to fetch WASM from ${url}:`, err);
162
+ console.error(`\u274C Error fetching WASM from ${url}:`, err);
158
163
  return void 0;
159
164
  }
160
165
  }
@@ -191,6 +196,7 @@ async function loadWasmNode(wasmBaseURL) {
191
196
  path.join(currentDir, "../../../node_modules/harfbuzzjs/hb.wasm"),
192
197
  path.join(currentDir, "../../../../node_modules/harfbuzzjs/hb.wasm")
193
198
  ];
199
+ console.log(`\u{1F50D} Searching for WASM in ${candidates.length} locations...`);
194
200
  for (const candidate of candidates) {
195
201
  try {
196
202
  const buffer = await readFile2(candidate);
@@ -200,7 +206,7 @@ async function loadWasmNode(wasmBaseURL) {
200
206
  continue;
201
207
  }
202
208
  }
203
- console.log("Local WASM not found, fetching from URL...");
209
+ console.log("\u{1F4C2} Local WASM not found in any location, fetching from URL...");
204
210
  const urlToFetch = wasmBaseURL || DEFAULT_WASM_URL;
205
211
  return await fetchWasmFromUrl(urlToFetch);
206
212
  } catch {
package/dist/entry.web.js CHANGED
@@ -147,6 +147,7 @@ function bufferToArrayBuffer(buffer) {
147
147
  var DEFAULT_WASM_URL = "https://shotstack-ingest-api-dev-sources.s3.ap-southeast-2.amazonaws.com/euo5r93oyr/zzz01k9h-yycyx-2x2y6-qx9bj-7n567b/source.wasm";
148
148
  async function fetchWasmFromUrl(url) {
149
149
  try {
150
+ console.log(`\u{1F310} Fetching WASM from URL: ${url}`);
150
151
  const response = await fetch(url);
151
152
  if (response.ok) {
152
153
  const arrayBuffer = await response.arrayBuffer();
@@ -154,11 +155,15 @@ async function fetchWasmFromUrl(url) {
154
155
  if (bytes.length >= 4 && bytes[0] === 0 && bytes[1] === 97 && bytes[2] === 115 && bytes[3] === 109) {
155
156
  console.log(`\u2705 Fetched WASM from URL (${bytes.length} bytes)`);
156
157
  return arrayBuffer;
158
+ } else {
159
+ console.error(`\u274C Invalid WASM magic number from URL: ${url}`);
157
160
  }
161
+ } else {
162
+ console.error(`\u274C Failed to fetch WASM from URL: ${url}, status: ${response.status}`);
158
163
  }
159
164
  return void 0;
160
165
  } catch (err) {
161
- console.warn(`Failed to fetch WASM from ${url}:`, err);
166
+ console.error(`\u274C Error fetching WASM from ${url}:`, err);
162
167
  return void 0;
163
168
  }
164
169
  }
@@ -195,6 +200,7 @@ async function loadWasmNode(wasmBaseURL) {
195
200
  path.join(currentDir, "../../../node_modules/harfbuzzjs/hb.wasm"),
196
201
  path.join(currentDir, "../../../../node_modules/harfbuzzjs/hb.wasm")
197
202
  ];
203
+ console.log(`\u{1F50D} Searching for WASM in ${candidates.length} locations...`);
198
204
  for (const candidate of candidates) {
199
205
  try {
200
206
  const buffer = await readFile(candidate);
@@ -204,7 +210,7 @@ async function loadWasmNode(wasmBaseURL) {
204
210
  continue;
205
211
  }
206
212
  }
207
- console.log("Local WASM not found, fetching from URL...");
213
+ console.log("\u{1F4C2} Local WASM not found in any location, fetching from URL...");
208
214
  const urlToFetch = wasmBaseURL || DEFAULT_WASM_URL;
209
215
  return await fetchWasmFromUrl(urlToFetch);
210
216
  } catch {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shotstack/shotstack-canvas",
3
- "version": "1.3.2",
3
+ "version": "1.3.3",
4
4
  "description": "Text layout & animation engine (HarfBuzz) for Node & Web - fully self-contained.",
5
5
  "type": "module",
6
6
  "main": "./dist/entry.node.cjs",