Bug 1596441 - Added a script to watch for changes when running/working directly in mozilla-central. r=k88hudson
authoremcminn <emcminn@mozilla.com>
Thu, 21 Nov 2019 20:44:50 +0000
changeset 503328 7e8008822534d87dca4958c0acfebd14341d40d8
parent 503327 87296e3085dde8687e265620302680b995e21537
child 503329 56a7bf9755769bbb7ab211bd7ef96375eabf873c
push id36833
push userbtara@mozilla.com
push dateFri, 22 Nov 2019 21:40:53 +0000
treeherdermozilla-central@2c912e46295e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersk88hudson
bugs1596441
milestone72.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1596441 - Added a script to watch for changes when running/working directly in mozilla-central. r=k88hudson FROM WITHIN /browser/components/newtab: `npm run watchmc` will now run bundle:webpack and bundle:css in order to watch for changes when working directly on mozilla-central. Works the same as `startmc`, without the need to copy/export changes first. to run directly from mozilla-central: `npm run watchmc --prefix browser/components/newtab`. Differential Revision: https://phabricator.services.mozilla.com/D53066
browser/components/newtab/package.json
browser/components/newtab/yamscripts.yml
--- a/browser/components/newtab/package.json
+++ b/browser/components/newtab/package.json
@@ -118,18 +118,20 @@
     "buildlibrary:webpack": "webpack --config webpack.aboutlibrary.config.js",
     "buildlibrary:css": "node-sass --source-map true --source-map-contents content-src/aboutlibrary -o aboutlibrary/content",
     "buildlibrary:copy": "cpx \"aboutlibrary/**/{,.}*\" $npm_package_config_mc_dir/browser/components/library",
     "startmc": "npm-run-all --parallel startmc:*",
     "prestartmc": "npm run buildmc",
     "startmc:copy": "cpx \"{{,.}*,!(node_modules)/**/{,.}*}\" $npm_package_config_mc_dir/browser/components/newtab/ -w",
     "startmc:copyFluent": "npm run buildmc:fluentExport -- -w",
     "startmc:copyPingCentre": "npm run buildmc:copyPingCentre -- -w",
-    "startmc:webpack": "npm run bundle:webpack -- --env.development -w",
-    "startmc:css": "npm run bundle:css && npm run bundle:css -- --source-map-embed --source-map-contents -w",
+    "startmc:watch": "npm run watchmc",
+    "watchmc": "npm-run-all --parallel watchmc:*",
+    "watchmc:webpack": "npm run bundle:webpack -- --env.development -w",
+    "watchmc:css": "npm run bundle:css && npm run bundle:css -- --source-map-embed --source-map-contents -w",
     "importmc": "npm-run-all importmc:*",
     "importmc:src": "rsync --exclude-from .mcignore -a $npm_package_config_mc_dir/browser/components/newtab/ .",
     "importmc:ftl": "rsync -a $npm_package_config_mc_dir/browser/locales/$npm_package_config_default_locale/browser/newtab/ $npm_package_config_locales_dir",
     "testmc": "npm-run-all testmc:*",
     "testmc:lint": "npm run lint",
     "testmc:build": "npm run bundle:webpack",
     "testmc:unit": "karma start karma.mc.config.js",
     "tddmc": "karma start karma.mc.config.js --tdd",
--- a/browser/components/newtab/yamscripts.yml
+++ b/browser/components/newtab/yamscripts.yml
@@ -41,16 +41,21 @@ scripts:
 # startmc: Automatically rebuild/export to mozilla central when files are changed. NOTE: Includes sourcemaps, do not use for profiling/perf testing.
   startmc:
     _parallel: true
     pre: =>buildmc
     # This copies only the system addon sub-folder; changing anything outside of it will need a full rebuild.
     copy: cpx "{{,.}*,!(node_modules)/**/{,.}*}" $npm_package_config_mc_dir/browser/components/newtab/ -w
     copyFluent: =>buildmc:fluentExport -- -w
     copyPingCentre: =>buildmc:copyPingCentre -- -w
+    watch: =>watchmc
+    
+# watchmc: same as startmc, without the copy behavior which is not needed when working directly from mozilla-central
+  watchmc: 
+    _parallel: true
     webpack: =>bundle:webpack -- --env.development -w
     css: =>bundle:css && =>bundle:css -- --source-map-embed --source-map-contents -w
 
   # importmc: Import changes from mc to github repo
   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