Commit graph

6 commits

Author SHA1 Message Date
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
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
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
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