Commit graph

26 commits

Author SHA1 Message Date
3b412a0a6b
Refactor version tracking to separate validation and update logic
- Split ValidateAndUpdateVersion into validation-only function
- Add dedicated UpdatePluginCtlVersion function for version updates
- Update updateassets command to use new version update function
- Improve separation of concerns and code maintainability

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-31 12:14:45 +02:00
353cc9efc7
Add version tracking and validation to prevent downgrade issues
Store the last pluginctl version used in plugin.json props and validate
before running commands. Prevents issues when using older pluginctl
versions on plugins modified by newer versions.

- Add Version field to PluginCtlConfig struct
- Implement version validation before command execution
- Add WritePluginManifest and SavePluginCtlConfig helper functions
- Add comprehensive tests for version comparison logic
- Skip validation for 'version' command and when no plugin.json exists

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-31 11:54:46 +02:00
9d3c6b357f
Integrate manifest apply into build system
Update build makefiles to include manifest apply command in build pipeline:
- Add apply target to deploy.mk that runs pluginctl manifest apply
- Update dist target in build.mk to run apply before building
- Update test and coverage targets in test.mk to run apply before testing

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-31 11:21:34 +02:00
5df921238e
fix: template substitions 2025-07-30 17:44:22 +02:00
dee239a3d4
Refactor help system to consolidate error messages and command-specific help
- Simplify main help to show brief command descriptions only
- Add --help support to all commands with detailed usage information
- Replace duplicated help text in error messages with error + help pattern
- Remove 'help' command in favor of consistent --help flag usage
- Add helper functions CheckForHelpFlag() and ShowErrorWithHelp() for standardization
- Refactor deploy command to reduce cognitive complexity and improve maintainability

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-28 19:20:36 +02:00
59dd709d83
chroe: updated webapp files 2025-07-28 18:01:22 +02:00
6403d1a51d
Add manifest apply command to generate server and webapp manifest files
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-28 18:00:41 +02:00
0bc6d51b24
Refactor manifest command to use template-based field access
Replace individual subcommands (id, version, has_server, has_webapp) with
a unified 'get {{.field_name}}' pattern that uses Go templates to access
any field from the manifest JSON dynamically.

- Update manifest.go to parse and execute Go templates against manifest data
- Update makefile calls in _setup.mk and versioning.mk to use new syntax
- Update help documentation to reflect template-based usage
- Provides more flexibility for accessing any manifest field without code changes

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-28 17:50:42 +02:00
18bfca1c2c
Add non-interactive flag support to create-plugin command
- Add --name and --module flags for non-interactive plugin creation
- Implement flag parsing and validation using existing validation functions
- Support plugin names with or without mattermost-plugin- prefix
- Maintain backward compatibility with interactive mode as fallback
- Update help text and examples to document new flag options

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-28 16:50:42 +02:00
07f21c6812
Add create-plugin command and improve asset management
- Add new create-plugin command to generate plugins from starter template
- Add manifest name subcommand for template context
- Replace hardcoded asset paths with explicit file patterns in embed directive
- Refactor asset build system to use _setup.mk instead of setup.mk
- Update versioning to use pluginctl manifest id for APP_NAME
- Clean up Makefile by removing redundant bundle name definition

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-28 16:02:57 +02:00
d7ac783efc
Fix parseGoModule function to use strings.SplitSeq and improve efficiency
- Update parseGoModule to use strings.SplitSeq for better performance
- Change GoModule.Module field to GoModule.Name for consistency
- Use strings.CutPrefix instead of HasPrefix + TrimPrefix pattern
- Add early break after parsing go version line
- Update template references to use .GoModule.Name instead of .GoModule

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-15 14:45:11 +02:00
2e2a95d7d6
Add GoModule support to template context and update gitignore
- Add GoModule struct with Module and Version fields
- Parse go.mod file to extract module name and Go version
- Expose GoModule in template context as {{.GoModule}}
- Update asset templates to use {{.GoModule}} instead of hardcoded values
- Add gitignore pattern for testdata directories (keep only plugin.json files)
- All templates now have access to both manifest and Go module information

Templates can now use:
- {{.GoModule.Module}} for module name
- {{.GoModule.Version}} for Go version
- {{if .GoModule}}...{{end}} for conditional logic

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-14 22:16:41 +02:00
04fa4154b3
Upgrade updateassets command to use templates with manifest context
- Convert all asset files to be processed as Go templates
- Expose plugin manifest data via .Manifest key in template context
- Add template processing infrastructure with TemplateContext struct
- Update asset processing pipeline to execute templates instead of direct file copying
- Fix info command output format to use plain text instead of structured logging
- All tests passing with proper error handling and backward compatibility

This enables dynamic asset files that can access plugin manifest properties
like {{.Manifest.Id}}, {{.Manifest.Version}}, and conditional logic based
on plugin configuration.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-14 21:33:58 +02:00
03c521f237
Fix linting issues in manifest.go and plugin_test.go
- Add blank line before return statement in manifest.go
- Fix table formatting alignment in plugin_test.go

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-14 19:19:11 +02:00
278958d1e4
Add deploy command to upload and enable plugin bundles
- New deploy.go implements RunDeployCommand function
- Auto-discovers plugin bundle from ./dist/ folder based on manifest
- Supports --bundle-path flag for custom bundle location
- Reuses existing client connection logic for server authentication
- Updated main.go to register deploy command and add help documentation
- Follows existing patterns for error handling and structured logging

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-14 19:17:25 +02:00
6639dad2d6
Add check subcommand to manifest command
- Add 'check' case to manifest command that validates plugin manifest
  using manifest.IsValid()
- Return appropriate exit codes: 0 for valid, 1 for invalid manifests
- Update help text and error messages to include the new subcommand
- Log validation results using structured logging

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-14 17:53:47 +02:00
873bf78c22
Add custom parser for props["pluginctl"] with ignore assets support
- Add PluginCtlConfig struct with IgnoreAssets field for glob patterns
- Add ParsePluginCtlConfig function to parse manifest props["pluginctl"]
- Update updateassets command to respect ignore patterns with glob matching
- Add comprehensive logging when files are skipped due to ignore patterns
- Support patterns like *.test.js, build/, node_modules for flexible exclusion
- Add extensive tests for config parsing and path matching functionality
- Maintain backward compatibility with existing manifests
- Fix Makefile check-changes target and add logger init to tests

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-14 17:38:38 +02:00
4d9c958fc9
moved test json files to folders 2025-07-14 17:24:32 +02:00
71a7b0de11
Refactor codebase with improved structure and logging
- Restructured info.go with extracted helper functions for better readability
- Enhanced updateassets.go with cleaner asset processing logic and better error handling
- Improved client.go formatting and logging consistency
- Added logs.go for centralized logging functionality
- Updated dependencies in go.mod to include tint as direct dependency
- Cleaned up README.md with simplified installation instructions and structure
- Added comprehensive assets/ directory with build configuration

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-14 17:14:12 +02:00
c01c9c2843
Add manifest command with subcommands for plugin information
- Add manifest command with id, version, has_server, has_webapp subcommands
- Provides simple text output for easy parsing/scripting
- Update help documentation with usage examples
- Follow existing command patterns and architecture

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-14 17:13:08 +02:00
3cbe5e4a9f
Compacted README.md
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-09 17:04:27 +02:00
4f0b94354c
Compacted CLAUDE.md file
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-09 16:58:34 +02:00
73149001eb
Replace logging system with slog and tint for structured colored output
- Add logger.go with public Logger variable and InitLogger function
- Replace all fmt.Printf/fmt.Fprintf calls with structured Logger.Info/Logger.Error
- Initialize logger in main function for consistent access across packages
- Keep fmt.Errorf for proper error creation (standard Go practice)
- Add tint dependency for colorized terminal output with timestamps
- Convert user output to structured logging with key-value pairs
- Update info command to use structured logging for plugin details
- Update updateassets command to use structured progress logging
- Update version command to use structured logging
- Update authentication logging in client.go with structured fields
- Update enable/disable commands to use structured logging
- Remove unused fmt imports after conversion

All output now uses slog with tint for beautiful, structured, colorized logging
while maintaining proper error handling with fmt.Errorf for error creation.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-09 16:51:40 +02:00
b43e7ac3ec
Add updateassets command with webapp code detection
- Add updateassets command to update plugin files from embedded assets
- Only include webapp assets if plugin manifest indicates webapp code presence
- Compare file contents before updating to avoid unnecessary writes
- Display count of updated files in completion message

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-09 16:38:26 +02:00
1ea8f2b38a
Add enable/disable/reset commands 2025-07-09 14:01:23 +02:00
fd6e4a4513
Initial implementation of pluginctl CLI tool
- Add comprehensive info command with plugin manifest parsing -
Implement global --plugin-path flag and PLUGINCTL_PLUGIN_PATH env var -
Add full test suite with fixtures for various plugin configurations -
Set up build system with Makefile, goreleaser, and golangci-lint -
Include development tools with pinned versions for reproducible builds

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-08 14:30:09 +02:00