Skip to content

Commit

Permalink
chore: upgrade to TypeScript 4.1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
edvald authored and thsig committed Feb 24, 2021
1 parent 164f30f commit 725f8a5
Show file tree
Hide file tree
Showing 11 changed files with 2,512 additions and 2,441 deletions.
3 changes: 3 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,9 @@ jobs:
# - We skip tests that only work for remote environments
# - We currently don't support in-cluster building on kind.
yarn integ-kind -b
- run:
name: Plugin tests
command: yarn run test:plugins
- run:
name: Deploy demo-project
command: ./bin/garden deploy --root examples/demo-project --logger-type basic
Expand Down
12 changes: 6 additions & 6 deletions core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@
"json-stable-stringify": "^1.0.1",
"json-stringify-safe": "^5.0.1",
"klaw": "^3.0.0",
"koa": "^2.12.0",
"koa": "^2.13.1",
"koa-bodyparser": "^4.3.0",
"koa-mount": "^4.0.0",
"koa-router": "8.0.8",
"koa-router": "^10.0.0",
"koa-static": "^5.0.0",
"koa-websocket": "^6.0.0",
"linewrap": "^0.2.1",
Expand Down Expand Up @@ -175,12 +175,12 @@
"@types/json-merge-patch": "0.0.5",
"@types/json-stringify-safe": "^5.0.0",
"@types/klaw": "^3.0.1",
"@types/koa": "^2.11.3",
"@types/koa": "^2.13.0",
"@types/koa-bodyparser": "^4.3.0",
"@types/koa-mount": "^4.0.0",
"@types/koa-router": "7.4.1",
"@types/koa-router": "^7.4.1",
"@types/koa-static": "^4.0.1",
"@types/koa-websocket": "^5.0.4",
"@types/koa-websocket": "^5.0.5",
"@types/lodash": "^4.14.153",
"@types/minimatch": "^3.0.3",
"@types/mocha": "^7.0.2",
Expand Down Expand Up @@ -255,4 +255,4 @@
]
},
"gitHead": "b0647221a4d2ff06952bae58000b104215aed922"
}
}
11 changes: 8 additions & 3 deletions core/src/enterprise/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { InternalError } from "../exceptions"
import { EnterpriseApi, AuthTokenResponse } from "./api"
import { ClientAuthToken } from "../db/entities/client-auth-token"
import { gardenEnv } from "../constants"
import { isArray } from "lodash"

/**
* Logs in to Garden Enterprise if needed, and returns a valid client auth token.
Expand Down Expand Up @@ -114,9 +115,9 @@ export class AuthRedirectServer {
http.get("/", async (ctx) => {
const { jwt, rt, jwtval } = ctx.request.query
const tokenResponse: AuthTokenResponse = {
token: jwt,
refreshToken: rt,
tokenValidity: jwtval,
token: getFirstValue(jwt),
refreshToken: getFirstValue(rt),
tokenValidity: parseInt(getFirstValue(jwtval), 10),
}
this.log.debug("Received client auth token")
this.events.emit("receivedToken", tokenResponse)
Expand All @@ -132,3 +133,7 @@ export class AuthRedirectServer {
this.server = app.listen(this.port)
}
}

function getFirstValue(v: string | string[]) {
return isArray(v) ? v[0] : v
}
4 changes: 2 additions & 2 deletions core/src/server/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,8 @@ export class GardenServer {
})
})

app.ws.use(<Koa.Middleware<websockify.MiddlewareContext<any>>>wsRouter.routes())
app.ws.use(<Koa.Middleware<websockify.MiddlewareContext<any>>>wsRouter.allowedMethods())
app.ws.use(<Koa.Middleware<any>>wsRouter.routes())
app.ws.use(<Koa.Middleware<any>>wsRouter.allowedMethods())
}
}

Expand Down
14 changes: 7 additions & 7 deletions dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"@types/eslint": "^6",
"@types/lodash": "^4.14.153",
"@types/node": "^12.12.16",
"@types/react": "^16.9.35",
"@types/react-dom": "^16.9.8",
"@types/react": "17.0.1",
"@types/react-dom": "17.0.1",
"@types/react-router-dom": "^5.1.5",
"@types/react-select": "^3.0.13",
"@typescript-eslint/eslint-plugin-tslint": "^2.23.0",
Expand All @@ -23,7 +23,7 @@
"tslint-no-unused": "^0.2.0-alpha.1",
"tslint-plugin-prettier": "^2.3.0",
"tslint-react": "^5.0.0",
"typescript": "^3.9.3"
"typescript": "4.1.5"
},
"dependencies": {
"@emotion/core": "^10.0.28",
Expand All @@ -42,12 +42,12 @@
"moment": "^2.26.0",
"node-sass": "^4.14.1",
"normalize-url": "4.5.0",
"react": "^16.13.1",
"react-content-loader": "^4.3.3",
"react-dom": "^16.13.1",
"react": "^17.0.1",
"react-content-loader": "^6.0.1",
"react-dom": "^17.0.1",
"react-router-dom": "^5.2.0",
"react-select": "^3.1.0",
"reaflow": "^2.4.4"
"reaflow": "^3.0.13"
},
"scripts": {
"start": "react-scripts start",
Expand Down
24 changes: 13 additions & 11 deletions dashboard/src/components/graph/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,18 +170,20 @@ export const StackGraph: React.FC<Props> = ({
}

return (
<div
className={classes.join(" ")}
// tslint:disable-next-line: jsx-no-lambda
onClick={onClick}
>
<div className="type">
{capitalize(type)}
{disabled ? <i className="fas fa-ban" /> : ""}
<foreignObject x={0} y={0} height={event.height} width={event.width}>
<div
className={classes.join(" ")}
// tslint:disable-next-line: jsx-no-lambda
onClick={onClick}
>
<div className="type">
{capitalize(type)}
{disabled ? <i className="fas fa-ban" /> : ""}
</div>
<span className="module-name">{moduleName}</span>
{subName}
</div>
<span className="module-name">{moduleName}</span>
{subName}
</div>
</foreignObject>
)
}

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"tslint-no-focused-test": "^0.5.0",
"tslint-no-unused": "^0.2.0-alpha.1",
"tslint-plugin-prettier": "^2.3.0",
"typescript": "^3.9.7",
"typescript": "^4.1.5",
"typescript-formatter": "^7.2.2",
"wrap-ansi": "^7.0.0"
},
Expand Down Expand Up @@ -90,4 +90,4 @@
"plugins/*",
"sdk"
]
}
}
2 changes: 1 addition & 1 deletion plugins/conftest-container/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@
"author": "Garden Technologies, Inc. <[email protected]>",
"license": "MPL-2.0",
"homepage": "https://github.com/garden-io/garden"
}
}
2 changes: 1 addition & 1 deletion plugins/conftest-kubernetes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@
"author": "Garden Technologies, Inc. <[email protected]>",
"license": "MPL-2.0",
"homepage": "https://github.com/garden-io/garden"
}
}
2 changes: 1 addition & 1 deletion plugins/conftest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@
"author": "Garden Technologies, Inc. <[email protected]>",
"license": "MPL-2.0",
"homepage": "https://github.com/garden-io/garden"
}
}
Loading

0 comments on commit 725f8a5

Please sign in to comment.