|
| 1 | +# 🤝 Contributing to LaunchMap |
| 2 | + |
| 3 | +Thank you for your interest in contributing to LaunchMap! |
| 4 | +Contributions of all kinds, features, bug fixes, tests, docs, and feedback are welcome! |
| 5 | + |
| 6 | +--- |
| 7 | + |
| 8 | +## 🛠️ Project Structure |
| 9 | +```txt |
| 10 | +launchmap/ |
| 11 | +├── parser/ # Python-based static launch file parser |
| 12 | +├── src/ # VS Code extension (TypeScript) |
| 13 | +├── webview/ # Webview frontend (HTML/JS) |
| 14 | +``` |
| 15 | + |
| 16 | +--- |
| 17 | + |
| 18 | +## ⚙️ Setup Instructions |
| 19 | + |
| 20 | +### Installation |
| 21 | + |
| 22 | +```bash |
| 23 | +# Clone the repo |
| 24 | +git clone https://github.com/Kodo-Robotics/launchmap |
| 25 | +cd launchmap |
| 26 | + |
| 27 | +# Python setup |
| 28 | +python3 -m venv .venv |
| 29 | +source .venv/bin/activate |
| 30 | +pip install -r parser/requirements.txt |
| 31 | + |
| 32 | +# Node setup |
| 33 | +npm install |
| 34 | +``` |
| 35 | + |
| 36 | +### Running |
| 37 | + |
| 38 | +Here is how you can get the extension running and see the output: |
| 39 | + |
| 40 | +1. Compile the code |
| 41 | +```bash |
| 42 | +npm run compile |
| 43 | +``` |
| 44 | +This converts the TypeScript code into JavaScript so VS Code can run it. |
| 45 | + |
| 46 | +2. Start the extension in a debug VS Code window |
| 47 | + - Open the file `src/extension.ts`. |
| 48 | + - Press F5 (or go to Run and Debug → Launch Extension). |
| 49 | + |
| 50 | +This launches a new VS Code window with the extension loaded in "dev mode" so you can test your changes live. |
| 51 | + |
| 52 | +3. Open a sample launch file |
| 53 | + - In the new debug VS Code window, navigate to: |
| 54 | +`parser/tests/real_cases/launch_files/` |
| 55 | + - Open any `.launch.py` file (these are real world test cases). |
| 56 | + |
| 57 | +4. Run the LaunchMap visualizer |
| 58 | + - Press `Cmd + Shift + P` (or `Ctrl + Shift + P` on Windows/Linux). |
| 59 | + - Search for `LaunchMap: Open Launch Visualizer` and run it. |
| 60 | + |
| 61 | +You should now see the visualization output. |
| 62 | + |
| 63 | +--- |
| 64 | + |
| 65 | +## 🧹 Linting & Code Style |
| 66 | + |
| 67 | +We use: |
| 68 | +- `ruff` for Python (ultra-fast linter + formatter) |
| 69 | +- `eslint` for TypeScript/JavaScript |
| 70 | + |
| 71 | +### 🔍 Run Python Lint (parser) |
| 72 | + |
| 73 | +```bash |
| 74 | +# Test |
| 75 | +npm run lint:py |
| 76 | + |
| 77 | +# Fix |
| 78 | +npm run lint:py:fix |
| 79 | +``` |
| 80 | + |
| 81 | +### 🔍 Run JS/TS Lint (extension + webview) |
| 82 | + |
| 83 | +```bash |
| 84 | +# Test |
| 85 | +npm run lint:js |
| 86 | + |
| 87 | +# Fix |
| 88 | +npm run lint:js:fix |
| 89 | +``` |
| 90 | + |
| 91 | +--- |
| 92 | + |
| 93 | +## 🧪 Running Tests |
| 94 | + |
| 95 | +```bash |
| 96 | +# Parser Tests |
| 97 | +npm run test:parser |
| 98 | + |
| 99 | +# Webview Visual Tests |
| 100 | +npm run test:webview |
| 101 | + |
| 102 | +# Extension Integration Tests |
| 103 | +npm run test:src |
| 104 | +``` |
| 105 | + |
| 106 | +### ⚠️ Notes on Snapshot Testing |
| 107 | +- Visual snapshots are stored under `webview/tests/__screenshots__/` |
| 108 | +- Snapshots may differ between macOS, Windows, and Linux |
| 109 | +- Snapshots are only validated on PRs in CI (Linux) |
| 110 | +- If you are on macOS/Windows, avoid committing updated snapshots unless necessary |
| 111 | + |
| 112 | +--- |
| 113 | + |
| 114 | +## 💡 Tips |
| 115 | +- Prefer small, focused PRs |
| 116 | +- Follow lint rules strictly (ruff and eslint) |
| 117 | +- Playwright tests are validated automatically on PRs |
| 118 | +- Use `npx playwright test --update-snapshots` only on Linux for visual diffs |
| 119 | + |
| 120 | +--- |
| 121 | + |
| 122 | +## 📬 Questions? |
| 123 | +- Join our [Discord Server](https://discord.gg/EK3pHZxrKy) |
| 124 | +- Ask on GitHub |
| 125 | + |
| 126 | +Thanks again for contributing! 🚀 |
0 commit comments