Skip to content

Commit

Permalink
feat: updated vite version (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
cofin authored Dec 8, 2024
1 parent 0556c31 commit b26d509
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 24 deletions.
20 changes: 10 additions & 10 deletions app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@

import logfire
import structlog
from advanced_alchemy.extensions.litestar import (
AlembicAsyncConfig,
AsyncSessionConfig,
SQLAlchemyAsyncConfig,
async_autocommit_handler_maker,
)
from httpx_oauth.clients.github import GitHubOAuth2
from httpx_oauth.clients.google import GoogleOAuth2
from litestar.config.compression import CompressionConfig
Expand All @@ -25,7 +19,13 @@
)
from litestar.middleware.logging import LoggingMiddlewareConfig
from litestar.middleware.session.server_side import ServerSideSessionConfig
from litestar.plugins.sqlalchemy import (
AlembicAsyncConfig,
AsyncSessionConfig,
SQLAlchemyAsyncConfig,
)
from litestar.plugins.structlog import StructlogConfig
from litestar.template import TemplateConfig
from litestar_saq import SAQConfig
from litestar_vite import ViteConfig
from litestar_vite.inertia import InertiaConfig
Expand All @@ -47,20 +47,20 @@

alchemy = SQLAlchemyAsyncConfig(
engine_instance=settings.db.get_engine(),
before_send_handler=async_autocommit_handler_maker( # note: change the session scope key if using multiple engines
commit_on_redirect=True,
),
before_send_handler="autocommit_include_redirects",
session_config=AsyncSessionConfig(expire_on_commit=False),
alembic_config=AlembicAsyncConfig(
version_table_name=settings.db.MIGRATION_DDL_VERSION_TABLE,
script_config=settings.db.MIGRATION_CONFIG,
script_location=settings.db.MIGRATION_PATH,
),
)
templates = TemplateConfig(
directory=settings.vite.TEMPLATE_DIR,
)
vite = ViteConfig(
bundle_dir=settings.vite.BUNDLE_DIR,
resource_dir=settings.vite.RESOURCE_DIR,
template_dir=settings.vite.TEMPLATE_DIR,
use_server_lifespan=settings.vite.USE_SERVER_LIFESPAN,
dev_mode=settings.vite.DEV_MODE,
hot_reload=settings.vite.HOT_RELOAD,
Expand Down
5 changes: 3 additions & 2 deletions app/server/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ def on_app_init(self, app_config: AppConfig) -> AppConfig:
app_config: The :class:`AppConfig <.config.app.AppConfig>` instance.
"""


from app import config
from app.__metadata__ import __version__ as current_version
from app.db.models import User as UserModel
Expand Down Expand Up @@ -108,6 +107,8 @@ def on_app_init(self, app_config: AppConfig) -> AppConfig:
# security
app_config.cors_config = config.cors
app_config.csrf_config = config.csrf
# templates
app_config.template_config = config.templates
# plugins
app_config.plugins.extend(
[
Expand Down Expand Up @@ -137,7 +138,7 @@ def on_app_init(self, app_config: AppConfig) -> AppConfig:
],
)
# signatures
app_config.signature_namespace.update({"UserModel": UserModel, "UUID":UUID})
app_config.signature_namespace.update({"UserModel": UserModel, "UUID": UUID})
# caching & redis
app_config.response_cache_config = ResponseCacheConfig(
default_expiration=120,
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"cmdk": "^1.0.4",
"lucide-react": "^0.468.0",
"md5": "^2.3.0",
"react-hook-form": "^7.53.2",
"react-hook-form": "^7.54.0",
"recharts": "^2.14.1",
"sonner": "^1.7.0",
"tailwind-merge": "^2.5.5",
Expand All @@ -45,7 +45,7 @@
"@vitejs/plugin-react": "^4.3.4",
"autoprefixer": "^10.4.20",
"axios": "^1.7.9",
"litestar-vite-plugin": "^0.8.2",
"litestar-vite-plugin": "^0.10.0",
"postcss": "^8.4.49",
"react": "^18.3.1",
"react-dom": "^18.3.1",
Expand Down
6 changes: 3 additions & 3 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b26d509

Please sign in to comment.