browser-extension-manager 1.3.11 → 1.3.13

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.
@@ -281,9 +281,12 @@ async function publishToFirefox() {
281
281
 
282
282
  // Use web-ext sign with firefox build
283
283
  // --approval-timeout=0 to skip waiting for approval (can take minutes to hours)
284
+ // --artifacts-dir to prevent leaving web-ext-artifacts folder in project root
285
+ const artifactsDir = path.join(process.cwd(), '.temp', 'web-ext-artifacts');
284
286
  const command = [
285
287
  'npx web-ext sign',
286
288
  `--source-dir "${PATHS.firefox.raw}"`,
289
+ `--artifacts-dir "${artifactsDir}"`,
287
290
  `--api-key "${apiKey}"`,
288
291
  `--api-secret "${apiSecret}"`,
289
292
  `--channel "${channel}"`,
@@ -293,6 +296,9 @@ async function publishToFirefox() {
293
296
 
294
297
  await execute(command);
295
298
 
299
+ // Clean up artifacts dir
300
+ jetpack.remove(artifactsDir);
301
+
296
302
  logger.log('[firefox] Upload complete (approval may take time)');
297
303
  }
298
304
 
@@ -308,6 +314,26 @@ async function publishToEdge() {
308
314
  throw new Error('Missing Edge credentials. Set EDGE_PRODUCT_ID, EDGE_CLIENT_ID, EDGE_API_KEY in .env');
309
315
  }
310
316
 
317
+ // Check current submission status first
318
+ logger.log('[edge] Checking submission status...');
319
+ const statusUrl = `https://api.addons.microsoftedge.microsoft.com/v1/products/${productId}/submissions`;
320
+ const statusResponse = await fetch(statusUrl, {
321
+ method: 'GET',
322
+ headers: {
323
+ 'Authorization': `ApiKey ${apiKey}`,
324
+ 'X-ClientID': clientId,
325
+ },
326
+ });
327
+
328
+ if (statusResponse.ok) {
329
+ const statusData = await statusResponse.json();
330
+ // Check if there's a pending submission (InReview, PendingPublish, etc.)
331
+ const pendingStatuses = ['InReview', 'PendingPublish', 'Submitted', 'InProgress'];
332
+ if (statusData && pendingStatuses.includes(statusData.status)) {
333
+ throw new Error(`Extension already has a pending submission (status: ${statusData.status}). Wait for it to complete.`);
334
+ }
335
+ }
336
+
311
337
  logger.log('[edge] Uploading to Microsoft Edge Add-ons...');
312
338
 
313
339
  // Read chromium zip file (Edge uses same build as Chrome)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "browser-extension-manager",
3
- "version": "1.3.11",
3
+ "version": "1.3.13",
4
4
  "description": "Browser Extension Manager dependency manager",
5
5
  "main": "dist/index.js",
6
6
  "exports": {