This comprehensive guide will help you set up Gitpod for TypeScript Excel development with Office Add-ins on Windows 11 using WSL2.
- Windows 11 (Build 22000 or later)
- WSL2 installed and configured
- Git for Windows
- A Gitpod account (free at gitpod.io)
- Open PowerShell as Administrator
- Run:
wsl --install - Restart your computer
- Set WSL2 as default:
wsl --set-default-version 2
# Clone the repository
git clone <your-repository-url>
cd Devcontainers
# Run the setup script
./scripts/setup-gitpod-windows.sh
# Open in Gitpod
# 1. Push your changes to GitHub
# 2. Go to https://gitpod.io
# 3. Open your repository in Gitpod# Run in PowerShell as Administrator
wsl --install
wsl --set-default-version 2wsl --list --verbose
# Should show your distribution with version 2- Download from git-scm.com
- Install with default settings
- Verify installation:
git --version
- Go to gitpod.io
- Sign up with your GitHub account
- Authorize Gitpod to access your repositories
- Verify your account is active
# Clone your repository
git clone <your-repository-url>
cd Devcontainers
# Run the setup script
./scripts/setup-gitpod-windows.sh
# Check the configuration
./scripts/setup-gitpod-windows.sh --testgit add .
git commit -m "Add Gitpod configuration for TypeScript Excel development"
git push origin main- Go to gitpod.io
- Click "New Workspace"
- Select your repository
- Wait for the workspace to initialize (2-3 minutes)
- Node.js 20: Latest LTS version
- TypeScript 5.0+: Latest TypeScript with full Office.js support
- Office.js SDK: Complete SDK with TypeScript definitions
- VS Code Extensions: All necessary extensions pre-installed
- Project Templates: Ready-to-use Excel Add-in templates
- Port 3000: Main development server
- Port 8080: Office Add-in testing and sideloading
- Port 9229: Chrome/Edge debugging port
- Office Add-in development tools
- TypeScript and JavaScript support
- ESLint and Prettier for code quality
- Git integration and GitHub support
- Testing frameworks (Jest, Playwright)
- Web development tools
- Open in Gitpod: Your workspace will automatically set up
- Start Dev Server: Run
npm run dev-server - Access Your App: Click the preview URL in Gitpod
- Start Coding: Begin developing your Excel Add-in
# Create a new Excel Add-in project
./scripts/setup-project.sh my-excel-addin
# Navigate to your project
cd projects/my-excel-addin
# Start development
npm run dev-server# Development
npm run dev-server # Start development server
npm run build # Build for production
npm run build:dev # Build for development
# Testing
npm test # Run all tests
npm run test:watch # Run tests in watch mode
npm run test:coverage # Run tests with coverage
# Code Quality
npm run lint # Run ESLint
npm run lint:fix # Fix ESLint issues
npm run format # Format code with Prettier
# Office Add-in Specific
npm run validate # Validate Add-in manifest
npm run sideload # Sideload Add-in to Excel# Build your add-in
npm run build
# Sideload to Excel
npm run sideload- Build your add-in:
npm run build - Create a
manifest.xmlfile - In Excel, go to Insert > Add-ins > Upload My Add-in
- Select your manifest file
- Start your dev server:
npm run dev-server - Open Excel Online
- Go to Insert > Add-ins > Upload My Add-in
- Enter your manifest URL:
https://your-gitpod-url/manifest.xml
- Ensure your add-in is accessible via HTTPS
- Use the sideloading method above
- Your add-in will appear in the Insert tab
Main Gitpod configuration file containing:
- Docker image specification
- Port forwarding configuration
- VS Code extensions
- Environment variables
- Workspace tasks
Custom Docker image with:
- Node.js 20
- TypeScript toolchain
- Office.js development tools
- Pre-configured workspace
Project configuration with:
- Gitpod-specific scripts
- Office.js dependencies
- Development tools
- Build and test configurations
# Check WSL version
wsl --list --verbose
# Update WSL
wsl --update
# Set default version
wsl --set-default-version 2- Check internet connectivity
- Verify Gitpod account status
- Try refreshing the workspace
- Check browser console for errors
- Ensure you're using HTTPS
- Check manifest.xml configuration
- Verify Office.js CDN accessibility
- Check browser console for errors
# Clear npm cache
npm cache clean --force
# Delete node_modules and reinstall
rm -rf node_modules package-lock.json
npm install
# Check for TypeScript errors
npx tsc --noEmit- Check if ports are already in use
- Verify port forwarding in Gitpod
- Try different ports in webpack.config.js
-
Check Documentation:
-
Community Support:
-
Repository Issues:
- Open an issue in this repository
- Check existing issues and solutions
Edit .gitpod.Dockerfile to customize the environment:
# Add custom packages
RUN apt-get update && apt-get install -y your-package
# Install additional Node.js packages
RUN npm install -g your-global-packageAdd ports to .gitpod.yml:
ports:
- port: 3001
onOpen: open-preview
name: "Additional Service"
description: "Custom service port"Add to .gitpod.yml:
env:
- name: CUSTOM_VAR
value: "custom-value"
- name: API_KEY
value: $API_KEY # From Gitpod secretsAdd to .gitpod.yml:
vscode:
settings:
editor.fontSize: 16
editor.tabSize: 4
typescript.preferences.importModuleSpecifier: "relative"- Use Prebuilds: Enable prebuilds for faster workspace startup
- Pin Dependencies: Use exact versions in package.json
- Optimize Images: Keep Docker images small and efficient
- Regular Updates: Keep dependencies and tools updated
- Use Workspace Settings: Configure VS Code settings in .gitpod.yml
- Test in Multiple Environments: Excel Online, Excel Desktop, Excel Mobile
- Use TypeScript: Leverage type safety for better development experience
- Follow Office.js Patterns: Use recommended patterns and best practices
- Handle Errors Gracefully: Implement proper error handling
- Optimize Performance: Use efficient Office.js APIs
- Use Workspace Snapshots: Save your workspace state
- Share Workspaces: Collaborate with team members
- Use Gitpod CLI: Install Gitpod CLI for local development
- Monitor Usage: Keep track of your Gitpod usage
- Backup Important Data: Don't rely solely on Gitpod for data storage
For issues and questions:
- Repository Issues: Create an issue in this repository
- Gitpod Issues: Check Gitpod Support
- Office.js Issues: Check Office Add-ins Documentation
- Community Help: Join the relevant communities above
Happy coding with TypeScript and Excel in Gitpod! 🎉
This guide is part of the TypeScript Excel Development Environment project. For more information, see the main README.md file.