browser-extension-manager 1.2.7 → 1.2.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.
@@ -95,6 +95,11 @@ async function updateManager() {
95
95
  const isUpToDate = version.is(installedVersion, '>=', latestVersion);
96
96
  const levelDifference = version.levelDifference(installedVersion, latestVersion);
97
97
 
98
+ // Check if installedVersion is truthy or throw error
99
+ if (!installedVersion) {
100
+ throw new Error(`No installed version of ${package.name} found in devDependencies.`);
101
+ }
102
+
98
103
  // Log
99
104
  logVersionCheck(package.name, installedVersion, latestVersion, isUpToDate);
100
105
 
@@ -172,6 +177,12 @@ function setupScripts() {
172
177
  function checkLocality() {
173
178
  const installedVersion = project.devDependencies[package.name];
174
179
 
180
+ // Check if installedVersion is truthy or throw error
181
+ if (!installedVersion) {
182
+ throw new Error(`No installed version of ${package.name} found in devDependencies.`);
183
+ }
184
+
185
+ // Warn if using local version
175
186
  if (installedVersion.startsWith('file:')) {
176
187
  logger.warn(`⚠️⚠️⚠️ You are using the local version of ${package.name}. This WILL NOT WORK when published. ⚠️⚠️⚠️`);
177
188
  }
@@ -301,6 +301,65 @@ async function packageZip() {
301
301
  }
302
302
  }
303
303
 
304
+ // Create source code zip for Firefox review
305
+ async function packageSource() {
306
+ const { template } = require('node-powertools');
307
+ const os = require('os');
308
+
309
+ // Log
310
+ logger.log(`Zipping source code...`);
311
+
312
+ try {
313
+ const sourceZipPath = 'packaged/source.zip';
314
+
315
+ // Only in build mode
316
+ if (!Manager.isBuildMode()) {
317
+ logger.log(`Skipping source zip (not in build mode)`);
318
+ return;
319
+ }
320
+
321
+ // Remove existing zip if it exists
322
+ jetpack.remove(sourceZipPath);
323
+
324
+ // Get system info
325
+ const platform = os.platform();
326
+ const platformName = {
327
+ darwin: 'macOS',
328
+ win32: 'Windows',
329
+ linux: 'Linux',
330
+ }[platform] || platform;
331
+
332
+ // Read template and replace variables
333
+ const templatePath = path.join(rootPathPackage, 'dist', 'gulp', 'templates', 'BUILD_INSTRUCTIONS.md');
334
+ const templateContent = jetpack.read(templatePath);
335
+ const instructions = template(templateContent, {
336
+ system: {
337
+ platform: platformName,
338
+ release: os.release(),
339
+ arch: os.arch(),
340
+ nodeVersion: process.version,
341
+ },
342
+ });
343
+
344
+ // Write instructions to project root temporarily
345
+ const instructionsPath = path.join(process.cwd(), 'BUILD_INSTRUCTIONS.md');
346
+ jetpack.write(instructionsPath, instructions);
347
+
348
+ // Create source zip using git archive (respects .gitignore)
349
+ await execute(`git archive --format=zip --output=${sourceZipPath} HEAD`);
350
+
351
+ // Add BUILD_INSTRUCTIONS.md to the zip
352
+ await execute(`zip -u ${sourceZipPath} BUILD_INSTRUCTIONS.md`);
353
+
354
+ // Clean up temp file
355
+ jetpack.remove(instructionsPath);
356
+
357
+ logger.log(`Source code zip created at ${sourceZipPath}`);
358
+ } catch (e) {
359
+ logger.error(`Error zipping source code`, e);
360
+ }
361
+ }
362
+
304
363
  function liveReload() {
305
364
  // Log
306
365
  logger.log('Reloading live server clients...');
@@ -349,6 +408,9 @@ async function packageFn(complete) {
349
408
  // Run packageZip
350
409
  await packageZip();
351
410
 
411
+ // Run packageSource
412
+ await packageSource();
413
+
352
414
  // Run build:post hook
353
415
  await hook('build:post', index);
354
416
 
@@ -0,0 +1,47 @@
1
+ # Build Instructions
2
+
3
+ This document provides instructions for building the extension from source code.
4
+
5
+ ## System Requirements
6
+
7
+ This extension was built on the following system:
8
+ - **Operating System:** { system.platform } { system.release } ({ system.arch })
9
+ - **Node.js Version:** { system.nodeVersion }
10
+
11
+ ## Prerequisites
12
+
13
+ 1. Install Node.js { system.nodeVersion } or compatible version
14
+ 2. Install npm (comes with Node.js)
15
+
16
+ ## Build Steps
17
+
18
+ 1. Extract the source code zip
19
+ 2. Open a terminal and navigate to the extracted directory
20
+ 3. Install dependencies:
21
+ ```sh
22
+ npm install
23
+ ```
24
+ 4. Build the extension:
25
+ ```sh
26
+ npm run build
27
+ ```
28
+ 5. The built extension will be in `packaged/raw/` directory
29
+ 6. The packaged zip will be at `packaged/extension.zip`
30
+
31
+ ## Loading the Extension
32
+
33
+ ### Firefox
34
+ 1. Go to `about:debugging`
35
+ 2. Click "This Firefox"
36
+ 3. Click "Load Temporary Add-on"
37
+ 4. Select `packaged/raw/manifest.json`
38
+
39
+ ### Chrome
40
+ 1. Go to `chrome://extensions`
41
+ 2. Enable "Developer mode"
42
+ 3. Click "Load unpacked"
43
+ 4. Select the `packaged/raw/` directory
44
+
45
+ ## Questions
46
+
47
+ If you have any questions about the build process, please contact the developer.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "browser-extension-manager",
3
- "version": "1.2.7",
3
+ "version": "1.2.9",
4
4
  "description": "Browser Extension Manager dependency manager",
5
5
  "main": "dist/index.js",
6
6
  "exports": {