Skip to content

Commit

Permalink
refactor: new repo structure (#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
ankithans committed Jul 29, 2021
1 parent 6f6f078 commit db597db
Show file tree
Hide file tree
Showing 16 changed files with 19 additions and 13 deletions.
10 changes: 9 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ The following should be to be installed on your device in order to contribute to

## Development

### Folder Structure
Charmil repository contains a number of components that can be consumed independently. In the root directory, the following folders can be found:

- **cli** -command line tool for using charmil.
- **core** - charmil SDK
- **starter** - charmil starter template project
- **validator** - validator and linter library to test cobra commands

### Running Charmil CLI Commands
You can run the CLI commands files directly with go run. All commands and subcommands are in the ./pkg/cmd folder.
```bash
Expand All @@ -32,4 +40,4 @@ Runs unit tests
- You can join [Aerogear’s discord server](https://discord.gg/hsDJUPkAWH) to participate in the discussions happening

## License
By contributing, you agree that your contributions will be licensed under its Apache License 2.0
By contributing, you agree that your contributions will be licensed under its Apache License 2.0
13 changes: 6 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,36 @@ help:
@echo ""
@echo "make lint run golangci-lint"
@echo "make test run tests"
@echo "make format format files"
@echo "make format format files"
@echo "make build build files"
@echo "make setup/git/hooks setup git hooks"
.PHONY: help

run:
go run ./cmd/charmil
go run ./cli/cmd/charmil

build:
go build ./cmd/charmil
go build ./cli/cmd/charmil

install:
go install ./cmd/charmil
go install ./cli/cmd/charmil

build/tags:
go build -tags ${TAGS} ./cmd/charmil
go build -tags ${TAGS} ./cli/cmd/charmil

test:
go test ./...

# Requires golangci-lint to be installed @ $(go env GOPATH)/bin/golangci-lint
# https://golangci-lint.run/usage/install/
lint:
golangci-lint run cmd/... pkg/...
golangci-lint run ./...
.PHONY: lint


# clean up code and dependencies
format:
@go mod tidy

@gofmt -w `find . -type f -name '*.go'`
.PHONY: format

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 2 additions & 3 deletions cmd/charmil/main.go → cli/cmd/charmil/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@ import (
"log"
"os"

"github.com/aerogear/charmil/cli/internal/cmd/crud"
"github.com/aerogear/charmil/cli/internal/cmd/root"
c "github.com/aerogear/charmil/core/config"
"github.com/aerogear/charmil/core/factory"
"github.com/aerogear/charmil/core/localize"

"github.com/spf13/cobra"
"golang.org/x/text/language"

"github.com/aerogear/charmil/pkg/cmd/crud"
"github.com/aerogear/charmil/pkg/cmd/root"
)

// Defines the configuration keys of the host CLI.
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/crud/crud.go → cli/internal/cmd/crud/crud.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"os"
"path/filepath"

"github.com/aerogear/charmil/cli/internal/template/crud"
"github.com/aerogear/charmil/core/factory"
"github.com/aerogear/charmil/pkg/template/crud"
"github.com/spf13/cobra"
)

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion pkg/cmd/root/root.go → cli/internal/cmd/root/root.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package root

import (
initialize "github.com/aerogear/charmil/cli/internal/cmd/init"
"github.com/aerogear/charmil/core/factory"
initialize "github.com/aerogear/charmil/pkg/cmd/init"
"github.com/spf13/cobra"
)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit db597db

Please sign in to comment.