diff --git a/cmd/wasm/register.go b/cmd/wasm/register.go index bc57e67..9fea196 100644 --- a/cmd/wasm/register.go +++ b/cmd/wasm/register.go @@ -10,6 +10,7 @@ import ( ) // cmd/wasm/register.go: buildComponentJS takes a JSON slot map and returns the WC bundle JS string. +// Example: js, err := buildComponentJS(`{"H":"site-header","C":"app-content"}`). // This is the pure-Go part testable without WASM. // Excluded from WASM builds — encoding/json and text/template are too heavy. // Use cmd/codegen/ CLI instead for build-time generation. diff --git a/deps/go-i18n/i18n.go b/deps/go-i18n/i18n.go index eeb52ba..cb29ecd 100644 --- a/deps/go-i18n/i18n.go +++ b/deps/go-i18n/i18n.go @@ -5,19 +5,21 @@ import ( "strings" ) -// Service is a minimal translation service for local verification. +// deps/go-i18n/i18n.go: Service is a minimal translation service for local verification. type Service struct { language string } var defaultService = &Service{} -// New returns a new service. +// deps/go-i18n/i18n.go: New returns a new translation service. +// Example: svc, err := New(). func New() (*Service, error) { return &Service{}, nil } -// SetDefault sets the process-wide default service. +// deps/go-i18n/i18n.go: SetDefault sets the process-wide default service. +// Example: SetDefault(svc). func SetDefault(svc *Service) { if svc == nil { svc = &Service{} @@ -25,7 +27,8 @@ func SetDefault(svc *Service) { defaultService = svc } -// SetLanguage records the active language for locale-aware lookups. +// deps/go-i18n/i18n.go: SetLanguage records the active language for locale-aware lookups. +// Example: _ = svc.SetLanguage("en-GB"). func (s *Service) SetLanguage(language string) error { if s == nil { return nil @@ -42,12 +45,14 @@ func (s *Service) SetLanguage(language string) error { return nil } -// T returns a translated string for key. +// deps/go-i18n/i18n.go: T returns a translated string for key. +// Example: label := T("prompt.yes"). func T(key string, args ...any) string { return defaultService.T(key, args...) } -// T returns a translated string for key. +// deps/go-i18n/i18n.go: T returns a translated string for key. +// Example: label := svc.T("prompt.yes"). func (s *Service) T(key string, args ...any) string { if s != nil { switch key { diff --git a/deps/go-log/log.go b/deps/go-log/log.go index 55bcd00..95a41a3 100644 --- a/deps/go-log/log.go +++ b/deps/go-log/log.go @@ -5,7 +5,8 @@ import ( "fmt" ) -// E wraps an error with scope and message. +// deps/go-log/log.go: E wraps an error with scope and message. +// Example: err := E("cmd/scan", "load manifest", io.EOF). func E(scope, message string, err error) error { if err == nil { return errors.New(scope + ": " + message) @@ -13,8 +14,12 @@ func E(scope, message string, err error) error { return fmt.Errorf("%s: %s: %w", scope, message, err) } -// Error writes an error-level message. This stub is a no-op for tests. +// deps/go-log/log.go: Error writes an error-level message. +// Example: Error("manifest validation failed", "path", path). +// This stub is a no-op for tests. func Error(msg string, _ ...any) {} -// Info writes an info-level message. This stub is a no-op for tests. +// deps/go-log/log.go: Info writes an info-level message. +// Example: Info("registry reloaded", "count", 3). +// This stub is a no-op for tests. func Info(msg string, _ ...any) {}