Skip to content

Commit 9cd792b

Browse files
committed
feat: implemented updated servce and CLI patterns
1 parent e26bf15 commit 9cd792b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1107
-1483
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ repos:
1111
- id: mixed-line-ending
1212
- id: trailing-whitespace
1313
- repo: https://github.com/charliermarsh/ruff-pre-commit
14-
rev: v0.9.0
14+
rev: v0.9.1
1515
hooks:
1616
- id: ruff
1717
args:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ Are you sure you you want migrate the database to the "head" revision? [y/n]: y
162162
163163
## Worker Commands
164164
165-
The following shows the commands available with the `worker` CLI command. This controls the `saq` worker processes. However, when using the `SAQ_USE_SERVER_LIFESPAN=True` environment variable, the background workers are automatically started and stopped with the Litestar HTTP server.
165+
The following shows the commands available with the `worker` CLI command. This controls the `saq` worker processes. However, when using the `SAQ_USE_SERVER_LIFESPAN=True` environment variable, the background workers are automatically started and stopped with the Litestar HTTP server.
166166
167167
```bash
168168
❯ app worker

manage.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
from __future__ import annotations
2+
3+
4+
def start_app() -> None:
5+
"""Application Management Entrypoint.
6+
7+
This is here for convenience due to its ubiquitous usage in Django.
8+
9+
This invokes the same as the `app` command (`python -m app`).
10+
"""
11+
import sys
12+
from pathlib import Path
13+
14+
current_path = Path(__file__).parent.resolve()
15+
sys.path.append(str(current_path))
16+
17+
from app.__main__ import run_cli
18+
19+
run_cli()
20+
21+
22+
if __name__ == "__main__":
23+
start_app()

package-lock.json

Lines changed: 60 additions & 59 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"react-router-dom": "^7.1.1",
3333
"sonner": "^1.7.1",
3434
"tailwind-merge": "^2.6.0",
35-
"tailwindcss-animate": "^1.0.7",
35+
"tailwindcss-animate": "^1.0.7",
3636
"zod": "^3.24.1"
3737
},
3838
"type": "module",

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ classifiers = [
1515
]
1616
dependencies = [
1717
"litestar[jinja,jwt,redis,structlog]",
18-
"advanced-alchemy[uuid]",
18+
"advanced-alchemy[uuid] @ git+https://github.com/litestar-org/advanced-alchemy.git@cli-fix",
1919
"asyncpg",
2020
"python-dotenv",
2121
"passlib[argon2]",

resources/layouts/AuthLayout.tsx

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { Helmet, HelmetProvider } from "react-helmet-async"
21
import favicon from "@/assets/favicon.png"
32
interface AuthLayoutProps {
43
children: React.ReactNode
@@ -16,16 +15,14 @@ const AuthLayout = ({
1615
keywords,
1716
}: AuthLayoutProps) => {
1817
return (
19-
<HelmetProvider context={helmetContext}>
20-
<Helmet>
21-
<meta charSet="utf-8" />
22-
<meta name="description" content={description} />
23-
<meta name="keywords" content={keywords} />
24-
<link rel="icon" type="image/x-icon" href={favicon} />
25-
<title>{title}</title>
26-
</Helmet>
18+
<>
19+
<meta charSet="utf-8" />
20+
<meta name="description" content={description} />
21+
<meta name="keywords" content={keywords} />
22+
<link rel="icon" type="image/x-icon" href={favicon} />
23+
<title>{title}</title>
2724
{children}
28-
</HelmetProvider>
25+
</>
2926
)
3027
}
3128

resources/layouts/MainLayout.tsx

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { Helmet, HelmetProvider } from "react-helmet-async"
21
import favicon from "@/assets/favicon.png"
32
interface MainLayoutProps {
43
children: React.ReactNode
@@ -7,27 +6,23 @@ interface MainLayoutProps {
76
keywords: string
87
}
98

10-
const helmetContext = {}
11-
129
const MainLayout = ({
1310
children,
1411
title,
1512
description,
1613
keywords,
1714
}: MainLayoutProps) => {
1815
return (
19-
<HelmetProvider context={helmetContext}>
20-
<Helmet>
21-
<meta charSet="utf-8" />
22-
<meta name="description" content={description} />
23-
<meta name="keywords" content={keywords} />
24-
<link rel="icon" type="image/x-icon" href={favicon} />
25-
<title>{title}</title>
26-
</Helmet>
16+
<>
17+
<meta charSet="utf-8" />
18+
<meta name="description" content={description} />
19+
<meta name="keywords" content={keywords} />
20+
<link rel="icon" type="image/x-icon" href={favicon} />
21+
<title>{title}</title>
2722
<header></header>
2823
<main>{children}</main>
2924
<footer></footer>
30-
</HelmetProvider>
25+
</>
3126
)
3227
}
3328

0 commit comments

Comments
 (0)