Skip to content

Commit

Permalink
Revert "Removed bower"
Browse files Browse the repository at this point in the history
This reverts commit 98e20a0.
  • Loading branch information
bmispelon committed Dec 17, 2024
1 parent 98e20a0 commit 432f859
Show file tree
Hide file tree
Showing 130 changed files with 46,163 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@ locale/*/LC_MESSAGES/django.mo
.envrc
.tox
djangoproject/cache
djangoproject/static/js/lib/jquery-flot/examples
djangoproject/static/css/*.map
djangoproject/static/css/*.css
node_modules/
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ RUN apt-get update \
libpq5 \
make \
netcat-openbsd \
npm \
postgresql-client-15 \
rsync \
zlib1g \
Expand All @@ -40,6 +41,10 @@ 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
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.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 @@ -18,13 +19,21 @@ compile-scss-debug:

install:
python -m pip install --requirement requirements/dev.txt
npm install

isort:
python -m isort $(APP_LIST)

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
21 changes: 18 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Install and run locally from a virtual environment
#. Install dependencies::

python3 -m pip install -r requirements/dev.txt
npm install

Alternatively, use the make task::

Expand Down Expand Up @@ -233,9 +234,23 @@ Check out the ``Procfile`` file for all the process names.
JavaScript libraries
--------------------

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.
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.

Documentation search
--------------------
Expand Down
8 changes: 8 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "djangoproject",
"private": true,
"dependencies": {
"jquery": "<2.0",
"jquery-flot": "~0.8.3"
}
}
18 changes: 18 additions & 0 deletions djangoproject/static/js/lib/jquery-flot/.bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "Flot",
"version": "0.8.3",
"main": "jquery.flot.js",
"dependencies": {
"jquery": ">= 1.2.6"
},
"homepage": "https://github.com/flot/flot",
"_release": "0.8.3",
"_resolution": {
"type": "version",
"tag": "v0.8.3",
"commit": "453b017cc5acfd75e252b93e8635f57f4196d45d"
},
"_source": "git://github.com/flot/flot.git",
"_target": "~0.8.3",
"_originalSource": "jquery-flot"
}
3 changes: 3 additions & 0 deletions djangoproject/static/js/lib/jquery-flot/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.min.js
!excanvas.min.js
node_modules/
3 changes: 3 additions & 0 deletions djangoproject/static/js/lib/jquery-flot/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
language: node_js
node_js:
- 0.8
Loading

0 comments on commit 432f859

Please sign in to comment.