Skip to content

Commit

Permalink
Merge pull request #61 from create-go-app/dev
Browse files Browse the repository at this point in the history
Minor refactoring
  • Loading branch information
Vic Shóstak authored Feb 27, 2021
2 parents a0a6aed + a76ce53 commit c38f11d
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 150 deletions.
2 changes: 0 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ Dockerfile
Makefile
LICENSE
**/*_test.go
*.yml
*.md
*.out

# Folders
.git/
.github/
app/
tmp/
1 change: 0 additions & 1 deletion .github/workflows/testing_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches: [dev]
paths:
- "configs/**"
- "**.go"

jobs:
Expand Down
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@
**/.DS_Store

# Dev builds
**/app/
**/build/
**/dist/
**/cgapp-project/

# Tests
*.out
**/tmp/
*.out
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
.PHONY: test security install build release
.PHONY: clean test security install build release

test:
clean:
rm -rf ./tmp coverage.out

test: clean
go test -coverprofile=coverage.out ./...
go tool cover -func=coverage.out

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
</h1>
<p align="center">Create a new production-ready project with <b>backend</b> (Golang), <b>frontend</b> (JavaScript, TypeScript)<br/>and <b>deploy automation</b> (Ansible, Docker) by running one CLI command.<br/><br/>Focus on <b>writing</b> code and <b>thinking</b> of business-logic! The CLI will take care of the rest.</p>

<p align="center"><a href="https://github.com/create-go-app/cli/releases" target="_blank"><img src="https://img.shields.io/badge/version-v1.7.0-blue?style=for-the-badge&logo=none" alt="cli version" /></a>&nbsp;<a href="https://pkg.go.dev/github.com/create-go-app/cli?tab=doc" target="_blank"><img src="https://img.shields.io/badge/Go-1.16+-00ADD8?style=for-the-badge&logo=go" alt="go version" /></a>&nbsp;<a href="https://gocover.io/github.com/create-go-app/cli/pkg/cgapp" target="_blank"><img src="https://img.shields.io/badge/Go_Cover-94%25-success?style=for-the-badge&logo=none" alt="go cover" /></a>&nbsp;<a href="https://goreportcard.com/report/github.com/create-go-app/cli" target="_blank"><img src="https://img.shields.io/badge/Go_report-A+-success?style=for-the-badge&logo=none" alt="go report" /></a>&nbsp;<img src="https://img.shields.io/badge/license-apache_2.0-red?style=for-the-badge&logo=none" alt="license" /></p>
<p align="center"><a href="https://github.com/create-go-app/cli/releases" target="_blank"><img src="https://img.shields.io/badge/version-v1.7.1-blue?style=for-the-badge&logo=none" alt="cli version" /></a>&nbsp;<a href="https://pkg.go.dev/github.com/create-go-app/cli?tab=doc" target="_blank"><img src="https://img.shields.io/badge/Go-1.16+-00ADD8?style=for-the-badge&logo=go" alt="go version" /></a>&nbsp;<a href="https://gocover.io/github.com/create-go-app/cli/pkg/cgapp" target="_blank"><img src="https://img.shields.io/badge/Go_Cover-94%25-success?style=for-the-badge&logo=none" alt="go cover" /></a>&nbsp;<a href="https://goreportcard.com/report/github.com/create-go-app/cli" target="_blank"><img src="https://img.shields.io/badge/Go_report-A+-success?style=for-the-badge&logo=none" alt="go report" /></a>&nbsp;<img src="https://img.shields.io/badge/license-apache_2.0-red?style=for-the-badge&logo=none" alt="license" /></p>

## ⚡️ Quick start

Expand Down Expand Up @@ -302,7 +302,7 @@ go install github.com/create-go-app/[email protected]
>
> For example: `mv $GOPATH/bin/cli $GOPATH/bin/cgapp_v1_6_0` and run it by `cgapp_v1_6_0`.

Found all available CLI versions on our [pkg.go.dev page](https://pkg.go.dev/github.com/create-go-app/cli?tab=versions).
Found all available CLI versions on our [pkg.go.dev](https://pkg.go.dev/github.com/create-go-app/cli?tab=versions) page.

## ⭐️ Project assistance

Expand All @@ -311,7 +311,7 @@ If you want to say **thank you** or/and support active development of `Create Go
- Add a [GitHub Star](https://github.com/create-go-app/cli) to the project.
- Twit about project [on your Twitter](https://twitter.com/intent/tweet?text=Create%20a%20new%20production-ready%20project%20with%20backend%20%28Golang%29%2C%20frontend%20%28JavaScript%2C%20TypeScript%29%20%26%20deploy%20automation%20%28Ansible%2C%20Docker%29%20by%20running%20one%20CLI%20command%21%20%F0%9F%9A%80%20https%3A%2F%2Fgithub.com%2Fcreate-go-app%2Fcli).
- Write interesting articles about project on [Dev.to](https://dev.to/), [Medium](https://medium.com/) or personal blog.
- Donate some money to the project's author via PayPal: [@paypal.me/koddr](https://paypal.me/koddr?locale.x=en_EN).
- Join DigitalOcean at our [referral link](https://m.do.co/c/b41859fa9b6e) (your profit is **$100** and we get $25).

Together, we can make this project **better** every day! 😘

Expand Down
129 changes: 0 additions & 129 deletions go.sum

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions pkg/cgapp/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TestCreateProjectFromRegistry(t *testing.T) {
args{
p: &registry.Project{
Type: "backend",
Name: "echo",
Name: "fiber",
RootFolder: "../../tmp",
},
r: registry.Repositories,
Expand All @@ -49,7 +49,7 @@ func TestCreateProjectFromRegistry(t *testing.T) {
args{
p: &registry.Project{
Type: "backend",
Name: "echo",
Name: "fiber",
RootFolder: "../../tmp",
},
r: map[string]*registry.Repository{
Expand Down Expand Up @@ -83,7 +83,7 @@ func TestCreateProjectFromRegistry(t *testing.T) {
args{
p: &registry.Project{
Type: "backend",
Name: "echo",
Name: "fiber",
RootFolder: "../../tmp",
},
r: nil,
Expand All @@ -105,7 +105,7 @@ func TestCreateProjectFromRegistry(t *testing.T) {
args{
p: &registry.Project{
Type: "backend",
Name: "echo",
Name: "fiber",
RootFolder: "../../tmp",
},
r: registry.Repositories,
Expand Down
1 change: 1 addition & 0 deletions pkg/registry/configs/.editorconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# A default .editorconfig for Create Go App project.
# Author: Vic Shóstak <[email protected]> (https://1wa.co)
# For more information, please visit https://create-go.app/

root = true

Expand Down
1 change: 1 addition & 0 deletions pkg/registry/configs/.gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# A default .gitattributes for Create Go App project.
# Author: Vic Shóstak <[email protected]> (https://1wa.co)
# For more information, please visit https://create-go.app/

go.sum merge=union
1 change: 1 addition & 0 deletions pkg/registry/configs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# A default .gitignore for Create Go App project.
# Author: Vic Shóstak <[email protected]> (https://1wa.co)
# For more information, please visit https://create-go.app/

# macOS
**/.DS_store
Expand Down
1 change: 1 addition & 0 deletions pkg/registry/configs/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# A default Makefile for Create Go App project.
# Author: Vic Shóstak <[email protected]> (https://1wa.co)
# For more information, please visit https://create-go.app/

.PHONY: test run build

Expand Down
11 changes: 5 additions & 6 deletions pkg/registry/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ import (

const (
// CLIVersion version of Create Go App CLI.
CLIVersion = "1.7.0"
CLIVersion = "1.7.1"
// RegexpAnsiblePattern pattern for Ansible roles.
RegexpAnsiblePattern = "^(deploy)$"
// RegexpBackendPattern pattern for backend.
RegexpBackendPattern = "^(net/http|fiber|echo)$"
RegexpBackendPattern = "^(net/http|fiber)$"
// RegexpFrontendPattern pattern for backend.
RegexpFrontendPattern = "^(p?react:?|vue(:?[\\w]+)?(:?[\\w-_0-9\\/]+)?|angular|svelte|sapper:?)"
// RegexpWebServerPattern pattern for web/proxy servers.
Expand All @@ -52,12 +52,12 @@ type Project struct {
RootFolder string
}

// Repository ...
// Repository struct for describe repositories collection.
type Repository struct {
List map[string]string
}

// Command ...
// Command struct for describe commands collection.
type Command struct {
Runner string
Create string
Expand Down Expand Up @@ -114,7 +114,6 @@ var (
List: map[string]string{
"net/http": "github.com/create-go-app/net_http-go-template",
"fiber": "github.com/create-go-app/fiber-go-template",
"echo": "github.com/create-go-app/echo-go-template",
},
},

Expand Down Expand Up @@ -175,7 +174,7 @@ var (
Name: "backend",
Prompt: &survey.Select{
Message: "Choose a backend framework:",
Options: []string{"net/http", "Fiber", "Echo", "Gin"},
Options: []string{"net/http", "Fiber"},
Default: "Fiber",
},
Validate: survey.Required,
Expand Down

0 comments on commit c38f11d

Please sign in to comment.