Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"description": "",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"postinstall": "(cd ./api && npm install) ; (cd ./ui && npm install) ; (cd ./upload-api && npm install)",
"env": "npm start",
"api": "cd ./api && npm run dev",
"upload": "cd ./upload-api && npm run dev",
Expand Down Expand Up @@ -44,4 +43,4 @@
"dependencies": {
"@contentstack/cli-utilities": "^1.8.4"
}
}
}
15 changes: 15 additions & 0 deletions setup-continue.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
@echo off
SET SCRIPT_DIR=%~dp0
CD /D "%SCRIPT_DIR%"

echo Using Node version:
node -v

call npm run setup:file
call npm run create:env

start "API" cmd /k "cd /d %SCRIPT_DIR%\api && npm install && npm run windev"
start "Upload API" cmd /k "cd /d %SCRIPT_DIR%\upload-api && npm install && npm run start"
start "UI" cmd /k "cd /d %SCRIPT_DIR%\ui && npm install && npm run start"

echo All services started!
52 changes: 52 additions & 0 deletions setup-nvm.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
@echo off
SETLOCAL

echo Checking if NVM is already installed...

where nvm >nul 2>nul
IF %ERRORLEVEL% EQU 0 (
echo NVM is already installed. Skipping installation.
goto run_setup
)

echo NVM not found. Checking for winget...

where winget >nul 2>nul
IF %ERRORLEVEL% EQU 0 (
echo Installing NVM using winget...
winget install -e --id CoreyButler.NVMforWindows
goto check_nvm
)

echo winget not found. Installing NVM manually...
SET NVM_URL=https://github.com/coreybutler/nvm-windows/releases/latest/download/nvm-setup.exe
SET NVM_INSTALLER=%TEMP%\nvm-setup.exe

IF EXIST "%NVM_INSTALLER%" DEL /F /Q "%NVM_INSTALLER%"

powershell -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; Invoke-WebRequest -Uri '%NVM_URL%' -OutFile '%NVM_INSTALLER%'"

IF EXIST "%NVM_INSTALLER%" (
echo Running NVM installer...
start /wait "" "%NVM_INSTALLER%"
) ELSE (
echo Failed to download NVM installer.
pause
exit /b 1
)

:check_nvm
echo Verifying NVM installation...

where nvm >nul 2>nul
IF %ERRORLEVEL% NEQ 0 (
echo NVM installation failed or not detected in PATH.
echo Please restart your terminal and try again, or install manually:
echo https://github.com/coreybutler/nvm-windows
pause
exit /b 1
)

:run_setup
echo NVM is ready. Running setup.bat...
call setup.bat
10 changes: 10 additions & 0 deletions setup.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
SETLOCAL ENABLEDELAYEDEXPANSION

SET SCRIPT_DIR=%~dp0
CD /D "%SCRIPT_DIR%"

call nvm install 21
call nvm use 21

REM Call second script in a new process to reload env
start "" cmd /k "%SCRIPT_DIR%setup-continue.bat"