Skip to content

Commit

Permalink
Merge pull request #20 from foomo/feature/v0.2.x
Browse files Browse the repository at this point in the history
Release v0.2.x
  • Loading branch information
franklinkim authored May 30, 2024
2 parents d2c61b5 + a139910 commit ec29972
Show file tree
Hide file tree
Showing 36 changed files with 1,737 additions and 640 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}"
cancel-in-progress: true

jobs:
Expand Down
2 changes: 2 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,11 @@ linters-settings:
- name: struct-tag
arguments:
- "json,inline"
- "yaml,squash"
- name: unhandled-error
arguments:
- "fmt.Println"
- "strings.Builder.WriteString"
# TODO remove
- name: deep-exit
disabled: true
Expand Down
11 changes: 5 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,7 @@ doc:
.PHONY: test
## Run tests
test:
@go test -coverprofile=coverage.out -race -json ./... | gotestfmt

.PHONY: test.update
## Run tests and update snapshots
test.update:
@go test -update -coverprofile=coverage.out -race -json ./... | gotestfmt
@GO_TEST_TAGS=-skip go test -coverprofile=coverage.out -race -json ./... | gotestfmt

.PHONY: lint
## Run linter
Expand All @@ -58,6 +53,10 @@ outdated:
install:
@go build -o ${GOPATH}/bin/sesamy main.go

## Install debug binary
install.debug:
@go build -gcflags "all=-N -l" -o ${GOPATH}/bin/sesamy main.go

## Build binary
build:
@mkdir -p bin
Expand Down
96 changes: 86 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,99 @@ google:

gtm:
account_id: 6099238525
web:
container_id: 175355532
measurement_id: GTM-57BHX34G
workspace_id: 23
server:
container_id: 175348980
workspace_id: 10
measurement_id: GTM-5NWPR4QW
workspace_id: 10

web:
container_id: 175355532
workspace_id: 23
measurement_id: GTM-57BHX34G
request_quota: 15
credentials_file: ./google_service_account_creds.json

credentials_file: ./tmp/google_service_account_creds.json

events:
typescript:
packages:
- path: 'github.com/username/repository/event'
types:
- Custom
- path: 'github.com/foomo/sesamy-go/event'
types:
- PageView
- SelectItem
output_path: '/path/to/src'

tagmanager:
tags:
ga4_enabled: true
packages:
- path: "github.com/foomo/sesamy-cli/_example/server"
output_path: "./_example/client/types.d.ts"
indent: "\t"
- path: 'github.com/username/repository/event'
types:
- Custom
- path: 'github.com/foomo/sesamy-go/event'
types:
- AddPaymentInfo
- AddShippingInfo
- AddToCart
- AddToWishlist
- AdImpression
- BeginCheckout
- CampaignDetails
- Click
- EarnVirtualMoney
- FileDownload
- FormStart
- FormSubmit
- GenerateLead
- JoinGroup
- LevelEnd
- LevelStart
- LevelUp
- Login
- PageView
- PostScore
- Purchase
- Refund
- RemoveFromCart
- ScreenView
- Scroll
- Search
- SelectContent
- SelectItem
- SelectPromotion
- SessionStart
- Share
- SignUp
- SpendVirtualCurrency
- TutorialBegin
- TutorialComplete
- UnlockAchievement
- UserEngagement
- VideoComplete
- VideoProgress
- VideoStart
- ViewCart
- ViewItem
- ViewItemList
- ViewPromotion
- ViewSearchResults
prefixes:
client: ''
folder: ''
tags:
ga4_event: 'GA4 - '
google_tag: ''
server_ga4_event: 'GA4 - '
triggers:
client: ''
custom_event: 'Event - '
variables:
constant: ''
event_model: 'dlv.eventModel.'
gt_event_settings: 'Event Settings - '
gt_settings: 'Settings - '
```
## Caveats
Expand Down
55 changes: 0 additions & 55 deletions _example/client/types.d.ts

This file was deleted.

7 changes: 0 additions & 7 deletions _example/server/addtocart.go

This file was deleted.

22 changes: 0 additions & 22 deletions _example/server/item.go

This file was deleted.

5 changes: 0 additions & 5 deletions _example/server/login.go

This file was deleted.

5 changes: 0 additions & 5 deletions _example/server/search.go

This file was deleted.

5 changes: 0 additions & 5 deletions _example/server/signup.go

This file was deleted.

28 changes: 13 additions & 15 deletions cmd/tagmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,20 @@ import (
"github.com/spf13/cobra"
)

// tagmanagerCmd represents the tagmanager command
var tagmanagerCmd = &cobra.Command{
Use: "tagmanager",
Short: "Provision Google Tag Manager containers",
}

func init() {
rootCmd.AddCommand(tagmanagerCmd)
// NewTagmanagerCmd represents the tagmanager command
func NewTagmanagerCmd(root *cobra.Command) *cobra.Command {
cmd := &cobra.Command{
Use: "tagmanager",
Short: "Provision Google Tag Manager containers",
}

// Here you will define your flags and configuration settings.
root.AddCommand(cmd)

// Cobra supports Persistent Flags which will work for this command
// and all subcommands, e.g.:
// tagmanagerCmd.PersistentFlags().String("foo", "", "A help for foo")
return cmd
}

// Cobra supports local flags which will only run when this command
// is called directly, e.g.:
// tagmanagerCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
func init() {
cmd := NewTagmanagerCmd(rootCmd)
NewTagManagerServerCmd(cmd)
NewTagmanagerWebCmd(cmd)
}
Loading

0 comments on commit ec29972

Please sign in to comment.