-
Notifications
You must be signed in to change notification settings - Fork 325
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #416 from ipfs-shipyard/feat/custom-build-targets
Support vendor-specific manifest.json
- Loading branch information
Showing
10 changed files
with
74 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,4 @@ add-on/dist | |
coverage | ||
.nyc_output | ||
add-on/ui-kit/**/* | ||
add-on/manifest.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,12 +11,6 @@ | |
"38": "icons/png/ipfs-logo-on_38.png", | ||
"128": "icons/png/ipfs-logo-on_128.png" | ||
}, | ||
"applications": { | ||
"gecko": { | ||
"id": "[email protected]", | ||
"strict_min_version": "58.0" | ||
} | ||
}, | ||
"permissions": [ | ||
"<all_urls>", | ||
"idle", | ||
|
@@ -35,7 +29,6 @@ | |
"page": "dist/background/background.html" | ||
}, | ||
"browser_action": { | ||
"browser_style": false, | ||
"default_icon": { | ||
"19": "icons/png/ipfs-logo-off_19.png", | ||
"38": "icons/png/ipfs-logo-off_38.png", | ||
|
@@ -45,7 +38,6 @@ | |
"default_popup": "dist/popup/browser-action/index.html" | ||
}, | ||
"options_ui": { | ||
"browser_style": false, | ||
"page": "dist/options/options.html" | ||
}, | ||
"web_accessible_resources": [ | ||
|
@@ -64,23 +56,6 @@ | |
"run_at": "document_start" | ||
} | ||
], | ||
"protocol_handlers": [ | ||
{ | ||
"protocol": "web+dweb", | ||
"name": "IPFS Add-On: DWEB protocol handler", | ||
"uriTemplate": "https://ipfs.io/%s" | ||
}, | ||
{ | ||
"protocol": "web+ipns", | ||
"name": "IPFS Add-On: IPNS protocol handler", | ||
"uriTemplate": "https://ipfs.io/%s" | ||
}, | ||
{ | ||
"protocol": "web+ipfs", | ||
"name": "IPFS Add-On: IPFS protocol handler", | ||
"uriTemplate": "https://ipfs.io/%s" | ||
} | ||
], | ||
"content_security_policy": "script-src 'self'; object-src 'self'; frame-src 'self';", | ||
"default_locale": "en" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"applications": { | ||
"gecko": { | ||
"id": "[email protected]", | ||
"update_url": "https://ipfs-shipyard.github.io/ipfs-companion/ci/firefox/update.json" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"browser_action": { | ||
"browser_style": false | ||
}, | ||
"options_ui": { | ||
"browser_style": false | ||
}, | ||
"applications": { | ||
"gecko": { | ||
"id": "[email protected]", | ||
"strict_min_version": "58.0" | ||
} | ||
}, | ||
"protocol_handlers": [ | ||
{ | ||
"protocol": "web+dweb", | ||
"name": "IPFS Add-On: DWEB protocol handler", | ||
"uriTemplate": "https://ipfs.io/%s" | ||
}, | ||
{ | ||
"protocol": "web+ipns", | ||
"name": "IPFS Add-On: IPNS protocol handler", | ||
"uriTemplate": "https://ipfs.io/%s" | ||
}, | ||
{ | ||
"protocol": "web+ipfs", | ||
"name": "IPFS Add-On: IPFS protocol handler", | ||
"uriTemplate": "https://ipfs.io/%s" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
# to explicitly state that produced artifact is a dev build. | ||
set -e | ||
|
||
MANIFEST=add-on/manifest.json | ||
MANIFEST=add-on/manifest.common.json | ||
|
||
# restore original (make this script immutable) | ||
git checkout $MANIFEST | ||
|
@@ -28,19 +28,3 @@ NEW_COMMITS_IN_CURRENT_BRANCH=$(git rev-list --count HEAD ^refs/remotes/origin/m | |
BUILD_VERSION=$(($COMMITS_IN_MASTER*10+$NEW_COMMITS_IN_CURRENT_BRANCH)) | ||
set-manifest ".version = (.version + \".${BUILD_VERSION}\")" | ||
grep \"version\" $MANIFEST | ||
|
||
# addon-linter throws error on 'update_url' so it is disabled in dev build | ||
# and needs to be manually opted-in when beta build is run | ||
if [ "$1" == "firefox-beta" ]; then | ||
# Switch to self-hosted dev-build for Firefox (https://github.com/ipfs-shipyard/ipfs-companion/issues/385) | ||
DEV_BUILD_ADDON_ID="[email protected]" | ||
UPDATE_URL="https://ipfs-shipyard.github.io/ipfs-companion/ci/firefox/update.json" | ||
|
||
## Set ADD-ON ID | ||
set-manifest ".applications.gecko[\"id\"] = \"$DEV_BUILD_ADDON_ID\"" | ||
grep ipfs-companion-dev-build $MANIFEST | ||
|
||
## Add UPDATE_URL | ||
set-manifest ".applications.gecko[\"update_url\"] = \"$UPDATE_URL\"" | ||
grep update_url $MANIFEST | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,11 @@ | |
"build:content-scripts:ipfs-proxy:content": "browserify -p prundupify -g uglifyify -t brfs -t [ browserify-package-json --global ] -s IpfsProxyContent add-on/src/contentScripts/ipfs-proxy/content.js -o add-on/dist/contentScripts/ipfs-proxy/content.js", | ||
"build:content-scripts:ipfs-proxy:cleanup": "shx rm add-on/dist/contentScripts/ipfs-proxy/page.js", | ||
"build:minimize-dist": "shx rm -rf add-on/dist/lib", | ||
"build:bundle-extension": "web-ext build -s add-on/ -i src/ -a build/", | ||
"build:bundle-all": "run-s bundle:generic bundle:firefox", | ||
"bundle": "run-s bundle:*", | ||
"bundle:generic": "shx cp add-on/manifest.common.json add-on/manifest.json && web-ext build -a build/generic", | ||
"bundle:firefox": "shx cat add-on/manifest.common.json add-on/manifest.firefox.json | json --deep-merge > add-on/manifest.json && web-ext build -a build/firefox/", | ||
"bundle:firefox:beta": "shx cat add-on/manifest.common.json add-on/manifest.firefox.json add-on/manifest.firefox-beta.json | json --deep-merge > add-on/manifest.json && web-ext build -a build/firefox/beta/", | ||
"watch": "npm-run-all build:copy --parallel watch:*", | ||
"watch:js": "watchify -p prundupify -t [ browserify-package-json --global ] add-on/src/background/background.js add-on/src/options/options.js add-on/src/popup/browser-action/index.js add-on/src/popup/quick-upload.js add-on/src/pages/proxy-acl/index.js add-on/src/pages/proxy-access-dialog/index.js -p [ factor-bundle -o add-on/dist/background/background.js -o add-on/dist/options/options.js -o add-on/dist/popup/browser-action/browser-action.js -o add-on/dist/popup/quick-upload.js -o add-on/dist/pages/proxy-acl/proxy-acl.js -o add-on/dist/pages/proxy-access-dialog/proxy-access-dialog.js ] -o add-on/dist/ipfs-companion-common.js -v", | ||
"watch:content-scripts": "run-p watch:content-scripts:*", | ||
|
@@ -38,12 +42,12 @@ | |
"test:functional": " nyc --reporter=lcov --reporter=text mocha --timeout 15000 --require ignore-styles --reporter mocha-jenkins-reporter 'test/functional/**/*.test.js'", | ||
"lint": "run-s lint:*", | ||
"lint:standard": "standard -v \"add-on/src/**/*.js\" \"test/**/*.js\"", | ||
"lint:web-ext": "web-ext lint -s add-on/ -i src/", | ||
"lint:web-ext": "web-ext lint", | ||
"fix:lint": "run-s fix:lint:*", | ||
"fix:lint:standard": "standard -v --fix \"add-on/src/**/*.js\" \"test/**/*.js\"", | ||
"precommit": "run-s lint:standard", | ||
"prepush": "run-s clean build lint test", | ||
"firefox": "web-ext run -s add-on/ --browser-console", | ||
"firefox": "web-ext run --browser-console", | ||
"ci": "run-s ci:*", | ||
"ci:install": "npx [email protected] install --frozen-lockfile || npx [email protected] install --frozen-lockfile", | ||
"ci:test": "npx [email protected] test", | ||
|
@@ -64,6 +68,7 @@ | |
"geckodriver": "1.10.0", | ||
"husky": "0.14.3", | ||
"ignore-styles": "5.0.1", | ||
"json": "9.0.6", | ||
"mem-storage-area": "1.0.3", | ||
"mocha": "5.0.1", | ||
"mocha-jenkins-reporter": "0.3.10", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Getting_started_with_web-ext | ||
module.exports = { | ||
// Global options: | ||
verbose: false, | ||
artifactsDir: 'build/', | ||
sourceDir: 'add-on/', | ||
ignoreFiles: [ | ||
'src/', | ||
'manifest.*.json', | ||
], | ||
// Command options: | ||
build: { | ||
overwriteDest: true, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4907,6 +4907,10 @@ json5@^0.5.0, json5@^0.5.1: | |
version "0.5.1" | ||
resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" | ||
|
||
[email protected]: | ||
version "9.0.6" | ||
resolved "https://registry.yarnpkg.com/json/-/json-9.0.6.tgz#7972c2a5a48a42678db2730c7c2c4ee6e4e24585" | ||
|
||
jsonfile@^2.1.0: | ||
version "2.4.0" | ||
resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8" | ||
|