chore: refactor build configurations.

This commit is contained in:
ramvignesh-b
2026-04-22 16:42:53 +05:30
parent 11b9e8b04c
commit 694715a90c
5 changed files with 47 additions and 13 deletions
+1
View File
@@ -15,6 +15,7 @@ dependencies = [
"djangorestframework-simplejwt>=5.5.1",
"djangorestframework-stubs>=3.16.9",
"freezegun>=1.5.5",
"gunicorn>=25.3.0",
"psycopg2-binary>=2.9.11",
"pyopenssl>=26.0.0",
"ruff>=0.15.9",
+23
View File
@@ -250,6 +250,18 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/5e/2e/b41d8a1a917d6581fc27a35d05561037b048e47df50f27f8ac9c7e27a710/freezegun-1.5.5-py3-none-any.whl", hash = "sha256:cd557f4a75cf074e84bc374249b9dd491eaeacd61376b9eb3c423282211619d2", size = 19266, upload-time = "2025-08-09T10:39:06.636Z" },
]
[[package]]
name = "gunicorn"
version = "25.3.0"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "packaging" },
]
sdist = { url = "https://files.pythonhosted.org/packages/c4/f4/e78fa054248fab913e2eab0332c6c2cb07421fca1ce56d8fe43b6aef57a4/gunicorn-25.3.0.tar.gz", hash = "sha256:f74e1b2f9f76f6cd1ca01198968bd2dd65830edc24b6e8e4d78de8320e2fe889", size = 634883, upload-time = "2026-03-27T00:00:26.092Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/43/c8/8aaf447698c4d59aa853fd318eed300b5c9e44459f242ab8ead6c9c09792/gunicorn-25.3.0-py3-none-any.whl", hash = "sha256:cacea387dab08cd6776501621c295a904fe8e3b7aae9a1a3cbb26f4e7ed54660", size = 208403, upload-time = "2026-03-27T00:00:27.386Z" },
]
[[package]]
name = "markupsafe"
version = "3.0.3"
@@ -280,6 +292,15 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/70/bc/6f1c2f612465f5fa89b95bead1f44dcb607670fd42891d8fdcd5d039f4f4/markupsafe-3.0.3-cp314-cp314t-win_arm64.whl", hash = "sha256:32001d6a8fc98c8cb5c947787c5d08b0a50663d139f1305bac5885d98d9b40fa", size = 14146, upload-time = "2025-09-27T18:37:28.327Z" },
]
[[package]]
name = "packaging"
version = "26.1"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/df/de/0d2b39fb4af88a0258f3bac87dfcbb48e73fbdea4a2ed0e2213f9a4c2f9a/packaging-26.1.tar.gz", hash = "sha256:f042152b681c4bfac5cae2742a55e103d27ab2ec0f3d88037136b6bfe7c9c5de", size = 215519, upload-time = "2026-04-14T21:12:49.362Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/7a/c2/920ef838e2f0028c8262f16101ec09ebd5969864e5a64c4c05fad0617c56/packaging-26.1-py3-none-any.whl", hash = "sha256:5d9c0669c6285e491e0ced2eee587eaf67b670d94a19e94e3984a481aba6802f", size = 95831, upload-time = "2026-04-14T21:12:47.56Z" },
]
[[package]]
name = "piku-backend"
version = "0.1.0"
@@ -295,6 +316,7 @@ dependencies = [
{ name = "djangorestframework-simplejwt" },
{ name = "djangorestframework-stubs" },
{ name = "freezegun" },
{ name = "gunicorn" },
{ name = "psycopg2-binary" },
{ name = "pyopenssl" },
{ name = "ruff" },
@@ -313,6 +335,7 @@ requires-dist = [
{ name = "djangorestframework-simplejwt", specifier = ">=5.5.1" },
{ name = "djangorestframework-stubs", specifier = ">=3.16.9" },
{ name = "freezegun", specifier = ">=1.5.5" },
{ name = "gunicorn", specifier = ">=25.3.0" },
{ name = "psycopg2-binary", specifier = ">=2.9.11" },
{ name = "pyopenssl", specifier = ">=26.0.0" },
{ name = "ruff", specifier = ">=0.15.9" },
+2 -1
View File
@@ -5,7 +5,8 @@
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
"build": "tsc -b & vite build",
"build:prod": "vite build --mode production",
"lint": "biome lint --write ./src",
"format": "biome format --write ./src",
"check": "biome check --write ./src",
+17 -8
View File
@@ -5,9 +5,22 @@ import react from "@vitejs/plugin-react";
import { defineConfig, loadEnv } from "vite";
import { getBaseUrl } from "./utils/url-builder";
// https://vite.dev/config/
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, "../", "");
// PROD Config
if (mode === "production") {
return {
envDir: "../",
plugins: [react(), tailwindcss()],
server: {
port: Number(env.FRONTEND_PORT),
host: env.FRONTEND_DOMAIN,
},
};
}
// DEV Config
const isSslEnabled = env.SSL_ENABLED === "true";
let sslCerts: { key: Buffer; cert: Buffer } | undefined;
@@ -20,17 +33,13 @@ export default defineConfig(({ mode }) => {
};
}
const baseApiUrl = getBaseUrl(
isSslEnabled,
env.BACKEND_DOMAIN,
env.BACKEND_PORT,
);
console.log(baseApiUrl);
return {
envDir: "../",
plugins: [react(), tailwindcss()],
define: {
"import.meta.env.VITE_API_URL": JSON.stringify(baseApiUrl),
"import.meta.env.VITE_API_URL": JSON.stringify(
getBaseUrl(isSslEnabled, env.BACKEND_DOMAIN, env.BACKEND_PORT),
),
},
server: {
port: Number(env.FRONTEND_PORT),
+4 -4
View File
@@ -5,22 +5,22 @@ pre-commit:
ruff:
root: "backend/"
glob: "*.py"
run: uv run ruff check --fix {staged_files} && uv run ruff format {staged_files}
run: export PATH="$HOME/.local/bin:$PATH" && uv run ruff check --fix {staged_files} && uv run ruff format {staged_files}
stage_fixed: true
django-check:
root: "backend/"
run: uv run manage.py check
run: export PATH="$HOME/.local/bin:$PATH" && uv run manage.py check
# Frontend: Biome (Linter + Formatter)
biome:
root: "frontend/"
glob: "**/*.{js,ts,jsx,tsx}"
run: bunx @biomejs/biome check --write --no-errors-on-unmatched {staged_files}
run: export PATH="$HOME/.bun/bin:$PATH" && bunx @biomejs/biome check --write --no-errors-on-unmatched {staged_files}
stage_fixed: true
# Frontend: TypeScript
tsc:
root: "frontend/"
glob: "**/*.ts, **/*.tsx"
run: bunx tsc --noEmit --incremental --tsBuildInfoFile --ignoreConfig .tsbuildinfo {staged_files}
run: export PATH="$HOME/.bun/bin:$PATH" && bunx tsc --noEmit --incremental --tsBuildInfoFile --ignoreConfig .tsbuildinfo {staged_files}