Skip to content

Update to TypeScript 4.1 #421

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Dec 21, 2020
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
3 changes: 1 addition & 2 deletions examples/access-token-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@
"nodemon": "^2.0.4",
"test": "^0.6.0",
"ts-jest": "^26.4.1",
"ts-node": "^9.0.0",
"typescript": "^4.0.3"
"ts-node": "^9.0.0"
},
"eslintConfig": {
"extends": [
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"test:ts": "yarn jest --reporters=default --reporters=jest-junit",
"test:apix": "yarn jest packages/api-explorer packages/run-it packages/extension-api-explorer",
"test:iphone": "xcodebuild test -project swift/looker/looker.xcodeproj -scheme looker-Package -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 11,OS=13.4.1' | xcpretty --test --color",
"test:sdk": "yarn jest packages/sdk",
"test:jest": "DOT_ENV_FILE=.env.test jest",
"bootstrap": "lerna clean -y && lerna bootstrap",
"watch": "lerna run --parallel watch"
Expand Down Expand Up @@ -92,9 +93,9 @@
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-mdx": "^1.6.8",
"eslint-plugin-prettier": "^3.1.3",
"jest": "^26.4.0",
"jest-canvas-mock": "^2.2.0",
"jest-junit": "^10.0.0",
"jest": "^26.6.3",
"jest-canvas-mock": "^2.3.0",
"jest-junit": "^12.0.0",
"jest-styled-components": "^7.0.3",
"js-yaml": "^3.13.1",
"lerna": "^3.20.2",
Expand All @@ -108,9 +109,9 @@
"react": "^16.13.1",
"react-dom": "^16.13.1",
"styled-components": "^5.2.1",
"ts-jest": "^26.2.0",
"ts-node": "^8.1.0",
"typescript": "3.8.2",
"ts-jest": "^26.4.4",
"ts-node": "^9.1.1",
"typescript": "^4.1.3",
"webpack": "^4.43.0",
"node-forge": "^0.10.0",
"node-uuid": "^1.4.8"
Expand Down Expand Up @@ -198,7 +199,6 @@
},
"keywords": [],
"resolutions": {
"set-value": "^2.0.1",
"typescript": "3.8.2"
"set-value": "^2.0.1"
}
}
3 changes: 0 additions & 3 deletions packages/api-explorer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,5 @@
"react-router-dom": "^5.1.2",
"styled-components": "^5.2.1",
"ts-jest": "^26.2.0"
},
"resolutions": {
"typescript": "3.8.2"
}
}
3 changes: 0 additions & 3 deletions packages/extension-api-explorer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,5 @@
"react-router-dom": "^5.2.0",
"webpack-cli": "^3.3.12",
"webpack-dev-server": "^3.11.0"
},
"resolutions": {
"typescript": "3.8.2"
}
}
6 changes: 1 addition & 5 deletions packages/hackathon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@
"develop": "webpack-dev-server --hot --disable-host-check --port 8080 --https --config webpack.dev.config.js",
"watch": "yarn lerna exec --scope @looker/wholly-sheet --stream 'BABEL_ENV=build babel src --root-mode upward --out-dir lib --source-maps --extensions .ts,.tsx --no-comments --watch'"
},
"resolutions": {
"typescript": "3.8.2"
},
"dependencies": {
"@looker/components": "^0.9.28",
"@looker/extension-sdk": "^0.13.0-alpha.1",
Expand All @@ -51,8 +48,7 @@
"redux": "^4.0.5",
"redux-saga": "^1.1.3",
"styled-components": "^5.2.1",
"styled-system": "^5.1.2",
"typescript": "3.8.2"
"styled-system": "^5.1.2"
},
"devDependencies": {
"@types/react-redux": "^7.1.9",
Expand Down
4 changes: 0 additions & 4 deletions packages/run-it/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
"react-router-dom": "^5.2.0",
"react-test-renderer": "^17.0.1",
"style-loader": "^1.1.3",
"typescript": "3.8.2",
"webpack-cli": "^3.3.11",
"webpack-dev-server": "^3.10.3"
},
Expand All @@ -60,8 +59,5 @@
"react-google-charts": "^3.0.15",
"react-is": "^16.13.1",
"styled-components": "^5.2.1"
},
"resolutions": {
"typescript": "3.8.2"
}
}
2 changes: 1 addition & 1 deletion packages/sdk-codegen-scripts/src/declarationMiner.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ describe('Declaration miner', () => {

const sourcePath = settings.base_url
const isConfigured = () => settings.base_url
const testIfConfigured = isConfigured ? it : it.skip
const testIfConfigured = isConfigured() ? it : it.skip

testIfConfigured('should mine files matching the probe settings', () => {
const miner = new DeclarationMiner(
Expand Down
3 changes: 0 additions & 3 deletions packages/sdk-codegen-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,5 @@
],
"scripts": {
"watch": "yarn lerna exec --scope @looker/sdk-codegen-utils --stream 'BABEL_ENV=build babel src --root-mode upward --out-dir lib --source-maps --extensions .ts,.tsx --no-comments --watch'"
},
"resolutions": {
"typescript": "3.8.2"
}
}
4 changes: 2 additions & 2 deletions packages/sdk-codegen/src/specConverter.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,8 @@ const swagger = JSON.parse(swaggerFrag)
const api = JSON.parse(openApiFrag)

const config = TestConfig()
const swaggerFile = `${config.rootPath}/spec/Looker.4.0.json`
const apiFile = `${config.rootPath}/spec/Looker.4.0.oas.json`
const swaggerFile = `${config.rootPath}spec/Looker.4.0.json`
const apiFile = `${config.rootPath}spec/Looker.4.0.oas.json`
Comment on lines +405 to +406
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

testUtils now has a rootFile() function we can use to fix this up in a future PR

const swaggerSource = readFileSync(swaggerFile, 'utf-8')
const fullSwagger = JSON.parse(swaggerSource)
const apiSource = readFileSync(apiFile, 'utf-8')
Expand Down
4 changes: 1 addition & 3 deletions packages/sdk-rtl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@
"ini": "^1.3.5",
"readable-stream": "^3.4.0",
"request": "^2.88.0",
"request-promise-native": "^1.0.8",
"ts-node": "^8.4.1",
"typescript": "^3.8.2"
"request-promise-native": "^1.0.8"
},
"keywords": [
"Looker",
Expand Down
6 changes: 3 additions & 3 deletions packages/sdk-rtl/src/baseTransport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export abstract class BaseTransport implements ITransport {
* @param options overrides of default transport settings
* @returns typed response of `TSuccess`, or `TError` result
*/
abstract async rawRequest(
abstract rawRequest(
method: HttpMethod,
path: string,
queryParams?: Values,
Expand All @@ -80,7 +80,7 @@ export abstract class BaseTransport implements ITransport {
* @param {Partial<ITransportSettings>} options transport option overrides
* @returns {Promise<TSuccess>} the streaming response
*/
abstract async request<TSuccess, TError>(
abstract request<TSuccess, TError>(
method: HttpMethod,
path: string,
queryParams?: any,
Expand All @@ -101,7 +101,7 @@ export abstract class BaseTransport implements ITransport {
* @param {Partial<ITransportSettings>} options transport option overrides
* @returns {Promise<TSuccess>} the streaming response
*/
abstract async stream<TSuccess>(
abstract stream<TSuccess>(
callback: (readable: Readable) => Promise<TSuccess>,
method: HttpMethod,
path: string,
Expand Down
12 changes: 8 additions & 4 deletions packages/sdk-rtl/src/testUtils/testUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
*/

import * as fs from 'fs'
import path from 'path'
import { ApiConfig } from '../nodeSettings'

interface IKeyAny {
Expand Down Expand Up @@ -52,17 +53,20 @@ export interface ITestConfig {
testSection: IKeyAny
}

const homeToRoost = '../../../../'

export const getRootPath = () => path.join(__dirname, homeToRoost)
export const rootFile = (fileName = '') => path.join(getRootPath(), fileName)

/**
* Reads configuration information, returning various test values
* @param {string} rootPath
* @returns {{testConfig: {[p: string]: any}; localIni: string; baseUrl: any; testData: any; apiVersion: any; testIni: string; configContents: string; rootPath: string; testSection: any; timeout: number}}
* @constructor
*/
export function TestConfig(rootPath = ''): ITestConfig {
export const TestConfig = (rootPath = ''): ITestConfig => {
const testFile = 'data.yml.json'
if (!rootPath) {
rootPath = fs.existsSync(`test/${testFile}`) ? '' : '../../'
}
rootPath = rootPath || getRootPath()
const localIni = process.env.LOOKERSDK_INI || `${rootPath}looker.ini`
const testPath = `${rootPath}test/`
const dataFile = `${testPath}${testFile}`
Expand Down
4 changes: 1 addition & 3 deletions packages/sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@
"ini": "^1.3.5",
"readable-stream": "^3.4.0",
"request": "^2.88.0",
"request-promise-native": "^1.0.8",
"ts-node": "^8.4.1",
"typescript": "^3.8.2"
"request-promise-native": "^1.0.8"
},
"keywords": [
"Looker",
Expand Down
3 changes: 0 additions & 3 deletions packages/wholly-sheet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@
"scripts": {
"watch": "yarn lerna exec --scope @looker/wholly-sheet --stream 'BABEL_ENV=build babel src --root-mode upward --out-dir lib --source-maps --extensions .ts,.tsx --no-comments --watch'"
},
"resolutions": {
"typescript": "3.8.2"
},
"dependencies": {
"@looker/sdk": "^0.3.7-beta.0",
"@looker/sdk-rtl": "^0.3.7-beta.0",
Expand Down
Loading