Skip to content

Commit 78145c3

Browse files
ovrvasilev-alex
authored andcommitted
misc: Use TS shared for whole monorepo (#1745)
* misc: Use TS shared for whole monorepo * misc: Use shared TS for compiling on CI
1 parent 325bf75 commit 78145c3

File tree

24 files changed

+610
-572
lines changed

24 files changed

+610
-572
lines changed

.github/actions/init-ci/action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ runs:
2727
- name: Lerna bootstrap
2828
run: yarn lerna bootstrap --ignore @cubejs-backend/jdbc-driver
2929
- name: Lerna tsc
30-
run: yarn lerna run --concurrency 1 tsc
30+
run: yarn tsc

.github/workflows/push.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
- name: Lerna bootstrap
7272
run: yarn lerna bootstrap
7373
- name: Lerna tsc
74-
run: yarn lerna run --concurrency 1 tsc
74+
run: yarn tsc
7575
- name: Lerna test
7676
run: yarn lerna run --concurrency 1 unit
7777

@@ -210,7 +210,7 @@ jobs:
210210
- name: Lerna bootstrap
211211
run: yarn lerna bootstrap
212212
- name: Lerna tsc
213-
run: yarn lerna run --concurrency 1 tsc
213+
run: yarn tsc
214214
- name: Run Redis Integration
215215
timeout-minutes: 10
216216
run: |
@@ -309,7 +309,7 @@ jobs:
309309
- name: Lerna bootstrap
310310
run: yarn lerna bootstrap
311311
- name: Lerna tsc
312-
run: yarn lerna run --concurrency 1 tsc
312+
run: yarn tsc
313313
- name: Run MySQL Integration with 5.6
314314
timeout-minutes: 10
315315
run: |
@@ -397,7 +397,7 @@ jobs:
397397
- name: Lerna bootstrap
398398
run: yarn lerna bootstrap
399399
- name: Lerna tsc
400-
run: yarn lerna run --concurrency 1 tsc
400+
run: yarn tsc
401401
- name: Run PrestoDB Integration with Postgres 12.4
402402
timeout-minutes: 15
403403
run: |

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ yarn-error.log
1212
.rpt2_cache/
1313
**/.nyc_output
1414
**/coverage
15-
lerna-debug.log
15+
lerna-debug.log
16+
tsconfig.tsbuildinfo

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
"watch-local": "CUBEJS_API_URL=http://localhost:6020/cubejs-api/v1 rollup -c -w",
1010
"lint": "lerna run lint",
1111
"lint:fix": "lerna run lint:fix",
12-
"tsc": "lerna run tsc",
13-
"tsc:watch": "lerna run watch"
12+
"tsc": "tsc --build",
13+
"tsc:watch": "tsc --build --watch",
14+
"clean": "rimraf packages/*/{tsconfig.tsbuildinfo,lib,dist}"
1415
},
1516
"author": "Cube Dev, Inc.",
1617
"dependencies": {
@@ -55,8 +56,9 @@
5556
"is-ci": "^2.0.0",
5657
"lerna": "^3.13.1",
5758
"prettier": "^2.0.5",
59+
"rimraf": "^3.0.2",
5860
"rollup": "^2.25.0",
59-
"typescript": "~4.1.2"
61+
"typescript": "^4.1.3"
6062
},
6163
"repository": {
6264
"type": "git",
Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
11
{
22
"extends": "../../tsconfig.base.json",
3+
"include": [
4+
"src",
5+
"test"
6+
],
37
"compilerOptions": {
4-
"outDir": "./dist", /* Redirect output structure to the directory. */
5-
"strict": true, /* Enable all strict type-checking options. */
8+
"outDir": "dist",
9+
"rootDir": ".",
10+
"baseUrl": ".",
611
"allowJs": true,
7-
"noImplicitAny": false, /* Raise error on expressions and declarations with an implied 'any' type. */
8-
"strictNullChecks": true, /* Enable strict null checks. */
9-
"strictFunctionTypes": true, /* Enable strict checking of function types. */
10-
"strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
11-
"strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
12-
"noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
13-
"alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
14-
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
15-
"allowSyntheticDefaultImports": true,
16-
"skipLibCheck": true, /* Skip type checking of declaration files. */
17-
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
18-
}
12+
"noImplicitAny": false,
13+
},
1914
}
Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,12 @@
11
{
2+
"extends": "../../tsconfig.base.json",
3+
"include": [
4+
"src",
5+
"test"
6+
],
27
"compilerOptions": {
3-
"lib": ["es2017"],
4-
"target": "es2017", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */
5-
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
6-
"declaration": true,
7-
"declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
8-
"sourceMap": true, /* Generates corresponding '.map' file. */
9-
"outDir": "./dist", /* Redirect output structure to the directory. */
10-
"strict": true, /* Enable all strict type-checking options. */
11-
"noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
12-
"strictNullChecks": true, /* Enable strict null checks. */
13-
"strictFunctionTypes": true, /* Enable strict checking of function types. */
14-
"strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
15-
"strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
16-
"noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
17-
"alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
18-
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
19-
"allowSyntheticDefaultImports": true,
20-
"skipLibCheck": true, /* Skip type checking of declaration files. */
21-
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
8+
"outDir": "dist",
9+
"rootDir": ".",
10+
"baseUrl": ".",
2211
}
2312
}

packages/cubejs-cli/tsconfig.json

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
11
{
22
"extends": "../../tsconfig.base.json",
3+
"include": [
4+
"src",
5+
"test"
6+
],
37
"compilerOptions": {
4-
"outDir": "./dist", /* Redirect output structure to the directory. */
5-
"strict": true, /* Enable all strict type-checking options. */
8+
"outDir": "dist",
9+
"rootDir": ".",
10+
"baseUrl": ".",
611
"allowJs": true,
712
"checkJs": true,
8-
"declaration": false,
9-
"declarationMap": false,
10-
"noImplicitAny": false, /* Raise error on expressions and declarations with an implied 'any' type. */
11-
"strictNullChecks": true, /* Enable strict null checks. */
12-
"strictFunctionTypes": true, /* Enable strict checking of function types. */
13-
"strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
14-
"strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
15-
"noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
16-
"alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
17-
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
18-
"allowSyntheticDefaultImports": true,
19-
"skipLibCheck": true, /* Skip type checking of declaration files. */
20-
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
13+
"noImplicitAny": false,
14+
"strictNullChecks": true,
15+
"strictFunctionTypes": true,
16+
"strictBindCallApply": true,
17+
"strictPropertyInitialization": true,
2118
}
2219
}
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
declare module '@cubejs-backend/schema-compiler/adapter/BaseQuery' {
2-
abstract class BaseQuery {
3-
protected readonly timezone: string;
4-
5-
public escapeColumnName(identifier: string): string;
6-
}
2+
declare var BaseQuery: any;
73

84
export default BaseQuery;
95
}

packages/cubejs-druid-driver/src/DruidClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export type DruidClientConfiguration = DruidClientBaseConfiguration & {
1111
};
1212

1313
export class DruidClient {
14-
constructor(
14+
public constructor(
1515
protected readonly config: DruidClientConfiguration,
1616
) {
1717
}

packages/cubejs-druid-driver/src/DruidDriver.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ export class DruidDriver extends BaseDriver {
1111

1212
protected readonly client: DruidClient;
1313

14-
static dialectClass() {
14+
public static dialectClass() {
1515
return DruidQuery;
1616
}
1717

18-
constructor(config?: DruidDriverConfiguration) {
18+
public constructor(config?: DruidDriverConfiguration) {
1919
super();
2020

2121
let url = config?.url || process.env.CUBEJS_DB_URL;
Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
11
{
22
"extends": "../../tsconfig.base.json",
3+
"include": [
4+
"src",
5+
"test"
6+
],
7+
"files": ["custom.d.ts"],
38
"compilerOptions": {
4-
"outDir": "./dist", /* Redirect output structure to the directory. */
5-
"strict": true, /* Enable all strict type-checking options. */
6-
"noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
7-
"strictNullChecks": true, /* Enable strict null checks. */
8-
"strictFunctionTypes": true, /* Enable strict checking of function types. */
9-
"strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
10-
"strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
11-
"noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
12-
"alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
13-
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
14-
"allowSyntheticDefaultImports": true,
15-
"skipLibCheck": true, /* Skip type checking of declaration files. */
16-
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
9+
"outDir": "dist",
10+
"rootDir": ".",
11+
"baseUrl": ".",
1712
}
1813
}
Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,18 @@
11
{
22
"extends": "../../tsconfig.base.json",
3-
"compilerOptions": {
4-
"allowJs": true,
5-
"checkJs": false,
6-
"outDir": "./dist", /* Redirect output structure to the directory. */
7-
"strict": true, /* Enable all strict type-checking options. */
8-
"noImplicitAny": false, /* Raise error on expressions and declarations with an implied 'any' type. */
9-
"strictNullChecks": false, /* Enable strict null checks. */
10-
"strictFunctionTypes": false, /* Enable strict checking of function types. */
11-
"strictBindCallApply": false, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
12-
"strictPropertyInitialization": false, /* Enable strict checking of property initialization in classes. */
13-
"noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
14-
"alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
15-
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
16-
"allowSyntheticDefaultImports": true,
17-
"skipLibCheck": true, /* Skip type checking of declaration files. */
18-
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
19-
},
203
"include": [
214
"src",
225
"test"
23-
]
6+
],
7+
"compilerOptions": {
8+
"outDir": "dist",
9+
"rootDir": ".",
10+
"baseUrl": ".",
11+
"allowJs": true,
12+
"noImplicitAny": false,
13+
"strictNullChecks": false,
14+
"strictFunctionTypes": false,
15+
"strictBindCallApply": false,
16+
"strictPropertyInitialization": false,
17+
},
2418
}
Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,18 @@
11
{
22
"extends": "../../tsconfig.base.json",
3-
"compilerOptions": {
4-
"allowJs": true,
5-
"checkJs": false,
6-
"outDir": "./dist", /* Redirect output structure to the directory. */
7-
"strict": true, /* Enable all strict type-checking options. */
8-
"noImplicitAny": false, /* Raise error on expressions and declarations with an implied 'any' type. */
9-
"strictNullChecks": false, /* Enable strict null checks. */
10-
"strictFunctionTypes": false, /* Enable strict checking of function types. */
11-
"strictBindCallApply": false, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
12-
"strictPropertyInitialization": false, /* Enable strict checking of property initialization in classes. */
13-
"noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
14-
"alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
15-
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
16-
"allowSyntheticDefaultImports": true,
17-
"skipLibCheck": true, /* Skip type checking of declaration files. */
18-
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
19-
},
203
"include": [
214
"src",
225
"test"
23-
]
6+
],
7+
"compilerOptions": {
8+
"outDir": "dist",
9+
"rootDir": ".",
10+
"baseUrl": ".",
11+
"allowJs": true,
12+
"noImplicitAny": false,
13+
"strictNullChecks": false,
14+
"strictFunctionTypes": false,
15+
"strictBindCallApply": false,
16+
"strictPropertyInitialization": false,
17+
},
2418
}

packages/cubejs-server/package.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@
1313
"node": ">=8.11.1"
1414
},
1515
"main": "index.js",
16-
"typings": "dist/index.d.ts",
16+
"typings": "dist/src/index.d.ts",
1717
"files": [
1818
"dist",
1919
"bin",
20+
"index.js",
2021
"/oclif.manifest.json"
2122
],
2223
"bin": {
@@ -31,11 +32,11 @@
3132
"tsc": "tsc",
3233
"watch": "tsc -w",
3334
"test": "npm run unit",
34-
"lint": "linter src/* tests/ --ext .ts,.js",
35-
"lint:fix": "linter --fix src/* tests/ --ext .ts,js",
35+
"lint": "linter src/* test/ --ext .ts,.js",
36+
"lint:fix": "linter --fix src/* test/ --ext .ts,js",
3637
"unit": "jest",
37-
"unit:debug": "jest --runInBand",
38-
"jest:shapshot": "jest --updateSnapshot"
38+
"unit:debug": "jest --runInBand test",
39+
"jest:shapshot": "jest --updateSnapshot test"
3940
},
4041
"dependencies": {
4142
"@cubejs-backend/server-core": "^0.25.14",
@@ -86,7 +87,7 @@
8687
"^.+\\.js$": "ts-jest"
8788
},
8889
"testMatch": [
89-
"<rootDir>/tests/*.(test|spec).(ts|js)"
90+
"<rootDir>/test/*.(test|spec).(ts|js)"
9091
]
9192
},
9293
"oclif": {

packages/cubejs-server/tsconfig.json

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,11 @@
11
{
22
"extends": "../../tsconfig.base.json",
3+
"include": ["src"],
34
"compilerOptions": {
5+
"outDir": "dist",
6+
"rootDir": "src",
7+
"baseUrl": ".",
48
"allowJs": true,
59
"resolveJsonModule": true,
6-
"outDir": "./dist", /* Redirect output structure to the directory. */
7-
"strict": true, /* Enable all strict type-checking options. */
8-
"noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
9-
"strictNullChecks": true, /* Enable strict null checks. */
10-
"strictFunctionTypes": true, /* Enable strict checking of function types. */
11-
"strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
12-
"strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
13-
"noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
14-
"alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
15-
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
16-
"allowSyntheticDefaultImports": true,
17-
"skipLibCheck": true, /* Skip type checking of declaration files. */
18-
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
1910
},
20-
"include": [
21-
"src"
22-
]
2311
}

0 commit comments

Comments
 (0)