|
| 1 | +# Releasing dingo.nvim |
| 2 | + |
| 3 | +This document describes how to release new versions of the Neovim plugin. |
| 4 | + |
| 5 | +## Distribution Model |
| 6 | + |
| 7 | +The dingo.nvim plugin is distributed as part of the main Dingo repository at `editors/nvim/`. Users can install it in two ways: |
| 8 | + |
| 9 | +### 1. From GitHub (Recommended for Users) |
| 10 | + |
| 11 | +```lua |
| 12 | +-- lazy.nvim with subdir |
| 13 | +{ |
| 14 | + "MadAppGang/dingo", |
| 15 | + subdir = "editors/nvim", |
| 16 | + ft = "dingo", |
| 17 | + config = function() |
| 18 | + require("dingo").setup() |
| 19 | + end, |
| 20 | +} |
| 21 | +``` |
| 22 | + |
| 23 | +### 2. Local Development |
| 24 | + |
| 25 | +```lua |
| 26 | +-- For contributors/testing |
| 27 | +{ |
| 28 | + dir = "~/path/to/dingo/editors/nvim", |
| 29 | + ft = "dingo", |
| 30 | + config = function() |
| 31 | + require("dingo").setup() |
| 32 | + end, |
| 33 | +} |
| 34 | +``` |
| 35 | + |
| 36 | +## Release Checklist |
| 37 | + |
| 38 | +### Before Release |
| 39 | + |
| 40 | +1. **Update version** in `pkg/version/version.go`: |
| 41 | + ```go |
| 42 | + const Version = "0.X.Y" |
| 43 | + ``` |
| 44 | + |
| 45 | +2. **Update CHANGELOG.md**: |
| 46 | + - Move items from `[Unreleased]` to new version section |
| 47 | + - Add release date |
| 48 | + - Update comparison links at bottom |
| 49 | + |
| 50 | +3. **Test the plugin**: |
| 51 | + ```bash |
| 52 | + # Test tree-sitter grammar |
| 53 | + cd editors/nvim/tree-sitter-dingo |
| 54 | + npm install |
| 55 | + npm test |
| 56 | + |
| 57 | + # Test in Neovim |
| 58 | + nvim --clean -u test_init.lua some_file.dingo |
| 59 | + ``` |
| 60 | + |
| 61 | +4. **Verify health checks**: |
| 62 | + ```vim |
| 63 | + :checkhealth dingo |
| 64 | + ``` |
| 65 | + |
| 66 | +5. **Rebuild tree-sitter parser** (if grammar changed): |
| 67 | + ```bash |
| 68 | + cd editors/nvim/tree-sitter-dingo |
| 69 | + npm run build |
| 70 | + ``` |
| 71 | + |
| 72 | +### Release Steps |
| 73 | + |
| 74 | +1. **Commit all changes**: |
| 75 | + ```bash |
| 76 | + git add . |
| 77 | + git commit -m "chore(nvim): prepare release v0.X.Y" |
| 78 | + ``` |
| 79 | + |
| 80 | +2. **Create and push tag**: |
| 81 | + ```bash |
| 82 | + git tag v0.X.Y |
| 83 | + git push origin main |
| 84 | + git push origin v0.X.Y |
| 85 | + ``` |
| 86 | + |
| 87 | +3. **Create GitHub Release** (optional but recommended): |
| 88 | + - Go to https://github.com/MadAppGang/dingo/releases |
| 89 | + - Click "Draft a new release" |
| 90 | + - Select the tag |
| 91 | + - Copy relevant CHANGELOG section to release notes |
| 92 | + - Publish |
| 93 | + |
| 94 | +### Post-Release |
| 95 | + |
| 96 | +1. **Verify installation works**: |
| 97 | + ```lua |
| 98 | + -- Test with fresh install |
| 99 | + { "MadAppGang/dingo", subdir = "editors/nvim", tag = "v0.X.Y" } |
| 100 | + ``` |
| 101 | + |
| 102 | +2. **Update CHANGELOG.md** with `[Unreleased]` section for next cycle |
| 103 | + |
| 104 | +## Tree-sitter Parser Updates |
| 105 | + |
| 106 | +If the grammar changes: |
| 107 | + |
| 108 | +1. **Regenerate parser**: |
| 109 | + ```bash |
| 110 | + cd editors/nvim/tree-sitter-dingo |
| 111 | + npm install |
| 112 | + npx tree-sitter generate |
| 113 | + npm run build |
| 114 | + ``` |
| 115 | + |
| 116 | +2. **Test parsing**: |
| 117 | + ```bash |
| 118 | + npx tree-sitter parse ../../examples/01_error_propagation/http_handler.dingo |
| 119 | + ``` |
| 120 | + |
| 121 | +3. **Rebuild .so file**: |
| 122 | + ```bash |
| 123 | + # The .so is needed for local testing |
| 124 | + cc -shared -o dingo.so -fPIC src/parser.c -I src |
| 125 | + ``` |
| 126 | + |
| 127 | +4. **Commit generated files**: |
| 128 | + ```bash |
| 129 | + git add src/parser.c src/tree_sitter/parser.h dingo.so |
| 130 | + git commit -m "chore(tree-sitter): regenerate parser" |
| 131 | + ``` |
| 132 | + |
| 133 | +## nvim-treesitter Registry (Future) |
| 134 | + |
| 135 | +To get `dingo` into the official nvim-treesitter registry: |
| 136 | + |
| 137 | +1. **Ensure grammar is stable** and well-tested |
| 138 | + |
| 139 | +2. **Create PR to nvim-treesitter**: |
| 140 | + - Fork https://github.com/nvim-treesitter/nvim-treesitter |
| 141 | + - Add dingo to `lua/nvim-treesitter/parsers.lua` |
| 142 | + - Add query files to `queries/dingo/` |
| 143 | + - Submit PR |
| 144 | + |
| 145 | +3. **Parser config format**: |
| 146 | + ```lua |
| 147 | + dingo = { |
| 148 | + install_info = { |
| 149 | + url = "https://github.com/MadAppGang/dingo", |
| 150 | + location = "editors/nvim/tree-sitter-dingo", |
| 151 | + files = { "src/parser.c" }, |
| 152 | + branch = "main", |
| 153 | + }, |
| 154 | + filetype = "dingo", |
| 155 | + maintainers = { "@YourGitHubUsername" }, |
| 156 | + } |
| 157 | + ``` |
| 158 | + |
| 159 | +4. **Required queries** (copy from `editors/nvim/queries/dingo/`): |
| 160 | + - `highlights.scm` - Syntax highlighting |
| 161 | + - `folds.scm` - Code folding |
| 162 | + - `indents.scm` - Auto-indentation |
| 163 | + |
| 164 | +## Version Numbering |
| 165 | + |
| 166 | +Follow semver aligned with Dingo CLI: |
| 167 | + |
| 168 | +- **MAJOR**: Breaking changes to plugin API or config |
| 169 | +- **MINOR**: New features (commands, LSP capabilities) |
| 170 | +- **PATCH**: Bug fixes, query improvements |
| 171 | + |
| 172 | +The nvim plugin version matches Dingo CLI version for simplicity. |
| 173 | + |
| 174 | +## Testing Configurations |
| 175 | + |
| 176 | +### Minimal test config (`test_init.lua`) |
| 177 | + |
| 178 | +```lua |
| 179 | +vim.opt.rtp:prepend("~/path/to/dingo/editors/nvim") |
| 180 | + |
| 181 | +require("dingo").setup({ |
| 182 | + lsp = { enabled = true, log_level = "debug" }, |
| 183 | + format = { on_save = true }, |
| 184 | + lint = { on_save = true }, |
| 185 | +}) |
| 186 | +``` |
| 187 | + |
| 188 | +### Test with: |
| 189 | +```bash |
| 190 | +nvim --clean -u test_init.lua examples/01_error_propagation/http_handler.dingo |
| 191 | +``` |
0 commit comments