diff --git a/.goreleaser.yml b/.goreleaser.yml index 655ef41..f1c9765 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -9,7 +9,7 @@ builds: - -tags=netgo ldflags: - -s -w - - -X github.com/specsnl/specs-cli/pkg/cmd.Version={{ .Version }} + - -X github.com/specsnl/specs-cli/internal/cmd.Version={{ .Version }} env: - CGO_ENABLED=0 goos: [linux, darwin] diff --git a/Dockerfile b/Dockerfile index abdb59a..02654de 100644 --- a/Dockerfile +++ b/Dockerfile @@ -38,7 +38,7 @@ RUN --mount=type=cache,target=/go/pkg/mod \ && CGO_ENABLED=0 GOOS=$GOOS GOARCH=$GOARCH go build \ -trimpath \ -tags netgo \ - -ldflags "-s -w -X ${GO_MODULE}/pkg/cmd.Version=${SPECS_VERSION}" -o ./specs + -ldflags "-s -w -X ${GO_MODULE}/internal/cmd.Version=${SPECS_VERSION}" -o ./specs # Latest version: https://hub.docker.com/_/debian/tags FROM debian:13.4-slim diff --git a/docs/content/docs/architecture/library-decisions.md b/docs/content/docs/architecture/library-decisions.md index 87dab4f..cf07242 100644 --- a/docs/content/docs/architecture/library-decisions.md +++ b/docs/content/docs/architecture/library-decisions.md @@ -17,7 +17,7 @@ weight: 4 ## Interactive Prompts: huh -**Decision:** `charm.land/huh/v2` — full replacement for the old `pkg/prompt`. +**Decision:** `charm.land/huh/v2` — full replacement for the old `internal/prompt`. **Rationale:** - Usable in standalone mode (`form.Run()` blocks like a normal function call). @@ -42,7 +42,7 @@ weight: 4 **Rationale:** - CSS-like chainable API for colour, bold/italic/underline, padding, margins, borders, and alignment. - Handles colour downsampling automatically (24-bit → 8-bit → 4-bit based on terminal capability). -- `pkg/util/output` provides the logger and table renderer on top of lipgloss. +- `internal/util/output` provides the logger and table renderer on top of lipgloss. **Libraries replaced:** - `github.com/fatih/color` @@ -54,7 +54,7 @@ weight: 4 `charm.land/bubbles/v2` is pulled in transitively by huh but is not used directly. -The `specs template list` table renderer (`pkg/util/output/table.go`) is implemented +The `specs template list` table renderer (`internal/util/output/table.go`) is implemented using lipgloss only — auto-sized columns, styled headers, and a border rendered with lipgloss styles. No bubbles table component is used. diff --git a/docs/content/docs/architecture/overview.md b/docs/content/docs/architecture/overview.md index bc24162..62a46eb 100644 --- a/docs/content/docs/architecture/overview.md +++ b/docs/content/docs/architecture/overview.md @@ -23,7 +23,7 @@ weight: 1 specs-cli/ ├── main.go # main() — XDG init, cmd.Execute() ├── go.mod -└── pkg/ +└── internal/ ├── specs/ # global config & constants │ ├── configuration.go # XDG paths, file name constants │ └── errors.go # sentinel errors @@ -244,9 +244,9 @@ flowchart TD --- -## Error Handling (`pkg/specs/errors.go`) +## Error Handling (`internal/specs/errors.go`) -Sentinel errors are declared in `pkg/specs/errors.go` and should always be wrapped with `%w` +Sentinel errors are declared in `internal/specs/errors.go` and should always be wrapped with `%w` so that callers can use `errors.Is` to distinguish them: | Sentinel | Kind string | Raised when | @@ -267,7 +267,7 @@ or `""` when no known sentinel is wrapped. --- -## Output System (`pkg/util/output`) +## Output System (`internal/util/output`) All user-facing output goes through the `output.Writer` interface: @@ -318,16 +318,16 @@ logger. `NewApp()` calls `slog.SetDefault` to install a text handler at `Info` l | Package | Function | Level | Attributes | |---------|----------|-------|------------| -| `pkg/template` | `Get` | Debug | `template`, `keys`, `computed` | -| `pkg/template` | `Execute` | Debug | `path`, `dest`, `action` (render/verbatim/skip) | -| `pkg/template` | `Execute` | Info | `template`, `dest`, `rendered`, `verbatim`, `skipped` (summary) | -| `pkg/template` | `ApplyComputed` | Debug | `key`, `source`="computed" | -| `pkg/hooks` | `Hooks.Run` | Debug | `trigger`, `commands`, `command` | -| `pkg/cmd` | `executeTemplate` | Debug | `key`, `source` (values_file/arg_flag/default/prompt) — one log per key, final source only | -| `pkg/registry` | `Upgrade` | Debug | `template`, `repo`, `branch`, `target_ref`, `latest_version` | -| `pkg/util/git` | `Clone` | Debug | `repo`, `dest`, `branch` (start and complete) | -| `pkg/util/git` | `Describe` | Debug | `dest`, `commit`, `version` (or `error` on failure) | -| `pkg/util/git` | `CheckRemoteContext` | Debug | `repo`, `branch`, `dest`, `up_to_date`, `latest_version`, `error_kind` | +| `internal/template` | `Get` | Debug | `template`, `keys`, `computed` | +| `internal/template` | `Execute` | Debug | `path`, `dest`, `action` (render/verbatim/skip) | +| `internal/template` | `Execute` | Info | `template`, `dest`, `rendered`, `verbatim`, `skipped` (summary) | +| `internal/template` | `ApplyComputed` | Debug | `key`, `source`="computed" | +| `internal/hooks` | `Hooks.Run` | Debug | `trigger`, `commands`, `command` | +| `internal/cmd` | `executeTemplate` | Debug | `key`, `source` (values_file/arg_flag/default/prompt) — one log per key, final source only | +| `internal/registry` | `Upgrade` | Debug | `template`, `repo`, `branch`, `target_ref`, `latest_version` | +| `internal/util/git` | `Clone` | Debug | `repo`, `dest`, `branch` (start and complete) | +| `internal/util/git` | `Describe` | Debug | `dest`, `commit`, `version` (or `error` on failure) | +| `internal/util/git` | `CheckRemoteContext` | Debug | `repo`, `branch`, `dest`, `up_to_date`, `latest_version`, `error_kind` | ### Consistent attribute keys @@ -365,7 +365,7 @@ by `NewApp()` and re-set in `PersistentPreRunE` when `--debug --output=json` swa ## Hooks Execution ```go -// pkg/hooks/hooks.go +// internal/hooks/hooks.go type Hooks struct { PreUse []string // each entry: single command or multiline bash script @@ -392,19 +392,19 @@ func (h *Hooks) Run(trigger, cwd string, ctx map[string]any, funcMap template.Fu | Package | Status | Change | |---------|--------|--------| -| `pkg/specs` | **new** | XDG paths, file name constants, sentinel errors, `KindOf()` (replaces `pkg/boilr`) | -| `pkg/registry` | **new** | on-disk template store: `Entry`, `Load()`, `Upgrade()` | -| `pkg/cmd` | updated | new `use.go`, `template_update.go`, `template_upgrade.go`, iterative conditional prompting; no longer reads project files or `__metadata.json` directly | -| `pkg/template` | updated | configurable delimiters (default `{{ }}`), `context.go`, `verbatim.go`, conditional skip, AST analysis, status; exports `LoadProjectFile()`, `LoadMetadata()`, `SaveMetadata()` | -| `pkg/hooks` | **new** | hook loading and execution | -| `pkg/util/output` | updated | lipgloss-based logger + table renderer; `WriteErr` with JSON `error_kind` for known sentinels (replaces tlog + tabular) | -| `pkg/util/values` | **new** | `--values` file (JSON/YAML) and `--arg` flag parsing | -| `pkg/host` | updated | source format parsing (github:, HTTPS, SSH, local path) | +| `internal/specs` | **new** | XDG paths, file name constants, sentinel errors, `KindOf()` (replaces `pkg/boilr`) | +| `internal/registry` | **new** | on-disk template store: `Entry`, `Load()`, `Upgrade()` | +| `internal/cmd` | updated | new `use.go`, `template_update.go`, `template_upgrade.go`, iterative conditional prompting; no longer reads project files or `__metadata.json` directly | +| `internal/template` | updated | configurable delimiters (default `{{ }}`), `context.go`, `verbatim.go`, conditional skip, AST analysis, status; exports `LoadProjectFile()`, `LoadMetadata()`, `SaveMetadata()` | +| `internal/hooks` | **new** | hook loading and execution | +| `internal/util/output` | updated | lipgloss-based logger + table renderer; `WriteErr` with JSON `error_kind` for known sentinels (replaces tlog + tabular) | +| `internal/util/values` | **new** | `--values` file (JSON/YAML) and `--arg` flag parsing | +| `internal/host` | updated | source format parsing (github:, HTTPS, SSH, local path) | | `pkg/prompt` | **removed** | replaced by `huh` | -| `pkg/util/tlog` | **removed** | replaced by `pkg/util/output` | -| `pkg/util/tabular` | **removed** | replaced by `pkg/util/output` | +| `pkg/util/tlog` | **removed** | replaced by `internal/util/output` | +| `pkg/util/tabular` | **removed** | replaced by `internal/util/output` | | `pkg/util/exec` | **removed** | no longer needed (hooks use `os/exec` directly) | -| `pkg/util/exit` | unchanged | | -| `pkg/util/git` | updated | SSH auth, `CheckRemoteContext()` (context-aware), `Describe()` for status tracking; `RemoteCheckResult.Err()` returns typed sentinel errors | -| `pkg/util/osutil` | updated | `CopyDir()` recursive copy | -| `pkg/util/validate` | updated | `Name()` validator (alphanumeric + hyphens + underscores) | +| `internal/util/exit` | unchanged | | +| `internal/util/git` | updated | SSH auth, `CheckRemoteContext()` (context-aware), `Describe()` for status tracking; `RemoteCheckResult.Err()` returns typed sentinel errors | +| `internal/util/osutil` | updated | `CopyDir()` recursive copy | +| `internal/util/validate` | updated | `Name()` validator (alphanumeric + hyphens + underscores) | diff --git a/docs/content/docs/architecture/template-engine.md b/docs/content/docs/architecture/template-engine.md index d9c35bc..3e1d6e7 100644 --- a/docs/content/docs/architecture/template-engine.md +++ b/docs/content/docs/architecture/template-engine.md @@ -194,7 +194,7 @@ executable in the registry and in every scaffolded output. All of Go's standard `text/template` built-ins are available, plus: -### Custom Functions (`pkg/template/specsregistry.go`) +### Custom Functions (`internal/template/specsregistry.go`) | Function | Signature | Description | |----------|-----------|-------------| @@ -241,7 +241,7 @@ the filesystem beyond their own template directory. ## Iterative Conditional Prompting Before prompting, specs analyses the template file tree's AST to determine which variables -are guarded behind conditions (see `pkg/template/analysis.go`). Prompting is iterative: +are guarded behind conditions (see `internal/template/analysis.go`). Prompting is iterative: 1. **Pass 1** — unconditional variables (always needed, regardless of any condition) 2. **Pass 2+** — each round finds conditional variables whose guard variables are all resolved, diff --git a/docs/operations/release.md b/docs/operations/release.md index 4127648..9a5c1dc 100644 --- a/docs/operations/release.md +++ b/docs/operations/release.md @@ -25,7 +25,7 @@ GoReleaser runs only in the release workflow — not needed for local developmen ## Version Injection ``` --X github.com/specsnl/specs-cli/pkg/cmd.Version= +-X github.com/specsnl/specs-cli/internal/cmd.Version= ``` GoReleaser sets `Version` to the Git tag (e.g. `1.2.3`) automatically through `-ldflags`. @@ -56,7 +56,7 @@ builds: - -tags=netgo ldflags: - -s -w - - -X github.com/specsnl/specs-cli/pkg/cmd.Version={{ .Version }} + - -X github.com/specsnl/specs-cli/internal/cmd.Version={{ .Version }} env: - CGO_ENABLED=0 goos: [linux, darwin] diff --git a/pkg/cmd/app.go b/internal/cmd/app.go similarity index 94% rename from pkg/cmd/app.go rename to internal/cmd/app.go index b189b11..a9e01db 100644 --- a/pkg/cmd/app.go +++ b/internal/cmd/app.go @@ -6,9 +6,9 @@ import ( "os" "time" - pkgtemplate "github.com/specsnl/specs-cli/pkg/template" - pkggit "github.com/specsnl/specs-cli/pkg/util/git" - "github.com/specsnl/specs-cli/pkg/util/output" + pkgtemplate "github.com/specsnl/specs-cli/internal/template" + pkggit "github.com/specsnl/specs-cli/internal/util/git" + "github.com/specsnl/specs-cli/internal/util/output" ) // HandlerFactory creates a slog.Handler wired to the given LevelVar. diff --git a/pkg/cmd/metadata_test.go b/internal/cmd/metadata_test.go similarity index 97% rename from pkg/cmd/metadata_test.go rename to internal/cmd/metadata_test.go index 0fd170d..7894fb1 100644 --- a/pkg/cmd/metadata_test.go +++ b/internal/cmd/metadata_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - pkgtemplate "github.com/specsnl/specs-cli/pkg/template" + pkgtemplate "github.com/specsnl/specs-cli/internal/template" ) func TestWriteMetadata_PreservesSuppliedCreated(t *testing.T) { diff --git a/pkg/cmd/reset_registry.go b/internal/cmd/reset_registry.go similarity index 92% rename from pkg/cmd/reset_registry.go rename to internal/cmd/reset_registry.go index cfb2a7b..882a381 100644 --- a/pkg/cmd/reset_registry.go +++ b/internal/cmd/reset_registry.go @@ -4,7 +4,7 @@ import ( "os" "github.com/spf13/cobra" - "github.com/specsnl/specs-cli/pkg/specs" + "github.com/specsnl/specs-cli/internal/specs" ) func newResetRegistryCmd(app *App) *cobra.Command { diff --git a/pkg/cmd/reset_registry_test.go b/internal/cmd/reset_registry_test.go similarity index 95% rename from pkg/cmd/reset_registry_test.go rename to internal/cmd/reset_registry_test.go index b9c63d4..9d6b7d9 100644 --- a/pkg/cmd/reset_registry_test.go +++ b/internal/cmd/reset_registry_test.go @@ -5,7 +5,7 @@ import ( "path/filepath" "testing" - "github.com/specsnl/specs-cli/pkg/specs" + "github.com/specsnl/specs-cli/internal/specs" ) func TestResetRegistry_WipesAndRecreates(t *testing.T) { diff --git a/pkg/cmd/root.go b/internal/cmd/root.go similarity index 96% rename from pkg/cmd/root.go rename to internal/cmd/root.go index b2b220b..6595ec1 100644 --- a/pkg/cmd/root.go +++ b/internal/cmd/root.go @@ -6,8 +6,8 @@ import ( "github.com/spf13/cobra" - "github.com/specsnl/specs-cli/pkg/specs" - "github.com/specsnl/specs-cli/pkg/util/output" + "github.com/specsnl/specs-cli/internal/specs" + "github.com/specsnl/specs-cli/internal/util/output" ) // Execute creates the root command and runs it with a background context. diff --git a/pkg/cmd/root_test.go b/internal/cmd/root_test.go similarity index 97% rename from pkg/cmd/root_test.go rename to internal/cmd/root_test.go index 95420a1..6e9fea5 100644 --- a/pkg/cmd/root_test.go +++ b/internal/cmd/root_test.go @@ -5,7 +5,7 @@ import ( "strings" "testing" - "github.com/specsnl/specs-cli/pkg/specs" + "github.com/specsnl/specs-cli/internal/specs" ) // executeCmd creates a fresh App and root command, executes it with the given diff --git a/pkg/cmd/template.go b/internal/cmd/template.go similarity index 100% rename from pkg/cmd/template.go rename to internal/cmd/template.go diff --git a/pkg/cmd/template_delete.go b/internal/cmd/template_delete.go similarity index 89% rename from pkg/cmd/template_delete.go rename to internal/cmd/template_delete.go index 9eb2fa4..fabafef 100644 --- a/pkg/cmd/template_delete.go +++ b/internal/cmd/template_delete.go @@ -5,8 +5,8 @@ import ( "os" "github.com/spf13/cobra" - "github.com/specsnl/specs-cli/pkg/specs" - "github.com/specsnl/specs-cli/pkg/util/validate" + "github.com/specsnl/specs-cli/internal/specs" + "github.com/specsnl/specs-cli/internal/util/validate" ) func newTemplateDeleteCmd(app *App) *cobra.Command { diff --git a/pkg/cmd/template_delete_test.go b/internal/cmd/template_delete_test.go similarity index 97% rename from pkg/cmd/template_delete_test.go rename to internal/cmd/template_delete_test.go index 5368190..e9fe0ef 100644 --- a/pkg/cmd/template_delete_test.go +++ b/internal/cmd/template_delete_test.go @@ -4,7 +4,7 @@ import ( "os" "testing" - "github.com/specsnl/specs-cli/pkg/specs" + "github.com/specsnl/specs-cli/internal/specs" ) func TestDelete_Success(t *testing.T) { diff --git a/pkg/cmd/template_download.go b/internal/cmd/template_download.go similarity index 87% rename from pkg/cmd/template_download.go rename to internal/cmd/template_download.go index a97dffa..aaa30e9 100644 --- a/pkg/cmd/template_download.go +++ b/internal/cmd/template_download.go @@ -6,11 +6,11 @@ import ( "time" "github.com/spf13/cobra" - "github.com/specsnl/specs-cli/pkg/host" - "github.com/specsnl/specs-cli/pkg/specs" - pkgtemplate "github.com/specsnl/specs-cli/pkg/template" - pkggit "github.com/specsnl/specs-cli/pkg/util/git" - "github.com/specsnl/specs-cli/pkg/util/validate" + "github.com/specsnl/specs-cli/internal/host" + "github.com/specsnl/specs-cli/internal/specs" + pkgtemplate "github.com/specsnl/specs-cli/internal/template" + pkggit "github.com/specsnl/specs-cli/internal/util/git" + "github.com/specsnl/specs-cli/internal/util/validate" ) func newTemplateDownloadCmd(app *App) *cobra.Command { diff --git a/pkg/cmd/template_download_test.go b/internal/cmd/template_download_test.go similarity index 92% rename from pkg/cmd/template_download_test.go rename to internal/cmd/template_download_test.go index 18f8cc3..76ff3a5 100644 --- a/pkg/cmd/template_download_test.go +++ b/internal/cmd/template_download_test.go @@ -4,7 +4,7 @@ import ( "errors" "testing" - "github.com/specsnl/specs-cli/pkg/specs" + "github.com/specsnl/specs-cli/internal/specs" ) func TestDownload_LocalSourceRejected(t *testing.T) { diff --git a/pkg/cmd/template_list.go b/internal/cmd/template_list.go similarity index 96% rename from pkg/cmd/template_list.go rename to internal/cmd/template_list.go index c384d98..e3a5c78 100644 --- a/pkg/cmd/template_list.go +++ b/internal/cmd/template_list.go @@ -8,9 +8,9 @@ import ( "time" "github.com/spf13/cobra" - "github.com/specsnl/specs-cli/pkg/specs" - pkgtemplate "github.com/specsnl/specs-cli/pkg/template" - pkggit "github.com/specsnl/specs-cli/pkg/util/git" + "github.com/specsnl/specs-cli/internal/specs" + pkgtemplate "github.com/specsnl/specs-cli/internal/template" + pkggit "github.com/specsnl/specs-cli/internal/util/git" "golang.org/x/sync/errgroup" ) diff --git a/pkg/cmd/template_list_test.go b/internal/cmd/template_list_test.go similarity index 98% rename from pkg/cmd/template_list_test.go rename to internal/cmd/template_list_test.go index 0886e01..b9813e7 100644 --- a/pkg/cmd/template_list_test.go +++ b/internal/cmd/template_list_test.go @@ -14,8 +14,8 @@ import ( gogit "github.com/go-git/go-git/v5" "github.com/go-git/go-git/v5/plumbing/object" - pkgtemplate "github.com/specsnl/specs-cli/pkg/template" - pkggit "github.com/specsnl/specs-cli/pkg/util/git" + pkgtemplate "github.com/specsnl/specs-cli/internal/template" + pkggit "github.com/specsnl/specs-cli/internal/util/git" ) // executeCmdWithCheckFn runs the command with a custom checkRemoteFn injected into the App. diff --git a/pkg/cmd/template_rename.go b/internal/cmd/template_rename.go similarity index 90% rename from pkg/cmd/template_rename.go rename to internal/cmd/template_rename.go index f140dd6..6ea2e2f 100644 --- a/pkg/cmd/template_rename.go +++ b/internal/cmd/template_rename.go @@ -5,8 +5,8 @@ import ( "os" "github.com/spf13/cobra" - "github.com/specsnl/specs-cli/pkg/specs" - "github.com/specsnl/specs-cli/pkg/util/validate" + "github.com/specsnl/specs-cli/internal/specs" + "github.com/specsnl/specs-cli/internal/util/validate" ) func newTemplateRenameCmd(app *App) *cobra.Command { diff --git a/pkg/cmd/template_rename_test.go b/internal/cmd/template_rename_test.go similarity index 97% rename from pkg/cmd/template_rename_test.go rename to internal/cmd/template_rename_test.go index e16aec9..17a826a 100644 --- a/pkg/cmd/template_rename_test.go +++ b/internal/cmd/template_rename_test.go @@ -5,7 +5,7 @@ import ( "os" "testing" - "github.com/specsnl/specs-cli/pkg/specs" + "github.com/specsnl/specs-cli/internal/specs" ) func TestRename_Success(t *testing.T) { diff --git a/pkg/cmd/template_save.go b/internal/cmd/template_save.go similarity index 82% rename from pkg/cmd/template_save.go rename to internal/cmd/template_save.go index 6cbc45f..29311b9 100644 --- a/pkg/cmd/template_save.go +++ b/internal/cmd/template_save.go @@ -7,11 +7,11 @@ import ( "time" "github.com/spf13/cobra" - "github.com/specsnl/specs-cli/pkg/specs" - pkgtemplate "github.com/specsnl/specs-cli/pkg/template" - pkggit "github.com/specsnl/specs-cli/pkg/util/git" - "github.com/specsnl/specs-cli/pkg/util/osutil" - "github.com/specsnl/specs-cli/pkg/util/validate" + "github.com/specsnl/specs-cli/internal/specs" + pkgtemplate "github.com/specsnl/specs-cli/internal/template" + pkggit "github.com/specsnl/specs-cli/internal/util/git" + "github.com/specsnl/specs-cli/internal/util/osutil" + "github.com/specsnl/specs-cli/internal/util/validate" ) func newTemplateSaveCmd(app *App) *cobra.Command { diff --git a/pkg/cmd/template_save_test.go b/internal/cmd/template_save_test.go similarity index 96% rename from pkg/cmd/template_save_test.go rename to internal/cmd/template_save_test.go index 4db9674..1997851 100644 --- a/pkg/cmd/template_save_test.go +++ b/internal/cmd/template_save_test.go @@ -8,8 +8,8 @@ import ( "strings" "testing" - "github.com/specsnl/specs-cli/pkg/specs" - pkgtemplate "github.com/specsnl/specs-cli/pkg/template" + "github.com/specsnl/specs-cli/internal/specs" + pkgtemplate "github.com/specsnl/specs-cli/internal/template" ) // makeFakeTemplate creates a minimal template directory structure in dir. diff --git a/pkg/cmd/template_test.go b/internal/cmd/template_test.go similarity index 100% rename from pkg/cmd/template_test.go rename to internal/cmd/template_test.go diff --git a/pkg/cmd/template_update.go b/internal/cmd/template_update.go similarity index 95% rename from pkg/cmd/template_update.go rename to internal/cmd/template_update.go index 3fd8cd9..045bcee 100644 --- a/pkg/cmd/template_update.go +++ b/internal/cmd/template_update.go @@ -7,9 +7,9 @@ import ( "time" "github.com/spf13/cobra" - "github.com/specsnl/specs-cli/pkg/specs" - pkgtemplate "github.com/specsnl/specs-cli/pkg/template" - pkggit "github.com/specsnl/specs-cli/pkg/util/git" + "github.com/specsnl/specs-cli/internal/specs" + pkgtemplate "github.com/specsnl/specs-cli/internal/template" + pkggit "github.com/specsnl/specs-cli/internal/util/git" ) func newTemplateUpdateCmd(app *App) *cobra.Command { diff --git a/pkg/cmd/template_update_test.go b/internal/cmd/template_update_test.go similarity index 98% rename from pkg/cmd/template_update_test.go rename to internal/cmd/template_update_test.go index a9e0199..7f59973 100644 --- a/pkg/cmd/template_update_test.go +++ b/internal/cmd/template_update_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - pkgtemplate "github.com/specsnl/specs-cli/pkg/template" + pkgtemplate "github.com/specsnl/specs-cli/internal/template" ) func TestUpdate_NoArgs_EmptyRegistry(t *testing.T) { diff --git a/pkg/cmd/template_upgrade.go b/internal/cmd/template_upgrade.go similarity index 92% rename from pkg/cmd/template_upgrade.go rename to internal/cmd/template_upgrade.go index 332d1d1..92718fa 100644 --- a/pkg/cmd/template_upgrade.go +++ b/internal/cmd/template_upgrade.go @@ -4,8 +4,8 @@ import ( "os" "github.com/spf13/cobra" - "github.com/specsnl/specs-cli/pkg/registry" - "github.com/specsnl/specs-cli/pkg/specs" + "github.com/specsnl/specs-cli/internal/registry" + "github.com/specsnl/specs-cli/internal/specs" ) func newTemplateUpgradeCmd(app *App) *cobra.Command { diff --git a/pkg/cmd/template_upgrade_test.go b/internal/cmd/template_upgrade_test.go similarity index 97% rename from pkg/cmd/template_upgrade_test.go rename to internal/cmd/template_upgrade_test.go index 271d9a5..52dfa10 100644 --- a/pkg/cmd/template_upgrade_test.go +++ b/internal/cmd/template_upgrade_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - pkgtemplate "github.com/specsnl/specs-cli/pkg/template" + pkgtemplate "github.com/specsnl/specs-cli/internal/template" ) func TestUpgrade_LocalSkipped(t *testing.T) { diff --git a/pkg/cmd/template_use.go b/internal/cmd/template_use.go similarity index 97% rename from pkg/cmd/template_use.go rename to internal/cmd/template_use.go index 485104b..b08a7a5 100644 --- a/pkg/cmd/template_use.go +++ b/internal/cmd/template_use.go @@ -11,12 +11,12 @@ import ( "charm.land/huh/v2" "github.com/spf13/cobra" - "github.com/specsnl/specs-cli/pkg/hooks" - "github.com/specsnl/specs-cli/pkg/specs" - pkgtemplate "github.com/specsnl/specs-cli/pkg/template" - "github.com/specsnl/specs-cli/pkg/util/osutil" - "github.com/specsnl/specs-cli/pkg/util/validate" - "github.com/specsnl/specs-cli/pkg/util/values" + "github.com/specsnl/specs-cli/internal/hooks" + "github.com/specsnl/specs-cli/internal/specs" + pkgtemplate "github.com/specsnl/specs-cli/internal/template" + "github.com/specsnl/specs-cli/internal/util/osutil" + "github.com/specsnl/specs-cli/internal/util/validate" + "github.com/specsnl/specs-cli/internal/util/values" ) type executeOpts struct { diff --git a/pkg/cmd/template_use_test.go b/internal/cmd/template_use_test.go similarity index 99% rename from pkg/cmd/template_use_test.go rename to internal/cmd/template_use_test.go index d759b7d..60a3f85 100644 --- a/pkg/cmd/template_use_test.go +++ b/internal/cmd/template_use_test.go @@ -8,7 +8,7 @@ import ( "strings" "testing" - "github.com/specsnl/specs-cli/pkg/specs" + "github.com/specsnl/specs-cli/internal/specs" ) // makeTemplateWithVar creates a template directory with a single string variable diff --git a/pkg/cmd/template_validate.go b/internal/cmd/template_validate.go similarity index 93% rename from pkg/cmd/template_validate.go rename to internal/cmd/template_validate.go index ee95764..9b9ee20 100644 --- a/pkg/cmd/template_validate.go +++ b/internal/cmd/template_validate.go @@ -8,9 +8,9 @@ import ( "path/filepath" "github.com/spf13/cobra" - "github.com/specsnl/specs-cli/pkg/specs" - pkgtemplate "github.com/specsnl/specs-cli/pkg/template" - "github.com/specsnl/specs-cli/pkg/util/exit" + "github.com/specsnl/specs-cli/internal/specs" + pkgtemplate "github.com/specsnl/specs-cli/internal/template" + "github.com/specsnl/specs-cli/internal/util/exit" ) func newTemplateValidateCmd(app *App) *cobra.Command { diff --git a/pkg/cmd/template_validate_test.go b/internal/cmd/template_validate_test.go similarity index 99% rename from pkg/cmd/template_validate_test.go rename to internal/cmd/template_validate_test.go index 7b74ca1..4b94943 100644 --- a/pkg/cmd/template_validate_test.go +++ b/internal/cmd/template_validate_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/specsnl/specs-cli/pkg/util/exit" + "github.com/specsnl/specs-cli/internal/util/exit" ) func TestValidate_ValidTemplate(t *testing.T) { diff --git a/pkg/cmd/testhelpers_test.go b/internal/cmd/testhelpers_test.go similarity index 89% rename from pkg/cmd/testhelpers_test.go rename to internal/cmd/testhelpers_test.go index 58b53b7..b0371a7 100644 --- a/pkg/cmd/testhelpers_test.go +++ b/internal/cmd/testhelpers_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/adrg/xdg" - "github.com/specsnl/specs-cli/pkg/specs" + "github.com/specsnl/specs-cli/internal/specs" ) // withTempRegistry sets XDG_CONFIG_HOME to a temp directory and reloads xdg, diff --git a/pkg/cmd/testmain_test.go b/internal/cmd/testmain_test.go similarity index 100% rename from pkg/cmd/testmain_test.go rename to internal/cmd/testmain_test.go diff --git a/pkg/cmd/use.go b/internal/cmd/use.go similarity index 94% rename from pkg/cmd/use.go rename to internal/cmd/use.go index ad69f8d..990834b 100644 --- a/pkg/cmd/use.go +++ b/internal/cmd/use.go @@ -7,9 +7,9 @@ import ( "github.com/spf13/cobra" - "github.com/specsnl/specs-cli/pkg/host" - pkggit "github.com/specsnl/specs-cli/pkg/util/git" - "github.com/specsnl/specs-cli/pkg/util/osutil" + "github.com/specsnl/specs-cli/internal/host" + pkggit "github.com/specsnl/specs-cli/internal/util/git" + "github.com/specsnl/specs-cli/internal/util/osutil" ) func newUseCmd(app *App) *cobra.Command { diff --git a/pkg/cmd/use_test.go b/internal/cmd/use_test.go similarity index 99% rename from pkg/cmd/use_test.go rename to internal/cmd/use_test.go index 8df4279..cb352f4 100644 --- a/pkg/cmd/use_test.go +++ b/internal/cmd/use_test.go @@ -6,7 +6,7 @@ import ( "path/filepath" "testing" - "github.com/specsnl/specs-cli/pkg/specs" + "github.com/specsnl/specs-cli/internal/specs" ) // buildMinimalTemplate creates a valid template root in dir with the given project.yaml diff --git a/pkg/cmd/version.go b/internal/cmd/version.go similarity index 93% rename from pkg/cmd/version.go rename to internal/cmd/version.go index 563601d..18b118a 100644 --- a/pkg/cmd/version.go +++ b/internal/cmd/version.go @@ -5,7 +5,7 @@ import ( ) // Version is the current binary version. -// Set at build time via: -ldflags "-X github.com/specsnl/specs-cli/pkg/cmd.Version=1.0.0" +// Set at build time via: -ldflags "-X github.com/specsnl/specs-cli/internal/cmd.Version=1.0.0" var Version = "dev" func newVersionCmd(app *App) *cobra.Command { diff --git a/pkg/cmd/version_test.go b/internal/cmd/version_test.go similarity index 100% rename from pkg/cmd/version_test.go rename to internal/cmd/version_test.go diff --git a/pkg/hooks/hooks.go b/internal/hooks/hooks.go similarity index 99% rename from pkg/hooks/hooks.go rename to internal/hooks/hooks.go index 8cc6ed3..766122c 100644 --- a/pkg/hooks/hooks.go +++ b/internal/hooks/hooks.go @@ -10,7 +10,7 @@ import ( "strings" "text/template" - "github.com/specsnl/specs-cli/pkg/specs" + "github.com/specsnl/specs-cli/internal/specs" ) // Hooks holds the pre-use and post-use command lists. diff --git a/pkg/hooks/hooks_test.go b/internal/hooks/hooks_test.go similarity index 99% rename from pkg/hooks/hooks_test.go rename to internal/hooks/hooks_test.go index 52ea365..e04957f 100644 --- a/pkg/hooks/hooks_test.go +++ b/internal/hooks/hooks_test.go @@ -10,7 +10,7 @@ import ( "testing" "text/template" - "github.com/specsnl/specs-cli/pkg/specs" + "github.com/specsnl/specs-cli/internal/specs" ) func TestMain(m *testing.M) { diff --git a/pkg/host/source.go b/internal/host/source.go similarity index 100% rename from pkg/host/source.go rename to internal/host/source.go diff --git a/pkg/host/source_test.go b/internal/host/source_test.go similarity index 99% rename from pkg/host/source_test.go rename to internal/host/source_test.go index bc7ec79..5af3af4 100644 --- a/pkg/host/source_test.go +++ b/internal/host/source_test.go @@ -3,7 +3,7 @@ package host_test import ( "testing" - "github.com/specsnl/specs-cli/pkg/host" + "github.com/specsnl/specs-cli/internal/host" ) func TestParse(t *testing.T) { diff --git a/pkg/registry/helpers_test.go b/internal/registry/helpers_test.go similarity index 100% rename from pkg/registry/helpers_test.go rename to internal/registry/helpers_test.go diff --git a/pkg/registry/registry.go b/internal/registry/registry.go similarity index 96% rename from pkg/registry/registry.go rename to internal/registry/registry.go index 83467df..00c25d7 100644 --- a/pkg/registry/registry.go +++ b/internal/registry/registry.go @@ -6,9 +6,9 @@ import ( "os" "strings" - "github.com/specsnl/specs-cli/pkg/specs" - pkgtemplate "github.com/specsnl/specs-cli/pkg/template" - pkggit "github.com/specsnl/specs-cli/pkg/util/git" + "github.com/specsnl/specs-cli/internal/specs" + pkgtemplate "github.com/specsnl/specs-cli/internal/template" + pkggit "github.com/specsnl/specs-cli/internal/util/git" ) // Entry represents a registered template with its metadata and cached remote status. diff --git a/pkg/registry/registry_test.go b/internal/registry/registry_test.go similarity index 96% rename from pkg/registry/registry_test.go rename to internal/registry/registry_test.go index 497c1cb..2ad4634 100644 --- a/pkg/registry/registry_test.go +++ b/internal/registry/registry_test.go @@ -8,9 +8,9 @@ import ( "time" "github.com/adrg/xdg" - "github.com/specsnl/specs-cli/pkg/registry" - "github.com/specsnl/specs-cli/pkg/specs" - pkgtemplate "github.com/specsnl/specs-cli/pkg/template" + "github.com/specsnl/specs-cli/internal/registry" + "github.com/specsnl/specs-cli/internal/specs" + pkgtemplate "github.com/specsnl/specs-cli/internal/template" ) // withTempRegistry redirects the XDG config home to a temp directory so diff --git a/pkg/specs/configuration.go b/internal/specs/configuration.go similarity index 100% rename from pkg/specs/configuration.go rename to internal/specs/configuration.go diff --git a/pkg/specs/configuration_test.go b/internal/specs/configuration_test.go similarity index 93% rename from pkg/specs/configuration_test.go rename to internal/specs/configuration_test.go index 093f8b6..c836096 100644 --- a/pkg/specs/configuration_test.go +++ b/internal/specs/configuration_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/adrg/xdg" - "github.com/specsnl/specs-cli/pkg/specs" + "github.com/specsnl/specs-cli/internal/specs" ) func TestConfigDir_XDGOverride(t *testing.T) { diff --git a/pkg/specs/delimiters.go b/internal/specs/delimiters.go similarity index 100% rename from pkg/specs/delimiters.go rename to internal/specs/delimiters.go diff --git a/pkg/specs/errors.go b/internal/specs/errors.go similarity index 100% rename from pkg/specs/errors.go rename to internal/specs/errors.go diff --git a/pkg/specs/errors_test.go b/internal/specs/errors_test.go similarity index 98% rename from pkg/specs/errors_test.go rename to internal/specs/errors_test.go index a6b421e..db22872 100644 --- a/pkg/specs/errors_test.go +++ b/internal/specs/errors_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/specsnl/specs-cli/pkg/specs" + "github.com/specsnl/specs-cli/internal/specs" ) func TestKindOf_KnownSentinels(t *testing.T) { diff --git a/pkg/template/analysis.go b/internal/template/analysis.go similarity index 99% rename from pkg/template/analysis.go rename to internal/template/analysis.go index 5473cde..b030611 100644 --- a/pkg/template/analysis.go +++ b/internal/template/analysis.go @@ -10,7 +10,7 @@ import ( texttemplate "text/template" "text/template/parse" - "github.com/specsnl/specs-cli/pkg/specs" + "github.com/specsnl/specs-cli/internal/specs" ) // Conditionals maps a schema variable name to the condition that must be true for diff --git a/pkg/template/analysis_test.go b/internal/template/analysis_test.go similarity index 99% rename from pkg/template/analysis_test.go rename to internal/template/analysis_test.go index d0d62f1..97cae00 100644 --- a/pkg/template/analysis_test.go +++ b/internal/template/analysis_test.go @@ -5,7 +5,7 @@ import ( "path/filepath" "testing" - pkgtemplate "github.com/specsnl/specs-cli/pkg/template" + pkgtemplate "github.com/specsnl/specs-cli/internal/template" ) // buildAnalysisTemplate creates a minimal template root for analysis tests. diff --git a/pkg/template/cond.go b/internal/template/cond.go similarity index 100% rename from pkg/template/cond.go rename to internal/template/cond.go diff --git a/pkg/template/cond_test.go b/internal/template/cond_test.go similarity index 100% rename from pkg/template/cond_test.go rename to internal/template/cond_test.go diff --git a/pkg/template/context.go b/internal/template/context.go similarity index 99% rename from pkg/template/context.go rename to internal/template/context.go index d9f0dec..8db5e9d 100644 --- a/pkg/template/context.go +++ b/internal/template/context.go @@ -14,7 +14,7 @@ import ( "gopkg.in/yaml.v3" - "github.com/specsnl/specs-cli/pkg/specs" + "github.com/specsnl/specs-cli/internal/specs" ) // LoadUserContext loads project.yaml (or project.json as fallback) from templateRoot. diff --git a/pkg/template/context_test.go b/internal/template/context_test.go similarity index 99% rename from pkg/template/context_test.go rename to internal/template/context_test.go index 01b1781..475d256 100644 --- a/pkg/template/context_test.go +++ b/internal/template/context_test.go @@ -6,8 +6,8 @@ import ( "path/filepath" "testing" - "github.com/specsnl/specs-cli/pkg/specs" - pkgtemplate "github.com/specsnl/specs-cli/pkg/template" + "github.com/specsnl/specs-cli/internal/specs" + pkgtemplate "github.com/specsnl/specs-cli/internal/template" ) func writeProjectYAML(t *testing.T, dir, content string) { diff --git a/pkg/template/functions.go b/internal/template/functions.go similarity index 100% rename from pkg/template/functions.go rename to internal/template/functions.go diff --git a/pkg/template/functions_test.go b/internal/template/functions_test.go similarity index 97% rename from pkg/template/functions_test.go rename to internal/template/functions_test.go index 458ca25..af1ef80 100644 --- a/pkg/template/functions_test.go +++ b/internal/template/functions_test.go @@ -3,7 +3,7 @@ package template_test import ( "testing" - pkgtemplate "github.com/specsnl/specs-cli/pkg/template" + pkgtemplate "github.com/specsnl/specs-cli/internal/template" ) // --- FuncMap presence --- diff --git a/pkg/template/helpers_test.go b/internal/template/helpers_test.go similarity index 100% rename from pkg/template/helpers_test.go rename to internal/template/helpers_test.go diff --git a/pkg/template/metadata.go b/internal/template/metadata.go similarity index 98% rename from pkg/template/metadata.go rename to internal/template/metadata.go index 29bea9c..f716d7e 100644 --- a/pkg/template/metadata.go +++ b/internal/template/metadata.go @@ -7,7 +7,7 @@ import ( "path/filepath" "time" - "github.com/specsnl/specs-cli/pkg/specs" + "github.com/specsnl/specs-cli/internal/specs" ) // Metadata is stored in __metadata.json inside each registered template. diff --git a/pkg/template/metadata_test.go b/internal/template/metadata_test.go similarity index 98% rename from pkg/template/metadata_test.go rename to internal/template/metadata_test.go index 053f665..2b88bf7 100644 --- a/pkg/template/metadata_test.go +++ b/internal/template/metadata_test.go @@ -8,8 +8,8 @@ import ( "testing" "time" - pkgtemplate "github.com/specsnl/specs-cli/pkg/template" - "github.com/specsnl/specs-cli/pkg/specs" + pkgtemplate "github.com/specsnl/specs-cli/internal/template" + "github.com/specsnl/specs-cli/internal/specs" ) // --- JSONTime.MarshalJSON / UnmarshalJSON --- diff --git a/pkg/template/specsregistry.go b/internal/template/specsregistry.go similarity index 100% rename from pkg/template/specsregistry.go rename to internal/template/specsregistry.go diff --git a/pkg/template/specsregistry_test.go b/internal/template/specsregistry_test.go similarity index 97% rename from pkg/template/specsregistry_test.go rename to internal/template/specsregistry_test.go index ad23a61..c431db1 100644 --- a/pkg/template/specsregistry_test.go +++ b/internal/template/specsregistry_test.go @@ -4,7 +4,7 @@ import ( "testing" texttemplate "text/template" - pkgtemplate "github.com/specsnl/specs-cli/pkg/template" + pkgtemplate "github.com/specsnl/specs-cli/internal/template" ) func newRegistry() *pkgtemplate.SpecsRegistry { diff --git a/pkg/template/status.go b/internal/template/status.go similarity index 93% rename from pkg/template/status.go rename to internal/template/status.go index 0c9e12e..3abeed9 100644 --- a/pkg/template/status.go +++ b/internal/template/status.go @@ -6,8 +6,8 @@ import ( "path/filepath" "time" - "github.com/specsnl/specs-cli/pkg/specs" - pkggit "github.com/specsnl/specs-cli/pkg/util/git" + "github.com/specsnl/specs-cli/internal/specs" + pkggit "github.com/specsnl/specs-cli/internal/util/git" ) // TemplateStatus is the cached result of the most recent remote status check. diff --git a/pkg/template/status_test.go b/internal/template/status_test.go similarity index 100% rename from pkg/template/status_test.go rename to internal/template/status_test.go diff --git a/pkg/template/template.go b/internal/template/template.go similarity index 99% rename from pkg/template/template.go rename to internal/template/template.go index 9e0cf1b..81d799e 100644 --- a/pkg/template/template.go +++ b/internal/template/template.go @@ -12,7 +12,7 @@ import ( texttemplate "text/template" "unicode/utf8" - "github.com/specsnl/specs-cli/pkg/specs" + "github.com/specsnl/specs-cli/internal/specs" ) // Config holds options that control template loading and execution behaviour. diff --git a/pkg/template/template_test.go b/internal/template/template_test.go similarity index 99% rename from pkg/template/template_test.go rename to internal/template/template_test.go index a88dc98..ad56599 100644 --- a/pkg/template/template_test.go +++ b/internal/template/template_test.go @@ -5,7 +5,7 @@ import ( "path/filepath" "testing" - pkgtemplate "github.com/specsnl/specs-cli/pkg/template" + pkgtemplate "github.com/specsnl/specs-cli/internal/template" ) // buildTemplate creates a minimal template root in a temp dir. diff --git a/pkg/template/validate.go b/internal/template/validate.go similarity index 98% rename from pkg/template/validate.go rename to internal/template/validate.go index 6e51f66..bc4b45d 100644 --- a/pkg/template/validate.go +++ b/internal/template/validate.go @@ -8,7 +8,7 @@ import ( "path/filepath" "sort" - "github.com/specsnl/specs-cli/pkg/specs" + "github.com/specsnl/specs-cli/internal/specs" ) // Sentinel errors identifying each kind of validation issue. diff --git a/pkg/template/verbatim.go b/internal/template/verbatim.go similarity index 96% rename from pkg/template/verbatim.go rename to internal/template/verbatim.go index baf7b99..a914553 100644 --- a/pkg/template/verbatim.go +++ b/internal/template/verbatim.go @@ -8,7 +8,7 @@ import ( "github.com/danwakefield/fnmatch" - "github.com/specsnl/specs-cli/pkg/specs" + "github.com/specsnl/specs-cli/internal/specs" ) // VerbatimRules holds glob patterns loaded from .specsverbatim. diff --git a/pkg/template/verbatim_test.go b/internal/template/verbatim_test.go similarity index 98% rename from pkg/template/verbatim_test.go rename to internal/template/verbatim_test.go index f75be36..8272e78 100644 --- a/pkg/template/verbatim_test.go +++ b/internal/template/verbatim_test.go @@ -5,7 +5,7 @@ import ( "path/filepath" "testing" - pkgtemplate "github.com/specsnl/specs-cli/pkg/template" + pkgtemplate "github.com/specsnl/specs-cli/internal/template" ) func TestLoadVerbatim_MissingFile(t *testing.T) { diff --git a/pkg/util/exit/exit.go b/internal/util/exit/exit.go similarity index 100% rename from pkg/util/exit/exit.go rename to internal/util/exit/exit.go diff --git a/pkg/util/git/describe_test.go b/internal/util/git/describe_test.go similarity index 99% rename from pkg/util/git/describe_test.go rename to internal/util/git/describe_test.go index 2d2e814..0d9866f 100644 --- a/pkg/util/git/describe_test.go +++ b/internal/util/git/describe_test.go @@ -10,7 +10,7 @@ import ( gogit "github.com/go-git/go-git/v5" "github.com/go-git/go-git/v5/plumbing" "github.com/go-git/go-git/v5/plumbing/object" - pkggit "github.com/specsnl/specs-cli/pkg/util/git" + pkggit "github.com/specsnl/specs-cli/internal/util/git" ) var testSig = &object.Signature{ diff --git a/pkg/util/git/git.go b/internal/util/git/git.go similarity index 100% rename from pkg/util/git/git.go rename to internal/util/git/git.go diff --git a/pkg/util/git/git_test.go b/internal/util/git/git_test.go similarity index 97% rename from pkg/util/git/git_test.go rename to internal/util/git/git_test.go index d925115..9e4934d 100644 --- a/pkg/util/git/git_test.go +++ b/internal/util/git/git_test.go @@ -6,7 +6,7 @@ import ( "os" "testing" - pkggit "github.com/specsnl/specs-cli/pkg/util/git" + pkggit "github.com/specsnl/specs-cli/internal/util/git" ) // TestClone_ShallowClone clones a small public repository and verifies the result. diff --git a/pkg/util/git/helpers_test.go b/internal/util/git/helpers_test.go similarity index 100% rename from pkg/util/git/helpers_test.go rename to internal/util/git/helpers_test.go diff --git a/pkg/util/git/remote_check_test.go b/internal/util/git/remote_check_test.go similarity index 100% rename from pkg/util/git/remote_check_test.go rename to internal/util/git/remote_check_test.go diff --git a/pkg/util/osutil/osutil.go b/internal/util/osutil/osutil.go similarity index 100% rename from pkg/util/osutil/osutil.go rename to internal/util/osutil/osutil.go diff --git a/pkg/util/osutil/osutil_test.go b/internal/util/osutil/osutil_test.go similarity index 97% rename from pkg/util/osutil/osutil_test.go rename to internal/util/osutil/osutil_test.go index 3a72b27..de606a3 100644 --- a/pkg/util/osutil/osutil_test.go +++ b/internal/util/osutil/osutil_test.go @@ -5,7 +5,7 @@ import ( "path/filepath" "testing" - "github.com/specsnl/specs-cli/pkg/util/osutil" + "github.com/specsnl/specs-cli/internal/util/osutil" ) func TestCopyDir_PreservesStructure(t *testing.T) { diff --git a/pkg/util/output/log.go b/internal/util/output/log.go similarity index 100% rename from pkg/util/output/log.go rename to internal/util/output/log.go diff --git a/pkg/util/output/log_test.go b/internal/util/output/log_test.go similarity index 97% rename from pkg/util/output/log_test.go rename to internal/util/output/log_test.go index 1731c87..3d4dd27 100644 --- a/pkg/util/output/log_test.go +++ b/internal/util/output/log_test.go @@ -6,8 +6,8 @@ import ( "strings" "testing" - "github.com/specsnl/specs-cli/pkg/specs" - "github.com/specsnl/specs-cli/pkg/util/output" + "github.com/specsnl/specs-cli/internal/specs" + "github.com/specsnl/specs-cli/internal/util/output" ) func TestHumanWriter_Info_NonEmpty(t *testing.T) { diff --git a/pkg/util/output/table.go b/internal/util/output/table.go similarity index 100% rename from pkg/util/output/table.go rename to internal/util/output/table.go diff --git a/pkg/util/output/table_test.go b/internal/util/output/table_test.go similarity index 93% rename from pkg/util/output/table_test.go rename to internal/util/output/table_test.go index f687c4e..bf7204a 100644 --- a/pkg/util/output/table_test.go +++ b/internal/util/output/table_test.go @@ -4,7 +4,7 @@ import ( "strings" "testing" - "github.com/specsnl/specs-cli/pkg/util/output" + "github.com/specsnl/specs-cli/internal/util/output" ) func TestRenderTable_ContainsHeaders(t *testing.T) { diff --git a/pkg/util/output/writer.go b/internal/util/output/writer.go similarity index 98% rename from pkg/util/output/writer.go rename to internal/util/output/writer.go index 7e8f07f..8c5bc62 100644 --- a/pkg/util/output/writer.go +++ b/internal/util/output/writer.go @@ -7,7 +7,7 @@ import ( "os" "charm.land/lipgloss/v2" - "github.com/specsnl/specs-cli/pkg/specs" + "github.com/specsnl/specs-cli/internal/specs" ) var ( diff --git a/pkg/util/validate/validate.go b/internal/util/validate/validate.go similarity index 100% rename from pkg/util/validate/validate.go rename to internal/util/validate/validate.go diff --git a/pkg/util/validate/validate_test.go b/internal/util/validate/validate_test.go similarity index 92% rename from pkg/util/validate/validate_test.go rename to internal/util/validate/validate_test.go index 61c1512..30cf164 100644 --- a/pkg/util/validate/validate_test.go +++ b/internal/util/validate/validate_test.go @@ -3,7 +3,7 @@ package validate_test import ( "testing" - "github.com/specsnl/specs-cli/pkg/util/validate" + "github.com/specsnl/specs-cli/internal/util/validate" ) func TestName_Valid(t *testing.T) { diff --git a/pkg/util/values/values.go b/internal/util/values/values.go similarity index 100% rename from pkg/util/values/values.go rename to internal/util/values/values.go diff --git a/pkg/util/values/values_test.go b/internal/util/values/values_test.go similarity index 98% rename from pkg/util/values/values_test.go rename to internal/util/values/values_test.go index b313165..f9f6cd7 100644 --- a/pkg/util/values/values_test.go +++ b/internal/util/values/values_test.go @@ -6,7 +6,7 @@ import ( "path/filepath" "testing" - "github.com/specsnl/specs-cli/pkg/util/values" + "github.com/specsnl/specs-cli/internal/util/values" ) func TestLoadFile_Valid(t *testing.T) { diff --git a/main.go b/main.go index fa7b261..53e9b98 100644 --- a/main.go +++ b/main.go @@ -7,8 +7,8 @@ import ( "os/signal" "syscall" - "github.com/specsnl/specs-cli/pkg/cmd" - "github.com/specsnl/specs-cli/pkg/util/exit" + "github.com/specsnl/specs-cli/internal/cmd" + "github.com/specsnl/specs-cli/internal/util/exit" ) func main() {