aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-09-16 13:50:53 +0200
committerMichael Muré <batolettre@gmail.com>2018-09-16 13:50:53 +0200
commit6f5d433e33b5432887a8496074f0d7c7048c1167 (patch)
treedbde7ddd52cad8207c637012ceba839fd00c5fc9
parentb9fc8b662ed72844a93d1019b1ecf8b60464f78e (diff)
downloadgit-bug-6f5d433e33b5432887a8496074f0d7c7048c1167.tar.gz
docs & cleaning
-rw-r--r--bug/bug.go1
-rw-r--r--cache/doc.go3
-rw-r--r--commands/root.go1
-rw-r--r--graphql/connections/connections.go1
-rw-r--r--graphql/handler.go2
-rw-r--r--graphql/models/models.go1
-rw-r--r--graphql/relay.go37
-rw-r--r--graphql/resolvers/root.go1
-rw-r--r--input/input.go4
-rw-r--r--operations/operations.go3
-rw-r--r--termui/termui.go1
-rw-r--r--webui/Readme.md16
12 files changed, 33 insertions, 38 deletions
diff --git a/bug/bug.go b/bug/bug.go
index 3342ecfa..98d8b2ce 100644
--- a/bug/bug.go
+++ b/bug/bug.go
@@ -1,3 +1,4 @@
+// Package bug contains the bug data model and low-level related functions
package bug
import (
diff --git a/cache/doc.go b/cache/doc.go
new file mode 100644
index 00000000..aa6caebd
--- /dev/null
+++ b/cache/doc.go
@@ -0,0 +1,3 @@
+// Package cache contains a caching layer on top of the low-level bug
+// functions to provide efficient querying, filtering, sorting.
+package cache
diff --git a/commands/root.go b/commands/root.go
index edfb5b2b..95a43516 100644
--- a/commands/root.go
+++ b/commands/root.go
@@ -1,3 +1,4 @@
+// Package commands contains the CLI commands
package commands
import (
diff --git a/graphql/connections/connections.go b/graphql/connections/connections.go
index 8b905fab..de5b8f1a 100644
--- a/graphql/connections/connections.go
+++ b/graphql/connections/connections.go
@@ -2,6 +2,7 @@
//go:generate genny -in=connection_template.go -out=gen_operation.go gen "NodeType=bug.Operation EdgeType=models.OperationEdge ConnectionType=models.OperationConnection"
//go:generate genny -in=connection_template.go -out=gen_comment.go gen "NodeType=bug.Comment EdgeType=models.CommentEdge ConnectionType=models.CommentConnection"
+// Package connections implement a generic GraphQL relay connection
package connections
import (
diff --git a/graphql/handler.go b/graphql/handler.go
index 7b940d8f..ed5047c4 100644
--- a/graphql/handler.go
+++ b/graphql/handler.go
@@ -1,5 +1,6 @@
//go:generate go run gen_graphql.go
+// Package graphql contains the root GraphQL http handler
package graphql
import (
@@ -10,6 +11,7 @@ import (
"net/http"
)
+// Handler is the root GraphQL http handler
type Handler struct {
http.HandlerFunc
*resolvers.RootResolver
diff --git a/graphql/models/models.go b/graphql/models/models.go
index 63d9c1fe..816a04a8 100644
--- a/graphql/models/models.go
+++ b/graphql/models/models.go
@@ -1,3 +1,4 @@
+// Package models contains the various GraphQL data models
package models
import (
diff --git a/graphql/relay.go b/graphql/relay.go
deleted file mode 100644
index 036ab54e..00000000
--- a/graphql/relay.go
+++ /dev/null
@@ -1,37 +0,0 @@
-package graphql
-
-import (
- "encoding/base64"
- "strings"
-)
-
-type ResolvedGlobalID struct {
- Type string `json:"type"`
- ID string `json:"id"`
-}
-
-// Takes a type name and an ID specific to that type name, and returns a
-// "global ID" that is unique among all types.
-func ToGlobalID(ttype string, id string) string {
- str := ttype + ":" + id
- encStr := base64.StdEncoding.EncodeToString([]byte(str))
- return encStr
-}
-
-// Takes the "global ID" created by toGlobalID, and returns the type name and ID
-// used to create it.
-func FromGlobalID(globalID string) *ResolvedGlobalID {
- strID := ""
- b, err := base64.StdEncoding.DecodeString(globalID)
- if err == nil {
- strID = string(b)
- }
- tokens := strings.Split(strID, ":")
- if len(tokens) < 2 {
- return nil
- }
- return &ResolvedGlobalID{
- Type: tokens[0],
- ID: tokens[1],
- }
-}
diff --git a/graphql/resolvers/root.go b/graphql/resolvers/root.go
index 1003f7f1..ff181784 100644
--- a/graphql/resolvers/root.go
+++ b/graphql/resolvers/root.go
@@ -1,3 +1,4 @@
+// Package resolvers contains the various GraphQL resolvers
package resolvers
import (
diff --git a/input/input.go b/input/input.go
index 4da73fc5..4b70bbd4 100644
--- a/input/input.go
+++ b/input/input.go
@@ -1,5 +1,7 @@
-// Originally taken from the git-appraise project
+// Inspired by the git-appraise project
+// Package input contains helpers to use a text editor as an input for
+// various field of a bug
package input
import (
diff --git a/operations/operations.go b/operations/operations.go
index 348f8cc8..020b8151 100644
--- a/operations/operations.go
+++ b/operations/operations.go
@@ -1,3 +1,6 @@
+// Package operations contains the various bug operations. A bug operation is
+// an atomic edit operation of a bug state. These operations are applied
+// sequentially to compile the current state of the bug.
package operations
import (
diff --git a/termui/termui.go b/termui/termui.go
index 54324c61..403fcc97 100644
--- a/termui/termui.go
+++ b/termui/termui.go
@@ -1,3 +1,4 @@
+// Package termui contains the interactive terminal UI
package termui
import (
diff --git a/webui/Readme.md b/webui/Readme.md
new file mode 100644
index 00000000..e75fa6b8
--- /dev/null
+++ b/webui/Readme.md
@@ -0,0 +1,16 @@
+# git-bug rich web UI
+
+## How to develop
+
+1. Compile the go binary
+ - run `make` in the **root** directory
+2. Run the GraphQL backend on the port 3001
+ - `./git-bug webui -p 3001`
+3. Run the hot-reloadable development WebUI
+ - run `npm start` in the **webui** directory
+
+The development version of the WebUI is configured to query the backend on the port 3001. You can now live edit the js code and use the normal backend.
+
+## Bundle the web UI
+
+Once the webUI is good enough for a new release, run `make pack-webui` from the root directory to bundle the compiled js into the go binary. \ No newline at end of file