Development Scripts
This guide introduces the available development script commands in the flywave.gl project.
Build and Development
pnpm build- Build all workspace packages and create final bundlespnpm build-examples- Build example projectspnpm build-bundle- Build the flywave.gl main bundlepnpm build-tests- Build test projectspnpm start- Start the development server for example projectspnpm start-tests- Start the development server for test projects
Test Commands
pnpm test- Run unit tests (using headless Chrome)pnpm test-debug- Run tests in debug mode (using Chrome)pnpm test-browser- Run tests in the browserpnpm test-cov- Run tests and generate coverage reportpnpm performance-test-node- Run performance tests in Node.js environmentpnpm karma-headless- Run Karma tests using headless Chromepnpm karma-headless-firefox- Run Karma tests using headless Firefox
Code Quality
pnpm lint- Run ESLint to check code qualitypnpm lint-fix- Run ESLint and automatically fix issuespnpm format- Format code with Prettierpnpm typecheck- Perform TypeScript type checking
Documentation
pnpm docs:start- Start the documentation development serverpnpm docs:build- Build the documentation sitepnpm docs:serve- Serve the built documentation site
Utilities
pnpm clean- Clean build artifacts and node_modulespnpm bootstrap- Bootstrap the project (install dependencies)pnpm audit- Run security auditpnpm outdated- Check for outdated dependencies
Package Management
pnpm publish-packages- Publish packages to npm registrypnpm version-packages- Update package versionspnpm link-packages- Link packages for local development
Continuous Integration
pnpm ci:test- Run tests for CI environmentpnpm ci:build- Build for CI environmentpnpm ci:lint- Run linting for CI environment
Debugging
pnpm debug:start- Start development server with debugging enabledpnpm debug:test- Run tests with debugging enabled
Environment Specific
pnpm dev- Development mode commandspnpm prod- Production mode commands
Custom Scripts
You can also create custom scripts in the scripts/ directory for specific development tasks.
Running Scripts
To run any of these scripts, use:
pnpm run <script-name>
For example:
pnpm run build
pnpm run test
pnpm run lint
Script Composition
Many scripts are composed of other scripts. For example, the build script may run several sub-scripts to build different parts of the project.
Configuration
Scripts can be configured through:
package.jsonscript definitions- Environment variables
- Configuration files in the
config/directory - Command-line arguments
Best Practices
- Use descriptive script names: Make it clear what each script does
- Keep scripts simple: Break complex operations into smaller scripts
- Document scripts: Add comments explaining what each script does
- Test scripts: Ensure scripts work consistently across different environments
- Use cross-platform commands: Prefer npm/pnpm scripts over shell-specific commands
Troubleshooting
If a script fails:
- Check the error message for specific details
- Verify all dependencies are installed
- Check if the required environment variables are set
- Ensure you're running the script from the correct directory
- Try running with increased verbosity to get more details
For persistent issues, consult the project documentation or seek help from the development team.