diff --git a/.gitignore b/.gitignore index 672e243f1e..ee9a495df4 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,8 @@ doc/ test-npm-packages-app/ .vscode/ .DS_Store - - 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-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-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-examples/package.json b/@here/harp-examples/package.json index aa39659ed5..f5ae8ba18e 100644 --- a/@here/harp-examples/package.json +++ b/@here/harp-examples/package.json @@ -54,10 +54,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": "^0.23.0", "three": "^0.108.0", - "ts-loader": "^6.0.3", + "ts-loader": "^6.2.0", "typescript": "^3.6.3", "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/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..f486c2a308 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: [ 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-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-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-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-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..9ed9f86add --- /dev/null +++ b/@here/harp-geoutils/tsconfig-build.json @@ -0,0 +1,8 @@ +{ + "extends": "../../tsconfig.settings.json", + "compilerOptions": { + "outDir": ".", + "rootDir": "." + }, + "include": ["lib/**/*.ts", "index.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-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-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-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/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-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-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-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-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-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-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-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.gl/package.json b/@here/harp.gl/package.json index 2519db1e6d..6a58902346 100644 --- a/@here/harp.gl/package.json +++ b/@here/harp.gl/package.json @@ -46,7 +46,7 @@ "@here/harp-text-canvas": "^0.10.0", "@here/harp-utils": "^0.10.0", "@here/harp-webtile-datasource": "^0.10.0", - "ts-loader": "^6.0.3", + "ts-loader": "^6.2.0", "typescript": "^3.6.3", "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..2c607dd1bb --- /dev/null +++ b/@here/harp.gl/tsconfig-build.json @@ -0,0 +1,20 @@ +{ + "extends": "../../tsconfig.settings.json", + "compilerOptions": { + "outDir": ".", + "rootDir": "." + }, + "references": [ + { "path": "../harp-datasource-protocol/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/webpack.config.js b/@here/harp.gl/webpack.config.js index b446f03467..07045a7002 100644 --- a/@here/harp.gl/webpack.config.js +++ b/@here/harp.gl/webpack.config.js @@ -11,31 +11,11 @@ const bundleSuffix = isProduction ? ".min" : ""; const commonConfig = { devtool: "source-map", resolve: { - extensions: [".webpack.js", ".web.ts", ".ts", ".tsx", ".web.js", ".js"] + extensions: [".webpack.js", ".web.js", ".js"] }, output: { path: path.join(process.cwd(), "dist") }, - module: { - rules: [ - { - test: /\.tsx?$/, - 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 - } - } - } - ] - }, plugins: [ new webpack.EnvironmentPlugin({ // default NODE_ENV to development. Override by setting the environment variable NODE_ENV to 'production' @@ -50,7 +30,7 @@ const commonConfig = { }; const mapComponentConfig = merge(commonConfig, { - entry: path.resolve(__dirname, "./lib/index.ts"), + entry: path.resolve(__dirname, "./lib/index.js"), output: { filename: `harp${bundleSuffix}.js`, library: "harp" @@ -66,7 +46,7 @@ const mapComponentConfig = merge(commonConfig, { }); const mapComponentDecoderConfig = merge(commonConfig, { - entry: path.resolve(__dirname, "./lib/DecoderBootstrap.ts"), + entry: path.resolve(__dirname, "./lib/DecoderBootstrap.js"), output: { filename: `harp-decoders${bundleSuffix}.js` }, diff --git a/package.json b/package.json index 84ecd2e478..b28f04e5fa 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,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", @@ -52,7 +52,11 @@ "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", + "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/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..43a6063ee7 --- /dev/null +++ b/tsconfig-build-tests.json @@ -0,0 +1,24 @@ +{ + "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-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.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 8b53844be9..a22232cd18 100644 --- a/webpack.tests.config.js +++ b/webpack.tests.config.js @@ -21,26 +21,12 @@ const harpFontResourcesPath = path.dirname(require.resolve("@here/harp-fontcatal const browserTestsConfig = { devtool: "source-map", resolve: { - extensions: [".webpack.js", ".web.ts", ".ts", ".tsx", ".web.js", ".js"], + extensions: [".web.js", ".js"], modules: [".", "node_modules"] }, - module: { - rules: [ - { - test: /\.tsx?$/, - loader: "ts-loader", - exclude: /node_modules/, - options: { - onlyCompileBundledFiles: true, - // use the main tsconfig.json for all compilation - configFile: path.resolve(__dirname, "tsconfig.json") - } - } - ] - }, entry: { - test: glob.sync("@here/*/test/**/*.ts"), - "performance-test": glob.sync("test/performance/**/*.ts") + test: glob.sync("@here/*/test/**/*.js").filter(path => !path.includes("generator-harp.gl")), + "performance-test": glob.sync("test/performance/**/*.js") }, output: { path: path.join(__dirname, "dist/test"), @@ -94,6 +80,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 1ae164159c..0199c8e005 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1041,7 +1041,7 @@ async@^1.5.2: resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" integrity sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo= -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== @@ -7219,6 +7219,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://registry.yarnpkg.com/source-map-loader/-/source-map-loader-0.2.4.tgz#c18b0dc6e23bf66f6792437557c569a11e072271" + integrity sha512-OU6UJUty+i2JDpTItnizPrlpOIBLmQbWMuBg9q5bVtnHACqw1tn9nNwqJLbv0/00JjnJb/Ee5g5WS5vrRv7zIQ== + 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" @@ -7886,10 +7894,10 @@ ts-json-schema-generator@^0.47.0: json-stable-stringify "^1.0.1" typescript "~3.5.2" -ts-loader@^6.0.3: - version "6.1.0" - resolved "https://registry.yarnpkg.com/ts-loader/-/ts-loader-6.1.0.tgz#999cb0a7644f9c7c6c0901802dce50ceb0a76e5b" - integrity sha512-7JedeOu2rsYHQDEr2fwmMozABwbQTZXEaEMZPSIWG7gpzRefOLJCqwdazcegHtyaxp04PeEgs/b0m08WMpnIzQ== +ts-loader@^6.2.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/ts-loader/-/ts-loader-6.2.0.tgz#52d3993ecbc5474c1513242388e1049da0fce880" + integrity sha512-Da8h3fD+HiZ9GvZJydqzk3mTC9nuOKYlJcpuk+Zv6Y1DPaMvBL+56GRzZFypx2cWrZFMsQr869+Ua2slGoLxvQ== dependencies: chalk "^2.3.0" enhanced-resolve "^4.0.0"