diff --git a/README.md b/README.md index a9b30a34..3c7f4e38 100644 --- a/README.md +++ b/README.md @@ -1,157 +1,177 @@ -# Vix.cpp - -

- Vix.cpp Banner + + + ---- + + +
+ +

Vix.cpp

+ +

+ + + + + +

-

Vix.cpp

+

Build real applications with modern C++.

-

- ⚡ Offline-first · Peer-to-peer · Ultra-fast C++ runtime +

+ Vix.cpp is a modern C++ runtime for building fast, reliable, production-ready applications.

-

- - - - - - - - +

+ Website · + Docs · + Registry · + Engineering notes

-

-⭐ If this vision resonates with you, consider starring the project. -

+
-## What is Vix.cpp? + -**Vix.cpp** is a modern **C++ runtime** designed as a serious alternative to **Node.js, Deno, and Bun** -but engineered **from day one** for: +
-- unstable networks -- offline-first environments -- peer-to-peer systems -- extreme native performance +Vix.cpp removes friction from C++ application development. +It gives C++ a modern application workflow while keeping native performance, explicit control, and production-oriented architecture. -> **Run applications like Node/Deno/Bun -> with C++ speed, control, and predictability.** +Vix is not just a web framework. +It is a runtime foundation for backend services, AI agents, games, P2P systems, local-first applications, fast builds, templates, and production-ready C++ projects. -Vix is not just a backend framework. -It is a **runtime layer** for real-world distributed systems. +## Install ---- +Shell, Linux and macOS: -## Who is Vix.cpp for? +```bash +curl -fsSL https://vixcpp.com/install.sh | bash +``` -Vix.cpp is built for developers who: +PowerShell, Windows: -- Build backend systems in **modern C++** -- Need **predictable performance** (no GC pauses) -- Target **offline-first or unreliable networks** -- Work on **edge, local, or P2P systems** -- Want a **Node/Deno-like DX**, but native +```powershell +irm https://vixcpp.com/install.ps1 | iex +``` -If you’ve ever thought _“I wish Node was faster and more reliable”_ -Vix is for you. +More installation options: ---- +https://vixcpp.com/install -## Why Vix exists +## Quick start -Most modern runtimes assume: +Create `server.cpp`: -- stable internet -- cloud-first infrastructure -- predictable latency -- always-online connectivity +```cpp +#include +using namespace vix; -That is **not reality** for much of the world. +int main() +{ + vix::App app; -**Vix.cpp is built for real conditions first.** + app.get("/", [](Request &req, Response &res) { + res.send("Hello from Vix.cpp"); + }); ---- + app.run(8080); -## Performance is not a feature it’s a requirement + return 0; +} +``` -Vix.cpp is designed to remove overhead, unpredictability, and GC pauses. +Run it: -### ⚡ Benchmarks (Dec 2025) +```bash +vix run server.cpp +``` -| Framework | Requests/sec | Avg Latency | -| --------------------------- | ------------ | ----------- | -| ⭐ **Vix.cpp (pinned CPU)** | **~99,000** | 7–10 ms | -| Vix.cpp (default) | ~81,400 | 9–11 ms | -| Go (Fiber) | ~81,300 | ~0.6 ms | -| Deno | ~48,800 | ~16 ms | -| Node.js (Fastify) | ~4,200 | ~16 ms | -| PHP (Slim) | ~2,800 | ~17 ms | -| FastAPI (Python) | ~750 | ~64 ms | +Open: ---- +```text +http://localhost:8080 +``` -## It really is this simple +## Why Vix.cpp ? + +C++ is powerful, but building real applications often means rebuilding the same foundation again and again. + +Vix gives you that foundation: + +- run C++ files with `vix run` +- create projects with `vix new` +- build fast with `vix build` +- build backend services +- build WebSocket applications +- build P2P systems +- build AI agents +- build game-oriented projects +- use threadpool and async runtime modules +- use KV, cache, database, ORM, middleware, crypto, validation, and template modules +- generate production-ready backend projects +- integrate backend projects with frontend apps such as Vue.js + +## Runtime modules + +```text +agent async cache cli conversion +core crypto db env error +fs game io json kv +log middleware net orm os +p2p p2p_http path process reply +sync template tests threadpool time +utils validation webrpc websocket +``` -```cpp -#include +Vix.cpp is designed as an application runtime layer, not only as an HTTP server. -int main() { - vix::App app; +## Built with Vix.cpp - app.get("/", [](Request&, Response& res){ - res.send("Hello from Vix.cpp 🚀"); - }); +### Kordex - app.run(8080); -} -``` +A JavaScript and TypeScript runtime layer built on Vix and Softadastra. ---- +https://github.com/softadastra/kordex -## Script mode Run C++ like a script +### Softadastra -```bash -vix run main.cpp -vix dev main.cpp -``` +A local-first and offline-first runtime foundation for reliable applications. + +https://github.com/softadastra/softadastra + +### PulseGrid + +Real-time service monitoring built with Vix.cpp. + +https://github.com/softadastra/PulseGrid + +### Vix Game ---- +Game-oriented project built on the Vix.cpp runtime foundation. -## Documentation +https://github.com/vixcpp/vix-game -- [Introduction](docs/introduction.md) -- [Quick Start](docs/quick-start.md) -- [Architecture & Modules](docs/architecture.md) -- [ORM Overview](docs/orm/overview.md) -- [Benchmarks](docs/benchmarks.md) -- [Examples](docs/examples/overview.md) -- [Build & Installation](docs/build.md) -- [CLI Options](docs/options.md) -- [CLI Reference](docs/vix-cli-help.md) +## Links -## Module Documentation Index +- Documentation: https://docs.vixcpp.com +- Registry: https://registry.vixcpp.com +- Engineering notes: https://blog.vixcpp.com +- Website: https://vixcpp.com -- **Core** : [docs/modules/core.md](docs/modules/core.md) -- **WebSocket** : [docs/modules/websocket.md](docs/modules/websocket.md) -- **ORM** : [docs/modules/orm.md](docs/modules/orm.md) -- **JSON** : [docs/modules/json.md](docs/modules/json.md) -- **Utils** : [docs/modules/utils.md](docs/modules/utils.md) -- **CLI** : [docs/modules/cli.md](docs/modules/cli.md) +## Contributing ---- +Contributions are welcome. -## ⭐ Support the project +Read the contribution guide: -If you believe in modern C++ tooling, offline-first systems, and native performance, -please consider starring the repository. +https://docs.vixcpp.com/contributing -MIT License +## License +MIT License. diff --git a/vix-site/README.md b/vix-site/README.md index a9b30a34..3c7f4e38 100644 --- a/vix-site/README.md +++ b/vix-site/README.md @@ -1,157 +1,177 @@ -# Vix.cpp - -

- Vix.cpp Banner + + + ---- + + +
+ +

Vix.cpp

+ +

+ + + + + +

-

Vix.cpp

+

Build real applications with modern C++.

-

- ⚡ Offline-first · Peer-to-peer · Ultra-fast C++ runtime +

+ Vix.cpp is a modern C++ runtime for building fast, reliable, production-ready applications.

-

- - - - - - - - +

+ Website · + Docs · + Registry · + Engineering notes

-

-⭐ If this vision resonates with you, consider starring the project. -

+
-## What is Vix.cpp? + -**Vix.cpp** is a modern **C++ runtime** designed as a serious alternative to **Node.js, Deno, and Bun** -but engineered **from day one** for: +
-- unstable networks -- offline-first environments -- peer-to-peer systems -- extreme native performance +Vix.cpp removes friction from C++ application development. +It gives C++ a modern application workflow while keeping native performance, explicit control, and production-oriented architecture. -> **Run applications like Node/Deno/Bun -> with C++ speed, control, and predictability.** +Vix is not just a web framework. +It is a runtime foundation for backend services, AI agents, games, P2P systems, local-first applications, fast builds, templates, and production-ready C++ projects. -Vix is not just a backend framework. -It is a **runtime layer** for real-world distributed systems. +## Install ---- +Shell, Linux and macOS: -## Who is Vix.cpp for? +```bash +curl -fsSL https://vixcpp.com/install.sh | bash +``` -Vix.cpp is built for developers who: +PowerShell, Windows: -- Build backend systems in **modern C++** -- Need **predictable performance** (no GC pauses) -- Target **offline-first or unreliable networks** -- Work on **edge, local, or P2P systems** -- Want a **Node/Deno-like DX**, but native +```powershell +irm https://vixcpp.com/install.ps1 | iex +``` -If you’ve ever thought _“I wish Node was faster and more reliable”_ -Vix is for you. +More installation options: ---- +https://vixcpp.com/install -## Why Vix exists +## Quick start -Most modern runtimes assume: +Create `server.cpp`: -- stable internet -- cloud-first infrastructure -- predictable latency -- always-online connectivity +```cpp +#include +using namespace vix; -That is **not reality** for much of the world. +int main() +{ + vix::App app; -**Vix.cpp is built for real conditions first.** + app.get("/", [](Request &req, Response &res) { + res.send("Hello from Vix.cpp"); + }); ---- + app.run(8080); -## Performance is not a feature it’s a requirement + return 0; +} +``` -Vix.cpp is designed to remove overhead, unpredictability, and GC pauses. +Run it: -### ⚡ Benchmarks (Dec 2025) +```bash +vix run server.cpp +``` -| Framework | Requests/sec | Avg Latency | -| --------------------------- | ------------ | ----------- | -| ⭐ **Vix.cpp (pinned CPU)** | **~99,000** | 7–10 ms | -| Vix.cpp (default) | ~81,400 | 9–11 ms | -| Go (Fiber) | ~81,300 | ~0.6 ms | -| Deno | ~48,800 | ~16 ms | -| Node.js (Fastify) | ~4,200 | ~16 ms | -| PHP (Slim) | ~2,800 | ~17 ms | -| FastAPI (Python) | ~750 | ~64 ms | +Open: ---- +```text +http://localhost:8080 +``` -## It really is this simple +## Why Vix.cpp ? + +C++ is powerful, but building real applications often means rebuilding the same foundation again and again. + +Vix gives you that foundation: + +- run C++ files with `vix run` +- create projects with `vix new` +- build fast with `vix build` +- build backend services +- build WebSocket applications +- build P2P systems +- build AI agents +- build game-oriented projects +- use threadpool and async runtime modules +- use KV, cache, database, ORM, middleware, crypto, validation, and template modules +- generate production-ready backend projects +- integrate backend projects with frontend apps such as Vue.js + +## Runtime modules + +```text +agent async cache cli conversion +core crypto db env error +fs game io json kv +log middleware net orm os +p2p p2p_http path process reply +sync template tests threadpool time +utils validation webrpc websocket +``` -```cpp -#include +Vix.cpp is designed as an application runtime layer, not only as an HTTP server. -int main() { - vix::App app; +## Built with Vix.cpp - app.get("/", [](Request&, Response& res){ - res.send("Hello from Vix.cpp 🚀"); - }); +### Kordex - app.run(8080); -} -``` +A JavaScript and TypeScript runtime layer built on Vix and Softadastra. ---- +https://github.com/softadastra/kordex -## Script mode Run C++ like a script +### Softadastra -```bash -vix run main.cpp -vix dev main.cpp -``` +A local-first and offline-first runtime foundation for reliable applications. + +https://github.com/softadastra/softadastra + +### PulseGrid + +Real-time service monitoring built with Vix.cpp. + +https://github.com/softadastra/PulseGrid + +### Vix Game ---- +Game-oriented project built on the Vix.cpp runtime foundation. -## Documentation +https://github.com/vixcpp/vix-game -- [Introduction](docs/introduction.md) -- [Quick Start](docs/quick-start.md) -- [Architecture & Modules](docs/architecture.md) -- [ORM Overview](docs/orm/overview.md) -- [Benchmarks](docs/benchmarks.md) -- [Examples](docs/examples/overview.md) -- [Build & Installation](docs/build.md) -- [CLI Options](docs/options.md) -- [CLI Reference](docs/vix-cli-help.md) +## Links -## Module Documentation Index +- Documentation: https://docs.vixcpp.com +- Registry: https://registry.vixcpp.com +- Engineering notes: https://blog.vixcpp.com +- Website: https://vixcpp.com -- **Core** : [docs/modules/core.md](docs/modules/core.md) -- **WebSocket** : [docs/modules/websocket.md](docs/modules/websocket.md) -- **ORM** : [docs/modules/orm.md](docs/modules/orm.md) -- **JSON** : [docs/modules/json.md](docs/modules/json.md) -- **Utils** : [docs/modules/utils.md](docs/modules/utils.md) -- **CLI** : [docs/modules/cli.md](docs/modules/cli.md) +## Contributing ---- +Contributions are welcome. -## ⭐ Support the project +Read the contribution guide: -If you believe in modern C++ tooling, offline-first systems, and native performance, -please consider starring the repository. +https://docs.vixcpp.com/contributing -MIT License +## License +MIT License. diff --git a/vix-site/public/data/github_stats.json b/vix-site/public/data/github_stats.json index abd3b485..07254078 100644 --- a/vix-site/public/data/github_stats.json +++ b/vix-site/public/data/github_stats.json @@ -1,6 +1,6 @@ { "repo": "vixcpp/vix", - "fetched_at": "2026-05-26T23:23:18.042Z", + "fetched_at": "2026-05-28T09:11:31.536Z", "stars": 441, "forks": 32, "open_issues": 1, diff --git a/vix-site/public/install.ps1 b/vix-site/public/install.ps1 index dfee892b..069e7315 100644 --- a/vix-site/public/install.ps1 +++ b/vix-site/public/install.ps1 @@ -1,49 +1,90 @@ -# Vix.cpp installer (Windows PowerShell) +# Vix.cpp installer for Windows PowerShell # Usage: # irm https://vixcpp.com/install.ps1 | iex # # Optional: -# $env:VIX_VERSION="v2.1.10" +# $env:VIX_VERSION="v2.5.5" # $env:VIX_REPO="vixcpp/vix" # $env:VIX_INSTALL_KIND="sdk" # sdk or cli # $env:VIX_INSTALL_PREFIX="$env:LOCALAPPDATA\Vix" -# $env:VIX_INSTALL_DIR="$env:LOCALAPPDATA\Vix\bin" # for cli installs or PATH link +# $env:VIX_INSTALL_DIR="$env:LOCALAPPDATA\Vix\bin" $ErrorActionPreference = "Stop" $ProgressPreference = "SilentlyContinue" -function Write-Title($msg) { - Write-Host "" - Write-Host $msg -ForegroundColor Cyan -} - -function Write-Step($msg) { - Write-Host "" - Write-Host "==> $msg" -ForegroundColor Blue -} - function Info($msg) { - Write-Host "› vix install: $msg" -ForegroundColor Cyan + Write-Host "› vix: $msg" } function Ok($msg) { - Write-Host "✔ vix install: $msg" -ForegroundColor Green + Write-Host "✔ vix: $msg" -ForegroundColor Green } function Warn($msg) { - Write-Host "! vix install: $msg" -ForegroundColor Yellow + Write-Host "! vix: $msg" -ForegroundColor Yellow } function Die($msg) { - throw "✖ vix install: $msg" + throw "✖ vix: $msg" } -Write-Title "Vix.cpp installer" -Write-Host "Native runtime and SDK installer" -ForegroundColor DarkGray +function Show-Help { + Write-Host @" +Vix.cpp installer + +Usage: + install.ps1 Install Vix SDK + install.ps1 --cli-only Install CLI only + install.ps1 --sdk Install SDK + +Environment: + VIX_VERSION Release version. Example: v2.5.5. Default: latest + VIX_REPO GitHub repo. Default: vixcpp/vix + VIX_INSTALL_KIND sdk or cli. Default: sdk + VIX_INSTALL_PREFIX SDK install prefix. Default: %LOCALAPPDATA%\Vix + VIX_INSTALL_DIR CLI bin dir. Default: %LOCALAPPDATA%\Vix\bin +"@ +} -$Repo = if ($env:VIX_REPO) { $env:VIX_REPO } else { "vixcpp/vix" } -$Version = if ($env:VIX_VERSION) { $env:VIX_VERSION } else { "latest" } -$InstallKind = if ($env:VIX_INSTALL_KIND) { $env:VIX_INSTALL_KIND } else { "sdk" } +foreach ($arg in $args) { + switch ($arg) { + "--cli-only" { + $env:VIX_INSTALL_KIND = "cli" + } + "--sdk" { + $env:VIX_INSTALL_KIND = "sdk" + } + "--help" { + Show-Help + exit 0 + } + "-h" { + Show-Help + exit 0 + } + default { + Die "unknown option: $arg" + } + } +} + +$Repo = if ($env:VIX_REPO) { + $env:VIX_REPO +} else { + "vixcpp/vix" +} + +$Version = if ($env:VIX_VERSION) { + $env:VIX_VERSION +} else { + "latest" +} + +$InstallKind = if ($env:VIX_INSTALL_KIND) { + $env:VIX_INSTALL_KIND +} else { + "sdk" +} $PrefixDir = if ($env:VIX_INSTALL_PREFIX) { $env:VIX_INSTALL_PREFIX @@ -61,180 +102,221 @@ $BinName = "vix.exe" function Resolve-LatestTag([string]$repo) { $api = "https://api.github.com/repos/$repo/releases/latest" + try { $resp = Invoke-RestMethod -Uri $api -Headers @{ "User-Agent" = "vix-installer" } + if (-not $resp.tag_name) { Die "could not resolve latest tag. Set VIX_VERSION=vX.Y.Z" } + return $resp.tag_name } catch { - Die "could not resolve latest tag (GitHub API). Set VIX_VERSION=vX.Y.Z" + Die "could not resolve latest tag. Set VIX_VERSION=vX.Y.Z" } } -Write-Step "Detecting platform" +function Detect-Architecture { + $archRaw = $env:PROCESSOR_ARCHITECTURE -$archRaw = $env:PROCESSOR_ARCHITECTURE -$Arch = switch -Regex ($archRaw) { - "AMD64" { "x86_64"; break } - "^ARM" { "aarch64"; break } - default { Die "unsupported arch: $archRaw" } + switch -Regex ($archRaw) { + "AMD64" { + return "x86_64" + } + "^ARM" { + return "aarch64" + } + default { + Die "unsupported architecture: $archRaw" + } + } } -$Tag = if ($Version -eq "latest") { Resolve-LatestTag $Repo } else { $Version } +function Verify-Checksum([string]$archivePath, [string]$shaPath) { + $first = (Get-Content -LiteralPath $shaPath -TotalCount 1).Trim() -$Asset = switch ($InstallKind.ToLowerInvariant()) { - "sdk" { "vix-sdk-windows-$Arch.zip"; break } - "cli" { "vix-windows-$Arch.zip"; break } - default { Die "unsupported VIX_INSTALL_KIND: $InstallKind (expected sdk or cli)" } + if (-not $first) { + Die "invalid sha256 file" + } + + $expected = $null + + if ($first -match "^[0-9a-fA-F]{64}") { + $expected = ($first -split "\s+")[0] + } elseif ($first -match "=\s*([0-9a-fA-F]{64})\s*$") { + $expected = $Matches[1] + } + + if (-not $expected) { + Die "invalid sha256 format" + } + + $actual = (Get-FileHash -Algorithm SHA256 -LiteralPath $archivePath).Hash + + if ($expected.ToLowerInvariant() -ne $actual.ToLowerInvariant()) { + Die "sha256 mismatch" + } } -$BaseUrl = "https://github.com/$Repo/releases/download/$Tag" -$UrlBin = "$BaseUrl/$Asset" -$UrlSha = "$UrlBin.sha256" +function Download-And-Verify-Asset([string]$baseUrl, [string]$asset, [string]$tmpDir) { + $archivePath = Join-Path $tmpDir $asset + $shaPath = Join-Path $tmpDir ($asset + ".sha256") -Ok "repo=$Repo version=$Tag arch=$Arch kind=$InstallKind" -Info "prefix=$PrefixDir" -Info "bin_dir=$BinDir" + Info "downloading $asset" -$TmpDir = Join-Path ([System.IO.Path]::GetTempPath()) ("vix-" + [System.Guid]::NewGuid().ToString("N")) -New-Item -ItemType Directory -Force -Path $TmpDir | Out-Null + Invoke-WebRequest -Uri "$baseUrl/$asset" -OutFile $archivePath + Invoke-WebRequest -Uri "$baseUrl/$asset.sha256" -OutFile $shaPath -try { - $ArchivePath = Join-Path $TmpDir $Asset - $ShaPath = Join-Path $TmpDir ($Asset + ".sha256") - $ExtractDir = Join-Path $TmpDir "extract" + Verify-Checksum $archivePath $shaPath - Write-Step "Downloading archive" - Info "asset: $Asset" - Info "url: $UrlBin" - Invoke-WebRequest -Uri $UrlBin -OutFile $ArchivePath - Ok "archive downloaded" + return $archivePath +} - Write-Step "Verifying checksum" - try { - Invoke-WebRequest -Uri $UrlSha -OutFile $ShaPath +function Add-To-UserPath([string]$pathToAdd) { + $userPath = [Environment]::GetEnvironmentVariable("Path", "User") - $first = (Get-Content -LiteralPath $ShaPath -TotalCount 1).Trim() - if (-not $first) { - Die "invalid sha256 file" - } + if (-not $userPath) { + $userPath = "" + } - $expected = $null - if ($first -match "^[0-9a-fA-F]{64}") { - $expected = ($first -split "\s+")[0] - } elseif ($first -match "=\s*([0-9a-fA-F]{64})\s*$") { - $expected = $Matches[1] - } + $segments = $userPath -split ";" | + ForEach-Object { $_.Trim() } | + Where-Object { $_ -ne "" } - if (-not $expected) { - Die "invalid sha256 format" - } + $already = $false - $actual = (Get-FileHash -Algorithm SHA256 -LiteralPath $ArchivePath).Hash - if ($expected.ToLowerInvariant() -ne $actual.ToLowerInvariant()) { - Die "sha256 mismatch" + foreach ($segment in $segments) { + if ([string]::Equals( + $segment.TrimEnd("\"), + $pathToAdd.TrimEnd("\"), + [System.StringComparison]::OrdinalIgnoreCase + )) { + $already = $true + break } + } - Ok "sha256 ok" - } catch { - Warn "sha256 file not found or verification skipped" + if (-not $already) { + $newPath = ($segments + $pathToAdd) -join ";" + [Environment]::SetEnvironmentVariable("Path", $newPath, "User") + return $false } - Write-Step "Extracting archive" - New-Item -ItemType Directory -Force -Path $ExtractDir | Out-Null - Expand-Archive -LiteralPath $ArchivePath -DestinationPath $ExtractDir -Force - Ok "archive extracted" + return $true +} + +function Install-Cli([string]$archivePath, [string]$tmpDir) { + $extractDir = Join-Path $tmpDir "cli" - Write-Step "Installing" + New-Item -ItemType Directory -Force -Path $extractDir | Out-Null + New-Item -ItemType Directory -Force -Path $BinDir | Out-Null - if ($InstallKind.ToLowerInvariant() -eq "cli") { - $ExeCandidate = Get-ChildItem -LiteralPath $ExtractDir -Recurse -File -Filter $BinName | Select-Object -First 1 - if (-not $ExeCandidate) { - Die "archive does not contain $BinName" - } + Expand-Archive -LiteralPath $archivePath -DestinationPath $extractDir -Force - New-Item -ItemType Directory -Force -Path $BinDir | Out-Null - $Exe = Join-Path $BinDir $BinName + $exeCandidate = Get-ChildItem -LiteralPath $extractDir -Recurse -File -Filter $BinName | + Select-Object -First 1 - Copy-Item -LiteralPath $ExeCandidate.FullName -Destination $Exe -Force - Ok "CLI installed to $Exe" + if (-not $exeCandidate) { + Die "SDK archive does not contain $BinName" } - else { - New-Item -ItemType Directory -Force -Path $PrefixDir | Out-Null - New-Item -ItemType Directory -Force -Path $BinDir | Out-Null - Get-ChildItem -Path $ExtractDir -Force | ForEach-Object { - Copy-Item -Path $_.FullName -Destination $PrefixDir -Recurse -Force - } + $exe = Join-Path $BinDir $BinName - $ExeCandidate = Get-ChildItem -Path $PrefixDir -Recurse -File -Filter $BinName | - Where-Object { $_.FullName -match '[\\/](bin)[\\/].*vix\.exe$' } | - Select-Object -First 1 + if (-not [string]::Equals( + $exeCandidate.FullName, + $exe, + [System.StringComparison]::OrdinalIgnoreCase + )) { + Copy-Item -LiteralPath $exeCandidate.FullName -Destination $exe -Force + } - if (-not $ExeCandidate) { - $ExeCandidate = Get-ChildItem -Path $PrefixDir -Recurse -File -Filter $BinName | Select-Object -First 1 - } + return $exe +} - if (-not $ExeCandidate) { - Die "SDK archive does not contain $BinName" - } +function Install-Sdk([string]$archivePath, [string]$tmpDir) { + $extractDir = Join-Path $tmpDir "sdk" - $Exe = Join-Path $BinDir $BinName + New-Item -ItemType Directory -Force -Path $extractDir | Out-Null + New-Item -ItemType Directory -Force -Path $PrefixDir | Out-Null + New-Item -ItemType Directory -Force -Path $BinDir | Out-Null - if ([string]::Equals($ExeCandidate.FullName, $Exe, [System.StringComparison]::OrdinalIgnoreCase)) { - Info "CLI already installed at $Exe" - } else { - Copy-Item -LiteralPath $ExeCandidate.FullName -Destination $Exe -Force - Info "CLI available at $Exe" - } + Expand-Archive -LiteralPath $archivePath -DestinationPath $extractDir -Force - Ok "SDK installed to $PrefixDir" + Get-ChildItem -Path $extractDir -Force | ForEach-Object { + Copy-Item -Path $_.FullName -Destination $PrefixDir -Recurse -Force } - Write-Step "Updating PATH" + $exeCandidate = Get-ChildItem -Path $PrefixDir -Recurse -File -Filter $BinName | + Where-Object { $_.FullName -match '[\\/](bin)[\\/].*vix\.exe$' } | + Select-Object -First 1 - $userPath = [Environment]::GetEnvironmentVariable("Path", "User") - if (-not $userPath) { - $userPath = "" + if (-not $exeCandidate) { + $exeCandidate = Get-ChildItem -Path $PrefixDir -Recurse -File -Filter $BinName | + Select-Object -First 1 } - $segments = $userPath -split ";" | ForEach-Object { $_.Trim() } | Where-Object { $_ -ne "" } - $already = $false + if (-not $exeCandidate) { + Die "SDK archive does not contain $BinName" + } - foreach ($s in $segments) { - if ([string]::Equals($s.TrimEnd("\"), $BinDir.TrimEnd("\"), [System.StringComparison]::OrdinalIgnoreCase)) { - $already = $true - break - } + $exe = Join-Path $BinDir $BinName + + Copy-Item -LiteralPath $exeCandidate.FullName -Destination $exe -Force + + return $exe +} + +$Arch = Detect-Architecture +$Tag = if ($Version -eq "latest") { + Resolve-LatestTag $Repo +} else { + $Version +} + +switch ($InstallKind.ToLowerInvariant()) { + "sdk" { + $Asset = "vix-sdk-windows-$Arch.zip" + } + "cli" { + $Asset = "vix-windows-$Arch.zip" } + default { + Die "unsupported VIX_INSTALL_KIND: $InstallKind" + } +} - if (-not $already) { - $newPath = ($segments + $BinDir) -join ";" - [Environment]::SetEnvironmentVariable("Path", $newPath, "User") - Ok "added to PATH" - Warn "restart your terminal to use 'vix'" +$BaseUrl = "https://github.com/$Repo/releases/download/$Tag" + +$TmpDir = Join-Path ([System.IO.Path]::GetTempPath()) ("vix-" + [System.Guid]::NewGuid().ToString("N")) +New-Item -ItemType Directory -Force -Path $TmpDir | Out-Null + +try { + Write-Host "" + Write-Host "Vix.cpp" -ForegroundColor Green + Info "installing $Tag ($InstallKind, windows-$Arch)" + + $ArchivePath = Download-And-Verify-Asset $BaseUrl $Asset $TmpDir + + if ($InstallKind.ToLowerInvariant() -eq "cli") { + $Exe = Install-Cli $ArchivePath $TmpDir } else { - Ok "PATH already contains bin_dir" + $Exe = Install-Sdk $ArchivePath $TmpDir } - Write-Step "Validating installation" + $PathAlreadyReady = Add-To-UserPath $BinDir + try { - $ver = & $Exe --version 2>$null - if ($ver) { - Ok "installed: $ver" - } else { - Warn "installed, but 'vix --version' returned no output" - } + & $Exe --version *> $null + Ok "installed $Tag" } catch { - Warn "installed, but running 'vix --version' failed" + Warn "installed, but 'vix --version' failed" } - Write-Host "" - Write-Host "Done." -ForegroundColor Green - Write-Host ("Location: " + $Exe) - Write-Host ("Version: " + $Tag) - Write-Host ("Kind: " + $InstallKind) + if ($PathAlreadyReady) { + Ok "ready" + } else { + Warn "installed, restart your terminal if 'vix' is not found" + } } finally { Remove-Item -LiteralPath $TmpDir -Recurse -Force -ErrorAction SilentlyContinue | Out-Null diff --git a/vix-site/public/install.sh b/vix-site/public/install.sh index f2440a23..2b935ed0 100644 --- a/vix-site/public/install.sh +++ b/vix-site/public/install.sh @@ -1,303 +1,323 @@ #!/usr/bin/env sh set -eu -# minisign public key (ONLY the base64 key, without the comment line) MINISIGN_PUBKEY="RWSIfpPSznK9A1gWUc8Eg2iXXQwU5d9BYuQNKGOcoujAF2stPu5rKFjQ" -REPO="${VIX_REPO:-vixcpp/vix}" -VERSION="${VIX_VERSION:-latest}" # "latest" or "vX.Y.Z" +VIX_REPO="${VIX_REPO:-vixcpp/vix}" +VIX_VERSION="${VIX_VERSION:-latest}" -# install kind: sdk or cli -INSTALL_KIND="${VIX_INSTALL_KIND:-sdk}" +# sdk or cli +VIX_INSTALL_KIND="${VIX_INSTALL_KIND:-sdk}" + +VIX_INSTALL_PREFIX="${VIX_INSTALL_PREFIX:-$HOME/.local}" +VIX_INSTALL_BIN_DIR="${VIX_INSTALL_BIN_DIR:-$HOME/.local/bin}" -# SDK installs a full prefix, CLI installs only the binary -PREFIX_DIR="${VIX_INSTALL_PREFIX:-$HOME/.local}" -BIN_DIR="${VIX_INSTALL_BIN_DIR:-$HOME/.local/bin}" BIN_NAME="vix" -# -------------------------------------------------- -# Styling -# -------------------------------------------------- if [ -t 2 ] && [ "${NO_COLOR:-}" = "" ]; then C_RESET="$(printf '\033[0m')" C_BOLD="$(printf '\033[1m')" - C_DIM="$(printf '\033[2m')" C_RED="$(printf '\033[31m')" C_GREEN="$(printf '\033[32m')" C_YELLOW="$(printf '\033[33m')" - C_BLUE="$(printf '\033[34m')" - C_CYAN="$(printf '\033[36m')" else C_RESET="" C_BOLD="" - C_DIM="" C_RED="" C_GREEN="" C_YELLOW="" - C_BLUE="" - C_CYAN="" fi die() { - printf "%s✖%s vix install: %s\n" "$C_RED" "$C_RESET" "$*" >&2 + printf "%s✖%s vix: %s\n" "$C_RED" "$C_RESET" "$*" >&2 exit 1 } info() { - printf "%s›%s vix install: %s\n" "$C_CYAN" "$C_RESET" "$*" >&2 + printf "› vix: %s\n" "$*" >&2 } ok() { - printf "%s✔%s vix install: %s\n" "$C_GREEN" "$C_RESET" "$*" >&2 + printf "%s✔%s vix: %s\n" "$C_GREEN" "$C_RESET" "$*" >&2 } warn() { - printf "%s!%s vix install: %s\n" "$C_YELLOW" "$C_RESET" "$*" >&2 + printf "%s!%s vix: %s\n" "$C_YELLOW" "$C_RESET" "$*" >&2 } -step() { - printf "\n%s==>%s %s\n" "$C_BOLD$C_BLUE" "$C_RESET" "$*" >&2 +have() { + command -v "$1" >/dev/null 2>&1 } -banner() { - printf '\n' >&2 - printf "%sVix.cpp installer%s\n" "$C_BOLD" "$C_RESET" >&2 - printf "%sNative runtime and SDK installer%s\n" "$C_DIM" "$C_RESET" >&2 +need_cmd() { + have "$1" || die "missing dependency: $1" } -# -------------------------------------------------- -# Helpers -# -------------------------------------------------- -have() { command -v "$1" >/dev/null 2>&1; } -need_cmd() { have "$1" || die "missing dependency: $1"; } - fetch() { url="$1" out="$2" if have curl; then curl -fsSL "$url" -o "$out" >/dev/null 2>&1 - elif have wget; then - wget -qO "$out" "$url" >/dev/null 2>&1 - else - die "need curl or wget" + return fi -} - -need_cmd uname -need_cmd mktemp -need_cmd tar -banner - -# -------------------------------------------------- -# Detect platform -# -------------------------------------------------- -step "Detecting platform" + if have wget; then + wget -qO "$out" "$url" >/dev/null 2>&1 + return + fi -os="$(uname -s | tr '[:upper:]' '[:lower:]')" -arch="$(uname -m)" + die "need curl or wget" +} -case "$os" in - linux) OS="linux" ;; - darwin) OS="macos" ;; - *) die "unsupported OS: $os (only Linux/macOS supported by install.sh)" ;; -esac +show_help() { + cat </dev/null 2>&1; then - ok "minisign ok" - else - die "minisign verification failed" - fi - else - warn "minisig is published but minisign is not installed" - warn "continuing because checksum verification already succeeded" +verify_signature() { + archive="$1" + sig_file="$2" + + if ! have minisign; then + return fi -else - warn "minisig not found" -fi -# -------------------------------------------------- -# Extract -# -------------------------------------------------- -step "Extracting archive" -mkdir -p "$EXTRACT_DIR" -tar -xzf "$ARCHIVE_PATH" -C "$EXTRACT_DIR" -ok "archive extracted" + minisign -Vm "$archive" -P "$MINISIGN_PUBKEY" >/dev/null 2>&1 || die "signature verification failed" +} -# -------------------------------------------------- -# Install -# -------------------------------------------------- -step "Installing" +download_and_verify_asset() { + base_url="$1" + asset="$2" -if [ "$INSTALL_KIND" = "cli" ]; then - mkdir -p "$BIN_DIR" + archive="$TMP_DIR/$asset" + sha_file="$TMP_DIR/$asset.sha256" + sig_file="$TMP_DIR/$asset.minisig" - [ -f "${EXTRACT_DIR}/${BIN_NAME}" ] || die "archive does not contain '${BIN_NAME}'" + info "downloading $asset" - chmod +x "${EXTRACT_DIR}/${BIN_NAME}" - dest="${BIN_DIR}/${BIN_NAME}" + fetch "$base_url/$asset" "$archive" || die "download failed" + fetch "$base_url/$asset.sha256" "$sha_file" || die "checksum not found" - info "installing CLI to: $dest" - mv -f "${EXTRACT_DIR}/${BIN_NAME}" "$dest" - ok "CLI installed" -else - mkdir -p "$PREFIX_DIR" "$BIN_DIR" + verify_checksum "$archive" "$sha_file" + + if fetch "$base_url/$asset.minisig" "$sig_file"; then + verify_signature "$archive" "$sig_file" + fi + + printf "%s" "$archive" +} - info "installing SDK to: $PREFIX_DIR" - cp -R "${EXTRACT_DIR}/." "$PREFIX_DIR/" +install_cli() { + archive="$(download_and_verify_asset "$BASE_URL" "$ASSET")" + extract_dir="$TMP_DIR/cli" - if [ -f "${PREFIX_DIR}/bin/${BIN_NAME}" ]; then - target="${PREFIX_DIR}/bin/${BIN_NAME}" - elif [ -f "${PREFIX_DIR}/install/bin/${BIN_NAME}" ]; then - target="${PREFIX_DIR}/install/bin/${BIN_NAME}" + rm -rf "$extract_dir" + mkdir -p "$extract_dir" "$VIX_INSTALL_BIN_DIR" + + tar -xzf "$archive" -C "$extract_dir" + + if [ -f "$extract_dir/$BIN_NAME" ]; then + src="$extract_dir/$BIN_NAME" + elif [ -f "$extract_dir/bin/$BIN_NAME" ]; then + src="$extract_dir/bin/$BIN_NAME" else - target="$(find "$PREFIX_DIR" -type f -path "*/bin/${BIN_NAME}" 2>/dev/null | head -n 1 || true)" + die "$BIN_NAME not found in archive" fi - [ -n "$target" ] || die "could not find installed '${BIN_NAME}' in SDK" + chmod +x "$src" + cp "$src" "$VIX_INSTALL_BIN_DIR/$BIN_NAME" + chmod +x "$VIX_INSTALL_BIN_DIR/$BIN_NAME" - chmod +x "$target" - dest="${BIN_DIR}/${BIN_NAME}" + DEST="$VIX_INSTALL_BIN_DIR/$BIN_NAME" +} + +install_sdk() { + archive="$(download_and_verify_asset "$BASE_URL" "$ASSET")" + extract_dir="$TMP_DIR/sdk" - if [ "$target" = "$dest" ]; then - info "CLI already installed at: $dest" + rm -rf "$extract_dir" + mkdir -p "$extract_dir" "$VIX_INSTALL_PREFIX" "$VIX_INSTALL_BIN_DIR" + + tar -xzf "$archive" -C "$extract_dir" + + cp -R "$extract_dir/." "$VIX_INSTALL_PREFIX/" + + if [ -f "$VIX_INSTALL_PREFIX/bin/$BIN_NAME" ]; then + target="$VIX_INSTALL_PREFIX/bin/$BIN_NAME" + elif [ -f "$VIX_INSTALL_PREFIX/install/bin/$BIN_NAME" ]; then + target="$VIX_INSTALL_PREFIX/install/bin/$BIN_NAME" else - ln -sf "$target" "$dest" - info "linked CLI to: $dest" + target="$(find "$VIX_INSTALL_PREFIX" -type f -path "*/bin/$BIN_NAME" 2>/dev/null | head -n 1 || true)" fi - ok "SDK installed" -fi + [ -n "$target" ] || die "could not find installed '$BIN_NAME'" + + chmod +x "$target" + + DEST="$VIX_INSTALL_BIN_DIR/$BIN_NAME" + + if [ "$target" != "$DEST" ]; then + ln -sf "$target" "$DEST" + fi +} + +detect_platform -# -------------------------------------------------- -# Validate install -# -------------------------------------------------- -step "Validating installation" -if "$dest" --version >/dev/null 2>&1; then - INSTALLED_VERSION="$("$dest" --version 2>/dev/null || true)" - ok "installed: $INSTALLED_VERSION" +TMP_DIR="$(mktemp -d 2>/dev/null || mktemp -d -t vix)" +cleanup() { + rm -rf "$TMP_DIR" +} +trap cleanup EXIT INT TERM + +TAG="$(resolve_version)" +BASE_URL="https://github.com/${VIX_REPO}/releases/download/${TAG}" + +case "$VIX_INSTALL_KIND" in + sdk) + ASSET="vix-sdk-${OS}-${ARCH}.tar.gz" + ;; + cli) + ASSET="vix-${OS}-${ARCH}.tar.gz" + ;; +esac + +printf "%s%sVix.cpp%s\n" "$C_BOLD" "$C_GREEN" "$C_RESET" >&2 +info "installing $TAG ($VIX_INSTALL_KIND, ${OS}-${ARCH})" + +case "$VIX_INSTALL_KIND" in + sdk) + install_sdk + ;; + cli) + install_cli + ;; +esac + +if "$DEST" --version >/dev/null 2>&1; then + ok "installed $TAG" else - warn "installed, but running 'vix --version' failed" + warn "installed, but '$BIN_NAME --version' failed" fi -# -------------------------------------------------- -# PATH hint -# -------------------------------------------------- -step "Checking PATH" case ":$PATH:" in - *":$BIN_DIR:"*) - ok "'$BIN_DIR' is already in PATH" + *":$VIX_INSTALL_BIN_DIR:"*) + ok "ready" ;; *) - warn "'$BIN_DIR' is not in your PATH" - info "Add this to your shell config:" - printf " export PATH=\"%s:\$PATH\"\n" "$BIN_DIR" >&2 + warn "installed, open a new terminal if '$BIN_NAME' is not found" ;; esac - -# -------------------------------------------------- -# Final summary -# -------------------------------------------------- -printf "\n%sDone.%s\n" "$C_BOLD$C_GREEN" "$C_RESET" >&2 -printf "%sLocation:%s %s\n" "$C_BOLD" "$C_RESET" "$dest" >&2 -printf "%sVersion:%s %s\n" "$C_BOLD" "$C_RESET" "$TAG" >&2 -printf "%sKind:%s %s\n" "$C_BOLD" "$C_RESET" "$INSTALL_KIND" >&2 diff --git a/vix-site/src/data/github_stats.json b/vix-site/src/data/github_stats.json index abd3b485..07254078 100644 --- a/vix-site/src/data/github_stats.json +++ b/vix-site/src/data/github_stats.json @@ -1,6 +1,6 @@ { "repo": "vixcpp/vix", - "fetched_at": "2026-05-26T23:23:18.042Z", + "fetched_at": "2026-05-28T09:11:31.536Z", "stars": 441, "forks": 32, "open_issues": 1, diff --git a/vix-site/src/router/index.js b/vix-site/src/router/index.js index f23db66c..a5f6b805 100644 --- a/vix-site/src/router/index.js +++ b/vix-site/src/router/index.js @@ -1,7 +1,6 @@ import { createRouter, createWebHistory } from "vue-router"; import Home from "../pages/Home.vue"; -import Install from "../pages/Install.vue"; import Community from "../pages/Community.vue"; import Support from "../pages/Support.vue"; import Roadmap from "../pages/Roadmap.vue"; @@ -50,39 +49,18 @@ const routes = [ { path: "/install", - name: "install", - component: Install, - meta: { - seo: { - title: "Install Vix.cpp", - description: - "Install Vix.cpp, create your first project, and start building native C++ applications.", - path: "/install", - type: "website", - }, + redirect: () => { + window.location.href = + "https://docs.vixcpp.com/getting-started/installation"; + return "/"; }, }, { path: "/roadmap", - name: "roadmap", - component: Roadmap, - meta: { - seo: { - title: "Roadmap", - description: - "Explore the Vix.cpp roadmap: runtime direction, CLI improvements, modules, registry, tooling, and long-term platform goals.", - path: "/roadmap", - type: "website", - jsonLd: { - "@context": "https://schema.org", - "@type": "WebPage", - name: "Vix.cpp Roadmap", - description: - "The public roadmap for Vix.cpp, covering runtime, CLI, modules, registry, tooling, and long-term platform direction.", - url: "https://vixcpp.com/roadmap", - }, - }, + redirect: () => { + window.location.href = "https://blog.vixcpp.com/posts/roadmap/"; + return "/"; }, }, @@ -103,16 +81,9 @@ const routes = [ { path: "/about/releases", - name: "releases", - component: Releases, - meta: { - seo: { - title: "Releases", - description: - "Read Vix.cpp release notes, version updates, and stability information.", - path: "/about/releases", - type: "website", - }, + redirect: () => { + window.location.href = "https://blog.vixcpp.com/posts/changelog/"; + return "/"; }, },