Npm commands restored (using web-ext)

This commit is contained in:
Fredrik Wollsén 2018-03-02 11:23:07 +02:00 коммит произвёл Gregg Lind
Родитель 21ea464b39
Коммит b6c2f4fe3d
2 изменённых файлов: 27 добавлений и 12 удалений

Просмотреть файл

@ -10,12 +10,23 @@
# install dependencies
npm install
## build
## lint
npm run lint
## build
npm run build
## build and run
## run
npm run firefox
## run and reload on filechanges
npm run watch
# run and reload on filechanges, with a variation/branch set by preference
npm run watch -- --pref extensions.button_icon_preference.variation='kittens'
# run and reload on filechanges, with a variation/branch set by preference, with a specific Firefox installation
npm run watch -- --pref extensions.button_icon_preference.variation='kittens' -f "/Applications/Firefox Nightly.app/Contents/MacOS/firefox-bin"
```
## Details

Просмотреть файл

@ -31,7 +31,8 @@
"onchange": "^3.2.1",
"prettier": "^1.10.2",
"selenium-webdriver": "^3.5.0",
"shield-studies-addon-utils": "^4.1.0"
"shield-studies-addon-utils": "^4.1.0",
"web-ext": "^2.4.0"
},
"engines": {
"node": ">=8.9.0"
@ -49,22 +50,25 @@
"url": "git://github.com/mozilla/shield-studies-addon-template.git"
},
"scripts": {
"build": "bash ./bin/xpi.sh",
"build": "npm run web-ext -- build --overwrite-dest --artifacts-dir ./webextension/web-ext-artifacts/",
"bundle-utils": "cp node_modules/shield-studies-addon-utils/dist/StudyUtils.jsm webextension/privileged/shieldUtils/jsm/StudyUtils.jsm",
"eslint": "eslint . --ext jsm --ext js --ext json",
"eslint-fix": "npm run eslint -- --fix",
"firefox": "export XPI=dist/linked-addon.xpi && npm run build && node run-firefox.js",
"firefox": "npm run watch -- --no-reload",
"format": "prettier '**/*.{css,js,json,jsm,md}' --trailing-comma=all --ignore-path=.eslintignore --write",
"harness_test": "export XPI=dist/linked-addon.xpi && mocha test/functional_tests.js --retry 2 --reporter json",
"postformat": "npm run eslint-fix",
"harness_test": "export XPI=./webextension/web-ext-artifacts/button_icon_preference_study_shield_study_example_-2.0.0.zip && mocha test/functional_tests.js --retry 2 --reporter json",
"lint": "npm-run-all lint:*",
"lint-build:addons-linter": "# actually a post build test: bin/addonLintTest ' + require('./package.json').name",
"lint:addons-linter": "addons-linter addon/webextension/",
"lint:addons-linter": "addons-linter webextension/",
"lint:eslint": "npm run eslint",
"lint:web-ext-lint": "web-ext lint --source-dir ./webextension/",
"lint:fixpack": "fixpack",
"lint:nsp": "nsp check",
"postformat": "npm run eslint-fix",
"prebuild": "cp node_modules/shield-studies-addon-utils/dist/StudyUtils.jsm addon/",
"prebuild": "npm run bundle-utils",
"prewatch": "npm run bundle-utils",
"sign": "echo 'TBD, see: https://bugzilla.mozilla.org/show_bug.cgi?id=1407757'",
"test": "export XPI=dist/linked-addon.xpi && npm run build && mocha test/functional_tests.js --retry 2",
"watch": "onchange 'addon/**' 'package.json' 'template/**' -e addon/install.rdf -e addon/chrome.manifest -e addon/StudyUtils.jsm -- npm run build -- '{{event}} {{changed}} $(date)'"
"test": "export XPI=./webextension/web-ext-artifacts/button_icon_preference_study_shield_study_example_-2.0.0.zip && npm run build && mocha test/functional_tests.js --retry 2",
"watch": "npm run web-ext -- run --browser-console --start-url about:debugging -f nightly",
"web-ext": "web-ext --source-dir ./webextension/ --ignore-files ''"
}
}