Skip to content

Commit 555a7fe

Browse files
author
Mikel Lindsaar
committed
Initial commit: Go CLI implementation
This is the initial state of the StoreConnect Go CLI before Milestone 1 implementation. Includes: - Complete CLI structure with Cobra - Theme, content, and API management commands - Configuration and credential management - Serialization/deserialization - Test suite with 100% coverage Base features working: - sc init, connect, disconnect - sc theme list, pull, push, preview, publish - sc article, block, category, menu, media, page, product commands - sc status Ready for Milestone 1: JSON output and exit codes.
0 parents  commit 555a7fe

85 files changed

Lines changed: 17477 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
9+
jobs:
10+
test:
11+
name: Test
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
go-version: [ '1.21', '1.22', '1.23' ]
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
- name: Set up Go
22+
uses: actions/setup-go@v5
23+
with:
24+
go-version: ${{ matrix.go-version }}
25+
26+
- name: Download dependencies
27+
run: go mod download
28+
29+
- name: Verify dependencies
30+
run: go mod verify
31+
32+
- name: Run tests
33+
run: go test -v -race -coverprofile=coverage.out ./...
34+
35+
- name: Upload coverage
36+
uses: codecov/codecov-action@v4
37+
with:
38+
file: ./coverage.out
39+
40+
lint:
41+
name: Lint
42+
runs-on: ubuntu-latest
43+
44+
steps:
45+
- name: Checkout code
46+
uses: actions/checkout@v4
47+
48+
- name: Set up Go
49+
uses: actions/setup-go@v5
50+
with:
51+
go-version: '1.23'
52+
53+
- name: Run golangci-lint
54+
uses: golangci/golangci-lint-action@v6
55+
with:
56+
version: latest
57+
58+
build:
59+
name: Build
60+
runs-on: ubuntu-latest
61+
62+
steps:
63+
- name: Checkout code
64+
uses: actions/checkout@v4
65+
66+
- name: Set up Go
67+
uses: actions/setup-go@v5
68+
with:
69+
go-version: '1.23'
70+
71+
- name: Build binary
72+
run: make build
73+
74+
- name: Upload binary
75+
uses: actions/upload-artifact@v4
76+
with:
77+
name: sc-linux-amd64
78+
path: bin/sc
79+
80+
build-multi:
81+
name: Multi-platform Build
82+
runs-on: ubuntu-latest
83+
if: github.event_name == 'push'
84+
85+
steps:
86+
- name: Checkout code
87+
uses: actions/checkout@v4
88+
89+
- name: Set up Go
90+
uses: actions/setup-go@v5
91+
with:
92+
go-version: '1.23'
93+
94+
- name: Build for all platforms
95+
run: make build-all
96+
97+
- name: Upload artifacts
98+
uses: actions/upload-artifact@v4
99+
with:
100+
name: binaries
101+
path: bin/*

.gitignore

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Binaries for programs and plugins
2+
*.exe
3+
*.exe~
4+
*.dll
5+
*.so
6+
*.dylib
7+
bin/
8+
dist/
9+
10+
# Test binary, built with `go test -c`
11+
*.test
12+
13+
# Output of the go coverage tool
14+
*.out
15+
coverage.html
16+
17+
# Dependency directories
18+
vendor/
19+
20+
# Go workspace file
21+
go.work
22+
23+
# IDE-specific files
24+
.idea/
25+
.vscode/
26+
*.swp
27+
*.swo
28+
*~
29+
30+
# OS-specific files
31+
.DS_Store
32+
Thumbs.db
33+
34+
# StoreConnect specific
35+
.storeconnect/
36+
themes/
37+
!.storeconnect/.gitkeep
38+
!themes/.gitkeep
39+
40+
# Credentials (never commit)
41+
credentials.yml
42+
*.key
43+
*.pem

.golangci.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# golangci-lint configuration
2+
run:
3+
timeout: 5m
4+
tests: true
5+
skip-dirs:
6+
- vendor
7+
skip-files:
8+
- ".*\\.pb\\.go$"
9+
10+
linters-settings:
11+
errcheck:
12+
check-type-assertions: true
13+
check-blank: true
14+
15+
govet:
16+
enable-all: true
17+
disable:
18+
- fieldalignment
19+
20+
gofmt:
21+
simplify: true
22+
23+
goimports:
24+
local-prefixes: github.com/GetStoreConnect/storeconnect-cli
25+
26+
goconst:
27+
min-len: 3
28+
min-occurrences: 3
29+
30+
misspell:
31+
locale: US
32+
33+
lll:
34+
line-length: 120
35+
36+
gocyclo:
37+
min-complexity: 15
38+
39+
dupl:
40+
threshold: 100
41+
42+
gocritic:
43+
enabled-tags:
44+
- diagnostic
45+
- experimental
46+
- opinionated
47+
- performance
48+
- style
49+
50+
linters:
51+
enable:
52+
- errcheck
53+
- gosimple
54+
- govet
55+
- ineffassign
56+
- staticcheck
57+
- unused
58+
- gofmt
59+
- goimports
60+
- goconst
61+
- misspell
62+
- lll
63+
- gocyclo
64+
- dupl
65+
- gocritic
66+
67+
disable:
68+
- typecheck
69+
70+
issues:
71+
exclude-use-default: false
72+
max-issues-per-linter: 0
73+
max-same-issues: 0
74+
75+
exclude-rules:
76+
# Exclude some linters from running on tests files.
77+
- path: _test\.go
78+
linters:
79+
- gocyclo
80+
- errcheck
81+
- dupl
82+
- gosec
83+
- lll

0 commit comments

Comments
 (0)