browser-extension-manager 1.2.7 → 1.2.8
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.
|
@@ -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.
|