67 строки
2.4 KiB
YAML
67 строки
2.4 KiB
YAML
# This file compiles to package.json scripts.
|
|
# When you add or modify anything, you *MUST* run:
|
|
# npm run yamscripts
|
|
# to compile your changes.
|
|
|
|
scripts:
|
|
|
|
# once: Build/serve the assets and run the add-on
|
|
once: =>bundle && =>firefox
|
|
|
|
clean: rimraf data/content/* && mkdirp data/content
|
|
|
|
changelog: conventional-changelog -i CHANGELOG.md -s
|
|
|
|
copyTestImages: cpx "node_modules/tippy-top-sites/images/**/*" data/content/favicons/images
|
|
|
|
copyTopSitesJson: cpx "node_modules/tippy-top-sites/top_sites.json" data/content/favicons
|
|
|
|
# bundle: Bundle assets for production
|
|
bundle:
|
|
pre: =>clean && =>copyTestImages && =>copyTopSitesJson
|
|
static: cpx "content-src/static/**/*" data/content
|
|
webpack: NODE_ENV=production webpack
|
|
webpackAddon: webpack --config webpack.addon.config.js
|
|
css: node-sass content-src/main.scss -o data/content
|
|
html: node ./bin/generate-html.js > data/content/activity-streams.html
|
|
post: du -hs ./data/content/*
|
|
|
|
# start: Start watching/compiling assets,
|
|
start:
|
|
_parallel: true
|
|
pre: =>clean && =>copyTestImages && =>copyTopSitesJson
|
|
static: =>bundle:static -- -w
|
|
webpack: webpack -w
|
|
webpackAddon: =>bundle:webpackAddon -- -w
|
|
css: =>bundle:css && =>bundle:css -- -w
|
|
html: =>bundle:html -- --baseUrl http://localhost:1963/ --csp off
|
|
server: live-server data/content --port=1963 --no-browser
|
|
|
|
# firefox: Launch addon with jpm run
|
|
firefox: =>bundle:webpackAddon && jpm run -b nightly --prefs ./dev-prefs.json
|
|
|
|
# test: Run all tests once
|
|
test:
|
|
pre: =>bundle && =>copyTestImages && =>copyTopSitesJson
|
|
# test:lint: Run eslint
|
|
lint: eslint --ext=.js,.jsx,.json . && sass-lint -v -q
|
|
checkbinary: echo "JPM_FIREFOX_BINARY: ${JPM_FIREFOX_BINARY}"
|
|
# test:jpm: Run jpm tests
|
|
jpm: jpm test -b ${JPM_FIREFOX_BINARY:-"nightly"} --prefs ./test-prefs.json -v
|
|
# test:karma: Run content tests only
|
|
karma: NODE_ENV=test karma start
|
|
post: cat logs/reports/coverage/text-summary.txt
|
|
|
|
# tdd: Run content tests continuously
|
|
tdd: =>test:karma -- --no-single-run --browsers Chrome
|
|
|
|
# package: Build add-on
|
|
package: =>bundle && jpm xpi && mv @activity-streams-$npm_package_version.xpi dist/activity-streams-$npm_package_version.xpi
|
|
|
|
# This is for ci
|
|
travis: =>test
|
|
|
|
# This is just to make sure we don't make commits with failing tests
|
|
# or uncompiled yamscripts.yml. Run automatically with husky.
|
|
prepush: =>test:lint && =>yamscripts
|