Skip to content

Commit

Permalink
Merge pull request #33 from rik/28_remove_npm
Browse files Browse the repository at this point in the history
Remove NPM dependencies
  • Loading branch information
nanorepublica authored May 18, 2024
2 parents 110451d + 0f4c8ec commit cb9b0ca
Show file tree
Hide file tree
Showing 19 changed files with 92 additions and 3,592 deletions.
1 change: 0 additions & 1 deletion .buildpacks
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
heroku/nodejs
heroku/python
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ docker-compose.override.yml

# Node.js
node_modules

djangosocial/static/to_collect/site.css
djangosocial/.local
8 changes: 8 additions & 0 deletions bin/post_compile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

set -eo pipefail # Exit at first error, including in a pipeline
set -u # Consider unset variables as errors
set -x # Print each command before executing it

python manage.py tailwind build
python manage.py collectstatic --noinput
4 changes: 4 additions & 0 deletions djangosocial/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ RUN python -m pip install -r /tmp/requirements.txt && rm /tmp/requirements.txt

# Dev stage
FROM django-base as django-dev

# Needed so django_tailwind_cli stops the container immediately instead of after 10s
STOPSIGNAL SIGINT

COPY requirements-dev.txt /tmp/requirements.txt
RUN python -m pip install pip-tools
RUN python -m pip install -r /tmp/requirements.txt && rm /tmp/requirements.txt
Expand Down
1 change: 1 addition & 0 deletions djangosocial/requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ psycopg[binary]~=3.1.12
wagtail>=5.1.0,<6
whitenoise==6.6.0
dj-database-url==2.1.0
django-tailwind-cli
35 changes: 32 additions & 3 deletions djangosocial/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# pip-compile --generate-hashes
Expand All @@ -19,7 +19,9 @@ beautifulsoup4==4.11.2 \
certifi==2023.7.22 \
--hash=sha256:539cc1d13202e33ca466e88b2807e29f4c13049d6d87031a3c110744495cb082 \
--hash=sha256:92d6037539857d8206b8f6ae472e8b77db8058fec5937a1ef3f54304089edbb9
# via requests
# via
# django-tailwind-cli
# requests
charset-normalizer==3.3.2 \
--hash=sha256:06435b539f889b1f6f4ac1758871aae42dc3a8c0e24ac9e60c2384973ad73027 \
--hash=sha256:06a81e93cd441c56a9b65d8e1d043daeb97a3d0856d177d5c90ba85acb3db087 \
Expand Down Expand Up @@ -112,6 +114,12 @@ charset-normalizer==3.3.2 \
--hash=sha256:fd1abc0d89e30cc4e02e4064dc67fcc51bd941eb395c502aac3ec19fab46b519 \
--hash=sha256:ff8fa367d09b717b2a17a052544193ad76cd49979c805768879cb63d9ca50561
# via requests
click==8.1.7 \
--hash=sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28 \
--hash=sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de
# via
# django-typer
# typer-slim
defusedxml==0.7.1 \
--hash=sha256:1bb3032db185915b62d7c6209c5a8792be6a32ab2fedacc84e01b52c51aa3e69 \
--hash=sha256:a352e7e428770286cc899e2542b6cdaedb2b4953ff269a210103ec58f6198a61
Expand All @@ -131,7 +139,9 @@ django==4.2.6 \
# django-modelcluster
# django-permissionedforms
# django-taggit
# django-tailwind-cli
# django-treebeard
# django-typer
# djangorestframework
# wagtail
django-debug-toolbar==4.2.0 \
Expand All @@ -154,10 +164,18 @@ django-taggit==4.0.0 \
--hash=sha256:4d52de9d37245a9b9f98c0ec71fdccf1d2283e38e8866d40a7ae6a3b6787a161 \
--hash=sha256:eb800dabef5f0a4e047ab0751f82cf805bc4a9e972037ef12bf519f52cd92480
# via wagtail
django-tailwind-cli==2.12.0 \
--hash=sha256:68622807e3169c7c0b63a7e338f33030370b21888a9138e07b2ed879191a5803 \
--hash=sha256:defdda15832488127e092fd2119f734ace267131c714f46fd1a333448318e781
# via -r requirements.in
django-treebeard==4.7 \
--hash=sha256:787117995ff985d98e6c2b241ef6b9d37fe8ff7051cd7535c283616a0b5b2645 \
--hash=sha256:c751a3f924158c288fea89afc25a7151979faf01bf11fdc7be3b858099dfa56d
# via wagtail
django-typer==1.1.2 \
--hash=sha256:77166cfaafd58b101515ac0e7aeb21b7c1dd9a2bd9e76dc08962cf4683065123 \
--hash=sha256:78ada994f5bc9472435244c1bacb57730f795c56efe85cfaceda344f19723e9e
# via django-tailwind-cli
djangorestframework==3.14.0 \
--hash=sha256:579a333e6256b09489cbe0a067e66abe55c6595d8926be6b99423786334350c8 \
--hash=sha256:eb63f58c9f218e1a7d064d17a70751f528ed4e1d35547fdade9aaf4cd103fd08
Expand Down Expand Up @@ -391,6 +409,10 @@ requests==2.31.0 \
--hash=sha256:58cd2187c01e70e6e26505bca751777aa9f2ee0b7f4300988b709f44e013003f \
--hash=sha256:942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1
# via wagtail
shellingham==1.5.4 \
--hash=sha256:7ecfff8f2fd72616f7481040475a65b2bf8af90a56c89140852d1120324e8686 \
--hash=sha256:8dbca0739d487e5bd35ab3ca4b36e11c4078f3a234bfce294b0a0291363404de
# via django-typer
six==1.16.0 \
--hash=sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926 \
--hash=sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254
Expand All @@ -411,12 +433,17 @@ telepath==0.3.1 \
--hash=sha256:925c0609e0a8a6488ec4a55b19d485882cf72223b2b19fe2359a50fddd813c9c \
--hash=sha256:c280aa8e77ad71ce80e96500a4e4d4a32f35b7e0b52e896bb5fde9a5bcf0699a
# via wagtail
typer-slim==0.12.3 \
--hash=sha256:142c73d91ac1df79a49cec5a1c2210c00b1b4040a91014b539792af5ba81c65c \
--hash=sha256:633965eb413074aa6c47549d1820832f229709e9a59857a4f57ee82b655602af
# via django-typer
typing-extensions==4.8.0 \
--hash=sha256:8f92fc8806f9a6b641eaa5318da32b44d401efaac0f6678c9bc448ba3605faa0 \
--hash=sha256:df8e4339e9cb77357558cbdbceca33c303714cf861d1eef15e1070055ae8b7ef
# via
# dj-database-url
# psycopg
# typer-slim
urllib3==2.0.7 \
--hash=sha256:c97dfde1f7bd43a71c8d2a58e369e9b2bf692d1334ea9f9cae55add7d0dd0f84 \
--hash=sha256:fdb6d215c776278489906c2f8916e6e7d4f5a9b602ccbcfdf7f016fc8da0596e
Expand All @@ -436,4 +463,6 @@ whitenoise==6.6.0 \
willow[heif]==1.6.2 \
--hash=sha256:957a4af8a7733e116a65eca34da11afe3fd52ffdb397494c8823901c25863787 \
--hash=sha256:e2d0450fd78ab19052d0478b888ef163e3264e8dcd1af002dd691458db98056f
# via wagtail
# via
# wagtail
# willow
7 changes: 6 additions & 1 deletion djangosocial/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles",
"django_tailwind_cli",
"home",
"search",
"streams",
Expand Down Expand Up @@ -180,7 +181,7 @@
]

STATICFILES_DIRS = [
BASE_DIR / "static",
BASE_DIR / "static" / "to_collect",
]

# ManifestStaticFilesStorage is recommended in production, to prevent outdated
Expand Down Expand Up @@ -220,3 +221,7 @@


DEFAULT_AUTO_FIELD = "django.db.models.AutoField"

TAILWIND_CLI_SRC_CSS = 'static/to_compile/site.css'
TAILWIND_CLI_DIST_CSS = 'site.css'
TAILWIND_CLI_CONFIG_FILE = BASE_DIR / 'tailwind.config.js'
Empty file.
Loading

0 comments on commit cb9b0ca

Please sign in to comment.