Skip to content

Commit

Permalink
Stop using bower
Browse files Browse the repository at this point in the history
`bower` is maintained but not recommended for use by its developers. Our
`bower.json` file now only includes two dependencies: `jquery` and
`jquery-flot`. At this point, `bower` is not doing much to serve the
project.

This patch makes the following primary changes:

- Remove `bower.json`
- Remove `package.json`, which only included `bower`
- Put the minified source files for `jquery` and `jquery-flot` directly
  in `static/js/lib/`
- Remove the project directories for `jquery` and `jquery-flot`.

The following smaller changes are also included:

- Remove `Makefile` rules related to `bower` and `jquery-flot`
- Update the "JavaScript libraries" section of the `README.rst`
- Remove steps related to `package.json` from  `Dockerfile`
  • Loading branch information
adamzap committed Dec 17, 2024
1 parent 260bf7d commit 1fc1b38
Show file tree
Hide file tree
Showing 129 changed files with 5 additions and 46,158 deletions.
4 changes: 0 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ RUN apt-get update \
zlib1g-dev \
&& rm -rf /var/lib/apt/lists/*

# install node dependencies
COPY ./package.json ./package.json
RUN npm install

# copy project
COPY . .

Expand Down
8 changes: 0 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.PHONY: all ci clean collectstatics compile-scss compile-scss-debug install run test watch-scss

APP_LIST ?= accounts aggregator blog contact dashboard djangoproject docs foundation fundraising legacy members releases svntogit tracdb
JQUERY_FLOT=djangoproject/static/js/lib/jquery-flot
SCSS = djangoproject/scss
STATIC = djangoproject/static

Expand All @@ -27,13 +26,6 @@ isort:
isort-check:
python -m isort --check $(APP_LIST)

$(JQUERY_FLOT)/:
npm run bower install

$(JQUERY_FLOT)/jquery.flot.min.js: $(JQUERY_FLOT)
cat $(JQUERY_FLOT)/jquery.flot.js $(JQUERY_FLOT)/jquery.flot.time.js > $(JQUERY_FLOT)/jquery.flot.concat.js
yuicompressor $(JQUERY_FLOT)/jquery.flot.concat.js -o $(JQUERY_FLOT)/jquery.flot.min.js

migrations-check:
python -m manage makemigrations --check --dry-run

Expand Down
20 changes: 3 additions & 17 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -234,23 +234,9 @@ Check out the ``Procfile`` file for all the process names.
JavaScript libraries
--------------------

This project uses `Bower <https://bower.io/>`_ to manage JavaScript libraries.

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.
This project's JavaScript libraries can be found in
``djangoproject/static/js/lib/``. If you need to add a library, commit the
minified version of it to this directory.

Documentation search
--------------------
Expand Down
8 changes: 0 additions & 8 deletions bower.json

This file was deleted.

18 changes: 0 additions & 18 deletions djangoproject/static/js/lib/jquery-flot/.bower.json

This file was deleted.

3 changes: 0 additions & 3 deletions djangoproject/static/js/lib/jquery-flot/.gitignore

This file was deleted.

3 changes: 0 additions & 3 deletions djangoproject/static/js/lib/jquery-flot/.travis.yml

This file was deleted.

Loading

0 comments on commit 1fc1b38

Please sign in to comment.