feat: remove bundle

breaking change in how to install lnbits

you will need to run `make build` instead of `poetry install` and it required to install nodejs for building

`make build`

remove bundle linter

make command
This commit is contained in:
dni ⚡ 2024-03-22 16:36:48 +01:00
parent 209cf7fbe0
commit ce463f2f54
No known key found for this signature in database
GPG Key ID: D1F416F29AD26E87
19 changed files with 13 additions and 113362 deletions

View File

@ -47,9 +47,3 @@ jobs:
with:
make: checkprettier
npm: true
bundle:
uses: ./.github/workflows/make.yml
with:
make: checkbundle
npm: true

4
.gitignore vendored
View File

@ -34,6 +34,10 @@ __bundle__
coverage.xml
node_modules
lnbits/static/vendor/*
lnbits/static/vendor.json
lnbits/static/bundle.min.js
lnbits/static/bundle.min.css
lnbits/static/bundle.js
lnbits/static/bundle.css
lnbits/static/bundle.min.js.old

View File

@ -2,7 +2,7 @@ FROM python:3.10-slim-bookworm AS builder
RUN apt-get clean
RUN apt-get update
RUN apt-get install -y curl pkg-config build-essential libnss-myhostname
RUN apt-get install -y curl pkg-config build-essential libnss-myhostname npm
RUN curl -sSL https://install.python-poetry.org | python3 -
ENV PATH="/root/.local/bin:$PATH"
@ -46,7 +46,7 @@ WORKDIR /app
COPY . .
COPY --from=builder /app/.venv .venv
RUN poetry install --only main
RUN make
ENV LNBITS_PORT="5000"
ENV LNBITS_HOST="0.0.0.0"

View File

@ -1,6 +1,4 @@
.PHONY: test
all: format check
build: install bundle
format: prettier black ruff
@ -112,16 +110,6 @@ bundle:
npm run vendor_bundle_js
npm run vendor_minify_js
checkbundle:
cp lnbits/static/bundle.min.js lnbits/static/bundle.min.js.old
cp lnbits/static/bundle.min.css lnbits/static/bundle.min.css.old
make bundle
diff -q lnbits/static/bundle.min.js lnbits/static/bundle.min.js.old || exit 1
diff -q lnbits/static/bundle.min.css lnbits/static/bundle.min.css.old || exit 1
@echo "Bundle is OK"
rm lnbits/static/bundle.min.js.old
rm lnbits/static/bundle.min.css.old
install-pre-commit-hook:
@echo "Installing pre-commit hook to git"
@echo "Uninstall the hook with poetry run pre-commit uninstall"

View File

@ -42,7 +42,12 @@ git checkout main
# Identify your version with python3 --version and specify in the next line
# command is only needed when your default python is not ^3.9 or ^3.10
poetry env use python3.9
poetry install --only main
# Install nodejs and npm
sudo apt-get install nodejs npm
# run poetry install, npm install and builds the frontend
make build
cp .env.example .env
# set funding source amongst other options

0
lnbits/static/vendor/.gitkeep vendored Normal file
View File

File diff suppressed because it is too large Load Diff

View File

@ -1,47 +0,0 @@
/*
* DOM element rendering detection
* https://davidwalsh.name/detect-node-insertion
*/
@keyframes chartjs-render-animation {
from { opacity: 0.99; }
to { opacity: 1; }
}
.chartjs-render-monitor {
animation: chartjs-render-animation 0.001s;
}
/*
* DOM element resizing detection
* https://github.com/marcj/css-element-queries
*/
.chartjs-size-monitor,
.chartjs-size-monitor-expand,
.chartjs-size-monitor-shrink {
position: absolute;
direction: ltr;
left: 0;
top: 0;
right: 0;
bottom: 0;
overflow: hidden;
pointer-events: none;
visibility: hidden;
z-index: -1;
}
.chartjs-size-monitor-expand > div {
position: absolute;
width: 1000000px;
height: 1000000px;
left: 0;
top: 0;
}
.chartjs-size-monitor-shrink > div {
position: absolute;
width: 200%;
height: 200%;
left: 0;
top: 0;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff