This repository has been archived by the owner on Aug 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ✨ fix packaging * switch from uglify to tercer * fix pkg versions * add brotli to dev env * fix ci * fix ci * fix ci
- Loading branch information
1 parent
f70ecfe
commit f7a1ea6
Showing
14 changed files
with
318 additions
and
232 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
FROM python:3.10.6-slim as runtime | ||
ENV PYTHONUNBUFFERED=1 \ | ||
PYTHONDONTWRITEBYTECODE=1 \ | ||
PIP_DISABLE_PIP_VERSION_CHECK=on | ||
|
||
|
||
COPY ../dist/ /app/dist | ||
RUN pip install /app/dist/*.whl | ||
RUN mkdir -p /app/docs | ||
RUN mkdir -p /app/raw | ||
WORKDIR /app | ||
COPY docs/landing.py /app/docs/landing.py | ||
COPY raw /app/raw | ||
ENTRYPOINT ["uvicorn", "docs.landing:app", "--host", "0.0.0.0", "--port", "4444"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,19 +34,20 @@ def replace_tw_message(text): | |
|
||
|
||
cdns = [ | ||
CdnInfo("https://cdn.tailwindcss.com", "tailwind", "tailwind.min.js.br"), | ||
CdnInfo("https://cdn.jsdelivr.net/npm/[email protected]/dist/full.min.css", "daisyui", "daisyui.min.css.br"), | ||
CdnInfo("https://cdn.tailwindcss.com", "tailwind", "tailwind.min.js"), | ||
CdnInfo("https://cdn.jsdelivr.net/npm/[email protected]/dist/full.min.css", "daisyui", "daisyui.min.css"), | ||
] | ||
|
||
dist_path = ASSETS_PATH / "dist" | ||
|
||
|
||
def load_deps(): | ||
print("Loading CSS dependencies...") # noqa T201 | ||
if not dist_path.exists(): | ||
dist_path.mkdir() | ||
|
||
for cdn in cdns: | ||
|
||
print(f"Fetching {cdn.name}...") # noqa T201 | ||
_text = cdn.fetch() | ||
|
||
if cdn.name == "tailwind": | ||
|
@@ -57,9 +58,16 @@ def load_deps(): | |
if output_path.exists(): | ||
output_path.unlink() | ||
|
||
with open(output_path, "wb") as f: | ||
with open(output_path, "w") as f: | ||
f.write(_text) | ||
|
||
with open(output_path.with_suffix(f"{output_path.suffix}.br"), "wb") as f: | ||
f.write(brotli.compress(_text.encode("utf-8"))) | ||
|
||
print(f"Saved {cdn.name} to {output_path}") # noqa T201 | ||
|
||
print("All CSS dependencies loaded!") # noqa T201 | ||
|
||
|
||
if __name__ == "__main__": | ||
load_deps() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.