Skip to content

Configurable file names for embedding applications#1

Merged
panyam merged 1 commit into
mainfrom
configurable-tool-names
Mar 30, 2026
Merged

Configurable file names for embedding applications#1
panyam merged 1 commit into
mainfrom
configurable-tool-names

Conversation

@panyam

@panyam panyam commented Mar 30, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add ToolInfo struct and parameterized variants of key library functions so embedding apps (like slyds) can customize config file names, vendor directory names, lock file names, and all generated content branding
  • Original functions (FindVendorConfig, LoadVendorConfig, WriteVendorReadme, WriteLockFile) preserved as backward-compatible wrappers — zero breaking changes
  • CLI updated to use library constants (DefaultLockFile) instead of hardcoded strings
  • Added CI/CD: test workflow on push/PR, release workflow via goreleaser on tag push
  • Added pre-push hook running go test ./...
  • All GitHub Actions pinned by SHA for supply chain security

Closes panyam/slyds#34 (templar side — slyds integration is a separate PR)

New APIs

Default (templar) Configurable (embedding)
FindVendorConfig(dir) FindVendorConfigWithNames(dir, names)
LoadVendorConfig(path) LoadVendorConfigWithDefaults(path, info)
WriteVendorReadme(dir) WriteVendorReadmeFor(dir, info)
WriteLockFile(path, lock) WriteLockFileFor(path, lock, info)

Test plan

  • 11 new tests written (TDD — verified they fail before implementation, pass after)
  • All existing tests pass unchanged (backward compatibility)
  • go test ./... passes
  • go build ./cmd/templar succeeds
  • CI workflow runs on this PR

Add ToolInfo struct and parameterized variants of key library functions
so embedding apps (like slyds) can customize config file names, vendor
directory names, lock file names, and generated content branding.

New APIs:
- FindVendorConfigWithNames(startDir, configNames)
- LoadVendorConfigWithDefaults(path, ToolInfo)
- WriteVendorReadmeFor(vendorDir, ToolInfo)
- WriteLockFileFor(path, lock, ToolInfo)

Original functions preserved as backward-compatible wrappers.
CLI updated to use library constants (DefaultLockFile).

Also adds:
- CI workflow (test on push/PR, release on tag via goreleaser)
- Pre-push hook running tests
- SHA-pinned GitHub Actions for supply chain security
@panyam panyam merged commit c242331 into main Mar 30, 2026
1 check passed
@panyam panyam deleted the configurable-tool-names branch March 30, 2026 01:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Phase 6: Templar library — configurable file names for embedding apps

1 participant