2016-02-01 21:20:30 +03:00
|
|
|
# This file compiles to package.json scripts.
|
2016-02-02 23:06:31 +03:00
|
|
|
# When you add or modify anything, you *MUST* run:
|
|
|
|
# npm run yamscripts
|
|
|
|
# to compile your changes.
|
2016-02-01 20:55:40 +03:00
|
|
|
|
2016-02-01 21:20:30 +03:00
|
|
|
scripts:
|
2016-02-02 23:06:31 +03:00
|
|
|
|
2016-02-09 22:56:20 +03:00
|
|
|
# once: Build/serve the assets and run the add-on
|
2016-02-24 02:11:33 +03:00
|
|
|
once: =>bundle && =>firefox
|
2016-02-09 22:56:20 +03:00
|
|
|
|
2016-05-05 19:41:43 +03:00
|
|
|
clean: rimraf data/content/* && mkdirp data/content
|
2016-02-11 17:29:57 +03:00
|
|
|
|
2016-02-18 19:59:56 +03:00
|
|
|
changelog: conventional-changelog -i CHANGELOG.md -s
|
|
|
|
|
2016-04-02 17:06:59 +03:00
|
|
|
copyTestImages: cpx "node_modules/tippy-top-sites/images/**/*" data/content/favicons/images
|
|
|
|
|
2016-05-02 23:08:19 +03:00
|
|
|
copyTopSitesJson: cpx "node_modules/tippy-top-sites/top_sites.json" data/content/favicons
|
|
|
|
|
2016-02-02 23:06:31 +03:00
|
|
|
# bundle: Bundle assets for production
|
|
|
|
bundle:
|
2016-05-02 23:08:19 +03:00
|
|
|
pre: =>clean && =>copyTestImages && =>copyTopSitesJson
|
2016-02-11 17:29:57 +03:00
|
|
|
static: cpx "content-src/static/**/*" data/content
|
2016-03-02 01:11:54 +03:00
|
|
|
webpack: NODE_ENV=production webpack
|
2016-05-31 20:10:00 +03:00
|
|
|
webpackAddon: webpack --config webpack.addon.config.js
|
2016-02-05 00:48:40 +03:00
|
|
|
css: node-sass content-src/main.scss -o data/content
|
2016-02-11 17:29:57 +03:00
|
|
|
html: node ./bin/generate-html.js > data/content/activity-streams.html
|
2016-03-02 01:11:54 +03:00
|
|
|
post: du -hs ./data/content/*
|
2016-02-02 23:06:31 +03:00
|
|
|
|
2016-02-01 20:55:40 +03:00
|
|
|
# start: Start watching/compiling assets,
|
|
|
|
start:
|
|
|
|
_parallel: true
|
2016-05-02 23:08:19 +03:00
|
|
|
pre: =>clean && =>copyTestImages && =>copyTopSitesJson
|
2016-02-05 00:38:28 +03:00
|
|
|
static: =>bundle:static -- -w
|
2016-02-01 21:20:30 +03:00
|
|
|
webpack: webpack -w
|
2016-05-31 20:10:00 +03:00
|
|
|
webpackAddon: =>bundle:webpackAddon -- -w
|
2016-02-02 23:06:31 +03:00
|
|
|
css: =>bundle:css && =>bundle:css -- -w
|
2016-04-27 21:24:06 +03:00
|
|
|
html: =>bundle:html -- --baseUrl http://localhost:1963/ --csp off
|
2016-02-01 21:20:30 +03:00
|
|
|
server: live-server data/content --port=1963 --no-browser
|
2016-02-01 20:55:40 +03:00
|
|
|
|
2016-02-02 23:06:31 +03:00
|
|
|
# firefox: Launch addon with jpm run
|
2016-08-04 23:55:08 +03:00
|
|
|
firefox: =>bundle:webpackAddon && jpm run -b nightly --prefs ./dev-prefs.json
|
2016-02-01 20:55:40 +03:00
|
|
|
|
2016-02-05 01:09:01 +03:00
|
|
|
# test: Run all tests once
|
2016-02-01 20:55:40 +03:00
|
|
|
test:
|
2016-05-02 23:08:19 +03:00
|
|
|
pre: =>bundle && =>copyTestImages && =>copyTopSitesJson
|
2016-02-05 01:09:01 +03:00
|
|
|
# test:lint: Run eslint
|
2016-08-05 01:49:02 +03:00
|
|
|
lint: eslint --ext=.js,.jsx,.json . && sass-lint -v -q
|
2016-04-22 22:35:41 +03:00
|
|
|
checkbinary: echo "JPM_FIREFOX_BINARY: ${JPM_FIREFOX_BINARY}"
|
2016-02-05 01:09:01 +03:00
|
|
|
# test:jpm: Run jpm tests
|
2016-08-04 23:55:08 +03:00
|
|
|
jpm: jpm test -b ${JPM_FIREFOX_BINARY:-"nightly"} --prefs ./test-prefs.json -v
|
2016-02-05 01:09:01 +03:00
|
|
|
# test:karma: Run content tests only
|
2016-04-22 22:35:41 +03:00
|
|
|
karma: NODE_ENV=test karma start
|
|
|
|
post: cat logs/reports/coverage/text-summary.txt
|
2016-02-01 21:20:30 +03:00
|
|
|
|
2016-02-05 01:09:01 +03:00
|
|
|
# tdd: Run content tests continuously
|
2016-04-26 22:40:55 +03:00
|
|
|
tdd: =>test:karma -- --no-single-run --browsers Chrome
|
2016-02-04 00:22:46 +03:00
|
|
|
|
2016-02-01 21:20:30 +03:00
|
|
|
# package: Build add-on
|
2016-02-24 02:14:50 +03:00
|
|
|
package: =>bundle && jpm xpi && mv @activity-streams-$npm_package_version.xpi dist/activity-streams-$npm_package_version.xpi
|
2016-02-01 21:20:30 +03:00
|
|
|
|
2016-02-05 01:09:01 +03:00
|
|
|
# This is for ci
|
2016-04-22 22:35:41 +03:00
|
|
|
travis: =>test
|
2016-02-01 21:20:30 +03:00
|
|
|
|
2016-02-05 01:09:01 +03:00
|
|
|
# This is just to make sure we don't make commits with failing tests
|
|
|
|
# or uncompiled yamscripts.yml. Run automatically with husky.
|
2016-06-28 20:18:35 +03:00
|
|
|
prepush: =>test:lint && =>yamscripts
|