Skip to content

Commit

Permalink
hof/release: update changelogs, readme, adjust ga params
Browse files Browse the repository at this point in the history
  • Loading branch information
verdverm committed Sep 20, 2022
1 parent 72e2db7 commit dadf993
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 24 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ Usage:
hof [flags] [command] [args]
Main commands:
create bootstrap projects, components, and files from any git repo
datamodel manage, diff, and migrate your data models
gen modular and composable code gen: CUE & data + templates = _
flow run CUE pipelines with the hof/flow DAG engine
Expand Down
11 changes: 9 additions & 2 deletions changelogs/0.6.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,19 +142,26 @@ Fixes several bugs and re-adds telemetry with proper user controls.
Introduces `hof create` to as a "npm create-react-app" for anything.
Easy bootstrap or add files to an existing project from any remote repository.

- essentially a generator with `CreatePrompt` field to get inputs from user.
- essentially a generator with `Create` field to get inputs from user.
- configure an interactive prompt and input schema, user can also use flags to fill prompt
- adds a new `hof create <repo>` which fetches and prompts user for starting input
- adds `Create*` schema and includes in generators
- adds `Create` schema and includes in generators
- add schema and code for implementing an input prompt
- works with remote repo, and also locally for directories
- makes it easy for you to provide one-line setup instructions for your own generators

To learn more about `hof create`, see
[docs/getting-started/create](https://docs.hofstadter.io/getting-started/create/).


Other changes:

- remove modder name from mod cache, flattening because they are always a git repo at a tag
- use cache dir for remote repositories
- enable symlinks for local, replaced, cue dependencies
- remove old or unused code
- fix and enable more formatters
- improve docker images
- improve tests & CI
- several bug fixes and edge case handling

30 changes: 14 additions & 16 deletions cmd/hof/ga/ga.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
var dir, fn, cid string
var isCI bool

var debug = false
var debug = true

func init() {
if debug {
Expand Down Expand Up @@ -48,6 +48,9 @@ func init() {

// try reading
cid, err = readGaId()
if debug {
fmt.Println("realGaId:", cid, err)
}
if err != nil {
cid = "missing"
}
Expand Down Expand Up @@ -114,16 +117,16 @@ func SendCommandPath(cmd string) {
if isCI {
l = "ci"
}
SendGaEvent(c, l, 0)
}

func SendGaEvent(action, label string, value int) {
if debug {
fmt.Println("SendGaEvent:", c, l, cid)
}
if cid == "disabled" {
return
}

ua := fmt.Sprintf(
"%s/%s %s/%s",
"%s/%s (%s %s)",
"hof", verinfo.Version,
verinfo.BuildOS, verinfo.BuildArch,
)
Expand All @@ -132,20 +135,15 @@ func SendGaEvent(action, label string, value int) {
TID: "UA-103579574-5",
CID: cid,
UA: ua,
CN: "hof",
CS: "hof/" + verinfo.Version,
CM: verinfo.Version,
CN: verinfo.Version,
CS: verinfo.BuildOS,
CM: verinfo.BuildArch,
}

evt := yagu.GaEvent{
Source: cfg.UA,
Category: "hof",
Action: action,
Label: label,
}

if value >= 0 {
evt.Value = value
Action: c, // path or cmd here
Source: fmt.Sprintf("%s/%s",verinfo.BuildOS, verinfo.BuildArch),
Category: l,
}

if debug {
Expand Down
12 changes: 6 additions & 6 deletions lib/yagu/ga.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ func SendGaEvent(cfg GaConfig, evt GaEvent) (string, error) {

vals := url.Values{}

// always
vals.Add("v", "1")

vals.Add("tid", cfg.TID)
vals.Add("cid", cfg.CID)
vals.Add("cs", cfg.CS)
Expand All @@ -65,13 +68,10 @@ func SendGaEvent(cfg GaConfig, evt GaEvent) (string, error) {
}

// TODO, move this parameter hackery for CLIs to hofmod-cli
vals.Add("dh", cfg.UA)
vals.Add("dt", cfg.CS)
vals.Add("dh", "hof/"+cfg.CN)
vals.Add("dp", evt.Action)
vals.Add("v", "1")
if evt.Source != "" {
vals.Add("ds", evt.Source)
}
vals.Add("dt", evt.Category)
vals.Add("dr", evt.Source)

payload := vals.Encode()

Expand Down

0 comments on commit dadf993

Please sign in to comment.