Skip to content

Commit

Permalink
Switching import path to quokka
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Lhussiez committed Apr 2, 2019
1 parent 6f7a1cd commit a3d3027
Show file tree
Hide file tree
Showing 15 changed files with 59 additions and 73 deletions.
48 changes: 17 additions & 31 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,19 @@
workspace:
base: /go
path: src/github.com/Depado/projectmpl
---
kind: pipeline
name: default

pipeline:
prerequisites:
image: "golang:latest"
pull: true
commands:
- go version
- go get -u github.com/golang/dep/cmd/dep
- dep ensure -vendor-only
environment:
- GO111MODULE=off
- name: build
image: golang:latest
pull: always
commands:
- go build
environment:
GO111MODULE: "on"

linter:
image: "golang:latest"
commands:
- go get -u github.com/golangci/golangci-lint/cmd/golangci-lint
- golangci-lint run
environment:
- GO111MODULE=off

test:
image: "golang:latest"
commands:
- go test -race -coverprofile=coverage.txt ./...
environment:
- GO111MODULE=off

codecov:
image: robertstettner/drone-codecov
secrets: [ codecov_token ]
- name: linter
image: golang:latest
commands:
- go get -u github.com/golangci/golangci-lint/cmd/golangci-lint
- golangci-lint run
environment:
GO111MODULE: "off"
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# Output of the go coverage tool, specifically when used with LiteIDE
*.out
vendor/
projectmpl
quokka
output/
dist/
.vscode/
Expand Down
50 changes: 25 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@
[![forthebadge](https://forthebadge.com/images/badges/made-with-go.svg)](https://forthebadge.com)[![forthebadge](https://forthebadge.com/images/badges/built-with-love.svg)](https://forthebadge.com)[![forthebadge](https://forthebadge.com/images/badges/uses-badges.svg)](https://forthebadge.com)

![Go Version](https://img.shields.io/badge/Go%20Version-latest-brightgreen.svg)
[![Go Report Card](https://goreportcard.com/badge/github.com/Depado/projectmpl)](https://goreportcard.com/report/github.com/Depado/projectmpl)
[![Build Status](https://drone.depado.eu/api/badges/Depado/projectmpl/status.svg)](https://drone.depado.eu/Depado/projectmpl)
[![codecov](https://codecov.io/gh/Depado/projectmpl/branch/master/graph/badge.svg)](https://codecov.io/gh/Depado/projectmpl)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/Depado/projectmpl/blob/master/LICENSE)
[![Go Report Card](https://goreportcard.com/badge/github.com/Depado/quokka)](https://goreportcard.com/report/github.com/Depado/quokka)
[![Build Status](https://drone.depado.eu/api/badges/Depado/quokka/status.svg)](https://drone.depado.eu/Depado/quokka)
[![codecov](https://codecov.io/gh/Depado/quokka/branch/master/graph/badge.svg)](https://codecov.io/gh/Depado/quokka)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/Depado/quokka/blob/master/LICENSE)
[![Say Thanks!](https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg)](https://saythanks.io/to/Depado)

</span>
</div>

<h2 align="center">Friendly Boilerplate Engine</h2>

<img align="center" src="/assets/projectmpl.gif">
<img align="center" src="/assets/quokka.gif">

- [Introduction](#introduction)
- [Features](#features)
Expand All @@ -31,56 +31,56 @@
- [Keeping the template](#keeping-the-template)
- [Examples](#examples)
- [Template Creation](#template-creation)
- [The root `.projectmpl.yml` file](#the-root-projectmplyml-file)
- [The root `.quokka.yml` file](#the-root-quokkayml-file)
- [Variable declaration](#variable-declaration)
- [Simple Input](#simple-input)
- [Selection](#selection)
- [Boolean/Confirmation](#booleanconfirmation)
- [Other options and help](#other-options-and-help)
- [Validation](#validation)
- [Sub Variables](#sub-variables)
- [Standard `.projectmpl.yml` files](#standard-projectmplyml-files)
- [Standard `.quokka.yml` files](#standard-quokkayml-files)
- [Per-file configuration](#per-file-configuration)
- [Conditional Rendering/Copy](#conditional-renderingcopy)
- [After render commands](#after-render-commands)

# Introduction

Projectmpl is a boilerplate engine. It allows you to quickly use boilerplate
quokka is a boilerplate engine. It allows you to quickly use boilerplate
templates and avoid copy-pasting chunks of code and snippets when you start a
new project.

## Features

- **No external dependencies**
Projectmpl is written in Go and thus is compiled to a static binary. Download
quokka is written in Go and thus is compiled to a static binary. Download
or build it and you're good to go.
- **Local or distant templates**
Either your template is a git repository, an archive stored on a distant
server or a local directory, projectmpl knows how to handle these.
server or a local directory, quokka knows how to handle these.
- **Sweet output and prompts**
Thanks to the wonderful [survey](https://github.com/AlecAivazis/survey)
library, the prompts are unified, can display an help text and support
validation.
- **Clean configuration files**
Projectmpl uses YAML for its configuration file formats, making them clean
quokka uses YAML for its configuration file formats, making them clean
and easy to read.
- **Powerful templating system**
Projectmpl uses [Go's template system](https://golang.org/pkg/text/template/)
quokka uses [Go's template system](https://golang.org/pkg/text/template/)
to render the boilerplate.
- **Configuration override**
Need a different behavior or additional variables in a specific directory?
Just add another `.projectmpl.yml` file in there. You can even overwrite
Just add another `.quokka.yml` file in there. You can even overwrite
variables.
- **Conditional prompts (sub-variables)**
Each variable can have its own subset of variables which will only be
prompted to the user if the parent variable is filled or set to true.
- **Customizable templates**
Projectmpl enables fine-grained control over what needs to be done when
quokka enables fine-grained control over what needs to be done when
rendering the template. Just copy the file, ignore it, add conditionals based
on what the user answered, change the template delimiters…
- **[On Hold] After render commands**
Projectmpl enables you to define commands to be run once the boilerplate has
quokka enables you to define commands to be run once the boilerplate has
been rendered. _For security reasons, an explicit flag must be provided by the
user for the commands to be executed_
This feature is currently disabled for security reasons.
Expand All @@ -89,12 +89,12 @@ new project.

## Download

You can grab the latest release from [the release page](https://github.com/Depado/projectmpl/releases).
You can grab the latest release from [the release page](https://github.com/Depado/quokka/releases).

## Build from source

```
$ go get -u github.com/Depado/projectmpl
$ go get -u github.com/Depado/quokka
$ cd $GOPATH/src/github.com/Depado/projectpml
$ dep ensure
$ make
Expand All @@ -103,15 +103,15 @@ $ make
Or directly install:

```
$ go get -u github.com/Depado/projectmpl
$ go get -u github.com/Depado/quokka
$ cd $GOPATH/src/github.com/Depado/projectpml
$ dep ensure
$ make install
```

# Usage

Projectmpl supports various provider to download the templates. It supports
quokka supports various provider to download the templates. It supports
`git`, downloading an archive (`.zip`/`.tar.gz`/`.tar.xz`/...) from internet,
or using a local directory.

Expand Down Expand Up @@ -151,7 +151,7 @@ system so make sure you are ok with that. -->

## Keeping the template

When downloading or cloning a template, `projectmpl` will create a temporary
When downloading or cloning a template, `quokka` will create a temporary
directory and delete it once the operation completes. If you want to keep
the template (to play with it, or simply to keep a copy), make sure you pass
the `--keep` option. This option pairs well with the `--output` option which
Expand All @@ -161,11 +161,11 @@ defines where the template should be downloaded/cloned.

```sh
$ # Clone the repository and execute the template that is located in _example/license
$ qk git@github.com:Depado/projectmpl.git output --path _example/license
$ qk git@github.com:Depado/quokka.git output --path _example/license
$ # Clone the template in a specific directory, render it in a specific directory and keep the template
$ qk git@github.com:Depado/projectmpl.git myamazingproject --path _example/cleanarch --keep --output "template"
$ qk git@github.com:Depado/quokka.git myamazingproject --path _example/cleanarch --keep --output "template"
$ # Reuse the downloaded template
$ projectmpl template/ myotherproject
$ quokka template/ myotherproject
```

# Template Creation
Expand Down Expand Up @@ -296,7 +296,7 @@ For example you can completely ignore a directory:
```
└──── change
   ├── override.go
   └── .projectmpl.yml
   └── .quokka.yml
```

```yaml
Expand Down Expand Up @@ -329,7 +329,7 @@ copy: true
```

You can even add per-file variables, or modify the delimiters. In fact, it's
like an inline `.projectmpl.yml` that applies to a single file.
like an inline `.quokka.yml` that applies to a single file.

## Conditional Rendering/Copy

Expand Down
4 changes: 2 additions & 2 deletions _example/cleanarch/.quokka.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "Example Projectmpl"
name: "Example quokka"
version: "0.1.0"
description: "An example template to show how projectmpl works"
description: "An example template to show how quokka works"
delimiters: ["{{", "}}"]
after:
- cmd: "git init"
Expand Down
4 changes: 2 additions & 2 deletions cmd/qk/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (

"github.com/spf13/viper"

"github.com/Depado/projectmpl/cmd"
"github.com/Depado/projectmpl/renderer"
"github.com/Depado/quokka/cmd"
"github.com/Depado/quokka/renderer"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion conf/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"os/exec"
"strings"

"github.com/Depado/projectmpl/utils"
"github.com/Depado/quokka/utils"
)

// Command is a simple command to be executed
Expand Down
2 changes: 1 addition & 1 deletion conf/command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"reflect"
"testing"

"github.com/Depado/projectmpl/utils"
"github.com/Depado/quokka/utils"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion conf/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"path/filepath"
"text/template"

"github.com/Depado/projectmpl/utils"
"github.com/Depado/quokka/utils"
"github.com/fatih/color"
"gopkg.in/yaml.v2"
)
Expand Down
2 changes: 1 addition & 1 deletion conf/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"path/filepath"
"strings"

"github.com/Depado/projectmpl/utils"
"github.com/Depado/quokka/utils"
yaml "gopkg.in/yaml.v2"
)

Expand Down
2 changes: 1 addition & 1 deletion conf/variables.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package conf
import (
"fmt"

"github.com/Depado/projectmpl/utils"
"github.com/Depado/quokka/utils"
"github.com/fatih/color"
survey "gopkg.in/AlecAivazis/survey.v1"
yaml "gopkg.in/yaml.v2"
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/Depado/projectmpl
module github.com/Depado/quokka

require (
github.com/BurntSushi/toml v0.3.1 // indirect
Expand Down
2 changes: 1 addition & 1 deletion provider/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package provider
import (
"path/filepath"

"github.com/Depado/projectmpl/utils"
"github.com/Depado/quokka/utils"
git "gopkg.in/src-d/go-git.v4"
)

Expand Down
2 changes: 1 addition & 1 deletion provider/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"path"
"path/filepath"

"github.com/Depado/projectmpl/utils"
"github.com/Depado/quokka/utils"
"github.com/mholt/archiver"
)

Expand Down
4 changes: 2 additions & 2 deletions renderer/analyze.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"os"
"path/filepath"

"github.com/Depado/projectmpl/conf"
"github.com/Depado/projectmpl/utils"
"github.com/Depado/quokka/conf"
"github.com/Depado/quokka/utils"
"github.com/fatih/color"
)

Expand Down
4 changes: 2 additions & 2 deletions renderer/render.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package renderer
import (
"os"

"github.com/Depado/projectmpl/provider"
"github.com/Depado/projectmpl/utils"
"github.com/Depado/quokka/provider"
"github.com/Depado/quokka/utils"
"github.com/spf13/viper"
"gopkg.in/AlecAivazis/survey.v1"
)
Expand Down

0 comments on commit a3d3027

Please sign in to comment.