The excel-dev-helper.sh script is a comprehensive command-line tool designed to streamline TypeScript Excel Add-in development. It provides an interactive menu system and command-line interface for managing projects, running development servers, and configuring your environment.
./scripts/excel-dev-helper.sh- ✅ Interactive menu system
- ✅ Project creation and management
- ✅ Development server control
- ✅ Build automation
- ✅ Test execution
- ✅ Environment setup and validation
- ✅ Node.js installation helper
- ✅ Global tools installation
The script will check for:
- Node.js 20+ (can be installed via the script)
- npm (comes with Node.js)
- Git (required)
Run without arguments to launch the interactive menu:
./scripts/excel-dev-helper.shThis displays a menu with options:
- Create New Project
- List Projects
- Start Dev Server
- Build Project
- Run Tests
- Install Node.js
- Install Global Tools
- Environment Info
- Quick Start Guide
- Exit
./scripts/excel-dev-helper.sh install-nodeInstalls Node.js 20 from NodeSource repository.
./scripts/excel-dev-helper.sh create my-excel-appOr use aliases:
./scripts/excel-dev-helper.sh new my-excel-appCreates a new Excel Add-in project with:
- Complete directory structure
- TypeScript configuration
- Webpack setup
- Jest testing framework
- ESLint and Prettier
- Sample Office.js code
./scripts/excel-dev-helper.sh listOr use alias:
./scripts/excel-dev-helper.sh lsShows all projects in the ./projects/ directory with descriptions.
./scripts/excel-dev-helper.sh start my-excel-appOr use aliases:
./scripts/excel-dev-helper.sh dev my-excel-app
./scripts/excel-dev-helper.sh serve my-excel-appStarts the Webpack dev server on port 3000 with hot module reloading.
# Production build
./scripts/excel-dev-helper.sh build my-excel-app
# Development build
./scripts/excel-dev-helper.sh build my-excel-app developmentBuilds the project to the dist/ directory.
./scripts/excel-dev-helper.sh test my-excel-appRuns Jest tests for the specified project.
./scripts/excel-dev-helper.sh installOr use alias:
./scripts/excel-dev-helper.sh toolsInstalls global npm packages:
- TypeScript
- ts-node
- Webpack & Webpack CLI
- Office.js development tools
./scripts/excel-dev-helper.sh infoOr use alias:
./scripts/excel-dev-helper.sh envDisplays:
- Node.js version
- npm version
- Git version
- TypeScript version
- Working directory
- Gitpod status (if applicable)
./scripts/excel-dev-helper.sh helpOr use alias:
./scripts/excel-dev-helper.sh guideShows a quick reference guide.
# 1. Install Node.js (if not already installed)
./scripts/excel-dev-helper.sh install-node
# 2. Install global development tools
./scripts/excel-dev-helper.sh install
# 3. Create a new project
./scripts/excel-dev-helper.sh create my-first-addin
# 4. Start development
./scripts/excel-dev-helper.sh start my-first-addin# List available projects
./scripts/excel-dev-helper.sh list
# Start working on a project
./scripts/excel-dev-helper.sh start my-excel-app
# In another terminal, run tests
./scripts/excel-dev-helper.sh test my-excel-app
# Build for production
./scripts/excel-dev-helper.sh build my-excel-app# Launch interactive menu
./scripts/excel-dev-helper.sh
# Follow prompts to:
# - Create projects
# - Start servers
# - Run builds
# - Execute testsWhen you create a new project, the script generates:
projects/my-excel-app/
├── src/
│ ├── index.ts # Main TypeScript entry point
│ ├── index.html # HTML template
│ ├── components/ # UI components
│ ├── utils/ # Utility functions
│ ├── types/ # TypeScript type definitions
│ └── services/ # Business logic
├── tests/ # Jest test files
├── assets/ # Static resources
│ ├── images/
│ ├── icons/
│ └── css/
├── docs/ # Project documentation
├── dist/ # Build output (generated)
├── package.json # Dependencies and scripts
├── tsconfig.json # TypeScript configuration
├── webpack.config.js # Webpack configuration
├── jest.config.js # Jest configuration
├── .eslintrc.js # ESLint rules
├── .prettierrc # Prettier configuration
└── README.md # Project documentation
Once inside a project directory, you can use:
npm run dev-server # Start dev server with hot reload
npm run build # Production build
npm run build:dev # Development build
npm start # Start development server
npm test # Run tests
npm run test:watch # Run tests in watch mode
npm run test:coverage # Run tests with coverage report
npm run lint # Check code quality
npm run lint:fix # Fix ESLint issues
npm run format # Format code with Prettier
npm run validate # Validate Office Add-in manifest
npm run sideload # Sideload Add-in to ExcelThe script respects:
GITPOD_WORKSPACE_ID- Detects Gitpod environmentGITPOD_WORKSPACE_URL- Shows Gitpod workspace URL
If you see "Node.js not found":
./scripts/excel-dev-helper.sh install-nodeIf you get permission errors:
chmod +x ./scripts/excel-dev-helper.shIf global tool installation fails:
# Try with sudo (if not in container)
sudo npm install -g typescript webpack webpack-cli
# Or use the script's install function
./scripts/excel-dev-helper.sh installIf port 3000 is already in use:
- Stop the existing server
- Or modify
webpack.config.jsin your project to use a different port
Ensure you're in the repository root:
cd /workspaces/typescript-excel-devcontainer
./scripts/excel-dev-helper.sh list-
Use Interactive Mode for Exploration: When learning, use the interactive menu to discover features.
-
Use Command-Line Mode for Automation: In scripts or CI/CD, use direct commands.
-
Check Environment First: Run
./scripts/excel-dev-helper.sh infoto verify your setup. -
Install Global Tools Once: After installing Node.js, run the global tools installer once per environment.
-
Keep Projects Organized: All projects live in
./projects/directory. -
Use Descriptive Names: Project names should be lowercase with hyphens (e.g.,
my-excel-calculator).
The helper script works alongside existing scripts:
setup-project.sh- Called internally by the helperbuild-all.sh- Build all projects at oncetest-all.sh- Test all projects at oncegitpod-setup.sh- Gitpod environment initialization
# Production build (default)
./scripts/excel-dev-helper.sh build my-app
# Development build (with source maps)
./scripts/excel-dev-helper.sh build my-app development# Create multiple projects
for name in calculator converter analyzer; do
./scripts/excel-dev-helper.sh create excel-$name
done
# Build all projects
cd projects
for dir in */; do
cd "$dir"
npm run build
cd ..
done#!/bin/bash
# Example: Automated project setup
./scripts/excel-dev-helper.sh create my-new-app
cd projects/my-new-app
npm install
npm run build
npm testFor issues or questions:
- Check the troubleshooting section
- Review the main README.md
- Check docs/troubleshooting.md
- Open an issue in the repository
Happy Excel Add-in Development! 🚀