Free Motion Capture for Everyone πβ¨
TypeScript
downloads page
jonmatthise15c59c8958e
diff --git a/freemocap-docs/src/components/download/downloads.ts b/freemocap-docs/src/components/download/downloads.tsnew file mode 100644index 00000000..eae83b0c--- /dev/null+++ b/freemocap-docs/src/components/download/downloads.ts@@ -0,0 +1,136 @@+import type { LinkedIssue } from '@freemocap/skellydocs';+export type { LinkedIssue };++export type OsType = 'windows' | 'macos' | 'linux';+export type ArchType = 'x64' | 'arm64';++export interface DownloadEntry {+ os: OsType;+ arch: ArchType;+ fmt: string;+ recommended: boolean;+ label: string;+ file: string;+ size: string;+}++export interface OsNoteEntry {+ os: OsType;+ arch?: ArchType;+ variant: 'warning' | 'info' | 'tip';+ title: string;+ content: string;+ issues?: LinkedIssue[];+}++export interface GitHubAsset {+ name: string;+ size: number;+ browser_download_url: string;+}++export interface GitHubRelease {+ tag_name: string;+ name: string;+ published_at: string;+ assets: GitHubAsset[];+ prerelease: boolean;+}++export const DEFAULT_VERSION = '2.0.0-alpha.3';+export const REPO = 'freemocap/freemocap';++export function getReleaseBaseUrl(version: string): string {+ return `https://github.com/${REPO}/releases/download/v${version}`;+}++export function buildAppDownloads(version: string): DownloadEntry[] {+ return [+ { os: 'windows', arch: 'x64', fmt: 'exe', recommended: true, label: 'Windows Installer', file: `freemocap_${version}_windows-x64.exe`, size: '' },+ { os: 'macos', arch: 'arm64', fmt: 'dmg', recommended: true, label: 'macOS Installer (Apple Silicon)', file: `freemocap_${version}_macos-arm64-apple-silicon.dmg`, size: '' },+ { os: 'macos', arch: 'x64', fmt: 'dmg', recommended: true, label: 'macOS Installer (Intel)', file: `freemocap_${version}_macos-x64-intel.dmg`, size: '' },+ { os: 'macos', arch: 'arm64', fmt: 'zip', recommended: false, label: 'macOS Portable (Apple Silicon)', file: `freemocap_${version}_macos-arm64-apple-silicon.zip`, size: '' },+ { os: 'macos', arch: 'x64', fmt: 'zip', recommended: false, label: 'macOS Portable (Intel)', file: `freemocap_${version}_macos-x64-intel.zip`, size: '' },+ { os: 'linux', arch: 'x64', fmt: 'AppImage', recommended: true, label: 'Linux AppImage (x64)', file: `freemocap_${version}_linux-x64.AppImage`, size: '' },+ { os: 'linux', arch: 'arm64', fmt: 'AppImage', recommended: true, label: 'Linux AppImage (ARM64)', file: `freemocap_${version}_linux-arm64.AppImage`, size: '' },+ { os: 'linux', arch: 'x64', fmt: 'deb', recommended: false, label: 'Linux .deb (x64)', file: `freemocap_${version}_linux-x64.deb`, size: '' },+ { os: 'linux', arch: 'arm64', fmt: 'deb', recommended: false, label: 'Linux .deb (ARM64)', file: `freemocap_${version}_linux-arm64.deb`, size: '' },+ ];+}++export function buildServerDownloads(version: string): DownloadEntry[] {+ return [+ { os: 'windows', arch: 'x64', fmt: 'exe', recommended: false, label: 'Server \u2014 Windows x64', file: `freemocap_server_${version}_windows-x64.exe`, size: '' },+ { os: 'macos', arch: 'arm64', fmt: 'bin', recommended: false, label: 'Server \u2014 macOS Apple Silicon', file: `freemocap_server_${version}_macos-arm64-apple-silicon`, size: '' },+ { os: 'macos', arch: 'x64', fmt: 'bin', recommended: false, label: 'Server \u2014 macOS Intel', file: `freemocap_server_${version}_macos-x64-intel`, size: '' },+ { os: 'linux', arch: 'x64', fmt: 'bin', recommended: false, label: 'Server \u2014 Linux x64', file: `freemocap_server_${version}_linux-x64`, size: '' },+ { os: 'linux', arch: 'arm64', fmt: 'bin', recommended: false, label: 'Server \u2014 Linux ARM64', file: `freemocap_server_${version}_linux-arm64`, size: '' },+ ];+}++export function formatBytes(bytes: number): string {+ const mb = bytes / (1024 * 1024);+ return `~${Math.round(mb)} MB`;+}++export function enrichDownloadsWithAssets(+ downloads: DownloadEntry[],+ assets: GitHubAsset[],+): DownloadEntry[] {+ const assetMap = new Map(assets.map(a => [a.name, a]));+ return downloads.map(d => {+ const asset = assetMap.get(d.file);+ return asset ? { ...d, size: formatBytes(asset.size) } : d;+ });+}++/** Check if a release's assets match our expected filename patterns */+export function matchesExpectedPattern(assets: GitHubAsset[], version: string): boolean {+ const expectedFiles = [+ ...buildAppDownloads(version).map(d => d.file),+ ...buildServerDownloads(version).map(d => d.file),+ ];+ const assetNames = new Set(assets.map(a => a.name));+ // Consider it a match if at least 3 of our expected files exist+ const matchCount = expectedFiles.filter(f => assetNames.has(f)).length;+ return matchCount >= 3;+}++export function fileLabel(os: OsType, arch: ArchType): string {+ if (os === 'macos') return arch === 'arm64' ? 'macos-arm64-apple-silicon' : 'macos-x64-intel';+ if (os === 'linux') return arch === 'arm64' ? 'linux-arm64' : 'linux-x64';+ return 'windows-x64';+}++export function formatMeta(d: DownloadEntry): string {+ const parts = [d.fmt.toUpperCase()];+ if (d.os !== 'windows') parts.push(d.arch === 'arm64' ? 'ARM64' : 'x64');+ return parts.join(' \u00B7 ');+}++export const OS_LABELS: Record<string, string> = {+ windows: 'Windows x64',+ macos: 'macOS',+ linux: 'Linux',+ unknown: 'Unknown OS',+};++export function archLabel(arch: ArchType): string {+ return arch === 'arm64' ? 'ARM64 / Apple Silicon' : 'x64 / Intel';+}++export function stripVersionPrefix(tag: string): string {+ return tag.replace(/^v/, '');+}++// Per-OS/arch advisories shown above the download cards for the matching system.+// Add FreeMoCap-specific notes here (platform caveats, known issues, help wanted).+export const OS_NOTES: OsNoteEntry[] = [];++export const OS_PILL_OPTIONS = [+ { os: 'windows' as OsType, arch: 'x64' as ArchType, label: 'Windows' },+ { os: 'macos' as OsType, arch: 'arm64' as ArchType, label: 'Mac (Apple\u00A0Silicon)' },+ { os: 'macos' as OsType, arch: 'x64' as ArchType, label: 'Mac (Intel)' },+ { os: 'linux' as OsType, arch: 'x64' as ArchType, label: 'Linux x64' },+ { os: 'linux' as OsType, arch: 'arm64' as ArchType, label: 'Linux ARM64' },+] as const;diff --git a/freemocap-docs/src/components/download/installInstructions.ts b/freemocap-docs/src/components/download/installInstructions.tsnew file mode 100644index 00000000..e6d4d5cf--- /dev/null+++ b/freemocap-docs/src/components/download/installInstructions.ts@@ -0,0 +1,216 @@+import type { OsType, ArchType } from './downloads';+import { fileLabel } from './downloads';++export interface CodeLine {+ type: 'prompt' | 'comment' | 'text';+ content: string;+ promptChar?: string;+}++export interface InstructionBlock {+ text?: string;+ codeLines?: CodeLine[];+}++export function getAppInstallInstructions(+ os: OsType,+ arch: ArchType,+ version: string,+): InstructionBlock[] {+ if (os === 'windows') {+ return [+ {+ text: 'Download and run the <code>.exe</code> installer. If Windows SmartScreen appears, click <strong>"More info"</strong> \u2192 <strong>"Run anyway"</strong>.',+ },+ ];+ }++ if (os === 'macos') {+ return [+ {+ text: '<strong>.dmg</strong> \u2014 Open the disk image and drag FreeMoCap into Applications. On first launch, right-click the app and select <strong>Open</strong> to bypass Gatekeeper.',+ },+ {+ text: '<strong>.zip</strong> \u2014 Portable version. Unzip and double-click to run without installing.',+ },+ ];+ }++ if (os === 'linux') {+ const label = fileLabel(os, arch);+ const ai = `freemocap_${version}_${label}.AppImage`;+ const deb = `freemocap_${version}_${label}.deb`;++ return [+ {+ text: '<strong>AppImage</strong> \u2014 Portable, works on any distro. Download, make executable, and run. No root needed.',+ },+ {+ codeLines: [+ { type: 'prompt', content: `chmod +x ${ai}`, promptChar: '$' },+ { type: 'prompt', content: `./${ai}`, promptChar: '$' },+ ],+ },+ {+ text: '<strong>.deb</strong> \u2014 For Debian, Ubuntu, Pop!_OS, and similar. Installs system-wide with desktop integration.',+ },+ {+ codeLines: [+ { type: 'prompt', content: `sudo apt install ./${deb}`, promptChar: '$' },+ ],+ },+ ];+ }++ return [];+}++export function getServerInstallInstructions(+ os: OsType,+ arch: ArchType,+ version: string,+): InstructionBlock[] {+ const label = fileLabel(os, arch);+ const srv =+ os === 'windows'+ ? `freemocap_server_${version}_${label}.exe`+ : `freemocap_server_${version}_${label}`;++ if (os === 'windows') {+ return [+ {+ text: 'Download and run from a terminal. The server starts a local API on port <code>53117</code>.',+ },+ {+ codeLines: [+ { type: 'prompt', content: `.\\${srv}`, promptChar: '>' },+ ],+ },+ ];+ }++ if (os === 'macos') {+ return [+ { text: 'Download, make executable, and run from Terminal.' },+ {+ codeLines: [+ { type: 'prompt', content: `chmod +x ${srv}`, promptChar: '$' },+ { type: 'prompt', content: `xattr -cr ${srv}`, promptChar: '$' },+ { type: 'prompt', content: `./${srv}`, promptChar: '$' },+ ],+ },+ {+ text: 'The <code>xattr</code> command clears the macOS quarantine flag so Gatekeeper won\u2019t block it.',+ },+ ];+ }++ if (os === 'linux') {+ return [+ {+ text: 'Download, make executable, and run. Ideal for headless rigs, Raspberry Pis, or remote capture machines.',+ },+ {+ codeLines: [+ { type: 'prompt', content: `chmod +x ${srv}`, promptChar: '$' },+ { type: 'prompt', content: `./${srv}`, promptChar: '$' },+ { type: 'text', content: '' },+ { type: 'comment', content: '# Or run in background (survives terminal close)' },+ { type: 'prompt', content: `nohup ./${srv} &`, promptChar: '$' },+ ],+ },+ ];+ }++ return [];+}++export function getTerminalInstallBlocks(+ os: OsType,+ arch: ArchType,+ version: string,+ baseUrl: string,+): InstructionBlock[] {+ if (os !== 'linux' && os !== 'macos') return [];++ const label = fileLabel(os, arch);+ const blocks: InstructionBlock[] = [];++ if (os === 'linux') {+ const ai = `freemocap_${version}_${label}.AppImage`;+ const deb = `freemocap_${version}_${label}.deb`;+ const srv = `freemocap_server_${version}_${label}`;++ blocks.push({+ codeLines: [+ { type: 'comment', content: '# App Installer \u2014 AppImage (any distro, no root)' },+ { type: 'prompt', content: `curl -fSL -o freemocap.AppImage "${baseUrl}/${ai}"`, promptChar: '$' },+ { type: 'prompt', content: 'chmod +x freemocap.AppImage', promptChar: '$' },+ { type: 'prompt', content: './freemocap.AppImage', promptChar: '$' },+ ],+ });+ blocks.push({+ codeLines: [+ { type: 'comment', content: '# App Installer \u2014 .deb (Debian/Ubuntu)' },+ { type: 'prompt', content: `curl -fSL -o freemocap.deb "${baseUrl}/${deb}"`, promptChar: '$' },+ { type: 'prompt', content: 'sudo apt install ./freemocap.deb', promptChar: '$' },+ ],+ });+ blocks.push({+ codeLines: [+ { type: 'comment', content: '# Backend Server (headless / Raspberry Pi)' },+ { type: 'prompt', content: `curl -fSL -o freemocap_server "${baseUrl}/${srv}"`, promptChar: '$' },+ { type: 'prompt', content: 'chmod +x freemocap_server', promptChar: '$' },+ { type: 'prompt', content: './freemocap_server', promptChar: '$' },+ ],+ });+ }++ if (os === 'macos') {+ const dmg = `freemocap_${version}_${label}.dmg`;+ const srv = `freemocap_server_${version}_${label}`;++ blocks.push({+ codeLines: [+ { type: 'comment', content: '# App Installer' },+ { type: 'prompt', content: `curl -fSL -o freemocap.dmg "${baseUrl}/${dmg}"`, promptChar: '$' },+ { type: 'prompt', content: 'open freemocap.dmg', promptChar: '$' },+ ],+ });+ blocks.push({+ codeLines: [+ { type: 'comment', content: '# Backend Server' },+ { type: 'prompt', content: `curl -fSL -o freemocap_server "${baseUrl}/${srv}"`, promptChar: '$' },+ { type: 'prompt', content: 'chmod +x freemocap_server && xattr -cr freemocap_server', promptChar: '$' },+ { type: 'prompt', content: './freemocap_server', promptChar: '$' },+ ],+ });+ }++ return blocks;+}++export function getTerminalTipContent(os: OsType): {+ openHow: string;+ promptChar: string;+} {+ if (os === 'windows') {+ return {+ openHow:+ 'Press <code>Win + X</code> then choose <strong>Terminal</strong>, or search for <strong>"PowerShell"</strong> in the Start menu.',+ promptChar: '<code>></code>',+ };+ }+ if (os === 'macos') {+ return {+ openHow:+ 'Open <strong>Terminal</strong> from <strong>Applications \u2192 Utilities \u2192 Terminal</strong>, or press <code>Cmd + Space</code> and type <strong>"Terminal"</strong>.',+ promptChar: '<code>$</code>',+ };+ }+ return {+ openHow:+ 'Open your terminal emulator. On most desktops, press <code>Ctrl + Alt + T</code> or find <strong>"Terminal"</strong> in your application launcher.',+ promptChar: '<code>$</code>',+ };+}diff --git a/freemocap-docs/src/components/download/systemHelp.ts b/freemocap-docs/src/components/download/systemHelp.tsnew file mode 100644index 00000000..a649270e--- /dev/null+++ b/freemocap-docs/src/components/download/systemHelp.ts@@ -0,0 +1,75 @@+export interface HelpSection {+ icon: string;+ title: string;+ content: Array<{+ type: 'paragraph' | 'list';+ text?: string;+ items?: string[];+ }>;+}++export const SYSTEM_HELP_SECTIONS: HelpSection[] = [+ {+ icon: '\uD83C\uDF4E',+ title: 'macOS \u2014 Intel or Apple Silicon?',+ content: [+ {+ type: 'paragraph',+ text: 'Click the Apple menu (\uF8FF) in the top-left corner \u2192 <strong>About This Mac</strong>.',+ },+ {+ type: 'list',+ items: [+ 'If <strong>Chip</strong> says <strong>Apple M1, M2, M3, M4</strong> (or similar) \u2192 you\u2019re on <strong>Apple Silicon (ARM64)</strong>',+ 'If <strong>Processor</strong> says <strong>Intel Core i5, i7, i9</strong> etc \u2192 you\u2019re on <strong>Intel (x64)</strong>',+ ],+ },+ {+ type: 'paragraph',+ text: 'Or run in Terminal: <code>uname -m</code> \u2014 it prints <code>arm64</code> or <code>x86_64</code>.',+ },+ ],+ },+ {+ icon: '\uD83D\uDC27',+ title: 'Linux \u2014 x64 or ARM64?',+ content: [+ { type: 'paragraph', text: 'Run in a terminal:' },+ { type: 'paragraph', text: '<code>uname -m</code>' },+ {+ type: 'list',+ items: [+ '<code>x86_64</code> \u2192 download the <strong>x64</strong> version',+ '<code>aarch64</code> \u2192 download the <strong>ARM64</strong> version',+ ],+ },+ {+ type: 'paragraph',+ text: 'Common ARM64 devices: Raspberry Pi 3/4/5, NVIDIA Jetson, some cloud VMs (AWS Graviton, Ampere).',+ },+ ],+ },+ {+ icon: '\uD83D\uDC27',+ title: 'Linux \u2014 AppImage or .deb?',+ content: [+ {+ type: 'list',+ items: [+ '<strong>AppImage</strong> \u2014 works on any Linux distro (Ubuntu, Fedora, Arch, etc). Just download and run. No install, no root. Best choice if you\u2019re not sure.',+ '<strong>.deb</strong> \u2014 for Debian-based distros (Ubuntu, Pop!_OS, Linux Mint, Raspberry Pi OS). Integrates with your package manager so it appears in your app launcher and can be cleanly uninstalled.',+ ],+ },+ ],+ },+ {+ icon: '\uD83E\uDE9F',+ title: 'Windows',+ content: [+ {+ type: 'paragraph',+ text: 'FreeMoCap provides a single <strong>x64 (64-bit)</strong> build, which works on virtually all modern Windows PCs \u2014 Intel, AMD, and Snapdragon/ARM laptops. If you have a newer Snapdragon X / Windows on ARM machine, the x64 installer still works via Microsoft\u2019s built-in emulation layer. There\u2019s only one download \u2014 you don\u2019t need to choose.',+ },+ ],+ },+];