mirror of
https://github.com/langflow-ai/langflow.git
synced 2026-07-23 22:15:24 +08:00
* fix(windows): ensure psycopg async compatibility by setting WindowsSelectorEventLoopPolicy * [autofix.ci] apply automated fixes * add build only script windows * 📝 (langflow/__main__.py): add type ignore comment to suppress attribute defined error for asyncio set_event_loop_policy on Windows platform --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Cris Zanforlin <cris.zanforlin@datastax.com> Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com>
76 lines
1.9 KiB
Batchfile
76 lines
1.9 KiB
Batchfile
@echo off
|
|
echo Starting Langflow frontend build process...
|
|
|
|
REM Get the script directory and resolve project root
|
|
for %%I in ("%~dp0..\..") do set "PROJECT_ROOT=%%~fI"
|
|
|
|
echo.
|
|
echo Step 1: Installing frontend dependencies...
|
|
cd ..\..\src\frontend
|
|
if errorlevel 1 (
|
|
echo Error: Could not navigate to src\frontend directory
|
|
pause
|
|
exit /b 1
|
|
)
|
|
|
|
echo Running npm install...
|
|
call npm install
|
|
if errorlevel 1 (
|
|
echo Error: npm install failed
|
|
pause
|
|
exit /b 1
|
|
)
|
|
|
|
echo.
|
|
echo Step 2: Building frontend...
|
|
echo Running npm run build...
|
|
call npm run build
|
|
if errorlevel 1 (
|
|
echo Error: npm run build failed
|
|
pause
|
|
exit /b 1
|
|
)
|
|
|
|
echo.
|
|
echo Step 3: Copying build files to backend...
|
|
cd ..\..
|
|
|
|
REM Check if build directory exists
|
|
if not exist "src\frontend\build" (
|
|
if not exist "src\frontend\dist" (
|
|
echo Error: Neither build nor dist directory found in src\frontend
|
|
pause
|
|
exit /b 1
|
|
)
|
|
set BUILD_DIR=src\frontend\dist
|
|
) else (
|
|
set BUILD_DIR=src\frontend\build
|
|
)
|
|
|
|
echo Copying from %BUILD_DIR% to src\backend\base\langflow\frontend\
|
|
REM Create target directory if it doesn't exist
|
|
if not exist "src\backend\base\langflow\frontend" (
|
|
mkdir "src\backend\base\langflow\frontend"
|
|
)
|
|
|
|
REM Remove existing files in target directory (FORCES CLEAN REPLACEMENT)
|
|
echo Removing existing files from target directory...
|
|
if exist "src\backend\base\langflow\frontend\*" (
|
|
del /q /s "src\backend\base\langflow\frontend\*"
|
|
for /d %%d in ("src\backend\base\langflow\frontend\*") do rmdir /s /q "%%d"
|
|
)
|
|
|
|
REM Copy all files from build directory
|
|
xcopy "%BUILD_DIR%\*" "src\backend\base\langflow\frontend\" /e /i /y
|
|
if errorlevel 1 (
|
|
echo Error: Failed to copy build files
|
|
pause
|
|
exit /b 1
|
|
)
|
|
|
|
echo Build files copied successfully!
|
|
|
|
echo.
|
|
echo Frontend build process completed!
|
|
echo You can now run the backend with: uv run langflow run
|
|
pause |