Skip to content

Commit

Permalink
Merge pull request #1373 from onflow/ianthpun/flowkit-export
Browse files Browse the repository at this point in the history
update to use flowkit externally
  • Loading branch information
ianthpun authored Feb 5, 2024
2 parents 3228fe3 + 94e1b04 commit b05ee6f
Show file tree
Hide file tree
Showing 147 changed files with 251 additions and 18,615 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,12 @@ jobs:
fetch-depth: 0
- uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: "1.20"
- name: Run tests
run: |
make ci
make check-tidy
make check-headers
make check-schema
- name: Upload coverage report
uses: codecov/codecov-action@v1
with:
Expand Down
18 changes: 0 additions & 18 deletions .github/workflows/flowkit-release.yml

This file was deleted.

15 changes: 2 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ install-tools:
.PHONY: test
test:
GO111MODULE=on go test -coverprofile=$(COVER_PROFILE) $(if $(JSON_OUTPUT),-json,) ./...
cd flowkit; GO111MODULE=on go test -coverprofile=$(COVER_PROFILE) $(if $(JSON_OUTPUT),-json,) ./...

.PHONY: test-e2e-emulator
test-e2e-emulator:
Expand All @@ -58,7 +57,7 @@ $(BINARY):
GO111MODULE=on go build \
-trimpath \
-ldflags \
"-X github.com/onflow/flow-cli/build.commit=$(COMMIT) -X github.com/onflow/flow-cli/build.semver=$(VERSION) -X github.com/onflow/flow-cli/flowkit/util.MIXPANEL_PROJECT_TOKEN=${MIXPANEL_PROJECT_TOKEN} -X github.com/onflow/flow-cli/internal/accounts.accountToken=${ACCOUNT_TOKEN}"\
"-X github.com/onflow/flow-cli/build.commit=$(COMMIT) -X github.com/onflow/flow-cli/build.semver=$(VERSION) -X github.com/onflow/flow-cli/internal/accounts.accountToken=${ACCOUNT_TOKEN}"\
-o $(BINARY) ./cmd/flow

.PHONY: versioned-binaries
Expand Down Expand Up @@ -97,20 +96,10 @@ fix-lint:
check-headers:
@./check-headers.sh

.PHONY: check-schema
check-schema:
cd flowkit && go run ./cmd/flow-schema/flow-schema.go --verify=true ./schema.json

.PHONY: check-tidy
check-tidy:
go mod tidy
cd flowkit; go mod tidy

.PHONY: generate-schema
generate-schema:
cd flowkit && go run ./cmd/flow-schema/flow-schema.go ./schema.json

.PHONY: generate
generate: install-tools
cd flowkit; \
go generate ./...
go generate ./...
285 changes: 0 additions & 285 deletions flowkit/CHANGELOG.md

This file was deleted.

17 changes: 2 additions & 15 deletions flowkit/README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
## Flowkit Package Design
Flowkit is a core package used by the CLI commands. It features APIs for interacting with the Flow network
in the context of flow.json configuration values. Flowkit is defined by the [interface here](services.go).

Flowkit contains multiple subpackages, the most important ones are:
- **config**: parsing and storing of flow.json values, as well as validation,
- **gateway**: implementation of Flow AN methods, uses emulator as well as Go SDK to communicate with ANs,
- **project**: stateful operations on top of flow.json, which allows resolving imports in contracts used in deployments

It is important we define clear boundaries between flowkit and other CLI packages. If we are in doubt where certain
methods should be implemented we must ask ourselves if the method provides value for any other consumers of the
pacakge or only provides utility for CLI usage, if it's only providing utility for CLI then it should be added inside
the internal package, instead of flowkit. If in doubt better to add things to internal package and then move to flowkit
if such need is identified.

## Flowkit

Note: This module has been migrated to github.com/onflow/flowkit. The latest supported version is v1.13.0. Please use the new module github.com/onflow/flowkit instead for any future updates. Version v1.13.0 is equivalent to version v1.13.0 on the new module.
Loading

0 comments on commit b05ee6f

Please sign in to comment.