Skip to content

Commit

Permalink
chore: internal/ -> pkg/ (#654)
Browse files Browse the repository at this point in the history
  • Loading branch information
moul authored Apr 13, 2023
1 parent 99a3ada commit c4da50f
Show file tree
Hide file tree
Showing 65 changed files with 286 additions and 284 deletions.
File renamed without changes.
31 changes: 16 additions & 15 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,22 @@ jobs:
args: release --rm-dist --snapshot --skip-publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
golangci-lint:
runs-on: ubuntu-latest
strategy:
matrix:
golangci_lint: [v1.47]
steps:
- uses: actions/checkout@v3.0.2
- name: golangci-lint
uses: golangci/golangci-lint-action@v3.4.0
with:
version: ${{ matrix.golangci_lint }}
#github-token: ${{ secrets.GITHUB_TOKEN }}
args: --timeout=2m
only-new-issues: false
working-directory: .
# disabled for now, requires updating all the deps and config.
#golangci-lint:
# runs-on: ubuntu-latest
# strategy:
# matrix:
# golangci_lint: [v1.47]
# steps:
# - uses: actions/checkout@v3.0.2
# - name: golangci-lint
# uses: golangci/golangci-lint-action@v3.4.0
# with:
# version: ${{ matrix.golangci_lint }}
# #github-token: ${{ secrets.GITHUB_TOKEN }}
# args: --timeout=2m
# only-new-issues: false
# working-directory: .
tests-on-windows:
needs: golangci-lint # run after golangci-lint action to not produce duplicated errors
runs-on: windows-latest
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ update_examples:
##


PROTOS_SRC := $(wildcard ./api/*.proto) $(wildcard ./api/internal/*.proto)
PROTOS_SRC := $(wildcard ./api/*.proto) $(wildcard ./api/pkg/*.proto)
GEN_DEPS := $(PROTOS_SRC) Makefile go.sum
.PHONY: generate
generate: gen.sum
Expand Down Expand Up @@ -66,9 +66,9 @@ generate_local:
); done
@# CUSTOM CHANGE
@# due to go module versionning (currently) incompatible with automatic protobuf generated imports
sed -i s@moul.io/depviz/@moul.io/depviz/v3/@g internal/dvserver/dvserver.pb.go
sed -i s@moul.io/depviz/@moul.io/depviz/v3/@g pkg/dvserver/dvserver.pb.go
@# END OF CUSTOM CHANGE
go run golang.org/x/tools/cmd/goimports -w ./pkg ./cmd ./internal
go run golang.org/x/tools/cmd/goimports -w ./pkg ./cmd ./pkg
shasum $(GEN_DEPS) | sort > gen.sum.tmp
mv gen.sum.tmp gen.sum

Expand All @@ -80,4 +80,4 @@ clean:

.PHONY: packr
packr:
cd internal/dvserver && go run github.com/gobuffalo/packr/v2/packr2 build && ls -la *-packr.go packrd/packed-packr.go
cd pkg/dvserver && go run github.com/gobuffalo/packr/v2/packr2 build && ls -la *-packr.go packrd/packed-packr.go
2 changes: 1 addition & 1 deletion api/dvmodel.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package depviz.model;
import "google/protobuf/timestamp.proto";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";

option go_package = "moul.io/depviz/internal/dvmodel";
option go_package = "moul.io/depviz/pkg/dvmodel";

option (gogoproto.goproto_getters_all) = false;
option (gogoproto.marshaler_all) = true;
Expand Down
2 changes: 1 addition & 1 deletion api/dvserver.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import "github.com/gogo/protobuf/gogoproto/gogo.proto";

import "dvmodel.proto";

option go_package = "moul.io/depviz/internal/dvserver";
option go_package = "moul.io/depviz/pkg/dvserver";
option (gogoproto.sizer_all) = true;
option (gogoproto.marshaler_all) = true;
option (gogoproto.unmarshaler_all) = true;
Expand Down
182 changes: 91 additions & 91 deletions cmd/depviz/depaware.txt

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions cmd/depviz/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ import (
"github.com/peterbourgon/ff/v3/ffcli"
"go.uber.org/zap"
"moul.io/banner"
"moul.io/depviz/v3/internal/dvcore"
"moul.io/depviz/v3/internal/dvparser"
"moul.io/depviz/v3/internal/dvserver"
"moul.io/depviz/v3/internal/dvstore"
"moul.io/depviz/v3/pkg/dvcore"
"moul.io/depviz/v3/pkg/dvparser"
"moul.io/depviz/v3/pkg/dvserver"
"moul.io/depviz/v3/pkg/dvstore"
"moul.io/srand"
"moul.io/u"
"moul.io/zapconfig"
Expand Down
8 changes: 4 additions & 4 deletions gen.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion internal/dvcore/doc.go

This file was deleted.

1 change: 0 additions & 1 deletion internal/dvmodel/doc.go

This file was deleted.

1 change: 0 additions & 1 deletion internal/dvparser/doc.go

This file was deleted.

1 change: 0 additions & 1 deletion internal/dvserver/doc.go

This file was deleted.

1 change: 0 additions & 1 deletion internal/dvstore/doc.go

This file was deleted.

1 change: 0 additions & 1 deletion internal/githubprovider/doc.go

This file was deleted.

1 change: 0 additions & 1 deletion internal/testutil/doc.go

This file was deleted.

File renamed without changes.
1 change: 1 addition & 0 deletions pkg/dvcore/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package dvcore // import "moul.io/depviz/v3/pkg/dvcore"
2 changes: 1 addition & 1 deletion internal/dvcore/fetch.go → pkg/dvcore/fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/cayleygraph/cayley"
"github.com/cayleygraph/cayley/schema"
"go.uber.org/zap"
"moul.io/depviz/v3/internal/dvparser"
"moul.io/depviz/v3/pkg/dvparser"
"moul.io/multipmuri"
)

Expand Down
8 changes: 4 additions & 4 deletions internal/dvcore/gen.go → pkg/dvcore/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import (
"github.com/cayleygraph/cayley/schema"
"go.uber.org/zap"
yaml "gopkg.in/yaml.v2"
"moul.io/depviz/v3/internal/dvmodel"
"moul.io/depviz/v3/internal/dvparser"
"moul.io/depviz/v3/internal/dvstore"
"moul.io/depviz/v3/internal/githubprovider"
"moul.io/depviz/v3/pkg/dvmodel"
"moul.io/depviz/v3/pkg/dvparser"
"moul.io/depviz/v3/pkg/dvstore"
"moul.io/depviz/v3/pkg/githubprovider"
"moul.io/graphman"
"moul.io/graphman/viz"
"moul.io/multipmuri"
Expand Down
4 changes: 2 additions & 2 deletions internal/dvcore/gen_test.go → pkg/dvcore/gen_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"github.com/cayleygraph/cayley/graph"
"github.com/cayleygraph/quad"
"github.com/stretchr/testify/assert"
"moul.io/depviz/v3/internal/dvstore"
"moul.io/depviz/v3/internal/testutil"
"moul.io/depviz/v3/pkg/dvstore"
"moul.io/depviz/v3/pkg/testutil"
"moul.io/multipmuri"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/dvcore/store.go → pkg/dvcore/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/cayleygraph/cayley"
"github.com/cayleygraph/cayley/schema"
"moul.io/depviz/v3/internal/dvmodel"
"moul.io/depviz/v3/pkg/dvmodel"
)

func StoreDumpQuads(h *cayley.Handle) error {
Expand Down
1 change: 1 addition & 0 deletions pkg/dvmodel/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package dvmodel // import "moul.io/depviz/v3/pkg/dvmodel"
Loading

0 comments on commit c4da50f

Please sign in to comment.