Skip to content

Commit

Permalink
Improved Bower integration.
Browse files Browse the repository at this point in the history
  • Loading branch information
xavierdutreilh authored and timgraham committed Dec 17, 2015
1 parent bfa1863 commit c37fa3c
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ djangoproject/static/css/*.css
djangoproject/static/js/lib/unveil/jquery-1.9.1.min.js
djangoproject/static/js/lib/unveil/index.html
djangoproject/static/js/lib/unveil/img
node_modules/
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ run:

install:
pip install -r requirements/dev.txt
npm install

test:
@coverage run --source=. manage.py test -v2 $(APP_LIST)
Expand All @@ -42,4 +43,4 @@ $(JQUERY_FLOT)/jquery.flot.min.js: $(JQUERY_FLOT)
yuicompressor $(JQUERY_FLOT)/jquery.flot.concat.js -o $(JQUERY_FLOT)/jquery.flot.min.js

$(JQUERY_FLOT)/:
bower install
npm run bower install
22 changes: 17 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ To run locally, do the usual:
#. Install dependencies::

pip install -r requirements/dev.txt
npm install

Alternatively use the make task::

Expand Down Expand Up @@ -207,12 +208,23 @@ Check out the ``Procfile`` file for all the process names.
JavaScript libraries
--------------------

This project uses `Bower <http://bower.io/>`_ for managing JS library
dependencies. See its documentation for how to use it. Here's the gist:
This project uses `Bower <http://bower.io/>`_ to manage JavaScript libraries.

To update any of the dependencies, edit the ``bower.json`` file accordingly
and then run ``bower install`` to download the appropriate files to the
static directory. Commit the downloaded files to git (vendoring).
At any time, you can run it to install a new library (e.g., ``jquery-ui``)::

npm run bower install jquery-ui --save

or check if there are newer versions of the libraries that we use::

npm run bower ls

If you need to update an existing library, the easiest way is to change the
version requirement in ``bower.json`` and then to run
``npm run bower install`` again.

We commit the libraries to the repository, so if you add, update, or remove a
library from ``bower.json``, you will need to commit the changes in
``djangoproject/static`` too.

Documentation search
--------------------
Expand Down
4 changes: 2 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Django Project",
"private": "true",
"name": "djangoproject",
"private": true,
"dependencies": {
"jquery": "<2.0",
"jquery.inview": "1.0.0",
Expand Down
10 changes: 10 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "djangoproject",
"private": true,
"dependencies": {
"bower": "^1.4.1"
},
"scripts": {
"bower": "bower"
}
}

0 comments on commit c37fa3c

Please sign in to comment.