yamscripts.yml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. scripts:
  6. # Run the activity-stream mochitests
  7. mochitest: (cd $npm_package_config_mc_dir && ./mach mochitest browser/components/newtab/test/browser --headless)
  8. # Run the activity-stream mochitests with the browser toolbox debugger.
  9. # Often handy in combination with adding a "debugger" statement in your
  10. # mochitest somewhere.
  11. mochitest-debug: (cd $npm_package_config_mc_dir && ./mach mochitest --jsdebugger browser/components/newtab/test/browser)
  12. # bundle: Build all assets for activity stream
  13. bundle:
  14. locales: pontoon-to-json --src $npm_package_config_locales_dir --dest data
  15. webpack: webpack --config webpack.system-addon.config.js
  16. css: node-sass content-src/styles -o css
  17. html: rimraf prerendered && node ./bin/render-activity-stream-html.js
  18. # buildmc: Export code to mozilla central
  19. buildmc:
  20. pre: rimraf $npm_package_config_mc_dir/browser/components/newtab/
  21. bundle: => bundle
  22. copy: rsync --exclude-from .mcignore -a . $npm_package_config_mc_dir/browser/components/newtab/
  23. stringsExport: cp $npm_package_config_locales_dir/$npm_package_config_default_locale/strings.properties $npm_package_config_mc_dir/browser/locales/$npm_package_config_default_locale/chrome/browser/activity-stream/newtab.properties
  24. copyPingCentre: cpx "ping-centre/PingCentre.jsm" $npm_package_config_mc_dir/browser/modules
  25. # builduplift: Build and export to mozilla central for uplifts without exporting strings to browser/locales
  26. builduplift:
  27. pre: =>prebuildmc
  28. bundle: => bundle
  29. copy: =>buildmc:copy
  30. # buildlibrary: Export about:library code to mozilla-central - intentionally not included in buildmc for now
  31. buildlibrary:
  32. webpack: webpack --config webpack.aboutlibrary.config.js
  33. css: node-sass --source-map true --source-map-contents content-src/aboutlibrary -o aboutlibrary/content
  34. copy: cpx "aboutlibrary/**/{,.}*" $npm_package_config_mc_dir/browser/components/library
  35. # startmc: Automatically rebuild/export to mozilla central when files are changed. NOTE: Includes sourcemaps, do not use for profiling/perf testing.
  36. startmc:
  37. _parallel: true
  38. pre: =>buildmc
  39. # This copies only the system addon sub-folder; changing anything outside of it will need a full rebuild.
  40. copy: cpx "{{,.}*,!(node_modules)/**/{,.}*}" $npm_package_config_mc_dir/browser/components/newtab/ -w
  41. copyPingCentre: =>buildmc:copyPingCentre -- -w
  42. webpack: =>bundle:webpack -- --env.development -w
  43. css: =>bundle:css && =>bundle:css -- --source-map-embed --source-map-contents -w
  44. # importmc: Import changes from mc to github repo
  45. importmc: rsync --exclude-from .mcignore -a $npm_package_config_mc_dir/browser/components/newtab/ .
  46. testmc:
  47. lint: =>lint
  48. build: =>bundle:webpack && =>bundle:locales
  49. unit: karma start karma.mc.config.js
  50. tddmc: karma start karma.mc.config.js --tdd
  51. debugcoverage: open logs/coverage/index.html
  52. # lint: Run eslint and sass-lint
  53. lint:
  54. eslint: eslint --ext=.js,.jsm,.jsx .
  55. sasslint: sass-lint -v -q
  56. # strings-import: Replace local strings with those from l10n-central
  57. strings-import: node ./bin/strings-import.js
  58. # test: Run all tests once
  59. test: =>testmc
  60. # tdd: Run content tests continuously
  61. tdd: =>tddmc
  62. # Utility scripts for use when vendoring in Node packages
  63. vendor:
  64. react: node ./bin/vendor-react.js