docs/INSTALL.md
Install the Valdi CLI from npm. This guide assumes you install the CLI with
npm install -g @snap/valdi. If you are contributing to Valdi itself, see DEV_SETUP.md instead.
This guide will help you set up your development environment and get started with your first project.
Install Xcode from the App Store - this is required for iOS development.
No prerequisites! The Valdi CLI will install everything you need.
That's it! The valdi dev_setup command handles all other dependencies automatically, including:
[!TIP] For manual installation details, see the macOS or Linux reference guides.
npm install -g @snap/valdi
# Set up your development environment (installs all dependencies)
valdi dev_setup
# Verify everything is working
valdi doctor
[!NOTE] The first time you run
valdi dev_setup, it will download and install several gigabytes of dependencies. This may take 10-20 minutes depending on your internet connection.
[!TIP] Contributing to Valdi? If you're developing Valdi itself (not just using it), clone the repository and install from source:
bashgit clone [email protected]:Snapchat/Valdi.git cd Valdi/npm_modules/cli/ npm run cli:install
The best way to start a new project is to bootstrap it using the Valdi CLI. The bootstrap command will create all of the necessary directories, source, and configuration files.
# Create and enter your project directory
mkdir my_project
cd my_project
# Initialize a new Valdi project
valdi bootstrap
This will create all necessary files for a new Valdi project in your current directory.
Choose your target platform and install dependencies:
# For iOS
valdi install ios
# For Android
valdi install android
[!NOTE] The first build may take several minutes as it sets up the bazel WORKSPACE.
Once your app is running in a simulator or emulator, start the hot reloader to see your changes in real-time:
valdi hotreload
Valdi provides editor extensions for syntax highlighting, debugging, and device logs during hot reload.
For VSCode:
shell command and select > Install 'code' command in PATHFor Cursor:
shell command and select > Install 'cursor' command in PATHDownload the extension files from the latest release:
valdi-vivaldi.vsix - Device logs and Valdi language supportvaldi-debug.vsix - JavaScript debugger for Valdi appsInstall the extensions:
# For VSCode
code --install-extension /path/to/valdi-vivaldi.vsix
code --install-extension /path/to/valdi-debug.vsix
# For Cursor
cursor --install-extension /path/to/valdi-vivaldi.vsix
cursor --install-extension /path/to/valdi-debug.vsix
After creating your first Valdi project:
Cmd+Shift+P (or Ctrl+Shift+P)Use Workspace Version[!IMPORTANT] Selecting the workspace TypeScript version is crucial for proper development and cannot be automated.
When you make changes to any of the following:
Run this command to update your project configuration:
valdi projectsync
If you encounter any issues during setup:
Run diagnostics:
valdi doctor
This will check your environment and provide specific fix suggestions.
Check prerequisites:
sudo xcode-select -s /Applications/Xcode.app)Review detailed setup guides:
Get help:
Ready to start building? Check out: