Skip to content

Commit 3e83ba3

Browse files
refactor(tailwind,build,ci,docker): drop local Tailwind build & Node toolchain (#373)
* refactor(build,ci,docker): drop local Tailwind build & Node toolchain * Remove npm ecosystem from Dependabot, workflows and Dockerfile. * Delete package.json, tailwind.config.js and generated CSS sources. * Replace compiled CSS with Tailwind CDN plus inline component layer. * Simplify CI: eliminate frontend build job; Python-only release pipeline. * Shrink Docker image to single Python stage. * Trim .gitignore and CONTRIBUTING docs accordingly. * fix max_file_size limit * fix #375
1 parent 38c2317 commit 3e83ba3

19 files changed

+69
-1745
lines changed

.github/dependabot.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,6 @@ updates:
1010
dependency-type: "development"
1111
update-types: ["minor", "patch"]
1212

13-
# ─── Node (npm) ───────────────────────────────
14-
- package-ecosystem: "npm"
15-
directory: "/"
16-
schedule: { interval: "weekly" }
17-
labels: [ "dependencies", "npm" ]
18-
cooldown: # wait before opening PRs
19-
semver-major-days: 30
20-
semver-minor-days: 7
21-
semver-patch-days: 3
22-
2313
# ─── GitHub Actions ───────────────────────────
2414
- package-ecosystem: "github-actions"
2515
directory: "/"

.github/workflows/ci.yml

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -48,27 +48,3 @@ jobs:
4848
- name: Run pre-commit hooks
4949
uses: pre-commit/action@v3.0.1
5050
if: ${{ matrix.python-version == '3.13' && matrix.os == 'ubuntu-latest' }}
51-
52-
frontend:
53-
needs: test # Builds Tailwind CSS only if tests pass
54-
runs-on: ubuntu-latest
55-
steps:
56-
- uses: actions/checkout@v4
57-
58-
- name: Set up Node
59-
uses: actions/setup-node@v4
60-
with:
61-
node-version: 20
62-
cache: npm
63-
64-
- name: Install Node deps
65-
run: npm ci
66-
67-
- name: Build CSS
68-
run: npm run build:css # Creates src/static/css/site.css
69-
70-
- name: Upload artefact
71-
uses: actions/upload-artifact@v4
72-
with:
73-
name: static-css
74-
path: src/static/css/site.css

.github/workflows/publish.yml

Lines changed: 3 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -8,71 +8,36 @@ on:
88
permissions:
99
contents: read
1010

11-
# ── Build the Tailwind CSS bundle ───────────────────────────────
1211
jobs:
13-
frontend-build:
14-
runs-on: ubuntu-latest
15-
16-
steps:
17-
- uses: actions/checkout@v4
18-
19-
- name: Setup Node
20-
uses: actions/setup-node@v4
21-
with:
22-
node-version: 20
23-
cache: npm
24-
cache-dependency-path: package-lock.json
25-
26-
- name: Install deps + build Tailwind
27-
run: |
28-
npm ci
29-
npm run build:css
30-
31-
- name: Upload built CSS
32-
uses: actions/upload-artifact@v4
33-
with:
34-
name: frontend-assets
35-
path: src/static/css/site.css
36-
if-no-files-found: error
37-
38-
# ── Build wheel/sdist (needs CSS) and upload “dist/” ────────────
3912
release-build:
40-
needs: frontend-build
4113
runs-on: ubuntu-latest
4214

4315
steps:
4416
- uses: actions/checkout@v4
4517

46-
# Grab site.css produced above
47-
- uses: actions/download-artifact@v4
48-
with:
49-
name: frontend-assets
50-
path: src/static/css/
51-
5218
- name: Set up Python 3.13
5319
uses: actions/setup-python@v5
5420
with:
5521
python-version: "3.13"
5622
cache: pip
5723
cache-dependency-path: pyproject.toml
5824

59-
- name: Install build backend
25+
- name: Build package
6026
run: |
6127
python -m pip install --upgrade pip
6228
python -m pip install build twine
63-
python -m build
6429
twine check dist/*
6530
- name: Upload dist artefact
6631
uses: actions/upload-artifact@v4
6732
with:
6833
name: dist
6934
path: dist/
7035

71-
# ── Publish to PyPI (only if “dist/” succeeded) ─────────────────
36+
# Publish to PyPI (only if “dist/” succeeded)
7237
pypi-publish:
7338
needs: release-build
7439
runs-on: ubuntu-latest
75-
environment: pypi # Creates the “pypi” environment in repo-settings
40+
environment: pypi
7641

7742
permissions:
7843
id-token: write # OIDC token for trusted publishing

.github/workflows/scorecard.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ on:
66
push:
77
branches: [ main ]
88

9-
permissions: read-all # Default for the whole workflow
9+
permissions: read-all
1010

11-
concurrency: # (optional) avoid overlapping runs
11+
concurrency: # avoid overlapping runs
1212
group: scorecard-${{ github.ref }}
1313
cancel-in-progress: true
1414

.gitignore

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -84,31 +84,7 @@ target/
8484
profile_default/
8585
ipython_config.py
8686

87-
# pyenv
88-
# For a library or package, you might want to ignore these files since the code is
89-
# intended to run in multiple environments; otherwise, check them in:
90-
# .python-version
91-
92-
# pipenv
93-
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
94-
# However, in case of collaboration, if having platform-specific dependencies or dependencies
95-
# having no cross-platform support, pipenv may install dependencies that don't work, or not
96-
# install all needed dependencies.
97-
#Pipfile.lock
98-
99-
# poetry
100-
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
101-
# This is especially recommended for binary packages to ensure reproducibility, and is more
102-
# commonly ignored for libraries.
103-
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
104-
#poetry.lock
105-
10687
# pdm
107-
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
108-
#pdm.lock
109-
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
110-
# in version control.
111-
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
11288
.pdm.toml
11389
.pdm-python
11490
.pdm-build/
@@ -158,21 +134,13 @@ dmypy.json
158134
# Cython debug symbols
159135
cython_debug/
160136

161-
# PyCharm
162-
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
163-
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
164-
# and can be added to the global gitignore or merged into this file. For a more nuclear
165-
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
166-
#.idea/
137+
# VSCode
167138
.vscode/settings.json
168139
.DS_Store
169140

170141
# JavaScript tooling
171142
node_modules/
172143

173-
# CSS
174-
src/static/css/site.css
175-
176144
# Project specific
177145
history.txt
178146
cleanup.py

CONTRIBUTING.md

Lines changed: 6 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ If you ever get stuck, reach out on [Discord](https://discord.com/invite/zerRaGK
1717
## How to submit a Pull Request
1818

1919
> **Prerequisites**: The project uses **Python 3.9+** and `pre-commit` for development.
20-
> If you plan to touch the frontend, you'll also need **Node ≥18** (for Tailwind).
2120
2221
1. **Fork** the repository.
2322

@@ -63,22 +62,7 @@ If you ever get stuck, reach out on [Discord](https://discord.com/invite/zerRaGK
6362
pre-commit run --all-files
6463
```
6564

66-
9. **If you edited templates or CSS** rebuild Tailwind:
67-
68-
```bash
69-
# one-time install
70-
npm ci
71-
72-
# build once
73-
npm run build:css
74-
75-
# or watch & rebuild on every save
76-
npm run dev:css
77-
```
78-
79-
*Skip this step if your PR only touches Python code.*
80-
81-
10. **Run the local server** to sanity-check:
65+
9. **Run the local server** to sanity-check:
8266

8367
```bash
8468
cd src
@@ -87,30 +71,22 @@ If you ever get stuck, reach out on [Discord](https://discord.com/invite/zerRaGK
8771

8872
Open [http://localhost:8000](http://localhost:8000) to confirm everything works.
8973

90-
11. **Commit** (signed):
74+
10. **Commit** (signed):
9175

9276
```bash
9377
git commit -S -m "Your commit message"
9478
```
9579

96-
If *pre-commit* complains, fix the problems and repeat **610**.
80+
If *pre-commit* complains, fix the problems and repeat **59**.
9781

98-
12. **Push** your branch:
82+
11. **Push** your branch:
9983

10084
```bash
10185
git push origin your-branch
10286
```
10387

104-
13. **Open a pull request** on GitHub with a clear description.
88+
12. **Open a pull request** on GitHub with a clear description.
10589

106-
14. **Iterate** on any review feedback—update your branch and repeat **6 – 13** as needed.
90+
13. **Iterate** on any review feedback—update your branch and repeat **6 – 11** as needed.
10791

10892
*(Optional) Invite a maintainer to your branch for easier collaboration.*
109-
110-
---
111-
112-
## CSS & build artefacts
113-
114-
- **Do not commit `src/static/css/site.css`.** The CI pipeline runs `npm run build:css` during the container/image build, so the artefact is produced automatically.
115-
116-
- When developing locally you may run the build yourself (see step 9) so you can preview the styles.

Dockerfile

Lines changed: 18 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,42 @@
1-
# ---------- Stage 1: Build CSS with Node -------------------------
2-
FROM node:20-alpine AS css-builder
3-
WORKDIR /frontend
4-
5-
# Copy only files that affect the CSS build to leverage Docker cache
6-
COPY package*.json ./
7-
RUN npm ci
8-
9-
# Tailwind source --> final CSS
10-
# (adjust the paths if you store Tailwind input elsewhere)
11-
COPY tailwind.config.js ./ # Tailwind config
12-
COPY src/static/css/ ./src/static/css/ # Tailwind input file(s)
13-
RUN npm run build:css # writes ./src/static/css/site.css
14-
15-
16-
# ---------- Stage 2: Install Python dependencies -----------------
17-
FROM python:3.12-slim AS python-builder
1+
# Stage 1: Install Python dependencies
2+
FROM python:3.13-slim AS python-builder
183
WORKDIR /build
194

20-
# System build tools first (so later layers are cached if unchanged)
5+
# System build tools
216
RUN apt-get update \
227
&& apt-get install -y --no-install-recommends gcc python3-dev \
238
&& rm -rf /var/lib/apt/lists/*
249

25-
# Python dependencies
10+
# Metadata and code that setuptools needs
2611
COPY pyproject.toml .
12+
COPY src/ ./src/
13+
14+
15+
# Install runtime dependencies defined in pyproject.toml
2716
RUN pip install --no-cache-dir --upgrade pip \
28-
&& pip install --no-cache-dir --timeout 1000 "."
17+
&& pip install --no-cache-dir --timeout 1000 .
2918

3019

31-
# ---------- Stage 3: Final runtime image -------------------------
32-
FROM python:3.12-slim
20+
# Stage 2: Runtime image
21+
FROM python:3.13-slim
3322
LABEL org.opencontainers.image.source="https://github.com/cyclotruc/gitingest"
3423

3524
# Minimal runtime utilities
3625
RUN apt-get update \
3726
&& apt-get install -y --no-install-recommends git curl \
27+
&& apt-get clean \
3828
&& rm -rf /var/lib/apt/lists/*
3929

40-
ENV PYTHONUNBUFFERED=1 \
41-
PYTHONDONTWRITEBYTECODE=1
42-
30+
ENV PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1
4331
WORKDIR /app
44-
45-
# Create non-root user (uid 1000 == common default on Linux host)
4632
RUN useradd -m -u 1000 appuser
4733

48-
# ── Copy Python site-packages & app code ───────────────────────────
49-
COPY --from=python-builder /usr/local/lib/python3.12/site-packages/ \
50-
/usr/local/lib/python3.12/site-packages/
51-
COPY src/ ./
52-
53-
# ── Copy the freshly-built CSS ────────────────────────────────────
54-
COPY --from=css-builder /frontend/src/static/css/site.css \
55-
src/static/css/site.css
34+
# Copy Python site-packages and code
35+
COPY --from=python-builder /usr/local/lib/python3.13/site-packages/ \
36+
/usr/local/lib/python3.13/site-packages/
37+
COPY src/ ./src/
5638

57-
# Fix permissions
39+
# Set permissions
5840
RUN chown -R appuser:appuser /app
5941
USER appuser
6042

0 commit comments

Comments
 (0)