Skip to content

Commit 6d9200c

Browse files
author
Nitin
authored
[BREAKING] dsl package refactor (goadesign#1913)
* Consolidate design packages * Rename Metadata to Meta * Merge DSLs * Merge DSLs part 2 * Typo * Add back examples Fixup all errors. * Add FinalizeFunc in codegen * Fix all tests * Nix aliaser * Fix some more examples * Change middleware logger interface to match gokit logger * Fix example server templates to handle gokit plugin * Fix type names in server/client types and openapi * Fix documentation on dsl/api.go * Fix openapi specs * Fix test-plugins in travis
1 parent ef09c45 commit 6d9200c

File tree

200 files changed

+4320
-7013
lines changed

Some content is hidden

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

200 files changed

+4320
-7013
lines changed

.golint_exclude

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
http/design/response.go
21
^examples/.*
2+
dsl/http.go
3+
expr/http_response.go
34
codegen/service/testing/.*
45
http/codegen/testing/.*
56
http/middleware/trace.go

.travis.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@ script:
88
- cd ../../.. && mkdir goa.design && cp -r github.com/goadesign/goa goa.design/goa
99
- cd goa.design/goa
1010
- make travis
11-
- make test-aliaser
1211
# https://graysonkoonce.com/getting-the-current-branch-name-during-a-pull-request-in-travis-ci/
13-
- export GOA_BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi)
12+
- export GOA_BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi) && echo $GOA_BRANCH
1413
- make test-plugins
1514
notifications:
1615
slack:

Makefile

+6-24
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,12 @@
55
# Targets:
66
# - "depend" retrieves the Go packages needed to run the linter and tests
77
# - "lint" runs the linter and checks the code format using goimports
8-
# - "aliases" builds the DSL aliases files
98
# - "test" runs the tests
109
#
1110
# Meta targets:
1211
# - "all" is the default target, it runs all the targets in the order above.
1312
#
14-
DIRS=$(shell go list -f {{.Dir}} goa.design/goa/design/...)
15-
ALIASER_DESTS=\
16-
http
13+
DIRS=$(shell go list -f {{.Dir}} goa.design/goa/expr/...)
1714

1815
# Only list test and build dependencies
1916
# Standard dependencies are installed via go get
@@ -22,7 +19,7 @@ DEPEND=\
2219
golang.org/x/lint/golint \
2320
golang.org/x/tools/cmd/goimports
2421

25-
all: lint aliases gen test
22+
all: lint gen test
2623

2724
travis: depend all
2825

@@ -40,13 +37,6 @@ lint:
4037
echo "^ - Lint errors!" && echo && exit 1; \
4138
fi
4239

43-
aliases:
44-
@cd cmd/aliaser && \
45-
go build && \
46-
for d in $(ALIASER_DESTS) ; do \
47-
./aliaser -src goa.design/goa/dsl -dest goa.design/goa/$$d/dsl > /dev/null; \
48-
done
49-
5040
gen:
5141
@cd cmd/goa && \
5242
go install && \
@@ -69,22 +59,14 @@ gen:
6959
test:
7060
go test ./...
7161

72-
test-aliaser: aliases
73-
@for d in $(ALIASER_DESTS) ; do \
74-
if [ "`git diff $$d/*/aliases.go | tee /dev/stderr`" ]; then \
75-
echo "^ - Aliaser tool output not identical!" && echo && exit 1; \
76-
else \
77-
echo "Aliaser tool output identical"; \
78-
fi \
79-
done
80-
8162
test-plugins:
8263
@if [ -z $(GOA_BRANCH) ]; then\
8364
GOA_BRANCH=$$(git rev-parse --abbrev-ref HEAD); \
8465
fi
85-
@go get -d -v goa.design/plugins/... && \
86-
cd $(GOPATH)/src/goa.design/plugins && \
87-
git checkout $(GOA_BRANCH) || echo "Using master branch" && \
66+
@if [ ! -d "$(GOPATH)/src/goa.design/plugins" ]; then\
67+
git clone https://github.com/goadesign/plugins.git $(GOPATH)/src/goa.design/plugins; \
68+
fi
69+
@cd $(GOPATH)/src/goa.design/plugins && git checkout $(GOA_BRANCH) || echo "Using master branch in plugins repo" && \
8870
make -k || (echo "Tests in plugin repo (https://github.com/goadesign/plugins) failed" \
8971
"due to changes in goa repo (branch: $(GOA_BRANCH))!" \
9072
"Create a branch with name '$(GOA_BRANCH)' in the plugin repo and fix these errors." && exit 1)

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
# <img src="http://goa.design/img/goa-logo.svg">
1+
#
22

3+
![goa logo](https://goa.design/img/goa-logo.svg "goa")
34
goa is a framework for building micro-services and APIs in Go using a unique
45
design-first approach.
56

@@ -10,7 +11,7 @@ design-first approach.
1011
[![Godoc](https://godoc.org/goa.design/goa?status.svg)](https://godoc.org/goa.design/goa)
1112
[![Slack](https://img.shields.io/badge/slack-gophers-orange.svg?style=flat)](https://gophers.slack.com/messages/goa/)
1213

13-
## Why goa?
14+
## Overview
1415

1516
goa takes a different approach to building services by making it possible to
1617
describe the *design* of the service API using a simple Go DSL. goa uses the
@@ -89,8 +90,7 @@ content:
8990
```go
9091
package design
9192

92-
import . "goa.design/goa/http/design"
93-
import . "goa.design/goa/http/dsl"
93+
import . "goa.design/goa/dsl"
9494

9595
// API describes the global properties of the API server.
9696
var _ = API("calc", func() {
@@ -266,7 +266,7 @@ The `http` directory contains the OpenAPI 2.0 specification in both YAML and
266266
JSON format.
267267

268268
The specification can easily be served from the service itself using a file
269-
server. The [Files](http://godoc.org/goa.design/goa/http/dsl/http.go#Files) DSL
269+
server. The [Files](http://godoc.org/goa.design/goa/dsl/http.go#Files) DSL
270270
function makes it possible to server static file. Edit the file
271271
`design/design.go` and add:
272272

cmd/aliaser/.gitignore

-1
This file was deleted.

0 commit comments

Comments
 (0)