Commit 6758764
feat: move plugin system to global scope and add lifecycle management (#55)
* Initial plan
* refactor: Move plugin system to global scope
- Plugins now install to global user data directory instead of local node_modules
- Removed dependency on local package.json for plugin loading
- Updated all plugin commands (load/unload/sync/list) to use global directory
- Updated plugin loader to scan global plugins directory
- Updated integration tests to work with global plugin system
Co-authored-by: vobu <6573426+vobu@users.noreply.github.com>
* fix: Improve plugin name extraction from URLs
- Extract actual package name from package.json in node_modules
- Scan installed plugins to find the correct package name
- Fall back to URL-based name extraction if needed
Co-authored-by: vobu <6573426+vobu@users.noreply.github.com>
* refactor: Address code review feedback
- Simplify extractPackageNameFromUrl to scan node_modules first
- Remove duplicate path logic for scoped packages
- Rename packageName to scopedPackageName for clarity in listPlugins
Co-authored-by: vobu <6573426+vobu@users.noreply.github.com>
* refactor: Extract hasPluginFile helper and improve naming
- Add hasPluginFile() helper to eliminate duplicate logic
- Rename scopedPackageName to packageNameWithScope for clarity
- Use consistent helper function across all plugin checks
Co-authored-by: vobu <6573426+vobu@users.noreply.github.com>
* wip: Potential fix for code scanning alert no. 3: Shell command built from environment values
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
* feat: Add plugin lifecycle commands and scaffolding
- Add upgrade/downgrade commands for plugin version management
- Add init plugin command to scaffold TypeScript plugin templates
- Create default-plugins directory with hello-world example plugin
- Load default plugins automatically on startup
- Expose c8ctl runtime properties directly for plugin compatibility
- Update help documentation with new plugin commands
Co-authored-by: vobu <6573426+vobu@users.noreply.github.com>
* docs: Update README with new plugin lifecycle commands
- Document init plugin command for scaffolding
- Document upgrade/downgrade commands
- Add section on plugin development
- Mention default plugins
Co-authored-by: vobu <6573426+vobu@users.noreply.github.com>
* refactor: Simplify plugin scanning with functional approach
- Extract helper functions for plugin validation and scanning
- Replace nested if-else with functional forEach and filter
- Improve code readability and maintainability
- No functional changes, all tests pass
Co-authored-by: vobu <6573426+vobu@users.noreply.github.com>
* test: Add comprehensive plugin lifecycle integration test
- Test full lifecycle: init, build, load, execute, help
- Dogfoods c8ctl init plugin command
- Verifies TypeScript compilation works
- Tests plugin command execution and help integration
- Fix tsconfig exclude to allow build to work
Co-authored-by: vobu <6573426+vobu@users.noreply.github.com>
* chore: Add test plugin directories to gitignore
- Ignore c8ctl-test-* directories
- Ignore test-plugin-temp directory
- Remove accidentally committed test scaffold
Co-authored-by: vobu <6573426+vobu@users.noreply.github.com>
* wip: potential fix for code scanning alert no. 4: Shell command built from environment values
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
* fix: Update bullet points to dashes in plugin API features output
* docs: Improve README formatting and clarify plugin creation instructions
* fix: Add upgrade, downgrade, and init commands to plugin management and shell completions
* docs: Update plugin help and README to include macOS installation paths and clarify plugin registry locations
* test: Add test for plugin command precedence
- Verify that plugins cannot override built-in commands
- Built-in commands always execute first
- Plugin with conflicting command name is ignored
- Test passes validating correct behavior
Co-authored-by: vobu <6573426+vobu@users.noreply.github.com>
* wip: potential fix for code scanning alert no. 5: Shell command built from environment values
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
* build: Include default-plugins in distribution
- Add copy-plugins script to copy default-plugins to dist/ during build
- Update plugin-loader to check both dev and prod paths for default-plugins
- Ensure default-plugins are bundled with transpiled JS in dist/
- Verified with npm pack --dry-run that plugins are included
- Both dev mode (node src/index.ts) and built mode (node dist/index.js) work correctly
Co-authored-by: vobu <6573426+vobu@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: vobu <6573426+vobu@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: Volker Buzek <dev@metalodge.com>1 parent d03dd29 commit 6758764
File tree
18 files changed
+1368
-115
lines changed- default-plugins/hello-world
- src
- commands
- tests
- integration
- unit
18 files changed
+1368
-115
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
9 | 46 | | |
10 | 47 | | |
11 | | - | |
| 48 | + | |
12 | 49 | | |
13 | 50 | | |
14 | 51 | | |
| |||
83 | 120 | | |
84 | 121 | | |
85 | 122 | | |
| 123 | + | |
86 | 124 | | |
87 | 125 | | |
88 | 126 | | |
| |||
95 | 133 | | |
96 | 134 | | |
97 | 135 | | |
| 136 | + | |
98 | 137 | | |
99 | 138 | | |
100 | 139 | | |
| |||
121 | 160 | | |
122 | 161 | | |
123 | 162 | | |
| 163 | + | |
124 | 164 | | |
125 | 165 | | |
126 | 166 | | |
| |||
150 | 190 | | |
151 | 191 | | |
152 | 192 | | |
153 | | - | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
154 | 225 | | |
155 | 226 | | |
156 | 227 | | |
157 | 228 | | |
| 229 | + | |
158 | 230 | | |
159 | 231 | | |
160 | 232 | | |
161 | 233 | | |
162 | 234 | | |
163 | 235 | | |
164 | 236 | | |
| 237 | + | |
165 | 238 | | |
166 | 239 | | |
167 | 240 | | |
168 | 241 | | |
169 | 242 | | |
170 | 243 | | |
171 | | - | |
| 244 | + | |
| 245 | + | |
172 | 246 | | |
173 | 247 | | |
174 | 248 | | |
| |||
179 | 253 | | |
180 | 254 | | |
181 | 255 | | |
182 | | - | |
| 256 | + | |
| 257 | + | |
183 | 258 | | |
184 | 259 | | |
185 | 260 | | |
186 | 261 | | |
187 | | - | |
| 262 | + | |
| 263 | + | |
188 | 264 | | |
189 | 265 | | |
190 | 266 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
309 | | - | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
310 | 322 | | |
311 | 323 | | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
312 | 327 | | |
313 | 328 | | |
314 | 329 | | |
| |||
318 | 333 | | |
319 | 334 | | |
320 | 335 | | |
321 | | - | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
322 | 344 | | |
323 | 345 | | |
324 | 346 | | |
| |||
333 | 355 | | |
334 | 356 | | |
335 | 357 | | |
336 | | - | |
337 | | - | |
338 | | - | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
339 | 366 | | |
340 | 367 | | |
341 | | - | |
342 | | - | |
| 368 | + | |
| 369 | + | |
343 | 370 | | |
344 | 371 | | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
345 | 378 | | |
346 | 379 | | |
347 | 380 | | |
348 | 381 | | |
349 | 382 | | |
350 | | - | |
| 383 | + | |
351 | 384 | | |
352 | 385 | | |
353 | 386 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
0 commit comments