Source code

Revision control

Other Tools

1
# This file compiles to package.json scripts.
2
# When you add or modify anything, you *MUST* run:
3
# npm run yamscripts
4
# to compile your changes.
5
6
scripts:
7
# Run the activity-stream mochitests
8
mochitest: (cd $npm_package_config_mc_dir && ./mach mochitest browser/components/newtab/test/browser --headless)
9
10
# Run the activity-stream mochitests with the browser toolbox debugger.
11
# Often handy in combination with adding a "debugger" statement in your
12
# mochitest somewhere.
13
mochitest-debug: (cd $npm_package_config_mc_dir && ./mach mochitest --jsdebugger browser/components/newtab/test/browser)
14
15
# bundle: Build all assets for activity stream
16
bundle:
17
webpack: webpack --config webpack.system-addon.config.js
18
css: node-sass content-src/styles -o css
19
html: rimraf prerendered && node ./bin/render-activity-stream-html.js
20
21
# buildmc: Export code to mozilla central
22
buildmc:
23
pre: rimraf $npm_package_config_mc_dir/browser/components/newtab/
24
bundle: => bundle
25
copy: rsync --exclude-from .mcignore -a . $npm_package_config_mc_dir/browser/components/newtab/
26
copyPingCentre: cpx "ping-centre/PingCentre.jsm" $npm_package_config_mc_dir/browser/modules
27
28
# builduplift: Build and export to mozilla central for uplifts without exporting strings to browser/locales
29
builduplift:
30
pre: =>prebuildmc
31
bundle: => bundle
32
copy: =>buildmc:copy
33
34
# buildlibrary: Export about:library code to mozilla-central - intentionally not included in buildmc for now
35
buildlibrary:
36
webpack: webpack --config webpack.aboutlibrary.config.js
37
css: node-sass --source-map true --source-map-contents content-src/aboutlibrary -o aboutlibrary/content
38
copy: cpx "aboutlibrary/**/{,.}*" $npm_package_config_mc_dir/browser/components/library
39
40
# startmc: Automatically rebuild/export to mozilla central when files are changed. NOTE: Includes sourcemaps, do not use for profiling/perf testing.
41
startmc:
42
_parallel: true
43
pre: =>buildmc
44
# This copies only the system addon sub-folder; changing anything outside of it will need a full rebuild.
45
copy: cpx "{{,.}*,!(node_modules)/**/{,.}*}" $npm_package_config_mc_dir/browser/components/newtab/ -w
46
copyFluent: =>buildmc:fluentExport -- -w
47
copyPingCentre: =>buildmc:copyPingCentre -- -w
48
watch: =>watchmc
49
50
# watchmc: same as startmc, without the copy behavior which is not needed when working directly from mozilla-central
51
watchmc:
52
_parallel: true
53
webpack: =>bundle:webpack -- --env.development -w
54
css: =>bundle:css && =>bundle:css -- --source-map-embed --source-map-contents -w
55
56
# importmc: Import changes from mc to github repo
57
importmc:
58
src: rsync --exclude-from .mcignore -a $npm_package_config_mc_dir/browser/components/newtab/ .
59
60
testmc:
61
lint: =>lint
62
build: =>bundle:webpack
63
unit: karma start karma.mc.config.js
64
65
tddmc: karma start karma.mc.config.js --tdd
66
67
debugcoverage: open logs/coverage/index.html
68
69
# lint: Run eslint and sass-lint
70
lint:
71
eslint-check: eslint --cache --print-config AboutNewTabService.jsm | eslint-config-prettier-check
72
eslint: eslint --cache --ext=.js,.jsm,.jsx .
73
sasslint: sass-lint -v -q
74
75
# test: Run all tests once
76
test: =>testmc
77
78
# tdd: Run content tests continuously
79
tdd: =>tddmc
80
81
# Utility scripts for use when vendoring in Node packages
82
vendor:
83
react: node ./bin/vendor-react.js
84
85
fix:
86
# Note that since we're currently running eslint-plugin-prettier,
87
# running fix:eslint will also reformat changed JS files using prettier.
88
eslint: =>lint:eslint -- --fix