Skip to content

Commit

Permalink
Add ffize to make Firefox version (#100)
Browse files Browse the repository at this point in the history
`npm run ff` will build and then make a `public-ff` tree you can load
as a temporary extension in Firefox Quantum.

Also removed old files we no longer need.
  • Loading branch information
Chris White committed Dec 26, 2018
1 parent 2deb068 commit fdecec3
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 82 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ tags
foo.*

# Output directories
/public
/public*
/build*
/doc/
/dist/
Expand Down
50 changes: 0 additions & 50 deletions Makefile

This file was deleted.

20 changes: 0 additions & 20 deletions bundle.sh

This file was deleted.

25 changes: 25 additions & 0 deletions ffize.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// ffize.js: Make a Firefox manifest from the built Chrome manifest
// cxw42, 2018.

var fs = require('fs-extra');

// Copy the whole `public` tree into a fresh `public-ff`.
fs.removeSync('public-ff');
fs.copySync('public','public-ff');

// Read the Chrome manifest
var manifest = require('./public/manifest.json');

// Munge
delete manifest['version_name'];
delete manifest['offline_enabled'];
delete manifest['options_page'];
delete manifest['background']['persistent'];

var idx = manifest['permissions'].indexOf('chrome://favicon/');
if(idx > -1) {
manifest['permissions'].splice(idx,1);
}

// Write it back out
fs.writeFileSync('./public-ff/manifest.json', JSON.stringify(manifest));
50 changes: 39 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
},
"scripts": {
"build": "npx brunch build",
"ff": "sh -c 'npx brunch b ; node ffize.js'",
"rebuild": "sh -c 'rm -rf public ; npx brunch b ; find public'",
"debug": "sh -c 'LOGGY_STACKS=1 npx brunch b -d 2>&1 |less -R'",
"watch": "npx brunch watch",
Expand Down Expand Up @@ -60,6 +61,7 @@
"babel-brunch": "^7.0.0",
"benchmark": "^2.1.4",
"brunch": "cxw42/brunch#1527",
"fs-extra": "^7.0.1",
"replacer-brunch": "^1.1.1",
"sass-brunch": "^2.10.7",
"seedrandom": "^2.4.3",
Expand Down

0 comments on commit fdecec3

Please sign in to comment.