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:
|
2017-07-18 21:35:22 +03:00
|
|
|
# Run the activity-stream mochitests
|
2018-07-26 22:49:43 +03:00
|
|
|
mochitest: (cd $npm_package_config_mc_dir && ./mach mochitest browser/components/newtab/test/browser --headless)
|
2017-03-16 21:17:11 +03:00
|
|
|
|
|
|
|
# Run the activity-stream mochitests with the browser toolbox debugger.
|
|
|
|
# Often handy in combination with adding a "debugger" statement in your
|
2017-07-18 21:35:22 +03:00
|
|
|
# mochitest somewhere.
|
2018-07-26 22:49:43 +03:00
|
|
|
mochitest-debug: (cd $npm_package_config_mc_dir && ./mach mochitest --jsdebugger browser/components/newtab/test/browser)
|
2017-03-04 01:09:00 +03:00
|
|
|
|
2018-05-25 18:22:21 +03:00
|
|
|
# bundle: Build all assets for activity stream
|
|
|
|
bundle:
|
2018-07-05 23:52:23 +03:00
|
|
|
webpack: webpack --config webpack.system-addon.config.js
|
2019-02-20 23:05:24 +03:00
|
|
|
css: node-sass content-src/styles -o css
|
2019-05-30 17:35:16 +03:00
|
|
|
html: rimraf prerendered && node ./bin/render-activity-stream-html.js
|
2017-07-26 01:24:14 +03:00
|
|
|
|
2019-02-20 23:05:24 +03:00
|
|
|
# buildmc: Export code to mozilla central
|
2017-03-04 01:09:00 +03:00
|
|
|
buildmc:
|
2018-07-26 22:49:43 +03:00
|
|
|
pre: rimraf $npm_package_config_mc_dir/browser/components/newtab/
|
2018-05-25 18:22:21 +03:00
|
|
|
bundle: => bundle
|
2018-07-26 22:49:43 +03:00
|
|
|
copy: rsync --exclude-from .mcignore -a . $npm_package_config_mc_dir/browser/components/newtab/
|
2019-05-30 20:59:03 +03:00
|
|
|
fluentExport: cpx "$npm_package_config_locales_dir/*.ftl" $npm_package_config_mc_dir/browser/locales/$npm_package_config_default_locale/browser/newtab/
|
2018-05-25 18:22:21 +03:00
|
|
|
copyPingCentre: cpx "ping-centre/PingCentre.jsm" $npm_package_config_mc_dir/browser/modules
|
2017-05-17 23:15:19 +03:00
|
|
|
|
2018-10-29 21:59:49 +03:00
|
|
|
# builduplift: Build and export to mozilla central for uplifts without exporting strings to browser/locales
|
|
|
|
builduplift:
|
|
|
|
pre: =>prebuildmc
|
|
|
|
bundle: => bundle
|
|
|
|
copy: =>buildmc:copy
|
|
|
|
|
2018-10-24 18:16:43 +03:00
|
|
|
# buildlibrary: Export about:library code to mozilla-central - intentionally not included in buildmc for now
|
|
|
|
buildlibrary:
|
|
|
|
webpack: webpack --config webpack.aboutlibrary.config.js
|
|
|
|
css: node-sass --source-map true --source-map-contents content-src/aboutlibrary -o aboutlibrary/content
|
|
|
|
copy: cpx "aboutlibrary/**/{,.}*" $npm_package_config_mc_dir/browser/components/library
|
|
|
|
|
2019-02-20 23:05:24 +03:00
|
|
|
# startmc: Automatically rebuild/export to mozilla central when files are changed. NOTE: Includes sourcemaps, do not use for profiling/perf testing.
|
2017-03-21 22:57:52 +03:00
|
|
|
startmc:
|
|
|
|
_parallel: true
|
2018-05-25 18:22:21 +03:00
|
|
|
pre: =>buildmc
|
|
|
|
# This copies only the system addon sub-folder; changing anything outside of it will need a full rebuild.
|
2018-07-26 22:49:43 +03:00
|
|
|
copy: cpx "{{,.}*,!(node_modules)/**/{,.}*}" $npm_package_config_mc_dir/browser/components/newtab/ -w
|
2019-05-30 20:59:03 +03:00
|
|
|
copyFluent: =>buildmc:fluentExport -- -w
|
2017-08-29 19:13:56 +03:00
|
|
|
copyPingCentre: =>buildmc:copyPingCentre -- -w
|
2019-02-20 23:05:24 +03:00
|
|
|
webpack: =>bundle:webpack -- --env.development -w
|
|
|
|
css: =>bundle:css && =>bundle:css -- --source-map-embed --source-map-contents -w
|
2017-01-26 12:56:34 +03:00
|
|
|
|
2017-03-09 20:39:43 +03:00
|
|
|
# importmc: Import changes from mc to github repo
|
2019-05-30 20:59:03 +03:00
|
|
|
importmc:
|
|
|
|
src: rsync --exclude-from .mcignore -a $npm_package_config_mc_dir/browser/components/newtab/ .
|
|
|
|
ftl: rsync -a $npm_package_config_mc_dir/browser/locales/$npm_package_config_default_locale/browser/newtab/ $npm_package_config_locales_dir
|
2017-03-09 20:39:43 +03:00
|
|
|
|
2017-03-21 22:57:52 +03:00
|
|
|
testmc:
|
2017-08-10 23:49:42 +03:00
|
|
|
lint: =>lint
|
2019-07-04 13:05:46 +03:00
|
|
|
build: =>bundle:webpack
|
2018-10-25 00:28:13 +03:00
|
|
|
unit: karma start karma.mc.config.js
|
2017-03-13 20:01:59 +03:00
|
|
|
|
2017-03-19 22:42:45 +03:00
|
|
|
tddmc: karma start karma.mc.config.js --tdd
|
2017-03-13 20:01:59 +03:00
|
|
|
|
2018-10-25 00:28:13 +03:00
|
|
|
debugcoverage: open logs/coverage/index.html
|
2017-05-04 21:23:30 +03:00
|
|
|
|
2016-09-09 22:08:06 +03:00
|
|
|
# lint: Run eslint and sass-lint
|
|
|
|
lint:
|
2019-06-26 19:56:29 +03:00
|
|
|
eslint-check: eslint --cache --print-config . | eslint-config-prettier-check
|
|
|
|
eslint: eslint --cache --ext=.js,.jsm,.jsx .
|
2017-10-22 21:37:31 +03:00
|
|
|
sasslint: sass-lint -v -q
|
2016-09-09 22:08:06 +03:00
|
|
|
|
2016-02-05 01:09:01 +03:00
|
|
|
# test: Run all tests once
|
2017-08-10 23:49:42 +03:00
|
|
|
test: =>testmc
|
2016-02-01 21:20:30 +03:00
|
|
|
|
2016-02-05 01:09:01 +03:00
|
|
|
# tdd: Run content tests continuously
|
2017-08-10 23:49:42 +03:00
|
|
|
tdd: =>tddmc
|
2016-02-04 00:22:46 +03:00
|
|
|
|
2019-02-26 19:57:29 +03:00
|
|
|
# Utility scripts for use when vendoring in Node packages
|
|
|
|
vendor:
|
|
|
|
react: node ./bin/vendor-react.js
|
2019-07-03 02:55:07 +03:00
|
|
|
|
|
|
|
fix:
|
|
|
|
# Note that since we're currently running eslint-plugin-prettier,
|
|
|
|
# running fix:eslint will also reformat changed JS files using prettier.
|
|
|
|
eslint: =>lint:eslint -- --fix
|