Skip to content
Permalink
Browse files

Switching import path to quokka

  • Loading branch information...
Depado committed Apr 2, 2019
1 parent 6f7a1cd commit a3d3027ca11f9b98022a97f5b4dcb36c6f0c5f4d
Showing with 59 additions and 73 deletions.
  1. +17 −31 .drone.yml
  2. +1 −1 .gitignore
  3. +25 −25 README.md
  4. +2 −2 _example/cleanarch/.quokka.yml
  5. +2 −2 cmd/qk/main.go
  6. +1 −1 conf/command.go
  7. +1 −1 conf/command_test.go
  8. +1 −1 conf/file.go
  9. +1 −1 conf/root.go
  10. +1 −1 conf/variables.go
  11. +1 −1 go.mod
  12. +1 −1 provider/git.go
  13. +1 −1 provider/http.go
  14. +2 −2 renderer/analyze.go
  15. +2 −2 renderer/render.go
@@ -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"
@@ -11,7 +11,7 @@
# Output of the go coverage tool, specifically when used with LiteIDE
*.out
vendor/
projectmpl
quokka
output/
dist/
.vscode/
@@ -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)
@@ -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.
@@ -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
@@ -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.

@@ -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
@@ -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
@@ -296,7 +296,7 @@ For example you can completely ignore a directory:
```
└──── change
   ├── override.go
   └── .projectmpl.yml
   └── .quokka.yml
```

```yaml
@@ -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

@@ -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"
@@ -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"
)

@@ -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
@@ -8,7 +8,7 @@ import (
"reflect"
"testing"

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

@@ -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"
)
@@ -6,7 +6,7 @@ import (
"path/filepath"
"strings"

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

@@ -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"
2 go.mod
@@ -1,4 +1,4 @@
module github.com/Depado/projectmpl
module github.com/Depado/quokka

require (
github.com/BurntSushi/toml v0.3.1 // indirect
@@ -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"
)

@@ -7,7 +7,7 @@ import (
"path"
"path/filepath"

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

@@ -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"
)

@@ -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"
)

0 comments on commit a3d3027

Please sign in to comment.
You can’t perform that action at this time.