Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15
go-version: "1.16.0-rc1"
stable: false

- name: Set up Node
uses: actions/setup-node@v2-beta
Expand All @@ -31,8 +32,6 @@ jobs:

- name: Checkout
uses: actions/checkout@v2
with:
lfs: true
with:
path: ${{ env.working-directory }}
fetch-depth: 0
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,18 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 6
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
lfs: true
go-version: "1.16.0-rc1"
stable: false

- uses: actions/checkout@v2

- uses: golangci/golangci-lint-action@master
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.28
version: v1.36.0
args: --timeout 10m
github-token: ${{ secrets.github_token }}
skip-go-installation: true

2 changes: 0 additions & 2 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
lfs: true
- uses: actions/setup-node@v1
with:
node-version: 14
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15
go-version: "1.16.0-rc1"
stable: false

- name: Set up Node
uses: actions/setup-node@v2-beta
Expand All @@ -34,7 +35,6 @@ jobs:
with:
path: ${{ env.working-directory }}
fetch-depth: 0
lfs: true

- name: Build UI
working-directory: ${{ env.working-directory }}
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/test-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15
go-version: "1.16.0-rc1"
stable: false

- name: "Get Go 1.15"
run: |
go get golang.org/dl/go1.15
go1.15 download

- name: Install protoc
uses: arduino/setup-protoc@v1
Expand All @@ -30,7 +36,6 @@ jobs:
with:
path: ${{ env.working-directory }}
fetch-depth: 0
lfs: true

- name: Build UI
working-directory: ${{ env.working-directory }}
Expand All @@ -52,3 +57,5 @@ jobs:
- name: Run Integration Tests
working-directory: ${{ env.working-directory }}
run: ./scripts/test-integration
env:
GONAME: "go1.15"
5 changes: 2 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
lfs: true
- uses: actions/setup-go@v2
with:
go-version: '1.15'
go-version: "1.16.0-rc1"
stable: false
- run: ./scripts/test-unit
7 changes: 7 additions & 0 deletions .gitpod.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
FROM gitpod/workspace-full

RUN wget https://golang.org/dl/go1.16rc1.linux-amd64.tar.gz && \
rm -rf $HOME/go && \
tar -C $HOME -xzf go1.16rc1.linux-amd64.tar.gz && \
rm go1.16rc1.linux-amd64.tar.gz

ENV GONAME go1.15

RUN brew install gh protobuf
4 changes: 4 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ workspaceLocation: "./starport/docs"

tasks:
- name: Install Starport
before: |
go get golang.org/dl/go1.15
go1.15 download

init: |
# Install Starport
export BIN_PATH=$GOPATH/bin
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/tendermint/starport

go 1.15
go 1.16

require (
github.com/AlecAivazis/survey/v2 v2.1.1
Expand Down
36 changes: 0 additions & 36 deletions go.sum

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion integration/env_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"github.com/tendermint/starport/starport/pkg/availableport"
"github.com/tendermint/starport/starport/pkg/cmdrunner"
"github.com/tendermint/starport/starport/pkg/cmdrunner/step"
"github.com/tendermint/starport/starport/pkg/gocmd"
"github.com/tendermint/starport/starport/pkg/httpstatuschecker"
"github.com/tendermint/starport/starport/pkg/xurl"
)
Expand Down Expand Up @@ -209,7 +210,7 @@ func (e env) Serve(msg, path, home, clihome string, options ...execOption) (ok b
func (e env) EnsureAppIsSteady(appPath string) {
e.Exec("make sure app is steady",
step.NewSteps(step.New(
step.Exec("go", "test", "./..."),
step.Exec(gocmd.Name(), "test", "./..."),
step.Workdir(appPath),
)),
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env node

var path = require("path"),
jscli = require("../pbjs.js"),
tscli = require("../pbts.js");
Expand All @@ -7,6 +8,11 @@ var args = process.argv.slice(3);
var mode = process.argv[2];
var ret;

if (mode === "sta") {
require("../sta");
return;
}

if (mode === "js") {
ret = jscli.main(args);
} else {
Expand Down
5 changes: 3 additions & 2 deletions scripts/data/gen-protobufjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"main": "index.js",
"types": "index.d.ts",
"bin": {
"pb": "bin/pb"
"nodetime": "bin/nodetime"
},
"dependencies": {
"chalk": "^4.0.0",
Expand All @@ -24,7 +24,8 @@
"protobufjs": "^6.10.2",
"semver": "^7.1.2",
"tmp": "^0.2.1",
"uglify-js": "^3.7.7"
"uglify-js": "^3.7.7",
"swagger-typescript-api": "5.0.0"
},
"pkg": {
"assets": ["targets/**/*", "wrappers/**/*"]
Expand Down
111 changes: 111 additions & 0 deletions scripts/data/gen-protobufjs/sta/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
// Copyright (c) 2019-present acacode
// Node module: swagger-typescript-api
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
// Repository https://github.com/acacode/swagger-typescript-api

const { Command } = require("commander");
const { resolve } = require("path");
const { generateApi } = require("swagger-typescript-api");
const { TS_KEYWORDS } = require("swagger-typescript-api/src/constants");

const program = new Command("swagger-typescript-api");
const version = "5.0.0";

program.storeOptionsAsProperties(true);

program
.version(version, "-v, --version", "output the current version")
.description("Generate api via swagger scheme.\nSupports OA 3.0, 2.0, JSON, yaml.");

program
.requiredOption("-p, --path <path>", "path/url to swagger scheme")
.option("-o, --output <output>", "output path of typescript api file", "./")
.option("-n, --name <name>", "name of output typescript api file", "Api.ts")
.option("-t, --templates <path>", "path to folder containing templates")
.option(
"-d, --default-as-success",
'use "default" response status code as success response too.\n' +
'some swagger schemas use "default" response status code as success response type by default.',
false,
)
.option(
"-r, --responses",
"generate additional information about request responses\n" +
"also add typings for bad responses",
false,
)
.option("--union-enums", 'generate all "enum" types as union types (T1 | T2 | TN)', false)
.option("--route-types", "generate type definitions for API routes", false)
.option("--no-client", "do not generate an API class", false)
.option(
"--enum-names-as-values",
"use values in 'x-enumNames' as enum values (not only as keys)",
false,
)
.option(
"--extract-request-params",
"extract request params to data contract (Also combine path params and query params into one object)",
false,
)
.option(
"--modular",
"generate separated files for http client, data contracts, and routes",
false,
)
.option("--js", "generate js api module with declaration file", false)
.option(
"--module-name-index <number>",
"determines which path index should be used for routes separation (example: GET:/fruites/getFruit -> index:0 -> moduleName -> fruites)",
0,
)
.option("--disableStrictSSL", "disabled strict SSL", false)
.option("--default-response <type>", "default type for empty response schema", TS_KEYWORDS.VOID)
.option(
"--clean-output",
"clean output folder before generate api. WARNING: May cause data loss",
false,
);

program.parse(process.argv);

const {
path,
output,
name,
templates,
unionEnums,
routeTypes,
client,
defaultAsSuccess,
responses,
modular,
js,
moduleNameIndex,
extractRequestParams,
enumNamesAsValues,
disableStrictSSL,
cleanOutput,
defaultResponse,
} = program;

generateApi({
name,
url: path,
generateRouteTypes: routeTypes,
generateClient: client,
defaultResponseAsSuccess: defaultAsSuccess,
defaultResponseType: defaultResponse,
generateUnionEnums: unionEnums,
generateResponses: responses,
extractRequestParams: extractRequestParams,
input: resolve(process.cwd(), path),
output: resolve(process.cwd(), output || "."),
templates,
modular: !!modular,
toJS: !!js,
enumNamesAsValues: enumNamesAsValues,
moduleNameIndex: +(moduleNameIndex || 0),
disableStrictSSL: !!disableStrictSSL,
cleanOutput: !!cleanOutput,
});
Loading