Bug 1343624 - Add `npm run build` as an alias of `grunt build`

Routing commands via npm/yarn is preferred, since it avoids
having to do global installs of grunt-cli, which simplifies contributor
setup, and means less effort when we switch to Yarn (since it requires
manual PATH setup for globally installed packages).
This commit is contained in:
Ed Morley 2017-03-10 16:56:11 +00:00
Родитель b12defb0cb
Коммит 21abe6ed75
5 изменённых файлов: 6 добавлений и 7 удалений

Просмотреть файл

@ -53,7 +53,7 @@ matrix:
script:
- grunt checkjs
- npm test
- ./node_modules/.bin/grunt build --production
- npm run build
# Job 3: Python Tests Chunk A
- env: python-tests-main

Просмотреть файл

@ -6,7 +6,7 @@ echo $SOURCE_VERSION > ui/revision.txt
# Create a `dist/` directory containing built/minified versions of the `ui/` assets.
# Uses the node binaries/packages installed by the nodejs buildpack previously.
./node_modules/.bin/grunt build --production
npm run build
# Generate gzipped versions of files that would benefit from compression, that
# WhiteNoise can then serve in preference to the originals. This is required
@ -32,7 +32,7 @@ set-env NEW_RELIC_PROCESS_HOST_DISPLAY_NAME '$DYNO'
# Remove nodejs files to reduce slug size (and avoid environment variable
# pollution from the nodejs profile script), since they are no longer
# required once the grunt build has run. The buildpack cache will still
# required once `npm run build` has run. The buildpack cache will still
# contain them, so this doesn't slow down the next slug compile.
rm -r .heroku/node/
rm -r .profile.d/nodejs.sh

Просмотреть файл

@ -123,7 +123,7 @@ To do this:
* Tell people to visit: ``https://<your-username>.github.io/treeherder/ui/``
There is no need to perform a ``grunt build`` prior. After switching away from the local gh-pages branch, you will need to recreate ``ui/js/config/local.conf.js`` if desired, due to the ``git add -f``.
There is no need to perform a ``npm run build`` prior. After switching away from the local gh-pages branch, you will need to recreate ``ui/js/config/local.conf.js`` if desired, due to the ``git add -f``.
Updating packages in package.json

Просмотреть файл

@ -9,10 +9,8 @@ production, a minified/built version of the UI (generated using grunt) is used i
To build the UI locally:
* Install the Grunt wrapper globally by running as root ``npm install -g grunt-cli``
(alternatively replace references to ``grunt`` with ``./node_modules/.bin/grunt``).
* Install local dependencies by running ``npm install`` from the project root.
* Run ``grunt build`` to create the ``dist`` directory.
* Run ``npm run build`` to create the ``dist`` directory.
Then to serve assets from this directory instead of ``ui/``, in the Vagrant environment
set ``SERVE_MINIFIED_UI=True`` before starting gunicorn/runserver.

Просмотреть файл

@ -44,6 +44,7 @@
"watchify": "^3.8.0"
},
"scripts": {
"build": "grunt build --production",
"test": "karma start tests/ui/config/karma.conf.js --single-run --browsers Firefox"
}
}