diff --git a/.gitignore b/.gitignore index c196ca37ed..953bac6ed3 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,12 @@ dist/ doc/ test-npm-packages-app/ .vscode/ +tsconfig-esm.json +tsconfig-cjs.json .DS_Store .nyc_output/ - credentials.js +*.d.ts +*.js +*.js.map +tsconfig-build.tsbuildinfo diff --git a/.mocharc.json b/.mocharc.json new file mode 100644 index 0000000000..3e3e61dfd5 --- /dev/null +++ b/.mocharc.json @@ -0,0 +1,5 @@ +{ + "diff": true, + "spec": ["./test/**/*.js", "./@here/*/test/**/*.js"], + "exclude": ["./@here/harp-mapview/test/resources/testWorker.js"] +} diff --git a/@here/harp-atlas-tools/tsconfig.json b/@here/harp-atlas-tools/tsconfig.json index f2c95df18e..9a5c2e5d51 100644 --- a/@here/harp-atlas-tools/tsconfig.json +++ b/@here/harp-atlas-tools/tsconfig.json @@ -1,18 +1,11 @@ { + "extends": "../../tsconfig-common.json", "compilerOptions": { - "target": "es2017", - "module": "commonjs", - "rootDir": "src", - "outDir": "lib", - "sourceMap": true, - "declaration": true, - "strictNullChecks": true, - "noImplicitAny": true, - "noImplicitReturns": true, - "noImplicitThis": true, - "noUnusedLocals": false, - "downlevelIteration": true + "rootDir": ".", + "noEmit": true }, - "exclude": ["node_modules"], - "include": ["src/*.ts"] + "include": [ + "lib/**/*.ts", + "index.ts" + ] } diff --git a/@here/harp-datasource-protocol/test/tsconfig-build.json b/@here/harp-datasource-protocol/test/tsconfig-build.json new file mode 100644 index 0000000000..95222289ae --- /dev/null +++ b/@here/harp-datasource-protocol/test/tsconfig-build.json @@ -0,0 +1,12 @@ +{ + "extends": "../../../tsconfig.settings.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "." + }, + "references": [ + { "path": "../tsconfig-build.json" }, + { "path": "../../harp-geoutils/tsconfig-build.json" }, + { "path": "../../harp-utils/tsconfig-build.json" } + ] +} diff --git a/@here/harp-datasource-protocol/tsconfig-build.json b/@here/harp-datasource-protocol/tsconfig-build.json new file mode 100644 index 0000000000..009550a887 --- /dev/null +++ b/@here/harp-datasource-protocol/tsconfig-build.json @@ -0,0 +1,12 @@ +{ + "extends": "../../tsconfig.settings.json", + "compilerOptions": { + "outDir": ".", + "rootDir": "." + }, + "references": [ + { "path": "../harp-geoutils/tsconfig-build.json" }, + { "path": "../harp-utils/tsconfig-build.json" } + ], + "exclude": ["test/**/*.ts"] +} diff --git a/@here/harp-datasource-protocol/tsconfig.json b/@here/harp-datasource-protocol/tsconfig.json index acc0124c45..61db05db95 100644 --- a/@here/harp-datasource-protocol/tsconfig.json +++ b/@here/harp-datasource-protocol/tsconfig.json @@ -1,14 +1,25 @@ { + "extends": "../../tsconfig-common.json", "compilerOptions": { - "target": "es2017", - "module": "commonjs", - "sourceMap": true, - "declaration": true, - "strictNullChecks": true, - "noImplicitAny": true, - "noImplicitReturns": true, - "noImplicitThis": true, - "noUnusedLocals": false, - "downlevelIteration": true - } + "rootDir": ".", + "noEmit": true + }, + "include": [ + "lib/**/*.ts", + "index.ts" + ], + "references": [ + { + "path": "../harp-geometry" + }, + { + "path": "../harp-geoutils" + }, + { + "path": "../harp-utils" + } + ], + "exclude": [ + "test/**/*.ts" + ] } diff --git a/@here/harp-debug-datasource/tsconfig-build.json b/@here/harp-debug-datasource/tsconfig-build.json new file mode 100644 index 0000000000..3c14e2a404 --- /dev/null +++ b/@here/harp-debug-datasource/tsconfig-build.json @@ -0,0 +1,13 @@ +{ + "extends": "../../tsconfig.settings.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "." + }, + "references": [ + { "path": "../harp-lrucache/tsconfig-build.json" }, + { "path": "../harp-geoutils/tsconfig-build.json" }, + { "path": "../harp-mapview/tsconfig-build.json" } + ], + "exclude": ["test/**/*.ts"] +} diff --git a/@here/harp-debug-datasource/tsconfig.json b/@here/harp-debug-datasource/tsconfig.json index acc0124c45..8192c0c3f7 100644 --- a/@here/harp-debug-datasource/tsconfig.json +++ b/@here/harp-debug-datasource/tsconfig.json @@ -1,14 +1,28 @@ { + "extends": "../../tsconfig-common.json", "compilerOptions": { - "target": "es2017", - "module": "commonjs", - "sourceMap": true, - "declaration": true, - "strictNullChecks": true, - "noImplicitAny": true, - "noImplicitReturns": true, - "noImplicitThis": true, - "noUnusedLocals": false, - "downlevelIteration": true - } + "rootDir": ".", + "noEmit": true + }, + "include": [ + "lib/**/*.ts", + "index.ts" + ], + "references": [ + { + "path": "../harp-geoutils" + }, + { + "path": "../harp-lrucache" + }, + { + "path": "../harp-mapview" + }, + { + "path": "../harp-text-canvas" + } + ], + "exclude": [ + "test/**/*.ts" + ] } diff --git a/@here/harp-examples/package.json b/@here/harp-examples/package.json index 3596402a28..2c266509bd 100644 --- a/@here/harp-examples/package.json +++ b/@here/harp-examples/package.json @@ -52,10 +52,11 @@ "highlight.js": "^9.15.8", "html-webpack-plugin": "^3.2.0", "ncp": "^2.0.0", + "source-map-loader": "^0.2.4", "stats.js": "^0.17.0", "style-loader": "^1.0.0", "three": "^0.110.0", - "ts-loader": "^6.0.3", + "ts-loader": "^6.2.1", "typescript": "^3.7.2", "webpack": "^4.34.0", "webpack-cli": "^3.3.4", diff --git a/@here/harp-examples/tsconfig-build.json b/@here/harp-examples/tsconfig-build.json new file mode 100644 index 0000000000..5e8c2aa44e --- /dev/null +++ b/@here/harp-examples/tsconfig-build.json @@ -0,0 +1,31 @@ +{ + "extends": "../../tsconfig.settings.json", + "compilerOptions": { + "rootDir": ".", + "outDir": ".", + "resolveJsonModule": true + }, + "references": [ + { "path": "../harp-datasource-protocol/tsconfig-build.json" }, + { "path": "../harp-debug-datasource/tsconfig-build.json" }, + { "path": "../harp-features-datasource/tsconfig-build.json" }, + { "path": "../harp-geojson-datasource/tsconfig-build.json" }, + { "path": "../harp-geoutils/tsconfig-build.json" }, + { "path": "../harp-map-controls/tsconfig-build.json" }, + { "path": "../harp-mapview/tsconfig-build.json" }, + { "path": "../harp-omv-datasource/tsconfig-build.json" }, + { "path": "../harp-text-canvas/tsconfig-build.json" }, + { "path": "../harp-utils/tsconfig-build.json" }, + { "path": "../harp-webtile-datasource/tsconfig-build.json" } + ], + "include": [ + "./*.ts", + "./src/*.ts", + "./lib/*.ts", + "./resources/*.ts", + "./decoder/*.ts", + "./src/*.tsx", + "./resources/**/*.json" + ], + "exclude": ["test/**/*.ts", "dist/**/*.ts"] +} diff --git a/@here/harp-examples/tsconfig-custom.json b/@here/harp-examples/tsconfig-custom.json new file mode 100644 index 0000000000..a49693161f --- /dev/null +++ b/@here/harp-examples/tsconfig-custom.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "resolveJsonModule": true + }, + "include": [ + "./*.ts", + "./src/*.ts", + "./lib/*.ts", + "./resources/*.ts", + "./decoder/*.ts", + "./src/*.tsx", + "./resources/**/*.json" + ], + "exclude": ["test/**/*.ts", "dist/**/*.ts"] +} diff --git a/@here/harp-examples/tsconfig.json b/@here/harp-examples/tsconfig.json index 0d0f34e63e..9a5c2e5d51 100644 --- a/@here/harp-examples/tsconfig.json +++ b/@here/harp-examples/tsconfig.json @@ -1,18 +1,11 @@ { + "extends": "../../tsconfig-common.json", "compilerOptions": { - "target": "es2017", - "module": "commonjs", - "sourceMap": true, - "declaration": false, - "strictNullChecks": true, - "noImplicitAny": true, - "noImplicitReturns": true, - "noImplicitThis": true, - "noUnusedLocals": false, - "resolveJsonModule": true, - "downlevelIteration": true, - "jsx": "react", - "skipLibCheck": true, - "baseUrl": "../../" - } + "rootDir": ".", + "noEmit": true + }, + "include": [ + "lib/**/*.ts", + "index.ts" + ] } diff --git a/@here/harp-examples/webpack-build.config.js b/@here/harp-examples/webpack-build.config.js new file mode 100644 index 0000000000..3c4899e892 --- /dev/null +++ b/@here/harp-examples/webpack-build.config.js @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2017-2018 HERE Europe B.V. + * Licensed under Apache 2.0, see full license in LICENSE + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * This basically downgrades original webpack.config.js to compile + * only JS created by `tsc -b .` (in current folder). + * + * This is much faster in bigger build process as Typescript runs only once. + * + * Usage: + + * - Development + + * tsc --build tsconfig-build.json --watch --verbose --listEmittedFiles + * webpack-dev-server --config webpack-build.config.js + * + * - CI + * tsc --build tsconfig-build.json + * webpack --config webpack-build.config.js + */ +const configs = require('./webpack.config'); + +module.exports = configs.map(config => { + config.resolve.extensions = [".webpack.js", ".web.js", ".js"] + config.module.rules = config.module.rules.filter(rule => rule.loader !== "ts-loader") + config.module.rules.push({ + rules: [ + { + test: /\.js$/, + use: ["source-map-loader"], + enforce: "pre" + } + ] + }) + for(const entry in config.entries) { + config.entries[entry] = config.entries[entry].replace(/.ts$/, ".js"); + } + return config; +}) + +throw new Foo(); diff --git a/@here/harp-examples/webpack.config.js b/@here/harp-examples/webpack.config.js index 43af74a2b8..55678c4486 100644 --- a/@here/harp-examples/webpack.config.js +++ b/@here/harp-examples/webpack.config.js @@ -40,10 +40,7 @@ const commonConfig = { } ], resolve: { - extensions: [".webpack.js", ".web.ts", ".ts", ".tsx", ".web.js", ".js"], - alias: { - "react-native": "react-native-web" - } + extensions: [".webpack.js", ".web.ts", ".ts", ".tsx", ".web.js", ".js"] }, module: { rules: [ @@ -52,13 +49,9 @@ const commonConfig = { loader: "ts-loader", exclude: /node_modules/, options: { - configFile: path.join(process.cwd(), "tsconfig.json"), + configFile: path.join(__dirname, "tsconfig-build.json"), onlyCompileBundledFiles: true, - transpileOnly: prepareOnly, - compilerOptions: { - sourceMap: !prepareOnly, - declaration: false - } + projectReferences: true } } ] @@ -84,12 +77,13 @@ const commonConfig = { const decoderConfig = merge(commonConfig, { target: "webworker", entry: { - decoder: "./decoder/decoder.ts" + decoder: "./decoder/decoder" } }); const webpackEntries = glob .sync(path.join(__dirname, "./src/*.{ts,tsx}")) + .filter(name => !name.includes(".d.ts")) .reduce((result, entry) => { const name = path.basename(entry).replace(/.tsx?$/, ""); if (name.startsWith("common")) { diff --git a/@here/harp-features-datasource/tsconfig-build.json b/@here/harp-features-datasource/tsconfig-build.json new file mode 100644 index 0000000000..0a25d6f285 --- /dev/null +++ b/@here/harp-features-datasource/tsconfig-build.json @@ -0,0 +1,14 @@ +{ + "extends": "../../tsconfig.settings.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "." + }, + "references": [ + { "path": "../harp-datasource-protocol/tsconfig-build.json" }, + { "path": "../harp-geojson-datasource/tsconfig-build.json" }, + { "path": "../harp-mapview/tsconfig-build.json" }, + { "path": "../harp-omv-datasource/tsconfig-build.json" } + ], + "exclude": ["test/**/*.ts"] +} diff --git a/@here/harp-features-datasource/tsconfig.json b/@here/harp-features-datasource/tsconfig.json index acc0124c45..c0f65b9f23 100644 --- a/@here/harp-features-datasource/tsconfig.json +++ b/@here/harp-features-datasource/tsconfig.json @@ -1,14 +1,28 @@ { + "extends": "../../tsconfig-common.json", "compilerOptions": { - "target": "es2017", - "module": "commonjs", - "sourceMap": true, - "declaration": true, - "strictNullChecks": true, - "noImplicitAny": true, - "noImplicitReturns": true, - "noImplicitThis": true, - "noUnusedLocals": false, - "downlevelIteration": true - } + "rootDir": ".", + "noEmit": true + }, + "include": [ + "lib/**/*.ts", + "index.ts" + ], + "references": [ + { + "path": "../harp-datasource-protocol" + }, + { + "path": "../harp-geojson-datasource" + }, + { + "path": "../harp-mapview" + }, + { + "path": "../harp-omv-datasource" + }, + { + "path": "../harp-utils" + } + ] } diff --git a/@here/harp-fetch/test/tsconfig-build.json b/@here/harp-fetch/test/tsconfig-build.json new file mode 100644 index 0000000000..88e7c082d7 --- /dev/null +++ b/@here/harp-fetch/test/tsconfig-build.json @@ -0,0 +1,8 @@ +{ + "extends": "../../../tsconfig.settings.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "." + }, + "references": [{ "path": "../tsconfig-build.json" }] +} diff --git a/@here/harp-fetch/tsconfig-build.json b/@here/harp-fetch/tsconfig-build.json new file mode 100644 index 0000000000..f7f16c27c8 --- /dev/null +++ b/@here/harp-fetch/tsconfig-build.json @@ -0,0 +1,8 @@ +{ + "extends": "../../tsconfig.settings.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "." + }, + "exclude": ["test/**/*.ts"] +} diff --git a/@here/harp-fetch/tsconfig.json b/@here/harp-fetch/tsconfig.json index acc0124c45..7bf13c86d7 100644 --- a/@here/harp-fetch/tsconfig.json +++ b/@here/harp-fetch/tsconfig.json @@ -1,14 +1,14 @@ { + "extends": "../../tsconfig-common.json", "compilerOptions": { - "target": "es2017", - "module": "commonjs", - "sourceMap": true, - "declaration": true, - "strictNullChecks": true, - "noImplicitAny": true, - "noImplicitReturns": true, - "noImplicitThis": true, - "noUnusedLocals": false, - "downlevelIteration": true - } + "rootDir": ".", + "noEmit": true + }, + "include": [ + "lib/**/*.ts", + "index.ts" + ], + "exclude": [ + "test/**/*.ts" + ] } diff --git a/@here/harp-geojson-datasource/test/tsconfig-build.json b/@here/harp-geojson-datasource/test/tsconfig-build.json new file mode 100644 index 0000000000..d7fd18ef77 --- /dev/null +++ b/@here/harp-geojson-datasource/test/tsconfig-build.json @@ -0,0 +1,16 @@ +{ + "extends": "../../../tsconfig.settings.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "." + }, + "references": [ + { "path": "../../harp-datasource-protocol/tsconfig-build.json" }, + { "path": "../../harp-geoutils/tsconfig-build.json" }, + { "path": "../../harp-mapview/tsconfig-build.json" }, + { "path": "../../harp-mapview/tsconfig-build.json" }, + { "path": "../../harp-mapview-decoder/tsconfig-build.json" }, + { "path": "../../harp-test-utils/tsconfig-build.json" }, + { "path": "../tsconfig-build.json" } + ] +} diff --git a/@here/harp-geojson-datasource/tsconfig-build.json b/@here/harp-geojson-datasource/tsconfig-build.json new file mode 100644 index 0000000000..b71fd5448f --- /dev/null +++ b/@here/harp-geojson-datasource/tsconfig-build.json @@ -0,0 +1,18 @@ +{ + "extends": "../../tsconfig.settings.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "." + }, + "references": [ + { "path": "../harp-datasource-protocol/tsconfig-build.json" }, + { "path": "../harp-fetch/tsconfig-build.json" }, + { "path": "../harp-geoutils/tsconfig-build.json" }, + { "path": "../harp-lines/tsconfig-build.json" }, + { "path": "../harp-mapview/tsconfig-build.json" }, + { "path": "../harp-mapview-decoder/tsconfig-build.json" }, + { "path": "../harp-transfer-manager/tsconfig-build.json" }, + { "path": "../harp-utils/tsconfig-build.json" } + ], + "exclude": ["test/**/*.ts"] +} diff --git a/@here/harp-geojson-datasource/tsconfig.json b/@here/harp-geojson-datasource/tsconfig.json index acc0124c45..f06c722d9b 100644 --- a/@here/harp-geojson-datasource/tsconfig.json +++ b/@here/harp-geojson-datasource/tsconfig.json @@ -1,14 +1,46 @@ { + "extends": "../../tsconfig-common.json", "compilerOptions": { - "target": "es2017", - "module": "commonjs", - "sourceMap": true, - "declaration": true, - "strictNullChecks": true, - "noImplicitAny": true, - "noImplicitReturns": true, - "noImplicitThis": true, - "noUnusedLocals": false, - "downlevelIteration": true - } + "rootDir": ".", + "noEmit": true + }, + "include": [ + "lib/**/*.ts", + "index.ts" + ], + "references": [ + { + "path": "../harp-datasource-protocol" + }, + { + "path": "../harp-fetch" + }, + { + "path": "../harp-geometry" + }, + { + "path": "../harp-geoutils" + }, + { + "path": "../harp-lines" + }, + { + "path": "../harp-mapview" + }, + { + "path": "../harp-mapview-decoder" + }, + { + "path": "../harp-text-canvas" + }, + { + "path": "../harp-transfer-manager" + }, + { + "path": "../harp-utils" + } + ], + "exclude": [ + "test/**/*.ts" + ] } diff --git a/@here/harp-geometry/test/tsconfig-build.json b/@here/harp-geometry/test/tsconfig-build.json new file mode 100644 index 0000000000..88e7c082d7 --- /dev/null +++ b/@here/harp-geometry/test/tsconfig-build.json @@ -0,0 +1,8 @@ +{ + "extends": "../../../tsconfig.settings.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "." + }, + "references": [{ "path": "../tsconfig-build.json" }] +} diff --git a/@here/harp-geometry/tsconfig-build.json b/@here/harp-geometry/tsconfig-build.json new file mode 100644 index 0000000000..71a229f1f6 --- /dev/null +++ b/@here/harp-geometry/tsconfig-build.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.settings.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "." + }, + "references": [{ "path": "../harp-geoutils/tsconfig-build.json" }], + "exclude": ["test/**/*.ts"] +} diff --git a/@here/harp-geometry/tsconfig.json b/@here/harp-geometry/tsconfig.json index acc0124c45..5d5646e966 100644 --- a/@here/harp-geometry/tsconfig.json +++ b/@here/harp-geometry/tsconfig.json @@ -1,14 +1,19 @@ { + "extends": "../../tsconfig-common.json", "compilerOptions": { - "target": "es2017", - "module": "commonjs", - "sourceMap": true, - "declaration": true, - "strictNullChecks": true, - "noImplicitAny": true, - "noImplicitReturns": true, - "noImplicitThis": true, - "noUnusedLocals": false, - "downlevelIteration": true - } + "rootDir": ".", + "noEmit": true + }, + "include": [ + "lib/**/*.ts", + "index.ts" + ], + "references": [ + { + "path": "../harp-geoutils" + } + ], + "exclude": [ + "test/**/*.ts" + ] } diff --git a/@here/harp-geoutils/package.json b/@here/harp-geoutils/package.json index 20c79640b3..23e855e322 100644 --- a/@here/harp-geoutils/package.json +++ b/@here/harp-geoutils/package.json @@ -2,10 +2,14 @@ "name": "@here/harp-geoutils", "version": "0.11.0", "description": "Utility classes for working with geospatial data", - "main": "index.js", - "typings": "index", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "exports": { + ".": "dist/esm/index.js" + }, + "typings": "dist/esm/index", "scripts": { - "build": "tsc", + "build": "tsc -b tsconfig-cjs.json && tsc -b tsconfig-esm.json", "test": "cross-env mocha --require source-map-support/register $EXTRA_MOCHA_ARGS ./test/*.js", "prepare": "cross-env tsc --sourceMap false $EXTRA_TSC_ARGS" }, diff --git a/@here/harp-geoutils/test/tsconfig-build.json b/@here/harp-geoutils/test/tsconfig-build.json new file mode 100644 index 0000000000..88e7c082d7 --- /dev/null +++ b/@here/harp-geoutils/test/tsconfig-build.json @@ -0,0 +1,8 @@ +{ + "extends": "../../../tsconfig.settings.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "." + }, + "references": [{ "path": "../tsconfig-build.json" }] +} diff --git a/@here/harp-geoutils/tsconfig-build.json b/@here/harp-geoutils/tsconfig-build.json new file mode 100644 index 0000000000..97091e8bb4 --- /dev/null +++ b/@here/harp-geoutils/tsconfig-build.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.settings.json", + "compilerOptions": { + "outDir": ".", + "rootDir": ".", + "noEmit": true + }, + "include": ["lib/**/*.ts", "index.ts"] +} diff --git a/@here/harp-geoutils/tsconfig-cjs.json b/@here/harp-geoutils/tsconfig-cjs.json new file mode 100644 index 0000000000..4cc9cd76a4 --- /dev/null +++ b/@here/harp-geoutils/tsconfig-cjs.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./dist/cjs", + "target": "esnext", + "module": "commonjs", + "sourceMap": false, + "rootDir": ".", + "noEmit": false + } +} diff --git a/@here/harp-geoutils/tsconfig-custom.json b/@here/harp-geoutils/tsconfig-custom.json new file mode 100644 index 0000000000..cad0317574 --- /dev/null +++ b/@here/harp-geoutils/tsconfig-custom.json @@ -0,0 +1,3 @@ +{ + "include": ["lib/**/*.ts", "index.ts"] +} diff --git a/@here/harp-geoutils/tsconfig-esm.json b/@here/harp-geoutils/tsconfig-esm.json new file mode 100644 index 0000000000..5d022a056b --- /dev/null +++ b/@here/harp-geoutils/tsconfig-esm.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./dist/esm", + "target": "esnext", + "module": "esnext", + "rootDir": ".", + "noEmit": false, + "sourceMap": false + } +} diff --git a/@here/harp-geoutils/tsconfig-umd.json b/@here/harp-geoutils/tsconfig-umd.json new file mode 100644 index 0000000000..6a06ae8f84 --- /dev/null +++ b/@here/harp-geoutils/tsconfig-umd.json @@ -0,0 +1,12 @@ +{ + "extends": "./tsconfig-build.json", + "compilerOptions": { + "outDir": "./dist", + "outFile": "./dist/harp-geoutils.js", + "target": "esnext", + "module": "amd", + "rootDir": ".", + "noEmit": false, + "declaration": true + } +} diff --git a/@here/harp-geoutils/tsconfig.json b/@here/harp-geoutils/tsconfig.json index acc0124c45..7bf13c86d7 100644 --- a/@here/harp-geoutils/tsconfig.json +++ b/@here/harp-geoutils/tsconfig.json @@ -1,14 +1,14 @@ { + "extends": "../../tsconfig-common.json", "compilerOptions": { - "target": "es2017", - "module": "commonjs", - "sourceMap": true, - "declaration": true, - "strictNullChecks": true, - "noImplicitAny": true, - "noImplicitReturns": true, - "noImplicitThis": true, - "noUnusedLocals": false, - "downlevelIteration": true - } + "rootDir": ".", + "noEmit": true + }, + "include": [ + "lib/**/*.ts", + "index.ts" + ], + "exclude": [ + "test/**/*.ts" + ] } diff --git a/@here/harp-lines/test/tsconfig-build.json b/@here/harp-lines/test/tsconfig-build.json new file mode 100644 index 0000000000..88e7c082d7 --- /dev/null +++ b/@here/harp-lines/test/tsconfig-build.json @@ -0,0 +1,8 @@ +{ + "extends": "../../../tsconfig.settings.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "." + }, + "references": [{ "path": "../tsconfig-build.json" }] +} diff --git a/@here/harp-lines/tsconfig-build.json b/@here/harp-lines/tsconfig-build.json new file mode 100644 index 0000000000..d46906ed52 --- /dev/null +++ b/@here/harp-lines/tsconfig-build.json @@ -0,0 +1,12 @@ +{ + "extends": "../../tsconfig.settings.json", + "compilerOptions": { + "outDir": ".", + "rootDir": "." + }, + "references": [ + { "path": "../harp-utils/tsconfig-build.json" }, + { "path": "../harp-materials/tsconfig-build.json" } + ], + "exclude": ["test/**/*.ts"] +} diff --git a/@here/harp-lines/tsconfig.json b/@here/harp-lines/tsconfig.json index acc0124c45..bb1756aca7 100644 --- a/@here/harp-lines/tsconfig.json +++ b/@here/harp-lines/tsconfig.json @@ -1,14 +1,19 @@ { + "extends": "../../tsconfig-common.json", "compilerOptions": { - "target": "es2017", - "module": "commonjs", - "sourceMap": true, - "declaration": true, - "strictNullChecks": true, - "noImplicitAny": true, - "noImplicitReturns": true, - "noImplicitThis": true, - "noUnusedLocals": false, - "downlevelIteration": true - } + "rootDir": ".", + "noEmit": true + }, + "include": [ + "lib/**/*.ts", + "index.ts" + ], + "references": [ + { + "path": "../harp-materials" + } + ], + "exclude": [ + "test/**/*.ts" + ] } diff --git a/@here/harp-lrucache/test/tsconfig-build.json b/@here/harp-lrucache/test/tsconfig-build.json new file mode 100644 index 0000000000..6d69f03e94 --- /dev/null +++ b/@here/harp-lrucache/test/tsconfig-build.json @@ -0,0 +1,11 @@ +{ + "extends": "../../../tsconfig.settings.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "." + }, + "references": [ + { "path": "../tsconfig-build.json" }, + { "path": "../../harp-utils/tsconfig-build.json" } + ] +} diff --git a/@here/harp-lrucache/tsconfig-build.json b/@here/harp-lrucache/tsconfig-build.json new file mode 100644 index 0000000000..537e77a94e --- /dev/null +++ b/@here/harp-lrucache/tsconfig-build.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.settings.json", + "compilerOptions": { + "outDir": ".", + "rootDir": "." + }, + "references": [{ "path": "../harp-utils/tsconfig-build.json" }], + "exclude": ["test/**/*.ts"] +} diff --git a/@here/harp-lrucache/tsconfig.json b/@here/harp-lrucache/tsconfig.json index acc0124c45..800c0d7d9c 100644 --- a/@here/harp-lrucache/tsconfig.json +++ b/@here/harp-lrucache/tsconfig.json @@ -1,14 +1,19 @@ { + "extends": "../../tsconfig-common.json", "compilerOptions": { - "target": "es2017", - "module": "commonjs", - "sourceMap": true, - "declaration": true, - "strictNullChecks": true, - "noImplicitAny": true, - "noImplicitReturns": true, - "noImplicitThis": true, - "noUnusedLocals": false, - "downlevelIteration": true - } + "rootDir": ".", + "noEmit": true + }, + "include": [ + "lib/**/*.ts", + "index.ts" + ], + "references": [ + { + "path": "../harp-utils" + } + ], + "exclude": [ + "test/**/*.ts" + ] } diff --git a/@here/harp-map-controls/test/tsconfig-build.json b/@here/harp-map-controls/test/tsconfig-build.json new file mode 100644 index 0000000000..a29db8b81b --- /dev/null +++ b/@here/harp-map-controls/test/tsconfig-build.json @@ -0,0 +1,11 @@ +{ + "extends": "../../../tsconfig.settings.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "." + }, + "references": [ + { "path": "../tsconfig-build.json" }, + { "path": "../../harp-geoutils/tsconfig-build.json" } + ] +} diff --git a/@here/harp-map-controls/tsconfig-build.json b/@here/harp-map-controls/tsconfig-build.json new file mode 100644 index 0000000000..b32c066b97 --- /dev/null +++ b/@here/harp-map-controls/tsconfig-build.json @@ -0,0 +1,13 @@ +{ + "extends": "../../tsconfig.settings.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "." + }, + "references": [ + { "path": "../harp-geoutils/tsconfig-build.json" }, + { "path": "../harp-mapview/tsconfig-build.json" }, + { "path": "../harp-utils/tsconfig-build.json" } + ], + "exclude": ["test/**/*.ts"] +} diff --git a/@here/harp-map-controls/tsconfig.json b/@here/harp-map-controls/tsconfig.json index acc0124c45..ecd36262b8 100644 --- a/@here/harp-map-controls/tsconfig.json +++ b/@here/harp-map-controls/tsconfig.json @@ -1,14 +1,25 @@ { + "extends": "../../tsconfig-common.json", "compilerOptions": { - "target": "es2017", - "module": "commonjs", - "sourceMap": true, - "declaration": true, - "strictNullChecks": true, - "noImplicitAny": true, - "noImplicitReturns": true, - "noImplicitThis": true, - "noUnusedLocals": false, - "downlevelIteration": true - } + "rootDir": ".", + "noEmit": true + }, + "include": [ + "lib/**/*.ts", + "index.ts" + ], + "references": [ + { + "path": "../harp-geoutils" + }, + { + "path": "../harp-mapview" + }, + { + "path": "../harp-utils" + } + ], + "exclude": [ + "test/**/*.ts" + ] } diff --git a/@here/harp-map-theme/tsconfig.json b/@here/harp-map-theme/tsconfig.json index acc0124c45..7bf13c86d7 100644 --- a/@here/harp-map-theme/tsconfig.json +++ b/@here/harp-map-theme/tsconfig.json @@ -1,14 +1,14 @@ { + "extends": "../../tsconfig-common.json", "compilerOptions": { - "target": "es2017", - "module": "commonjs", - "sourceMap": true, - "declaration": true, - "strictNullChecks": true, - "noImplicitAny": true, - "noImplicitReturns": true, - "noImplicitThis": true, - "noUnusedLocals": false, - "downlevelIteration": true - } + "rootDir": ".", + "noEmit": true + }, + "include": [ + "lib/**/*.ts", + "index.ts" + ], + "exclude": [ + "test/**/*.ts" + ] } diff --git a/@here/harp-mapview-decoder/test/tsconfig-build.json b/@here/harp-mapview-decoder/test/tsconfig-build.json new file mode 100644 index 0000000000..f9716329dd --- /dev/null +++ b/@here/harp-mapview-decoder/test/tsconfig-build.json @@ -0,0 +1,11 @@ +{ + "extends": "../../../tsconfig.settings.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "." + }, + "references": [ + { "path": "../tsconfig-build.json" }, + { "path": "../../harp-test-utils/tsconfig-build.json" } + ] +} diff --git a/@here/harp-mapview-decoder/tsconfig-build.json b/@here/harp-mapview-decoder/tsconfig-build.json new file mode 100644 index 0000000000..8729c0af1d --- /dev/null +++ b/@here/harp-mapview-decoder/tsconfig-build.json @@ -0,0 +1,16 @@ +{ + "extends": "../../tsconfig.settings.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "." + }, + "references": [ + { "path": "../harp-datasource-protocol/tsconfig-build.json" }, + { "path": "../harp-fetch/tsconfig-build.json" }, + { "path": "../harp-geoutils/tsconfig-build.json" }, + { "path": "../harp-mapview/tsconfig-build.json" }, + { "path": "../harp-utils/tsconfig-build.json" }, + { "path": "../harp-test-utils/tsconfig-build.json" } + ], + "exclude": ["test/**/*.ts"] +} diff --git a/@here/harp-mapview-decoder/tsconfig.json b/@here/harp-mapview-decoder/tsconfig.json index acc0124c45..37eb94b63c 100644 --- a/@here/harp-mapview-decoder/tsconfig.json +++ b/@here/harp-mapview-decoder/tsconfig.json @@ -1,14 +1,34 @@ { + "extends": "../../tsconfig-common.json", "compilerOptions": { - "target": "es2017", - "module": "commonjs", - "sourceMap": true, - "declaration": true, - "strictNullChecks": true, - "noImplicitAny": true, - "noImplicitReturns": true, - "noImplicitThis": true, - "noUnusedLocals": false, - "downlevelIteration": true - } + "rootDir": ".", + "noEmit": true + }, + "include": [ + "lib/**/*.ts", + "index.ts" + ], + "references": [ + { + "path": "../harp-datasource-protocol" + }, + { + "path": "../harp-fetch" + }, + { + "path": "../harp-geoutils" + }, + { + "path": "../harp-lrucache" + }, + { + "path": "../harp-mapview" + }, + { + "path": "../harp-utils" + } + ], + "exclude": [ + "test/**/*.ts" + ] } diff --git a/@here/harp-mapview/lib/ElevationRangeSource.ts b/@here/harp-mapview/lib/ElevationRangeSource.ts index 309bb340d1..9f6c4265a0 100644 --- a/@here/harp-mapview/lib/ElevationRangeSource.ts +++ b/@here/harp-mapview/lib/ElevationRangeSource.ts @@ -4,8 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { TilingScheme } from "@here/harp-geoutils"; -import { TileKey } from "@here/harp-geoutils/lib/tiling/TileKey"; +import { TileKey, TilingScheme } from "@here/harp-geoutils"; /** * Status of the elevation range calculation. diff --git a/@here/harp-mapview/test/tsconfig-build.json b/@here/harp-mapview/test/tsconfig-build.json new file mode 100644 index 0000000000..f9716329dd --- /dev/null +++ b/@here/harp-mapview/test/tsconfig-build.json @@ -0,0 +1,11 @@ +{ + "extends": "../../../tsconfig.settings.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "." + }, + "references": [ + { "path": "../tsconfig-build.json" }, + { "path": "../../harp-test-utils/tsconfig-build.json" } + ] +} diff --git a/@here/harp-mapview/tsconfig-build.json b/@here/harp-mapview/tsconfig-build.json new file mode 100644 index 0000000000..bbd4121ecc --- /dev/null +++ b/@here/harp-mapview/tsconfig-build.json @@ -0,0 +1,18 @@ +{ + "extends": "../../tsconfig.settings.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "." + }, + "references": [ + { "path": "../harp-datasource-protocol/tsconfig-build.json" }, + { "path": "../harp-fetch/tsconfig-build.json" }, + { "path": "../harp-geoutils/tsconfig-build.json" }, + { "path": "../harp-lines/tsconfig-build.json" }, + { "path": "../harp-lrucache/tsconfig-build.json" }, + { "path": "../harp-materials/tsconfig-build.json" }, + { "path": "../harp-text-canvas/tsconfig-build.json" }, + { "path": "../harp-utils/tsconfig-build.json" } + ], + "exclude": ["test/**/*.ts"] +} diff --git a/@here/harp-mapview/tsconfig.json b/@here/harp-mapview/tsconfig.json index acc0124c45..62a2b29e4a 100644 --- a/@here/harp-mapview/tsconfig.json +++ b/@here/harp-mapview/tsconfig.json @@ -1,14 +1,46 @@ { + "extends": "../../tsconfig-common.json", "compilerOptions": { - "target": "es2017", - "module": "commonjs", - "sourceMap": true, - "declaration": true, - "strictNullChecks": true, - "noImplicitAny": true, - "noImplicitReturns": true, - "noImplicitThis": true, - "noUnusedLocals": false, - "downlevelIteration": true - } + "rootDir": ".", + "noEmit": true + }, + "include": [ + "lib/**/*.ts", + "index.ts" + ], + "references": [ + { + "path": "../harp-datasource-protocol" + }, + { + "path": "../harp-fetch" + }, + { + "path": "../harp-geometry" + }, + { + "path": "../harp-geoutils" + }, + { + "path": "../harp-lines" + }, + { + "path": "../harp-lrucache" + }, + { + "path": "../harp-materials" + }, + { + "path": "../harp-text-canvas" + }, + { + "path": "../harp-transfer-manager" + }, + { + "path": "../harp-utils" + } + ], + "exclude": [ + "test/**/*.ts" + ] } diff --git a/@here/harp-materials/lib/MapMeshMaterials.ts b/@here/harp-materials/lib/MapMeshMaterials.ts index 364f535997..3ec303c7f9 100644 --- a/@here/harp-materials/lib/MapMeshMaterials.ts +++ b/@here/harp-materials/lib/MapMeshMaterials.ts @@ -689,7 +689,8 @@ export namespace ExtrusionFeature { * * @see [[Tile#addRenderHelper]] */ -export class ExtrusionFeatureMixin implements ExtrusionFeature { + +class ExtrusionFeatureMixin implements ExtrusionFeature { needsUpdate?: boolean; uniformsNeedUpdate?: boolean; private m_extrusion: number = ExtrusionFeature.DEFAULT_RATIO_MAX; diff --git a/@here/harp-materials/tsconfig-build.json b/@here/harp-materials/tsconfig-build.json new file mode 100644 index 0000000000..537e77a94e --- /dev/null +++ b/@here/harp-materials/tsconfig-build.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.settings.json", + "compilerOptions": { + "outDir": ".", + "rootDir": "." + }, + "references": [{ "path": "../harp-utils/tsconfig-build.json" }], + "exclude": ["test/**/*.ts"] +} diff --git a/@here/harp-materials/tsconfig.json b/@here/harp-materials/tsconfig.json index acc0124c45..ac0b5707e9 100644 --- a/@here/harp-materials/tsconfig.json +++ b/@here/harp-materials/tsconfig.json @@ -1,14 +1,19 @@ { + "extends": "../../tsconfig-common.json", "compilerOptions": { - "target": "es2017", - "module": "commonjs", - "sourceMap": true, - "declaration": true, - "strictNullChecks": true, - "noImplicitAny": true, - "noImplicitReturns": true, - "noImplicitThis": true, - "noUnusedLocals": false, - "downlevelIteration": true - } + "rootDir": ".", + "noEmit": true + }, + "include": [ + "lib/**/*.ts", + "index.ts" + ], + "references": [ + { + "path": "../harp-datasource-protocol" + }, + { + "path": "../harp-utils" + } + ] } diff --git a/@here/harp-olp-utils/tsconfig.json b/@here/harp-olp-utils/tsconfig.json index acc0124c45..d78be6f182 100644 --- a/@here/harp-olp-utils/tsconfig.json +++ b/@here/harp-olp-utils/tsconfig.json @@ -1,14 +1,22 @@ { + "extends": "../../tsconfig-common.json", "compilerOptions": { - "target": "es2017", - "module": "commonjs", - "sourceMap": true, - "declaration": true, - "strictNullChecks": true, - "noImplicitAny": true, - "noImplicitReturns": true, - "noImplicitThis": true, - "noUnusedLocals": false, - "downlevelIteration": true - } + "rootDir": ".", + "noEmit": true + }, + "include": [ + "lib/**/*.ts", + "index.ts" + ], + "references": [ + { + "path": "../harp-geoutils" + }, + { + "path": "../harp-mapview" + }, + { + "path": "../harp-mapview-decoder" + } + ] } diff --git a/@here/harp-omv-datasource/lib/OmvDebugLabelsTile.ts b/@here/harp-omv-datasource/lib/OmvDebugLabelsTile.ts index 84d8c96a2c..2cebdfbc5c 100644 --- a/@here/harp-omv-datasource/lib/OmvDebugLabelsTile.ts +++ b/@here/harp-omv-datasource/lib/OmvDebugLabelsTile.ts @@ -4,7 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ import { getPropertyValue, isTextTechnique } from "@here/harp-datasource-protocol"; -import { TileKey } from "@here/harp-geoutils/lib/tiling/TileKey"; import { DataSource, TextElement } from "@here/harp-mapview"; import { debugContext } from "@here/harp-mapview/lib/DebugContext"; import { @@ -15,6 +14,7 @@ import { } from "@here/harp-text-canvas"; import * as THREE from "three"; +import { TileKey } from "@here/harp-geoutils"; import { TileGeometryCreator } from "@here/harp-mapview/lib/geometry/TileGeometryCreator"; import { OmvTile } from "./OmvTile"; diff --git a/@here/harp-omv-datasource/test/tsconfig-build.json b/@here/harp-omv-datasource/test/tsconfig-build.json new file mode 100644 index 0000000000..469bfcb270 --- /dev/null +++ b/@here/harp-omv-datasource/test/tsconfig-build.json @@ -0,0 +1,12 @@ +{ + "extends": "../../../tsconfig.settings.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "." + }, + "references": [ + { "path": "../tsconfig-build.json" }, + { "path": "../../harp-geoutils/tsconfig-build.json" }, + { "path": "../../harp-mapview-decoder/tsconfig-build.json" } + ] +} diff --git a/@here/harp-omv-datasource/tsconfig-build.json b/@here/harp-omv-datasource/tsconfig-build.json new file mode 100644 index 0000000000..f5a8122657 --- /dev/null +++ b/@here/harp-omv-datasource/tsconfig-build.json @@ -0,0 +1,20 @@ +{ + "extends": "../../tsconfig.settings.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "." + }, + "references": [ + { "path": "../harp-datasource-protocol/tsconfig-build.json" }, + { "path": "../harp-fetch/tsconfig-build.json" }, + { "path": "../harp-geoutils/tsconfig-build.json" }, + { "path": "../harp-lines/tsconfig-build.json" }, + { "path": "../harp-lrucache/tsconfig-build.json" }, + { "path": "../harp-mapview/tsconfig-build.json" }, + { "path": "../harp-mapview-decoder/tsconfig-build.json" }, + { "path": "../harp-transfer-manager/tsconfig-build.json" }, + { "path": "../harp-utils/tsconfig-build.json" }, + { "path": "../harp-geometry/tsconfig-build.json" } + ], + "exclude": ["test/**/*.ts"] +} diff --git a/@here/harp-omv-datasource/tsconfig.json b/@here/harp-omv-datasource/tsconfig.json index acc0124c45..672ceb927a 100644 --- a/@here/harp-omv-datasource/tsconfig.json +++ b/@here/harp-omv-datasource/tsconfig.json @@ -1,14 +1,46 @@ { + "extends": "../../tsconfig-common.json", "compilerOptions": { - "target": "es2017", - "module": "commonjs", - "sourceMap": true, - "declaration": true, - "strictNullChecks": true, - "noImplicitAny": true, - "noImplicitReturns": true, - "noImplicitThis": true, - "noUnusedLocals": false, - "downlevelIteration": true - } + "rootDir": ".", + "noEmit": true + }, + "include": [ + "lib/**/*.ts", + "index.ts" + ], + "references": [ + { + "path": "../harp-datasource-protocol" + }, + { + "path": "../harp-geometry" + }, + { + "path": "../harp-geoutils" + }, + { + "path": "../harp-lines" + }, + { + "path": "../harp-lrucache" + }, + { + "path": "../harp-mapview" + }, + { + "path": "../harp-mapview-decoder" + }, + { + "path": "../harp-text-canvas" + }, + { + "path": "../harp-transfer-manager" + }, + { + "path": "../harp-utils" + } + ], + "exclude": [ + "test/**/*.ts" + ] } diff --git a/@here/harp-test-utils/test/tsconfig-build.json b/@here/harp-test-utils/test/tsconfig-build.json new file mode 100644 index 0000000000..88e7c082d7 --- /dev/null +++ b/@here/harp-test-utils/test/tsconfig-build.json @@ -0,0 +1,8 @@ +{ + "extends": "../../../tsconfig.settings.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "." + }, + "references": [{ "path": "../tsconfig-build.json" }] +} diff --git a/@here/harp-test-utils/tsconfig-build.json b/@here/harp-test-utils/tsconfig-build.json new file mode 100644 index 0000000000..537e77a94e --- /dev/null +++ b/@here/harp-test-utils/tsconfig-build.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.settings.json", + "compilerOptions": { + "outDir": ".", + "rootDir": "." + }, + "references": [{ "path": "../harp-utils/tsconfig-build.json" }], + "exclude": ["test/**/*.ts"] +} diff --git a/@here/harp-test-utils/tsconfig.json b/@here/harp-test-utils/tsconfig.json index acc0124c45..7bf13c86d7 100644 --- a/@here/harp-test-utils/tsconfig.json +++ b/@here/harp-test-utils/tsconfig.json @@ -1,14 +1,14 @@ { + "extends": "../../tsconfig-common.json", "compilerOptions": { - "target": "es2017", - "module": "commonjs", - "sourceMap": true, - "declaration": true, - "strictNullChecks": true, - "noImplicitAny": true, - "noImplicitReturns": true, - "noImplicitThis": true, - "noUnusedLocals": false, - "downlevelIteration": true - } + "rootDir": ".", + "noEmit": true + }, + "include": [ + "lib/**/*.ts", + "index.ts" + ], + "exclude": [ + "test/**/*.ts" + ] } diff --git a/@here/harp-text-canvas/test/tsconfig-build.json b/@here/harp-text-canvas/test/tsconfig-build.json new file mode 100644 index 0000000000..f9716329dd --- /dev/null +++ b/@here/harp-text-canvas/test/tsconfig-build.json @@ -0,0 +1,11 @@ +{ + "extends": "../../../tsconfig.settings.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "." + }, + "references": [ + { "path": "../tsconfig-build.json" }, + { "path": "../../harp-test-utils/tsconfig-build.json" } + ] +} diff --git a/@here/harp-text-canvas/tsconfig-build.json b/@here/harp-text-canvas/tsconfig-build.json new file mode 100644 index 0000000000..654e2010c5 --- /dev/null +++ b/@here/harp-text-canvas/tsconfig-build.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.settings.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "." + }, + "references": [{ "path": "../harp-lrucache/tsconfig-build.json" }], + "exclude": ["test/**/*.ts"] +} diff --git a/@here/harp-text-canvas/tsconfig.json b/@here/harp-text-canvas/tsconfig.json index acc0124c45..43837b7a15 100644 --- a/@here/harp-text-canvas/tsconfig.json +++ b/@here/harp-text-canvas/tsconfig.json @@ -1,14 +1,19 @@ { + "extends": "../../tsconfig-common.json", "compilerOptions": { - "target": "es2017", - "module": "commonjs", - "sourceMap": true, - "declaration": true, - "strictNullChecks": true, - "noImplicitAny": true, - "noImplicitReturns": true, - "noImplicitThis": true, - "noUnusedLocals": false, - "downlevelIteration": true - } + "rootDir": ".", + "noEmit": true + }, + "include": [ + "lib/**/*.ts", + "index.ts" + ], + "references": [ + { + "path": "../harp-lrucache" + } + ], + "exclude": [ + "test/**/*.ts" + ] } diff --git a/@here/harp-transfer-manager/test/tsconfig-build.json b/@here/harp-transfer-manager/test/tsconfig-build.json new file mode 100644 index 0000000000..88e7c082d7 --- /dev/null +++ b/@here/harp-transfer-manager/test/tsconfig-build.json @@ -0,0 +1,8 @@ +{ + "extends": "../../../tsconfig.settings.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "." + }, + "references": [{ "path": "../tsconfig-build.json" }] +} diff --git a/@here/harp-transfer-manager/tsconfig-build.json b/@here/harp-transfer-manager/tsconfig-build.json new file mode 100644 index 0000000000..f5bbc9217d --- /dev/null +++ b/@here/harp-transfer-manager/tsconfig-build.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.settings.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "." + }, + "references": [{ "path": "../harp-fetch/tsconfig-build.json" }], + "exclude": ["test/**/*.ts"] +} diff --git a/@here/harp-transfer-manager/tsconfig.json b/@here/harp-transfer-manager/tsconfig.json index acc0124c45..4bfed5ff97 100644 --- a/@here/harp-transfer-manager/tsconfig.json +++ b/@here/harp-transfer-manager/tsconfig.json @@ -1,14 +1,19 @@ { + "extends": "../../tsconfig-common.json", "compilerOptions": { - "target": "es2017", - "module": "commonjs", - "sourceMap": true, - "declaration": true, - "strictNullChecks": true, - "noImplicitAny": true, - "noImplicitReturns": true, - "noImplicitThis": true, - "noUnusedLocals": false, - "downlevelIteration": true - } + "rootDir": ".", + "noEmit": true + }, + "include": [ + "lib/**/*.ts", + "index.ts" + ], + "references": [ + { + "path": "../harp-fetch" + } + ], + "exclude": [ + "test/**/*.ts" + ] } diff --git a/@here/harp-utils/.npmignore b/@here/harp-utils/.npmignore index e6c8306524..3d5b88aee2 100644 --- a/@here/harp-utils/.npmignore +++ b/@here/harp-utils/.npmignore @@ -1,7 +1,10 @@ *.ts !*.d.ts +dist/cjs/**/*.d.ts test/ -tsconfig.json +tsconfig*.tsbuildinfo +tsconfig*.json +.yarnrc .gitignore .gitreview *.tgz diff --git a/@here/harp-utils/package.json b/@here/harp-utils/package.json index 422af7120a..9d4a8630dc 100644 --- a/@here/harp-utils/package.json +++ b/@here/harp-utils/package.json @@ -2,11 +2,16 @@ "name": "@here/harp-utils", "version": "0.11.1", "description": "Provides utilities: logging, debugging.", - "main": "index.js", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "exports": { + ".": "dist/esm/index.js" + }, + "typings": "dist/esm/index", "scripts": { - "build": "tsc", + "build": "tsc -b tsconfig-cjs.json && tsc -b tsconfig-esm.json", "test": "cross-env mocha --require source-map-support/register $EXTRA_MOCHA_ARGS ./test/*.js", - "prepare": "cross-env tsc --sourceMap false $EXTRA_TSC_ARGS" + "prepare": "cross-env tsc -b tsconfig-cjs.json $EXTRA_TSC_ARGS && cross-env tsc -b tsconfig-esm.json $EXTRA_TSC_ARGS" }, "repository": { "type": "git", diff --git a/@here/harp-utils/test/tsconfig-build.json b/@here/harp-utils/test/tsconfig-build.json new file mode 100644 index 0000000000..88e7c082d7 --- /dev/null +++ b/@here/harp-utils/test/tsconfig-build.json @@ -0,0 +1,8 @@ +{ + "extends": "../../../tsconfig.settings.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "." + }, + "references": [{ "path": "../tsconfig-build.json" }] +} diff --git a/@here/harp-utils/tsconfig-build.json b/@here/harp-utils/tsconfig-build.json new file mode 100644 index 0000000000..204802c5ce --- /dev/null +++ b/@here/harp-utils/tsconfig-build.json @@ -0,0 +1,8 @@ +{ + "extends": "../../tsconfig.settings.json", + "compilerOptions": { + "outDir": ".", + "rootDir": "." + }, + "exclude": ["test/**/*.ts"] +} diff --git a/@here/harp-utils/tsconfig-cjs.json b/@here/harp-utils/tsconfig-cjs.json new file mode 100644 index 0000000000..4cc9cd76a4 --- /dev/null +++ b/@here/harp-utils/tsconfig-cjs.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./dist/cjs", + "target": "esnext", + "module": "commonjs", + "sourceMap": false, + "rootDir": ".", + "noEmit": false + } +} diff --git a/@here/harp-utils/tsconfig-esm.json b/@here/harp-utils/tsconfig-esm.json new file mode 100644 index 0000000000..5d022a056b --- /dev/null +++ b/@here/harp-utils/tsconfig-esm.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./dist/esm", + "target": "esnext", + "module": "esnext", + "rootDir": ".", + "noEmit": false, + "sourceMap": false + } +} diff --git a/@here/harp-utils/tsconfig.json b/@here/harp-utils/tsconfig.json index acc0124c45..7bf13c86d7 100644 --- a/@here/harp-utils/tsconfig.json +++ b/@here/harp-utils/tsconfig.json @@ -1,14 +1,14 @@ { + "extends": "../../tsconfig-common.json", "compilerOptions": { - "target": "es2017", - "module": "commonjs", - "sourceMap": true, - "declaration": true, - "strictNullChecks": true, - "noImplicitAny": true, - "noImplicitReturns": true, - "noImplicitThis": true, - "noUnusedLocals": false, - "downlevelIteration": true - } + "rootDir": ".", + "noEmit": true + }, + "include": [ + "lib/**/*.ts", + "index.ts" + ], + "exclude": [ + "test/**/*.ts" + ] } diff --git a/@here/harp-webtile-datasource/test/tsconfig-build.json b/@here/harp-webtile-datasource/test/tsconfig-build.json new file mode 100644 index 0000000000..88e7c082d7 --- /dev/null +++ b/@here/harp-webtile-datasource/test/tsconfig-build.json @@ -0,0 +1,8 @@ +{ + "extends": "../../../tsconfig.settings.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "." + }, + "references": [{ "path": "../tsconfig-build.json" }] +} diff --git a/@here/harp-webtile-datasource/tsconfig-build.json b/@here/harp-webtile-datasource/tsconfig-build.json new file mode 100644 index 0000000000..bd81ffd998 --- /dev/null +++ b/@here/harp-webtile-datasource/tsconfig-build.json @@ -0,0 +1,13 @@ +{ + "extends": "../../tsconfig.settings.json", + "compilerOptions": { + "outDir": ".", + "rootDir": "." + }, + "references": [ + { "path": "../harp-geoutils/tsconfig-build.json" }, + { "path": "../harp-mapview/tsconfig-build.json" }, + { "path": "../harp-utils/tsconfig-build.json" } + ], + "exclude": ["test/**/*.ts"] +} diff --git a/@here/harp-webtile-datasource/tsconfig.json b/@here/harp-webtile-datasource/tsconfig.json index acc0124c45..c8b22bab4b 100644 --- a/@here/harp-webtile-datasource/tsconfig.json +++ b/@here/harp-webtile-datasource/tsconfig.json @@ -1,14 +1,34 @@ { + "extends": "../../tsconfig-common.json", "compilerOptions": { - "target": "es2017", - "module": "commonjs", - "sourceMap": true, - "declaration": true, - "strictNullChecks": true, - "noImplicitAny": true, - "noImplicitReturns": true, - "noImplicitThis": true, - "noUnusedLocals": false, - "downlevelIteration": true - } + "rootDir": ".", + "noEmit": true + }, + "include": [ + "lib/**/*.ts", + "index.ts" + ], + "references": [ + { + "path": "../harp-datasource-protocol" + }, + { + "path": "../harp-geometry" + }, + { + "path": "../harp-geoutils" + }, + { + "path": "../harp-lrucache" + }, + { + "path": "../harp-mapview" + }, + { + "path": "../harp-utils" + } + ], + "exclude": [ + "test/**/*.ts" + ] } diff --git a/@here/harp.gl/package.json b/@here/harp.gl/package.json index d6ec345d1b..1946b1c4f1 100644 --- a/@here/harp.gl/package.json +++ b/@here/harp.gl/package.json @@ -48,7 +48,7 @@ "@here/harp-text-canvas": "^0.11.1", "@here/harp-utils": "^0.11.1", "@here/harp-webtile-datasource": "^0.11.1", - "ts-loader": "^6.0.3", + "ts-loader": "^6.2.1", "typescript": "^3.7.2", "webpack": "^4.34.0", "webpack-cli": "^3.3.4", diff --git a/@here/harp.gl/tsconfig-build.json b/@here/harp.gl/tsconfig-build.json new file mode 100644 index 0000000000..c86f445828 --- /dev/null +++ b/@here/harp.gl/tsconfig-build.json @@ -0,0 +1,21 @@ +{ + "extends": "../../tsconfig.settings.json", + "compilerOptions": { + "outDir": ".", + "rootDir": "." + }, + "references": [ + { "path": "../harp-datasource-protocol/tsconfig-build.json" }, + { "path": "../harp-debug-datasource/tsconfig-build.json" }, + { "path": "../harp-features-datasource/tsconfig-build.json" }, + { "path": "../harp-geojson-datasource/tsconfig-build.json" }, + { "path": "../harp-geoutils/tsconfig-build.json" }, + { "path": "../harp-map-controls/tsconfig-build.json" }, + { "path": "../harp-mapview/tsconfig-build.json" }, + { "path": "../harp-mapview-decoder/tsconfig-build.json" }, + { "path": "../harp-omv-datasource/tsconfig-build.json" }, + { "path": "../harp-utils/tsconfig-build.json" }, + { "path": "../harp-webtile-datasource/tsconfig-build.json" } + ], + "exclude": ["test/**/*.ts"] +} diff --git a/@here/harp.gl/tsconfig-custom.json b/@here/harp.gl/tsconfig-custom.json new file mode 100644 index 0000000000..4a0d4f3ddd --- /dev/null +++ b/@here/harp.gl/tsconfig-custom.json @@ -0,0 +1,16 @@ +{ + "include": ["lib/**/*.ts"], + "references": [ + { "path": "../harp-datasource-protocol" }, + { "path": "../harp-debug-datasource" }, + { "path": "../harp-features-datasource" }, + { "path": "../harp-geojson-datasource" }, + { "path": "../harp-geoutils" }, + { "path": "../harp-map-controls" }, + { "path": "../harp-mapview" }, + { "path": "../harp-mapview-decoder" }, + { "path": "../harp-omv-datasource" }, + { "path": "../harp-utils" }, + { "path": "../harp-webtile-datasource" } + ] +} diff --git a/@here/harp.gl/tsconfig.json b/@here/harp.gl/tsconfig.json index 4dc0c8c7d6..9a5c2e5d51 100644 --- a/@here/harp.gl/tsconfig.json +++ b/@here/harp.gl/tsconfig.json @@ -1,14 +1,11 @@ { + "extends": "../../tsconfig-common.json", "compilerOptions": { - "target": "es2017", - "module": "commonjs", - "sourceMap": true, - "declaration": false, - "strictNullChecks": true, - "noImplicitAny": true, - "noImplicitReturns": true, - "noImplicitThis": true, - "noUnusedLocals": false, - "downlevelIteration": true - } + "rootDir": ".", + "noEmit": true + }, + "include": [ + "lib/**/*.ts", + "index.ts" + ] } diff --git a/@here/harp.gl/webpack.config.js b/@here/harp.gl/webpack.config.js index b446f03467..d4e0e461e9 100644 --- a/@here/harp.gl/webpack.config.js +++ b/@here/harp.gl/webpack.config.js @@ -23,15 +23,12 @@ const commonConfig = { loader: "ts-loader", exclude: /node_modules/, options: { - onlyCompileBundledFiles: true, - // use the main tsconfig.json for all compilation - // configFile: path.join(process.cwd(), "tsconfig.json"), - configFile: fs.existsSync("../../tsconfig.json") - ? path.resolve(__dirname, "../../tsconfig.json") - : path.resolve(__dirname, "./tsconfig.json"), - compilerOptions: { - declaration: false - } + projectReferences: true, + configFile: path.join(__dirname, "tsconfig-cjs.json"), + //compilerOptions: { + // incremental: true + //}, + //experimentalWatchApi: true } } ] @@ -40,8 +37,8 @@ const commonConfig = { new webpack.EnvironmentPlugin({ // default NODE_ENV to development. Override by setting the environment variable NODE_ENV to 'production' NODE_ENV: process.env.NODE_ENV || "development" - }), - new HardSourceWebpackPlugin() + }) + //new HardSourceWebpackPlugin() ], performance: { hints: false diff --git a/package.json b/package.json index 02f60ea404..9d708f954f 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "@strictsoftware/typedoc-plugin-monorepo": "^0.2.1", "@types/chai": "^4.2.2", "@types/fs-extra": "^8.0.0", + "@types/lodash": "^4.14.149", "chai": "^4.2.0", "chromedriver": "^78.0.0", "commander": "^4.0.1", @@ -18,6 +19,7 @@ "geckodriver": "^1.16.2", "glob": "^7.1.4", "hard-source-webpack-plugin": "^0.13.1", + "lodash": "^4.17.15", "mkpath": "^1.0.0", "mocha": "^6.1.4", "mocha-webdriver-runner": "^0.5.3", @@ -42,7 +44,7 @@ "cov-test": "nyc mocha -r ts-node/register ./@here/*/test/*.ts", "cov-report-html": "nyc report --reporter=html", "start": "ts-node ./scripts/credentials.ts -- . && webpack-dev-server -d --config @here/harp-examples/webpack.config.js", - "build": "npm run build-bundle && npm run build-examples", + "build": "yarn build-bundle && yarn build-examples", "build-examples": "ts-node ./scripts/credentials.ts -- dist/examples && webpack -d --config @here/harp-examples/webpack.config.js", "build-bundle": "cd @here/harp.gl && webpack", "start-tests": "webpack-dev-server -d --config webpack.tests.config.js", @@ -53,7 +55,12 @@ "tslint:fix": "tslint --fix --project tsconfig.json", "prettier": "prettier -l \"**/*.ts\" \"**/*.tsx\" \"**/*.json\"", "prettier:fix": "prettier --write \"**/*.ts\" \"**/*.tsx\" \"**/*.json\"", - "postinstall": "ts-node ./scripts/postinstall.ts" + "postinstall": "ts-node ./scripts/postinstall.ts", + "generate-tsconfig": "ts-node ./scripts/generate-tsconfig.ts", + "tsc": "tsc -b ./tsconfig-build.json", + "tsc-examples": "tsc -b ./@here/harp-examples/tsconfig-build.json", + "tsc-sdk": "tsc -b ./tsconfig-build-sdk.json", + "tsc-tests": "tsc -b ./tsconfig-build-tests.json" }, "engines": { "node": ">=10.5.0", diff --git a/scripts/generate-tsconfig.ts b/scripts/generate-tsconfig.ts new file mode 100644 index 0000000000..61a730b595 --- /dev/null +++ b/scripts/generate-tsconfig.ts @@ -0,0 +1,251 @@ +import fs = require("fs"); +import glob = require("glob"); +import _ = require("lodash"); +import path = require("path"); + +interface TsConfig { + extends?: string; + compilerOptions?: any; + references?: any[]; + include?: string[]; + exclude?: string[]; +} + +const tsConfigMainTemplate: TsConfig = { + // tslint:disable-next-line:no-invalid-template-strings + extends: "@monoRepoRoot@/tsconfig-common.json", + compilerOptions: { + rootDir: ".", + noEmit: true + }, + include: ["index*.ts", "lib/**/*.ts", "src/**/*.ts"], + exclude: ["*.d.ts"] +}; + +const tsConfigTestTemplate: TsConfig = { + // tslint:disable-next-line:no-invalid-template-strings + extends: "@monoRepoRoot@/tsconfig-common.json", + compilerOptions: { + rootDir: ".", + outDir: ".", + composite: false, + declaration: false + }, + references: [{ path: "../" }] +}; + +const tsConfigEsmTemplate: TsConfig = { + extends: "./tsconfig.json", + compilerOptions: { + outDir: "./dist/esm", + target: "esnext", + module: "esnext", + rootDir: ".", + noEmit: false, + sourceMap: false + } +}; + +const tsConfigCjsTemplate = { + extends: "./tsconfig.json", + compilerOptions: { + outDir: "./dist/cjs", + target: "esnext", + module: "commonjs", + sourceMap: false, + rootDir: ".", + noEmit: false + } +}; + +/* +const tsConfigUmdTemplate = (packageName: string) => ({ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDie": "./dist", + "outFile": "./dist/${packageName}.js" + "target": "es6", + "module": "", + "rootDir": ".", + "noEmit": false, + "declaration": true + } +}); +*/ + +function loadJsonSync(pathStr: string): any { + return JSON.parse(fs.readFileSync(pathStr, "utf-8")); +} +function jsonStringify(obj: unknown): string { + return JSON.stringify(obj, null, 4) + "\n"; +} + +const monoRepoRoot = path.resolve(__dirname, ".."); +const monoRepoPackageJsonPath = path.join(monoRepoRoot, "package.json"); + +// tslint:disable-next-line:no-var-requires +const monoRepoPackageJson = loadJsonSync(monoRepoPackageJsonPath); + +function resolveRelative(packageFolder: string, pathStr: string): string { + if (pathStr.startsWith("@monoRepoRoot@/")) { + return path.relative(packageFolder, path.join(monoRepoRoot, pathStr.substr(15))); + } + return pathStr; +} + +function createReferecesToLocalProjects( + dependencyNames: string[], + packageFolder: string, + config: TsConfig, + localPackages: Map, + tsConfigname?: string +) { + for (const depName of dependencyNames) { + const localDepPath = localPackages.get(depName); + if (!localDepPath) { + continue; + } + if (!config.references) { + config.references = []; + } + let refPath = path.relative(packageFolder, localDepPath); + if (tsConfigname) { + refPath = path.join(refPath, tsConfigname); + } + config.references.push({ path: refPath }); + } +} + +function generateTsConfigs(packageFolder: string, localPackages: Map) { + const localCustomizations = path.resolve(packageFolder, "tsconfig-custom.json"); + + const packageJsonPath = path.join(packageFolder, "package.json"); + const packageJson = loadJsonSync(packageJsonPath); + + const tsConfigMain = _.cloneDeep(tsConfigMainTemplate); + const tsConfigEsm = _.cloneDeep(tsConfigEsmTemplate); + const tsConfigCjs = _.cloneDeep(tsConfigCjsTemplate); + + const dependencyNames = + (packageJson.dependencies && Object.keys(packageJson.dependencies)) || []; + + const devDependencyNames = + (packageJson.devDependencies && Object.keys(packageJson.devDependencies)) || []; + if (fs.existsSync(localCustomizations)) { + _.merge(tsConfigMain, loadJsonSync(localCustomizations)); + } + + const dependencies = [...dependencyNames, ...devDependencyNames]; + + // Unfortunately, we have to generate `references` in all configs, because `references` are + // not inherited "by design" (https://github.com/microsoft/TypeScript/issues/27098) + createReferecesToLocalProjects( + dependencies, + packageFolder, + tsConfigCjs, + localPackages, + "tsconfig-cjs.json" + ); + + createReferecesToLocalProjects( + dependencies, + packageFolder, + tsConfigEsm, + localPackages, + "tsconfig-esm.json" + ); + + if (tsConfigMain.extends !== undefined) { + tsConfigMain.extends = resolveRelative(packageFolder, tsConfigMain.extends); + } + + const tsConfigMainPath = path.resolve(packageFolder, "tsconfig.json"); + const tsConfigEsmPath = path.resolve(packageFolder, "tsconfig-esm.json"); + const tsConfigCjsPath = path.resolve(packageFolder, "tsconfig-cjs.json"); + + const packageTestsFolder = path.resolve(packageFolder, "test"); + + if (fs.existsSync(packageTestsFolder)) { + if (!tsConfigMain.exclude) { + tsConfigMain.exclude = []; + } + tsConfigMain.exclude.push("test/**/*.ts"); + const tsConfigCjsPathTests = path.resolve(packageTestsFolder, "tsconfig.json"); + + const tsConfigTests = _.cloneDeep(tsConfigTestTemplate); + + createReferecesToLocalProjects( + dependencies, + packageTestsFolder, + tsConfigTests, + localPackages, + "tsconfig-cjs.json" + ); + if (tsConfigTests.extends !== undefined) { + tsConfigTests.extends = resolveRelative(packageTestsFolder, tsConfigTests.extends); + } + + fs.mkdirSync(packageTestsFolder, { recursive: true }); + fs.writeFileSync(tsConfigCjsPathTests, jsonStringify(tsConfigTests), "utf-8"); + } + + fs.mkdirSync(packageFolder, { recursive: true }); + fs.writeFileSync(tsConfigMainPath, jsonStringify(tsConfigMain), "utf-8"); + fs.writeFileSync(tsConfigEsmPath, jsonStringify(tsConfigEsm), "utf-8"); + fs.writeFileSync(tsConfigCjsPath, jsonStringify(tsConfigCjs), "utf-8"); +} + +/** + * Assuming that we are monorepo, get all packages that are available locally as map `name->path`. + */ +function getLocalPackages(): Map { + const result = new Map(); + result.set(monoRepoPackageJson.name, monoRepoRoot); + if (Array.isArray(monoRepoPackageJson.workspaces)) { + for (const workspaceGlobPattern of monoRepoPackageJson.workspaces) { + const packageFolders = glob.sync(workspaceGlobPattern); + for (const packageFolder of packageFolders) { + const packageJsonPath = path.join(packageFolder, "package.json"); + if (!fs.existsSync(packageJsonPath)) { + continue; + } + const packageJson = loadJsonSync(packageJsonPath); + result.set(packageJson.name, path.resolve(monoRepoRoot, packageFolder)); + } + } + } + return result; +} + +export async function generateTsConfig(paths?: string[]) { + if (!paths) { + paths = glob + .sync(path.resolve(__dirname, "../@here/*")) + .filter(dir => { + const packageJsonPath = path.join(dir, "package.json"); + if (!fs.existsSync(packageJsonPath)) { + return false; + } + const packageJson = loadJsonSync(packageJsonPath); + return packageJson.devDependencies && "typescript" in packageJson.devDependencies; + }) + .map(p => path.relative(process.cwd(), p)); + } + const localPackages = getLocalPackages(); + for (const dir of paths) { + // tslint:disable-next-line:no-console + console.error(`generate-tsconfig: generating tsconfig for ${dir}`); + generateTsConfigs(dir, localPackages); + } +} + +if (require.main === module) { + const paths = process.argv.slice(2); + generateTsConfig(paths.length > 0 ? paths : undefined) + .then(() => process.exit(0)) + .catch(error => { + // tslint:disable-next-line:no-console + console.error(`generate-tsconfig: ${error}`, error); + process.exit(1); + }); +} diff --git a/test/tsconfig-build.json b/test/tsconfig-build.json new file mode 100644 index 0000000000..18b5b6cba9 --- /dev/null +++ b/test/tsconfig-build.json @@ -0,0 +1,7 @@ +{ + "extends": "../tsconfig.settings.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "." + } +} diff --git a/tsconfig-build-sdk.json b/tsconfig-build-sdk.json new file mode 100644 index 0000000000..225b0ffed5 --- /dev/null +++ b/tsconfig-build-sdk.json @@ -0,0 +1,28 @@ +{ + "files": [], + "compilerOptions": { + "composite": true + }, + "references": [ + { "path": "@here/harp.gl/tsconfig-build.json" }, + { "path": "@here/harp-datasource-protocol/tsconfig-build.json" }, + { "path": "@here/harp-fetch/tsconfig-build.json" }, + { "path": "@here/harp-debug-datasource/tsconfig-build.json" }, + { "path": "@here/harp-features-datasource/tsconfig-build.json" }, + { "path": "@here/harp-geojson-datasource/tsconfig-build.json" }, + { "path": "@here/harp-geometry/tsconfig-build.json" }, + { "path": "@here/harp-geoutils/tsconfig-build.json" }, + { "path": "@here/harp-lines/tsconfig-build.json" }, + { "path": "@here/harp-lrucache/tsconfig-build.json" }, + { "path": "@here/harp-map-controls/tsconfig-build.json" }, + { "path": "@here/harp-mapview/tsconfig-build.json" }, + { "path": "@here/harp-mapview-decoder/tsconfig-build.json" }, + { "path": "@here/harp-materials/tsconfig-build.json" }, + { "path": "@here/harp-omv-datasource/tsconfig-build.json" }, + { "path": "@here/harp-utils/tsconfig-build.json" }, + { "path": "@here/harp-test-utils/tsconfig-build.json" }, + { "path": "@here/harp-text-canvas/tsconfig-build.json" }, + { "path": "@here/harp-transfer-manager" }, + { "path": "@here/harp-webtile-datasource/tsconfig-build.json" } + ] +} diff --git a/tsconfig-build-tests.json b/tsconfig-build-tests.json new file mode 100644 index 0000000000..69018ddcb8 --- /dev/null +++ b/tsconfig-build-tests.json @@ -0,0 +1,25 @@ +{ + "files": [], + "compilerOptions": { + "composite": true + }, + "references": [ + { "path": "test/tsconfig-build.json" }, + { "path": "@here/harp-datasource-protocol/test/tsconfig-build.json" }, + { "path": "@here/harp-fetch/test/tsconfig-build.json" }, + { "path": "@here/harp-geoutils/test/tsconfig-build.json" }, + { "path": "@here/harp-geojson-datasource/test/tsconfig-build.json" }, + { "path": "@here/harp-geometry/test/tsconfig-build.json" }, + { "path": "@here/harp-lines/test/tsconfig-build.json" }, + { "path": "@here/harp-lrucache/test/tsconfig-build.json" }, + { "path": "@here/harp-map-controls/test/tsconfig-build.json" }, + { "path": "@here/harp-mapview/test/tsconfig-build.json" }, + { "path": "@here/harp-mapview-decoder/test/tsconfig-build.json" }, + { "path": "@here/harp-omv-datasource/test/tsconfig-build.json" }, + { "path": "@here/harp-utils/test/tsconfig-build.json" }, + { "path": "@here/harp-test-utils/test/tsconfig-build.json" }, + { "path": "@here/harp-text-canvas/test/tsconfig-build.json" }, + { "path": "@here/harp-transfer-manager/test/tsconfig-build.json" }, + { "path": "@here/harp-webtile-datasource/test/tsconfig-build.json" } + ] +} diff --git a/tsconfig-build.json b/tsconfig-build.json new file mode 100644 index 0000000000..0c3b932cbc --- /dev/null +++ b/tsconfig-build.json @@ -0,0 +1,8 @@ +{ + "files": [], + "references": [ + { "path": "./tsconfig-build-sdk.json" }, + { "path": "./@here/harp-examples/tsconfig-build.json" }, + { "path": "./tsconfig-build-tests.json" } + ] +} diff --git a/tsconfig-common.json b/tsconfig-common.json new file mode 100644 index 0000000000..6ea21753d4 --- /dev/null +++ b/tsconfig-common.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "target": "es6", + "lib": ["es2017", "dom"], + "module": "commonjs", + "moduleResolution": "node", + "sourceMap": true, + "declaration": true, + "strictNullChecks": true, + "noImplicitAny": true, + "noImplicitReturns": true, + "noImplicitThis": true, + "noUnusedLocals": false, + "downlevelIteration": true, + "composite": true + }, + "exclude": ["*.d.ts"] +} diff --git a/tsconfig.settings.json b/tsconfig.settings.json new file mode 100644 index 0000000000..6ea21753d4 --- /dev/null +++ b/tsconfig.settings.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "target": "es6", + "lib": ["es2017", "dom"], + "module": "commonjs", + "moduleResolution": "node", + "sourceMap": true, + "declaration": true, + "strictNullChecks": true, + "noImplicitAny": true, + "noImplicitReturns": true, + "noImplicitThis": true, + "noUnusedLocals": false, + "downlevelIteration": true, + "composite": true + }, + "exclude": ["*.d.ts"] +} diff --git a/webpack.tests.config.js b/webpack.tests.config.js index c125b4bb3a..6ae8b4709a 100644 --- a/webpack.tests.config.js +++ b/webpack.tests.config.js @@ -21,12 +21,17 @@ const harpFontResourcesPath = path.dirname(require.resolve("@here/harp-fontcatal const allTests = [ ...glob.sync("@here/*/test/**/*.ts"), ...glob.sync("./test/performance/**/*.ts"), - ...glob.sync("./test/rendering/*.ts"), -]; + ...glob.sync("./test/rendering/*.ts") +].filter(name => !name.endsWith(".d.ts")) ; -const unitTests = allTests.filter(name => (name.indexOf("/rendering") === -1 && name.indexOf("/performance/") === -1)); -const performanceTests = allTests.filter(name => name.indexOf("/performance/") > -1); -const renderingTests = allTests.filter(name => name.indexOf("/rendering/") > -1); +const unitTests = allTests.filter( + name => + !name.includes("/rendering") && + !name.includes("/performance/") && + !name.includes("/generator-harp.gl/") +); +const performanceTests = allTests.filter(name => name.includes("/performance/")); +const renderingTests = allTests.filter(name => name.includes("/rendering/")); const browserTestsConfig = { devtool: "source-map", @@ -42,8 +47,8 @@ const browserTestsConfig = { exclude: /node_modules/, options: { onlyCompileBundledFiles: true, - // use the main tsconfig.json for all compilation - configFile: path.resolve(__dirname, "tsconfig.json") + projectReferences: true, + configFile: path.join(__dirname, "tsconfig-build-tests.json") } } ] @@ -111,6 +116,10 @@ const browserTestsConfig = { entrypoints: true, warnings: true }, + watchOptions: { + aggregateTimeout: 300, + poll: 1000 + }, mode: process.env.NODE_ENV || "development" }; diff --git a/yarn.lock b/yarn.lock index 2a7c689f42..109861e8ea 100644 --- a/yarn.lock +++ b/yarn.lock @@ -581,6 +581,11 @@ resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4= +"@types/lodash@^4.14.149": + version "4.14.149" + resolved "https://artifactory.in.here.com/artifactory/api/npm/here-node/@types/lodash/-/lodash-4.14.149.tgz#1342d63d948c6062838fbf961012f74d4e638440" + integrity sha1-E0LWPZSMYGKDj7+WEBL3TU5jhEA= + "@types/long@^4.0.0": version "4.0.0" resolved "https://registry.yarnpkg.com/@types/long/-/long-4.0.0.tgz#719551d2352d301ac8b81db732acb6bdc28dbdef" @@ -1121,7 +1126,7 @@ async-limiter@~1.0.0: resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.1.tgz#dd379e94f0db8310b08291f9d64c3209766617fd" integrity sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ== -async@^2.6.0, async@^2.6.2: +async@^2.5.0, async@^2.6.0, async@^2.6.2: version "2.6.3" resolved "https://registry.yarnpkg.com/async/-/async-2.6.3.tgz#d72625e2344a3656e3a3ad4fa749fa83299d82ff" integrity sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg== @@ -4793,7 +4798,7 @@ loader-runner@^2.4.0: resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.4.0.tgz#ed47066bfe534d7e84c4c7b9998c2a75607d9357" integrity sha512-Jsmr89RcXGIwivFY21FcRrisYZfvLMTWx5kOLc+JTxtpBOG6xML0vzbc6SEQG2FO9/4Fc3wW4LVcB5DmGflaRw== -loader-utils@1.2.3, loader-utils@^1.0.2, loader-utils@^1.2.3: +loader-utils@1.2.3, loader-utils@^1.0.2, loader-utils@^1.1.0, loader-utils@^1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.2.3.tgz#1ff5dc6911c9f0a062531a4c04b609406108c2c7" integrity sha512-fkpz8ejdnEMG3s37wGL07iSBDg99O9D5yflE9RGNH3hRdx9SOwYfnGYdZOUIZitN8E+E2vkq3MUMYMvPYl5ZZA== @@ -7320,6 +7325,14 @@ source-list-map@^2.0.0: resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.1.tgz#3993bd873bfc48479cca9ea3a547835c7c154b34" integrity sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw== +source-map-loader@^0.2.4: + version "0.2.4" + resolved "https://artifactory.in.here.com/artifactory/api/npm/here-node/source-map-loader/-/source-map-loader-0.2.4.tgz#c18b0dc6e23bf66f6792437557c569a11e072271" + integrity sha1-wYsNxuI79m9nkkN1V8VpoR4HInE= + dependencies: + async "^2.5.0" + loader-utils "^1.1.0" + source-map-resolve@^0.5.0: version "0.5.2" resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.2.tgz#72e2cc34095543e43b2c62b2c4c10d4a9054f259" @@ -7983,10 +7996,19 @@ ts-json-schema-generator@^0.56.0: json-stable-stringify "^1.0.1" typescript "~3.7.2" -ts-loader@^6.0.3: +ts-loader@../../../ts-loader: + version "6.2.1" + dependencies: + chalk "^2.3.0" + enhanced-resolve "^4.0.0" + loader-utils "^1.0.2" + micromatch "^4.0.0" + semver "^6.0.0" + +ts-loader@^6.2.1: version "6.2.1" - resolved "https://registry.yarnpkg.com/ts-loader/-/ts-loader-6.2.1.tgz#67939d5772e8a8c6bdaf6277ca023a4812da02ef" - integrity sha512-Dd9FekWuABGgjE1g0TlQJ+4dFUfYGbYcs52/HQObE0ZmUNjQlmLAS7xXsSzy23AMaMwipsx5sNHvoEpT2CZq1g== + resolved "https://artifactory.in.here.com/artifactory/api/npm/here-node/ts-loader/-/ts-loader-6.2.1.tgz#67939d5772e8a8c6bdaf6277ca023a4812da02ef" + integrity sha1-Z5OdV3LoqMa9r2J3ygI6SBLaAu8= dependencies: chalk "^2.3.0" enhanced-resolve "^4.0.0"