Skip to content

Commit

Permalink
misc: Use TS shared for whole monorepo (#1745)
Browse files Browse the repository at this point in the history
* misc: Use TS shared for whole monorepo

* misc: Use shared TS for compiling on CI
  • Loading branch information
ovr committed Jan 11, 2021
1 parent ce33f88 commit 224914e
Show file tree
Hide file tree
Showing 24 changed files with 610 additions and 572 deletions.
2 changes: 1 addition & 1 deletion .github/actions/init-ci/action.yaml
Expand Up @@ -27,4 +27,4 @@ runs:
- name: Lerna bootstrap
run: yarn lerna bootstrap --ignore @cubejs-backend/jdbc-driver
- name: Lerna tsc
run: yarn lerna run --concurrency 1 tsc
run: yarn tsc
8 changes: 4 additions & 4 deletions .github/workflows/push.yml
Expand Up @@ -71,7 +71,7 @@ jobs:
- name: Lerna bootstrap
run: yarn lerna bootstrap
- name: Lerna tsc
run: yarn lerna run --concurrency 1 tsc
run: yarn tsc
- name: Lerna test
run: yarn lerna run --concurrency 1 unit

Expand Down Expand Up @@ -210,7 +210,7 @@ jobs:
- name: Lerna bootstrap
run: yarn lerna bootstrap
- name: Lerna tsc
run: yarn lerna run --concurrency 1 tsc
run: yarn tsc
- name: Run Redis Integration
timeout-minutes: 10
run: |
Expand Down Expand Up @@ -309,7 +309,7 @@ jobs:
- name: Lerna bootstrap
run: yarn lerna bootstrap
- name: Lerna tsc
run: yarn lerna run --concurrency 1 tsc
run: yarn tsc
- name: Run MySQL Integration with 5.6
timeout-minutes: 10
run: |
Expand Down Expand Up @@ -397,7 +397,7 @@ jobs:
- name: Lerna bootstrap
run: yarn lerna bootstrap
- name: Lerna tsc
run: yarn lerna run --concurrency 1 tsc
run: yarn tsc
- name: Run PrestoDB Integration with Postgres 12.4
timeout-minutes: 15
run: |
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Expand Up @@ -12,4 +12,5 @@ yarn-error.log
.rpt2_cache/
**/.nyc_output
**/coverage
lerna-debug.log
lerna-debug.log
tsconfig.tsbuildinfo
8 changes: 5 additions & 3 deletions package.json
Expand Up @@ -9,8 +9,9 @@
"watch-local": "CUBEJS_API_URL=http://localhost:6020/cubejs-api/v1 rollup -c -w",
"lint": "lerna run lint",
"lint:fix": "lerna run lint:fix",
"tsc": "lerna run tsc",
"tsc:watch": "lerna run watch"
"tsc": "tsc --build",
"tsc:watch": "tsc --build --watch",
"clean": "rimraf packages/*/{tsconfig.tsbuildinfo,lib,dist}"
},
"author": "Cube Dev, Inc.",
"dependencies": {
Expand Down Expand Up @@ -55,8 +56,9 @@
"is-ci": "^2.0.0",
"lerna": "^3.13.1",
"prettier": "^2.0.5",
"rimraf": "^3.0.2",
"rollup": "^2.25.0",
"typescript": "~4.1.2"
"typescript": "^4.1.3"
},
"repository": {
"type": "git",
Expand Down
23 changes: 9 additions & 14 deletions packages/cubejs-api-gateway/tsconfig.json
@@ -1,19 +1,14 @@
{
"extends": "../../tsconfig.base.json",
"include": [
"src",
"test"
],
"compilerOptions": {
"outDir": "./dist", /* Redirect output structure to the directory. */
"strict": true, /* Enable all strict type-checking options. */
"outDir": "dist",
"rootDir": ".",
"baseUrl": ".",
"allowJs": true,
"noImplicitAny": false, /* Raise error on expressions and declarations with an implied 'any' type. */
"strictNullChecks": true, /* Enable strict null checks. */
"strictFunctionTypes": true, /* Enable strict checking of function types. */
"strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
"strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
"noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
"alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
"allowSyntheticDefaultImports": true,
"skipLibCheck": true, /* Skip type checking of declaration files. */
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
}
"noImplicitAny": false,
},
}
27 changes: 8 additions & 19 deletions packages/cubejs-backend-shared/tsconfig.json
@@ -1,23 +1,12 @@
{
"extends": "../../tsconfig.base.json",
"include": [
"src",
"test"
],
"compilerOptions": {
"lib": ["es2017"],
"target": "es2017", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
"declaration": true,
"declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
"sourceMap": true, /* Generates corresponding '.map' file. */
"outDir": "./dist", /* Redirect output structure to the directory. */
"strict": true, /* Enable all strict type-checking options. */
"noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
"strictNullChecks": true, /* Enable strict null checks. */
"strictFunctionTypes": true, /* Enable strict checking of function types. */
"strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
"strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
"noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
"alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
"allowSyntheticDefaultImports": true,
"skipLibCheck": true, /* Skip type checking of declaration files. */
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
"outDir": "dist",
"rootDir": ".",
"baseUrl": ".",
}
}
27 changes: 12 additions & 15 deletions packages/cubejs-cli/tsconfig.json
@@ -1,22 +1,19 @@
{
"extends": "../../tsconfig.base.json",
"include": [
"src",
"test"
],
"compilerOptions": {
"outDir": "./dist", /* Redirect output structure to the directory. */
"strict": true, /* Enable all strict type-checking options. */
"outDir": "dist",
"rootDir": ".",
"baseUrl": ".",
"allowJs": true,
"checkJs": true,
"declaration": false,
"declarationMap": false,
"noImplicitAny": false, /* Raise error on expressions and declarations with an implied 'any' type. */
"strictNullChecks": true, /* Enable strict null checks. */
"strictFunctionTypes": true, /* Enable strict checking of function types. */
"strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
"strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
"noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
"alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
"allowSyntheticDefaultImports": true,
"skipLibCheck": true, /* Skip type checking of declaration files. */
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
"noImplicitAny": false,
"strictNullChecks": true,
"strictFunctionTypes": true,
"strictBindCallApply": true,
"strictPropertyInitialization": true,
}
}
6 changes: 1 addition & 5 deletions packages/cubejs-druid-driver/custom.d.ts
@@ -1,9 +1,5 @@
declare module '@cubejs-backend/schema-compiler/adapter/BaseQuery' {
abstract class BaseQuery {
protected readonly timezone: string;

public escapeColumnName(identifier: string): string;
}
declare var BaseQuery: any;

export default BaseQuery;
}
2 changes: 1 addition & 1 deletion packages/cubejs-druid-driver/src/DruidClient.ts
Expand Up @@ -11,7 +11,7 @@ export type DruidClientConfiguration = DruidClientBaseConfiguration & {
};

export class DruidClient {
constructor(
public constructor(
protected readonly config: DruidClientConfiguration,
) {
}
Expand Down
4 changes: 2 additions & 2 deletions packages/cubejs-druid-driver/src/DruidDriver.ts
Expand Up @@ -11,11 +11,11 @@ export class DruidDriver extends BaseDriver {

protected readonly client: DruidClient;

static dialectClass() {
public static dialectClass() {
return DruidQuery;
}

constructor(config?: DruidDriverConfiguration) {
public constructor(config?: DruidDriverConfiguration) {
super();

let url = config?.url || process.env.CUBEJS_DB_URL;
Expand Down
21 changes: 8 additions & 13 deletions packages/cubejs-druid-driver/tsconfig.json
@@ -1,18 +1,13 @@
{
"extends": "../../tsconfig.base.json",
"include": [
"src",
"test"
],
"files": ["custom.d.ts"],
"compilerOptions": {
"outDir": "./dist", /* Redirect output structure to the directory. */
"strict": true, /* Enable all strict type-checking options. */
"noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
"strictNullChecks": true, /* Enable strict null checks. */
"strictFunctionTypes": true, /* Enable strict checking of function types. */
"strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
"strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
"noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
"alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
"allowSyntheticDefaultImports": true,
"skipLibCheck": true, /* Skip type checking of declaration files. */
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
"outDir": "dist",
"rootDir": ".",
"baseUrl": ".",
}
}
30 changes: 12 additions & 18 deletions packages/cubejs-query-orchestrator/tsconfig.json
@@ -1,24 +1,18 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"allowJs": true,
"checkJs": false,
"outDir": "./dist", /* Redirect output structure to the directory. */
"strict": true, /* Enable all strict type-checking options. */
"noImplicitAny": false, /* Raise error on expressions and declarations with an implied 'any' type. */
"strictNullChecks": false, /* Enable strict null checks. */
"strictFunctionTypes": false, /* Enable strict checking of function types. */
"strictBindCallApply": false, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
"strictPropertyInitialization": false, /* Enable strict checking of property initialization in classes. */
"noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
"alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
"allowSyntheticDefaultImports": true,
"skipLibCheck": true, /* Skip type checking of declaration files. */
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
},
"include": [
"src",
"test"
]
],
"compilerOptions": {
"outDir": "dist",
"rootDir": ".",
"baseUrl": ".",
"allowJs": true,
"noImplicitAny": false,
"strictNullChecks": false,
"strictFunctionTypes": false,
"strictBindCallApply": false,
"strictPropertyInitialization": false,
},
}
30 changes: 12 additions & 18 deletions packages/cubejs-server-core/tsconfig.json
@@ -1,24 +1,18 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"allowJs": true,
"checkJs": false,
"outDir": "./dist", /* Redirect output structure to the directory. */
"strict": true, /* Enable all strict type-checking options. */
"noImplicitAny": false, /* Raise error on expressions and declarations with an implied 'any' type. */
"strictNullChecks": false, /* Enable strict null checks. */
"strictFunctionTypes": false, /* Enable strict checking of function types. */
"strictBindCallApply": false, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
"strictPropertyInitialization": false, /* Enable strict checking of property initialization in classes. */
"noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
"alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
"allowSyntheticDefaultImports": true,
"skipLibCheck": true, /* Skip type checking of declaration files. */
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
},
"include": [
"src",
"test"
]
],
"compilerOptions": {
"outDir": "dist",
"rootDir": ".",
"baseUrl": ".",
"allowJs": true,
"noImplicitAny": false,
"strictNullChecks": false,
"strictFunctionTypes": false,
"strictBindCallApply": false,
"strictPropertyInitialization": false,
},
}
13 changes: 7 additions & 6 deletions packages/cubejs-server/package.json
Expand Up @@ -13,10 +13,11 @@
"node": ">=8.11.1"
},
"main": "index.js",
"typings": "dist/index.d.ts",
"typings": "dist/src/index.d.ts",
"files": [
"dist",
"bin",
"index.js",
"/oclif.manifest.json"
],
"bin": {
Expand All @@ -31,11 +32,11 @@
"tsc": "tsc",
"watch": "tsc -w",
"test": "npm run unit",
"lint": "linter src/* tests/ --ext .ts,.js",
"lint:fix": "linter --fix src/* tests/ --ext .ts,js",
"lint": "linter src/* test/ --ext .ts,.js",
"lint:fix": "linter --fix src/* test/ --ext .ts,js",
"unit": "jest",
"unit:debug": "jest --runInBand",
"jest:shapshot": "jest --updateSnapshot"
"unit:debug": "jest --runInBand test",
"jest:shapshot": "jest --updateSnapshot test"
},
"dependencies": {
"@cubejs-backend/server-core": "^0.25.14",
Expand Down Expand Up @@ -86,7 +87,7 @@
"^.+\\.js$": "ts-jest"
},
"testMatch": [
"<rootDir>/tests/*.(test|spec).(ts|js)"
"<rootDir>/test/*.(test|spec).(ts|js)"
]
},
"oclif": {
Expand Down
File renamed without changes.
20 changes: 4 additions & 16 deletions packages/cubejs-server/tsconfig.json
@@ -1,23 +1,11 @@
{
"extends": "../../tsconfig.base.json",
"include": ["src"],
"compilerOptions": {
"outDir": "dist",
"rootDir": "src",
"baseUrl": ".",
"allowJs": true,
"resolveJsonModule": true,
"outDir": "./dist", /* Redirect output structure to the directory. */
"strict": true, /* Enable all strict type-checking options. */
"noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
"strictNullChecks": true, /* Enable strict null checks. */
"strictFunctionTypes": true, /* Enable strict checking of function types. */
"strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
"strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
"noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
"alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
"allowSyntheticDefaultImports": true,
"skipLibCheck": true, /* Skip type checking of declaration files. */
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
},
"include": [
"src"
]
}

0 comments on commit 224914e

Please sign in to comment.