Skip to content

Commit

Permalink
Merge pull request #99 from nimblehq/release/2.1.0
Browse files Browse the repository at this point in the history
Release 2.1.0
  • Loading branch information
carryall authored Apr 24, 2023
2 parents b12eb88 + 256b454 commit 9b13cd4
Show file tree
Hide file tree
Showing 31 changed files with 251 additions and 260 deletions.
6 changes: 6 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Team
# @carryall is the Team Lead and the others are team members
* @carryall @hoangmirs @malparty @Nihisil @suphanatjarukulgowit

# Engineering Leads
CODEOWNERS @nimblehq/engineering-leads
10 changes: 5 additions & 5 deletions .github/ISSUE_TEMPLATE/bug_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ labels: "type : bug"
## Issue

Describe the issue you are facing. Show us the implementation: screenshots, gif, etc.

## Expected

Describe what should be the correct behaviour.

## Steps to reproduce

1.
2.
3.
1.
2.
3.
14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE/chore_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: "Chore"
about: "Open a Chore for minor update."
title: "Update "
labels: "type : chore"
---

## Why

Describe the update details and why it's needed.

## Who Benefits?

Describe who will be the beneficiaries e.g. everyone, specific chapters, clients...
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/feature_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ labels: "type : feature"

## Why

Describe the big picture of the feature and why it's needed.
Describe the big picture of the feature and why it's needed.

## Who Benefits?

Describe who will be the beneficiaries e.g. everyone, specific chapters, clients...
12 changes: 6 additions & 6 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
https://github.com/nimblehq/git-template/issues/??
Resolve https://github.com/nimblehq/gin-templates/issues/??

## What happened 👀

Describe the big picture of your changes here to communicate to the team why we should accept this pull request.
Provide a description of the **changes** this pull request brings to the codebase. Additionally, when the pull request is still being worked on, a checklist of the planned changes is welcome to track progress.

## Insight 📝

Describe in details how to test the changes, which solution you tried but did not go with, referenced documentation is welcome as well.
Describe in detail why this solution is the most appropriate, which solution you tried but did not go with, and how to test the changes. References to relevant documentation are welcome as well.

## Proof Of Work 📹

Show us the implementation: screenshots, gif, etc.
Show us the implementation: screenshots, GIFs, etc.
13 changes: 9 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,26 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Cancel previous runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- name: Checkout
uses: actions/[email protected]

- name: Install cookiecutter
run: sudo -H python3 -m pip install cookiecutter

- name: Setup Go environment
uses: actions/setup-go@v2.1.3
uses: actions/setup-go@v3
with:
go-version: 1.16.x
go-version: 1.20.x

- name: Linters
uses: golangci/golangci-lint-action@v2
uses: golangci/golangci-lint-action@v3
with:
version: v1.29
version: v1.51

- name: Test
env:
Expand Down
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
golang 1.20
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

---

Our templates offer a rich boilerplate to jump start Go Gin-based application development.
Our templates offer a rich boilerplate to jump start Go [Gin-based](https://github.com/gin-gonic/gin) application development.

Check this [wiki](https://github.com/nimblehq/gin-templates/wiki/Directories) for more information about the template structure.

Expand All @@ -20,22 +20,25 @@ Check this [wiki](https://github.com/nimblehq/gin-templates/wiki/Directories) fo
- Cookiecutter
- Mac: `brew install cookiecutter`
- Debian/Ubuntu: `sudo apt-get install cookiecutter`
- Go version >= 1.16
- Go version >= 1.20

## Usage

- Download **latest** version of gin-templates.
```

```sh
go get github.com/nimblehq/gin-templates
```

- Build the binary file.
```

```sh
go build -o $GOPATH/bin/nimble-gin github.com/nimblehq/gin-templates
```

- Create the project using gin-templates. Note that the **main** branch is being used by default. Refer to [this wiki page](https://github.com/nimblehq/gin-templates/wiki/Commands) for instructions on how to use a different branch.
```

```sh
nimble-gin create
```

Expand All @@ -54,7 +57,7 @@ make test
This project is Copyright (c) 2014 and onwards Nimble. It is free software,
and may be redistributed under the terms specified in the [LICENSE] file.

[LICENSE]: /LICENSE
[license]: /LICENSE

## About

Expand Down
26 changes: 19 additions & 7 deletions cmd/create_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package cmd_test

import (
"io/ioutil"
"os"

"github.com/nimblehq/gin-templates/tests"
Expand Down Expand Up @@ -125,13 +124,13 @@ var _ = Describe("Create template", func() {
})

Context("given bootstrap/database.go", func() {
It("contains project name at helpers import", func() {
It("contains project name at database import", func() {
cookiecutter := tests.Cookiecutter{AppName: "test-gin-templates"}
cookiecutter.CreateProjectFromGinTemplate(currentTemplatePath)

content := tests.ReadFile("bootstrap/database.go")

expectedContent := `"github.com/nimblehq/test-gin-templates/helpers"`
expectedContent := `"github.com/nimblehq/test-gin-templates/database"`

Expect(content).To(ContainSubstring(expectedContent))
})
Expand Down Expand Up @@ -296,7 +295,7 @@ var _ = Describe("Create template", func() {
cookiecutter.CreateProjectFromGinTemplate(currentTemplatePath)
content := tests.ReadFile("go.mod")

expectedContent := "github.com/sirupsen/logrus v1.8.1"
expectedContent := "github.com/sirupsen/logrus"

Expect(content).To(ContainSubstring(expectedContent))
})
Expand All @@ -314,13 +313,26 @@ var _ = Describe("Create template", func() {
Expect(content).To(ContainSubstring(expectedContent))
})

It("contains logrus package import in bootstrap/database.go", func() {
Context("given database/database.go", func() {
It("contains project name at helpers import", func() {
cookiecutter := tests.Cookiecutter{AppName: "test-gin-templates"}
cookiecutter.CreateProjectFromGinTemplate(currentTemplatePath)

content := tests.ReadFile("database/database.go")

expectedContent := `"github.com/nimblehq/test-gin-templates/helpers"`

Expect(content).To(ContainSubstring(expectedContent))
})
})

It("contains logrus package import in database/database.go", func() {
cookiecutter := tests.Cookiecutter{
AppName: "test-gin-templates",
UseLogrus: tests.Yes,
}
cookiecutter.CreateProjectFromGinTemplate(currentTemplatePath)
content := tests.ReadFile("bootstrap/database.go")
content := tests.ReadFile("database/database.go")

expectedContent := "github.com/nimblehq/test-gin-templates/helpers/log"

Expand Down Expand Up @@ -450,7 +462,7 @@ var _ = Describe("Create template", func() {
UseHeroku: tests.Yes,
}
cookiecutter.CreateProjectFromGinTemplate(currentTemplatePath)
files, err := ioutil.ReadDir("deploy/heroku")
files, err := os.ReadDir("deploy/heroku")
if err != nil {
Fail("Failed to read directory: " + err.Error())
}
Expand Down
14 changes: 13 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
module github.com/nimblehq/gin-templates

go 1.16
go 1.20

require (
github.com/onsi/ginkgo v1.15.0
github.com/onsi/gomega v1.10.5
github.com/spf13/cobra v1.1.1
)

require (
github.com/fsnotify/fsnotify v1.4.9 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/nxadm/tail v1.4.4 // indirect
github.com/spf13/pflag v1.0.5 // indirect
golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb // indirect
golang.org/x/sys v0.0.0-20210112080510-489259a85091 // indirect
golang.org/x/text v0.3.3 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/yaml.v2 v2.3.0 // indirect
)
Loading

0 comments on commit 9b13cd4

Please sign in to comment.